content
stringlengths
1
15.9M
\section{Introduction}\label{sec:intro} Genome sequencing methodologies have led to a significant increase in the amount of data to be processed and analyzed by Bioinformatics experiments. Consequently, this led to an increase in the demand for their scalable execution. Most bioinformatics studies aim to extract information from DNA sequences and can be classified as \textit{in silico} experiments. \textit{In silico} comprise mathematical and computational models that simulate real-world situations; they depend on the use of computational resources and specialized technologies for their execution. Simulations often require the composition of several applications, or activities, which have dependencies and manipulate large amounts of data. These aspects make it difficult to manage and control \textit{in silico} experiments. Due to the complexity of simulation-based scientific experiments, it is necessary to use approaches that support their design, execution, and analysis, such as scientific workflows \cite{Deelman2009}. A scientific workflow is an abstraction that formalizes the composition of several activities through data set production and consumption. Each activity corresponds to a computational application, and the dependencies between them represent the execution data flow, in which the output of one activity is input to another. Scientific Workflow Management Systems (SWfMS) can be used to manage the various steps of the life-cycle of a scientific workflow, i.e. design, execution, and analysis. SWfMS can be deployed in high-performance computing (HPC) environments, such as clusters, clouds, or computational grids. They can also capture and store provenance information. Provenance records the process of deriving data from the execution of a workflow. For this reason, provenance describes the history of a given experiment, ensuring its reliability, reproducibility, and reuse \cite{Freire2008}. Provenance may also contain computational and scientific domain data, making it an important resource for the analysis of the computational behavior of an experiment and its scientific results. By combining computational and domain data, it is possible, for example, to make optimizations in the experiment as well as predictions for execution time and the amount of storage that it will require. In this work, we present BioWorkbench: a framework that couples scientific workflow management and provenance data analytics for managing bioinformatics experiments in HPC environments. BioWorkbench integrates a set of tools that cover the process of modeling a bioinformatics experiment, including a provenance data analytics interface, transparently to the user. For managing scientific workflows, we use SWfMS Swift \cite{Wilde2011}, because of the support that the system provides for executing workflows in different HPC environments transparently and also due to its scalability \cite{Wilde2009}. Provenance data related to workflow performance and resulting data associated with the application area of the experiment are automatically collected by the framework. As part of the framework, we have developed a web application where workflow results are presented in a data analytics interface, from the abstraction of a set of queries to the provenance database, supporting the process of analysis by the scientists. We also demonstrate that it is possible to use machine learning techniques to extract relations from provenance data that are not readily detected, as well as to predict and classify the execution time of workflows. In this way, BioWorkbench consolidates various activities related to scientific workflow execution analysis in a single tool. We evaluated the BioWorkbench using three case studies: SwiftPhylo, a phylogenetic tree assembly workflow; SwiftGECKO, a comparative genomics workflow; and RASflow, a RASopathy analysis workflow. Each case study has its own characteristics. However, the three allowed the evaluation of aspects related to performance gains and provenance management covered by our framework. We show results where we obtained a reduction of up to 98.9\% in the total execution time, in the case of SwiftPhylo, decreasing from $\sim$13.35 hours to $\sim$8 minutes. Also, we demonstrate that with the provenance collected through the framework, we can provide useful results to the user who does not need to inspect files manually to extract this information. \section{Related Work}\label{sec:related} In general, our proposal addresses aspects related to the modeling of bioinformatics workflows, their parallel execution in high-performance computing environments, as well as provenance data analytics, including predictions on computational resource usage. Here we compare BioWorkbench to related solutions from these different points of view. There are a variety of SWfMS for modeling and executing workflows in different application areas. Some of them allow execution in high-performance computing environments. Among them, we highlight Pegasus~\cite{Deelman2015}, which enables the specification of workflows through the XML format. The provenance is managed through the Wings/Pegasus framework \cite{Wings2008}, and can be queried using the SPARQL language. Askalon \cite{Nadeem2007} allows the definition of the workflow through a graphical interface, using UML diagrams or the XML format. Workflow performance monitoring information is used by a service that supports planning the execution of activities. Taverna \cite{Wolstencroft2013} is an SWfMS widely used by the bioinformatics community, where workflow activities usually comprise web services. Parallel execution has an optimization engine that identifies and simplifies complex parts of the workflow structure \cite{Cohen2014}. Provenance is collected and stored in a database and workflows can be shared through the \textit{myExperiment}\footnote {https://www.myexperiment.org/home} platform. With a focus on cloud environments, SciCumulus \cite{silva2014} is a SWfMS based on relational algebra for workflow definition that uses a provenance database for configuration and monitoring of executions. It is distinct in that it allows provenance queries to be made during the execution of the experiment. Compared with these solutions, we use the Swift SWfMS because it transparently supports the execution of workflows in different HPC environments, it has been shown that it has a high potential for scalability \cite{Wilde2009}, and it supports provenance management \cite{Gadelha2012}. In addition, it supports workflow patterns such as conditional execution and iterations that not supported by similar systems such as Pegasus \cite{Deelman2015}. It also evaluates the workflow dynamically, possibly changing task execution sites for efficiency of reliability. Juve et al. \cite{Juve2013} present Wfprof, a tool for collecting and summarizing performance metrics of workflow activities. Wfprof was coupled to the Pegasus SWfMS to identify the complexity level of different workflows and how computational and I/O intensive they are. In \cite{Krol2016}, an approach for analyzing the performance of workflows executed with the Pegasus SWfMS is presented, which also studies the effect of input parameters on task performance. The PDB \cite{Liew2011} presents an approach that collects and stores computational data in a database for planning the execution of workflows that occur in memory and out-of-core. ParaTrac \cite{Dun2010} is a data-intensive workflow profiler with an interface that allows its use by different SWfMS. ParaTrac uses the Linux {\em taskstats} interface to collect memory usage, CPU and runtime statistics, and the FUSE file system to record the amount of data that is passed between workflow activities. In \cite{silvaintegrating}, provenance data is integrated into the TAU code profiling tool, allowing the performance visualization of workflows executed with the Scicumulus SWfMS. This work aims to carry out the monitoring and profiling for the detection of anomalies in the execution of large-scale scientific workflows. Visionary \cite{Oliveira2017} is a framework for analysis and visualization of provenance data with the support of ontology and complex networks techniques. However, the work is focused on the analysis of the provenance graph and does not include domain data or predictive analysis. Our approach provides profiling analysis of the execution of workflows from the provenance collected by Swift, in addition to being able to aggregate domain data from the experiment. We show that it is possible to combine provenance and domain data for more detailed analysis. Also, we demonstrate that these analyses can benefit from machine learning techniques for extracting relevant information and predicting computational resource consumption that are not readily detected by queries and statistics from the provenance database. Focusing on bioinformatics workflows, the WEP \cite{Wep2013} tool enables the modularization of the workflow, allowing the user to execute the entire experiment or just the necessary activities. In addition, WEP also allows access to intermediate files and final results through the web interface. It does not provide detailed computational profiling or parallel and distributed execution features as does BioWorkbench. ADAM \cite{Adam2013} is a scalable API for genome processing workflows that uses Spark \cite{Zaharia2016}, a framework for managing Big Data. Both tools allow for running experiments in HPC environments, but they implement parallelism at a lower level, within the activities. ADAM requires the API functions to be implemented according to Spark's model of computation, using distributed datasets and applying actions and transformations, such as map and reduce, to these. BioWorkbench allows for the parallel composition of workflow activities that may be implemented using different models of computation. Therefore, BioWorkbench is more flexible in incorporating existing and legacy bioinformatics tools into its workflows. \section{Materials and Methods}\label{sec:desimpl} \subsection{Design and implementation}\label{subsec:desimpl} BioWorkbench was developed to support users in the specification process of an experiment, the experiment execution in HPC resources, the management of consumed and produced data, and the analysis of its execution results. BioWorkbench uses a SWfMS for definition and execution of bioinformatics workflows, and a web application for provenance data analytics. Figure \ref{fig:arq_bio} shows the layered conceptual architecture of BioWorkbench. It should be noted that this architecture is available for demonstration in a Docker \cite{docker} software container\footnote{Available at https://hub.docker.com/r/malumondelli/rasflow/} that allows one to reproduce the computational environment described and used in this work. In this way, BioWorkbench supports reproducibility at two levels: the computational environment and the data derivation history (through provenance information). In the following subsections, we detail the features and functionalities of each layer. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.8\linewidth]{img/bioWorkbenchArq} \end{center} \caption{\label{fig:arq_bio}BioWorkbench layered conceptual architecture.} \end{figure*} \subsection{Specification and Execution Layer}\label{subsec:management} This layer uses Swift \cite{Wilde2011}, a SWfMS that allows users to specify workflows through a high-level scripting language and execute them in different HPC environments. The scripting language follows functional programming principles that allow, for example, all operations to have a well-defined set of inputs and outputs and all the variables to be write-once. Through the Swift scripting language, datasets are declared as variables of primitive types, such as floats, integers, and strings; mapped types, which associate a variable with persistent files; and collections, which include arrays and structures. The activities that comprise a workflow are represented as \textit{app functions}, responsible for specifying how applications outside Swift should be executed, their inputs and outputs. \textit{Compound functions} are used to form more complex data flows and can include calls to \textit{app functions}, loops, and conditionals. All expressions in a Swift script whose data dependencies are met are evaluated in parallel. Through the \textit{foreach} loop instruction, it is possible to process all elements of an array in parallel. The independence of locality is another essential feature of Swift and allows the same workflow to run on different computing resources without the need to change its specification. Therefore, Swift supports the management and parallel execution of these workflows in HPC environments. This layer is then responsible for managing, through Swift, the execution of the workflow in the computational resources to which the user has access and intends to use. \subsection{Data Layer}\label{subsec:data} The data layer handles the provenance of workflow executions. For this, the layer also uses Swift because of its capability of tracking provenance of the workflow execution behavior as well as its activities \cite{Gadelha2011}. All information regarding the execution of a workflow in Swift, or its provenance, is recorded in a log file. Each of the activities executed by a workflow also has a log file, called {\em wrapper log}. These files contain information such as the computational aspects of activity executions: the number of read and write operations to the file system, CPU and memory utilization, and other details. Also, the log files keep track of the files consumed and produced by each of the activities, analyzing the data derivation process of the experiment possible. To provide access to provenance, Swift has a mechanism that processes these log files, filters the entries that contain provenance data, and exports this information to a relational SQL database (SQLite) \cite{Mondelli2016a}. The main entities of the Swift provenance model are presented in Figure \ref{fig:sqlite}. The \textit{script\_run} entity contains the description of the execution of a workflow; the \textit{app\_exec} entity describes aspects of the activities associated with a workflow, and \textit{resource\_usage} has the computational information of the executions of those activities. The \textit{file} entity has the record of all the files consumed and generated by the execution of a workflow; \textit{staged\_in} and \textit{staged\_out} entities, in turn, record the process of deriving data, relating the files to the executions of the activities. Workflow executions may also produce domain provenance data related to the application area of the experiment. Domain data comprises the results obtained by the execution of computational activities of the workflow or parameters used by them. Usually, these results are stored in files. In bioinformatics, for example, the domain data from a sequence alignment experiment may consist of rates or scores, indicating to the scientist the accuracy of the alignment. Thus, domain data is data essential for bioinformatics analyses. In order to store the domain data along with the provenance Swift collects by default, this layer can use a set of extractors developed for collecting domain data, or annotations, from some bioinformatics applications. Extractors consist of scripts that collect domain data from the files produced by the activities, and that can support the analysis process by the user. These annotations can be exported to the provenance database and associated with the respective workflow or particular activity execution in the form of key-value pairs. The provenance database contains a set of annotation entities, which relate to the model presented, giving more flexibility to store information that is not explicitly defined in the schema. More entities can be added to the database allowing for better management of the results of the workflow execution, depending on the type of annotation to be stored. In the section \ref{sec:evaluation}, we describe some of the entities that have been added to the Swift provenance model in order to provide better domain data management of a case study. Once the provenance data is stored in the database, they can be accessed by the {\em Analytics Layer}, described in the next subsection, in order to facilitate access and visualization of the results. \begin{figure*}[htb] \begin{center} \includegraphics[width=0.6\linewidth]{img/sqlite} \end{center} \caption{\label{fig:sqlite}Main entities in the conceptual model of the Swift provenance database.} \end{figure*} \subsection{Analytics Layer}\label{subsec:vis} This layer abstracts a set of database queries from the data layer, facilitating the access to the provenance of the workflow. The main goal is to provide the user with a more intuitive way to understand the computational profile of the experiment and to analyze the domain results. Without the set of query abstractions that we propose in this layer, the user would have to manipulate both the provenance database and the output files of the experiment. As part of the query abstraction process, we use R scripts that connect to the provenance database, perform the queries and extract useful statistics for analysis. The results of the queries retrieve data that are presented to the user through graphs and tables in a web interface. This interface was developed using the Shiny library\footnote{https://shiny.rstudio.com/}, which allows an analysis implemented in R to be accessed via web applications interactively. The interface provides a menu so that researchers can carry out their analyses. This menu, shown in Figure \ref{fig:interface1}, allows them to select a workflow execution from the list of executions available for analysis. The charts and tables are updated according to the chosen options. Computational analyses present graphs such as the execution time of the activities, the percentage of CPU used by each of them, and the parallelism level of the workflow. Information about the total time of execution of a workflow, the number of executed activities, and whether the workflow ended successfully is also displayed. Domain analyses provide information about the scientific domain of the workflow. In the RASflow case study, presented below, this information includes data on the genetic mutations found in patients. \subsubsection{Machine Learning Techniques in Support of Provenance Analysis}\label{subsubsec:ml} Provenance data can be a useful resource for a wide variety of machine learning algorithms for data mining. The application of machine learning algorithms consists in statistical analyses and automatic generation of models. These models can produce: (i) predictions, allowing scientists to estimate results or behavior based on some previous information; and (ii) learning, related to the discovery of implicit relations that are not always detected by human observations or simple queries. From a data set of interest, the models take into account a set of attributes that must be passed as input to produce an output, which in this case can be a prediction. If the output receives values in a continuous numeric range, the models comprise a set of mathematical and logical operators, resulting in a regression problem. On the other hand, if these outputs can only assume a previously defined set of discrete values, named classes, then the models map the input attributes in classes, resulting in a classification problem. In bioinformatics workflows, for example, we can have as input to a machine learning algorithm a set of attributes such as genome sequence size, statistics on memory usage and CPU to analyze them. The output of this algorithm may be the prediction of the execution time. In comparative genomics, more specifically, behaviors or relations such as the required computational time, memory or space for comparing an arbitrary number of genomes can also be predicted. In this work, as part of the analysis process, we combine provenance data and machine learning by using the free software Weka \cite{hall2009weka}. Weka provides a broad set of machine learning and statistical analysis techniques for data mining tasks. These techniques include rule- and tree-based algorithms, such as \textit{J48, BFTree, OneR}, in which the values of all input and output attributes are previously known. To evaluate the performance of a generated model we used metrics related to the differences between the previously known values (which we can call ``real values'') and the predicted values of the output attribute. Regarding the generalization capacity of the model, whenever possible the algorithms were evaluated using the methodology known as ``cross-validation,'' with 10 folds \cite{arlot2010survey}. Therefore, we hope to indicate some relevant opportunities that arise from the association between provenance data and machine learning techniques, both in the specific case of SwiftGECKO, presented below, and in the scientific workflows field. Also, these experiments can contribute to the understanding of workflow behavior, being useful, for instance, in guiding optimization efforts and parameter configurations. It is worth mentioning that the techniques used in this work were applied using the original algorithm attributes proposed in the software Weka, except for the minimum number of tuples classified at a time by the models. This attribute provides a minimum amount of tuples that need to be simultaneously classified by a model for each possible input parameters configuration, thus influencing in the model complexity. The values of this parameter were changed to increase the legibility of the obtained results. A more detailed description of the algorithms included in Weka, together with some statistical information that we did not include in this work for scope reasons, can be found in papers such as \cite{arora2012comparative} and \cite{sharma2013weka}. \begin{figure*}[!htb] \begin{center} \includegraphics[width=1.0\linewidth]{img/interface1} \end{center} \caption{\label{fig:interface1}BioWorkbench web interface displaying information about a RASopathy analysis workflow (RASflow) execution.} \end{figure*} \section{Results and Discussion}\label{sec:evaluation} We present three case studies to evaluate BioWorkbench: SwiftPhylo, a phylogenetic tree assembly workflow; SwiftGECKO, a comparative genomics workflow; and RASflow, a RASopathy analysis workflow. These workflows are analyzed from both computational and scientific domain points of view using queries to a provenance and annotation database. Some of these queries are available as a pre-built feature of the BioWorkbench web interface. The values and statistics presented in this section were extracted from queries to the Swift provenance database. In the case of SwiftGECKO and RASflow, in addition to the computational information already collected and stored by Swift, annotations were also gathered from the scientific domain of the experiment, such as the size of the sequences used as input for the workflow execution. This demonstrates the usefulness of Swift both in supporting the parallel execution of the experiment and in the analysis of those runs through queries to the provenance database. The executions of each of the workflows were performed on a shared memory computer, with a single node with 160 cores and 2~TB of RAM. It is worth mentioning that the computational resource is shared with other users and was not dedicated to these executions. This can be considered as one of the factors influencing the performance gains. We highlight that the workflows were executed directly in the aforementioned computational resource, not taking into account the Docker structure presented in the Figure \ref{fig:arq_bio}. The Docker container was built for reuse purposes only, to encapsulate the components that compose the framework. \subsection{SwiftPhylo: phylogenetic tree assembly} SwiftPhylo\footnote{Available at https://github.com/mmondelli/swift-phylo} is based on the approach proposed in \cite{Ocana2011}. Its goal is to build phylogenetic trees from a set of multi-FASTA files with biological sequences from various organisms. The construction of phylogenetic trees allows understanding the evolutionary relationship between organisms, determining the ancestral relationships between known species. Results obtained through phylogenetic experiments contribute, for example, to the development of new drugs \cite{anderson2003process}. SwiftPhylo is composed of six activities, shown in Figure \ref{fig:diagram_phylo} and described as follows: \begin{figure*}[htb] \begin{center} \includegraphics[width=0.6\linewidth]{img/swiftPhylo} \end{center} \caption{\label{fig:diagram_phylo}SwiftPhylo workflow modeling.} \end{figure*} \begin{enumerate} \item Sequence numbering: the activity receives multi-FASTA format files as input and uses a Perl script so that each sequence contained in the file receives is numbered. \item Multiple Sequence Alignment (MSA): the activity receives the result of Activity 1 and produces a MSA as output through the MAFFT \cite{katoh2002mafft} application. \item Alignment format conversion: this activity converts the format of the file generated by the previous activity to the PHYLIP format using the ReadSeq \cite{Gilbert2003} application. \item Search for the evolutionary model: this activity tests the output files of Activity 3 to find the best evolutionary model, through the ModelGenerator \cite{keane2006assessment} application. \item Filtering: this activity uses a Python script to filter the output file from Activity 4. \item Construction of phylogenetic trees: this activity receives as input the resulting files of Activities 3 and 5, and uses the RAxML \cite{stamatakis2006raxml} application to construct phylogenetic trees. \end{enumerate} SwiftPhylo works with a large amount of data and can be run with different parameters. This means that, in practice, managing its execution without the help of a SWfMS becomes a cumbersome task for the scientist. Taking into account that the workflow modeling specifies independent processing for each input file, with the implementation of SwiftPhylo we have a workflow that allows us to explore the characteristics of Swift's parallelism. In the SwiftPhylo implementation process, the computational applications that compose the workflow were mapped to the Swift data flow model. In this way, the activities are represented in the Swift script as \textit{app functions}. The app functions determine how the execution of a computational activity external to Swift is performed, including its arguments, parameters, inputs, and outputs. Once this has been done, activity chaining was defined by indicating that the output of one app function is the input of another. Parallelism has been implemented in a way that the activity flow can be executed independently for each input, as shown in the code in Listing \ref{lst:swift_1} through the \textit{foreach} statement. \begin{figure}[h] \begin{lstlisting}[label={lst:swift_1}, style=mystyle, frame=single, language=SwiftK, caption={SwiftPhylo specification sample.}] app (file o) mafft (file i) { mafft filename(i) stdout=filename(o); } foreach f, i in fastaFile { mafftFile[i] = mafft(fastaFile[i]); } \end{lstlisting} \end{figure} SwiftPhylo was executed using a set of 200 multi-FASTA files, with the size of each file ranging from 2~KB to 6~KB, resulting in the execution of 1200 activities. The total execution time averages and speedup of the workflow are shown in Figure \ref{fig:time_phylo}. The results indicate a reduction of the execution time of the SwiftPhylo from $\sim$13.35 hours, when executed sequentially, to $\sim$8 minutes, when executed in parallel using 160 cores. This represents a decrease of 98.9\% in the workflow execution time. Also, the speedup metric was used as a way to evaluate the performance gain between parallel and sequential executions. In this case, SwiftPhylo executed in parallel was $\sim$92 times faster than its sequential execution. \begin{figure*}[htb] \begin{center} \includegraphics[width=0.6\linewidth]{img/phylo_scale.eps} \end{center} \caption{\label{fig:time_phylo}SwiftPhylo execution time and speedup.} \end{figure*} Another important aspect related to the execution of the workflow concerns its level of parallelism, presented through a Gantt graph in Figure \ref{fig:gantt_phylo}. This type of analysis shows the order of execution and the duration of each of the activities that comprise the \textit{workflow}. In the chart, activities are represented by different colors and each activity is displayed as a horizontal bar that indicates when the activity started and when it ended. The bars are stacked on the vertical axis in order of execution. Thus, by plotting a vertical line at some time $t$ of the workflow execution, we find the parallelism at time $t$ as the number of activities intercepted by the line. We can observe that the {\em modelgenerator} activity is the one that demands the most execution time and can be considered a candidate for identify parallelism strategies that reduce its duration. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.8\linewidth]{img/gantt_phylo.eps} \end{center} \caption{\label{fig:gantt_phylo}SwiftPhylo workflow Gantt chart expressing its parallelism level.} \end{figure*} \subsection{SwiftGECKO: comparative genomics} SwiftGECKO\footnote{Available at https://github.com/mmondelli/swift-gecko} is an implementation of the comparative genomics workflow proposed in \cite{Torreno2015}. Comparative genomics studies the relationship between genomes of different species, allowing a better understanding of the evolutionary process among them \cite{alfoldi2013comparative}. SwiftGECKO aims to identify portions of biological sequences of various organisms with a high degree of similarity, or {\em high-scoring segment pairs} (HSP), between them. SwiftGECKO is composed by 10 activities distributed in three modules, which are presented in Figure \ref{fig:diagram_gecko} and described as follows: \begin{enumerate} \item Dictionary creation: this corresponds to the creation of dictionaries for each sequence and includes Activities 1 to 4 (blue boxes). For the dictionary creation, the user must indicate the size of the portion of the sequence, or $K$-mers, that will be used for the comparison. The dictionary consists of a table that organizes the $K$-mers and their respective positions, for each of the sequences. \item HSP identification: this is composed by Activities 5 to 9 (green boxes) and performs the comparison between the sequences, identifying {\em hits} used to find HSPs. {\em Hits} consist of positions where the $K$-mers of the compared sequences are equal. \item Post-processing: this is Activity 10, where a conversion of the output format of Activity 9 to CSV is done, allowing analysis of the results. The CSV file contains information such as the size of the sequences, the parameters used in the comparison, and the number of hits found. \end{enumerate} \begin{figure*}[htb] \begin{center} \includegraphics[width=0.8\linewidth]{img/diagram_gecko} \end{center} \caption{\label{fig:diagram_gecko}SwiftGECKO workflow modeling.} \end{figure*} SwiftGECKO consumes and produces a significant amount of data. A workflow execution with 40 complete bacterial genomes totals 1560 possible comparisons, resulting in the execution of 8080 activities. The implementation of SwiftGECKO followed the same steps mentioned in the SwiftPhylo implementation process. Parallelism was divided into two \textit{foreach} stages as shown in Listing \ref{lst:swift_2}. In the first one, the activities that belong to Module 1 are executed; they generate the files that will be consumed by the other activities. The second step, referring to Modules 2 and 3, manages the activities responsible for comparing pairs of all genomes given as input. \begin{figure}[h] \begin{lstlisting}[label={lst:swift_2}, style=mystyle, frame=single, language=SwiftK, caption={SwiftPhylo specification sample.}] foreach f,i in fasta { wordsUnsort[i] = words(fasta[i]); } foreach f,i in fasta { foreach g,j in fasta { hits[i][j] = hits(d2hW[i], d2hW[j], wl); } } \end{lstlisting} \end{figure} SwiftGECKO was executed with a set of 40 files containing bacterial genome sequences, ranging in size from 1~KB to 8~MB. The execution time decreased from $\sim$2.1 hours to $\sim$6 minutes, representing a reduction of $\sim$96.6\%. Also, the workflow was $\sim$30 times faster when executed in parallel, using 160 processors. In a more in-depth analysis, we illustrate in Table \ref{tab:data_gecko} that the {\em hits} activity is also I/O-intensive. This is a factor that limits the scalability of the workflow. \begin{table}[!htb] \centering \caption{Average duration (s) and the amount of data read and written by SwiftGECKO.} \label{tab:data_gecko} \begin{tabular}{|l|r|r|r|} \hline \multicolumn{1}{|c|}{\textbf{Activity}} & \multicolumn{1}{c|}{\textbf{Duration (s)}} & \multicolumn{1}{c|}{\textbf{GB read}} & \multicolumn{1}{c|}{\textbf{GB written}} \\ \hline reverseComplement & 11.8 & 0.15 & 0.14 \\ \hline words & 55.9 & 0.29 & 7.05 \\ \hline sortWords & 76.6 & 7.05 & 7.05 \\ \hline w2hd & 425.1 & 7.05 & 11.67 \\ \hline combineFrags & 425.8 & 0.32 & 0.16 \\ \hline csvGenerator & 697.8 & 0.006 & 0.004 \\ \hline filterHits & 2402 & 111.36 & 83.09 \\ \hline FragHits & 3793.3 & 94.7 & 0.32 \\ \hline sortHits & 4457.3 & 111.36 & 111.36 \\ \hline hits & 60058 & 455.24 & 111.36 \\ \hline \end{tabular} \end{table} For a more detailed analysis of the SwiftGECKO provenance data, we present predictive models automatically generated by machine learning methods. These models aim at understanding how some variables influence the total execution time of the workflow. Besides the CPU time, which was selected as the attribute to be predicted, and the total\_fasta\_size, we included the following attributes as input parameters for the models: \textit{length}, \textit{word\_length}, \textit{similarity}, \textit{total\_genomes}, \textit{total\_reads}, and \textit{total\_written}. The machine learning methods were applied using Weka \cite{hall2009weka}, a software that contains a set of different algorithms for data classification and prediction. In this case, the regression algorithms obtained especially promising results. The simple linear regression algorithm achieved a correlation coefficient of 0.9855 and is represented in the Equation \ref{eq:linear_regression_query4}, while the multilayer neural network algorithm obtained a correlation coefficient equal to 0.9941. We have not represented this second model due to its high complexity. Commonly, the high complexity of the models obtained by neural network-based algorithms is responsible for the use of the expression ``black box algorithm'', to refer to them. These results demonstrate that it is quite possible to predict the execution time of the workflow as a whole, on the chosen set of input parameters. \begin{equation} \begin{array}{llll} CPU\, time=& -931.4025 & \times & \textit{word\_length = 12 $\vee$ word\_length = 10 }\, + \\ & -2704.5534 & \times & \textit{word\_length = 10 }\, + \\ & 0 & \times & \textit{total\_written }\, + \\ & -1006.3049 & \times & \textit{total\_genomes = 20 $\vee$ total\_genomes = 30 $\vee$ total\_genomes = 40 }\, + \\ & -547.6854 & \times & \textit{total\_genomes = 30 $\vee$ total\_genomes = 40 }\, + \\ & 410.1449 & \times & \textit{total\_genomes = 40 }\, + \\ & 876.1037 & & \end{array} \label{eq:linear_regression_query4} \end{equation} We divided the domain of possible values for \textit{CPU time} in 5 ranges (which are the classes) $\{ \textit{A, B, C, D, E} \}$ of equal size, in which $A$ includes the lowest values and $E$ includes the highest values. This makes it possible to apply classification algorithms using the same data as the previous analysis. Having a discrete domain, the information gain ratio values for each attribute are listed in the Table \ref{tab:info_gain_query4}. Cost matrices were used to avoid the overvaluation of class A, which holds 88.46\% of all tuples. In this case, the tree-based techniques ``J48'' and ``BF Tree'' obtained the best results, correctly classifying 96.79\% and 96.15\%, respectively, of all tuples. \begin{table}[!h] \centering \begin{tabular}{|l|l|} \hline \multicolumn{1}{|c|}{\textbf{Information gain ratio}} & \multicolumn{1}{|c|}{\textbf{Attribute}}\\ \hline 1 & total\_read \\ \hline 0.1842 & word\_length \\ \hline 0.1611 & total\_fasta\_size \\ \hline 0.1208 & total\_genomes \\ \hline 0.0421 & length \\ \hline 0.0271 & similarity \\ \hline \end{tabular} \caption{Information gain ratio values of the attributes used for the analysis.} \label{tab:info_gain_query4} \end{table} \begin{small} \begin{algorithm}[h!] \caption{J48 query4 without constraints} \label{a:j48-query4-completa} \If{total\_read $\leq$ 1020229446482}{ \Return Class A\; }\Else{ \If{total\_fasta\_size $\leq$ 113556442}{ \If{length = 80}{ \If{similarity = 65}{ \Return Class C\; }\Else{ \Return Class B\; } }\Else{ \Return Class C\; } }\Else{ \Return Class E\; } } \end{algorithm} \end{small} \begin{small} \begin{algorithm}[h!] \caption{BFTree query4 without constraints} \label{a:bfTree-query4-completa} \If{total\_read $<$ 1.768799155948E12}{ \Return Class A\; }\Else{ \If{total\_fasta\_size $<$ 1.314087315E8}{ \If{length=100}{ \Return Class C\; }\Else{ \If{similarity $\neq$ 40}{ \Return Class C\; }\Else{ \Return Class B\; } } }\Else{ \Return Class E\; } } \end{algorithm} \end{small} The ``OneR'' algorithm obtained the rule given by the Equation \ref{eq:oneR_query4}, correctly classifying 96.79\% of all tuples. \begin{equation} \centering \begin{array}{lll} total\_read: & & \\ < 1.768799155948E12 & : & Class\, A \\ < 2.5173879304975E12 & : & Class\, B \\ < 3.4581148731605E12 & : & Class\, C \\ \geq 3.4581148731605E12 & : & Class\, D \\ \end{array} \label{eq:oneR_query4} \end{equation} According to the Table \ref{tab:info_gain_query4}, the \textit{CPU time} is most directly influenced by the amount of data read by the workflow. Together with the third higher information gain ratio value assigned to the attribute \textit{total\_fasta\_size}, we can suggest that the magnitude of the information to be read is the most influential aspect concerning the execution time. Despite the I/O routines, the attribute \textit{word\_length} receives the second higher information gain ratio value, highlighting its relevance. In fact, in the absence of data about the number of hits, the attribute \textit{word\_length} assumes the most prominent position to predict the attribute \textit{CPU time}. For all this, the value of \textit{word\_length} is also a decisive attribute to predict the execution time of the workflow as a whole, due to its importance in the behavior of the most costly component of the workflow. Reinforcing the relevance of the I/O routines, both Algorithms \ref{a:j48-query4-completa} and \ref{a:bfTree-query4-completa} employ the attributes \textit{total\_read} and \textit{total\_fasta\_size} in their main conditionals. As in the Equation \ref{eq:oneR_query4}, the greater the \textit{total\_read} value, the greater the computational time demanded. Also, the attributes \textit{length} and \textit{similarity} are used to classify a minor number of tuples. However, they can indicate the influence of the cost associated with the amount of fragments found (influenced by the attributes \textit{length} and \textit{similarity}). Beyond all this, these experiments demonstrate that is possible to generate simple models able to efficiently predict the computational time demanded by the workflow execution, both in terms of continuous or discrete times. The techniques used to build these models also allows us to infer predictions related to other attributes, beyond the execution time. For example, we can focus on the amount of written data by the workflow or the specific domain data stored in the provenance database. Also, there are a wide variety of machine learning methods that produce symbolic solutions and allow, in addition to the predictions, knowledge extraction about different aspects. These aspects include, for example, the structure or the importance degree of relations among the various variables or between variables and constants. Therefore, machine learning methods constitute an essential toolkit to be explored in provenance data analyses concerning SwiftGECKO and other, to provide predictive models and to reveal implicit knowledge. \subsection{RASflow: RASopathy analysis} Genetic diseases, such as RASopathies, occur due to changes in the nucleotide sequence of a particular part of the DNA. These changes modify the structure of a protein, which may cause anatomical and physiological anomalies \cite{klug1997}. RASopathies comprise a set of syndromes characterized by heterogeneity of clinical signs and symptoms that limit the prognosis, still in the childhood, of predispositions to certain tumors or neurocognitive delays. RASopathies are characterized by mutations in genes that encode proteins of the RAS/MAPK cell signaling pathway, which is part of the communication system responsible for the coordination of cellular activities and functions. This type of mutation was found in 20-30\% of cancer cases in humans, setting the RASopathies in the group of syndromes that are predisposed to cancer \cite{Lapunzina2014}. A consortium between Bioinformatics Laboratory of the National Laboratory for Scientific Computing (LABINFO/LNCC) and the Center for Medical Genetics of the Fernandes Figueiras Institute at Fiocruz (IFF/Fiocruz) established an experiment aimed at the molecular study of RASopathies, from the sequencing of the exome of a set of patients. The consortium seeks to investigate genetic aspects of RASopathies by using DNA sequencing technologies, providing support for the treatment of the disease. For this, a study that counts on the processing of the sequences of patients diagnosed with RASopathies was established. This study comprises the use of a set of bioinformatics applications and, due to the significant amount of data to be processed, demands high-performance computing. A scientific workflow, called RASflow, was implemented to support the large-scale management of a bioinformatic experiment to analyze diseases associated with RASopathies and allows the identification of mutations in the exome of patients. Once the exomes of the collected patient samples are sequenced, the results are stored in a text file in the FASTQ format, which records the {\em reads} and their quality scores. The {\em reads} consist of sequence fragments generated by the sequencer. By using the results obtained through RASflow, a researcher can analyze and identify whether or not there is pathogenicity in the mutations present in the exome. RASflow was implemented in Swift, and the workflow model is shown in Figure \ref{fig:modeling}. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.6\linewidth]{img/rasflow} \end{center} \caption{\label{fig:modeling}RASopathy analysis workflow modeling.} \end{figure*} Activity 1 receives a reference human genome and indexes it. The results are stored in files in the BT2 format, which records the indexes according to the sequence size. This activity requires large computational time, and its results are used in the analysis of each patient. Therefore, the workflow checks for the existence of BT2 files in the filesystem where it is executed. The activity is only performed when the files are not found. Activity 2 receives the exome sequence of the patient in the FASTQ format as input, filters the reads with a certain quality, and maintains the result in the same format. The need to perform Activity 2 depends on the type of sequencer used to sequence the exome of the patient. If the Illumina sequence was used, for example, it is not necessary to perform this activity. If the sequencing comes from IonTorrent, the activity is performed in parallel. Activity 3 receives the result of Activities 1 and 2 to perform the alignment of the exome and the reference genome sequence, resulting in a SAM format file and a log file with alignment statistics. The SAM file, the result of the alignment, is usually large and therefore difficult to analyze and manipulate. Activities 4, 5 and 6 are used to compress, sort and index the SAM file, respectively, generating the BAM and BAI binary files that store the aligned sequences. The resulting files are used by Activity 7, which filters duplicate reads and produces a file in BAM format as well. From this point on, mutations are identified by comparing the exome sequence of the patient and the reference genome. However, the workflow presents some variability, and the comparison can be made through two approaches: (i) using {\em samtools} \cite{samtools2011} or (ii) the toolkit provided by \textit{GATK} \cite{gatk2010}. A more detailed analysis of the differences between the two approaches that take into account biological aspects falls outside the scope of this work. However, it can be said that the GATK toolkit comprises more sophisticated techniques and the results obtained tend to be more accurate. In the workflow variation that uses \textit{samtools}, the BAM file produced by Activity 7 and the reference genome are consumed by Activity 8, which performs the comparison. The result is used by Activity 9, which converts the file from a binary format to the VCF format, which is responsible for storing the genetic variants found. The workflow variation using the \textit{GATK} approach performs the set of Activities 10a-10f, indicated in the figure, which also produces a VCF file. The VCF file resulting from the execution of one of the variations is consumed by Activity 11 to predict the effects of the mutations found and to determine the pathogenicity, resulting in a set of VCFs. In this work, we also included Activities 12 and 13 to compress and index the files resulting from Activity 11, respectively. The results are consumed by Activity 14, responsible for combining this set of files. Finally, Activity 15 applies a set of filtering activities based, for example, on the quality and quantity of occurrences of a given variant, generating a single final VCF file. A set of scientific domain annotation extractors was developed for gathering and adding to the provenance database information from the following files: (i) the GFF file, which describes characteristics of the DNA, RNA and protein sequences of the genome used as reference; (ii) the log file resulting from the execution of Activity 3; and (iii) the file in VCF format, which contains the variations found in the exome. The conceptual schema of the Swift database has been augmented to enable storage of this information. The following tables, as shown in Figure \ref{fig:domainrasflow}, were added: \textit{gff} and \textit{vcf}, for storing the contents of the GFF and VCF files respectively; and the \textit{file\_annot\_numeric} table, which records the contents of the log file in key-value format. \begin{figure*}[!htb] \begin{center} \includegraphics[width=0.5\linewidth]{img/sqlite_domain} \end{center} \caption{\label{fig:domainrasflow}Database entities for storing scientific domain annotations in RASflow.} \end{figure*} Next, we propose a set of queries to the RASflow provenance database to assist the scientist in the analysis of the results of the workflow. The queries were defined with one of the researchers responsible for the analysis of RASopathies. They are available for viewing in the BioWorkbench web interface corresponding to the RASflow experiment. That is, the scientist does not need to redefine them to obtain the results. \textit{Query 1}: ``Retrieve the alignment rate of each patient's exome sequences relative to the reference genome''. The alignment process allows identifying the similarity between the patient sequence and the sequence used as a reference. The result is obtained by executing Activity 2 of the workflow, which produces a log file. This file records some statistics and among them the rate of alignment between the two sequences. This type of information is useful for the scientist, who is responsible for deciding what rate is sufficient for proceeding with the analysis. The alignment rate is stored in the \textit{file\_annot\_numeric} table of the provenance database and can be retrieved through the query shown in Listing \ref{lst:query_1}. Table \ref{tab:query_1} displays the result of the query, with the alignment rates for each of the patients used in the analysis of RASopathies of a given workflow execution. \begin{figure}[h] \begin{lstlisting}[label={lst:query_1}, style=mystyle, frame=single, language=SQL, caption={SQL query to retrieve the alignment rate of each patient's exome sequences.}] SELECT file_id, value FROM file_annot_numeric NATURAL JOIN staged_out WHERE key LIKE 'overall alignment rate' AND app_exec_id LIKE \end{lstlisting} \end{figure} \begin{table}[!htb] \centering \begin{tabular}{|l|r|} \hline \textbf{Patient} & \textbf{Alignment rate} \\ \hline P1.log & 93.95\% \\ \hline P2.log & 94.52\% \\ \hline P3.log & 94.41\% \\ \hline P4.log & 94.48\% \\ \hline P5.log & 94.62\% \\ \hline P6.log & 94.58\% \\ \hline \end{tabular} \caption{Alignment rate resulting from patients analysis in RASflow.} \label{tab:query_1} \end{table} \textit{Query 2}: ``Retrieve the biotype and transcript gene name from the final VCF file''. This type of result, without BioWorkbench support, was obtained through a manual scan of the GFF file, used as input in the execution of the workflow, and if the VCF file generated as the final result. In RASflow, these two files are imported into the \textit{gff} and \textit{vcf} tables of the provenance database. To retrieve this information, one can use the query presented in Listing \ref{lst:query_2}, which performs the join of the \textit{vcf} and \textit{gff} tables for a given workflow execution. The result is displayed in Table \ref{tab:query_2}. Through the BioWorkbench interface for RASflow, the result is also presented as a table, but iteratively, allowing the scientist to filter the columns or search for names according to their needs. \begin{figure}[h] \begin{lstlisting}[label={lst:query_2}, style=mystyle, language=SQL, frame=single, caption={SQL query to retrieve the biotype and transcript gene name from the final VCF file of a patient.}] SELECT v.*, g.Name AS nome, g.biotype AS biotipo FROM vcf v NATURAL JOIN file f NATURAL JOIN staged_out o NATURAL JOIN app_exec a LEFT JOIN gff g ON v.trid = g.ID WHERE a.script_run_id LIKE 'loss-run006-3737171381'; \end{lstlisting} \end{figure} \begin{table*}[!htb] \centering \begin{tabular}{|l|l|l|l|l|} \hline \textbf{Patient} & \textbf{Gene} & \textbf{Transcript} & \textbf{Name} & \textbf{Biotype} \\ \hline P1.log & ENSE00001768193 & ENST00000341065 & SAMD11-001 & protein\_coding \\ \hline P1.log & ENSE00003734555 & ENST00000617307 & SAMD11-203 & protein\_coding \\ \hline P1.log & ENSE00003734555 & ENST00000618779 & SAMD11-206 & protein\_coding \\ \hline P1.log & ENSE00001864899 & ENST00000342066 & SAMD11-010 & protein\_coding \\ \hline P1.log & ENSE00003734555 & ENST00000622503 & SAMD11-208 & protein\_coding \\ \hline \end{tabular} \caption{Mutation list with the biotype and the name of the transcribed genes in the final VCF file of a patient.} \label{tab:query_2} \end{table*} To evaluate the performance of the workflow, we used exome sequences of 6 patients as input, ranging in size from 8~GB to 11~GB. It is worth mentioning that a preliminary version of this workflow was developed in Python. In this work, we chose to develop it using Swift to take advantage of the parallelism offered by the system. By considering the variability of the workflow, executions were made for the two possible approaches: one using the \textit{samtools} tool and the other using the \textit{GATK} toolkit. In the approach using \textit{samtools}, a reduction of $\sim$77\% of the execution time of the analyses was obtained, representing a gain of $\sim$4 times in the execution with Swift compared to the sequential execution in Python. The approach using \textit{GATK} had a reduction of $\sim$80\% in execution time, for a gain of $\sim$5 times. The parallelism strategy of RASflow explored the simultaneous analysis of patients. Thus, the total time of execution of the workflow is associated with the execution time of the most time-consuming patient analysis. Because it has been executed with a small set of patients, the workflow has a large run-time variability. However, genetic variant analysis can be applied to other diseases. For diseases such as cancer, for example, the volume of sequenced genomes is much larger and therefore, there is an opportunity to obtain higher performance gain through the approach used in RASflow. \section{Conclusion and Future Work}\label{sec:conclusion} Large-scale bioinformatics experiments involve the execution of a flow of computational applications and demand HPC. The execution management of these experiments, as well as the analysis of results, requires a lot of effort by the scientist. In this work, we demonstrate that the use of scientific workflow technologies coupled with provenance data analytics can support this management, allowing for the specification of experiments, parallel execution in HPC environments, and gathering provenance information. To benefit from the use of scientific workflow technologies and support the whole process of scientific experimentation, we have developed the BioWorkbench framework. It was designed to use the Swift SWfMS for the specification and execution of bioinformatics experiments, and a web application for provenance data analytics. In this way, through BioWorkbench the user has access to a tool that integrates various features ranging from the high-performance execution of the workflow to profiling, prediction, and domain data analysis. We can observe that BioWorkbench enables a better scientific data management since the user does not have to directly manipulate the provenance database and the resulting files from the experiment execution. Another important aspect concerns the reproducibility of the experiment, which is facilitated by the provenance and the reproduction of the computational environment through a Docker container. We used three case studies that model bioinformatic experiments as workflows: SwiftPhylo, SwiftGECKO, and RASflow. In addition to the performance gains achieved by using Swift in BioWorkbench, we have demonstrated how the provenance allows the identification of bottlenecks and possible optimization opportunities in the execution of workflows. Also, we conclude that users can benefit from the application of machine learning techniques in provenance analysis to, for example, predict and classify workflow execution time. It is noteworthy that, during the development of this work, SwiftGECKO was integrated into the Bioinfo-Portal scientific portal\footnote{Available at http://bioinfo.lncc.br/} \cite{Mondelli2016a}. Through the portal, users can execute the workflow through a web interface in a transparent way, using geographically distributed computational resources managed by the Brazilian National System for High-performance Computing (SINAPAD). \section*{Acknowledgements} This work was partially supported by Brazilian funding agencies CNPq, CAPES, and FAPERJ. M. Wilde has an employment and ownership interest in the commercial firm Parallel Works Inc. \bibliographystyle{abbrv}
\section*{S1. Methodology and Details of the Monte-Carlo Procedure} We utilize a DQMC scheme \cite{QMC1981}, to numerically solve the Hamiltonian of the Hubbard model in the presence of spin-selective disorder. The DQMC formalism initially entails the slicing of the inverse temperature $\beta$ into $L_{\tau}$ slices of width $\Delta\tau$ each \cite{Suzuki01111976}. The interacting electron problem is recast into an effective time-dependent non-interacting problem by utilizing a Hubbard-Stratonovich \cite{Hirsch1983} transformation in terms of an Ising-type auxillary field. The fermionic degrees of freedom are then formally integrated out. Various physical quantities like the Greens function, the electronic density, and the two particle correlator are calculated via Monte-Carlo sampling of the Ising Hubbard-Stratanovich field. The parameter space of our simulation is spanned by the interaction strength $U$, the disorder strength $\Delta_\downarrow$ and temperature $T$, which are all expressed in terms of the hopping integral $t$. The simulations are further performed at various filling fractions. The simulations are performed on a $2d$ square lattice of linear dimension $L = 10$. Thus the number of sites is $N=10^{2}$. To incorporate the disorder averaging we have performed simulations for $80$ different disorder realizations. All the observables are obtained by performing averages over these $80$ realizations. \section*{S2. Some Details on the dc Conductivity} Here, we discuss some details of the approximations involved in calculating the dc conductivity: The dc conductivity can be calculated by taking the long wavelength($q=0$) and $ \omega \rightarrow 0$ limit of the dynamical current-current correlation function \cite{mitcriterion}. \begin{equation} \sigma_{dc} = \lim_{\omega\rightarrow 0} \frac{\mathbb{I}m\Lambda(q=0,\omega)}{\omega} \label{eq:1} \end{equation} The current-current correlation function in imaginary time is connected to the dynamical current-current correlation function via the integral transform given by Eq.~(\ref{eq:2}), \begin{equation} \Lambda(q,\tau) = \int_{-\infty}^{+\infty} \frac{d\omega}{\pi} \frac{e^{-\omega \tau}}{1-e^{-\beta \omega}}\mathbb{I}m\Lambda(q,\omega) \label{eq:2} \end{equation} The correlation function in DQMC are measured in imaginary time $\tau$. Calculating the dynamical correlation function given the correlator in imaginary time via the inversion of Eq.~(\ref{eq:2}) is not a well defined problem. The kernel, $k = \frac{e^{-\omega \tau}}{1-e^{-\beta \omega}} $ decays exponentially as a function of frequency. At $\tau=\frac{\beta}{2}$ the kernel $k$ reduces to $ \frac{1}{2 \sinh(\frac{\beta \omega}{2})}$ and it gets most of the contribution from the small $\omega$ limit. Now, in the limit $\tau=\beta/2$, $\mathbb{I}m\Lambda(0,\omega)$ can be replaced by $\omega \sigma_{dc}$ and the kernel $k$ is replaced by its value at $\tau=\frac{\beta}{2}$. \\ Once these approximations are made eq(2) becomes, \begin{equation} \Lambda\left(q=0,\tau=\frac{\beta}{2}\right) = \int_{- \infty}^{+ \infty} \frac{d\omega}{2 \pi} \frac{\omega \sigma_{dc}}{ \sinh(\frac{\beta \omega}{2})} \end{equation} After carrying out the integration, \begin{equation} \sigma_{dc} = \frac{\beta^{2}}{\pi} \Lambda \left( q=0,\tau=\frac{\beta}{2} \right). \end{equation} Now $\sigma_{dc}$ has been expressed in terms of a current-current correlation function calculated in imaginary time. Current-Current correlation function in imaginary time is calculated using DQMC and is given by, \begin{equation} \Lambda(q,\tau) = \langle j_{x}(q,\tau)j_{x}(-q,\tau) \rangle. \end{equation} where $j_{x}(q,\tau)$ is the fourier transform of current density operator given in real space by $j_{x}(r,\tau)$, \begin{equation} j_{x}(r,\tau)=e^{\frac{ \tau H}{h}}j_{x}(r)e^{-\frac{\tau H}{h}} \end{equation} \begin{equation} j_{x}(r)=\frac{i e a t}{h}\sum_{\sigma} (c^{\dagger}_{r+e_{x}, \sigma} c_{r,\sigma} - c^{\dagger}_{r,\sigma} c_{r+e_{x}, \sigma}). \end{equation}
\section{Automating Verification} \label{autoverif} We detail in this section our Maude formalization which allows us to automatically check whether two initial configurations are timed equivalent. To make analysis feasible we use a symbolic semantics for intruder interactions as well as for time constraints. To further facilitate implementation of analysis, the semantics records events making traces/bundles explicit rather than implicit. Thus a \emph{Maude configuration} has the form \begin{verbatim} pc ! tSym ! ds ! b ! exe \end{verbatim} where \begin{itemize} \item \texttt{pc} is the player configuration consisting of honest players \texttt{[h(i),j | evtl | keys]} each with their associated intruder \texttt{[I(i),j| msgs | buff ]}. Here \texttt{evtl} is the timed protocol that the player follows (coding a role $\pl$); \texttt{i,j} are natural numbers used for player identification and ensuring nonce freshness; \texttt{keys} are the keys possessed by the player; \texttt{msgs} are the (symbolic) messages that have been learned by the intruder, \ie, his current knowledge; \texttt{buff} contains messages that have been shared by other intruders and that have not yet been learned by the intruder because they still did not arrive the intruder. \item \texttt{ds} is the set of constraints on intruder generated symbols \item \texttt{tSym} is the symbolic current time \item \texttt{b} the symbolic time constraints, includes network topology $r_0 \le \key{td}(i,j) \le r_1$ \item \texttt{exe} a sequence of message transmission events \texttt{o(msg,sndr,rcvr,ts)}. Each \texttt{ds} instance of \texttt{exe} (see definition \ref{ds-model} below) corresponds directly to a timestamped bundle. \end{itemize} Messages delivered to honest players by intruders are symbols constrained to be derivable from the intruders current knowledge. The messages are also constrained to be receivable, formalizing the implicit meaning of message patterns. For example, a pattern \texttt{-(enc(x,y))} implies the receiver has the decryption key. By using symbolic terms, a single Maude configuration can represent a number of timed bundles. For example, consider the following Maude configuration with one player \texttt{H(0)} and his associated intruder \texttt{I(0)} \begin{verbatim} [h(0),3 | eif vs(0, 1) :=: e(vs(0, 0), KM) # tt(1) := tt(5) + tMac ethen ... | sk(pv("A"))] [I(0),1 | sk(p("I:0")) n(0,0) | m-old e(n(0,1000),KE) e(e(n(0,1000),KE),KM)] ! tt(5) ! dc(vs(0, 0), z(n(0, 0) m-old)) dc(vs(0, 1), z(n(0, 0) m-old)) ! tt(5) >= 0 and tMac >= 1.0 and tEnc >= 2.0 and tt(6) >= tt(5) ! o(n(0,0),(h(0),1),(I(0),1),tt(5)) ; o({vs(0,0),vs(0,1)},(I(0),0),(h(0),2),tt(6)) \end{verbatim} The honest player is executing the passport protocol described in Example~\ref{ex:passport}. Part of the protocol is omitted, represented by the ellipses \texttt{...}. \texttt{m-old} stands for the messages \texttt{e(n(0,-1),KE) e(e(n(0,-1),KE)} which are messages, corresponding to $\m_{enc}^{old}, \m_{mac}^{old}$, learned by the intruder in a previous protocol session. The protocol has already started as can be verified by the two message transmission events in the \texttt{exe} component: the honest player has sent the nonce \texttt{n(0,0)} which was intercepted by the intruder \texttt{I(0)}. The intruder then sent a pair of symbols \texttt{{vs(0,0),vs(0,1)}} to the honest player. These symbols are constrained as specified by the \texttt{ds} component. In particular, they can be any message constructed using the term learned by the intruder until them, namely: \texttt{sk(p("I:0")) n(0, 0) m-old}. This Maude configuration corresponds, therefore, to all timed bundles where the player sends a nonce and the intruder responds with any message constructed using \texttt{sk(p("I:0")) n(0, 0) m-old}. The executable semantics of for timed protocols is specified by the rewrite rules in Figure~\ref{fig:rewrite-rules}. The whole specification can be found in~\cite{maude-timed}. We explain these rewrite rules in detail:\footnote{In order for improving clarity the rules here differ from the rules~\cite{maude-timed}, but are essentially the same.} \begin{itemize} \item Rule \texttt{snd}: If a honest player \texttt{h(n)} is sending a message \texttt{t}, then this message is learned immediately by the intruder \texttt{I(n)} associated to \texttt{h(n)}. Moreover, it is added to the buffer of the remaining intruders, \texttt{I(m)}, to be learned after it arrives the intruder, at $\texttt{T} + \key{td}(n,m)$. This is specified by the function \texttt{bufAdd(n,t,T,pc)}; \item Rule \texttt{asnd}: Its behavior is similar to the rule \texttt{snd}, but we replace all the occurrences of the time variable \texttt{T1} being assigned by the expression \texttt{TR1} replacing the keyword \texttt{cur} by the global time \texttt{T}; \item Rule \texttt{tsnd}: Its behavior is similar to the rule \texttt{snd}, but it only succeeds if the condition \texttt{b'} associated to the timed input \texttt{t} together with the accumulated time constraints \texttt{b} is satisfiable. To check this, we create a fresh global time \texttt{tt(s m)} which is greater or equal than the global time \texttt{tt(m)}. Then we replace the keyword \texttt{cur} in \texttt{b'} by \texttt{tt(s m)} and check whether the resulting formula \texttt{b2} is satisfiable. The rule can fire only if it is satisfiable. We use the SMT solver CVC4 to check whether the formula \texttt{b2} is satisfiable. This is specified by the command \texttt{(metaCheck(['EXE],toVarsB(b2)))} which returns true if it is satisfiable and false otherwise; \item Rule \texttt{newN}: This rule creates a new nonce \texttt{n(i,j)}. The indexes \texttt{i,j} are used to ensure its freshness. We then replace all occurrences of the variable \texttt{nv:nonceVar} in the remaining protocol specification \texttt{evtl} by \texttt{n(i,j)}. This is done by using the substitution \texttt{sb}. \item Rule \texttt{rcv}: This rule specifies the when a honest player \texttt{h(n)} is expecting to receive a message \texttt{t}. Under the timed intruder model, this message is sent by his associated intruder \texttt{I(n)}. However, instead of sending a concrete message, we use symbolic terms which reduces search space. Given the term \texttt{t}, the set of current symbol constraints \texttt{ds}, and the intruder’s current knowledge \texttt{ts}, we compute (\texttt{sGen}) the possible messages the intruder can construct that can be received by the honest player \texttt{h(n)}. This set is represented symbolically as \texttt{\{sb, css1\}} where \texttt{sb} maps variables of \texttt{t} to new symbols, and \texttt{css1} is a set of pairs \texttt{\{ssb1, ds1\}} where \texttt{ssb1} maps some symbols to terms (a partial solution to the constraints) and \texttt{ds0} extends ds1 with additional constraints needed to match the term \texttt{t}. (\texttt{css1} is written as \texttt{\{ssb, ds0\}, css} in the rule condition to ensure the set is not empty, and to pick one to use). \texttt{sGen} uses both matching and unification to find solutions to the generation problem. \item Rule \texttt{buff}: This rule specifies when an intruder, \texttt{iid}, learns a message \texttt{t} that was sent by another intruder and should reach \texttt{iid} at time \texttt{TR}. For this we create a fresh time symbol \texttt{t(s j)} which is greater than \texttt{t(j)} and is greater than the time \texttt{TR} when the message \texttt{t} is supposed to reach the intruder \texttt{iid}. This is specified by the new timed constraint \texttt{b'}; \item Remaining Rules: We omitted for space reasons the rules specifying the semantics of timed receives, \texttt{(-t) \# b} and \texttt{(-t) \# T1 := TR1}, and conditionals. Their semantics are as expected. The receive rules additionally add time constraints, while the conditional checks whether the condition is true or not. The complete specification can be found in \cite{maude-timed}. \end{itemize} \begin{figure*}[t] \begin{verbatim} rl[snd]: [h(n), j | +(t), evtl | ks] pc ! T ! ds ! b ! exe => [h(n), s j | evtl | ks] bufAdd(n,t,T,pc) ! T ! ds ! b ! exe ; o(t,(h(n),j),(I(n),j),T) crl[asnd]: [h(n), j | +(t # T1 := TR1), evtl | ks] pc ! T ! ds ! b ! exe => [h(n), s j | tsubl(T1,TR2,evtl) | ks] bufAdd(n,t,T,pc) ! T ! ds ! b ! exe ; o(t,(h(n),j),(I(n),j),T) if TR2 := tsubr(cur,T,TR1) . crl[tsnd]: [h(n), j | +(t # b'), evtl | ks] pc ! tt(m) ! ds ! b ! exe => [h(n), s j | evtl | ks] bufAdd(n,t,tt(s m),pc) ! tt(s m) ! ds ! b2 ! exe ; o(t,(h(n),j),(I(n),j),tt(s m)) if b1 := (tt(s m) >= 0/1) and (tt(s m) >= tt(m) and (b)) /\ b2 := tsubb(cur,tt(s m),b') and (b1) /\ (metaCheck(['EXE],toVarsB(b2))) . crl[newN]: [h(i), j | new(nv:nonceVar), evtl | ks] pc ! T ! ds ! b ! exe => [h(i), s j | sb[[evtl]] | ks] pc ! T ! ds ! b ! exe if sb := nv:nonceVar := n(i,j) . crl[rcv]: [h(n), j | -(t), evtl | ks] [I(n),i | ts | tts ] pc ! T ! ds ! b ! exe => [h(n), s j | ssb[[sb[[evtl]]]] | addKeys(t,sb0,ssb[[[ks]]])] [I(n), s i | ssb[[[ts]]] | ssb[[[tts]]] ] ssbPC(ssb,pc) ! T ! ds0 ! b ! ssbExe(ssb,exe) ; o(ssb[sb0[t]],(I(n),i),(h(n),j),T) if {sb,{ssb,ds0} css} := sGen(n,i,t,ts,ds) /\ sb0 := ssbRng(ssb,sb,mtS) /\ receivable(t,sb0,ks) . crl[buff]: [iid, i | ts | (t @ TR1) tts ] pc ! (tt(j)) ! ds ! b ! exe => pc ! (tt(s j)) ! ds ! b' ! exe b' := (tt(s j) >= 0/1) and (tt(s j) >= tt(j) and (tt(s j) >= TR1 and b)) . \end{verbatim} \caption{Rewrite rules specifying the executable semantics for timed bundles. The rules for timed receive commands and conditionals are omitted. \texttt{pc} is a variable for a set of honest players and intruders.} \label{fig:rewrite-rules} \end{figure*} \smallskip In order to connect symbolic executions to concrete ones we need to define the notion of model for the intruder symbol constraints \texttt{ds}. \begin{definition}\label{ds-model} A \emph{model} $M$ of a set of intruder symbol constraints \texttt{ds} is a (sort preserving) mapping from the symbols in \texttt{ds} (domain and range) to ground terms such that for each \texttt{s} in the domain of $M$ that is constrained by \texttt{ds} (\texttt{ds} contains \texttt{dc(s,z(ts-1)...z(ts-k))}), $M(\texttt{s})$ is derivable from each set $M(\texttt{ts-i})$ $1 \le i \le k$. In this case we write $M \vdash \texttt{ds}$ \end{definition} Note that the definition is well-defined due to the fact that \texttt{ds} is required to be non-cyclic. Given a Maude configuration reachable from a Maude initial configuration, the execution component of that Maude configuration represents the concrete executions obtained by applying substitutions that model the symbol constraint component. The following soundness and completeness theorem can be proved by extending the corresponding result (to appear elsewhere) for untimed protocols as the treatment of time constraints is independent from the symbol constraints. \begin{theorem} \label{the:sound-complete} Let $I = \tup{\Hscr,\Iscr,\key{td}}$ be an initial configuration. Let \texttt{I} be the initial Maude configuration corresponding to $I$. There is a one to one correspondence between the timed bundles $\Sscr(I)$ and the concrete executions of Maude configurations reachable using the rules in Figure~\ref{fig:rewrite-rules}. \end{theorem} \subsection{Automating the Proof of Timed Equivalence} We first show how one can prove whether two Maude configurations are equivalent in the sense that for all timed bundles reprsented by $\texttt{C1}$ there is an equivalent timed bundle represented $\texttt{C2}$. We then proceed to show how two initial Maude configurations are equivalent. \paragraph{Maude Configuration Equivalence:} Consider two Maude configurations: \[ \begin{array}{l} \texttt{C1} = \texttt{pc1 ! tSym1 ! ds1 ! b1 ! exe1} \\[2pt] \texttt{C2} = \texttt{pc2 ! tSym2 ! ds2 ! b2 ! exe2} \end{array} \] We determine whether they are equivalent in the sense that for all timed bundles reprsented by $\texttt{C1}$ there is an equivalent timed bundle represented $\texttt{C2}$. Assume without loss of generality that \texttt{C1} and \texttt{C2} have disjoint term symbols and time variables. Let $\texttt{exe1}$ and \texttt{exe2} be the lists: \[ \begin{array}{l} \texttt{exe1} = o(\texttt{m}_1,\texttt{snd}_1,\texttt{rcv}_1,\texttt{ts}_1),\ldots,o(\texttt{m}_n,\texttt{snd}_n,\texttt{rcv}_n,\texttt{ts}_n)] \\ \texttt{exe2} = o(\texttt{m}_1',\texttt{snd}_1',\texttt{rcv}_1',\texttt{ts}_1'),\ldots,o(\texttt{m}_n',\texttt{snd}_n',\texttt{rcv}_n',\texttt{ts}_n')] \end{array} \] Notice that if the executions have different sizes, then the Maude configurations are not equivalent. We proceed by checking whether the bijection \[ o(\texttt{m}_i,\texttt{snd}_i,\texttt{rcv}_i,\texttt{ts}_i) \leftrightarrow o(\texttt{m}_i',\texttt{snd}_i',\texttt{rcv}_i',\texttt{ts}_i') \] for $1 \leq i \leq n$ is a witness for the timed equivalence of the timed bundles represented by \texttt{C1} and \texttt{C2}. This already means that the observations have the same senders and receivers, that is, $\texttt{snd}_i = \texttt{snd}_i'$ and $\texttt{rcv}_i = \texttt{rcv}_i'$, for all $1 \leq i \leq n$. However, we face the following two main challenges in automating this verification: \begin{enumerate} \item \textbf{Term Symbols:} The terms $\texttt{m}_i$ and $\texttt{m}_i'$ for all $1 \leq i \leq n$ may contain symbols. So simple equality will not work. We need to check whether the following formula $F$ is true \[ \begin{array}{l} \forall M_1. (M_1 \vdash \texttt{ds1} \Rightarrow \\ \quad \exists M_2. M_2 \vdash \texttt{ds2} \land \forall 1 \leq i\leq n. M_1[\m_i] \sim M_2[\m_i'] ) \end{array} \] and its converse. We can use our constraint solver to check whether $F$ is true. In particular, we check whether $\neg F$ is false, that is: \[ \begin{array}{l} \exists M_1. (M_1 \vdash \texttt{ds1} \land \\ \quad \neg \exists M_2. M_2 \vdash \texttt{ds2} \land \forall 1 \leq i\leq n. M_1[\m_i] \sim M_2[\m_i'] ) \end{array} \] is false. This means that if we find models $M_1,M_2$, that unifies the messages, then $\neg F$ is false and consequently $F$ is true. Thus, we simply run our constraint solver (\texttt{sGen}) to check whether $\{\texttt{m}_1,\ldots,\texttt{m}_n\}$ is unifiable modulo encryption with $\{\texttt{m}_1',\ldots,\texttt{m}_n'\}$ provided $\texttt{ds1}$ and $\texttt{ds2}$. If there is a solution, then $F$ is true. \item \textbf{Time Variables:} The second challenge is the quantification over all time models in the definition of time equivalence of timed bundles. In particular, we need to check the following formula $G$ is true: \[ \begin{array}{l} \forall M_1. (M_1 \vDash \texttt{b1} \Rightarrow\\ \quad \exists M_2. (M_2 \vDash \texttt{b2} \land \forall 1 \leq i \leq n. M_1[\texttt{tsi}] = M_2[\texttt{tsi'}])) \end{array} \] and its converse. We proceed by checking whether its negation $\neg G$: \[ \begin{array}{l} \exists M_1. (M_1 \vDash \texttt{b1} \land~\\ \quad \neg \exists M_2. (M_2 \vDash \texttt{b2} \land \forall 1 \leq i \leq n. M_1[\texttt{tsi}] = M_2[\texttt{tsi'}])) \end{array} \] is false. Thus if we are able to show that this formula is satisfiable, then we show that $\neg G$ is not false and thus $G$ is true. We can use an SMT solver to the check of whether $\neg G$ is satisfiable. In particular, we ask the SMT-solver to check whether the following formula is satisfiable: \[ \texttt{b1} \land \neg (\texttt{b2} \land (\texttt{ts1} = \texttt{ts1'} \land \cdots \land \texttt{tsn} = \texttt{tsn'})) \] is satisfiable. Assume it is satisfiable with a model $M$. Recall that the time variables of \texttt{b1} and \texttt{b2} are disjoint. This means that there is a model of \texttt{b1}, namely $M$ restricted to the time variables in \texttt{b1}. Moreover, the formula $\exists M_2. (M_2 \vDash \texttt{b2} \land \forall 1 \leq i \leq n. M_1[\texttt{tsi}] = M_2[\texttt{tsi'}]$ is false. Thus, $\neg G$ is satisfiable and $G$ is true. \end{enumerate} \smallskip If the two conditions (same terms and same times) are satisfied, then the Maude configurations \texttt{C1} and \texttt{C2} are equivalent, \ie, for each the timed bundles represented by \texttt{C1} there is an equivalent timed bundle represented by \texttt{C2} and the converse is true. \paragraph{Initial Maude Configuration Equivalence} We now use the machinery described above to show whether two initial Maude configurations \texttt{I1} and \texttt{I2} are equivalent. We first collect all the Maude configurations reachable from \texttt{I1} and \texttt{I2} that cannot be rewritten by the rules in Figure~\ref{fig:rewrite-rules}: \[ \begin{array}{c} \Rscr(\texttt{I1}) = \{\texttt{C1}, \ldots, \texttt{Cn}\} \quad \textrm{and} \quad \Rscr(\texttt{I2}) = \{\texttt{C1}', \ldots, \texttt{Cm}'\} \end{array} \] We then proceed as follows: For each $\texttt{C} \in \Rscr(\texttt{I1})$ (and conversely), we search for an equivalent Maude configuration $\texttt{C'} \in \Rscr(\texttt{I2})$ using the method described above. \begin{lemma} Two initial configurations $I_1 = \tup{\Hscr_1, \Iscr_1, \key{td}}$ and $I_2 = \tup{\Hscr_2, \Iscr_2, \key{td}}$ are timed equivalent if and only if their corresponding initial Maude configuration $\texttt{I1}$ and $\texttt{I2}$ are equivalent. \end{lemma} The following theorem establishes the decidability of the timed equivalence problem. This result depends on the types of term contraints problems involved, \eg, assumptions on the encryption used, and time constraints problems involved, \eg, which theories used. \begin{theorem} Assuming decidable term constraint and time constraint problems, the problem of checking whether two initial configurations $I_1 = \tup{\Hscr_1, \Iscr_1, \key{td}}$ and $I_2 = \tup{\Hscr_2, \Iscr_2, \key{td}}$ are timed equivalent is decidable. \end{theorem} The examples shown here all use decidable term and time contraints problems. \subsection{Symbolic Term Language} The basic term language contains usual cryptographic operators such as encryption, nonces, tuples. More precisely the term language is defined by the following grammar. We assume given text constants, $\Tscr$ and player names $\Pscr$. We also assume a countable set of nonces, $\Nscr$, and of symbols, $\Syms$, as well as a countable number of sorted variables, $\Vscr$, where $\Nscr, \Syms$ and $\Vscr$ are disjoint. Below $\v_p$ represents a variable of sort player. \[ \begin{array}{l@{~}l@{\quad}l@{\quad}l} \multicolumn{2}{l}{\textbf{Basic Constants:}}\\ \c := & \t \in \Tscr & \textrm{Text Constants}\\ & \mid \p \in \Pscr & \textrm{Player Names} \\ & \mid \n \in \Nscr & \textrm{Nonces}\\[2pt] \multicolumn{2}{l}{\textbf{Keys:}}\\ \k := & \mid \symk & \textrm{Symmetric key}\\ & \mid \pk(\p) \mid \pk(\v_p) & \textrm{Public key of a player}\\ & \mid \sk(\p) \mid \sk(\v_p) & \textrm{Secret key of a player}\\[2pt] \multicolumn{2}{l}{\textbf{Symbols:}}\\ \sym := & \mid \sym \in \Syms & \textrm{Symbol}\\[2pt] \multicolumn{2}{l}{\textbf{Terms:}}\\ \m := & \c & \textrm{Basic constants}\\ & \mid \k & \textrm{Keys}\\ & \mid \v \in \Vscr & \textrm{Variables}\\ & \mid \sym \in \Syms& \textrm{Symbols}\\ & \mid \enc(\m,\k) & \textrm{Encryption of term \m with key \k }\\ & \mid \tup{\m_1, \ldots, \m_n} & \textrm{Tuples} \end{array} \] A term is \emph{ground} if it does not contain any occurrence of variables and symbols. A term is \emph{symbolic} if it does not contain any occurrence of variables, but it may contain occurrences of symbols. $\ms,\ms_1,\ms_2, \ldots$ will range over symbolic terms. We define $\Syms(\ms)$ as the set of symbols appearing in a symbolic term. It is possible to add other cryptographic constructions, such as hash, signatures, but in order to keep things simple and more understandable, we only include encryption. As hashes and signatures can be specified using encryption, this is not limiting. Finally, it is easy to extend the results here with fresh keys. These are treated in the same way as nonces, but to keep it simple, we do not include them. We will use two types of (capture avoiding) substitutions. \emph{Variable substitutions} written $\sb, \sb_1, \sb_2, \ldots$ which are maps from variables to symbolic terms $\sb = [\v_1 \mapsto \ms_1,\v_2 \mapsto \ms_2, \ldots, \v_n \mapsto \ms_n ]$. \emph{Symbol substitutions} written $\ssb, \ssb_1, \ssb_2, \ldots$ mapping symbols to symbolic terms $\ssb = [\sym_1 \mapsto \ms_1,\sym_2 \mapsto \ms_2, \ldots, \sym_n \mapsto \ms_n ]$. \subsection{Symbolic Term Constraints} Intuitively, variables are entities that can be replaced by symbolic terms, while a symbol denotes a (possibly infinite) set of terms. For example, if the symbol $\sym_j$ can be instantiated by any one of the (symbolic) terms $\{\ms_1, \ldots, \ms_n\}$, then the symbolic term $\enc(\sym,\k)$ represents the set of terms: \[ \{\enc(\ms,\k) \mid \ms \in \{\ms_1, \ldots, \ms_n\}\} \] Such simple idea has enabled the verification of security protocols, which have infinite search space on ground terms, but finite state space using symbolic terms. We formalize this idea by using derivability constraints. Derivability constraints are constructed over minimal sets defined below. \begin{definition} \label{def:minimal} A set of symbolic messages $\Sscr$ is minimal if it satisfies the following conditions: \begin{itemize} \item $\Sscr$ contains all guessable constants, such as player names and public keys; \item $\Sscr$ does not contain tuples; \item if $\enc(\ms, \k) \in \Sscr$ if and only if $\k^{-1} \notin \Sscr$ where $\k^{-1}$ is the inverse key of $\k$; \end{itemize} Formally, the symbolic terms derivable from $\Sscr$ is the smallest set $\Rscr$ defined inductively as follows: \begin{itemize} \item if $\ms \in \Sscr$ then $\ms \in \Rscr$; \item if $\k \in \Rscr$ and $\ms \in \Rscr$, then $\enc(\ms,\k) \in \Rscr$; \item if $\ms_1', \ldots, \ms_m' \in \Rscr$, then $\tup{\ms_1',\ldots,\ms_m'} \in \Rscr$; \end{itemize} \end{definition} From two minimal sets, $\Sscr_1$ and $\Sscr_2$, we can construct the minimal set, $\Sscr$, representing the union of $\Sscr_1$ and $\Sscr_2$ by applying the following operations until a fixed point is reached starting from $\Sscr_0 = \Sscr_1 \cup \Sscr_2$: \begin{itemize} \item $\enc(\m,\k)\in \Sscr_i$ and $\k^{-1} \in \Sscr_i$, then $\Sscr_{i+1} = \Sscr_i \cup \{\m\}$; \item $\enc(\m,\k),\k, \k^{-1}\in \Sscr_i$, then $\Sscr_{i+1} = \Sscr_i \setminus\{\enc(\m,\k)\} \cup \{\m\}$; \item $\tup{\m_1, \ldots, \m_n} \in \Sscr_i$, then $\Sscr_{i+1} = \Sscr_i \setminus \{\tup{\m_1, \ldots, \m_n}\} \cup \{\m_1, \ldots, \m_n\}$. \end{itemize} For example, given the minimal sets: \[ \Sscr_1 = \{\symk,\pk\} \textrm{ and } \Sscr_2 = \{\enc(\tup{\enc(\t,\sk), \t},\symk)\} \] The minimal set obtained by the union of $\Sscr_1$ and $\Sscr_2$ is: \[ \Sscr = \{\symk,\pk,\t,\enc(\t,\sk)\} \] We consider two types of constraints on terms: Derivability constraints (Definition~\ref{def:dc}) and comparison constraints (Definition~\ref{def:comparison}). \begin{definition} \label{def:dc} A derivability constraint has the form $\dc(\sym, \Sscr)$, where $\Sscr$ is minimal. This constraint denotes that $\sym$ can be any (symbolic) term derived from $\Sscr$. \end{definition} For example, the derivability constraint \[ \dc(\sym, \{alice, bob, eve, \pk(alice), \pk(bob),\sk(eve)\}) \] specifies that $\sym$ may be instantiated by, \eg, the terms $\tup{alice, bob}, \tup{alice, \sk(eve)},$ $\enc({alice, \pk(bob)})$, $\enc(\tup{alice, bob}, \pk(bob))$ and so on. To improve readability (and also reflect our implementation), we will elide in any constraint $\dc(\sym,\Sscr)$ the guessable terms. For example, we write the derivability constraint above simply as $\dc(\sym(1), \{\sk(eve),\})$ as $alice, bob, eve, \pk(alice), \pk(bob)$ are all guessables, namely player names and public keys. Notice that any $\dc(\sym,\Sscr)$ denotes a infinite number of symbolic terms due to the tupling closure. We will abuse notation and use $\ms \in \dc(\sym, \{\ms_1,\ldots, \ms_n\})$ to denote that the symbolic term $\ms$ is in the set of terms that $\sym$ can be instantiated with. Moreover, we assume that for any given set of derivability constraints $\DC$, there is at most one derivability constraint for any given $\sym$, that is, if $\dc(\sym,\Sscr_1), \dc(\sym,\Sscr_2) \in \DC$, then $\Sscr_1 = \Sscr_2$. We write $\dom(\DC) = \{\sym \mid \dc(\sym,\Sscr) \in \DC\}$. We write $\DC(\sym)$ for the derivability constraint for $\sym$ in $\DC$ if it exists. Moreover, we write $\ms \in \DC(\sym)$ if the term can be derived from $\DC(\sym)$. \begin{definition} The symbol dependency graph of a given set of derivability constraints $\DC$, written $\Gscr_\DC$, is a directed graph defined as follows: \begin{itemize} \item Its nodes are symbols in $\DC$, that is, $\dom(\DC)$; \item It contains the edge $\sym_1 \longrightarrow \sym_2$ if and only if $\dc(\sym_1,\Sscr_1), \dc(\sym_2,\Sscr_2) \in \DC$ and $\Sscr_2$ contains at least one occurrence of $\sym _1$. \end{itemize} \end{definition} While in general the symbol dependency graph of $\DC$ can be cyclic, our operational semantics will ensure that these graphs are acyclic. Consider the following set of derivability constraints: \[ \DC_0 = \left\{\begin{array}{c} \dc(\sym_1, \{\sk(eve)\}), \dc(\sym_2, \{\enc(\sym_1, \symk)\}),\\ \dc(\sym_3, \{\enc(\tup{\sym_2,\sym_1}, \pk(Alice)\}),\\ \dc(\sym_4, \{\sym_3, \sym_2\}) \}), \end{array}\right\} \] Its dependency graph is the directed acyclic graph (DAG). \begin{center} \includegraphics[width=0.25\textwidth]{figures/dc.pdf} \end{center} Whenever the dependency graph of a set of constraints is a DAG, we classify the set as acyclic. We can compute a topological sort of the DAG in linear time. For example, a topological sort of $\Gscr_{\DC_0}$ is $[\sym_1, \sym_2, \sym_3, \sym_4]$. Given a set of derivability constraints, we can now formally specify the set of terms that a symbolic term denotes. \begin{definition} \label{def:basic-semantics-terms} Let $\ms$ be a symbolic term. Let $\DC$ be an acyclic set of derivability constraints. Assume $\dc(\sym, \Sscr) \in \DC$. We define the operator $Sub_{\DC}(\sym,\ms)$ as the set of symbolic terms obtained by replacing all occurrences of $\sym$ in $\ms$ by a term $\ms_1 \in \DC(\sym)$. Formally, the set: \[ \left\{\begin{array}{ll} \sigma(\ms) \mid & \sigma = \{\sym \mapsto \ms_1\}\\ & \textrm{ is a substitution where $\ms_1 \in \DC(\sym)$} \end{array}\right\} \] Moreover, $Sub_{\DC}(\sym,\Sscr)$ for a set of symbolic terms $\Sscr$ is the set $\bigcup_{\ms \in \Sscr} Sub_\DC(\sym,\ms)$. Let $\Tscr = [\sym_1,\ldots,\sym_n]$ be any topological sort of the DAG $\Gscr_\DC$. Then the meaning of a symbolic term $\ms$ with respect to $\DC$, written $\DC(\ms)$, is the set obtained by applying $Sub_\DC$ consecutively as follows: \vspace{-2mm} \noindent \begin{small} \[ Sub_\DC(\sym_1, Sub_\DC(\sym_2,Sub_\DC(\ldots Sub_\DC(\sym_n,\ms)\cdots))). \] \end{small} \end{definition} For example, $Sub_{\DC_0}(\sym(4),\enc(\sym(4),\pk(bob)))$ is the set of terms: \[ \{\enc(\ms_1,\pk(bob)) \mid \ms_1 \in \DC_0(\sym(4))\} \] It contains the terms $\enc(\sym_2,\pk(bob)), \enc(\sym_3,\pk(bob))$, $\enc(\tup{\sym_2,\sym_2} ,\pk(bob))$, $\enc(\tup{\sym_2,\sym_3},\pk(bob)), \ldots$. The set $\DC_0(\enc(\sym_4,\pk(bob)))$ contains the terms $\enc(\enc(\sk(eve), \symk),\pk(bob))$, by applying to the term $\enc(\sym_4,\pk(bob))$ the substitution $[\sym_4 \mapsto \sym_2]$ followed by $[\sym_2 \mapsto \enc(\sym_1, \symk)]$ $[\sym_1 \mapsto \sk(eve)]$. Notice that for any acyclic set of derivability constraints such that its lowest height symbols (w.r.t. $\Gscr_\DC$) have constraints of the form $\dc(\sym, \Sscr)$ where $\Sscr$ are ground terms, then $\DC(\ms)$ is an (infinite) set of ground terms. This is because the successive application of $Sub_\DC$ will eventually eliminate all symbols. Given terms $\ms, \ms'$, we describe how to check whether $\ms \in \DC(\ms')$. We first build the matching subsitution $\ssb = \{\sym_1' \mapsto \ms_1, \ldots, \sym_n' \mapsto \ms_n\}$ from symbols in $\ms'$ to (sub)terms in $\ms$. If no such matching subsitution exists, then $\ms \notin \DC(\ms')$. For each $\sym_i'\mapsto \ms_i$, let $\dc(\sym_i, \Sscr_i) \in \DC$. We check whether $\ms_i \in \DC(\sym_i')$ recursively as follows: \begin{itemize} \item If $\ms_i \in \Sscr_i$, return true; \item If $\ms_1 = \enc(\ms_2, \ms_3)$, then we check whether $\tup{\ms_2, \ms_3} \in \DC(\sym_i')$; \item if $\ms_i = \{\ms_i^1,\ldots, \ms_i^m\}$, then for each $1 \leq j \leq m$, we check whether $\ms_i^j \in \DC(\sym_i')$. \end{itemize} \begin{definition} $\ssb \vDash \DC$ if for each $\sym \mapsto \ms \in \ssb$, $\ms \in \DC(\sym)$. \end{definition} The following definitions specify the second type of term constraints called comparison constraints. \begin{definition} \label{def:comparison} A comparison constraint is either an equality constraint of the form $\Eq(\ms_1,\ms_2)$ or an inequality constraint of the form $\Neq(\ms_1,\ms_2)$. \end{definition} A set $\EQ$ of comparison constraints should be interpreted as a conjunction of constraints. The following definition specifies when it is satisfiable. \begin{definition} Let $\DC$ be a set of derivability constraints and $\EQ$ be a set of comparison constraints. The set $\EQ$ is satisfiable w.r.t. $\DC$, written $\DC \vDash \EQ$, if there is a subsitution $\sigma = \{\sym_1 \mapsto \m_1, \ldots, \sym_n \mapsto \m_n\}$ mapping all symbols $\sym_i$ in $\EQ$ to ground terms in $\DC(\sym_i)$, such that: \begin{itemize} \item for all equality constraints $\Eq(\ms,\ms') \in \EQ$, $\sigma[\ms] = \sigma[\ms']$; \item for all inequality constraints $\Neq(\ms,\ms') \in \EQ$, $\sigma[\ms] \neq \sigma[\ms']$. \end{itemize} \end{definition} We define the procedure below, $\eqCheck$, for checking whether a set of comparison constraints $\EQ$ is satisfiable. \begin{definition} \label{def:eqCheck} Let $\EQ$ be a (finite) set of comparison constraints and $\DC$ a set of derivability constraints. Let $\Eq(\ms_1,\ms_1'), \Eq(\ms_2,\ms_2') \ldots \Eq(\ms_n,\ms_n')$ be all the equality constraints in $\EQ$. Then $\eqCheck(\EQ,\DC)$ is true if and only if \begin{enumerate} \item There is a unifer $\ssb$ of the terms $\alpha = \tup{\ms_1, \ldots, \ms_n}$ and $\beta = \tup{\ms_1', \ldots, \ms_n'}$ mapping symbols to symbolic terms, that is, $\ssb(\alpha) = \ssb(\beta)$; \item For all inequality constraint $\Neq(\ms,\ms') \in \EQ$, $\ssb[\ms] \neq \ssb[\ms']$; \item $\ssb$ is consistent with $\DC$ (as done in Section~\ref{subsec:basic-solving}). \end{enumerate} \end{definition} \begin{lemma} \label{lem:eqCheck} $\DC \vDash \EQ$ if and only if $\eqCheck(\EQ,\DC)$. \end{lemma} Moreover, the meaning of a symbolic term should take comparison constraints $\EQ$ into account. That is, it should not be possible to replace a symbol by a term that falsifies some comparison constraint. We extend Definition~\ref{def:basic-semantics-terms} accordingly. \begin{definition} Let $\DC$ be an acyclic set of derivability constraints and $\EQ$ a set of comparison constraints. The meaning of a symbolic term $\ms$ w.r.t. $\DC$ and $\EQ$, written $\DC(\ms)|_\EQ$, is the set of terms $\ms' \in \DC(\ms)$ such that there exists a matching substitution $\theta$: \begin{itemize} \item $\theta(\ms) = \ms'$; \item For all equality constraints $\Eq(\ms_1,\ms_2) \in \EQ$, $\theta(\ms_1) = \theta(\ms_2)$; \item For all inequality constraints $\Neq(\ms_1,\ms_2) \in \EQ$, $\theta(\ms_1) \neq \theta(\ms_2)$. \end{itemize} \end{definition} For example, $\dc(\sym_1, \{\t_1\}),\dc(\sym_2, \{\t_2\}) \in \DC$ and a set of a single comparison constraint $\EQ = \{\Eq(\sym_1, \sym_2)\}$. The term $\tup{\t_1, \t_2} \in \DC(\tup{\sym_1,\sym_2})$, but $\tup{\t_1, \t_2} \notin \DC(\tup{\sym_1,\sym_2})|_\EQ$. This is because the matching substitution $\theta = \{\sym_1 \mapsto \t_1, \sym_2 \mapsto \t_2\}$ turns the constraint $\Eq(\sym_1, \sym_2)$ false: $\t_1 \neq \t_2$. \subsection{Symbolic Time Constraints} Assume a time signature $\Xi$ which is disjoint to the message alphabet $\Sigma$. It contains numbers (real and natural), variables and pre-defined functions. \omitthis{In principle, we can use any function supported by the underlying SMT-solver. [clt: redundant]} \[ \begin{array}{l@{~}l} \r_1,\r_2,\ldots & \textrm{A set of numbers;}\\ \tv_1,\tv_2,\ldots,& \textrm{A set of time variables};\\ & \textrm{including the special variable $\cur$}\\ +,-,\times,/, \floor,\ceiling, \ldots & \textrm{A set of pre-defined functions.} \end{array} \] \emph{Time Expressions} are constructed inductively by applying arithmetic symbols to time expressions. For example $\ceiling((2 + \tv + \cur )/ 10)$ is a Time Expression. The symbols $\tr_1,\tr_2, \ldots$ range over Time Expressions. We do not constrain the set of numbers and function symbols in $\Xi$. However, in practice, we allow only the symbols supported by the SMT solver used. All examples in this paper will contain SMT supported symbols (or equivalent). Finally, the time variable $\cur$ will be a keyword in our protocol specification language denoting the current global time. \begin{definition}[Symbolic Time Constraints] Let $\Xi$ be a time signature. The set of symbolic time constraints is constructed inductively using time expressions as follows: Let $\tr_1,\tr_2$ be time expressions, then \[ \begin{array}{l} \tr_1 = \tr_2, \quad \tr_1 \geq \tr_2 \quad \tr_1 > \tr_2, \quad\tr_1 < \tr_2, \textrm{ and } \tr_1 \leq \tr_2 \end{array} \] are Symbolic Time Constraints. \end{definition} For example, $\cur + 10 < \floor(\tv - 5)$ is a Time Constraint. Time Constraints will range over $\tc, \tc_1, \tc_2, \ldots$. Intutively, given a set of time constraints $\TC$, each of its models with concrete instantiations for the time variables corresponds to a particular scenario. This means that one single set of time constraints denotes a possibly infinite number of concrete scenarios. For example, the set of constraints $\{\tv_1 \leq 2, \tv_2 \geq 1 + \tv_1\}$ has an infinite number of models, \eg, $[\tv_1 \mapsto 2.1, \tv_2 \mapsto 3.1415]$. Finally, SMT-solvers, such as CVC4~\cite{barrett11cvc4} and Yices~\cite{duterte15smt}, can check for the satisfiability of a set of time constraints. \input symbolicCC \section{Timed Protocol Language} \label{subsec:basic-symb-op-sem} The language used to specify a cryptographic protocol has the standard constructions, such as the creation of fresh values, sending and receiving messages. Moreover, it also includes ``if then else'' constructors needed to specify, for example, the RFID protocol used by passports. A protocol is composed of a set of roles. \begin{definition} [Timed Protocols] The set of Timed Protocols, $\TL$, is composed of Timed Protocol Roles, $\tl$, which are constructed by using commands as specified by the following grammar: \[ \begin{array}{l@{\qquad}l} \mathsf{nil} & \textrm{Empty Protocol}\\ \mid (\new~ \v~\#~ \tc), \tl & \textrm{Fresh Constant}\\ \mid (+ \m ~\#~ \tc), \tl & \textrm{Timed Message Output}\\ \mid (- \m ~\#~ \tc), \tl & \textrm{Timed Message Input}\\ \mid (\mathsf{if}~{(\m_1 := \m_2)~\#~\tc}& \textrm{Timed Conditional}\\ ~~\mathsf{then}~{\tl_1}~\mathsf{else}~{\tl_2}) \end{array} \] \end{definition} Intuitively, $\new$ generates a fresh value binding it to the variable $\v$, $(+ \m~\#~ \tc)$ denotes sending the term $\m$ and the $(- \m~\#~ \tc)$ receiving a term, and $(\myif{\m_1 := \m_2~\#~ \tc}{\mathsf{pl}_1}{\mathsf{pl}_2})$ denotes that if $\m_1$ can be matched with $\ms_2$, that is, instantiate the variables in $\m_1$ so that the resulting term is $\ms_2$, then the protocol proceeds by execution $\mathsf{pl}_1$ and otherwise to $\mathsf{pl}_2$. A command is only applicable if the associated constraint $\tc$ is satisfiable. We elide the associated time constraint whenever $\tc$ is a tautology, that is, it is always true. \begin{example} \label{ex:ns} The Needham-Schroeder~\cite{ns} protocol is specified as follows where $X,Y$ are variables: \[ \begin{array}{l} Alice := (\new ~N_a), (+ \enc(\tup{N_a,alice},\pk(Z))), \\ \qquad (- \enc(\tup{N_a,Y},\pk(alice)\})), (+ \enc(Y,\pk(Z)))\\[2pt] Bob := (- \enc(\tup{X,Z},\pk(bob))), (\new ~N_b),\\ \qquad (+ \enc(\tup{X,N_b},\pk(Z)\})), (- \enc(N_b,\pk(bob))) \end{array} \] \end{example} \begin{example} \label{ex:ns2} Consider the following protocol role which is a modification of Alice's role in the Needham-Schroeder's protocol (Example~\ref{ex:ns}): \[ \begin{array}{ll} Alice := & (\new ~N_a), (+\enc(\tup{N_a,alice},\pk(Z))), (- \v),\\ & \quad \mathsf{if}~\v := \enc(\tup{N_a,Y},\pk(alice)\}) \\ & \quad\mathsf{then}~ (+ \enc(Y,\pk(Z)))\\ & \quad\mathsf{else}~(+ error) \\[2pt] \end{array} \] Here, Alice checks whether the received message $\v$ has the expected shape before proceeding. If it does not have this shape, then she sends an error message. \end{example} \begin{example} \label{ex:distance-bounding} The following role specifies the verifier of a (very simple) distance bounding protocol~\cite{brands93eurocrypt}: \[ \begin{array}{l} (\new~\v),(+ \v~\#~\tv = \cur), (- \v~\#~\cur \leq \tv + 4) \end{array} \] It creates a fresh constant and sends it to the prover, remembering the current global time by assigning it to the time variable $\tv$. Finally, when it receives the response $\v$ it checks whether the current time is less than $\tv + 4$. \end{example} \begin{example}[Passport] \label{ex:passport} Timed conditionals can be used to specify the duration of operations, such as checking whether some message is of a given form. In practice, the duration of these operations can be measured empirically to obtain a finer analysis of the protocol~\cite{chothia10fc}. For example, consider the following protocol role: \[ \begin{array}{l} (\new~\v),(+ \v),(- \{\v_{enc},\v_{mac}\}~\#~\tv_0 = \cur),\\ \key{if}~ (\v_{mac} := \enc(\v_{enc},\k_M))~ \# ~ \tv_1 = \tv_0 + \tv_{Mac}\\ \key{then}~ (\key{if}~(\v_{enc} := \enc(\v,\k_E)) ~\# ~ \tv_2 = \tv_1 + \tv_{Enc})\\ \qquad ~\key{then} ~ (+ done ~\#~ \cur = \tv_2)~\key{else}~ (+ error ~\#~ \cur = \tv_2))\\ \key{else}~(+ error ~\#~ \cur = \tv_1) \end{array} \] This role creates a fresh value $\v$ and sends it. Then it is expecting a pair of two messages $\v_{mac}$ and $\v_{enc}$, remembering at time variable $\tv_0$ when this message is received. It then checks whether the first component $\v_{mac}$ is of the form $\enc(\v_{enc},\k_M))$, \ie, it is the correct MAC. This operation takes $\tv_{mac}$ time units. The time variable $\tv_1$ is equal to the time $\tv_0 + \tv_{mac}$, \ie, the time when the message was received plus the MAC check duration. If the MAC is not correct, an $error$ message is sent exactly at time $\tv_1$. Otherwise, if the first component, $\v_{MAC}$, is as expected, the role checks whether the second component, $\v_{enc}$, is an encryption of the form $\enc(\v,\k_E))$, which takes (a longer) time $\tv_{enc}$. If so it sends the $done$ message, otherwise the $error$ message, both at time $\tv_2$ which is $\tv_1 + \tv_{enc}$. \end{example} \begin{example}[Red Pill Example] \label{ex:red-pill} We abstract the part of sending the baseline message, \eg, the messages that establish the connection to the server, and the part that sends the differential messages. We assume that it takes \key{dBase} to complete the exchange of the baseline messages. \[ \begin{array}{l} (-(\key{baseline\_req})~ \#~ \tv_0 = \cur),\\ (+(\key{baseline\_done})~ \#~ \cur = \tv_0 + \key{dBase}),\\ (-(\key{diff\_req})~ \#~ \tv_1 = \cur )\\ (+ (\key{diff\_done})~ \#~ \cur = \tv_1 + \key{dAppl}) \end{array} \] Then the part of the protocol that depends on the application starts. We abstract this part using the messages \key{diff\_req} and \key{diff\_done}. If the application is running over a virtual machine, then \key{dAppl} takes \key{dVirtual} time units; otherwise \key{dAppl} takes \key{dReal} time units, where \texttt{dVirtual > dReal}. The intruder can distinguish whether an application is running over a virtual machine or not by measuring the time it takes to complete the exchange of \key{diff\_req} and \key{diff\_done} messages. \end{example} \begin{example}[Anonymous Protocol] \label{ex:anonymous} We specify (a simplified version of the) anonymous group protocol proposed by Abadi and Fournet for private authentication~\cite{abadi04tcs}. Whenever a broadcasted message is received by an agent, it checks whether it has been encrypted with the group key $KB$. If this is the case, then it checks whether the player sending the message with key $\v_G$ is part of the group. If so, then it sends a response encrypted with his private key. Otherwise, he sends a decoy message. \[ \begin{array}{l} -(\{\key{hello}), \enc(\{\key{hello},\v_n,\v_G,\},\k_G) \} ~\#~ \tv_0 = \cur\\ \key{if}~\k_G: = KB ~\#~ \tv_1 = \tv_0 + \key{dEnc}\\ \key{then} \\ \quad \key{if}~\v_G: = KA ~\#~ \tv_2 = \tv_1 + \key{dCheck}\\ \quad \key{then}~+(\{\key{ack}, \enc(\key{rsp},\k_B)\}) ~\#~ \cur = \tv_1 + \key{dCreate}\\ \quad \key{else}~+(\{\key{ack}, \enc(\key{decoy},\k_B)\}) ~\#~ \cur = \tv_1\\ \key{else}~+(\{\key{ack}, \enc(\key{decoy},\k_B)\}) ~\#~ \cur = \tv_1\\ \end{array} \] Notice the use of time constraints to capture that the steps of the protocol take some time, namely \key{dCheck} and \key{dCreate}. \end{example} \subsection{Operational Semantics for Timed Protocols} The operational semantics of timed protocols is given in Figure~\ref{fig:os-branching}. The rewrite rules are rewrite configurations defined below: \begin{definition} \label{def:basic-configuration} A symbolic term configuration has the form $\tup{\Pscr, \IK, \DC, \EQ, \TC}@\tG$, where \begin{itemize} \item $\Pscr$ is a set of player roles of the form $[n \mid \pl \mid \ks]$ composed by an identifier, $n$, a protocol $\pl$, and a set of known keys $\ks$; \item $\IK$ is the intruder knowledge; \item $\DC$ is a set of derivability constraints; \item $\EQ$ is a set of comparison constraints; \item $\TC$ is a set of time constraints; \item $\tG$ is a time symbol representing global time. \end{itemize} \end{definition} The operational semantics of timed protocols is defined in Figure~\ref{fig:os-timed}. The \textbf{New} rule replaces the (bound) variable $\v$ by a fresh nonce $\n^\nu$. The \textbf{Send} rule sends a message $\ms$ which is then added to the intruder knowledge. The \textbf{Receive} rule expects a term of the form $\m$. The function $\sgen(\m, \IK, \DC)$ returns the variable substitution $\sb$ and a set of solutions $\{\ssb,\DC_1\}~ \css$. Each solution intuitively generates a different trace. We apply $\sb$ in the remaining of the program $\pl$ and apply the symbol substitution $\ssb$ to all symbols in the resulting configuration. This rule also has a proviso that the message $\ms = \ssb[\sb[\m]]$ is encrypted with keys that can be decrypted by the honest participant. This is specified by the function $isReceivable$. Finally, it also adds to the set of keys of the honest participant $\ks$, the keys he can learn from the message $\ms$. The rule \textbf{If-true} checks whether the terms $\m_1$ and $\ms_1$ can be matched from the intruder knowledge $\IK$. This is done by the function $\sgenB$ which is defined in a similar fashion as $\sgen$. It then adds the equality constraint to the set of comparison constraints. Finally, the rule \textbf{If-false} replaces the variables in $\m$ by fresh symbols, constrained in $\DC'$ with the intruder knowlegde. That is if $\sym^\nu$ is a fresh symbol, then $\dc(\sym^\nu,\IK)$. It also adds the corresponding inequality constraint. The intuition of replacing variables in $\m_1$ by fresh symbols is to specify that for any instance of these variables, the resulting term cannot be matched with $\ms_2$ as specifies the inequality constraint. \begin{example} \label{ex:lowe} Consider the Needham-Schroeder protocol in Example~\ref{ex:ns}. Assume that the intruder initially only knows his secret key (and the guessables), $\IK_0 = \{\sk(eve)\}$ and there are no symbols $\DC = \emptyset$. An execution of Alice's protocol role is as follows. Alice creates a fresh constant $N_a$ and sends the message $\enc(\tup{N_a,alice},\pk(eve))$. At this point, the intruder knowledge is: \[ \IK_1 = \IK_0 \cup \{N_a\} \] He now can send a message to $Bob$, namely $\enc(\tup{\sym_1,\sym_2},\pk(bob))$ where $\sym_1,\sym_2$ are fresh and constrained $\DC_1 = \{\dc(\sym_1, \IK_1), \dc(\sym_2, \IK_1)\}$. At this point, Bob creates a fresh value $N_b$ and sends the message $\enc(\tup{\sym_1,N_b},\pk(\sym_2)\})$. The intruder learns this message (and no further): \[ \IK_2 = \IK_1 \cup \{\enc(\tup{\sym_1,N_b},\pk(\sym_2)\})\} \] Now, the intruder can fool alice by sending her a message of the form $\enc(\tup{N_a,Y},\pk(alice)\})$. We create a fresh symbol $\sym_3$ for $Y$ obtaining $\enc(\tup{N_a,\sym_3},\pk(alice)\})$ and attempt to generate this message from $\IK_2$ using $\sgen$. Indeed we can generate this message using $\enc(\tup{\sym_1,N_b},\pk(\sym_2)\}) \in \IK_2$. This generates the $\ssb = [\sym_1 \mapsto N_a, \sym_2 \mapsto alice, \sym_3 \mapsto N_b]$. This substitution is consistent with $\DC_1$. Notice that $\sym_3$ is not constrained. The protocol finishes by the intruder simply forwarding the message send by alice to bob. Bob then thinks he is communicating with alice, but he is not. \end{example} Each rule has two general provisos. The first is that the resulting set of comparison constraints should be consistent. This can be checked as defined in Definition~\ref{def:eqCheck}. The second, more interesting, condition is on the time symbols. Whenever a rule is applied, time constraints $\TC_1$ are added to the configuration's constraint set. These time constraints are obtained by replacing $\cur$ in $\tc$ with $\tG_1$ together with the constraint $\tG_1 \geq \tG_0$ specifying that time can only advance. The rule is fired only if the resulting set of time constraints ($\TC \cup \TC_1$) is consistent, which can be done using SMT solver. This way of specifying systems is called Rewriting Modulo SMT~\cite{rocha-2012}. \begin{figure*}[t] \[ \begin{array}{l} \textbf{New:~}\tup{[n\mid (\new~ \v~\#~ \tc), \mathsf{pl} \mid \ks]~\Pscr,\IK,\DC,\EQ,\TC}@\tG_0 \lra \tup{[n\mid \sb[\mathsf{pl}] \mid \ks]~ \Pscr,\IK,\DC,\EQ,\TC_1}@\tG_1\\ \textrm{where $\n^\nu$ is a fresh nonce and $\sb = [\v \mapsto \n^\nu]$}\\[3pt] \textbf{Send:~}\tup{[n\mid (+ \ms ~\#~ \tc), \mathsf{pl} \mid \ks]~\Pscr, \IK, \DC, \EQ, \TC}@\tG_0 \lra \tup{[n\mid \mathsf{pl} \mid \ks]~ \Pscr, \IK \cup\{\ms\}, \DC, \EQ, \TC_1}@\tG_1\\[3pt] \textbf{Receive:~}\tup{[n\mid (-\m ~\#~ \tc), \mathsf{pl} \mid \ks]~\Pscr, \IK, \DC, \EQ, \TC}@\tG_0 \lra \\ \qquad \qquad \qquad \ssb[\tup{[n\mid \sb[\mathsf{pl}] \mid \addKeys(\ms,\ks)]~ \Pscr, \IK, \DC_1, \EQ,\TC_1}]@\tG_1\\[1pt] \textrm{where~} \{\sb,\{\ssb,\DC_1\}~ \css \} := \sgen(\m,\IK,\DC)\textrm{ and }\ms = \ssb[\sb[\m]]\textrm{ and } isReceivable(\ms,\ks) \\[3pt] \textbf{If-true:~} \tup{[n\mid (\myif{(\m_1 := \ms_2~\#~ \tc) }{\mathsf{pl}_1}{\mathsf{pl}_2}) \mid \ks]~\Pscr,\IK, \DC, \EQ,\TC}@\tG_0 \lra \\ \qquad \qquad \qquad \ssb[\tup{[n\mid \sb[\mathsf{pl_1}] \mid \ks~ \Pscr,\IK, \DC_1, \EQ \cup \{\Eq(\sb[\m_1], \sb[\ms_2])\},\TC_1}]@\tG_1\\[1pt] \textrm{where~} \{\sb,\{\ssb,\DC_1\}~ \css \} := \sgenB(\m_1 = \ms_2,\IK,\DC)\\[3pt] \textbf{If-false:~} \tup{[n\mid (\myif{\m_1 := \ms_2}{\mathsf{pl}_1}{\mathsf{pl}_2}) \mid \ks]~\Pscr, \IK, \DC, \EQ} \lra \\ \qquad \qquad \tup{[n\mid \sb[\mathsf{pl_2}] \mid \ks]~\Pscr,\IK, \DC \cup \DC', \EQ \cup\{\Neq(\sb[\m_1],\ms_2)\}} \\[1pt] \textrm{where~$\sb$ replaces the variables in $\m_1$ by fresh symbols which are constrained with $\IK$ in $\DC'$}\\[1pt] \end{array} \] \caption{Operational semantics for basic protocols. Here $\sb$ is a substitution mapping the variables in $\m$ by fresh symbols; and the function $rng$ applies the symbol substitution $\ssb$ to the range of the variable substitution $\sb$; $\tc_1$ is the time constraint obtained by replacing $\cur$ in $\tc$ by the global time $\tG_1$; and $\TC_1 = \TC\cup\{\tG_1 \geq \tG_0,\tc_1\}$. The function isReceivable checks whether the message $\ssb[\sb[\m]]$ can be decrypted with the keys he has in $\ks$. Every rule has the proviso that the set of comparison constraints and the set of time constraints should be satisfiable. Rules are only applicable if the set of time constraints are consistent.} \label{fig:os-timed} \label{fig:os-basic} \label{fig:os-branching} \end{figure*} \begin{definition} \label{def:basic-traces} Let $\Rscr$ be the set of rules in Figure~\ref{fig:os-timed}. A timed trace is a labeled sequence of transitions written $\Cscr_1 \stackrel{l_1}{\lra} \Cscr_2 \stackrel{l_2}{\lra} \cdots \stackrel{l_{n-1}}{\lra} \Cscr_n$ such that for all $1 \leq i \leq n-1$, $\Cscr_i \lra \Cscr_{i+1}$ is an instance of a rule in $\Rscr$ and $l_i$ is $+\ms @ \tG_1$ if it is an instance of Send rule sending term $\ms$ at time $\tG_1$, $-\ms @ \tG_1$ if it is an instance of Receive rule receiving term $\ms$ at time $\tG_1$, and $\emptyset$ otherwise. \end{definition} The use of rewriting modulo SMT considerably reduces the search space. Timed protocols are infinite state systems, as time symbols can be instantiated by any (positive) real number. With the use of rewriting modulo SMT we simply have to accumulate constraints. Only traces with satisfiable sets of time constraints are allowed. Indeed, as we describe in Section~\ref{sec:exp}, the number of traces is not only finite (as stated in the following Proposition), but very low (less than 40 traces). As observational equivalence involves the matching of traces, checking for observational equivalence can be automated. \begin{proposition} \label{prop:finite-traces} The set of traces starting from any configuration $\Cscr_0$ is finite. \end{proposition} \begin{proposition} \label{prop:trace-properties} Let $\tau = \Cscr_1 \stackrel{l_1}{\lra} \Cscr_2 \stackrel{l_2}{\lra} \cdots \stackrel{l_{n-1}}{\lra} \Cscr_n$ be a trace. For any $\Cscr_i = \tup{\Pscr_i, \IK_i, \DC_i, \EQ_i}$, such that $1 \leq i \leq n$, the following holds: \begin{itemize} \item For any $i \leq j \leq n$, $ \DC_n(\IK_{i})|_{\EQ_n} \subseteq \DC_n(\IK_{j})|_{\EQ_n}$, that is, the intruder knowledge can only increase; \item $\DC_{i}$ is an acyclic set of derivability constraints; \item Let $\sym_k$ be a symbol created in some $\Cscr_k$, $k < i$ and let $\sym_i$ be a symbol created in $\Cscr_i$. If $\dc(\sym_k,\Sscr_k),\dc(\sym_i,\Sscr_i) \in \DC_i$, then $\Sscr_k \subseteq \Sscr_i$. That is, symbols that are introduced at a later transitions can be instantiated by more terms than symbols introduced at earlier transitions. \end{itemize} \end{proposition} \paragraph{Timed Intruders:} In fact, our implementation generalizes the machinery in this section by considering multiple timed intruders~\cite{kanovich14fccfcs,nigam16esorics}. As described in~\cite{kanovich14fccfcs}, the standard Dolev-Yao may not be suitable for the verificaiton of Cyber-Physical Security Protocols where the physical properties of the environment is important. Differently from the Dolev-Yao intruder, a timed intruder needs to wait for the message to arrive before he can learn it. \cite{nigam16esorics} proved an upper-bound on the number of timed intruders. Our tool implements this strategy. However, for the examples considered here, the standard Dolev-Yao intruder is enough. \section{Timed Protocol Specification Language}\label{lang} This section reviews the timed protocol specification language introduced previously~\cite{nigam16esorics}. \subsection{Syntax} We start first by specifying the syntax of our protocol specification language with symbolic time variables and symbolic time constraints. We exemplify the specification of protocols using our language. Then, we formalize the operational semantics of our language by extending Strand Spaces~\cite{thayer99jcs} to include time variables. \paragraph{Message Expressions} We assume a message signature $\Sigma$ of constants, and function symbols. Constants include nonces, symmetric keys and player names. The set of messages is constructed as usual using constants, variables and at least the following function symbols: \[ \begin{array}{l@{\qquad}p{5cm}} \sk(\p) & \textrm{Denoting the secret key of the player $\p$;}\\ \pk(\p) & \textrm{Denoting the public key of the player $\p$;}\\ \enc(\m,\k) & \textrm{Encryption function denoting the encryption of $m$ using key $k$;}\\ \lst{\m_1,\m_2,\ldots,\m_n} & \textrm{Tuple function denoting a list of messages $\m_1,\m_2,\ldots,\m_n$;}\\ \end{array} \] where $\c_1, \c_2, \ldots$ range over constants, $\n_1,\ldots,\n_n$ range over nonces, $\k_1,\k_2,\ldots$ range over symmetric keys, $\p_1, \p_2 \ldots$ range over player names, $\v_1,\v_2, \ldots$ range over variables, and $\m_1,\m_2,\ldots$ range over messages. For example, the message $\enc(\lst{\v_1, \enc(\c,\k)},\pk(\p))$ denotes the encryption using the public key of \p of the pair of messages $\v_1$ (not instantiated) and $\enc(\c,\k)$. We define $ (\pk(\p))^{-1} = \sk(\p)$ and $\k^{-1} = k$ if $\k$ is a symmetric key. We also write interchangeably the singleton tuple $\{\m\}$ and $\m$. For a given scenario with some protocol session instances, we are going to distinguish the players that are participating in the protocol sessions, \eg, honest participants, which we call \emph{protocol participants} (briefly \emph{participants}), from the \emph{Timed Intruders} which are not participating explicitly in the protocol sessions in the given scenario, but are simply manipulating messages and possibly interacting with the participants. The symbols $\p_1, \p_2 \ldots$ will range over participant names while $\ti_1, \ti_2, \ldots$ will range over the names of such Timed Intruders. \paragraph{Time Expressions} We also assume a time signature $\Xi$ which is disjoint to the message alphabet $\Sigma$. It contains: \[ \begin{array}{l@{\quad}p{4cm}} \r_1,\r_2,\ldots & \textrm{A set of numbers;}\\ \tv_1,\tv_2,\ldots,& \textrm{A set of time variables including the special variable $\cur$};\\ +,-,\times,/, \floor,\ceiling, \ldots & \textrm{A set of arithmetic symbols and other function symbols.} \end{array} \] \emph{Time Expressions} are constructed inductively by applying arithmetic symbols to time expressions. For example $\ceiling((2 + \tv + \cur )/ 10)$ is a Time Expression. The symbols $\tr_1,\tr_2, \ldots$ range over Time Expressions. We do not constrain the set of numbers and function symbols in $\Xi$. However, in practice, we allow only the symbols supported by the SMT solver used. All examples in this paper will contain SMT supported symbols (or equivalent). Finally, the time variable $\cur$ will be a keyword in our protocol specification language denoting the current global time. \begin{definition}[Symbolic Time Constraints] Let $\Xi$ be a time signature. The set of symbolic time constraints is constructed inductively using time expressions as follows: Let $\tr_1,\tr_2$ be time expressions, then \[ \begin{array}{l} \tr_1 = \tr_2, \qquad \tr_1 \geq \tr_2 \qquad \tr_1 > \tr_2,\\\tr_1 < \tr_2, \quad \textrm{and} \quad \tr_1 \leq \tr_2 \end{array} \] are Symbolic Time Constraints. \end{definition} For example, $\cur + 10 < \floor(\tv - 5)$ is a Time Constraint. The symbols $\tc_1, \tc_2, \ldots$ will range over Time Constraints. Finally, we let $\b_1, \b_2, \ldots$, range over boolean expressions. We also allow for checking whether two messages $\m_1$ and $\m_2$ can be matched, \eg, $\lst{\v_1,\v_2} :=: \lst{\p_1, \k_1}$ evaluates to true as they can be matched by the substitution $\{\v_1 \mapsto \p_1,\v_2 \mapsto \k_1\}$. \begin{definition} [Timed Protocols] The set of Timed Protocols, $\PL$, is composed of Timed Protocol Roles, $\pl$, which are constructed by using commands as specified by the following grammar, where $\b$ is a boolean expression: \[ \begin{array}{l@{\qquad}l} \mathsf{nil} & \textrm{Empty Protocol}\\ \mid (\new~ \v), \mathsf{pl} & \textrm{Fresh Constant}\\ \mid (+ \m), \mathsf{pl} & \textrm{Message Output}\\ \mid (+ \m ~\#~ \tc), \mathsf{pl} & \textrm{Timed Message Output}\\ \mid (- \m), \mathsf{pl} & \textrm{Message Input}\\ \mid (- \m ~\#~ \tc), \mathsf{pl} & \textrm{Timed Message Input}\\ \mid (\myif{\b}{\mathsf{pl}_1}{\mathsf{pl}_2}) & \textrm{Conditional}\\ \mid (\myif{\b~\#~\tc}{\mathsf{pl}_1}{\mathsf{pl}_2}) & \textrm{Timed Conditional} \end{array} \] \end{definition} To identify a particular command in a Timed Protocol Role we use a string of the form $i_1.i_2.i_3.\ldots.i_n$, called position and denoted by $\bar{i}$, where each $i_j \in \{1,2\}$ to specify a path in the control flow of the Timed Protocol. For example, $1.1.1.1.2$ in Example~\ref{ex:passport} below leads to $(+ error ~\#~ \cur = \tv_1)$. We denote by $\mathcal{PS}(\pl)$ the set of strings representing the paths in the Timed Protocol Role $\pl$. We explain some examples intuitively before we formalize the semantics of our language in the following section. We will elide $\mathsf{nil}$ whenever it is clear from the context. \begin{example} \label{ex:distance-bounding} The following role specifies the verifier of a (very simple) distance bounding protocol~\cite{brands93eurocrypt}: \[ \begin{array}{l} (\new~\v),(+ \v~\#~\tv = \cur), (- \v~\#~\cur \leq \tv + 4) \end{array} \] It creates a fresh constant and sends it to the prover, remembering the current global time by assigning it to the time variable $\tv$. Finally, when it receives the response $\v$ it checks whether the current time is less than $\tv + 4$. \end{example} \begin{example}[Passport] \label{ex:passport} Timed conditionals can be used to specify the duration of operations, such as checking whether some message is of a given form. In practice, the duration of these operations can be measured empirically to obtain a finer analysis of the protocol~\cite{chothia10fc}. For example, consider the following protocol role: \[ \begin{array}{l} (\new~\v),(+ \v),(- \{\v_{enc},\v_{mac}\}~\#~\tv_0 = \cur),\\ \key{if}~ (\v_{mac} :=: \enc(\v_{enc},\k_M))~ \# ~ \tv_1 = \tv_0 + \tv_{Mac}\\ \key{then}~ (\key{if}~(\v_{enc} :=: \enc(\v,\k_E)) ~\# ~ \tv_2 = \tv_1 + \tv_{Enc})\\ \qquad ~\key{then} ~ (+ done ~\#~ \cur = \tv_2)~\key{else}~ (+ error ~\#~ \cur = \tv_2))\\ \key{else}~(+ error ~\#~ \cur = \tv_1) \end{array} \] This role creates a fresh value $\v$ and sends it. Then it is expecting a pair of two messages $\v_{mac}$ and $\v_{enc}$, remembering at time variable $\tv_0$ when this message is received. It then checks whether the first component $\v_{mac}$ is of the form $\enc(\v_{enc},\k_M))$, \ie, it is the correct MAC. This operation takes $\tv_{mac}$ time units. The time variable $\tv_1$ is equal to the time $\tv_0 + \tv_{mac}$, \ie, the time when the message was received plus the MAC check duration. If the MAC is not correct, an $error$ message is sent exactly at time $\tv_1$. Otherwise, if the first component, $\v_{MAC}$, is as expected, the role checks whether the second component, $\v_{enc}$, is an encryption of the form $\enc(\v,\k_E))$, which takes (a longer) time $\tv_{enc}$. If so it sends the $done$ message, otherwise the $error$ message, both at time $\tv_2$ which is $\tv_1 + \tv_{enc}$. \end{example} \begin{example}[Red Pill Example] We abstract the part of sending the baseline message, \eg, the messages that establish the connection to the server, and the part that sends the differential messages. We assume that it takes \key{dBase} to complete the exchange of the baseline messages. \[ \begin{array}{l} (-(\key{baseline\_req})~ \#~ \tv_0 = \cur),\\ (+(\key{baseline\_done})~ \#~ \cur = \tv_0 + \key{dBase}),\\ (-(\key{diff\_req})~ \#~ \tv_1 = \cur )\\ (+ (\key{diff\_done})~ \#~ \cur = \tv_1 + \key{dAppl}) \end{array} \] Then the part of the protocol that depends on the application starts. We abstract this part using the messages \key{diff\_req} and \key{diff\_done}. If the application is running over a virtual machine, then \key{dAppl} takes \key{dVirtual} time units; otherwise \key{dAppl} takes \key{dReal} time units, where \texttt{dVirtual > dReal}. The intruder can distinguish whether an application is running over a virtual machine or not by measuring the time it takes to complete the exchange of \key{diff\_req} and \key{diff\_done} messages. \end{example} \begin{example}[Anonymous Protocol] We specify (a simplified version of the) anonymous group protocol proposed by Abadi and Fournet's protocol for private authentication~\cite{abadi04tcs}. Whenever a broadcasted message is received by an agent, it checks whether it has been encrypted with the group key $KB$. If this is the case, then it checks whether the player sending the message with key $\v_G$ is part of the group. If so, then it sends a response encrypted with his private key. Otherwise, he sends a decoy message. \[ \begin{array}{l} -(\{\key{hello}), \enc(\{\key{hello},\v_n,\v_G,\},\k_G) \} ~\#~ \tv_0 = \cur\\ \key{if}~\k_G :=: KB ~\#~ \tv_1 = \tv_0 + \key{dEnc}\\ \key{then} \\ \quad \key{if}~\v_G :=: KA ~\#~ \tv_2 = \tv_1 + \key{dCheck}\\ \quad \key{then}~+(\{\key{ack}, \enc(\key{rsp},\k_B)\}) ~\#~ \cur = \tv_1 + \key{dCreate}\\ \quad \key{else}~+(\{\key{ack}, \enc(\key{decoy},\k_B)\}) ~\#~ \cur = \tv_1\\ \key{else}~+(\{\key{ack}, \enc(\key{decoy},\k_B)\}) ~\#~ \cur = \tv_1\\ \end{array} \] Notice the use of time constraints to capture that the steps of the protocol take some time, namely \key{dCheck} and \key{dCreate}. \end{example} \subsection{Semantics} We formalize the semantics of Timed Protocols by extending Strand Spaces and Bundles~\cite{thayer99jcs} to include time constraints and a network topology. \paragraph{Network Topology} Messages take time to travel between agents, both honest players and intruders. The network model is specified by representing the time a message needs to travel from any agent $a$ to any agent $b$, specified by $\td{a}{b}$ using a function that takes two names and returns a number. Typically, $\td{a}{a} = 0$, that is the time for a message sent from a player to reach himself is 0, but we do not need to enforce this. We also assume the following axiom for all players $a,a_1, \ldots, a_n,a'$ (with $1 \leq n$): \begin{equation} \td{a}{a'} \leq \td{a}{a_1} + \td{a_1}{a_2} + \cdots + \td{a_n}{a'} \label{eq:geometry} \end{equation} That is, it is at least as fast for a message to travel directly from $a$ to $a'$, then to first travel through $a_1,\ldots,a_n$. This is similar to the usual triangle inequality in basic geometry. A given scenario with some protocol session instances includes the protocol participants (or simply participants), $\Pscr = \{\p_1, \ldots, \p_n\}$ and a set of Timed Intruders $\Iscr = \{\ti_1, \ldots,\ti_m\}$, who may be manipulating messages. The Network Topology is composed by two disjoint functions $\key{td} = \key{td}_\Pscr \uplus \key{td}_\Iscr$ defined as follows: \[ \td{a}{b} = \left\{ \begin{array}{ll} \key{td}_\Pscr(a,b) & \textrm{if $a,b \in \Pscr$}\\ \key{td}_\Iscr(a,b) & \textrm{otherwise} \end{array}\right. \] Thus, $\key{td}_\Pscr$ specifies the time messages take to travel among participants, while $\key{td}_\Iscr$ specifies the time messages take to travel between Timed Intruders, between a Timed Intruder and a participant and between a participant and a Timed Intruder. \begin{remark} \label{rem:transmission} Here we are assuming that all agents share the same transmission medium for simplicity. It is possible to allow for different communication channel by adding an additional parameter to \key{td}. \end{remark} The following definitions extend Strands and Bundles to include time variables capturing the semantics of Timed Protocols. A Timed Protocol Role is ground if it does not contain variables. \begin{definition} A Timed Strand Space is a set $\Pi$ and a trace mapping $tr : \Pi \lra \Pscr \times \GPL$, where $\Pscr$ is the set of player names $\{\p_1, \ldots, \p_n\}$ and $\GPL$ is the set of Ground Timed Protocol Roles. We denote by $tr(s)_1$ the player name and $tr(s)_2$ the Timed Protocol Role of a strand $s \in \Pi$. \end{definition} For the remainder we fix a Timed Strand Space $[\Pi,tr]$. \begin{definition} \label{def:timed-strands} The Timed Strand Space Graph, $\Gscr = \tup{\Nscr,\Rightarrow \cup \rightarrow}$, has nodes $\Nscr$ and edges $\Rightarrow$ and $\rightarrow$ as defined below. \begin{enumerate} \item A node $n$ is a tuple $\tup{\p,s,\bar{i}}@\tv$ with $s \in \Pi$, $\p = tr(s)_1$, $\bar{i}\in \mathcal{PS}(tr(s)_2)$ is a string identifying a command in the Timed Protocol, and $\tv$ is a time variable timestamping the node $n$. The set of nodes is denoted by $\Nscr$; \item If $n = \tup{\p,s,\bar{i}}@\tv$, we denote by $term(n)$, the command at position $\bar{i}$ in $tr(s)_2$; \item If $n_1 = \tup{\p,s,\bar{i}}@\tv_1$ and $n_2 = \tup{\p,s,\bar{i}.j}@\tv_2$ are in $\Nscr$, then there is an edge $n_1 \Rightarrow n_2$; \item For two nodes $\n_1, \n_2 \in \Nscr$, there is an edge $n_1 \rightarrow n_2$ if and only if $term(n_1)$ is of the form $+\m$ or $+\m~\#~\tc_1$ and $term(n_2)$ is of the form $-\m$ or $-\m~\#~\tc_2$; \item If a node $n \in \Nscr$, $term(n) = \new~\c$, then $\c$ originates on $n$, that is, all nodes $n'$ such that $term(n')$ contains $\c$ are such that $n~(\Rightarrow \cup \rightarrow)^* ~n'$, where $(\cdot)^*$ is the reflexive and transitive closure operator. \end{enumerate} \end{definition} \begin{definition} \label{def:timed-constraint-set} Let $\key{td}$ be a Network Topology and let $\Cscr = \tup{\Nscr_\Cscr,\rightarrow_\Cscr \cup \Rightarrow_\Cscr}$ be a subgraph of $\Gscr = \tup{\Nscr,\Rightarrow \cup \rightarrow}$. The Timed Constraint Set of $\Cscr$ over $\key{td}$, denoted by $\TC(\Cscr,\key{td})$, is the smallest set of Time Constraints specified as follows: \begin{enumerate} \item If $n = \tup{\p,s,\bar{i}}@\tv \in \Nscr_\Cscr$, such that $term(n)$ is of the form $\pm \m~\#~\tc$ or $\key{if}~{\b~\#~\tc}$, then $\tc' \in \TC(\Cscr,\key{td})$ where $\tc'$ is the Time Constraint obtained by replacing $\cur$ by $\tv$; \item If $\tup{\p,s,\bar{i}}@\tv_1 \Rightarrow_\Cscr \tup{\p,s,\bar{i}.j}@\tv_2$, then $\tv_2 \geq \tv_1 \in \TC(\Cscr,\key{td})$; \item If $\tup{\p_1,s_1,\bar{i}_1}@\tv_1 \rightarrow_\Cscr \tup{\p_2,s_2,\bar{i}_2}@\tv_2$, then $\tv_2 \geq \tv_1 + \td{\p_1}{\p_2} \in \TC(\Cscr,\key{td})$. \end{enumerate} \end{definition} Intuitively, the $\Rightarrow$ specifies the sequence of actions carried out by a protocol session participant, while the $\rightarrow$ specifies the interactions between protocol sesssion participants. However, not all timed strand space graph will correspond to possible executions. Thus, we introduce Timed Bundle which is a subset of the Timed Strand space graph, playing a similar role of Bundles for Strand Spaces. \begin{definition} Let $\key{td}$ be a Network Topology. Let $\rightarrow_\Cscr \subseteq \rightarrow$ and $\Rightarrow_\Cscr \subseteq \Rightarrow$ and suppose $\Cscr = \tup{\Nscr_\Cscr,\rightarrow_\Cscr \cup \Rightarrow_\Cscr}$ is a sub-graph of $\tup{\Nscr,\Rightarrow \cup \rightarrow}$. $\Cscr$ is a Timed Bundle over $\key{td}$ if: \begin{enumerate} \item $\Cscr$ is finite and acyclic; \item $n_2 \in \Nscr_\Cscr$ is Message Input or a Timed Message Input, then there is a unique $n_1 \in \Nscr_\Cscr$ such that $n_1 \rightarrow_\Cscr n_2$; \item $n_2 \in \Nscr_\Cscr$ and $n_1 \Rightarrow n_2$, then $n_1 \in \Nscr_\Cscr$, and $n_1 \Rightarrow_\Cscr n_2$; \item $n = \tup{\p,s,\bar{i}}$ is a node such that $term(n)$ is of the form $\key{if}~{\b}$ or $\key{if}~{\b~\#~\tc}$ and $\b$ is evaluated to true, then $n \Rightarrow_\Cscr \tup{\p,s,\bar{i}.1}$ and $n \nRightarrow_\Cscr \tup{\p,s,\bar{i}.2}$; otherwise $n \Rightarrow_\Cscr \tup{\p,s,\bar{i}.2}$ and $n \nRightarrow_\Cscr \tup{\p,s,\bar{i}.1}$; \item the Timed Constraint Set of $\Cscr$ over $\key{td}$ is satisfiable, \ie, there is a substitution $\sigma$, called model of $\TC(\Cscr,\key{td})$, replacing all time variables in $\TC(\Cscr,\key{td})$ by Real numbers so that all inequalities in $\TC(\Cscr,\key{td})$ are true. \end{enumerate} \end{definition} \subsection{Timed Intruder Model} The Timed Intruder Model is similar to the usual Dolev-Yao Intruder Model in the sense that it can compose, decompose, encrypt and decrypt messages provided it has the right keys. However, unlike the Dolev-Yao intruder, a Timed Intruder is constrained by the physical properties of the systems, namely, an intruder is not able to learn any message instantaneously, instead, must wait until the message arrives. A Timed Intruder Set is a set of intruder names $\Iscr = \{\ti_1,\ldots,\ti_n\}$ a set of initially known keys $K_P$, which contain all public keys, all private keys of all the intruders, all symmetric keys initially shared between intruders and honest players, and may contain ``lost keys'' that an intruder learned previously by, for instance, succeeding in some cryptoanalysis. Recall that Timed Intruders are situated at locations specified by the Network Topology. For instance, $\td{\p_1}{\ti_1} = \key{td}_\Iscr({\p_1},{\ti_1}) = 4$ denotes that the timed needed for a message to travel from participant $\p_1$ to intruder $\ti_1$ is $4$. \begin{definition} \label{def:ind-strands} An intruder trace is one of the following, where $\ti$ is a Timed Intruder Name, $\tv,\tv_1,\tv_2,\tv_3$ are time variables, and $\m,\m_1,\ldots, \m_n,\m_1',\ldots,\m_p'$ are messages: \begin{itemize} \item \textrm{Text Message:} $\tup{\ti,+ \t}@\tv$, where $\t$ is a text constant; \item Flushing: $\tup{\ti,-\m}@\tv$; \item Forward: $\tup{\ti, -\m, +\m}@(\tv_1,\tv_2)$ denoting the strand $\tup{\ti,-\m}@\tv_1 \Rightarrow \tup{\ti,+\m}@\tv_2$; \item Concatenation: \\ $\tup{\ti,-\{\m_1,\ldots,\m_n\}, -\{\m_1',\ldots,\m_p'\},\\ + \{\m_1,\ldots,\m_n,\m_1',\ldots,\m_p'\}}@(\tv_1,\tv_2,\tv_3)$ denoting the strand \begin{small} \( \begin{array}{l} \tup{\ti,-\{\m_1,\ldots,\m_n\}}@\tv_1 \Rightarrow\\ \tup{\ti,-\{\m_1',\ldots,\m_p'\}}@\tv_2 \Rightarrow\\ \tup{\ti,+ \{\m_1,\ldots,\m_n,\m_1',\ldots,\m_p'\}}@\tv_3 \end{array} \) \end{small} \item Decomposing: $\tup{\ti,-\{\m_1,\ldots,\m_n\}, +\{\m_1,\ldots,\m_i\},\\+\{\m_{i+1},\ldots,\m_n\} }@(\tv_1,\tv_2,\tv_3)$ denoting the strand \begin{small} \( \begin{array}{l} \tup{\ti,-\{\m_1,\ldots,\m_i,\m_{i+1},\ldots,\m_n\}}@\tv_1 \Rightarrow\\ \tup{\ti,+\{\m_1,\ldots,\m_i\}}@\tv_2 \Rightarrow\\ \tup{\ti,+ \{\m_{i+1},\ldots,\m_n\}}@\tv_3 \end{array} \) \end{small} \item Key: $\tup{\ti,+\k}@\tv$ if $\k \in K_P$; \item Encryption: $\tup{\ti,-\k,-\m,+\enc(\m,\k)}@(\tv_1,\tv_2,\tv_3)$ denoting the strand \( \begin{array}{c} \tup{\ti,-\k}@\tv_1 \Rightarrow \tup{\ti,-\m}@\tv_2 \Rightarrow \tup{\ti,+\enc(\m,\k)}@\tv_3 \end{array} \) \item Decryption: $\tup{\ti,-\k^{-1},-\enc(\m,\k),+\m}@(\tv_1,\tv_2,\tv_3)$. \( \begin{array}{c} \tup{\ti,-\k^{-1}}@\tv_1 \Rightarrow \tup{\ti,-\enc(\m,\k)}@\tv_2 \Rightarrow \tup{\ti,+\m}@\tv_3 \end{array} \) \end{itemize} \end{definition} As with the the usual Dolev-Yao intruder model as, e.g., in \cite{thayer99jcs}, the Timed Intruder can send text messages and known keys, receive a message, replay a message, concatenate and decompose messages, and finally encrypt and decrypt messages. There are, however, two differences with respect to the usual Dolev-Yao intruder model as defined in \cite{thayer99jcs}. Each node of the trace is associated with an intruder name $\ti$ and a time variable $\tv$. These are necessary for extracting the Time Constraints of a Strand Graph (as described in Definition~\ref{def:timed-constraint-set}), specifying the physical restrictions of the Timed Intruder. As the time when timed intruders receive and manipulate messages cannot be measured by the protocol participants, they do not have control over the time variables of timed intruder strands. The following assumption captures this intuition: \paragraph{Time Variable Disjointness Assumption} For any Bundle $\Bscr$, the set of time variables appearing in protocol participant strands in $\Bscr$ is disjoint from the set of time variables appearing in timed intruder strands in $\Bscr$. \begin{figure*}[t] \begin{center} \includegraphics[width=0.8\textwidth]{figs/strand-distance-bounding-mafia.pdf} \end{center} \caption{Bundle for the mafia attack described in Example~\ref{ex:mafia-attack}.} \label{fig:strand-mafia} \end{figure*} \begin{example} \label{ex:mafia-attack} Let us return to the distance bounding protocol described in Example~\ref{ex:distance-bounding}. The following is an attack, where two colluding intruders $\ti_1$, who is close to $\p_1$, and $\ti_2$, who is close to $\p_2$, collude by sharing a fast channel to fool $\p_1$ into thinking that $\p_2$ is closer than he actually is. The intruders $\ti_1$ and $\ti_2$ simply forward messages between each other and the players $\p_1$ and $\p_2$. However, this is a Bundle only if the following Time Constraint Set is satisfiable: \[ \left\{ \begin{array}{c} \tv_2 \geq \tv_1, \tv = \tv_2, \tv_6 \geq \tv_2 + \td{\p_1}{\ti_1}, \tv_7 \geq \tv_6,\\ \tv_8 \geq \tv_7 + \td{\ti_1}{\ti_2}, \tv_9 \geq \tv_8, \tv_4 \geq \tv_9 + \td{\ti_1}{\p_2},\\ \tv_5 \geq \tv_4, \tv_{10} \geq \tv_5 + \td{\p_2}{\ti_1}, \tv_{11} \geq \tv_{10},\\ \tv_{12} \geq \tv_{11} + \td{\ti_2}{\ti_1}, \tv_{13} \geq \tv_{12}, \tv_3 \geq \tv_{13} + \td{\ti_1}{\p_1},\\ \tv_3 \leq \tv_2 + 4 \end{array} \right\} \] This set of constraints represents a set of concrete executions, where the Timed Intruders $\ti_1$ and $\ti_2$ collude. There is a concrete execution only if the set of Time Constraints is satisfiable, \ie, it has a \emph{model}, which depends on the Network Topology, that is, on the function $\key{td}$. \end{example} \begin{definition} A \emph{time model} $M$ of a set of time constraints $\Tscr$ is a mapping from the time variables in $\Tscr$ to non-negative real numbers such that all constraints in $\Tscr$ are satisfied. \end{definition} For example, the following model \[ M = \{\tv_1 \mapsto 2.0, \tv_2 \mapsto 2.2, \tv_3 \mapsto 1.8 \} \] is a model of the following set of time constraints: \[ \Tscr = \{\tv_1 \leq \tv_2, \tv_3 \leq \tv_1 + 1.0, \tv_2 > \tv_3\}. \] We write $M \vDash \Tscr$ if $M$ is a model of the constraints $\Tscr$. \begin{definition}\label{init} An initial configuration is a tuple \[ I = \tup{\Hscr, \Iscr, \key{td}} \] where $\Hscr = \{(\p_1,\pl_1), \ldots, (\p_n,\pl_n)\}$ is a set of honest players with their corresponding timed protocols; $\Iscr = \{(\ti_1,\IK_1), \ldots, (\ti_m,\IK_m)\}$ is a set of timed intruders with their corresponding intruder strands, representing initial intruder knowledge; and \key{td} is a network topology. Moreover, the sematics, $\Sscr(I)$, of an initial configuration is the set of timed bundles of $I$, representing the possible executions of $I$. \end{definition} \section{Introduction} \label{intro} \input{intro} \section{Examples}\label{examples} \input{examples} \section{Term Language} \label{sec:bas-language} \input{basic-language} \section{Observational Equivalence} \label{sec:obs-eq} \input{sec-obs} \section{Experimental Results} \label{sec:exp} \input{experiments} \section{Related and Future Work} \label{related} \label{sec:related} \input{related} \newpage \bibliographystyle{abbrv} \subsection{Black-Boxed Terms} There are some subtleties involved in handling nonces and handling encrypted terms for which the intruder does not possess the inverse key. Consider the two following sequence of labels: \[ \begin{array}{l} \Lscr_1 = \tup{(+ \n_1),(+ \n_2),(+ \tup{\n_1,\n_2}) }\\ \Lscr_2 = \tup{(+ \n_1),(+ \n_2),(+ \tup{\n_2,\n_1}) } \end{array} \] where $\n_1, \n_2$ are nonces, say created by an honest participant. The intruder can distinguish these observables because of the order of the pair of the last send messages. However, the intruder should not be able to distinguish the following two sequence of labels: \[ \begin{array}{l} \Lscr_1' = \tup{(+ \n_1),(+ \n_2),(+ \tup{\n_1,\n_2}) }\\ \Lscr_2' = \tup{(+ \n_1'),(+ \n_2'),(+ \tup{\n_1',\n_2'}) } \end{array} \] where $\n_1,\n_1',\n_2,\n_2'$ are nonces. This is because although different constants, they are appear in the same order. The same happens for encrypted terms that the intruder cannot decrypt.\footnote{Recall that from the Dolev-Yao intruder's point of view, such terms are treated as black-boxes.} Consider the following two sequence of labels: \[ \begin{array}{l} \Lscr_1'' = \tup{(+ \enc(\t_1,\k_1)),(+ \enc(\t_2,\k_2)),(+ \tup{\enc(\t_1,\k_1),\enc(\t_2,\k_2)}) }\\ \Lscr_2'' = \tup{(+ \enc(\t_1',\k_1')),(+ \enc(\t_2',\k_2')),(+ \tup{\enc(\t_2',\k_2'),\enc(\t_1',\k_1')}) } \end{array} \] where $\t_1, \t_2$ are different constants and $\k_1, \k_2$ are keys for which the intruder does not possess the decryption key. Although the intruder cannot decrypt the exchanged messages, he can still distinguish $\Lscr_1''$ and $\Lscr_2''$ because of the order of last tuple sent. The definition below specifies when two observables are equal. It uses definition of black-box bijections and term equivalences defined in the following. \begin{definition} Let $\Oscr = \tup{\Lscr, \IK, \DC, \EQ, \TC}@\tG$ be an observable. The set of black-box terms of $\Oscr$ is the set, written $\BB(\Oscr)$, of all sub-terms in $\Lscr$ that are nonces, $\n$, or encryption terms, $\enc(\t,\k)$, for which the inverse of $\k$ is not in $\IK$. \end{definition} \begin{definition} Let $\Oscr$ be an observable. A symbolic term $\ms$ restricted to $\BB(\Oscr)$, written, $\ms|_{\BB(\Oscr)}$, is the term obtained by replacing by the special symbol $*$ all sub-terms of $\ms$ that (1) do not contain any term in $\BB(\Oscr)$ or (2) is not contained in a term in $\BB(\Oscr)$. \end{definition} For example, the consider the term $\ms = \tup{\n_1,\t_1,\enc(\tup{\t_2,\enc(\t_3,\k_2)},\k_1)}$ where the intruder knows the inverse of $\k_1$, but not of $\k_2$. Then the term restricted to black-boxes is $\tup{\n_1,*,\enc(\tup{*,\enc(\t_3,\k_2)},*)}$, where $\t_1, \t_2$ and $\k_1$ are replaced by $*$. \begin{definition} \label{def:black-box-bij} Let $\Oscr = \tup{\Lscr, \IK, \DC, \EQ, \TC}@\tG$ and $\Oscr' = \tup{\Lscr', \IK', \DC', \EQ', \TC'}@\tG'$ be two observables, such that $\Lscr = \{(\pm_1 \ms_1) \ldots (\pm_n \ms_n)\}$ and $\Lscr' =\{(\pm_1 \ms_1') \ldots (\pm_n \ms_n')\}$. A black-box bijection, $\bij(\Oscr,\Oscr')$ is any bijection between the sets $\BB(\Oscr)$ and $\BB(\Oscr')$ such that $\bij(\Oscr,\Oscr')$ makes the terms $\tup{\ms_1,\ldots,\ms_n}|_{\BB(\Oscr)}$ and $\tup{\ms_1',\ldots,\ms_n'}|_{\BB(\Oscr)}$ equal.\footnote{ One can easily compute one such bijection by recursively traversing terms and checking which ones are black-boxed or not. This procedure is implemented in the file obs-equiv.maude, function \texttt{mkSSBB}.} \end{definition} For example, there is no bijection between the terms in $\Lscr_1''$ and $\Lscr_2''$ shown above. However, the bijection $\{\enc(\t_1,\k_1) \leftrightarrow \enc(\t_1',\k_1'), \enc(\t_2,\k_2) \leftrightarrow \enc(\t_2',\k_2')\}$ makes equal the terms in $\Lscr_1''$ and the sequence of labels $\Lscr_2'''$ below: \[ \Lscr_2''' = \tup{(+ \enc(\t_1',\k_1')),(+ \enc(\t_2',\k_2')),(+ \tup{\enc(\t_1',\k_1'),\enc(\t_2',\k_2')}) }. \] \subsection{Term approximation} \textbf{Notation:} For the remainder of this section, to avoid repetition, we will assume given two observables $\Oscr = \tup{\Lscr,\IK,\DC, \EQ, \TC}@\tG$ and $\Oscr' = \tup{\Lscr',\IK',\DC',\EQ', \TC'}@\tG'$ with disjoint sets of term and time symbols and of nonces. Moreover, $\bij = \bij(\Oscr,\Oscr')$ is a bijection between the black-box terms of the observables $\Oscr$ and $\Oscr'$. First we handle black boxed in the same way as nonces: given a bijection with $n$ relations: \[ \bij = \{ \ms_1 \leftrightarrow \ms_1', \ldots, \ms_n \leftrightarrow \ms_n'\} \] We create $n$ new nonces $\n^\nu_1, \ldots, \n^\nu_n$ and replace each occurrence of $\ms_i$ in $\Oscr$ and $\ms_i'$ in $\Oscr'$ by the same nonce $\n^\nu_i$ for $1 \leq i \leq n$. In the following we assume that this replacement has been already performed. We define when a symbolic term approximates another one. \begin{definition} \label{def:term-approx-denotational} Let $\ms$ and $\ms'$ be two symbolic terms in, respectively, $\Oscr$ and $\Oscr'$. The term $\ms$ approximates $\ms'$, written $\ms \preceq_{\Oscr,\Oscr'} \ms'$ if for all ground terms $\m \in \DC\mid_\EQ(\ms)$, then $\m \in \DC'\mid_{\EQ'}(\ms')$. Two terms are equivalent, written $\ms \sim_{\Oscr,\Oscr'} \ms'$ if and only if $\ms \preceq_{\Oscr,\Oscr'} \ms'$ and $\ms' \preceq_{\Oscr,\Oscr'} \ms$. \end{definition} \newcommand\termApprox{\mathsf{termApprox}} \newcommand\symDer{\mathsf{symDer}} A problem with the definition above is the quantification over all terms, which is an infinite set. We define in Definition~\ref{def:term-eq-approx} a procedure, called $\termEqApprox$ which checks for the observational equivalence of terms. It uses the auxiliary functions $\termApprox$ and $\canEq$. We start by defining the function $\termApprox$ which uses the auxiliary function $\symDer$. \begin{definition} \label{def:term-approx} Let $\ms$ and $\ms'$ be terms in, respectively, $\Oscr$ and $\Oscr'$. The predicate $\termApprox(\ms,\ms',\Oscr,\Oscr')$ evaluates to true if and only if the two conditions below are satisfied: \begin{enumerate} \item \label{defitem:term-approx-match} There exists a matching substitution $\theta = \{\sym'_1 \mapsto \ms_1, \ldots, \sym_n' \mapsto \ms_n\}$ mapping symbols in $\ms'$ to subterms in $\ms$, such that, $\theta[\ms'] = \ms$; \item \label{defitem:term-approx-sym-approx} For each $\sym_i' \mapsto \ms_i \in \theta$, we have $\symDer(\sym_i',\ms_i,\DC,\DC')$ (Definition~\ref{def:sym-approx}). \end{enumerate} \end{definition} \begin{definition} \label{def:sym-approx} Let $\sym'$ be a symbol in $\Oscr'$ and $\dc(\sym',\Sscr') \in \DC'$ and $\ms$ be a term in $\Oscr$. We say that $\symDer(\sym',\ms,\DC,\DC')$ if one of the following holds: \begin{itemize} \item $\ms$ is an guessable; \item $\ms$ is a key, then $\ms \in \Sscr'$; \item $\ms$ is a nonce $\n$, then $\n \in \Sscr'$; \item $\ms$ is an encryption $\enc(\ms_1,\k) \notin \BB(\Oscr)$, then $ \symDer(\sym',\tup{\ms_1,\k},\DC,\DC')$; \item $\ms = \tup{\ms_1,\ldots,\ms_n}$, then $\symDer(\sym',\ms_i,\DC,\DC')$ for $1 \leq i \leq n$; \item $\ms = \sym$ is a symbol such that $\dc(\sym,\Sscr) \in \DC$, then for each $\ms_1 \in \Sscr$, $\symDer(\sym',\ms_1,\DC,\DC')$. \end{itemize} \end{definition} We prove the following soundness and completeness results for the functions $\symDer$ and $\termApprox$: \begin{theorem} \label{th:basic-obs} Let $\ms$ and $\ms'$ be two terms. The for all $\m \in \DC(\ms)$, we have $\m \in \DC(\ms')$ if and only if $\termApprox(\ms,\ms',\DC,\DC')$. \end{theorem} \paragraph{Example}: We illustrate the procedure $\termApprox$ with an example. Consider \[ \begin{array}{l} \ms = \tup{\n,\enc(\tup{\n,\t,\sym_1,\sym_2},\k_1)} \\ \ms' = \tup{\n',\enc(\sym',\k_1)} \\ \end{array} \] Moreover, assume that the intruder knows the inverse of $\k_1$ in both observables, that is, $\k_1^{-1} \in \IK \cap \IK'$, and consider the bijection $\bij = \bij(\Oscr,\Oscr') = \{\n \leftrightarrow \n'\}$. We replace these nonces by the fresh nonce $\n^\nu$. We check for Condition~\ref{def:term-approx}.\ref{defitem:term-approx-match}, that is, construct a matching substitution mapping symbols in $\ms'$ to subterms in $\ms$. We obtain the following matching substitution: \[ \theta = \{\sym' \mapsto \tup{\n^\nu,\t,\sym_1,\sym_2}\} \] as $\theta[\ms'] = \tup{\n^\nu,\enc(\tup{\n',\t,\sym_1,\sym_2},\k_1)}$. Notice that if such a matching substitution does not exists, then the $\ms$ cannot approximate $\ms'$. Indeed $\ms' \npreceq_{\Oscr,\Oscr'} \ms$ as there is no such matching substitution: The term $\ms'$ can be instantiated to a term where a non-tuple is encrypted, \eg, $\tup{\n_1,\enc(\t,\k_1)}$ for some guessable $\t$, whereas $\ms$ can only be instantiated by terms where a tuple with at least four elements is encrypted. Now we check for the Condition~\ref{def:term-approx}.\ref{defitem:term-approx-sym-approx}. In order to check this condition, we need to know more about $\DC$ and $\DC'$. Assume that the symbol $\sym_1$ is created before the symbol $\sym_2$ in the trace corresponding to $\Oscr$. Then by Proposition~\ref{prop:trace-properties}, we have that if $\dc(\sym_1, \Sscr_1), \dc(\sym_2, \Sscr_2) \in \DC$, then $\Sscr_1 \subseteq \Sscr_2$. Consider, $\dc(\sym_1, \{\t_1,\k_1\}), \dc(\sym_2, \{\t_1,\t_2,\k_1,\k_2\}) \in \DC$ which satisfies the condition above. Moreover, assume $\dc(\sym',\Sscr') \in \DC'$ with $\Sscr' = \{\n^\nu,\t_1,\k_1,\t_2,\k_2\}$. We have that $\symDer(\sym',\{\n, \sym_1, \sym_2\},\DC,\DC')$ as: \begin{itemize} \item $\symDer(\sym',\n^\nu,\DC,\DC')$ as $\n^\nu \in \Sscr'$; \item $\symDer(\sym',\sym_1,\DC,\DC')$ as $\{\t_1,\k_1\} \subseteq \Sscr'$; \item $\symDer(\sym',\sym_2,\DC,\DC')$ as $\{\t_1,\t_2,\k_1,\k_2\} \subseteq \Sscr'$; \end{itemize} The following definition specifies the function $\canEq$. Intuitively, $\canEq$ checks whether it is possible to instantiate w.r.t. $\DC,\EQ$ the symbols in $\ms_1,\ms_2$ so to falsify the constraint $\Neq(\ms_1,\ms_2)$. \begin{definition} \label{def:neq-approx} $\canEq(\ms_1,\ms_2,\DC,\EQ)$ evaluates to true if and only if the following conditions are satisfied: \begin{enumerate} \item If is a unifier $\sigma = [\sym_1 \mapsto \ms_1^*, \ldots, \sym_n \mapsto \ms_n^*]$ of $\ms_1$ and $\ms_2$; \item $\sigma$ does not make any comparison constraint in $\EQ$ false; \item For each $\sym_i \mapsto \ms_i^* \in \sigma$, $\sym_i$ can generate the term $\ms_i^*$ w.r.t. $\DC$. \label{defitem:neq4} \end{enumerate} \end{definition} \begin{definition} \label{def:term-eq-approx} Let $\ms$ and $\ms'$ be terms in, respectively, $\Oscr$ and $\Oscr'$. The predicate $\termEqApprox(\ms,\ms',\Oscr,\Oscr')$ evaluates to true if and only if: \begin{enumerate} \item If $\eqCheck(\EQ,\DC) = false$; \label{def:item-eqcheck1} \item Otherwise if $\eqCheck(\EQ,\DC) = \eqCheck(\EQ',\DC') = true$, let $\ssb$ and $\ssb'$ being the corresponding witnessing matching subsitutions (Definition~\ref{def:eqCheck}); \label{def:item-eqcheck2} \begin{enumerate} \item \label{defitem:term-eq-approx} $\termApprox(\ssb[\ms],\ssb'[\ms'],\ssb[\DC],\ssb'[\DC'])$ is true where the witnessing matching subsitution is $\theta = [\sym'_1 \mapsto \ms_1, \ldots, \sym_n' \mapsto \ms_n]$ (Definition~\ref{def:term-approx}); \item \label{defitem:neq} $\canEq(\ssb[\theta[\ms_1']],\ssb[\theta[\ms_2']],\DC,\EQ)$ is false (Definition~\ref{def:neq-approx}) for each inequality constraint $\Neq(\m_1',\m_2') \in \EQ'$. \end{enumerate} \end{enumerate} \end{definition} Intuitively, the Condition \ref{def:term-eq-approx}.\ref{def:item-eqcheck1} specifies that if $\EQ, \DC$ are not consistent, then the approximation is trivial. Otherwise, if both $\EQ,\DC$ and $\EQ',\DC'$ are consistent, then there are matching substitutions $\ssb$ and $\ssb'$. We apply $\ssb$ and $\ssb'$ substitutions in, respectively, $\Oscr$ and $\Oscr'$ in the following. This takes care of all the $\Eq$ constraints. Condition \ref{def:term-eq-approx}.\ref{defitem:term-eq-approx} checks whether the terms they generate are the same. Condition \ref{def:term-eq-approx}.\ref{defitem:neq} intuitively checks whether it is not possible to falsify any inequality constraint in $\EQ'$ using $\DC$ and $\EQ$. \begin{theorem} \label{th:branching-obs} Let $\ms$ and $\ms'$ be two terms from, respectively, $\Oscr$ and $\Oscr'$. Then $\ms \preceq_{\Oscr,\Oscr'} \ms'$ if and only if $\termEqApprox(\ms,\ms',\Oscr,\Oscr')$. \end{theorem} \paragraph{Example} Consider the protocol role for Alice in Example~\ref{ex:ns2}. We omit the time constraints as they are not important for this example. From an initial configuration with Alice and the intruder called $eve$, one can construct the following observable $\Oscr'$: \[ \begin{array}{l} \tup{+ \enc(\tup{\n_1',alice},\pk(eve)), - \sym', + error},\\ \IK', \DC', \{\Neq(\sym',\enc(\tup{n_1,\v},\pk(alice)\}) \} \end{array} \] for some intruder knowledge $\IK'$ and $\DC'$. Consider the protocol role which outputs an error: \[ \begin{array}{ll} Alice' := & (\new ~N_a), (+\enc(\tup{N_a,alice},\pk(Z))), (- \v),(+ error) \\[2pt] \end{array} \] Consider the observable $\Oscr$ for this protocol: \[ \begin{array}{l} \tup{+ \enc(\tup{\n_1,alice},\pk(eve)), - \sym, + error},\IK, \DC, \emptyset) \} \end{array} \] which is similar to the observable above, but without the comparison constraint. There is the bijection $\n_1 \leftrightarrow \n_1'$. Moreover, since the message is sent to $eve$, $\n_1 \in \IK$ and $\n_1' \in \IK'$. Notice that% \begin{small} \[ \begin{array}{c} \termApprox(\tup{\enc(\tup{\n_1,alice},\pk(eve)),sym,error},\\ \tup{\enc(\tup{\n_1',alice},\pk(eve)),sym',error},\DC, \DC') \end{array} \] \end{small as the messages are the same. However, due to the comparison constraint in $\Oscr$, it is not the case that \begin{small} \[ \begin{array}{c} \termEqApprox(\tup{\enc(\tup{\n_1,alice},\pk(eve)),sym,error}, \\\tup{\enc(\tup{\n_1',alice},\pk(eve)),sym',error}, \Oscr, \Oscr') \end{array} \] \end{small}% Indeed, the function $\canEq(\sym, \enc(\tup{n_1,\t},\pk(alice)\}, \DC, \emptyset)$ is true. (Recall that variables are replaced by fresh symbols.) This is true because the intruder knows the public key of Alice and $\n_1$. \subsection{Timing of Messages} \label{subsec-timing} For Condition~\ref{def:equiv-obs}.\ref{defitem:timeapprox}, we reduce the formulas to formulas for which existing solvers can be used~\cite{duterte15smt}, namely formulas of the form $\exists \forall$: \noindent \begin{small} \[ \begin{array}{l} \forall \widetilde{\tv}. \left[\TC \Rightarrow \exists \widetilde{\tv'}. \left[\TC' \land \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right]\right] \textrm{is a tautology}\\[2pt] \Leftrightarrow \neg \forall \widetilde{\tv}. \left[\TC \Rightarrow \exists \widetilde{\tv'}. \left[\TC' \land \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right]\right] \textrm{is unsat} \\[2pt] \Leftrightarrow \exists \widetilde{\tv}. \left[\TC \land \forall \widetilde{\tv'}. \left[ \TC' \Rightarrow \neg \left[ \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right] \right]\right] \textrm{is unsat}\\ \end{array} \] \end{small} In our implementation, we use the SMT solver Yices for solving this formula (which is decidable~\cite{duterte15smt}), where all time variables have type Reals. \begin{lemma} Determining whether two timed observables are equivalent is decidable. \end{lemma} Together with Proposition~\ref{prop:finite-traces}, we obtain the decidability of timed observational equivalence checking. \begin{theorem} Determining whether two configurations are time observationally equivalent is decidable. \end{theorem} \section{Symbolic Timed Observational Equivalence}\label{stobseq} Intuitively, two systems $s_1$ and $s_2$, modeled by two initial configurations, are equivalent if there is no behavior of $s_1$ that cannot be emulated by $s_2$ and vice-versa. This notion is formalized by using the notion of observational equivalence: \begin{definition} Two systems, $s_1$ and $s_2$, are observational equivalent, written $s_1 \equiv s_2$ if $s_1 \preceq s_2$ and $s_2 \preceq s_1$, where $s_i \preceq s_j$ if for all contexts $C[\cdot]$, we have that $C[s_i]$ has the same \emph{observations} as $C[s_j]$. \end{definition} The notion of observation will vary according to the application domain. For example, the equivalence in programming languages is concerned with a value produced. Protocol security is also interested in the order in which messages are sent by honest participants. Here, we will also be interested in the time when messages are sent. We will formalize this in Section~\ref{subsec:observations}. A number of security protocol properties, such as anonimity, unlinkability, and privacy, have been reduced to the problem of observational equivalence~\cite{arapinis10csf}. Thus it is a powerful notion for discovering non-trivial flaws in protocols. However, one main problem for automated verification in using the above definition is the quantification over contexts. There have been, however, many techniques developed that overcome this problem and can be used for proving the equivalence of systems, \eg, logical relations~\cite{gunter,hofmann14popl}, bisimulation~\cite{milner}. The problem of quantification of contexts in protocol security verification can be overcome by relying on the following fact~\cite{cervesato02isss}: \begin{center} \textbf{Fact:} The Dolev-Yao intruder is the most powerful intruder. \end{center} Thus, it is not necessary for (traditional) protocol security verification to check whether for all contexts the systems evaluate to the same value, but rather check this for a single context implementing the Dolev-Yao intruder. All \emph{observations} obtained by any (symbolic) context can be observed by the Dolev-Yao intruder. Unfortunately, the Dolev-Yao intruder is not suitable for cyber-physical protocol security verification because the Dolev-Yao intruder is too strong, being faster than the speed of light. Therefore, one should use instead a weaker timed Dolev-Yao intruder which is not omnipresent, but is placed at some location~\cite{kanovich14fccfcs}. It only may learn a message when it arrives, \ie, a timed intruder needs to wait for the message to travel from the sender to him. Thus, the observed behaviors depends on the context, \ie, number of intruders and their location and therefore, we face again the problem of quantifying over all contexts. To solve this problem, we rely on the following result from~\cite{nigam16esorics} which formalizes \emph{timed intruder models} and proves the following fact: \begin{center} \textbf{Fact:} Timed intruders located at \emph{negligible} distance to honest participants (one intruder per participant) is the strongest timed intruder configuration. \end{center} That is, any observation resulting from a context where timed intruders are placed differently can also be observed if the timed intruders are placed at negligible distance to the honest participants. Therefore, it is enough for protocol verification to consider a single context where timed intruders are placed at neglible distance to honest participants. Formally, this means that for each participant $p$ there is a timed intruder $I_p$ such that: \[ \begin{array}{l} \key{td}_\Iscr(I_p,I_q) = \key{td}_\Iscr(p,I_q) = \key{td}_\Iscr(I_p,q) = \key{td}(p,q)\\ \key{td}_\Iscr(p,I_p) = \key{td}_\Iscr(I_p,p) = 0\\ \end{array} \] If we were to assume additional communication channels (see Remark~\ref{rem:transmission}), then we would assume that the intruders always communicate with the channel with the greatest speed. \subsection{Observations} \label{subsec:observations} Assume that we are given a initial configuration $I$ (definition \ref{init}) We are interested in the set of observations that can be obtained by executing $I$ where the timed intruders are located at negligible distance to honest participants. Intuitively, an observation will be the messages that intruders learn as in usual protocol security verification~\cite{cortier09csf} together with the time when a message was sent. That is, the messages that are sent into the network. Formally, an observation has the following format: \begin{definition} \label{def:message-observation} A \emph{message observation} is a tuple $\tup{msg,snd,rcv,time}$ where $msg$ is the message exchanged, $snd$ is the player that sent the message $msg$, $rcv$ is the player that received the message $msg$, and the $time$ is the time when the message is sent. \end{definition} The following definition formalizes the set of observations of a timed bundle by looking only at the $n_1 \to n_2$ edges between honest participants and associated timed intruders. Notice that we do not need to keep the time of receipt of messages as from our timed intruder model assumption (see the text just before Section~\ref{subsec:observations}), the intruder is negligibly close to the sender and message transmission is instantaneous. \red{Maybe only look at intruder outputs.} \begin{definition} Let $\Cscr = \tup{\Nscr_\Cscr,\rightarrow_\Cscr \cup \Rightarrow_\Cscr}$ be a timed bundle over a network topology $\key{td}$. The set of observations of $\Cscr$ is a pair composed by the set of message observations, written $\Oscr(\Cscr)$, below and the Timed Constraint Set of $\Cscr$, $\TC(\Cscr,\key{td})$: \[ \hspace{-4mm} \left\{ \begin{array}{lcl} \tup{\m,\p_S,\p_R,\tv_0} & \mid & n_1 \to n_2 \land time(n_1) = \tv_0 \land~ \\ && player(n_1) = \p \land player(n_2) = \p_R\\ && (term(n_1) = +\m \lor~\\ && term(n_1) = +\m~\#~\tc) \end{array} \right\} \] \end{definition} Consider Example~\ref{ex:mafia-attack} and the timed bundle depicted in Figure~\ref{fig:strand-mafia}. The observations of this timed bundle is the pair composed by the timed constraint shown in Example~\ref{ex:mafia-attack} and the following set of message observations: \[ \left\{ \begin{array}{c} \tup{\c,\p_1,I,\tv_2}, \tup{\c,I,\p_2,\tv_9}, \tup{\c,\p_2,I,\tv_{5}}, \tup{\c,I,\p_1,\tv_{13}} \end{array}\right\} \] \subsection{Timed Equivalence} In order to define timed equivalence, we need to describe when two messages seem identical to an external intruder. In symbolic verification using Dolev-Yao like intruders, one assumes that the intruder cannot distinguish two encrypted messages if the intruders do not possess the corresponding encryption keys. The following definitions makes this precise. \red{Add that nonces are also indistinguishable.} \begin{definition} Two messages $\m_1$ and $\m_2$ are similar, written $\m_1 \sim \m_2$ if and only if: \begin{itemize} \item $\m_1$ and $\m_2$ are both constants and $\m_1 = \m_2 = \c$; \item $\m_1 = \enc(\m_1',\k_1)$ and $\m_2 = \enc(\m_2',\k_2)$; \item $\m_1 = \{\m_1',\ldots,\m_n'\}$ and $\m_2 = \{\m_1'',\ldots,\m_n''\}$ and for all $1 \leq i \leq n$, $\m_i' \sim \m_i''$. \end{itemize} \end{definition} Two messages that are similar may be distinguishable by an intruder. It will depend on the overall knowledge acquired by the intruder in the bundle, namely the keys he has learned. For example, consider the following two timed bundles, $\Bscr_1$ and $\Bscr_2$, where the first two messages are permuted. We omit the time variables and the intruder strands. \[ \begin{array}{l} \Bscr_1 = \tup{\p_1,+\enc(\c_1,\k)} \Rightarrow \tup{\p_1,+\enc(\c_2,\k)} \Rightarrow \tup{\p_1,+\k};\\ \Bscr_2 = \tup{\p_1,+\enc(\c_2,\k)} \Rightarrow \tup{\p_1,+\enc(\c_1,\k)} \Rightarrow \tup{\p_1,+\k}; \end{array} \] Assuming the intruder does not possess the key $\k$, \ie, $\k \notin K_P$, the intruder cannot distinguish the messages $\enc(\c_1,k)$ and $\enc(\c_2,k)$ when these are sent. However, once he learns the corresponding key $\k$ due to the third message, he can distinguish $\enc(\c_1,k_1)$ and $\enc(\c_2,k_2)$ and therefore distinguish these timed bundles. Therefore, to check whether two messages are distinguishable depends on the intruder knowledge. This can be formalized by using the notion of derivable messages as follows: \begin{definition} Let $\IK$ be a set of strands available to the intruders which includes the strands in Definition~\ref{def:ind-strands} and any initial knowledge. Let $\ti$ be any intruder. Let $\Kscr(\IK)$ be the set of keys that the intruder can construct: \[ \hspace{-3mm} \Kscr(\IK) = \left\{\begin{array}{lcl} \k & \mid & \textrm{It is possible to construct a bundle } \\ && \textrm{outputting $\k$ using the strands in $\IK$ } \end{array}\right \} \] We define the set of derivable terms, $\DC(\m,\IK)$, for a given message $\m$ as $\DC(\m,\IK) =$ \[ \hspace{-5mm} \left\{\begin{array}{lcl} \m' & \mid & \textrm{It is possible to construct a bundle } \\ && \textrm{outputting $\m'$ using the strands Decomposing,}\\ && \textrm{Decryption, $\tup{\ti,\k}@\tv_1$ and $\tup{\ti,-\m,+\m}@\{\tv_2,\tv_3\}$}\\ && \textrm{for fresh symbols $\tv_1,\tv_2,\tv_3$ and $\k \in \Kscr(\IK)$.} \end{array}\right \} \] Moreover, we define $\DC(\m_1,\IK_1) \sim \DC(\m_2,\IK_2)$ if for all $\m_1' \in \DC(\m_1,\IK_1)$ there is a $\m_2' \in \DC(\m_1,\IK_1)$ such that $\m_1' \sim \m_2'$ and vice versa. \end{definition} For example, in the bundles $\Bscr_1$ and $\Bscr_2$ above, for the intruder strand space $\IK$, the intruders have the following keys where $K_P$ are the initially known keys and $\k \notin K_P$: \[ \Kscr(\IK) = \{\k\} \cup K_P \] With this set of keys, the intruders can distinguish the messages $\enc(\c_1,\k)$ and $\enc(\c_2,\k)$. This is formally captured by using the derivable sets $\DC$: \[ \DC(\enc(\c_1,\k),\IK) \nsim \DC(\enc(\c_2,\k),\IK) \] This is because in the set to the left the intruder can output $\c_1$, while this is not the case in the set to the right. The following definitions formalize timed observational equivalence. Intuitively, it says that a timed bundle $\Cscr_1$ can be approximated by another timed bundle $\Cscr_2$ if all observations of messages and their sending times can be matched by observations in $\Cscr_2$. \begin{definition} \label{def:approx} Let $\Cscr_1$ and $\Cscr_2$ be two timed bundles over the same network \key{td}. Let $\IK_1$ and $\IK_2$ be the intruder strands in, respectively, $\Cscr_1$ and $\Cscr_2$. We say that $\Cscr_1$ is approximated by $\Cscr_2$, written $\Cscr_1 \preceq \Cscr_2$, if and only if \[ \hspace{-5mm} \begin{array}{l} \forall M_1. (M_1 \vDash \TC(\Cscr_1,\key{td})\Rightarrow \exists M_2. (M_2 \vDash \TC(\Cscr_2,\key{td})\Rightarrow\\ ~\exists B : \Oscr(\Cscr_1) \to \Oscr(\Cscr_2). (\textrm{$B$ is a bijection}\Rightarrow~\\ \quad \forall \tup{\m_1,\p_S,\p_R,\tv_1} \in \Oscr(\Cscr_1).\\ \qquad B(\tup{\m_1,\p_S,\p_R,\tv_1}) = \tup{\m_2,\p_S,\p_R,\tv_2}\Rightarrow~\\ ~\qquad \DC(\m_1,\IK_1) \sim \DC(\m_2,\IK_2) \land M_1[\tv_1] = M_2[\tv_2]))). \end{array} \] \end{definition} \begin{definition}[Timed Bundles Equivalence] Let $\Cscr_1$ and $\Cscr_2$ be two timed bundles over the same network \key{td}. We say that $\Cscr_1$ and $\Cscr_2$ are observational equivalent, written $\Cscr_1 \equiv \Cscr_2$ if and only if $\Cscr_1 \preceq \Cscr_2$ and $\Cscr_2 \preceq \Cscr_1$. \end{definition} The definition of approximation (Definition~\ref{def:approx}) contains a quantification over all possible models $M_1$ of $\TC(\Cscr_1,\key{td})$. This will need to be overcome in order to automate the verification of timed observational equivalence. We explain in the next section how we handle this using SMT solvers. Moreover, notice the need for a bijection, $B$, between $\Oscr(\Cscr_1)$ and $\Oscr(\Cscr_2)$. Such bijection should exist, otherwise the following timed bundles would be equivalent: \[ \begin{array}{l} \Bscr_3 = \tup{\p_1, +\c_1} \\ \Bscr_4 = \tup{\p_1, +\c_1} \Rightarrow \tup{\p_1, +\c_1} \end{array} \] However, they can be distinguished as in $\Bscr_3$ intruders observe only one message, while in $\Bscr_4$, they see two messages. \begin{figure*}[ht] \includegraphics[width=0.50\textwidth]{figs/passport.pdf} \includegraphics[width=0.50\textwidth]{figs/passport2.pdf} \caption{Timed bundles of the passport example (Example~\ref{ex:passport}) when the intruder is meeting a passport previously seen and a passport not previously seen.} \label{fig:passport-bundles} \end{figure*} We illustrate the definition of timed observational equivalence with the timed bundles shown in Figure~\ref{fig:passport-bundles} for the passport protocol described in Example~\ref{ex:passport}. Assume that the intruder has obtained the messages $\m_{enc}^{old}$ and $\m_{mac}^{old}$ from a previous interaction with a given passport. Figure~\ref{fig:passport-bundles} depicts the timed bundles, $\Cscr_1$ to the left, when the intruder is interacting with the same passport and the timed bundle, $\Cscr_2$ to the right, when the intruder is interacting with a different passport not previously seen. The set of observation messages in $\Cscr_1$ and $\Cscr_2$ are the same (modulo time variable renaming). They differ, however, on their timed constraints $\TC(\Cscr_1,\key{td})$ and $\TC(\Cscr_2,\key{td})$. The former contains the constraints: \[ \{\tv_{17} = \tv'', \tv'' = \tv' + \tv_{enc}, \tv' = \tv + \tv_{mac}, \tv == \tv_{14}\} \] where $\tv_{17}$ is the time when the message $\key{error}$ is sent. On the other hand, $\TC(\Cscr_2,\key{td})$ contains the following set of timed constraints: \[ \{\tv_{16} = \tv', \tv' = \tv + \tv_{mac}, \tv == \tv_{14}\} \] where $\tv_{16}$ is the time when the message $\key{error}$ is sent. Assuming $\tv_{enc}, \tv_{mac}$ fixed, say 1.0, we have that $\Cscr_1$ and $\Cscr_2$ are not observational equivalent. Consider the a model, $M_2$ of $\TC(\Cscr_2,\key{td})$ containing the assignments: \[\left\{ \begin{array}{c} \tv_{13} \mapsto 1.0, \tv_{14} \mapsto 1.0, \tv \mapsto 0, \tv' \mapsto 2.0, \tv_{16} \mapsto 2.0 \end{array}\right\} \] This means that the message $\tup{\m_{mac}^{old},\m_{enc}^{old}}$ is sent at time 1.0 and the message $\key{error}$ is sent at time $\tv_{16} = 2.0$. It is not possible to find a model $M_1$ of $\TC(\Cscr_1,\key{td})$ where $\tup{\m_{mac}^{old},\m_{enc}^{old}}$ is sent at time 1.0, \ie, $\tv_{14} \mapsto 1.0$ and $\key{error}$ is sent at time $\tv_{17} \mapsto 2.0$ as the constraints entail that $\tv_{17} = \tv_{enc} + \tv_{mac} + \tv_{14}$. \begin{definition} Let $I_1$ and $I_2$ be two initial configurations over the same network \key{td}. $I_1$ is timed equivalent to $I_2$ if for all timed bundles $\Cscr_1$ of $\Sscr(I_1)$ there is a timed bundle $\Cscr_2$ of $\Sscr(I_2)$ such that $\Cscr_1 \equiv \Cscr_2$ and conversely. \end{definition} \subsection{Symbolic Constraint Solving} \label{subsec:basic-solving} For protocol verification, we will assume a traditional Dolev-Yao intruder~\cite{DY}, that is, an intruder that can construct messages from his knowledge by tupling and encrypting messages. However, he cannot decrypt a message for which he does not possess the inverse key. This is captured by the definition of minimal sets Definition~\ref{def:minimal}. \begin{definition} An intruder knowledge $\IK$ is a minimal set of symbolic terms. \end{definition} During protocol execution, the intruder sends messages to honest participants constructed from his knowledge base. Suppose an honest player is ready to receive a message matching a term $\m$, possibly containing variables. Rather than considering all possible ground instances of $\m$ that the intruder could send, we consider a finite representation of thie set, namely symbolic messages where the possible values of the symbols are constrained by derivability constraints. To compute this this representation the intruder replaces variables with symbolic terms, possibly containing fresh symbols, and then constrains the symbols so that the allowed instances are exactly the terms matching $\m$ that the intruder can derive from his current knowledge $\IK$. For example, consider the term $\m = \enc(\{\v_1,\sym,\v_1,\v_2\},\k)$ (which is expected as input by an honest player). Here $\v_1$ and $\v_2$ are variables and $\sym$ is constrained by derivability constraints $\DC$. We create two fresh symbols $\sym_1$ and $\sym_2$ for, respectively, the variables $\v_1$ and $\v_2$. We use $\sb$ to denote such substitution of variables by symbolic terms. In this example $\sb = [\v_1 \mapsto \sym_1, \v_2 \mapsto \sym_2]$. We then obtain $\ms = \sb[\m] = \enc(\{\sym_1,\sym,\sym_1,\sym_2\},\k)$. It remains to solve the following problem: \begin{center} \emph{Given an intruder knowledge, $\IK$, and a set of derivability constraints $\DC$ constraining the symbols in $\IK$, find a representation of all instances of a symbolic term $\ms$, satisfying $\DC$, that can be generated from $\IK$.} \end{center} We implemented the function called $\sgen$ that enumerates all possible instances. Its specification is in the Appendix. We describe $\sgen$ informally next and illustrate it with some examples. A similar algorithm is also used by~\cite{cortier09csf}. In particular, $\sgen(\m, \IK,\DC)$ takes as input a term $\m$, which is expected by the honest participant, the intruder knowledge $\IK$ and the derivability constraints $\DC$ for the existing symbols. $\sgen(\m, \IK,\DC)$ then generates as output a pair: \[ \{\sb, \{\ssb_1, \DC_1\} \ldots \{\ssb_k, \DC_k\}\} \] where $\sb$ maps the variables of $\m$ to symbols, and each $\{\ssb_i,\DC_i\}$ is a solution to the problem above for $\ms = \sb[\m]$. If $k = 0$, then there are no solutions, that is, the intruder is not able to generate a term which matches $\m$. Intuitively, the function $\sgen$ constructs a solution by either matching $\m$ with a term in his knowledge $\IK$ (base case) or constructing $\m$ from terms in $\IK$ and using tupling and encryption. The following examples illustrates the different cases involved: \begin{example} Consider the following cases for deriving the term $\m = \enc(\{\v,\sym\},\k)$. \begin{itemize} \item Case 1 (matching with a term in $\IK$): Assume: \[ \begin{array}{l} \IK = \{\enc(na,\sym_1),\k)\}\\ \DC = \dc(\sym, \{\n_a,\n_c\})\ \dc(\sym_1, \Sscr) \end{array} \] Then the solution of $\sgen$ is: \[ \{\sb, \{[\sym_\v \mapsto \n_a, \sym \mapsto \sym_1], \dc(\sym_1, \add(\{na,nc\},\Sscr) )\}\} \] where $\sb = [\v \mapsto \sym_\v]$ and $\sym_\v$ is a fresh symbol. Notice that since $\sym_\v$ is mapped to a particular term ($\n_a$), no derivability constraint for it is generated. Additionally, notice that $\sym$ is constrained to be the same as $\sym_1$. This causes the removal of the derivability constraint $\dc(\sym_1, \Sscr)$; \item Case 2 (constructing terms from $\IK$): Assume that $\k \in \IK$ and $\IK$ has no encryption term. Then the solution of $\sgen$ is: \[ \{[\v \mapsto \sym_\v], \{[], \DC\}\} \] which corresponds to generatign the term $\enc(\{\sym_v,\sym\},\k)$. \item Case 3 [No Solution]: Assume that $\IK = \{\enc(\n_a,\n_b),\k)\}$ and $\DC = \dc(\sym, \{na,nc\})$. Since $\sym$ cannot be instantiated to $\n_b$, the intruder cannot use the term $\enc(\n_a,\n_b),\k)$. \end{itemize} \end{example} \subsection{Timed Observational Equivalence} We extend the definition of observables to include (multiple) timed intruders and time constraints: \begin{definition} Let $\tau = \Cscr_1 \stackrel{l_1}{\lra} \Cscr_2 \stackrel{l_2}{\lra} \cdots \stackrel{l_{n-1}}{\lra} \Cscr_n = \tup{\Pscr_n,\DY_n,\DC_n,\EQ_n,\TC_n}@\tG_n$ be a timed trace. Its observable is the tuple $\tup{\tv_I,\Lscr_\tau,\IK,\DC_n,\EQ_n,\TC_n}$, where $\tv_I$ is the global time at configuration $\Cscr_1$, $\Lscr_\tau$ is the sequence of labels in $\tau$ and \[ \IK = \bigcup_{[i, \IK_i, \buf_i] \in \DY_n} \IK_i \] is the knowledge accumulated by all intruders. \end{definition} Notice that at the end we collect the knowledge accumulated by all intruders. This is because given time, they would have enough time to share all data gathered. We now extend the notion of observable equivalence. For this, assume two sets of observables $\Oscr$ and $\Oscr'$ with disjoint sets of symbols, disjoint sets of nonce names and disjoint sets of time variable names. \begin{definition} \label{def:timed-obs} Let $\Oscr = \tup{\tv_I,\Lscr, \IK, \DC,\EQ,\TC}$ and $\Oscr' = \tup{\tv_I',\Lscr', \IK', \DC',\EQ',\TC'}$ be two timed observables, such that $\Lscr = \{(\pm_1 \ms_1 @ \tG_1) \ldots (\pm_p \ms_p @ \tG_p)\}$ and $\Lscr' =\{(\pm_1' \ms_1' @ \tG_1') \ldots (\pm_n' \ms_n' @ \tG_n')\}$. Assume $\widetilde{\tv}$ and $\widetilde{\tv'}$ are the set of time variables in $\TC$ and $\TC'$, respectively. The observation $\Oscr$ is equivalent to $\Oscr'$, written $\Oscr \sim \Oscr'$ if the following conditions are all true: \begin{enumerate} \item \label{defitem:timed-obs1} The branching observables $\tup{\Lscr,\IK,\DC,\EQ},\tup{\Lscr',\IK',\DC',\EQ'}$ are equivalent where they are obtained from $\Oscr,\Oscr'$ respectively, by eliding all time variables. Thus $p = n = N$ \item The following formula is a tautology: \[ \forall \widetilde{\tv}. \left[\TC \Rightarrow \exists \widetilde{\tv'}. \left[\TC' \land \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right]\right] \] specifying that for any time $\tG_1, \ldots, \tG_N$ satisfying $\TC$ when the messages $\ms_1, \ldots, \ms_N$ were observed in $\Oscr$, we can find $\tG_1', \ldots, \tG_N'$ satisfying $\TC'$, that makes the time of observation equal. \label{defitem:timed-obs2} \end{enumerate} \end{definition} For Condition~\ref{def:timed-obs}.\ref{defitem:timed-obs1}, we simply use the function $\termEqApprox$ introduced in the previous Section. For Condition~\ref{def:timed-obs}.\ref{defitem:timed-obs2}, we reduce it to a formula for which existing solvers can be used~\cite{duterte15smt}, namely formulas of the form $\exists \forall$: \[ \begin{array}{l} \forall \widetilde{\tv}. \left[\TC \Rightarrow \exists \widetilde{\tv'}. \left[\TC' \land \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right]\right] \textrm{is a tautology}\\[2pt] \Leftrightarrow \neg \forall \widetilde{\tv}. \left[\TC \Rightarrow \exists \widetilde{\tv'}. \left[\TC' \land \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right]\right] \textrm{is unsat} \\[2pt] \Leftrightarrow \exists \widetilde{\tv}. \left[\TC \land \forall \widetilde{\tv'}. \left[ \TC' \Rightarrow \neg \left[ \tG_1 = \tG_1' \land \cdots \land \tG_N = \tG_N' \right] \right]\right] \textrm{is unsat}\\ \end{array} \] In our implementation, we use the SMT solver Yices for solving this formula (which is decidable as shown by Tarski), where all time variables have type Reals. \begin{theorem} Determining whether two timed observables are equivalent is decidable. \end{theorem}
\section{Introduction}\label{S:intro} Observation of the neutral hydrogen (HI) distribution through its 21~cm line radiation can provide very precious information on the history of the Epoch of Reionization (EoR) \cite{2006PhR...433..181F,2010ARA&A..48..127M,2012RPPh...75h6901P, 2013ASSL..396...45Z} and the statistical properties of Large Scale Structure, which can be used to infer the nature of dark energy, dark matter, inflationary origin of the Universe \cite{2006astro.ph..6104P,2008PhRvL.100i1303C, 2008arXiv0807.3614A,2010ApJ...721..164S,2012A&A...540A.129A}. Detecting the 21~cm signal in a cosmological experiment is a very challenging task, because there are various astrophysical foreground emissions, such as galactic synchrotron emission, free-free emission, recombination lines, and the extragalactic radio sources including quasars, radio galaxies and galaxy clusters, some of these are several orders of magnitude stronger than the 21 cm signal. For example, for the intensity mapping (IM) experiment where the 21 cm signal intensity of the large scale structure is observed without resolving individual galaxies, the galactic synchrotron emission has $T_{b} \sim 10 \ensuremath{\, {\rm K}}$ while the HI signal $T_{b} \sim$ a few $\ensuremath{\, {\rm mK}}$ at $z \sim 1$. To separate the the HI signal from the foreground components one has to use their distinct statistical characteristics. The foreground spectra are expected to be smooth in the frequency domain, while the redshifted 21~cm signal fluctuates randomly at different frequencies. Early works demonstrated that the 21~cm signal can be successfully extracted from such foregrounds by low order polynomial fitting in image space spectra \cite{2006ApJ...650..529W,2008MNRAS.389.1319J,2009MNRAS.394.1575L}, or alternatively in Fourier space \cite{2009MNRAS.398..401L}, provided that the instrument response is smooth or well-known. However, in the real world the instrument responses are not smooth, and are only known up to the precision of calibration, which is itself a challenging task subject to many errors. More sophisticated methods which can deal with the non-smooth apparent foregrounds in the observational data are therefore developed. In the so called blind or semi-blind methods, no specific parametric model for the foregrounds is assumed, only generic features of the signal and foreground components such as their spectra smoothness and frequency coherence are used. Examples include the low-order polynomial fitting; Principle Component Analysis (PCA) or Singular Value Decomposition (SVD) \cite{2013ApJ...763L..20M, 2015MNRAS.454.3240B,2013MNRAS.434L..46S,2015ApJ...815...51S} (to discriminate from the robust PCA method to be discussed below, we shall call it the {\it classic PCA} in the following); Independent Component Analysis (ICA) \cite{2012MNRAS.423.2518C,2014MNRAS.441.3271W, 2015MNRAS.447..400A}; and the Generalized Morphological Component Analysis (GMCA) \cite{2013MNRAS.429..165C}, etc. However, so far the redshifted 21~cm signal has not yet been positively detected in the various EoR and IM experiments, it is imperative to improve these methods further and explore new approaches and methods . In recent years, many powerful techniques and efficient algorithms in signal processing come out from the compressed sensing (CS) researches \cite{Candes2006robust,Donoho06compressedsensing}, which offers a theoretical framework for simultaneously sensing and compressing finite dimensional vectors by linear dimensionality reduction. It shows that sparse or compressible signals can be recovered from highly incomplete measurements by using appropriate algorithms. The most prevalent structure used in CS is that of {\it sparsity}. Sparsity implies that the signal $x$ itself has only a small number of non-zero (or significantly non-zero in the case of not exactly sparse but compressible case) values, or $x$ can be sparsely represented in an appropriately chosen basis or frame. Another often pursuit structure is the low-rankness of matrices, where the rank is given by the number of non-zero singular values of the matrix. Low-rank approximation has many important applications for data compression, dimensionality reduction and so on in areas such as computer vision, information retrieval, and machine learning. An important role in these developments is played by convex optimization \cite{Rockafellar1970,Boyd2004}, which is a subfield of optimization, and has applications in a wide range of disciplines. The convexity makes the optimization easier than the general case since all its local minima must be global ones. Many compressive sensing problems can be formulated into an optimization problem, for example the most commonly encountered Basis Pursuit (BP) problem (also called the $l_{1}$ minimization problem) in compressive sensing \begin{equation} \label{eq:BP} \min_{x} \, \norm{x}_{1} \qquad \text{subject to} \qquad y = Ax, \end{equation} can be solved by an equivalent convex optimization problem \begin{equation} \label{eq:cv} \min_{x} \, \norm{y - Ax}_{2}^{2} + \lambda \norm{x}_{1}, \end{equation} for some appropriate $\lambda >0$ (see the end of this section for notations). Because of the universality of the compressive sensing techniques and convex optimization methods, they found application in many areas, including astronomy and astrophysics \cite{2008ISTSP...2..718B}. Some CS techniques have been applied to radio astronomy, mostly in interferometer array image synthesis \cite{2013ISPL...20..591C,2014MNRAS.439.3591C,EPFL-CONF-209227,2015A&A...575A..90G,2015JInst..10C8013G,2015arXiv150406847F,2016MNRAS.462.4314O,2016arXiv161008895O}. In fact, even the classical H\"{o}gbom CLEAN algorithm \cite{1974A&AS...15..417H} and its multi-scale version \cite{1988A&A...200..312W} in radio image synthesis can be seen as matching pursuit algorithms from the CS perspective \cite{1997A&AS..123..183L}. In this work, we introduce the Robust Principle Component Analysis (RPCA) method, which is a CS technique based on sparsity and low-rankness, to the problem of 21~cm signal and foregrounds separation. To our knowledge, this is the first conscious application of CS method in the 21~cm--foreground separation problem by taking advantage of the the sparsity and low-rank structure characteristics of the 21~cm signal and foregrounds frequency covariance information. It is also the first application of the RPCA method in 21cm foreground subtraction. While previous works has made use of the low- rank property of the foreground, the present work first exploited the sparsity of the 21cm signal. The paper is organized as follows: We first describe the frequency covariance structure of the foregrounds and the 21~cm signal, and how the information of their distinct structures can be used to separate them from each other in \autoref{S:fc} using the RPCA method. We introduce the RPCA method and the algorithm for its solution in \autoref{S:alg}, and show how this is done by a simulation in \autoref{S:sim}. Some details of the 21~cm signal and foreground simulation is given in Appendix \ref{S:gen}. We then introduce the generalized Internal Linear Combination (ILC) method to recovery the 21~cm signal from the extracted 21~cm signal frequency covariance matrix in\autoref{S:21cm}, and compare the performance of our introduced method to that of the classical PCA method in \autoref{S:comp}. Finally we discuss the results and its possible extensions in \autoref{S:dis}. In this paper, we used various norms for vectors or matrices, for clarity, we summarize them here: \begin{description} \item[$\norm{\vec{x}}_{0}$] $l_{0}$-norm for vector or matrix $\vec{x}$, which is the number of non-zero elements of $\vec{x}$; \item[$\norm{\vec{x}}_{1}$] $l_{1}$-norm for vector $\vec{x}$, defined as $\norm{\vec{x}}_{1} \equiv \sum_{i} |x_{i}|$, if applied to a matrix the matrix is treated as a linear vector; \item[$\norm{\vec{x}}_{2}$] $l_{2}$-norm for vector $\vec{x}$, $\norm{\vec{x}}_{2} \equiv (\sum_{i} |x_{i}|^{2})^{1/2}$; \item[$\norm{\vec{x}}_{\infty}$] $l_{\infty}$-norm for vector $\vec{x}$, defined as $\norm{\vec{x}}_{\infty} \equiv \max |x_{i}|$, when applied to a matrix the matrix is treated as a linear vector; \item[$\norm{\mat{A}}_{F}$] Frobenius norm for matrix $\mat{A}$, a generalization of the $l_2$ norm for matrix, defined as $\norm{A}_{F} \equiv (\sum_{ij} A_{ij}^{2})^{1/2}$; \item[$\norm{\mat{A}}_{*}$] Nuclear norm for matrix $\mat{A}$ defined as the sum of its singular values. The nuclear norm can be interpreted as the $l_{1}$-norm of the vector of singular value of the matrix. \end{description} \section{The Robust PCA Method} \label{S:rpca} \subsection{Frequency Correlations} \label{S:fc} Consider a 21cm observation image data cube with two angular dimensions and one frequency dimension. The angular pixel indices are re-arranged as one index $p$, then the discrete multi-frequency sky maps is denoted as $x_{i}(p)$ at frequency $\nu_i$ and pixel $p$ as \begin{equation} \label{eq:xip} x_{i}(p) = f_{i}(p) + s_{i}(p) + n_{i}(p), \end{equation} where $f_{i}(p)$ is the foreground, $s_{i}(p)$ the HI 21~cm signal, and $n_{i}(p)$ the receiver noise contributions, or in vector form, \begin{equation} \label{eq:xp} \vec{x}(p) = \vec{f}(p) + \vec{s}(p) + \vec{n}(p). \end{equation} We assume that the 21~cm signal, astrophysical foreground and the instrument noise are uncorrelated with each other, and the noise in different frequency channels are independent and can be modeled as a zero-mean normal distribution, $n_{i}(p) \sim \mathcal{N}(0, \sigma_{i}^{2})$, where $\sigma_{i}^{2}$ is the variance of the noise in frequency channel $i$. Under this assumption, the $\nu - \nu'$ covariance matrix of the noise will be a strictly diagonal matrix $\mat{N} = \text{diag}\{\sigma_{1}^{2}, \cdots, \sigma_{N_{\nu}}^{2}\}$. We have the $N_{\nu} \times N_{\nu}$ size $\nu -\nu'$ covariance matrix of the observed data, \begin{equation} \label{eq:cov} \mat{R} = \frac{1}{N_p} \langle \vec{x} \vec{x}^{T} \rangle = \mat{R}_{f} + \mat{R}_{\text{HI}} + \mat{N}, \end{equation} where $\mat{R}_{f}$, $\mat{R}_{\text{HI}}$ and $\mat{N}$ are the $\nu - \nu'$ covariance matrix of $\vec{f}$, $\vec{s}$ and $\vec{n}$, respectively, and the number of pixels $N_{p}$ is divided as an normalization factor to make the value of the elements of the covariance matrix roughly independent of pixelization. For a well constructed telescope system, to a first approximation, the frequency covariance matrix of the noise $\mat{N}$ may be assumed as diagonal, i.e. the noise could be described by a white noise model, and the different frequency bins are uncorrelated. Such noise would be indistinguishable from that of the 21cm signal $\mat{R}_{\text{HI}}$, as both are sparse and their non-zero elements concentrate on the diagonals. The noise in this case can be suppressed by longer integration time or by cross-correlating with other tracer signal (e.g. the galaxy density obtained by optical observations). If we know the variance of the noise $\sigma_{i}^{2}$ in each frequency bin, we could also subtract the frequency covariance matrix of the noise $\mat{N}$ from $\mat{R}$. In the following, to simplify the discussion, we shall not distinguish $\mat{N}$ and $\mat{R_{\rm HI}}$ any more, but treat them as an effective $\mat{R_{\rm HI}}$, and solve the foregrounds and 21~cm signal separation problem \begin{equation} \label{eq:cov1} \mat{R} = \mat{R}_{f} + \mat{R}_{\text{HI}}. \end{equation} As radio point sources and diffuse foregrounds are all relatively smooth along frequency and have a long frequency coherence, their $\nu - \nu'$ covariance is expected to have very low ranks. A way to see this is to note that $\mat{R}_{f}$ can be expressed as $$\mat{R}_{f} =\frac{1}{N_p} \mat{M}_{f} \mat{M}_{f}^{T},$$ where $\mat{M}_{f}$ is the $N_{\nu} \times N_{p}$ (foregrounds) sky data arranged as a matrix, and $\mat{M}_{f}$ can be well modeled as a low-rank matrix. Its approximate SVD decomposition is $$\mat{M}_{f} \cong \mat{U} \mat{\Sigma} \mat{V}^{T} =\sum_{i=1}^{r} \sigma_{i} \vec{u}_{i} \vec{v}_{i}^{*},$$ where $r \ll N_{\nu}$ is the rank of the matrix $\mat{M}_f$, and $\sigma_{1} > \sigma_{2} > \cdots > \sigma_{r}$ are the non-zero singular values, and $\mat{U} = [\vec{u}_{1}, \cdots, \vec{u}_{r}]$, $\mat{V} = [\vec{v}_{1}, \cdots, \vec{v}_{r}]$ are the corresponding left and right singular vectors. This is the underlying principles of the classic PCA/SVD foreground subtraction method \cite{2013ApJ...763L..20M,2015MNRAS.447..400A,2015MNRAS.454.3240B,2013MNRAS.434L..46S,2015ApJ...815...51S}. On the other hand, the 21~cm signal has very short frequency coherence because its frequency corresponds directly to redshift and thus cosmic distance, its correlation diminishes as the frequency difference $\Delta \nu$ increases. The correlation length $\Delta \nu$ for the 21~cm signal also depends on the angular scale of observation, for the case of interest at $l \sim 100$, this signal is uncorrelated beyond $\Delta \nu \sim 1$~MHz or even less, while for $l \sim 10^{3}$ this occurs around $\sim 0.1$~MHz \cite{2005MNRAS.356.1519B,2007MNRAS.378..119D}. For the 21~cm signal, the $\nu - \nu'$ covariance matrix concentrates along the main diagonal, and the typical value of off-diagonal elements decay rapidly to essentially zero at a few MHz away. So the 21~cm $\nu - \nu'$ covariance matrix is a very sparse one, especially in broad band observations, only elements along or near the diagonal have non-zero values. \subsection{The Algorithm} \label{S:alg} We see above that the $\nu - \nu'$ covariance matrix of the foregrounds and 21~cm signal have distinctly different characteristics, the 21~cm signal has a very sparse structure, i.e., only elements along or near the the diagonal are non-zero, while the $\nu - \nu'$ covariance matrix of foregrounds has low rank. Mathematically, separating such two components are exactly what the RPCA \cite{Candes:2011:RPC:1970392.1970395,NIPS2009_3704,Chandrasekaran2011} is supposed to do, which tries to recover a low-rank component $L$ and a sparse component $S$ from their superposition $M = L + S$ under some suitable assumptions. In other words, the RPCA is to solve the problem \begin{equation} \min \ \text{rank}(L) + \lambda \norm{S}_{0} \quad \text{s.t.} \quad L + S = M, \label{eq:rp0} \end{equation} over the (matrix) variables $L, S \in \mathbb{R}^{m \times n}$ and the regularization parameter $\lambda > 0$. This is a non-convex problem, since the minimization of $\text{rank}(L)$ and $\norm{S}_{0}$ are non-convex and also NP-hard \cite{Natarajan:1995:SAS:207985.207987,Recht:2010:GMS:1958515.1958520}. Its convex relaxation is known as the Principal Component Pursuit (PCP), which is \begin{equation} \min \ \norm{L}_{*} + \lambda \norm{S}_{1} \quad \text{s.t.} \quad L + S = M, \label{eq:rp1} \end{equation} where the nuclear norm $\norm{L}_{*} = \sum_{i} \sigma_{i}(L)$ is the sum of the singular values of the matrix, which is used as a convex proxy for the non-convex $\text{rank}(L)$, and the $l_{1}$-norm $\norm{S}_{1} = \sum_{ij}|S_{ij}|$ is used as a convex proxy for the non-convex $l_{0}$-norm $\norm{S}_{0}$. At first glance it may seem that for the PCP to work, one would have to choose a right regularization parameter $\lambda$, but in practice, the fixed choice $\lambda = 1 / \sqrt{\max{(m, n)}}$ works very well for almost all cases \cite{Candes:2011:RPC:1970392.1970395}. In this sense, there is no tunable parameter in the PCP problem. Of course, in the most general case, there is an obvious degeneracy in the robust PCA problem Eq.~(\ref{eq:rp0}) or its convex version -- the PCP problem Eq.~(\ref{eq:rp1}), i.e., how to distinguish $L$ and $S$ if both are sparse and have low ranks. To separate the two, we make the following assumptions on $L$ and $S$: \begin{enumerate} \item $L$ is not sparse or ``spiky'' in the basis we start with. This is imposed by requiring $L$ to be $\mu$-incoherent \cite{Candes2008DBLP}: given the SVD of the low-rank component (with rank $r$) $L = U\Sigma V^{*}$, let $U_{r}$ and $V_{r}$ denote the matrices consisting the first $r$ columns of $U$ and $V$ respectively, the incoherence parameter $\mu$ is a property of the matrix $L$, it is the smallest value that satisfies all the three inequalities \cite{Candes:2011:RPC:1970392.1970395}: \begin{eqnarray} \label{eq:muinc} \max_{i} \norm{U_{r}^{*} e_{i}}_{2}^{2} &\le& \frac{\mu r}{m}, \\ \max_{i} \norm{V_{r}^{*} e_{i}}_{2}^{2} &\le& \frac{\mu r}{n}, \\ \norm{U_{r} V_{r}^{*}}_{\infty} &\le& \sqrt{\frac{\mu r}{m n}}. \end{eqnarray} Satisfying the incoherence conditions means having a small value of $\mu$, this ensures that $L$ is not sparse \cite{Hornstein2011}. \item The entries of $S$ are ``spread out'', i.e. for $\alpha \in [0,1)$, we assume $S \in \mathcal{S}_{\alpha}$, where $\mathcal{S}_{\alpha}$ is defined as $ \forall i \in [n], j \in [m]$, \begin{equation} \label{eq:Sa} \mathcal{S}_{\alpha} := \left\{ A \in \mathbb{R}^{m \times n} \ \middle| \ \|A_{(i, \cdot)}\|_{0} \leq \alpha n, \|A_{(\cdot, j)}\|_{0} \leq \alpha m \right\}\nonumber\\ \end{equation} In other words, $S$ contains at most a fraction $\alpha$ of non-zero entries per row and column. This guarantees that the probability of $S$ be low-rank is small. For example, if the non-zero elements of $A$ are mainly concentrate on the diagonal, as the case of the frequency covariance matrix of the 21~cm signal we are discussing it satisfies the condition $\mathcal{S}_{\alpha}$. \end{enumerate} The frequency covariance of the foregrounds is low-rank but not sparse, satisfying condition 1; and the frequency covariance matrix of the 21~cm signal is sparse but not low-rank, satisfying condition 2. Under such assumptions, the PCP problems is solvable and convergence guaranteed (c.f. Theorem 1.1 of \cite{Candes:2011:RPC:1970392.1970395}). The PCP problem is a convex optimization problem, many off-the-shelf algorithms and tools are available for its solution \cite{LiuV09,Mohan:2012:IRA:2503308.2503351,Boyd2003,Lin2009,Eckstein2012,Boyd2011}. New algorithm customized for the RPCA and the PCP problem have also been developed, which are generally faster, more robust to corruptions or outliers, or more scalable for large problems \cite{2010arXiv1009.5055L,NIPS2014_5430,Kang2015,YiPCC16}. Here we use an augmented Lagrange multiplier (ALM) algorithm \cite{2010arXiv1009.5055L,Yuan2009} to solve the PCP problem Eq.(\ref{eq:rp1}), which is faster and more accurate than, e.g., the Accelerated Proximal Gradient (APG) method \cite{Lin2009}. The ALM method operates on the augmented Lagrangian \begin{eqnarray} \label{eq:lag} l(L, S, Y) &=& \norm{L}_{*} + \lambda \norm{S}_{1} + \langle Y, M - L - S \rangle \nonumber\\ &+& \frac{\mu}{2} \norm{M - L - S}_{F}^{2}, \end{eqnarray} where $Y$ is an Lagrange multiplier matrix and $\mu$ is a positive scalar. A generic Lagrange multiplier algorithm would solve the PCP problem by repeatedly setting \begin{equation} \label{eq:sub-alm} (L_{k}, S_{k}) = \text{arg} \, \min_{L, S} \, l(L, S, Y_{k}) \end{equation} and then updating the Lagrange multiplier matrix via $$Y_{k+1} = Y_{k} + \mu (M - L_{k} - S_{k}).$$ Two ALM methods had been proposed to solve the RPCA problem\cite{2010arXiv1009.5055L}: the exact ALM (EALM) method has a pleasing Q-linear convergence speed, and a slight improvement over the exact ALM leads an inexact ALM (IALM) method, which converges practically as fast as the exact ALM, but the required number of partial SVDs is significantly less. Here, we will use the IALM method, since the algorithm is easy to implement, and performs excellently on a wide range of problem settings without need of tuning parameters. The IALM method does not solve Eq.~(\ref{eq:lag}) exactly, rather, it alternately updates $L_{k}$ and $S_{k}$ by solving a sequence of convex programs of $\text{min}_{L} \, l(L, S, Y)$ and $\text{min}_{S} \, l(L, S, Y)$ while keeping the other matrix variables fixed. By doing so, both problems have very simple and efficient closed solutions. Let $\mathcal{S}_\tau : \mathbb{R} \to \mathbb{R}$ denote the shrinkage operator (also called the soft-thresholding operator), $$\mathcal{S}_\tau[x] = \text{sgn}(x) \, \text{max}( |x| - \tau, 0 ),$$ and extend it to matrices by applying it to each element. It is easy to show that the solution to the first problem is \begin{equation} \label{eq:minS} \text{arg} \, \min_{S} \, l(L, S, Y) = \mathcal{S}_{\lambda \mu^{-1}}(M - L + \mu^{-1} Y). \end{equation} Similarly, for matrix $X$, let $\mathcal{D}_\tau(X)$ denote the singular value thresholding operator given by \cite{Cai2010a} $$\mathcal{D}_\tau(X) =U \mathcal{S}_\tau(\Sigma) V^* ,$$ where $X = U \Sigma V^*$ is its singular value decomposition, it can be shown that \begin{equation} \label{eq:minL} \text{arg} \, \min_{L} \, l(L, S, Y) = \mathcal{D}_{\mu^{-1}}(M - L + \mu^{-1} Y). \end{equation} The above method is summarized in Algorithm \autoref{alg:RPCA_ALM}, proof of its convergence is given in \cite{2010arXiv1009.5055L}. The iteration of the algorithm can be stopped once \begin{equation} \norm{M - L - S}_{F} \le \delta \norm{M}_{F}, \label{eq:ALMconverge} \end{equation} with a sufficiently small $\delta$, where the Frobenius norm $\norm{M}_{F}^{2} = \sum_{ij} M_{ij}^{2}.$ \begin{algorithm}[H] \caption{\bf (The PCP problem by ALM)} \begin{algorithmic}[1] \STATE {\bf initialize:} $S_0 = Y_0 = 0, \mu > 0, \delta > 0$. \WHILE{$\norm{M - L - S}_{F} > \delta \norm{M}_{F}$ } \STATE \hspace{2 mm} compute $L_{k+1} = \mathcal{D}_\mu^{-1}(M - S_k + \mu^{-1} Y_k)$; \STATE \hspace{2 mm} compute $S_{k+1} = \mathcal{S}_{\lambda \mu^{-1}}(M - L_{k+1} + \mu^{-1} Y_k)$; \STATE \hspace{2 mm} compute $Y_{k+1} = Y_k + \mu (M - L_{k+1} - S_{k+1})$; \ENDWHILE \STATE {\bf output:} $L, S$. \end{algorithmic} \label{alg:RPCA_ALM} \end{algorithm} In the problem of foregrounds and 21~cm signal component separation, as discussed above, the assumption that the low-rank component (the frequency covariance matrix of the foregrounds) is not ``spiky'' and the entries of the sparse one (the frequency covariance matrix of the 21~cm signal) are ``spread out'' is obviously satisfied. In contrast to the usual application of the RPCA method and the PCP problem where recovery of the low rank matrix $L$ is the primary goal, here the sparse component $S$ is what we really want, as it will provide a good estimate for the HI 21~cm frequency covariance matrix $\mat{\hat{R}}_{\text{HI}}$. The low rank component $L$ may also be of interest as it gives a good approximation of the foreground frequency covariance matrix $\mat{\hat{R}}_{f}$, which as a byproduct, actually provides an estimate of the foreground from the observation itself. Note that the matrix $\mat{R}$ is symmetric positive definite in this problem, as it is the frequency covariance matrix of the observed sky, but the RPCA method and the PCP algorithm do not require this, the matrix $M$ in Eqs.(\ref{eq:rp0}) or (\ref{eq:rp1}) can be non-symmetric, so the same method can be applied in the case of cross-correlation with other observation, and even non-square matrix in the general case. \begin{figure*}[htbp] \centering \includegraphics[trim=180 10 180 10,clip,width=0.4\textwidth]{sim_galaxy_256_700_800_256_128_T_50.png} \includegraphics[trim=180 10 180 10,clip,width=0.4\textwidth]{sim_21cm_256_700_800_256_128_T.png} \\ \includegraphics[trim=180 10 180 10,clip,width=0.4\textwidth]{sim_pointsource_256_700_800_256_128_T_-15_15_-10_10.png} \includegraphics[trim=180 10 180 10,clip,width=0.4\textwidth]{sim_total_256_700_800_256_128_T_50.png} \caption{Input sky maps at 750 MHz. From left to right, top to bottom, the brightness temperature of the simulated Galactic synchrotron emission, 21~cm signal, extragalactic point sources and the sum of the three components, respectively. To better visualize the point source, in the bottom left panel a small part of the map, ($-15\degree \le \alpha \le 15\degree$, $-10\degree \le \delta \le 10\degree$), is shown . } \label{fig:maps} \end{figure*} For comparison, the frequently used classical PCA can be expressed as solving the (non-convex) problem \begin{equation} \min \, \norm{M - L}_{F} \quad \text{s.t.} \quad \text{rank}(L) \le k, \label{eq:cp} \end{equation} with problem data $M$, variable $L$, and integer $k \ge 1$. In the classical PCA, $M$ is approximated as a low rank matrix $L$ with the Frobenius norm error minimized. It can be efficiently solved with the SVD method, and works well when the error is small and distributed as independent and identically Gaussian. But the classical PCA is not robust when the data is grossly corrupted, i.e., with large outliers. Also it is easy to fail in cases when a matrix is only a few sparse terms away from being low-rank, especially if the sparse terms have large magnitudes. By contrast, RPCA decomposes a matrix into the sum of a low-rank matrix and a sparse matrix, thereby separates out the sparse errors, the entries in the sparse error matrix $S$ can have arbitrary large magnitude as long as its support is sufficiently small. Performing this separation prevents the sparse errors from obscuring the low-rank component \cite{Candes:2011:RPC:1970392.1970395}. \subsection{Simulation} \label{S:sim} \begin{figure*}[htbp] \centering \includegraphics[trim=30 10 30 10,clip,width=0.4\textwidth]{tt_corr.png} \includegraphics[trim=30 10 30 10,clip,width=0.4\textwidth]{diff.png} \\ \includegraphics[trim=30 10 30 10,clip,width=0.4\textwidth]{L.png} \includegraphics[trim=30 10 30 10,clip,width=0.4\textwidth]{S.png} \caption{Frequency correlation matrix of data $\mat{R}$ (upper left), the recovered low-rank matrix $L$ (lower left) and the sparse matrix $S$ (lower right), and the difference of $\mat{R}_{\text{HI}} - S$ (upper right).} \label{fig:dec} \end{figure*} We use simulated sky map data to demonstrate the application of the RPCA method for the separation of the foregrounds and the 21~cm signal. The real foreground may consist of many different physical components, such as synchrotron radiation, free-free emission, and emission by dusts. Here for demonstration we only include the two main components at low frequencies, i.e. the galactic synchrotron radiation and the extragalactic radio point sources. For this simulation, we use the Cosmology in the Radio Band (CORA)~\footnote{\url{https://github.com/radiocosmology/cora}} \cite{2014ApJ...781...57S,2015PhRvD..91h3514S} package, which simulates sky emission including galactic and extragalactic foregrounds, with some extra utility codes for dealing with Healpix maps and spherical co-ordinates. We consider a case which is inspired by the Tianlai experiment \cite{2012IJMPS..12..256C} whose pathfinder works at the frequency range $700-800 \ensuremath{\, {\rm MHz}}$. We generate the sky maps in the frequency range $700-800$~MHz, with 256 equally spaced frequency bins ($\Delta \nu \sim 0.39$~MHz), and the whole sky is divided using the HEALPix pixelization scheme \cite{2005ApJ...622..759G} with $n_{\text{side}} = 256$, which corresponds to an angular resolution of $\sim 13.7$~arcmin. To take the effect of frequency dependent beam into account, we first convolve the generated sky maps with a symmetric circular frequency dependent Gaussian beam with $\theta=1.22 \lambda / D$, where $\lambda$ is the observing wavelength, and $D$ is the diameter of the telescope. We take $D=100$m, corresponding to the optimal size for the mid-redshift 21cm intensity mapping experiment \cite{2008PhRvL.100i1303C,2010ApJ...721..164S,2012A&A...540A.129A}, and also the size of current largest fully steerable telescope, such as the Green Bank Telescope (GBT) which is conducting intensity mapping observations \cite{2010Natur.466..463C,2013ApJ...763L..20M,2013MNRAS.434L..46S}. For this size the beam width is $\sim 16.8$~arcmin at 750 MHz, which roughly matches the resolution of the map. The details of the simulation is given in Appendix~\ref{S:gen}. We tested our procedure by making 10 different realizations of the random field, and found similar results in each case. One of these is shown in \autoref{fig:maps}, at the central frequency of 750 MHz. We use Algorithm \autoref{alg:RPCA_ALM} to solve the PCP problem, with a fixed regularization parameter $\lambda = 1 / \sqrt{N_{\nu}}$, where $N_{\nu}$ is the number of rows (or columns) of the $\nu - \nu'$ covariance matrix $\mat{R}$. After a few trials, we found that $\mu = 10^8$ works, though it is not necessarily the optimal value. We terminate the algorithm when $\norm{\mat{R} - L - S}_{F} \leq \delta \, \norm{\mat{R}}_{F}$ with $\delta = 10^{-14}$. The algorithm converges quickly with this choice of $\lambda$ and $\mu$, it takes less than 100 iterations to get the required precision. The frequency covariance matrix $\mat{R}$ is then successfully decomposed into a low-rank component $L$, which is mainly the contribution of the foreground, and an almost diagonal sparse component $S$, which represents the frequency covariance matrix of the 21~cm signal. The result is shown in \autoref{fig:dec}, from which we see the maximum element difference between $S$ and the input $\mat{R}_{\text{HI}}$ is at least an order of magnitude lower than the corresponding element of $\mat{R}_{\text{HI}}$, shown a very accurate recovery of the 21~cm signal frequency covariance matrix from the total signal. \section{21cm Signal Recovery} \label{S:21cm} Once we obtained the 21~cm $\nu - \nu'$ covariance matrix $\mat{\hat{R}}_{\text{HI}}$ (the sparse matrix $S$) and the foreground covariance matrix $\mat{\hat{R}}_{f}$ (the low-rank matrix $L$), the 21cm signal can be recovered from the data. A number of methods are available for this task, some by using only $S$, and others may use both $L$ and $S$. For example, the Karhunen-Lo\`eve (K-L) transform method is one of the latter, it seeks to find a linear transformation of the observed data $\vec{x}' = \mat{P} \vec{x}$ such that by projecting onto the transformation matrix $\mat{P}$ the signal covariance matrix $S$ becomes diagonal and the noise (here the foreground) covariance matrix $L$ becomes the identity matrix $\mat{I}$: \begin{align} S \to S' &= \mat{P} S \mat{P}^{T} = \mat{\Lambda}, \notag \\ L \to L' &= \mat{P} L \mat{P}^{T} = \mat{I}, \label{eq:SL} \end{align} where $\mat{\Lambda}$ is a diagonal matrix, and $\mat{I}$ is the identity matrix. The sub-space with low foreground contamination can then be identified as those with larger values of diagonal elements of $\mat{\Lambda}$. Mathematically, this transformation can be found by solving the generalized eigenvalue problem $S \vec{x} = \lambda L \vec{x}$, or written in matrix form $S \mat{X} = L \mat{X} \mat{\Lambda}$. This gives a set of eigenvectors $\vec{x}$ (or $\mat{X}$), and corresponding eigenvalues $\lambda$ (or $\mat{\Lambda}$), then $\mat{X} = \mat{P}^{T}$, i.e. the transformation matrix $\mat{P}$ consists each eigenvectors $\vec{x}$ as a row. To recover the 21~cm signal, select modes with eigenvalue (which is the signal-to-foreground power) greater than a certain threshold. Define the matrix $\mat{P}_{s}$ which contains only the rows from $\mat{P}$ corresponding to eigenvalues greater than the threshold $s$, the 21~cm signal is then recovered approximately by $\vec{\hat{s}}= \mat{P}_{s} \vec{x}$. This 21~cm signal recovery method depends on the joint transformation of $L$ and $S$, the inaccuracy in either $L$ and $S$ may lead to large errors. Another potential problem of this method is that for the generalized eigenvalue problem to have a solution, $L$ must be symmetric positive definite, but there is no guarantee for this in the RPCA decomposition, and the solution would fail if $L$ is not positive definite. For these reasons, here we choose to uses only the $S$ matrix, which is generally more robust than methods which depend on both $L$ and $S$. Note that to do RPCA decomposition, both the sparsity of $S$ and low-rank of $L$ and needed, but to recover the 21~cm signal, $S$ is sufficient. In this paper we use the generalized Internal Linear Combination (ILC) method \cite{2011MNRAS.418..467R} to recover the 21~cm signal. The ILC component separation method has been extensively used to extract the cosmic microwave background (CMB) from the WMAP multi-frequency data \cite{2003ApJS..148...97B,2003PhRvD..68l3523T,2009A&A...493..835D}. However, here we will follow the method and symbol notations presented in \cite{2016MNRAS.456.2749O} because which also deals with HI signal extraction, thus closer to our work. We have already mentioned that foreground components are correlated over frequencies, so we expect that the foregrounds signal can be represented as a linear combination of a finite number $m$ of independent templates, which do not necessarily represent physical components. In other words, we try to capture all foreground contributions as resulting from $m$ (unphysical) templates, so $m$ is just the effective dimension of the foregrounds subspace. While the 21~cm signal $\vec{s}$ is only correlated over adjacent frequencies, and can be represented as the linear combination of $N_{\nu} - m$ independent (unphysical) templates $\vec{t}$, \begin{equation} \label{eq:st} \vec{s} = \mat{S} \vec{t}, \end{equation} where $\mat{S}$ is a $N_{\nu} \times (N_{\nu} - m)$ mixing matrix giving the contribution from the templates to the HI emission in each frequency channel. Note that we are not interested in recovering $\vec{t}$, our goal is just to use it to explore the subspace of the HI signal and recover $\vec{s}$. Using this expression, we can write the 21~cm $\nu - \nu'$ covariance matrix as \begin{equation} \label{eq:RHI} \mat{R}_{\text{HI}} = \mat{S} \mat{R}_{t} \mat{S}^{T}, \end{equation} where $\mat{R}_{t} = \langle \vec{t} \vec{t}^{T} \rangle$ is the $(N_{\nu} - m) \times (N_{\nu} - m)$ covariance matrix of the templates $\vec{t}$. The generalized ILC method estimates the signal $\vec{s}$ as a linear combination of the total signal $\vec{x}$ as \begin{equation} \label{eq:sest} \hat{\vec{s}} = \mat{W} \vec{x}, \end{equation} where $\mat{W}$ is the $N_{\nu} \times N_{\nu}$ ILC weight matrix, which have unit response to the 21~cm signal, while minimizing the total variance of the vector estimate $\hat{\vec{s}}$. The optimal weighting matrix of the generalized multi-dimensional ILC can be written as \cite{2011MNRAS.418..467R} \begin{equation} \label{eq:W} \mat{W} = \mat{S} (\mat{S}^{T} \mat{R}^{-1} \mat{S})^{-1} \mat{S}^{T} \mat{R}^{-1}. \end{equation} We can see from Eq.~(\ref{eq:W}) that $\mat{W}$ is invariant under the transformation $\mat{S} \to \mat{S}\mat{T}$ for any invertible matrix $\mat{T}$, so $\vec{t}$ can also be replaced by any other linear combination $\mat{T} \vec{t}$. We apply the following transformation to the total signal $\vec{x}$ using the estimated 21~cm $\nu - \nu'$ covariance matrix $\mat{\hat{R}}_{\text{HI}}$, \begin{equation} \label{eq:Rx} \vec{x} \to \mat{\hat{R}}_{\text{HI}}^{-1/2} \vec{x}, \end{equation} where the matrix $\mat{\hat{R}}_{\text{HI}}^{-1/2}$ is defined to satisfy $\mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{\hat{R}}_{\text{HI}} \mat{\hat{R}}_{\text{HI}}^{-1/2} = \mat{I}$, and can be calculated by eigen-decomposition: $\mat{\hat{R}}_{\text{HI}}= \mat{U} \mat{\Lambda} \mat{U}^{T}$, then $\mat{\hat{R}}_{\text{HI}}^{-1/2} = \mat{U} \mat{\Lambda}^{-1/2} \mat{U}^{T}$. \begin{figure}[htbp] \centering \includegraphics[trim=20 20 30 20,clip,width=0.45\textwidth]{eig_val.png} \includegraphics[trim=20 20 30 20,clip,width=0.45\textwidth]{eig_val_1000x.png} \caption{Eigen-values of the covariance matrix $\mat{C}=\mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R} \mat{\hat{R}}_{\text{HI}}^{-1/2}$. Top is for the parameters setting of this simulation, four eigen-values are significantly larger; bottom is for the case when the 21~cm signal is 1000 times larger, now there is two significantly lager eigen-values.} \label{fig:eigval} \end{figure} \begin{table*}[htbp] \centering \caption{The largest 20 eigenvalues. } \begin{ruledtabular} \begin{tabular}{ccccc} $2.680 \times 10^{11}$ & $2.187 \times 10^8$ & $3.751 \times 10^4$ & $3.824 \times 10^1$ & 1.201 \\ \hline 1.188 & 1.181 & 1.169 & 1.164 & 1.147 \\ \hline 1.135 & 1.129 & 1.119 & 1.108 & 1.099 \\ \hline 1.089 & 1.082 & 1.073 & 1.063& 1.055 \\ \end{tabular} \end{ruledtabular} \label{tab:eig20} \end{table*} The transformed quantity $\mat{\hat{R}}_{\text{HI}}^{-1/2} \vec{x}$ will have a covariance \begin{eqnarray} \label{eq:RRR} \mat{C} &\equiv& \mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R} \mat{\hat{R}}_{\text{HI}}^{-1/2} \nonumber\\ &=& \mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R}_{f} \mat{\hat{R}}_{\text{HI}}^{-1/2} + \mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R}_{\text{HI}} \mat{\hat{R}}_{\text{HI}}^{-1/2}. \end{eqnarray} The estimated HI $\nu - \nu'$ covariance matrix $\mat{\hat{R}}_{\text{HI}}$ is close to the real HI covariance matrix $\mat{R}_{\text{HI}}$, so the last term in Eq.~(\ref{eq:RRR}) will be close to the identity matrix $\mat{I}$. Now if we make an eigen-decomposition of the left covariance matrix of Eq.~(\ref{eq:RRR}), we have \begin{equation} \label{eq:eig} \mat{C}= [\mat{U}_{F} \mat{U}_{S}] \times \begin{bmatrix} \lambda_1 + 1 & & & \\ & \cdots & & \\ & & \lambda_m +1 & \\ & & & \mat{\tilde{I}} \\ \end{bmatrix} \, \times \, \begin{bmatrix} \mat{U}_F^T \\ \mat{U}_S^T \end{bmatrix}, \end{equation} where $\mat{\tilde{I}}$ is used to denote the appropriate identity sub-matrix. From this we see that the eigenvalues of the covariance matrix $\mat{C}=\mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R} \mat{\hat{R}}_{\text{HI}}^{-1/2}$ that are nearly unity contains the power of the HI 21~cm signal, with the corresponding eigenvectors spanning the HI subspace. This is equivalent to say that the eigenvalues significantly greater than unity contains the foreground components, and the number of these eigenvalues determines $m$, the dimension of foreground subspace. We can extract the subspace corresponding to the HI 21~cm signal as \begin{equation} \label{eq:HIsub} \mat{\hat{R}}_{\text{HI}}^{-1/2} \mat{R}_{\text{HI}} \mat{\hat{R}}_{\text{HI}}^{-1/2} = \mat{U}_{S} \, \mat{\tilde{I}} \, \mat{U}_{S}^{T}, \end{equation} which can be re-written as \begin{equation} \label{eq:RHIest} \mat{R}_{\text{HI}} = \mat{\hat{R}}_{\text{HI}}^{1/2} \mat{U}_{S} \, \mat{\tilde{I}} \, \mat{U}_{S}^{T} \mat{\hat{R}}_{\text{HI}}^{1/2}. \end{equation} This is just the $N_{\nu} \times N_{\nu}$ HI $\nu - \nu'$ covariance matrix projected onto the $(N_{\nu} - m)$-dimensional HI subspace spanned by the subset of eigenvectors collected in matrix $\mat{U}_{S}$. Compare Eq.~(\ref{eq:RHIest}) with Eq.~(\ref{eq:RHI}), and using the fact that the template $\vec{t}$ can be replaced by any linear combination $\mat{T} \vec{t}$ provided $\mat{T}$ is invertible, we can choose $\mat{T}$ to be the orthogonal transform matrix of $\mat{R}_{t}$ to re-express Eq.~(\ref{eq:RHI}) as \begin{equation} \label{eq:RHI1} \mat{R}_{\text{HI}} = \mat{S} \mat{T} \mat{D}_{t} \mat{T}^{T} \mat{S}^{T}, \end{equation} where $\mat{D}_{t}$ is the diagonal matrix of the orthogonal transform $\mat{R}_{t} = \mat{T} \mat{D}_{t} \mat{T}^{T}$. Now we can see that \begin{equation} \label{eq:ST} \mat{S} \mat{T} = \mat{\hat{R}}_{\text{HI}}^{1/2} \mat{U}_{S} \end{equation} up to an scaling factor which could be absorbed into $\mat{T}$. Since $\mat{W}$ is invariant under the transform of $\mat{S} \to \mat{S}\mat{T}$ for any invertible matrix $\mat{T}$, we get the estimate of the mixing matrix of the 21~cm signal as \begin{equation} \label{eq:Sest} \mat{\hat{S}} = \mat{\hat{R}}_{\text{HI}}^{1/2} \mat{U}_{S}. \end{equation} Now we can substitute Eq.~(\ref{eq:Sest}) into Eq.~(\ref{eq:W}), then from Eq.~(\ref{eq:sest}) we can get the recovered HI 21~cm signal. We show that the eigenvalues of the covariance matrix $\mat{C}$ for the simulated data in \autoref{fig:eigval} and the largest 20 eigen-values in \autoref{tab:eig20}. \begin{figure}[htbp] \centering \includegraphics[trim=10 10 10 10,clip,width=0.45\textwidth]{rec_cm_2p00.png} \includegraphics[trim=10 10 10 10,clip,width=0.45\textwidth]{ratio.png} \caption{HI 21~cm signal recovery result for a threshold 2.0. Subfigures are: (a) the recovered 21~cm signal, (b) the relative difference of the input 21~cm signal and the recovered 21~cm signal.} \label{fig:rec2.0} \end{figure} \begin{figure}[htbp] \centering \includegraphics[trim=5 10 30 10,clip,width=0.45\textwidth]{cl_normalize_2p00.png} \includegraphics[trim=5 10 30 10,clip,width=0.45\textwidth]{Tl_2p00.png} \caption{The normalized angular power spectrum $l(l + 1) C_{l} /2\pi$ of the recovered HI 21~cm signal for a threshold 2.0 (top), where the curve labeled ``cross'' is the cross angular power spectrum of the input 21~cm signal and the recovered 21~cm signal, and the transfer function $T_{l} = C_{l}^{\text{input}} / C_{l}^{\text{recovered}}$ (bottom).} \label{fig:cl2.0} \end{figure} From Eq.~(\ref{eq:eig}) we see the eigenvalues of $\mat{C}$ are $1+\lambda_m$, so if we select $\lambda_m >1$ or the eigenvalues of $\mat{C}$ greater than 2, the subspace of the eigenvectors would correspond to the low rank matrix $\mat{L}$, so in fact there is no arbitrary choice here. From \autoref{fig:eigval} and \autoref{tab:eig20}, we see that in this simulation there are four large eigenvalues, all other eigenvalues are significantly smaller. As we will see, this number is also the optimal number of eigen-modes that should be subtracted in the classic PCA method, which actually reflects the fact that our foreground model has four principal components that dominates the 21~cm signal. We have also made tests to check this correspondence. For example, if we artificially increase the 21~cm signal by 1,000 times while keeping the foregrounds unchanged, now the signal actually dominates the smaller two principal components of the foregrounds, and we see there is only two eigenvalues that are significantly larger as shown in the bottom of \autoref{fig:eigval}. The GILC method can quite automatically and robustly detected the dimensionality of the foreground subspace, which is an additional advantage of our method against the classic PCA method we will discuss next. We show in Fig.\ref{fig:rec2.0} (a) the recovered 21~cm signal, (b) the relative difference of the input 21~cm signal and the recovered 21~cm $(\vec{x}^{\text{recovered}} - \vec{x}^{\text{input}}) / (\bar{T}_{b} + \vec{x}^{\text{input}})$, where $\bar{T}_{b}$ is the mean temperature of the 21~cm signal computed according to \autoref{eq:Tbz}. For fully accurate recover, the relative difference is 0. We can see from the figure that the signal is generally well recovered, as most points of the map the relative error is nearly zero. The residue deviations are randomly distributed over the sky. We can also check the recovery in spherical harmonic space, which is also what we are ultimately interested in cosmology. The cross angular power spectrum between the input and recovered map is defined as $$C_{l}^{\text{cross}} = \frac{1}{2l + 1} \sum_{m}\frac{1}{2}(a_{lm}^{\text{input}} a_{lm}^{\text{recover}, *} +a_{lm}^{\text{input}, *} a_{lm}^{\text{recover}}).$$ where $a_{lm}^{\text{input}}, a_{lm}^{\text{recover}}$ are the spherical harmonic expansion coefficients for the input and recovered map respectively. The auto power spectrum for the input map, recovered map and the cross power are shown in \autoref{fig:cl2.0}. These power spectra almost coincides with each other, and the residue difference is very small. We can also compute the angular power transfer function $T_{l} = C_{l}^{\text{input}} / C_{l} ^{\text{recovered}}$, which is shown as the bottom panel of Fig.\ref{fig:cl2.0}, which is nearly unity for the interested $\ell$ range, though the error is larger at small $l$ due to cosmic variance. \section{Comparison with the Classic PCA} \label{S:comp} In contrast to the classic PCA/SVD foreground subtraction method which only uses the low-rank structure and characteristics of the foregrounds implicitly, the RPCA method presented in this paper exploits the additional characteristics of the HI 21~cm signal frequency covariance matrix as well, which has a very sparse structure, as discussed in \autoref{S:fc}, only the elements along and near the main diagonal are non-zero. This improves the effectiveness of foreground subtraction, and is free from the 21 cm signal loss problem encountered in the classic PCA/SVD method. To compare with the classic PCA method, we follow the method presented in \cite{2015MNRAS.447..400A,2015MNRAS.454.3240B}. Diagonalize the frequency covariance matrix $\mat{R}$ of the full data set with an eigen-decomposition, \begin{equation} \label{eq:ed} \mat{U}^{T} \mat{R} \mat{U} = \mat{\Lambda} \equiv \text{diag} \{ \lambda_{1}, \cdots, \lambda_{N_{\nu}} \}, \end{equation} The magnitude of $\lambda_{i}$ gives the variance of the corresponding eigen-mode, each eigenvalue measures the contribution of its corresponding eigenvector to the total sky variance. As the foreground components dominate the full data overwhelmingly, we expect they would occupy the modes with the largest eigenvalues, so we pick a number of the largest eigenvalues $\lambda_{1} \ge \lambda_{2} \ge \cdots \lambda_{k} \ge 0$ to construct a matrix $\Lambda_{f} = \text{diag} \{ \lambda_{1}, \cdots, \lambda_{k}, 0, \cdots, 0 \}$, and use their corresponding eigenvectors to build a matrix $\mat{U}_{f}$, then use this matrix to extract the foregrounds from the full data as $\hat{\vec{f}} = \mat{U}_{f} \mat{U}_{f}^{T} \vec{x}.$ Its covariance matrix is $ \hat{\mat{R}}_{f} = \frac{1}{N_p} \langle \hat{\vec{f}} \hat{\vec{f}}^{T} \rangle = \mat{U}_{f} \mat{\Lambda}_{f} \mat{U}_{f}^{T},$ This is the solution of the classical PCA problem Eq.~(\ref{eq:cp}) with $M$ being the full data covariance matrix $\mat{R}$ and $k$ being the number of largest eigenvalues corresponding to the contribution of foregrounds. The 21~cm signal can then be reconstructed by subtracting the foregrounds from the total data with $ \hat{\vec{s}} = \vec{x} - \hat{\vec{f}}$. \begin{figure}[htbp] \centering \includegraphics[trim=20 20 30 20,clip,width=0.45\textwidth]{cpcaeig_val.png} \caption{Eigen-values of the covariance matrix $\mat{R}$.} \label{fig:pca-eig} \end{figure} For our simulated data, we show the eigenvalues in \autoref{fig:pca-eig}. We see that there are four eigenvalues which are significantly larger than others, the other eigenvalues decay slowly, which is different from that in \autoref{fig:eigval}, where aside from the largest four eigenvalues, all others are quite close to 1, because by doing the transformation \autoref{eq:Rx}, we have made the covariance matrix corresponding to the signal subspace close to identity. By subtracting the first 4 eigenmodes we obtain the reconstructed HI 21~cm signal. \begin{figure}[htbp] \centering \includegraphics[trim=0 10 10 10,clip,width=0.45\textwidth]{e_diff.png} \includegraphics[trim=0 10 10 10,clip,width=0.45\textwidth]{r_diff.png} \caption{Difference of RMSE (top) and Pearson correlation coefficient $r$ (bottom) between the RPCA+GILC method and the classical PCA method for all frequency points.} \label{fig:diff} \end{figure} To compare the robust and classical PCA results, we introduce two quantitative aspects: the Root-Mean-Square Error (RMSE) and the Pearson correlation coefficient $r$. The former is defined as $$ \text{RMSE} = \sqrt{\sum\nolimits_{i}(x_{i}^{\text{input}} - x_{i}^{\text{recovered}})^{2}}, $$ which reflects the total disagreement between the recovered 21~cm signal $\vec{x}^{\text{recovered}}$ and the input 21~cm signal $\vec{x}^{\text{input}}$; the latter is defined as $$ r = \frac{\sum_{i}(x_{i}^{\text{input}} - \bar{x}^{\text{input}})(x_{i}^{\text{recovered}} - \bar{x}^{\text{recovered}})}{\sqrt{\sum_{i}(x_{i}^{\text{input}} - \bar{x}^{\text{input}})^{2}} \sqrt{\sum_{i}(x_{i}^{\text{recovered}} - \bar{x}^{\text{recovered}})^{2}}}, $$ which is a measure of the linear correlation between the recovered 21~cm signal $\vec{x}^{\text{recovered}}$ and the input 21~cm signal $\vec{x}^{\text{input}}$, where $\bar{x}^{\text{recovered}}$ and $\bar{x}^{\text{input}}$ are the mean of $\vec{x}^{\text{recovered}}$ and $\vec{x}^{\text{input}}$, respectively. We show the difference of RMSE and $r$ between the two methods in \autoref{fig:diff} for each frequency point, where we see the 21~cm signal recovered by the RPCA + GILC method is consistently better than that recovered by the classical PCA method in the whole frequency band, though in this case the difference is not large. This is probably because the foreground in our simulation can be well approximated by a rank-4 matrix, so the classical PCA extraction is already pretty good. \begin{figure}[htbp] \centering \includegraphics[trim=15 10 30 10,clip,width=0.45\textwidth]{Pkp_100.png} \caption{The line of sight temperature power spectrum $P_{21}(k_{\parallel})$ of the recovered 21~cm signal.} \label{fig:pk} \end{figure} We plot the line of sight temperature power spectrum $P_{21}(k_{\parallel})$ of the recovered signal by the RPCA method and by the classical PCA method with different number of PCA modes being subtracted in \autoref{fig:pk}. Both performs well on small scales (large $k$). On the large scales (small $k$), the performance of both methods get worse as here the signal is more similar to the smooth foregrounds. The oscillating structure in the recovered $P_{21}(k_{\parallel})$ is due to the limited bandwidth (100~MHz) we have used. However, in the classical PCA the number of modes to be subtracted is more uncertain, as the decay of the eigenvalues is slower near the floor, as shown in Fig.~\ref{fig:pca-eig}, making it harder to decide how many modes should be subtracted. If the number of PCA modes being subtracted is incorrectly set (in this figure more than optimal 4 modes), the recovery performance of the classical PCA methods would become significantly worse as more modes with higher signal-to-foreground ratio are being subtracted, which causes the signal loss problem. For the recovery of the power spectrum, this signal-loss could be partially compensated by computing the signal loss transfer function from numerical simulations \cite{2013ApJ...763L..20M,2013MNRAS.434L..46S}, but it is still a tricky and time-consuming process. In the RPCA method, at least in principle, the separation of the 21cm signal and the foreground is automatic, and as shown in Fig.~\ref{fig:eigval} the eigenvalues are more distinctly separated. However, despite the advantage of the RPCA method over the classic PCA method, in the recovered 21~cm signal and power spectrum the difference is not large. While we showed only one example above, we have tried various different realizations and different mean signal-to-foreground ratios, the results are generally similar to what we get here, the RPCA result is only slightly better than the best result of the classical PCA with optimal subtraction of modes. A possible reason for this is that the simulated foreground and beam models are so simple that the classical PCA already subtracted most of the foregrounds in the simulation. In practice, however, a much larger number of principal components must be subtracted from the the real observation data using the classical PCA. For example, in Ref. \cite{2013ApJ...763L..20M}, after many trials the first 20 modes are subtracted to get the 21~cm map. The signal loss would be quite severe, one needs to use simulation of mock samples to measure the power spectrum transfer function in the SVD in order to compensate for the signal loss. In that case the advantage of the RPCA method would be more significant. Analysis of the real data, however, require to deal with a number of practical issues. In the present paper we will concentrate on the algorithm itself, while the application to the observational data would be investigated in a subsequent study. \begin{figure}[htbp] \centering \includegraphics[trim=25 10 50 20,clip,width=0.45\textwidth]{rel_loss_100.png} \caption{The relative recovery error of the 21~cm signal for the two method: red dots for the classical PCA method, green line for the RPCA method. $x$-axis is the number of modes subtracted by the classical PCA method.} \label{fig:loss} \end{figure} By utilizing both the low-rank property of the foreground frequency covariance and the sparsity of the 21~cm signal frequency covariance, the RPCA method can be used to subtract the foreground without losing the signal, which was encountered in the classic PCA method. However, the GILC reconstruction process may not be the best reconstruction method and also causes some signal loss too. To make a fair comparison of the RPCA with the classical PCA without being affected by the additional GILC part, we define a quantity $\Delta = \norm{\hat{\mat{R}}_{\text{HI}} - \mat{R}_{\text{HI}}}_{F} / \norm{\mat{R}_{\text{HI}}}_{F}$ as the relative error between the recovered 21~cm signal frequency covariance matrix $\hat{\mat{R}}_{\text{HI}}$ and the input 21~cm signal frequency covariance matrix $\mat{R}_{\text{HI}}$. We show the relative error $\Delta$ in \autoref{fig:loss} for the RPCA method and also the classical PCA method with different number of PCA modes subtracted, where $\hat{\mat{R}}_{\text{HI}}$ is the sparse component $S$ for the RPCA method, and $\langle \hat{\vec{s}} \hat{\vec{s}}^{T} \rangle / N_{p}$ for the classical PCA method where $\hat{\vec{s}}$ is the recovered 21~cm signal. In \autoref{fig:loss}, we see a clear turning point at $N=4$ for the number of subtracted modes for the classical PCA method. This shows that the relative error decreases as we subtract the large PCA modes initially, but then the relative error begin to increase again as we subtract more modes, indicating more and more severe 21~cm signal loss during the classical PCA mode subtracting process. The relative recovery error of the RPCA method is about an order of magnitude lower than even the lowest relative error of the classical PCA method, indicating a better foreground subtraction and 21~cm signal recovery result. We see that the RPCA method and the PCP algorithm are actually quite automatic in the sense that less tunable parameters are needed for the user to provide or tune, the regularization parameter $\lambda$ can be taken as $\sqrt{\max{(m, n)}}$ and works well in almost all cases, the user only need to provide an appropriate threshold $\delta$ for the iteration stopping criteria, Algorithm \autoref{alg:RPCA_ALM} automatically gets the matrices $L$ and $S$ satisfying the required low-rank and sparsity condition, the rank $k$ of $L$ and the number of non-zero elements and their support do not need to be known as a prior or to be determined, while for the classical PCA/SVD foreground subtraction, the user has to do several trials to determine the optimal number of principal components or SVD modes for a balance of good 21~cm signal recovery result and minimum signal loss. \section{Discussion} \label{S:dis} We have shown by simulation that the RPCA method can efficiently extract the HI 21~cm $\nu - \nu'$ covariance matrix from the observed data with better accuracy than the classical PCA method by utilizing the generic condition that the 21cm signal covariance matrix is sparse, while the foreground covariance matrix has low ranks. Algorithm \autoref{alg:RPCA_ALM} is very fast, only a relatively small number of iterations is needed to achieve good relative accuracy. For a $256 \times 256$ matrix decomposition used in this simulation, it takes less than a minute on a personal computer to converge to a satisfactory error threshold. For higher pixel and frequency bin numbers, the speed of computation could be further accelerated by noting that instead of doing a full matrix SVD decomposition in each iteration, for calculating the singular value thresholding operator $\mathcal{D}_\tau(X)$ (step 3 in Algorithm \autoref{alg:RPCA_ALM}), only those singular values that are greater than the threshold $\tau$ and the corresponding singular vectors are needed, so a partial SVD suffices \cite{Cai2010b}. Some algorithms and softwares can do this, e.g., PROPACK\footnote{\url{http://soi.stanford.edu/~rmunk/PROPACK/}} and the modified version of LANSVD\footnote{\url{http://svt.stanford.edu/code.html}} which comes with a threshold option to compute only those singular vectors with singular values greater than a given threshold value $\tau > 0$. In practice, artifacts are introduced in the sky maps reconstructed from the observatories during the map-making process, due to imperfections such as incomplete uv-coverage, missing data, particularly bright source, numerical errors. Usually the artifacts are not correlated with the HI 21~cm signal, though in some case may have correlations with the foregrounds, and may be distinct from both the foregrounds and the HI 21~cm signal. After removing some most obvious ones, residue artifacts should be small relative to the diffuse foregrounds and extragalactic point sources, though still larger than that of the HI 21~cm signal. Due to the complex structure and frequency dependence, its covariance matrix will not have a rank as low as that of the foregrounds, nor will it be sparse like that of the HI 21~cm signal. In the presence of artifacts, an extension of the RPCA method presented above is to include an additional term, $$\mat{R} = L + S+ Z,$$ where $Z$ is a dense, small perturbation, which can be solved via the convex optimization problem called Stable Principle Component Pursuit (SPCP) \cite{Zhou2010}: \begin{equation} \label{eq:SPCP} \min_{L,S} \; \norm{L}_{*} + \lambda \norm{S}_{1} \quad \textup{s.t.} \quad \norm{\mat{R} - L - S}_{F} \leq \delta. \end{equation} Efficient algorithms for this problem are available \cite{Aybat2014,Aybat2015}. The GILC method is used to recover the 21~cm signal from the observation data using the 21~cm $\nu - \nu'$ covariance matrix extracted by the RPCA method. In this paper, the method is applied to the sky map as a whole, but in fact the foreground components may vary over different sky areas or different angular scales. Improvement can be made by employing the Generalized Needlet Internal Linear Combination (GNILC) method \cite{2011MNRAS.418..467R,2016MNRAS.456.2749O}, which worked in a needlet frame, the number of principal components of the observed covariance matrix is estimated locally both in space and in angular scale by using a wavelet (needlet) decomposition of the observations. We will explore how this extension could improve the recovery performance of the 21~cm signal in future work. While we demonstrated the use of RPCA and GILC method for HI signal recovery in mid-redshift 21~cm experiment, it could also be applied to other redshift range (e.g. EoR) or even other spectral line (e.g. CO) intensity mapping experiments as well. For example, \cite{2016MNRAS.456.2749O} showed that the GNILC method can be used to recover the 21~cm signal by using a prior of the theoretical HI frequency covariance matrix, here we have shown that actually we could extract a good estimate of the HI 21~cm frequency covariance matrix from the observed data itself by the RPCA method. This could avoid a biased prior, which is even more useful in the EoR 21cm experiment or other spectral line intensity mapping experiment, since in those cases we have less reliable knowledge of the expected signals. \acknowledgments We acknowledges the support of the MoST through grant 2016YFE0100300, NSFC through grant No. 11473044, 1633004, and the CAS Frontier Science Key Project No. QYZDJ-SSW-SLH017.
\section{Introduction} \subsection{$L^\infty$ control} The motivation for this paper is a question, concerning heat diffusion on the Heisenberg group, that is implicitly raised by Kuwada in \cite[Remark 4.4]{Ku}, and that we reproduce at page \pageref{la_question} after Theorem \ref{thm:Li-K}. Before we reach this question let us start with some background and a few definitions. All remaining material will be introduced later in the paper. In the literature, $L^\infty$-Wasserstein control for a diffusion has been used to deduce $L^1$-gradient estimates of its associated semigroup (see for instance \cite{W} and the references therein). Kuwada extends this result to $L^p$-Wasserstein control and $L^q$-gradient estimates for all $p,q\geq 1$ with $\frac {1}{p} + \frac{1}{q}=1$ and, using Kantorovich duality, proves that, conversely, $L^q$-gradient estimates allow one to obtain $L^p$-Wasserstein control for the diffusion. We recall that, on a metric space $(M,d)$, for $p\in (0,\infty]$, the $L^p$-Wasserstein distance between two probability measures $\mu$ and $\nu$ is given by \begin{equation}\label{eq:Wasserstein} \mathcal W_p(\mu,\nu)=\left( \inf_{\pi \in \Pi(\mu,\nu)} \iint d (x,y)^p d\pi(x,y) \right)^{1/p}=\inf_{X\sim \mu,\,Y\sim \nu}\|d_\mathbb H(X,Y)\|_p. \end{equation} Here $\Pi(\mu,\nu)$ is the set of probability measures on $M \times M$ with marginals $\mu$ and $\nu$. For $p=\infty$ the first expression is replaced by the essential supremum of $d$. Note that $ \mathcal W_p$ is a distance only for $p\geq 1$. For $0< p<1$, it is only a quasidistance, in the sense that the triangle inequality only holds up to a multiplicative constant. Using H\"older inequality, it is clear that $\mathcal W_p(\mu, \nu) \leq \mathcal W_q(\mu,\nu)$ if $0<p\leq q$. On the Heisenberg group $\mathbb H$, the following $L^1$-gradient bound was established by H.Q. Li \cite{Li} (see also \cite{BBBC}) generalising \cite{DM} \[ \forall f\in \mathcal{C}_c^{\infty}(\mathbb H_1),\forall t\geq0,\forall a\in \mathbb H, |\nabla_\mathrm h P_t f (a)| \leq C P_t(|\nabla_\mathrm h f|)(a), \] where $C>1$ is constant, $P_t$ denotes the heat semigroup associated to half the sub-Laplacian and $\nabla_\mathrm h$ the horizontal gradient (see Section \ref{sec:H} for the definitions). Consequently, Kuwada's result implies that the heat diffusion of the Heisenberg group possesses a $L^\infty$-Wasserstein control for its diffusion: \begin{theo}[H.Q. Li, Kuwada]\label{thm:Li-K} There exists $C>0$ such that for every $t\geq 0$ and $a,a'\in \mathbb H$ \begin{equation}\label{eq:LiK} \mathcal{W}_\infty(\mu^a_t,\mu^{a'}_t)\leq Cd_\mathbb H(a,a'), \end{equation} where $\mu^a_t=\mathrm{Law}(\mathbf B^a_t)$ and $\mu^{a'}_t=\mathrm{Law}(\mathbf B^{a'}_t)$ and $(\mathbf B_s^a)_{s\geq 0}, (\mathbf B_s^{a'})_{s\geq 0}$ are two Heisenberg Brownian motions, starting respectively in $a,a'$. Moreover, \begin{equation}\label{eq:LiK2} \mathcal{W}_p(\mu^a_t,\mu^{a'}_t)\leq Cd_\mathbb H(a,a') \end{equation} holds for every $p<\infty$. \end{theo} In other words, for each $a,a'\in \mathbb H$ and each $t\geq 0$, there exists a coupling $(\mathbf B_s^a, \mathbf B_s^{a'})_{s\geq 0}$ of the two Heisenberg Brownian motions such that \begin{equation} \label{eq:coupling-t} d_{\mathbb H}(\mathbf B_t^a, \mathbf B_t^{a'}) \leq C d_{\mathbb H} (a,a')\quad\text{almost surely}. \end{equation} Please note: Firstly the time $t\geq 0$ is fixed; secondly $\mathbf B_t^a$ and $\mathbf B_t^{a'}$ are conveniently defined on the same probability space (and the remaining random variables $(\mathbf B^a_s)_{s\neq t}$ and $(\mathbf B^{a'}_s)_{s\neq t}$ of the Heisenberg Brownian motions are defined without paying attention to their correlation). Kuwada's problem is precisely on inverting the quantifiers $\forall$ and $\exists$, namely, he asks whether it is possible to define a coupling of the two Heisenberg Brownian motions $(\mathbf B_t^a)_{t\geq 0}$ and $(\mathbf B_t^{a'})_{t\geq 0}$ such that \eqref{eq:coupling-t} holds for all $t\geq 0$.\label{la_question} In this paper we answer negatively and show that $\eqref{eq:coupling-t}$ can not hold for all $t\geq 0$ for \emph{co-adapted} couplings (see Definition \ref{def:co-adapted}), probably the most usual couplings in the literature for our type of problem, (see, e.g. \cite{BaCK, K,Ke_ecp,K2,Cra91,Re_ejp,KuS,PaPo}). Informally, a coupling of two processes $(\mathbf B_t)$ and $(\mathbf B_t')$ is said co-adapted if the interaction in the coupling only depends on the common past of the process $(\mathbf B_t, \mathbf B'_t)$. See Definition \ref{def:co-adapted} fo the rigorous definition. Our results hold for the Heisenberg groups of higher dimension, as explained in Section \ref{sec:gene}, but we only prove them thoroughly in the first Heisenberg group where all the significative ideas are present and the notation is lighter. \begin{theo} \label{thm:rapport-Winfty} For every $T>0$ and every $C>0$ there exists two points $a,a'\in \mathbb H$ with $a\neq a'$ such that for every co-adapted coupling $(\mathbf B_t^a, \mathbf B_t^{a'})_{0\leq t\leq T}$, there exists $t\leq T$ such that \[ \mathrm{essup}_{(\Omega,\P)} \, d_{\mathbb H}(\mathbf B_t^a, \mathbf B_t^{a'})> Cd_\mathbb H(a,a').\] \end{theo} \begin{remark} \label{rem:rapport-Winfty} Another way to state Theorem \ref{thm:rapport-Winfty} is as follows: Let $T>0$, then \begin{align*} \sup_{a\neq a'\in\mathbb H} \inf_{ \mathcal A_ T ^{(a,a')} } \sup_{0\leq t\leq T} \frac{ \mathrm{essup}_{(\Omega,\P)} d_{\mathbb H}(\mathbf B_t^a, \mathbf B_t^{a'}) }{ d_{\mathbb H} (a,a')}=+\infty \end{align*} where $ \mathcal A_ T ^{(a,a')}$ denotes the set of all co-adapted couplings $(\mathbf B_t^a, \mathbf B_t^{a'})_{0\leq t\leq T}$ of two Heisenberg Brownian motions starting respectively in $a$ and $a'$. \end{remark} The proof will be based on the following result and the use of homogeneous dilations (defined in Section \ref{sec:H}): \begin{theo}\label{thm:Winfty}\label{them:LiKu} Let $(\mathbf B_t)_t$ and $(\mathbf B'_t)_t$ be any two co-adapted Heisenberg Brownian motions starting respectively in $a=(x,y,z)$ and $a'=(x',y',z')$ with $(x'-x)^2 + (y'-y)^2>0$. Then, for every $C>0$, \[ \P\left(\forall t \geq 0,\,d_\mathbb H ( \mathbf B_t,\mathbf B'_t) \leq C\right)\neq1. \] \end{theo} \subsection{Comparison with the Riemannian case} These results show a significative difference with the Riemannian case. Indeed, on a Riemannian manifold $M$, it is well known (see e.g. \cite {W} and \cite{VRS}) that if the Ricci curvature is bounded from below by $k\in\mathbb R$, there exists a Markovian coupling of two Brownian motions such that almost surely \begin{equation} \label{eq:coupling-t-riem} d(\mathbf B_t^a, \mathbf B_t^{a'}) \leq e^{-(k/2)t} d (a,a')\quad \textrm{ for all } t\geq 0,\,a\in M,\,a'\in M. \end{equation} Here we call Brownian motions the diffusion processes starting at $a$ and $a'$ respectively, having generator half the Laplace--Beltrami operator. We make clear that Markovian coupling is a type of co-adapted coupling. Note moreover that the motivation for proving \eqref{eq:coupling-t-riem} is exactly to provide estimates on the heat semi-group (see, e.g. \cite{Cra91,Cra92}), so that the historical $L^p$-Wasserstein controls have been established for co-adaptive processes whereas $L^p$-Wasserstein controls at fixed time may first appear unusual from a stochastic perspective. We note further that \begin{itemize} \item the Heisenberg group can be thought as the first sub-elliptic model space of curvature $0$ (e.g. \cite{Mg}) but, its behaviour with respect to couplings of co-adapted Brownian motions is therefore completely different from the case of Riemannian manifolds with curvature bounded from below by $k=0$. \item the Heisenberg group is also classically presented as the limit space for a sequence of Riemannian metrics on the Lie group, the optimal lower bound on the Ricci curvature of which tends to $-\infty$. On this topic see \cite{Ju_imrn,BG}. This fact is coherent with the interpretation of Theorem \ref{thm:Winfty} as a special case of \eqref{eq:coupling-t-riem} where the best bound for the $L^\infty$ control is $C=e^{-kt}$ with $k=-\infty$: There is no possible control for $t>0$. \end{itemize} \subsection{$L^p$ control for $0<p<\infty$} To go further, given two diffusion processes $(\mathbf B_t)_{t\geq 0}$ and $(\mathbf B'_t)_{t\geq 0}$ on a metric space $(M,d)$, we shall consider the function \[ t\in [0,\infty) \to \mathbb E\left[d(\mathbf B_t, \mathbf B'_t)^p \right]^\frac{1}{p}\in [0,\infty]. \] and try to bound it from above uniformly in time for some well-chosen co-adapted coupling. If we denote by $\mu_t$ and $\nu_t$ the law of the processes $(\mathbf B_t)_{t\geq 0}$ and $(\mathbf B'_t)_{t\geq 0}$, we clearly have for each $t\geq 0$: \[ \mathbb E\left[d(\mathbf B_t, \mathbf B'_t)^p \right]^\frac{1}{p} \geq \mathcal W_p (\mu_t,\nu_t). \] On the Heisenberg group, we will prove the result stronger than Theorem \ref{thm:rapport-Winfty} that any co-adapted coupling $(\mathbf B_t)_t$ and $(\mathbf B'_t)_t$ of Brownian motions do not stay bounded in $L^{2}$: \begin{theo} \label{thm:rapport-W2} Let $p\geq 2$. For every $T>0$ and every $C>0$ there exists two points $a,a'\in \mathbb H$ with $a\neq a'$ such that for every co-adapted coupling $(\mathbf B_t^a, \mathbf B_t^{a'})_{0\leq t\leq T}$, there exists $t\leq T$ such that \[ \mathbb E \left[ d_{\mathbb H}^p(\mathbf B_t^a, \mathbf B_t^{a'})\right]> Cd_\mathbb H(a,a')^p.\] \end{theo} \begin{remark} \label{rem:rapport-W2} Equivalently Theorem \ref{thm:rapport-W2} can be stated as follows: Let $p\geq 2$. Let $T>0$, then \begin{align*} \sup_{a\neq a'\in\mathbb H} \inf_{ \mathcal A_ T ^{(a,a')} } \sup_{0\leq t\leq T} \frac{ \mathbb E[ d_{\mathbb H}^p(\mathbf B_t^a, \mathbf B_t^{a'}) ]^\frac{1}{p} } { d_{\mathbb H} (a,a')}=+\infty \end{align*} where $ \mathcal A_ T ^{(a,a')}$ denotes the set of all co-adapted coupling $(\mathbf B_t^a, \mathbf B_t^{a'})_{0\leq t\leq T}$ of two Heisenberg Brownian motions starting respectively in $a$ and $a'$. \end{remark} As for $p=\infty$, the proof will be based on the following result and the use of dilations. \begin{theo}\label{thm:W2} Let $(\mathbf B_t)_{t\geq 0}$ and $(\mathbf B'_t)_{t\geq 0}$ be any two co-adapted Heisenberg Brownian motion starting respectively in $a=(x,y,z)$ and $a'=(x',y',z')$ such that $(x'-x)^2 + (y'-y)^2>0$. Then, \[ \limsup_{t\to +\infty} \mathbb E\left[d_\mathbb H ( \mathbf B_t,\mathbf B'_t)^2 \right] \to +\infty. \] \end{theo} \subsection{Two positive results} To complete the picture, we provide two positive results. We first show that the coupling by reflection on the Heisenberg group stays bounded in $L^p$ for $0< p <1$. We recall that for $0< p<1$, the quantity $ \mathbb E\left[d^p (\mathbf B_t, \mathbf B'_t) \right]^\frac{1}{p} $ is not a distance, but only a quasidistance, in the sense that the triangle inequality only holds up to a multiplicative constant. \begin{theo}\label{thm:refl} Let $(\mathbf B_t)_{t\geq 0}$ and $(\mathbf B'_t)_{t\geq 0}$ be a coupling by reflection of two Heisenberg Brownian motions starting in $(x,y,z)$ and $(x',y',z')$. Then, for every $p\in (0,1)$, \begin{equation}\label{eq:sup-alpha} \sup_{t\geq 0} \mathbb E\left[d_\mathbb H ( \mathbf B_t,\mathbf B'_t)^p \right] < +\infty. \end{equation} Moreover, for the coupling by reflection, for every $p\in (0,1)$, we also have: \begin{equation}\label{eq:sup-rapport} \sup_{a\neq a'\in\mathbb H} \sup_{t\geq 0} \frac{ \mathbb E[ d_{\mathbb H}(\mathbf B_t^a, \mathbf B_t^{a'})^p ]}{ d_{\mathbb H} (a,a')^p}<+\infty \end{equation} \end{theo} Unfortunately, the above result is false for the reflection coupling for $p\geq 1$ (as a close look at Proposition \ref{pro:assymp} shows). In the general context of co-adapted coupling, we were not able to obtain any results for $p \in [1,2)$: we ignore whether there exist co-adapted couplings satisfying \eqref{eq:sup-alpha} or \eqref{eq:sup-rapport}, or not, for $p\in [1,2)$. One difficulty in this study is to obtain estimates for the expectation of nonnegative (nonconvex) functionals of martingales as typically $x\mapsto |x|^{1/2}$, see Remark \ref{rem:concave}. The next remark recalls the situation of $L^p$-Wasserstein control in the case of Riemannian manifolds. \begin{remark} On a Riemannian manifold $M$, for $p\geq 1$, the $L^p$ version of the $L^\infty$ control \eqref{eq:LiK}, namely \[ \mathcal{W}_p(\mu^a_t,\mu^{a'}_t)\leq e^{-kt/2}d(a,a')\textrm{ for all } t\geq 0,\,a\in M,\,a'\in M; \] is satisfied if and only if the Ricci curvature is bounded from below by $k$ (see \cite{VRS} and \cite[Remark 2.3]{Ku}). Therefore all the above $L^p$-Wasserstein controls, for $p\in [1,\infty]$ are equivalent and only depend on the Ricci curvature lower bound. Moreover in this situation, as said before, one has the existence of some appropriate Markovian coupling such that almost surely: \[ d( B_t^a, B_t^{a'}) \leq e^{-kt/2}d(a,a') \textrm{ for all }t\geq 0,\,a\in M,\,a'\in M. \] \end{remark} We now turn to the second positive result. We propose an explicit coupling of the laws $\mu^a_t=\mathrm{Law}(\mathbf B^a_t)$ and $\mu^{a'}_t=\mathrm{Law}(\mathbf B^{a'}_t)$. This coupling is not at all dynamical and is made at a given fixed time $t$. This coupling has thus no interpretation in terms of co-adapted coupling. It provides a new proof of the case $p=1$ in Theorem \ref{thm:Li-K}. This is the weakest result in the spectrum of $L^p$-Wasserstein controls ; the strongest result is for $p=\infty$. However, we stress that, apparently, our static coupling provides the first direct proof (that is, not obtained by duality) of the case $p=1$. \begin{theo}\label{thm:static} There exists $C>0$ such that for every $t\geq 0$ and $a=(x,y,z), a'=(x',y',z')\in \mathbb H$, there is a random vector $(X,Y,Z,X',Y',Z')$ of marginals $\mu^a_t=\mathrm{Law}(\mathbf B^a_t)=\mathrm{Law}(X,Y,Z)$ and $\mu^{a'}_t=\mathrm{Law}(\mathbf B^{a'}_t)=\mathrm{Law}(X',Y',Z')$ such that \begin{align*} &\mathcal{W}_1(\mu^a_t,\mu^{a'}_t)\leq \mathbb E(d_\mathbb H((X,Y,Z),(X',Y',Z')))\leq Cd_\mathbb H(a,a')\\ \intertext{and} &\left\{ \begin{aligned} X'=X+(x'-x)\quad\text{almost surely,}\\ Y'=Y+(y'-y)\quad\text{almost surely.} \end{aligned} \right. \end{align*} \end{theo} The idea of the coupling is the following. The goal is to construct a random vector $((X,Y,Z);(X',Y',Z'))$ of marginals $\mu^a_t$ and $\mu^{a'}_t$. First we perform a coupling of the horizontal parts $(X,Y)$ and $(X',Y')$ of the two Brownian laws by a simple translation. It appears that the conditional laws of the last coordinates $\mathcal L(Z| (X,Y))$ and $\mathcal L(Z'| (X',Y'))$ differ also only by a translation; but which depends on the value of $(X,Y)$. Eventually, we use a coupling of the last coordinates which is well adapted to optimal transport for the cost $(z,z')\mapsto\sqrt{ |z-z' |}$ on the real line, and is better than the simple translation. Note that our proof requires at the end an analytic estimate on the heat kernel, see \eqref{eq:dzp1}. We mention the interesting recent work by S. Banerjee, M. Gordina and P. Mariano \cite{BGM} where the authors also use non co-adapted couplings to study the decay in total variation for the laws of Heisenberg Brownian motions and obtain gradient estimates for harmonic functions. This work and our work seems to deliver a common message namely that co-adapted couplings are not the unique relevant couplings, what concerns obtaining gradient estimates. \medskip The paper is organised as follows. In Section \ref{sec:H}, we recall the notion of co-adapted coupling and describe quickly the geometry of the Heisenberg group, its associated Brownian motions and their coupling. We also discuss some classical couplings. The proofs of the main theorems on the non-existence of co-adapted Heisenberg Brownian motions which stay at bounded distance are given Section \ref{sec:sec}. The reflection coupling on $\mathbb H$ is studied in Section \ref{sec:refl}. The construction of the static coupling between the Brownian laws is given in Section \ref{sec:bonus}. The results are then generalised to the Heisenberg groups of higher dimension in the final section. \section{ Co-adapted couplings on the Heisenberg group} \subsection{The Heisenberg group}\label{sec:H} The Heisenberg group can be identified with $\mathbb R^3$ equipped with the law: \[ (x,y,z)\cdot(x',y',z')= \left(x+x',y+y', z+z'+\frac{1}{2}(xy'-yx')\right). \] The left invariant vector fields are given by \[ \left\{ \begin{array} {l} X (f) (x,y,z)= \frac{d}{dt} _{|t=0} f( (x,y,z) \cdot (t,0,0 ) ) = \left( \partial_x - \frac{y}{2} \partial z \right) f(x,y,z) \\ Y (f) (x,y,z)= \frac{d}{dt} _{|t=0} f( (x,y,z) \cdot (0,t,0 ) ) = \left( \partial_y + \frac{x}{2} \partial z \right) f(x,y,z)\\ Z (f) (x,y,z)= \frac{d}{dt} _{|t=0} f( (x,y,z) \cdot (0,0,t ) ) = \partial_z f(x,y,z). \end{array} \right. \] Note that $[X,Y]=Z$ and that $Z$ commutes with $X$ and $Y$. We are interested in half the sub-Laplacian $L= \frac{1}{2} (X^2+Y^2)$. This is a diffusion operator that satisfies the H\"ormander bracket condition and thus the associated heat semigroup $P_t=e^{tL}$ admits a $\mathcal C^\infty$ positive kernel $p_t$. From a probabilistic point of view, $L$ is the generator of the following stochastic process starting in $(x,y,z)$: \[ \mathbf B^{(x,y,z)}_t:= (x,y,z) \cdot \left( B^1_t,B^2_t, \frac{1}{2}\left( \int_0^t B^1_s dB^2_s - \int_0^t B^2_s dB^1_s\right) \right) \] where $(B^1_t)_{t\geq 0}$ and $(B^2_t)_{t\geq 0}$ are two standard independent 1-dimensional Brownian motions. The quantity $ \int_0^t B^1_s dB^2_s - \int_0^t B^2_s dB^1_s$ that we denote by $A_t$ is one of the first stochastic integrals ever considered. It is the L\'evy area of the 2-dimensional Brownian motion $(B_t)_{t\geq 0} :=(B^1_t, B^2_t)_{t\geq 0}$. It is easily seen that $(\mathbf B_t)_{t\geq 0} $ is a continuous process with independent and stationary increments. We simply call it the Heisenberg Brownian motion. The sub-Laplacian $L$ is strongly related to the following subRiemmanian distance (also called Carnot-Carath\'eodory) on $\mathbb H$: \[ d_{\mathbb H} (a,a')= \inf_{\gamma} \int_0 ^1 | \dot \gamma(t) |_\mathrm h dt \] where $\gamma$ ranges over the horizontal curves connecting $\gamma(0)=a$ and $\gamma(1)=a'$. We remind the reader of the fact that a curve is said horizontal if it is absolutely continuous and $\dot \gamma (t) \in \textrm{Vect} ( X(\gamma(t)), Y(\gamma(t)))$ almost surely holds. The horizontal norm $|\cdot |_\mathrm h$ is a Euclidean norm on $\textrm{Vect} (X,Y)$ obtained by asserting that $(X,Y)$ is an orthonormal basis of $\textrm{Vect} (X(a),Y(a))$ at each point $a\in \mathbb H$. Finally the horizontal gradient $\nabla_\mathrm h f$ is $(Xf) X+(Yf)Y$. The Heisenberg group admits homogeneous dilations adapted both to the distance and the group structure. They are given by \[ \mathrm{dil}_\lambda (x,y,z)= (\lambda x, \lambda y, \lambda^2 z) \] for $\lambda>0$. They satisfy $d_\mathbb H(\mathrm{dil}_\lambda(a),\mathrm{dil}_\lambda(a'))=\lambda d_\mathbb H(a,a')$ and, in law: \[ \mathrm{dil} _{\frac{1}{\sqrt t}} \left( B^1_t,B^2_t, \frac{1}{2}\left( \int_0^t B^1_s dB^2_s - \int_0^t B^2_s dB^1_s\right) \right) \overset{\mathrm{Law}}{=} \left( B^1_1,B^2_1, \frac{1}{2}\left( \int_0^1 B^1_s dB^2_s - \int_0^1 B^2_s dB^1_s\right) \right). \] The distance is clearly left-invariant so that $\mathrm{trans}_p:q\in \mathbb H\mapsto p.q$ is an isometry for every $p\in \mathbb H$. In particular \[ d_{\mathbb H}(a,a)= d_{\mathbb H} (e, a^{-1} a') \] with $e=(0,0,0)$. Another isometry is the rotation $\mathrm{rot}_\theta:(x+iy,z)\in \mathbb{C}\times \mathbb R\equiv \mathbb H \mapsto (\mathrm{e}^{i\theta}(x+iy),z)$, for every $\theta\in \mathbb R$. Since the explicit expression of $d_\mathbb H$ is not so easy, it is often simpler to work with a homogenous quasinorm (still in the sense that the triangle inequality only holds up to a multiplicative constant). We will use \[ H: a=(x,y,z)\in \mathbb H\mapsto\sqrt {x^2+y^2 + |z |}\in \mathbb R , \] and the attached homogeneous quasidistance $d_H(a,a')=H(a^{-1}a')$. It satisfies \begin{equation}\label{eq:dist-eq} c^{-1} d_H(a,a') \leq d_{\mathbb H}(a,a') \leq c d_H(a,a') \end{equation} for some constant $c>1$. We finally mention $d_\mathbb H((0,0,0),(x,y,0))=\sqrt{x^2+y^2}$ and $d_\mathbb H((x,y,z),(x,y,z+h))=2\sqrt{\pi |h|}$. \subsection{Co-adapted couplings}\label{sec:co-ad} We first recall the notion of \emph{co-adapted} coupling of two processes. Indeed, in this study, we only want to consider couplings built solely knowing the past of the two processes. The definition below is taken from \cite[Definition 1.1.]{K2}. \begin{defi}\label{def:co-adapted} Given two continuous-time Markov processes $(X^{(1)}_t)_{t\geq0}$ , $(X^{(2)}_t)_{t \geq 0}$, we say that $(\tilde X^{(1)}_t, \tilde X^{(2)}_t)_{t \geq 0}$ is a \emph{co-adapted coupling} of $(X^{(1)}_t)_{t\geq0}$ and $(X^{(2)}_t)_{t \geq 0}$ if $\tilde X^{(1)}$ and $ \tilde X^{(2)}$ are defined on the same filtered probability space $(\Omega, (\mathcal F_t)_{t\geq 0}, \mathbb P)$, satisfy $\mathrm{Law}(X^{(i)}_t)_{t\geq 0}=\mathrm{Law}(\tilde X^{(i)}_t)_{t\geq 0}$ for $i=1,2$, and \[ \tilde P_t^{(i)}f:z\mapsto\mathbb E\left[ f(\tilde X^{(i)}_{t+s}) |\, \mathcal F_s , \tilde X^{(i)}_s=z \right] \] equals \[ P_t^{(i)}f:z\mapsto\mathbb E\left[ f(X^{(i)}_{t+s})|\,X^{(i)}_s=z \right],\quad\mathrm{Law}(X^{(i)}_s)\text{-almost surely} \] for $i=1,2$, for each bounded measurable function $f$, each $z$, each $s,t\geq 0$. \end{defi} If we moreover assume that the full process $(\tilde X^{(1)}_t, \tilde X^{(2)}_t)_{t \geq 0}$ is Markovian, we say that the co-adapted coupling is Markovian. The next lemma describes more explicitly co-adapted couplings in the case of Brownian motion in $\mathbb R^2$ (see \cite[Lemma 6]{Ke_ecp}). \begin{lemme}\label{lem:gen-coupling} Let $(B_t)_t$ and $(B'_t)_t$ be two co-adapted Brownian motions on $\mathbb R^2\times \mathbb R^2$ defined on some filtered probability space $(\Omega, (\mathcal F_t)_{t\geq 0}, \P )$. Then, enriching the filtration if necessary, there exists a Brownian motion $(\hat B_t)_{t\geq 0}$ defined on the same filtration $(\mathcal F_t)_{t\geq 0}$ and independent of $(B_t)_{t\geq 0} $ such that \begin{equation}\label{eq:co-adapted} d B'(t)= J(t) d B_t + \hat J(t) d \hat B_t \end{equation} where $(J_t)_{t\geq0}=((J_t^{i,j})_{1\leq i,j\leq 2})_{t\geq 0}$ and $\hat J$ are matrices satisfying \begin{equation}\label{eq:co-BM} J J^T + \hat J \hat J^T= I_2 \end{equation} and $J(t), \hat J (t) \in \mathcal F_t$. \end{lemme} In the following $\|\cdot\|$ may denote the operator norm of a matrix attached to the Euclidean norm, or the Euclidean norm of a vector. \begin{lemme}\label{lem:deuxdeux} Let $J$ be a $2\times2$ real matrix $J=\left(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\right)$. Then $$0\leq J^TJ\leq I_2 \Longleftrightarrow \|J\|\leq 1 \Longleftrightarrow 0\leq JJ^T\leq I_2,$$ where $\leq$ is the ordering of symmetric matrices. In particular \begin{itemize} \item $a^2+b^2$, $a^2+c^2$, $c^2+d^2$ and $b^2+d^2$ are smaller or equal to $1$, \item all the four entries of $J$ are in $[-1,1]$. \end{itemize} \end{lemme} \begin{proof} Let $\mathbb{S}^1=\{(\cos(\theta),\sin(\theta))\in \mathbb R^2:\,\theta\in \mathbb R\}$ be the Euclidean sphere of $\mathbb R^2$ and $Q:x\in \mathbb{S}^1\mapsto (x,J^T J x)=\|Jx\|^2$. Therefore, $Q$ is bounded by $1$ if and only if $\|J x\|\leq1$, for all $x\in \mathbb{S}^1$. The bound $0\leq J^T J$ is trivially satisfied. The proof is completed by $\|J\|=\sup_{x,y\in \mathbb{S}^1}(Jx,y)=\|J^T\|$. \end{proof} \begin{remark} A necessary and sufficient condition can be found considering $\lambda$, the greatest eigenvalue of $J^TJ$. It writes $$2\lambda=(a^2+b^2+c^2+d^2)+\sqrt{(a^2+b^2+c^2+d^2)^2-4(bc-ad)^2}\leq2\times1.$$ Paradoxically, it not easy to deduce $|a|,|b|,|c|,|d|\leq 1$ from this condition. \end{remark} \subsection{Co-adapted couplings on $\mathbb H$} We now describe co-adapted Heisenberg Brownian motions. As seen before, a Brownian motion $\mathbf B$ is entirely determined by its two first coordinates $(B_t)_t=(B_t^1,B^2_t)_t$; the third one being $(A_t)_t$ the L\'evy area swept by this 2-dimensional process $(B_t)_t$. Thus two Heisenberg Brownian motions $(\mathbf B_t)_t=(B_t^1, B_t^2, A_t)_t$ and $(\mathbf B'_t)_t=(B'^1_t, B'^2_t, A'_t)_t$ on $\mathbb H$ are co-adapted if and only if $B =(B_t^1,B_t^2)_t$ and $B' =(B'^1_t,B'^2_t)_t$ are two co-adapted Brownian motions on $\mathbb R^2$ and if moreover their third coordinates satisfy \[ dA_t=\frac{1}{2} \left( B^1_t dB^2_t - B^2_t dB^1_t\right) \] and \[ dA'_t=\frac{1}{2} \left( B'^1_t dB'^2_t - B'^2_t dB'^1_t\right.). \] For the following, we denote by $J$ and $\hat J$ the matrices appearing in Lemma \ref{lem:gen-coupling}. A computation gives: \[ \mathbf B'^{-1}_t \mathbf B_t=\left( B_t^1-B'^1_t, B_t^2-B'^2_t, B_t^3-B'^3_t - \frac{1}{2} \left( B^1_t B'^2_t - B^2_t B'^1_t \right) \right) \] and thus: \[ d(\mathbf B'^{-1}_t \mathbf B_t)= \left(\begin{array}{c} dB_t^1-d B'^1_t\\ dB_t^2-d B'^2_t\\ ( B_t^1-B'^1_t) \left(\frac{dB'^2_t+ dB_t^2} {2} \right) - (B_t^2-B'^2_t)\left(\frac{dB'^1_t+ dB_t^1} {2}\right) - \frac{1}{2}(d\langle B^1_t, B'^2_t \rangle - d\langle B^2_t , B'^1_t\rangle ) \end{array}\right), \] where we used: \[ d(X_t Y_t)=X_t dY_t + Y_t dX_t+ d\langle X_t,Y_t\rangle. \] We denote by $R_t$ the horizontal distance between the two Brownian motions $B_t$ and $B'_t$ in $\mathbb R^2$, that is $R_t^2=(B^1_t-B'^1_t)^2 + (B^2_t-B'^2_t)^2$ and by $Z_t$ the third coordinate, the relative L\'evy area. Hence $Z_t= (\mathbf B'^{-1}_t \mathbf B_t)_3$. The homogeneous distance $d_H(\mathbf B_t,\mathbf B'_t)$ is thus given by \[ \sqrt{R_t^2 + |Z_t|.} \] In the following, when $R_t>0$, we choose to work in the direct orthonormal (random moving) frame $(v_1,v_2)$ defined by taking $v_1(t)$ the normalised vector of $\mathbb R^2$ directed by $B_t-B'_t$. Let $ Q_t$ be the matrix whose columns are respectively $v_1(t)$ and $v_2(t)$. In this new basis, for $(\alpha,\beta)\in \mathbb R^2$ and $( \cdot \mid \cdot )$ the usual scalar product on $\mathbb R^2$, we have: \begin{align*}\label{eq:co-adapted-K} (\alpha v_1 + \beta v_2 \mid dB'_t ) &= \left( Q_t \begin{pmatrix} \alpha \\ \beta \end{pmatrix} \mid J_t d B_t + \hat J_t d \hat B_t\right)\\ &= \left( \begin{pmatrix} \alpha \\ \beta \end{pmatrix} \mid (Q_t^TJ_tQ_t) Q_t^T d B_t + (Q_t^T\hat J_tQ_t) Q_t^T d \hat B_t\right)\\ &= \left( \begin{pmatrix} \alpha \\ \beta \end{pmatrix} \mid K_t d W_t + \hat K_t d \hat W_t \right) \end{align*} for $K_t= Q_t^T J_t Q_t$ and $\hat K_t= Q_t^T \hat J_t Q_t$, and where $W$ and $\hat W$ are the two standard independent 2-dimensional Brownian motions defined by \[ dW_t = Q_t^T dB_t , \; d\hat W_t = Q_t^T d\hat B_t. \] This can be summed up as follows: \[ Q_t^T dB'_t=\underbrace{(Q_t^TJ_tQ_t)}_{K_t} Q_t^TdB_t + \underbrace{(Q_t^T\hat J_tQ_t)}_{\hat K_t} Q_t^Td\hat B_t. \] The next easy lemma describes the relation between the matrices $J$ and $K$. \begin{lemme}\label{lem:JK} With the above notation, when $R_t>0$, \begin{itemize} \item Equation \eqref{eq:co-BM} is satisfied for $(K,\hat K)$ if and only if it is satisfied for $(J,\hat J)$. \item $\mathrm{tr}\, K= \mathrm{tr} \, J$. \item $ K^{1,2}-K^{2,1}=J^{1,2}-J^{2,1}$. \end{itemize} \end{lemme} \begin{proof} The first two relations follow from the fact that $Q$ is an orthogonal matrix. For the last relation, one can note that $J^{1,2}-J^{2,1}= \mathrm{tr} ( J M )=\mathrm{tr} (K Q^TM Q)$ with $M$ the matrix $(\begin{smallmatrix}0&-1\\1&0\end{smallmatrix})$. Now a computation gives $Q^TM Q= (\det Q) M$ and the last relation follows from the fact $Q$ is actually a rotation matrix. \end{proof} \ The stochastic processes $R_t^2$ and $Z_t$ are semimartingales defined for all time $t\geq 0$. In the next statement, we provide stochastic differential equations for their evolution. \begin{lemme}\label{lem:SDE} With the above notation, when $R_t\neq 0$, the processes $R_t^2$ and $Z_t$ solve the stochastic differential equation: \begin{align*} \left\{ \begin{aligned} d(R^2_{t})&= 2R_t \sqrt{2(1-K^{1,1})}\, dC_t + \left( 2(1-K^{1,1}) + 2(1-K^{2,2}) \right)dt\\ dZ_{t} &=\frac{R_t}{2} \, \sqrt{2(1 + K^{2,2})} \, d\tilde C_t + \frac{1}{2}( K^{1,2} - K^{2,1} )dt\\ \end{aligned} \right. \end{align*} where $(C_t)_{t\geq 0}$ and $(\tilde C_t)_{t\geq 0}$ are some 1-dimensional Brownian motions whose co-variation satisfies: \begin{equation}\label{SDE:C-C} \langle\sqrt{2(1-K^{1,1})}dC_t,\sqrt{2(1+K^{2,2})}d\tilde{C}_t\rangle=(K^{1,2}-K^{2,1})dt . \end{equation} \end{lemme} \begin{remark}\label{rem:vraicoord} Actually the stochastic process $(R_t^2,Z_t)_{t\geq 0}$ is perfectly defined for all $t\geq 0$ (even when $R_t=0$). The technical problem in Lemma \ref{lem:SDE} is that the matrix $Q_t$ and thus the matrix $K_t$ are only defined for $R_t\neq 0$. However, the matrix $J_t$ is defined for every value of $R_t$ and we have: \begin{align*} \left\{ \begin{aligned} d(R^2_{t})&= \sigma_R( B_t, B'_t, J_t) \, d C_t + \left( 2(1-J^{1,1}) + 2(1-J^{2,2}) \right) dt\\ dZ_{t} &= \sigma_Z( B_t, B'_t, J_t) \, d \tilde C_t + \frac{1}{2}( J^{1,2} - J^{2,1} )dt \end{aligned} \right. \end{align*} where $\sigma_R$ and $\sigma_Z$ are defined by: \[ \sigma_R( B_t, B'_t, J_t)= \left\{ \begin{array} {lcc} 0 & \textrm{ if } & B_t= B'_t\\ 2 R_t \sqrt{2( 1- (Q_t^T J_t Q_t)^{1,1})} & \textrm{ if } & B_t \neq B'_t\\ \end{array}\right. \] and \[ \sigma_Z( B_t, B'_t, J_t)= \left\{ \begin{array} {lcc} 0 & \textrm{ if } & B_t= B'_t\\ \frac{R_t}{2} \sqrt{2( 1+(Q_t^T J_t Q_t)^{2,2})} & \textrm{ if } & B_t \neq B'_t.\\ \end{array}\right. \] Note finally that the fact that $\sigma_R$ and $\sigma_Z$ vanish for $R_t=0$ is rather clear from their expressions in Lemma \ref{lem:SDE}. \end{remark} \begin{proof}[Proof of Lemma \ref{lem:SDE}] The computations are done in \cite{K} but we repeat them for the sake of completeness. First by It\^o formula and with the previous notation: \begin{align*} dR^2_t&=d\left( (B^1_t -B'^1_t )^2 + (B^2_t -B'^2_t )^2 \right)\\ &= 2 R_t \left(v_1 \mid (dB_t-dB'_t) \right) + d\langle (B^1_t -B'^1_t ) , (B^1_t -B'^1_t ) \rangle + d\langle (B^2_t -B'^2_t ) , (B^2_t -B'^2_t ) \rangle . \end{align*} We turn to the martingale part and write \begin{align*} \left(v_1 \mid (dB_t-dB'_t) \right)&= \left( (K^{1,1}-1) dW_t^{1}+ K^{1,2} dW_t^{2} + \hat K^{1,1} d \hat W_t^{1}+ \hat K^{1,2} d \hat W_t^{2} \right)\\ & = \sqrt{2(1-K^{1,1})} dC_t \end{align*} for some 1-dimensional Brownian motion $(C_t)_t$ where we used Lemma \ref{lem:JK} for \[ (K^{1,1})^2 + (K^{1,2})^2+ ( \hat K^{1,1})^2+ ( \hat K^{1,2})^2=1. \] The quadratic variation writes \begin{align*} d\langle (B^1_t -B'^1_t ) , (B^1_t -B'^1_t ) \rangle \rangle &= (J^{1,1}-1)^2+ (J^{1,2})^2 + ( \hat J^{1,1})^2+ ( \hat J^{1,2})^2= 2- 2 J^{1,1} \end{align*} and similarly \begin{align*} d\langle (B^2_t -B'^2_t ) , (B^2_t -B'^2_t ) \rangle \rangle &= (J^{2,1})^2+ (J^{2,2}-1)^2 + ( \hat J^{2,1})^2+ ( \hat J^{2,2})^2= 2- 2 J^{2,2}, \end{align*} thus \begin{align*} d\langle (B^1_t -B'^1_t ) , (B^1_t -B'^1_t ) \rangle + d\langle (B^2_t -B'^2_t ) , (B^2_t -B'^2_t ) \rangle &= 2 \mathrm{tr}(I-J) = 2\mathrm{tr}(I-K). \end{align*} We turn now to $Z_t$. Using the basis $(v_1,v_2)$, we can rewrite \begin{align*} dZ_t =\frac{R_t}{2} \left(v_2 \mid (dB'_t+ dB_t) \right) - \frac{1}{2}(d\langle B^1_t, B'^2_t \rangle - d \langle B^2_t , B'^1_t\rangle ). \end{align*} As before, we get: \begin{align*} \left(v_2 \mid (dB'_t+ dB_t) \right) & = K^{2,1} dW^{1}_t+(K^{2,2}+1) dW^{2}_t + \hat K^{2,1} d\hat W^{1}_t+ \hat{K}^{2,2} d\hat W^{2}_t\\ & = \sqrt{2(1+K^{2,2})} d\tilde C_t \end{align*} for some 1-dimensional Brownian motion $(\tilde C_t)_t$. Moreover: \[ d\langle B^1_t, B'^2_t \rangle - d\langle B^2_t , B'^1_t\rangle = (J^{2,1} -J^{1,2} )dt = (K^{2,1} -K^{1,2} )dt . \] The equation on the covariation \eqref{SDE:C-C} follows since by \eqref{eq:co-BM} and Lemma \ref{lem:JK}, \[ K^{1,1} K^{2,1}+ K^{1,2} K^{2,2} + \hat K^{1,1} \hat K^{2,1}+ \hat K^{1,2} \hat K^{2,2}=0. \] \end{proof} \begin{remark}\label{rem:autreseq} Since we will use them in the following we also write stochastic differential equations satisfied by $R_t$, $R_t^4$ and $Z_t^2$, obtained for $R_t\neq 0$ using It\^o's formula in Lemma \ref{lem:SDE}: \begin{align*} \left\{ \begin{aligned} dR_{t}&=\sqrt{2(1-K^{1,1})} \, dC_t +\frac{1-K^{2,2}}{R_t} dt,\\ d R_t^4&=4R_t^3 \sqrt{2(1-K^{1,1})}\, dC_t + (4 R_t^2 (1-K^{2,2}))dt + 12 R_t^2 (1-K^{1,1}) dt,\\ d(Z_t^2)&= Z_t R_t \sqrt{2(1 + K^{2,2})}\, d\tilde C_t + \left( Z_t( K^{1,2} - K^{2,1} ) + \frac{R_t^2}{2} (1+ K^{2,2}) \right) dt. \end{aligned} \right. \end{align*} As in Remark \ref{rem:vraicoord}, an expression for $dZ^2_t$ is possible in the canonical basis with the matrix $J$ in place of $K$. According to Lemma \ref{lem:JK}, $K^{1,2}-K^{2,1}$ is replaced by $J^{1,2}-J^{2,1}$ and the factor $R_t$ make the undefined terms vanish when $R_t=0$. The same holds for the semimartingale $(R^4_t)_{t\geq 0}$. On the contrary $R_t$ is not a semimartingale, but only locally when $R_t>0$. \end{remark} \subsection{Description of some couplings} In this section, we describe some interesting couplings. \subsubsection{The synchronous coupling ($K^{1,1}=1$, $K^{2,2}=1$, $K^{1,2}=K^{2,1}=0$.)}\label{sub:synchro} The coupling is called synchronous because the planar trajectories $(B_t)_{t\geq 0}$ and $(B'_t)_{t\geq 0}$ are parallel. Here $R_t \equiv R_0 $ and $Z_t=Z_0+ W_{R_0 t}$ with $W$ a Brownian motion. \subsubsection{The reflection coupling ($K^{1,1}=-1$ $K^{2,2}=1$, $K^{1,2}=K^{2,1}=0$.)}\label{reflec} For the reflection coupling the planar trajectories of $(B_t)_{t\geq 0}$ and $(B'_t)_{t\geq 0}$ evolve symmetrically with respect to the bisector of line segment $[B_0,B'_0]$. We stop the coupling when $R_t$ hits $0$ and continue synchronously with $J^{1,1}=J^{2,2}=1$. Denote by $\tau$ this hitting time. One thus has \[ R_t=R_0 + 2C_{t\wedge \tau} \textrm{ and } Z_t= Z_0+ \int_0^{t\wedge \tau} (R_0 + 2C_{s\wedge\tau} )d \tilde C_s \] where $(C_s)_s$ and $(\tilde C_s)_s$ are two independent Brownian motions (starting in 0) and with $\tau= \inf\{ s\geq 0, 2C_s=-R_0\}$. This coupling is studied in Section 4. On Euclidean and Riemannian manifolds, the efficiency of reflection coupling has been studied in \cite{HS13,Ku07}. \subsubsection{Kendall's coupling: ($K^{1,1}= \pm 1$, $K^{1,2}=K^{2,1}=0$ and $K^{2,2}=1$).} In \cite{K}, Kendall describes a coupling which alternates between synchronous coupling and reflection coupling. In order to avoid the use of local times the strategy of Kendall is defined with hysteresis. The regime swaps when the process $(R_t,|Z_t|)$ hits a certain parabola $\{8Z_t^2= \kappa^2 R_t^4\}$ or $\{8Z_t^2=(\kappa-\varepsilon)^2 R_t^4\}$ (see \cite[Theorem 4]{K}), depending for the synchronous or the reflection coupling. Thus the process is not Markovian, but it is co-adapted. The author proves that this coupling is successful: this means $T:=\inf\{ s\geq 0, \mathbf B_s=\mathbf B'_s\}$ is almost surely finite, or, equivalently, the process $(R_t, Z_t)$ hits almost surely $(0,0)$ in finite time. \subsubsection{The perverse coupling: $K^{1,1}=1$, $K^{2,2}=-1$, $K^{1,2}=K^{2,1}=0$.} We assume $R_0>0$. It satisfies, \[ dR(t)=\frac{2}{R_t} dt \textrm{ and } dZ_t=0. \] Thus the distance $R_t$ and $Z_t$ are deterministic and given by: \[ R_t =\sqrt {R_0^2 + 4t} \textrm{ and } Z_t=Z_0. \] The name perverse coupling is given by Kendall in \cite{Ke_ecp} as a generic name for a repulsive coupling. Here, the planar components of $(\mathbf B_t)_t$ and $(\mathbf B'_t)_t$ are coupled in a perverse way. This particular method to produce a perverse coupling appears in \cite[Section 5]{PaPo} in a Riemannian setting. \section{Non-existence of co-adapted Heisenberg Brownian motions at bounded distance.}\label{sec:sec} We now turn to the proofs of Theorems \ref{thm:Winfty} and \ref{thm:W2}. \subsection{Proof of Theorem \ref{thm:Winfty}} Theorem \ref{thm:Winfty} is clearly a corollary of Theorem \ref{thm:W2} but we can prove it more easily and it already shows a clear difference with the Riemannian case. Hence, we first present a proof of this result. \begin{proof}[Proof of Theorem \ref{thm:Winfty}.] Assume that $(\mathbf B_t)_t$ and $(\mathbf B'_t)_t$ are two co-adapted Heisenberg Brownian motions starting in $a=(x,y,z)$ and $a'=(x',y',z')$ with $R_0=\sqrt{(x'-x)^2+(y'-y)^2}>0$. Striving for a contradiction we suppose that $t\mapsto d_\mathbb H(\mathbf B_t,\mathbf B'_t)$ is almost surely and uniformly bounded. More precisely for some $C>0$ we assume $|R_t|+|Z_t|^{1/2}\leq C$ for every $t\geq 0$. Using Lemmas \ref{lem:JK} and \ref{lem:SDE} (or simply Remark \ref{rem:vraicoord}), we have \begin{align*} \mathbb E[R_t ^2] = R_0^2 +\mathbb E\left[ 2\int_0^T (1-J^{1,1}(s)) + (1-J^{2,2}(s)) ds \right] \end{align*} and $R_t\leq C$ gives $\mathbb E[R_t ^2]\leq C^2$ and \begin{align}\label{eq:Efini0} \mathbb E\left[ 2\int_0^{t} (1-J^{1,1}(s)) + (1-J^{2,2}(s)) ds \right]\leq C^2. \end{align} Recall from Lemma \ref{lem:JK} that $K^{1,1}+K^{2,2}=J^{1,1}+J^{2,2}$ and from Lemma \ref{lem:deuxdeux} that the matrix entries are $\geq -1$. Therefore \begin{align}\label{eq:Efini1} \max_{i\in\{1,2\}}\mathbb E\left[ \int_0^{t} \left((1-K^{i,i}(s))\right) \mathbf 1_{ \{R_s>0\} } ds \right]\leq C^2/2 \end{align} and $R_t\leq C$, again, gives \begin{equation}\label{eq:Efini2} \mathbb E\left[ \int_0^{t} (1-K^{2,2}(s)) \frac{R_s^2}{2} ds \right]\leq C^4/4. \end{equation} Until now we have used $\mathbb E(R_t^2)\leq C^2$ and $R_t\leq C$. We turn to exploit $\mathbb E(Z_t^2)\leq C^4$. Lemma \ref{lem:JK} and Remark \ref{rem:autreseq} give \begin{align}\label{eq:Z2} \mathbb E[Z_t ^2] = Z_0^2 +\mathbb E\left[ 2\int_0^t Z_s( J^{1,2}(s) - J^{2,1}(s) ) ds + \int_0^t \frac{R_s^2}{2} (1+ K^{2,2}(s)) ds \right] \end{align} Adding \eqref{eq:Efini2} and \eqref{eq:Z2}, and using $\mathbb E(Z_t^2)\leq C^4$, we obtain \begin{equation}\label{eq:Efini3} \mathbb E\left[ 2\int_0^{t} Z_t( J^{1,2}(s) - J^{2,1}(s) ) ds + \int_0^{t}R_s^2 ds \right] \leq (1+1/4)C^4. \end{equation} Next, we aim to compare $\mathbb E\left[ 2\int_0^{t} Z_s( J^{1,2}(s) - J^{2,1}(s) ) ds\right]$ with $\mathbb E\left[\int_0^{t}R_s^2 ds \right]$ that both appear in \eqref{eq:Efini3}. On the one hand, since $Z_t$ stays bounded $\mathbb E[Z_t^2]$ is also bounded. Hence by Cauchy-Schwarz inequality (for the product measure on $\Omega\times [0,t]$): \begin{align} \label{un} \notag \left| \mathbb E\left[ \int_0^{t} Z_s( J^{1,2}(s) - J^{2,1}(s) )ds \right] \right| &\leq \left(\ \int_0^{t} \mathbb E [Z_t^2] ds\right)^{1/2} \left(\int_0^{t} \mathbb E (J^{1,2}- J^{2,1})^2ds\right)^{1/2}\\ \notag &\leq \left(\ \int_0^{t} \mathbb E [Z_t^2] ds\right)^{1/2} \left(2\int_0^{t} \mathbb E ((J^{1,2})^2+ (J^{2,1})^2)ds\right)^{1/2}\\ \notag &\leq \sqrt{C^4 t} \left(2\int_0^{t} \mathbb E (J^{1,2})^2 + \mathbb E (J^{2,1})^2ds\right)^{1/2}\\ &\leq \sqrt{C^4 t}\cdot\sqrt{2C^2}=C^3\sqrt{2t}. \end{align} The last estimate follows from Lemma \ref{lem:deuxdeux} (the rows and columns of $J$ have $L^2$-norm smaller than $1$), $1-J_{i,i}^2\leq (1-J_{i,i})(1+J_{i,i})$ and \eqref{eq:Efini0}: \begin{align*} \int_0^{t} \mathbb E (J^{1,2})^2+\mathbb E (J^{2,1})^2 ds &\leq \int_0^{t} \mathbb E [(1- (J^{1,1})^2)+(1- (J^{2,2})^2)] ds\\ &\leq \int_0^{t} 2\mathbb E [(1-J^{1,1})+(1-J^{2,2})] ds \leq C^2. \end{align*} On the other hand, since $(R_t^2)_{t\geq 0}$ is a submartingale, $\mathbb E[R_s^2] \geq R_0^2$ and \begin{align} \label{deux} \int_0^{t}\mathbb E[R_s^2]ds \geq R_0^2 t. \end{align} Since $R_0>0$, \eqref{un} and \eqref{deux} provide a contradiction in \eqref{eq:Efini3} as $t$ goes to infinity. \end{proof} \begin{remark}\label{rem:W4} The proof of Theorem \ref{thm:Winfty} can be improved to show that any co-adapted Heisenberg Brownian motions can not stay bounded in $L^{4}$. In this proof, the only place where we fully use the fact that $R_t$ is uniformly bounded almost surely is \eqref{eq:Efini2}. At the other places we merely need that $\mathbb E[R_t^2]$ and $\mathbb E[Z_t^2]$ are bounded. But $\mathbb E[R_t^4]\leq C^4$ for every $t\geq 0$ is a sufficient assumption for \eqref{eq:Efini2} and, hence, for the proof. Indeed, by Lemma \ref{rem:autreseq} one has \[ \mathbb E[R_t^4] = R_0^4 + \mathbb E\left[ \int_0^t 12 R_s^2(1-K^{1,1}(s)) + 4 R_s^2 (1-K^{2,2}(s)) ds \right]. \] This quantity is uniformly bounded by $C^4$ for every $t\geq 0$ so that \eqref{eq:Efini2} holds. (the bound in \eqref{eq:Efini2} can even be divided by two: $C^4/8$ in place of $C^4/4$). \end{remark} \subsection{Proof of Theorem \ref{thm:W2}} To go beyond Theorem \ref{thm:Winfty}, we conduct a precise study of the expected total variation (or length in $L^1$) of the martingale part and of the drift part of $(Z_t)_{t\geq 0}$, the relative L\'evy area. As before, the proof will be by contradiction. The principle is the following. We derive an upper bound for the drift part of $Z_t$ similar to \eqref{un} from the proof of Theorem \ref{thm:Winfty}; and using Lemma \ref{lem:MG} below, we provide a lower bound for the martingale part of $Z_t$. \begin{lemme}\label{lem:MG} Let $(N_t)_{t\geq 0}$ be a continuous martingale with $N_0=0$ and $p$ be in $]0,1[$. Then there exists $a_p>0$ such that for every positive real numbers $\beta$ and $h$, the estimate \[ \P\left(\langle N \rangle_h \geq \beta \right) \geq p \] implies \[ \mathbb E[|N_h|] \geq a_p \sqrt {\beta}. \] \end{lemme} The proof of Lemma \ref{lem:MG} is postponed at the end of the section. \begin{proof}[Proof of Theorem \ref{thm:W2}.] Let $C$ be $\sup_{t\geq 0}\sqrt{\max(\mathbb E(R_t^2),\mathbb E(|Z_t|))}$ and as before, assume $C<+\infty$ by contradiction. First recall \begin{align* \mathbb E\left(R^2_t\right) = R_0^2 +\mathbb E\left(\int_0^{t}2[(1-J^{1,1})+(1-J^{2,2})]ds\right)\geq 0, \end{align*} which gives \begin{align}\label{J11} \mathbb E\left(\int_0^{+\infty}[(1-J^{1,1})+(1-J^{2,2})]ds\right) \leq \frac{C^2}{2} <+\infty. \end{align} Let $T:=\inf\{t\geq 0, R_t=\frac{R_0}{2}\}$ be the hitting time of $\frac{R_0}{2}$. We show that we can assume $\P(T=+\infty)>0$. Suppose for the rest of this paragraph $\P(T<+\infty)=1$ and let $S$ the finite random variable defined by \[S=\int_0^T 2(1-K^{1,1})ds.\] Because of the non-negative drift in the stochastic differential equation of $R_{t}$, using the Dambins-Dubins-Schwarz theorem (see e.g. \cite{MR1725357}), the random variable $S$ is greater in stochastic order than the hitting time of $\frac{R_0}{2}$ for a Brownian motion starting in $R_0$. This hitting time is almost surely finite but nonintegrable. Thus $\mathbb E(S)=+\infty$ which contradicts \eqref{J11} (Recall from Lemma \ref{lem:JK} that $J^{1,1}+J^{2,2}=K^{1,1}+K^{2,2}$ and from Lemma \ref{lem:deuxdeux} that these quantities are $\geq -1$). Now, let us decompose the semimartingale $(Z_{t})_t=M_t-A_t$ into its martingale $M_t$ and its bounded variation part $-A_t$. From Lemma \ref{lem:SDE}, we recall: \begin{align}\label{At} -A_t= \frac{1}{2} \int_0^t (J^{1,2}-J^{2,1} ) ds. \end{align} Applying Cauchy--Schwarz inequality and following the same track as for \eqref{un} we obtain \begin{align}\label{totvar} \mathbb E\int_0^t | J^{1,2}- J^{2,1}|ds\leq{\sqrt{t}}\sqrt{\mathbb E\int_0^t (J^{1,2}- J^{2,1})^2ds}\leq {\sqrt{t}}\sqrt{2C^2}. \end{align} Remark now that the quantity on the left hand side is two times the expected total variation of $A_t$ on $[0,t]$. We postpone the proof of the following result until the end of the (present) proof. It occurs as an application of Lemma \ref{lem:MG}: there exists $h>0$ such that for every $t>0$, \begin{align}\label{martingale_part} \mathbb E(|M_{t+h}-M_t|)\geq 10 C^2. \end{align} Since, we have assumed $E(|M_t-A_t|)\leq C^2$ for every $t\geq 0$, the triangle inequality implies $\mathbb E(|A_{t+h}-A_t|)\geq 8C^2$ for every $t\geq 0$. The control of the expected total variation of $(A_t)$ expressed in \eqref{totvar} and the lower estimate just proved give \begin{equation}\label{eq:contradiction} 8C^2 n\leq \sum_{k=1}^n \mathbb E(|A_{kh}-A_{(k-1)h}|)\leq \frac{1}{2} \mathbb E\int_0^{nh} |J^{1,2}-J^{2,1} | ds \leq \sqrt{\frac{C^2h n}{2}},\end{equation} which, as $n$ tends to $\infty$, provides a contradiction with our initial assumption that was $\sup_{t\geq 0}\sqrt{\max(\mathbb E(R_t^2),\mathbb E(|Z_t|))}\leq C$. We are left with the proof of \eqref{martingale_part} (under the assumption of the $L^2$ boundedness). Recall $T=\inf\{t\geq 0:\, R_t=\frac{R_0}{2}\}$ and set $q=\P(T=+\infty)$. We have already proved $q>0$. We shall show further that for $h\geq \frac{5C^2}{q}$, \begin{equation}\label{crochet-Mt} \P\left(\langle M\rangle_{t+ h} - \langle M\rangle_{t} \geq \frac{R_0^2h}{8} \right) \geq q- \frac{C^2}{2h} \geq \frac{9q}{10}. \end{equation} We hence obtain \eqref{martingale_part} taking $h$ large enough in \eqref{crochet-Mt} and applying Lemma \ref{lem:MG} to $(M_{t+h}-M_t)_{h\geq 0}$. Proof of \eqref{crochet-Mt}: considering only the event $\{T=+\infty\}$ for the martingale part of $Z_t$ described in Lemma \ref{lem:SDE}, one has \begin{align}\label{eq:yoh} \langle M\rangle_{t+ h} - \langle M\rangle_{t} \geq \mathbf 1_{\{ T=+\infty\}}\left(\frac{R_0}{2}\right)^2 \int _t^{t+h} \frac{1+K^{2,2}}{2} ds. \end{align} Now, since by \eqref{J11} it holds \[ \mathbb E\left[\int_t^{t+h} \mathbf 1_{\{ T=+\infty\}} \frac{1-K^{2,2}}{2}\, \mathrm{d} s\right]\leq C^2/4, \] taking the complementary set of $\{\int _t^{t+h} \frac{1+K^{2,2}}{2} ds \geq \frac{h}{2}\}$ in $\{T=+\infty\}$ and using Markov inequality, one obtains: \begin{align}\label{eq:yohyoh} \notag &\P\left( \mathbf 1_{\{ T=+\infty\}} \int _t^{t+h} \frac{1+K^{2,2}}{2} ds \geq \frac{h}{2}\right)\\ = & q- \P\left( \mathbf 1_{\{ T=+\infty\}} \int_t^{t+h} \frac{1-K^{2,2}}{2} ds > \frac{h}{2}\right) \geq q- \frac{C^2}{4}\cdot\frac2h. \end{align} Hence, in \eqref{eq:yoh} we consider the probability that the right-hand side is greater than $(R_0/2)^2\cdot(h/2)$, which, with \eqref{eq:yohyoh}, gives the wanted estimate \eqref{crochet-Mt} for every $h\geq \frac{5C^2}{q}$. \end{proof} \begin{proof}[Proof of Lemma \ref{lem:MG}.] Let $\phi$ be the quadratic variation of $N$ $$\phi(t) =\langle N \rangle_t,$$ and consider the hitting time $\tau=\inf\{t\geq 0:\, \phi(t)\geq \beta\}$. Set $\psi(t)= \phi(t) \wedge \beta$. The Dambins theorem shows that there exists a standard Brownian motion $(W_t)_{t\geq 0}$ such that for every $t\geq 0$, \begin{align}\label{N_to_B} \mathbb E\left[|N_t|\right] \geq \mathbb E\left[ |N_{t\wedge \tau}| \right] = \mathbb E\left[ | W_{\psi(t)}| \right]. \end{align} Let now $A$ be the event $\{\omega\in \Omega:\, \phi(h)\geq \beta \}$ and recall the assumption $\P(A)\geq p$. One has \begin{align}\label{event_A} \mathbb E\left[ | W_{\psi(h)}| \right] \geq \mathbb E\left[ | W_{\psi(h)}|\cdot\mathbf1_{A} \right] = \mathbb E\left[ | W_{\beta}|\cdot \mathbf1_{A} \right] \geq a_p\, \sqrt{ \beta} \end{align} where the constant $a_p$ is given by $$a_p=\mathbb E\left[ |G| \, \mathbf1_{\{|G| \leq \Phi^{-1}(\frac{1+p}{2})\}} \right]=\int_{\Phi^{-1}(\frac{1-p}2)}^{\Phi^{-1}(\frac{1+p}2)}|x|\frac{e^{-x^2/2}}{\sqrt{2\pi}}\mathrm{d} x.$$ with $G$ a standard normal random variable and $\Phi$ its cumulative distribution function. The lower bound in \eqref{event_A} is obtained for $\P(A)=p$ and the normal random variable $W_{\beta}$ of variance $\beta$ concentrated as much as possible close to zero on event $A$. Equation \eqref{N_to_B} for $t=h$ and \eqref{event_A} finally provide the wanted estimate. \end{proof} \begin{remark}\label{rem:concave} The major constraint for generalising Theorem \ref{thm:W2} and its proof to a $L^p$-Wasserstein control for $p< 2$ is that $\mathbb E(|Z_t|)$ is replaced by $\mathbb E(|Z_t|^{p/2})$. Here $x\mapsto |x|^{p/2}$ is not convex when $p<2$ and Jensen's inequality does not apply. \end{remark} \subsection{Proof of Theorems \ref{thm:rapport-Winfty} and \ref{thm:rapport-W2}} As said before, Theorems \ref{thm:rapport-Winfty} and \ref{thm:rapport-W2} are deduced from Theorems \ref{thm:Winfty} and \ref{thm:W2} and the use of the homogeneous dilations. For a fixed time $T>0$ and $p\in (0,\infty]$, we introduce $C_{T,p}$ to be the constant: \[ C_{T,p}:= \sup_{a\neq a'\in\mathbb H} \inf_{\mathcal {A}_T^{(a,a')}} \sup_{0 \leq t \leq T} \frac{ \mathbb E[ d_{\mathbb H}^p(\mathbf B_t^a, \mathbf B_t^{a'}) ]^{\frac{1}{p}} } { d_{\mathbb H} (a,a')}\in [0,+\infty]; \] where, as before in Remarks \ref{rem:rapport-Winfty} and \ref{rem:rapport-W2}, $ \mathcal {A}_T^{(a,a')}$ denotes the set of co-adpated couplings of $(\mathbf B_t^a)_{0\leq t\leq T}$ and $(\mathbf B_t^{a'})_{0\leq t\leq T}$, starting respectively in $a$ and $a'$. When $p=+\infty$, the numerator is $\mathrm{essup}_{(\Omega,\P)}d_\mathbb H(\mathbf B_t^a,\mathbf B_t^{a'})$. As noticed in these remarks we aim at proving $C_{T,p}=+\infty$ for $p\geq 2$. The first key point is to show that, using dilations, this constant does not depend on $T$. For this, let $S>0$ be another fixed time. The point is that if $(\mathbf B_t^a, \mathbf B_t^{a'} )_{0\leq t\leq T}$ is a co-adapted coupling of two Heisenberg Brownian motions on $[0,T]$ starting respectively in $a$ and $a'$; setting for $b\in\{a,a'\}$: \[ \tilde \mathbf B_s ^{\tilde b} : = \mathrm{dil}_{\sqrt\frac{S}{T} }\left( \mathbf B_{\frac{sT}{S}}^{ b}\right), \textrm{ for } 0\leq s \leq S; \] then, $ (\tilde \mathbf B_s^{\tilde a} , \tilde \mathbf B_s ^{\tilde{a'}})_{0\leq s\leq S} $ is a co-adapted coupling of two Heisenberg Brownian motions on $[0,S]$ starting respectively in $\tilde a=\mathrm{dil}_{\sqrt \frac{S}{T}} (a) $ and $\tilde{a'}= \mathrm{dil}_{\sqrt \frac{S}{T}} (a')$, Moreover, \[ d_\mathbb H(\tilde \mathbf B_s ^{\tilde a}, \tilde \mathbf B_s ^{\tilde {a'}}) = \sqrt\frac{S}{T} d_\mathbb H \left( \mathbf B_{\frac{sT}{S}}^{a}, \mathbf B_{\frac{sT}{S}}^{a'}\right) \] and \[ d_\mathbb H( \tilde a, \tilde {a'})= \sqrt \frac{S}{T} d_\mathbb H (a,a').\] This easily gives $C_{S,p} \leq C_{T,p}$ and by symmetry of $S$ and $T$: $ C_{S,p} = C_{T,p}$. We can now turn to the proof of Theorems \ref{thm:rapport-Winfty} and \ref{thm:rapport-W2}. Since the proofs are similar and the case $p=+\infty$ is easier, we only treat the case $p=2$. \begin{proof}[Proof of Theorem \ref{thm:rapport-W2}.] Suppose by contradiction that $C_{T_0,2} <+\infty$ for some $T_0>0$. The above discussion implies that $C_{T,2} <+\infty$ for each fixed time $T>0$. Let $a=(0,0,0)$ and $a'=(x',0,0)$ with $x'\neq 0 $. Thus, there exists a constant $C$ (one can take $C= C_{T_0,2} \, d_\mathbb H(a,a')$) such that for each time $T_0>0$, there is a co-adapted coupling satisfying $ \mathbb E[d_\mathbb H^2( B_t ^a, B_t^{a'})] \leq C$ for $t\in [0, T_0]$. Now with the same notation as in the proof of Theorem \ref{thm:W2} and denoting $q_{T_0}= \P(\forall 0\leq s\leq T_0, R_s\geq \frac{R_0}{2} )$; one has $q_{T_0} \geq q$ and as before, there exists $h$ (independent of $T_0$) such that for all $0\leq t\leq T_0 -h $, \[ \mathbb E[|M_{t+h}-M_t|] \geq 10 C^2. \] Of course this gives: $\mathbb E[|A_{t+h}-A_t|]\geq 8C^2$ for every $0\leq t\leq T_0 -h $. Therefore equation \eqref{eq:contradiction} still holds if $nh\leq T_0$. Since the constants $C$ and $h$ are independent of $T_0$, letting $T_0$ and $n$ tend to infinity gives the contradiction. Thus $C_{T_0,2} =+\infty$. \end{proof} \section{Coupling by reflection}\label{sec:refl} In this section, we study precisely the coupling by reflection. We recall that $(\mathbf B_t)_{t\geq 0}$ and $(\mathbf B'_t)_{t\geq 0}$ are two Heisenberg Brownian motions coupled by reflection if and only if their horizontal parts $(B_t)_{t\geq 0}$ and $(B'_t)_{t\geq 0}$ are two Brownian motions on $\mathbb R^2$ coupled by reflection. This means that the coupling matrices are given by $K^{1,1}=-1$, $K^{2,2}=1$, $K^{1,2}=K^{2,1}=0$ for $t< \tau$ and by the matrix $J=\mathrm{Id}_2$ for $t\geq\tau$ where $\tau= \inf \{s\geq 0:\, R_s =0\}$ is the hitting time of $0$ for $(R_t)_{t\geq 0}$. We recall \[ R_t=R_0 + 2 C_{t\wedge \tau}\quad \textrm{ and }\quad Z_t= Z_0+ \int_0^{t\wedge \tau} (R_0 + 2 C_{s\wedge\tau} )d \tilde C_s \] where $(C_s)_s$ and $(\tilde C_s)_s$ are two independent Brownian motions (starting in 0) and with $\tau= \inf\{ s\geq 0:\, C_s=-R_0/2\}$. For simplicity, in the following we only consider the case $R_0>0$ and $Z_0=0$. \begin{prop}\label{pro:assymp} With the above notation, assume $R_0>0$ and $Z_0=0$, Let $p>0$, then there exists some constants $C_p, C_p', C_p''>0$ such that \[ \mathbb E[R_t]= R_0 \] and \[ \left\{ \begin{array}{l l l} \mathbb E[|Z_t|^p]& \sim_{t\to \infty} C_p R_0 t^{p-\frac{1}{2}} & \textrm{ if } p > \frac{1}{2}\\ \mathbb E[|Z_t|^p] &\sim_{t\to \infty} C_p' R_0 \ln t &\textrm{ if } p =\frac{1}{2} \\ \mathbb E[|Z_t|^p] &\to_{t\to+\infty} C_p'' R_0^{2p} & \textrm{ if } 0 < p <\frac{1}{2}. \end{array} \right. \] \end{prop} \begin{remark} In particular for $0<\alpha<1$, the upper bound \[ \sup_{t\geq 0} \mathbb E\left[d_\mathbb H(\mathbf B_t, \mathbf B'_t)^\alpha\right] <+\infty \] is satisfied by the coupling by reflection. This is obtained by recalling that $d_\mathbb H(\mathbf B_t, \mathbf B'_t)$ is equivalent to the homogeneous distance $\sqrt{R_t^2 + |Z_t|}$ using Proposition \ref{pro:assymp} for $p=\alpha/2$, $(a+b)^p\leq a^p+b^p$, and Jensen's inequality $[\mathbb E(R_t)^\alpha]\leq [\mathbb E(R_t)]^\alpha$. \end{remark} \begin{proof} We assume $R_0=1$. Let $t>0$ be fixed. By the Dambins-Dunford-Schwarz theorem, $Z$ is a changed time Brownian motion: \[ Z_t= W_{T(t)} \textrm{ with } T(t)=\int_0^t R_s^2 ds \] with $W$ a Brownian motion independent of $(R_t)_{t\geq 0}$. Set $\tau =\inf\{s\geq 0:\, R_s=0\}$. As $( R_s/2)_{s\geq 0}$ is a Brownian motion starting in $R_0/2$ and stopped in 0, it is known that $\tau$ is almost surely finite and that its density $f_\tau$ is given by \begin{align}\label{densite} f_\tau(u)=\frac{R_0/2}{ \sqrt{2\pi} u^{3/2}} e^{-\frac{R_0^2}{4u}}, \; u\geq 0. \end{align} Using $\tau$, we compute \begin{align} \label{decomp} E\left[|Z_t|^{p}\right]&=\mathbb E(|W_{T(t)}|^{p})\\ \notag &=\int_0^{+\infty} \mathbb E(|W_{T(t)}|^{p}|\tau=u)f_\tau(u)d u \\ \notag &=\underbrace{\int_0^{t} \mathbb E(|W_{T(t)}|^{p}|\tau=u)f_\tau(u)d u}_{h_1(t)}+ \underbrace{\int_t^{+\infty} \mathbb E(|W_{T(t)}|^{p}|\tau=u)f_\tau(u)d u}_{h_2(t)}. \notag \end{align} In the last line, we split the integral between the trajectories of $R$ that have hit $0$ before $t$ and those which will hit 0 after $t$. Let us estimate $h_1(t)$, the first integral in the decomposition \eqref{decomp}. Hence we set $u\leq t$. Since $W$ and $R$ are independent, with $c_p=\mathbb E(|W_1|^{p})$, one has: \begin{align} \label{transfo} \mathbb E(|W_{T(t)}|^{p}|\tau=u)&= c_p \mathbb E(|T(t)|^{p/2}|\tau=u)\\ \notag &= c_p \mathbb E\left( \left(\int_0^u R_s^2 ds\right) ^{p/2} |\tau=u \right)\\ \notag &= c_p 2^p u^p \mathbb E\left[ \left(\int_0^1 \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau=u \right]\notag \end{align} where we have introduced the normalised process $(\tilde R_\lambda)_{\lambda\in [0,1]}$ (defined almost surely, since the hitting time $\tau$ is almost surely finite) in such a way it hits 0 at time 1: \[ \tilde R_\lambda= \frac{1}{2 \sqrt \tau} R_{\tau \lambda},\quad \lambda \in [0,1]. \] Note that $\tilde R_0= \frac{R_0}{2\sqrt \tau}$. It is then well-known that, conditioned on $\tau=u$, the entire process $(\tilde R_\lambda)_{\lambda \in [0,1]} $ converges in law when $u\to \infty$ to a normal positive Brownian excursion $(X_s)_{s\in[0,1]}$. Moreover, as proven in Lemma \ref{lem:unif-int}, when $u\to \infty$ \begin{align}\label{stab} \mathbb E\left[ \left(\int_0^1 \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau=u \right] \to \mathbb E\left[ \left(\int_0^1 X_s^2 ds\right) ^{p/2} \right]. \end{align} \ \ Finally with \eqref{transfo} denoting the limit in \eqref{stab} by $E_p$, the first integral in \eqref{decomp} satisfies the following equivalence: \begin{align*} h_1(t)=\int_0^{t} \mathbb E(|W_{T(t)}|^{p}|\tau=u)f_\tau(u)d u & \sim_{t\to \infty}2^p \, c_p \, E_p \int_0^{t} u^p f_\tau(u) du \end{align*} From the density estimate of $f_\tau$ in \eqref{densite} we have $u^pf_\tau(u)\sim_{+\infty} \frac{R_0}{2 \sqrt{2\pi}}u^{p-3/2}$. Therefore: \begin{itemize} \item If $p>1/2$, the function $h_1(t)$ is equivalent to $\frac{ 2^{p-3/2}\, R_0 \, c_p E_p}{ (p-1/2) \sqrt {\pi} \, u^{3/2}}t^{p-1/2}$ at $+\infty$, \item if $p=1/2$, it is equivalent to $\frac{R_0c_p E_p}{2 \sqrt {\pi} \, u^{3/2}}\ln t$, \item if $0<p<1/2$, it converges to a positive constant. \end{itemize} \ We now turn to $h_2$. As before, \begin{align*} h_2(t)&=\int_t^{+\infty} \mathbb E(|W_{T(t)}|^{p}|\tau=u)f_\tau(u)d u\\ &= c_p \int_t^{+\infty}\mathbb E\left( \left(\int_0^t R_s^2 ds\right) ^{p/2} |\tau=u \right)f_\tau(u)d u\\ &=2^p \, c_p \, \int_t^{+\infty} u^p \mathbb E\left[ \left(\int_0^{ \frac{t}{u}} \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau=u \right] f_\tau(u)d u\\ &=2^p\, c_p \, t^{p+1} \, \int_1^{+\infty} v^p \mathbb E\left[ \left(\int_0^{ \frac{1}{v}} \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau= tv \right] f_\tau(tv)d v\\ &= \frac{ 2^{p-3/2}\, c_p \, R_0 \, t^{p-3/2}}{ \sqrt{\pi}} \int_1^{+\infty} v^{p-3/2} \mathbb E\left[ \left(\int_0^{ \frac{1}{v}} \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau= tv \right] e^{-\frac{R_0^2}{tv}} dv\\ \end{align*} where, as above, $s=u\lambda$ and $\tilde{R}_{\lambda}=R_{\tau\lambda}/\sqrt{\tau}$ and where we set the change of variable $u=tv$ in the next to last line. Now, Lemma \ref{lem:unif-int} and the dominated convergence, which is completely justified by Lemma \ref{lem:bessel}, give as $t\to+\infty$, \begin{align*} \int_1^{+\infty} v^{p-3/2} \mathbb E\left[ \left(\int_0^{ \frac{1}{v}} \tilde R_\lambda^2 d\lambda \right) ^{p/2} |\tau= tv \right] e^{-\frac{R_0^2}{4tv}} dv \to \int_1^{+\infty} v^{p-3/2} \mathbb E\left[ \left(\int_0^{ \frac{1}{v}}X_s^2 ds \right) ^{p/2} \right] d v. \end{align*} As a consequence, denoting by $I_p$ the last integral, \[ h_2(t) \sim_{t\to \infty} \frac{2^{p-3/2}\, c_p \, R_0}{\sqrt {\pi}} t^{p-1/2} I_p. \] This with the treatment of $h_1$ above gives the complete result in case $R_0=1$. Next, if $R_0>0$ one infers $\mathbb E_{R_0} [|Z_t|^p ]=R_0^{2p} \; \mathbb E_{\{R_0=1\} }[| Z_{t/R_0^2} |^p]$ from the classical dilations of Subsection \ref{sec:H}, so that the general case follows. \end{proof} The two next lemmas complete the proof of Proposition \ref{pro:assymp}. \begin{lemme}\label{lem:unif-int} Let $( \tilde R_t)_{t\in[0,1]}$ be a Brownian motion starting in $r_0>0$ conditioned to hit 0 for the first time at time 1. Let $\alpha\in [0,1]$ and $p$ be positive. As $r_0\to 0$, \begin{align}\label{stab2} \mathbb E\left[ \left(\int_0^\alpha \tilde R_\lambda^2 d\lambda \right) ^{p/2}\right] \to \mathbb E\left[ \left(\int_0^\alpha X_s^2 ds\right) ^{p/2} \right] \end{align} where $( X_s)_{s\in [0,1]}$ is a Brownian excursion. \end{lemme} \begin{proof} The process $ (\tilde R_t)_{t\in[0,1]}$ converges in law to the Brownian excursion $( X_s)_{s\in [0,1]}$. To obtain the convergence of the moments of $\int_0^\alpha \tilde R_\lambda^2 d\lambda$, we use a uniform integrability property. Let 0$ \leq \alpha\leq 1$. We bound \[ \P\left( \left(\int_0^\alpha \tilde R_\lambda^2 d\lambda \right) \geq y |\,\tau=u\right) \leq \P\left( \sup_{0\leq s\leq 1} W_s \geq \sqrt y |\, T_0= 1\right) \] where $(W_s)_{s\geq 0}$ is a Brownian motion starting in $r_0$ and $T_0$ its hitting time of $0$. Next, by \cite[Formula 2.1.4 (1) p.198]{BoSa_second}, still for $W$ starting in $r_0$, we have for every $t>0$ \begin{align*} \P\left( \sup_{0\leq s\leq T_0} W_s <y |\, T_0= t\right)&= \sum_{k=-\infty} ^{+\infty} \frac{( r_0 + 2ky)}{\sqrt {2\pi} t^{3/2}} \exp\left( - \frac{( r_0 + 2ky)^2}{2t} \right) \frac{\sqrt {2\pi} t^{3/2}}{r_0} \exp\left( \frac{ r_0^2}{2t} \right), \end{align*} In particular, reorganising the terms, \begin{align*} \P \left( \sup_{0\leq s\leq 1} W_s <y |\, T_0= 1\right)& &=1 - 2 \sum_{k=1} ^{+\infty} \left( 4k^2y^2 \frac{\sinh(2kyr_0)}{2kyr_0}-\cosh(2kyr_0) \right) \exp\left(- 2k^2 y^2\right), \end{align*} and, since for $u\geq 0$, $\frac{\sinh u}{u} \leq e^{u}$, uniformly on $0<r_0\leq 1$ and $y\geq 1$, \begin{align*} \P \left( \sup_{0\leq s\leq 1} W_s \geq y |\,T_0= 1\right) &\leq 8\sum_{k=1} ^{+\infty} k^2y^2 \exp(2ky)\exp\left(- 2k^2 y^2\right) \leq a \exp(-by^2) \end{align*} for some $a,b>0$. Thus, for all $0<r_0\leq 1$, the random variables $ \left(\int_0^\alpha \tilde R_\lambda^2 d\lambda \right)_{r_0\leq 1}$ admit some uniformly bounded exponential moment. As a consequence, the corresponding $ \left(\int_0^\alpha \tilde R_\lambda^2 d\lambda \right)^\frac{p}{2}$ are uniformly integrable and the desired convergence follows. \end{proof} \begin{lemme}\label{lem:bessel} With the above notation, there exists a coupling of $( \tilde R_t)_{t\in[0,1]}$ and of a 3-Bessel process $(V_t)_{t\in [0,1]} $ on the same probability space such that both start in $r_0\geq 0$ and such almost surely: \[ \tilde R_t \leq V_ t , \, \textrm{for all } 0\leq t\leq 1. \] In particular, for $R_0$ fixed and $p>0$ there exists a constant $D_p>0$ such that for all $v\geq 1$ and $r_0 \leq \frac{R_0}{\sqrt {v}}$ it holds \[ v^p \mathbb E\left[ \left(\int_0^{ \frac{1}{v}} \tilde R_\lambda^2 d\lambda \right) ^{p/2}\right] \leq D_p \] where the process $\tilde R_\lambda$ starts in $r_0$. \end{lemme} \begin{proof} The process $ \tilde R_t$ can be thought as a Bessel bridge (see e.g. \cite[Chapter XIII] {MR1725357}) and thus satisfies \[ d \tilde R_t = dW_t + \left(\frac{1}{\tilde R_t} - \frac{\tilde R_t}{1-t} \right) dt \] for some Brownian motion $(W_t)_{t\in[0,1]}$. The coupling is obtained by considering the same Brownian motion in the stochastic differential equation defining $(V_t)_{t \in [0,1]}$: \[ d V_t = dW_t + \frac{1}{ V_t} dt \] The other conclusion follows since the 3-Bessel process shares the same scaling property as the Brownian motion: $(V_{\lambda t}/\sqrt{\lambda})_t$ has the same law as the 3-Bessel process starting in $r_0/\sqrt{\lambda}$. \end{proof} \section{The static coupling, a transport problem}\label{sec:bonus} In this section, we turn to the proof of Theorem \ref{thm:static}. Recall that it gives a direct proof of the following $L^1$-Wasserstein control: There exists $C>0$ such that for every $t\geq 0$, and every $a,a'\in \mathbb H$, \[\mathcal{W}_1(\mu^a_t,\mu^{a'}_t) \leq Cd_\mathbb H(a,a')\] where $\mu^a_t=\mathrm{Law}(\mathbf B^a_t)$ and $\mu^{a'}_t=\mathrm{Law}(\mathbf B^{a'}_t)$. \begin{proof}[Proof of Theorem \ref{thm:static} ] \emph{Reduction of the problem:} Let us first see how, using the symmetries of $\mathbb H$ presented in Subsection \ref{sec:H}, the proof can be reduced to $t=1$, $a=(0,0,0)$ and $a'=(x',0,0)$. First, the isometries of $\mathbb H$ induced isometries for $\mathcal{W}_1$. In particular $(\mathrm{trans}_p)_\#$ and $(\mathrm{rot}_\theta)_\#$ are isometries for $\mathcal{W}_1$, for every $p\in \mathbb H$ and $\theta\in \mathbb R$, that stabilise the family $\{\mu^a_t\}_{a\in \mathbb H}$. \[\mathcal{W}_1(\mu^a_t,\mu^{a'}_t)=\mathcal{W}_1((\mathrm{trans}_p)_\#\mu^a_t,(\mathrm{trans}_p)_\#\mu^{a'}_t)=\mathcal{W}_1(\mu^{p.a}_t,\mu^{p.a'}_t).\] Hence, we can assume $a=(0,0,0)$. Using $\mathrm{rot}_\theta$ we can moreover assume $a'=(x',0,z')$. As moreover $\mathrm{dil}_\lambda$, defined in Subsection \ref{sec:H} satisfies $(\mathrm{dil}_\lambda)_\#\mu^a_t=\mu^{\mathrm{dil}_\lambda(a)}_{\lambda^2 t}$ we can assume $t=1$. Finally \begin{align*} \mathcal{W}_1(\mu^0_1,\mu^{(x',0,z')}_1)&\leq \mathcal{W}_1(\mu^0_1,\mu^{(x',0,0)}_1)+\mathcal{W}_1(\mu^{(x',0,0)}_1,\mu^{(x',0,z')}_1)\\ &\leq \mathcal{W}_1(\mu^0_1,\mu^{(x',0,0)}_1)+\mathcal{W}_1(\mu^{0}_1,\mu^{(0,0,z')}_1)\\ &\leq \mathcal{W}_1(\mu^0_1,\mu^{(x',0,0)}_1)+d_\mathbb H((0,0,0),(0,0,z')). \end{align*} The estimate $\mathcal{W}_1(\mu^{0}_1,\mu^{(0,0,z')}_1)\leq d_\mathbb H((0,0,0),(0,0,z'))=2\sqrt{\pi|z'|}$ comes from the fact that $\mathrm{trans}_{(0,0,z')}$ is not only the left-translation but also the right-translation of vector $(0,0,z')$. If $(X,Y,Z)\sim \mu^{0}_1$, then $(X,Y,Z).(0,0,z')\sim \mu^{(0,0,z')}_1$ so that \[d_\mathbb H((X,Y,Z).(0,0,z'),(X,Y,Z))=d_\mathbb H((0,0,0),(0,0,z')).\] If we can prove $\mathcal{W}_1(\mu^0_1,\mu^{(x',0,0)}_1)\leq C' d_\mathbb H((0,0,0),(x',0,0))=C'|x'|$ for some $C'\geq 1$, we have finally \begin{align*} \mathcal{W}_1(\mu^0_1,\mu^{(x',0,z')}_1)&\leq C d_\mathbb H((0,0,0),(x',0,0))+d_\mathbb H((0,0,0),(0,0,z'))\\ &=C' |x'|+2\sqrt{\pi |z'|} \leq\max( C', \sqrt{2\pi}) \sqrt{(x')^2+|z'|}\\ &\leq C d_\mathbb H((0,0,0),(x',0,z')), \end{align*} with $C= c\cdot \max( C', \sqrt{2\pi})$ with $c$ defined as in \eqref{eq:dist-eq}. Finally the proof amounts to the case $t=1$, $a=(0,0,0)$ and $a'=(x',0,0)$, as we announced. \emph{Main body of the proof:} We set \begin{align} \mu&=\mu^0_1=\mathrm{Law}(X,Y,Z)\label{ligne_un}\\ \nu&=\mu_1^{(x',0,0)}=\mathrm{Law}\left[(x',0,0).(X,Y,Z)\right]=\mathrm{Law}(X+x',Y,Z+(1/2)x'Y)\label{ligne_deux}\\ \tilde\mu&=\mathrm{Law}\left[(x',0,0).(X,Y,Z).(-x',0,0)\right]=\mathrm{Law}(X,Y,Z+x'Y) \label{ligne_trois} \end{align} We want to estimate $W_1(\mu,\nu)$ from above and start with \[W_1(\mu,\nu)\leq W_1(\mu,\tilde \mu)+W_1(\tilde \mu,\nu)\] The coupling in \eqref{ligne_deux} and \eqref{ligne_trois} yields $W_1(\tilde \mu,\nu)\leq |x'|=d_\mathbb H((0,0,0),(x',0,0))$. The coupling suggested in \eqref{ligne_un} and \eqref{ligne_trois} yields \begin{align} W_1(\mu,\tilde \mu)&\leq \mathbb E\left[\mathbb E\left[d_\mathbb H((X,Y,Z),(X,Y,Z+x'Y))|(X,Y)\right] \right]\label{restart}\\ \notag &\leq \mathbb E\left[\mathbb E\left[d_\mathbb H((0,0,0),(0,0,x'Y))|(X,Y)\right]\right]\\ &\leq \mathbb E \left[2\sqrt{\pi |Yx'|}\right]=\sqrt{|x'|}\times[2\sqrt{\pi} \, \mathbb E(\sqrt{|Y|})] \notag \end{align} The order $\sqrt{|x'|}$ is such that $\sqrt{|x'|}/d_\mathbb H((x',0,0),(0,0,0))=|x'|^{-1/2}\to \infty$ as $x'$ goes to zero. \begin{remark} Note that the coupling in \eqref{restart} is exactly the synchronous coupling of subsection \ref{sub:synchro} evaluated at time $t=1$. The estimate from above can easily be checked with Lemma \ref{lem:SDE}. \end{remark} We modify the computation above just a little based on the knowledge that the translation is not the optimal transport plan on the real line when considering costs that are increasing concave functions of the distance. The following lemma will be in order: \begin{lemme}\label{lem:sqrt} If $\eta$ is a probability measure on $\mathbb R$ with rapidly decreasing and smooth density $f$, then \[\inf_{\pi\in \Pi(\eta, (\mathrm{trans}^\mathbb R_t)_\#\eta)} \iint \sqrt{|y-x|}\, d \pi\leq |t| \times\left(\int |f'(x)|\sqrt{|x|}\,dx\right) \] \end{lemme} \begin{proof} The left-hand side is the $1$-Wasserstein distance $\mathcal{W}^\mathbb R_1(\eta,(\mathrm{trans}^\mathbb R_t)_\#\eta)$ on $\mathbb R$ for the distance $(x,y)\mapsto \sqrt{|y-x|}$. This is also the Kantorovich norm $\|\eta-(\mathrm{trans}^\mathbb R_t)_\#\eta)\|_1$, in the sense of \cite{MR0102006}. Recall that the Kantorovich norm of a signed Radon measure $\sigma=\sigma_+-\sigma_-$ of mass zero is \[\|\sigma\|_1=\mathcal{W}_1^\mathbb R(\sigma_+,\sigma_-)=\inf_{\pi\in \Pi(\sigma_+,\sigma_-)}\iint \sqrt{|y-x|}d\pi(x,y)\] where the mass of $\sigma_+$ can be different from 1. Let $\sigma=\eta-(\mathrm{trans}^\mathbb R_t)_\#\eta)$ and for the computation of $\|\sigma\|_1$ assume without loss of generality that $t\geq 0$. We have $\sigma=\int_0^t (\mathrm{trans}^\mathbb R_u)_\#\gamma\,d u$ where $\gamma$ is the Radon measure of density $f'$. Therefore \begin{align*} \|\sigma\|_1=\left\|\int_0^t(\mathrm{trans}^\mathbb R_u)_\#\gamma\,du\right\|&\leq \int_0^t\|(\mathrm{trans}^\mathbb R_u)_\#\gamma\|_1\,du\\ &= \int_0^t\|\gamma\|_1\,du \, = t \|\gamma\|_1 \\ &\leq \, t\times\left(\int |f'(x)|\sqrt{|x|}\,dx\right). \end{align*} Note that for the last inequality, we use the triangle inequality by transporting $\gamma_+$, of density $f'_+$, to the atomic measure $(\int f'_+) \delta_0$ and then from this measure to $\gamma_-$, of density $f'_-$. \end{proof} We can now conclude by coupling $Z$ and $Z'$, conditionally on $(X,Y)$. From \eqref{restart}: \begin{align*} \mathbb E\left[d_\mathbb H((X,Y,Z),(X,Y,Z+x'Y))|(X,Y)\right]&\leq 2\sqrt{\pi}|x'Y|\times\left(2\int |f'_{Z|X,Y}(z)|\sqrt{|z|}\,dz\right)\\ \end{align*} where $f_{Z|x,y}$ is the density of $\mathrm{Law}(Z|\,X=x,\ Y=y)$. Finally, \begin{align*} &\mathbb E\left[d_\mathbb H((X,Y,Z),(X,Y,Z+x'Y))\right]\\ &\leq |x'|\iint f_{X,Y}(x,y) 2\sqrt{\pi}|y|\times\left(\int |f_{Z|x,y}'(z)|\sqrt{|z|}\,dz\right)\,dx\,dy\\ &\leq |x'|\iiint 2\sqrt{\pi}|y|\sqrt{|z|}\left(\frac{|\partial_z f_{X,Y,Z}(x,y,z)|}{f_{X,Y,Z}(x,y,z)}\right)f_{X,Y,Z}(x,y,z)\,dx\,dy\,dz. \end{align*} Here $f_{X,Y,Z}$ is the density of $\mu=\mathrm{Law}(X,Y,Z)$ with respect to the Lebesgue measure and $f_{X,Y}$ is the density of $(X,Y)$. Note that we have $f_{Z|x,y}(z)=f_{X,Y,Z}(x,y,z)/f_{X,Y}(x,y)$. Since $f_{X,Y,Z}$ is the density of the heat kernel, it is well known (see \cite{Li} and \cite{BBBC} equation (14) ) that there exists a constant $C>0$ such that for all $(x,y,z)\in\mathbb H$, \begin{equation}\label{eq:dzp1} \left| \frac{\partial_z f_{X,Y,Z}(x,y,z)}{f_{X,Y,Z}(x,y,z)} \right| \leq C. \end{equation} The proof of this fact is analytic and is based on the explicit representation of the heat kernel as an oscillatory intergal. The proof of Theorem \ref{thm:static} is then finished since the quantity $|y| \sqrt {|z|}$ is clearly integrable with respect to the heat kernel $ f_{X,Y,Z}$. \end{proof} \section{Generalisation to the Heisenberg groups of higher dimension.}\label{sec:gene} In this section, we prove that Theorems \ref{thm:rapport-Winfty}, \ref{thm:Winfty}, \ref{thm:rapport-W2}, \ref{thm:W2}, \ref{thm:refl} and \ref{thm:static} also hold in the case of the Heisenberg groups of higher dimension. For $n\geq 1$ the Heisenberg group $\mathbb H_n$ can be identified with $\mathbb R^{2n+1}$ equipped with the law: \[ \left((x_i,y_i)_{i=1}^n ,z\right)\cdot \left((x'_i,y'_i)_{i=1}^n ,z'\right)= \left((x_i+x'_i,y_i+y_i')_{i=1}^n , z+z'+\frac{1}{2}\sum_{i=1}^n (x_iy_i'-y_ix_i')\right). \] The corresponding Brownian motion starting from $0_{\mathbb R^{2n+1}}$ is given by: \[ \mathbf B_t^0:= \left( \left(B_{t,i}^1, B_{t,i}^2\right)_{i=1,\dots,n}, \frac{1}{2} \sum_{i=1}^n\left( \int_0^t B^1_{s,i} dB^2_{s,i} - \int_0^t B^2_{s,i} dB^1_{s,i}\right) \right) \] where $B_t:=\left(B_{t,i}^1, B_{t,i}^2\right)_{i=1,\dots,n}$ is a $2n$-dimensional standard Brownian motion. As before, we denote by $(\mathbf B_t ^a)_{t\geq 0}$ the Brownian motion starting in $a\in \mathbb H_n$. It can be represented as $a \cdot \mathbf B_t^0$ and we write $\mu_t^a$ for its law at time $t$. Lemma \ref{lem:gen-coupling} can directly be generalised for describing co-adapted Heisenberg Brownian motions $(\mathbf B_t,\mathbf B_t')$ but with matrices $J, \hat J\in \mathcal M_{2n}(\mathbb R)$. As above, we denote by $R_t$ the Euclidean norm of $B_t'-B_t\in \mathbb R^{2n}$ and by $Z_t $ the last coordinate of $\mathbf B_t'^{-1} \mathbf B_t$ that we still call the relative L\'evy area. The quantity \[ d_H(\mathbf B_t,\mathbf B'_t):= \sqrt{R_t^2 + |Z_t|} \] is still a homogenous distance on $\mathbb H_n$ and is equivalent to the Carnot-Carath\'eodory distance $d_\mathbb H$. When $R_t>0$ we introduce the following basis: let $e_1$ be $\frac{1}{R_t}(B_t' - B_t)\in \mathbb R^{2n}$, write $e_1=(a_1, \dots a_n), \, a_j\in \mathbb C=\mathbb R^2$, set $e_2= (ia_1,\dots, i a_n)$ and complete $(e_1,e_2) $ into a direct orthonormal basis of $\mathbb R^{2n}$. This basis is well adapted for studying couplings in $\mathbb H_n$. Indeed, with $L$ and $\hat L$ being the coupling matrices in this new basis in place of $J, \hat J$ in the canonical basis, a computation gives: \begin{lemme} With the above notation, if $R_t>0$, then \begin{align*} \left\{ \begin{aligned} d(R^2_{t})&=2 R_t \sqrt{2(1-L^{1,1}) } \, dC_t + 2 \, \mathrm{tr} \left(I_{2n}- J\right)dt\\ dZ_{t} &= \frac{1}{2}\, R_t \sqrt{2(1+L^{2,2}) } \, d\tilde C_t + \frac{1}{2} \sum_{i=1}^n ( J^{2i-1,2i} - J^{2i,2i-1} )dt\\ \end{aligned} \right. \end{align*} where $(C_t)_{t\geq 0}$ and $(\tilde C_t)_{t\geq 0}$ are some 1-dimensional (possibly correlated) standard Brownian motions. \end{lemme} Now, since $\mathrm{tr} L= \mathrm{tr} J$, and since each $|L^{i,i}| \leq 1$ for $1\leq i\leq n$, \[ 1-L^{2,2} \leq \mathrm{tr}(I-L)= \mathrm{tr}(I-J) \] and one can directly adapt the proof of Theorems \ref{thm:Winfty} and \ref{thm:W2} to this setting. Similarly as before, one can deduce that Theorems \ref{thm:rapport-Winfty} and \ref{thm:rapport-W2} are also satisfied for higher dimensional Heisenberg groups. \ \emph{Generalisation of Theorem \ref{thm:refl}:} The coupling by reflection can also be done on $\mathbb H_n$. It corresponds to the matrix $L$ defined by \[\left\{ \begin{array}{l} L^{1,1}= -1\\ L^{i,i}=1 \textrm{ for }{2 \leq i \leq n}\\ L^{i,j}=0 \textrm{ for } {i\neq j.}\\ \end{array} \right. \] In this case, a computation easily gives that $C_t$ and $\tilde C_t$ are independent. Moreover since $L$ is symmetric, $J$ is also symmetric and $\sum_{i=1}^n ( J^{2i-1,2i} - J^{2i,2i-1})=0$. As a consequence, $R_t^2$ and $Z_t$ satisfy the same stochastic differential system as in the case of $\mathbb H_1$. Thus Proposition \ref{pro:assymp} holds in $\mathbb H_n$ with constants $C_p,C_p'$ and $C_p''$ independent of the dimension and Theorem \ref{thm:refl} also holds for $\mathbb H_n$. \ \emph{Generalisation of Theorem \ref{thm:static}:} We turn to the static coupling. As before, using the symmetries and the dilatation of the higher dimensional Heisenberg groups, it suffices to study the case $t=1$ and $a= 0$, $a'= ((x',0), (0,0) , \dots, (0,0), 0)$. If the vector $V=( (X_1, Y_1), \dots (X_d,Y_d), Z)$ has law $\mu_1^0$, then the vector $a'.V=(X_1+ x', Y_1), (X_2,Y_2), \dots (X_d,Y_d), Z+ \frac{1}{2} x' Y_2 )$ has law $\mu_1^{a'}$. An analogue coupling as the one in Section \ref{sec:bonus} can be defined. The horizontal part is translated by $((x,'0), \dots,(0,0))$ and conditionally on $( (X_1, Y_1), \dots (X_d,Y_d))$, we perform a coupling between the law of $Z$ and the law of $Z+ \frac{1}{2} x' Y_2 $ as described in Lemma \ref{lem:sqrt}. Recall that it is adapted to the non-convex transport cost $(z,z')\mapsto \sqrt{|z-z'|}$. Since the heat kernel estimate corresponding to \eqref{eq:dzp1} also holds in higher dimension (see \cite{MR2541147}), the proof finishes analogously to the one in $\mathbb H_1$. Therefore Theorem \ref{thm:static} is satisfied for higher dimensional Heisenberg groups too. \bibliographystyle{abbrv
\section{Introduction} \para{Background} The problem of simulating the time evolution of a quantum system is perhaps the most important application of quantum computers. Indeed, this was the reason Feynman proposed quantum computing~\cite{Fey82}, and it remains an important practical application since a significant fraction of the world's supercomputing power is used to solve instances of this problem that arise in materials science, condensed matter physics, high energy physics, and chemistry~\cite{NERSC16}. All known classical algorithms (i.e., algorithms that run on traditional non-quantum computers) for this problem run in exponential time. On the other hand, from the early days of quantum computing~\cite{Fey82,Lloyd1996} it was known that quantum computers can solve this problem in polynomial time. More precisely, when formalized as a decision problem, the problem of simulating the time evolution of a quantum system is in the complexity class $\mathsf{BQP}$, the class of problems solved by a quantum computer to bounded error in polynomial time. Furthermore, the problem is complete for $\mathsf{BQP}$~\cite{Feynman1985,Nagaj2009}, which means we do not expect there to be efficient classical algorithms for the problem, since that would imply $\mathsf{BPP}=\mathsf{BQP}$, which in turn would imply polynomial-time algorithms for problems such as integer factorization and discrete log~\cite{Sho97}. \para{Hamiltonian simulation problem} The Hamiltonian simulation problem is a standard formalization of the problem of simulating the time evolution\footnote{This is sometimes referred to as ``real time evolution'', to distinguish it from ``imaginary time evolution'' which we will not talk about in this paper.} of a quantum system. In this problem, we assume the quantum system whose time evolution we wish to simulate consists of $n$ qubits and we want to simulate its time evolution for time $T$, in the sense that we are provided with the initial state $|\psi(0)\>$ and we want to compute the state of the system at time $T$, $|\psi(T)\>$. The goal of an efficient simulation is to solve the problem in time polynomial in $n$ and $T$. The state of a system of $n$ qubits can be described by a complex vector of dimension $2^n$ of unit norm. Since we are studying quantum algorithms for the problem, we are given the input as an $n$-qubit quantum state, and have to output an $n$-qubit quantum state. The relation between the output state at time $T$ and the initial state at time $0$ is given by the Schr\"odinger equation \begin{equation} i\frac{\mathrm{d}}{\mathrm{d}t}|\psi(t)\>=H(t)|\psi(t)\>, \end{equation} where the Hamiltonian $H$, a $2^n \times 2^n$ complex Hermitian matrix, has entries which may also be functions of time. The Hamiltonian captures the interaction between the constituents of the system and governs time dynamics. In the special case where the Hamiltonian is independent of time, the Schr\"odinger equation can be solved to yield $|\psi(T)\>=e^{-iHT}|\psi(0)\>$. More formally, the input to the Hamiltonian simulation problem consists of a Hamiltonian $H$ (or $H(t)$ in the time-dependent case), a time $T$, and an error parameter $\epsilon$. The goal is to output a quantum circuit that approximates the unitary matrix that performs the time evolution above (e.g., for time-independent Hamiltonians, the quantum circuit should approximate the unitary $e^{-iHT}$). The notion of approximation used is the spectral norm distance between the ideal unitary and the one performed by the circuit. The cost of a quantum circuit is measured by the number of gates used in the circuit, where the gates come from some fixed universal gate set. Note that it is important to describe how the Hamiltonian in the input is specified, since it is a matrix of size $2^n \times 2^n$. This will be made precise when talking about specific classes of Hamiltonians that we would like to simulate. \para{Geometrically local Hamiltonian simulation} The most general class of Hamiltonians that is commonly studied in the literature is the class of sparse Hamiltonians~\cite{AT03,Chi04,BAC+07,BerryEtAl2014,TS,BCK15,QSP,LC16, LC17USA}. A Hamiltonian on $n$ qubits is sparse if it has only $\poly(n)$ nonzero entries in any row or column. For such Hamiltonians, we assume we have an efficient algorithm to compute the nonzero entries in each row or column, and the input Hamiltonian is specified by an oracle that can be queried for this information. In this model, recent quantum algorithms have achieved optimal complexity in terms of the queries made to the oracle~\cite{QSP}. A very important special case of this type of Hamiltonian is a ``local Hamiltonian.'' Confusingly, this term is used to describe two different kinds of Hamiltonians in the literature. We distinguish these two definitions of ``local'' by referring to them as ``non-geometrically local'' and ``geometrically local'' in this introduction. A non-geometrically local Hamiltonian is a Hamiltonian $H(t)$ that can be written as a sum of polynomially many terms $H_j(t)$, each of which acts nontrivially on only $k$ qubits at a time (i.e., the matrix acts as identity on all other qubits). A geometrically local Hamiltonian is similar, except that each term $H_j(t)$ must act on $k$ adjacent qubits. Since we refer to ``adjacent'' qubits, the geometry of how the qubits are laid out in space must be specified. In this paper we will deal with qubits laid out in a $D$-dimensional lattice in Euclidean space. I.e., qubits are located at points in $\mathbb{Z}^D$ and are adjacent if they are close in Euclidean distance. Lattice Hamiltonians in $D$-dimensions (with $D\leq 3$) already model all the physical systems we are interested in, are of fundamental importance by the principle of locality. From a practical perspective, this case captures a large fraction of all physical systems we are interested in.\footnote{There are some physical situations where we do care about more general Hamiltonians. Even though the system we are given may be described by a geometrically local Hamiltonian, it is sometimes computationally advantageous to represent a given system with a non-geometrically local (or sparse) Hamiltonian.} \para{Prior best algorithms} To describe the known algorithms for this problem, we need to formally specify the problem. Although our results apply to very general time-dependent Hamiltonians, while comparing to previous work we assume the simpler case where the Hamiltonian is time independent. We assume our $n$ qubits are laid out in a $D$-dimensional lattice $\Lambda$ in $\mathbb{R}^D$, where $D=\O(1)$, and every unit ball contains $\O(1)$ qubits. We assume our Hamiltonian $H$ is given as a sum of terms $H = \sum_{X\subseteq\Lambda} h_X$, where each $h_X$ only acts nontrivally on qubits in $X$ (and acts as identity on the qubits in $\Lambda \setminus X$), such that $h_X=0$ if $\diam(X)>1$, which enforces geometric locality. (More formally, we rescale the metric in such a way that $\diam(X) > 1$ implies $h_X = 0$.) We normalize the Hamiltonian by requiring $\norm{h_X}\leq 1$. We consider a quantum circuit simulating the time evolution due to such a Hamiltonian efficient if it uses $\poly(n,T,1/\epsilon)$ gates. To get some intuition for what we should hope for, notice that in the real world, time evolution takes time $T$ and uses $n$ qubits. Regarding ``Nature'' as a quantum simulator, we might expect that there is a quantum circuit that uses $O(n)$ qubits, $O(T)$ circuit depth, and $O(nT)$ total gates to solve the problem. It is also reasonable to allow logarithmic overhead in the simulation since such overheads are common even when one classical system simulates the time evolution of another (e.g., when one kind of Turing machine simulates another). However, previous algorithms for this problem fall short of this expectation. The best Hamiltonian simulation algorithms for sparse Hamiltonians~\cite{TS,QSP,LC16} have query complexity $\O(nT \polylog(nT/\epsilon))$, but the assumed oracle for the entries requires $O(n)$ gates to implement, yielding an algorithm that uses $\O(n^2T \polylog(nT/\epsilon))$ gates. This was also observed in a recent paper of Childs, Maslov, Nam, Ross, and Su~\cite{Childs2017}, who noted that for $T=n$, all the sparse Hamiltonian simulation algorithms had gate cost proportional to $n^3$ (or worse). A standard application of high-order Lie-Trotter-Suzuki expansions~\cite{Trotter1959,Suzuki1991,Lloyd1996,BAC+07} yields gate complexity $O(n^2T (nT/\epsilon)^{\delta})$ for any fixed $\delta > 0$. It has been argued~\cite[Sec.~4.3]{JordanLeePreskill2014} that this in fact yields an algorithm with gate complexity $O(nT (nT/\epsilon)^{\delta})$ for any fixed $\delta > 0$. We believe this analysis is correct, but perhaps some details need to be filled in to make the analysis rigorous. In any case, this algorithm still performs worse than desired, and in particular does not have polylogarithmic dependence on $1/\epsilon$. \subsection{Results} We exhibit a quantum algorithm that simulates the time evolution due to a time-dependent lattice Hamiltonian with a circuit that uses $\O(nT \polylog(nT/\epsilon))$ geometrically local $2$-qubit gates (i.e., the gates in our circuit also respect the geometry of the qubits), with depth $\O(T \polylog(nT/\epsilon))$ using only $\polylog(nT/\epsilon)$ ancilla qubits. We then also prove a matching lower bound, showing that no quantum algorithm can do better (up to logarithmic factors), even if we relax the output requirement significantly. We now describe our results more formally. \para{Algorithmic results} We consider a more general version of the problem with time-dependent Hamiltonians. In this case we will have $H(t) = \sum_{X\subseteq \Lambda} h_X(t)$ with the locality and norm conditions as before. However, now the operators $h_X(t)$ are functions of time and we need to impose some reasonable constraints on the entries to obtain polynomial-time algorithms. First we need to be able to compute the entries of our Hamiltonian efficiently at a given time $t$. We say that a function $\alpha: [0,T] \ni t \mapsto \alpha(t) \in {\mathbb{R}}$ is \emph{efficiently computable} if there is an algorithm that outputs $\alpha(t)$ to precision $\epsilon$ for any given input $t$ specified to precision $\epsilon$ in running time $\polylog(T/\epsilon)$. Note that any complex-valued analytic function on a nonzero neighborhood of a closed real interval in the complex plane is efficiently computable (see \cref{app:chebyshev}). We will assume that each entry in a local term $h_X(t)$ is efficiently computable. In addition to being able to compute the entries of the Hamiltonian, we require that the entries do not change wildly with time; otherwise, a sample of entries at discrete times may not predict the behavior of the entries at other times. We say that a function $\alpha$ on the interval $[0,T]$ ($T \ge 1$) is \emph{piecewise slowly varying} if there are $M = {{O}}(T)$ intervals $[t_{j-1},t_j]$ with $0 = t_0 < t_1 < \cdots < t_M = T$ such that $\frac{\mathrm{d}}{\mathrm{d}t}\alpha(t)$ exists and is bounded by $1/(t_j - t_{j-1})$ for $t \in (t_{j-1},t_j)$. In particular, a function is piecewise slowly varying if it is a sum of $O(T)$ pieces, each of which has derivative at most $O(1)$. We will assume that each entry in a term $h_X(t)$ is piecewise slowly varying. We are now ready to state our main result, which is proved in \Cref{sec:algorithm} \begin{restatable}{theorem}{main} Let $H(t) = \sum_{X \subseteq \Lambda} h_X(t)$ be a time-dependent Hamiltonian on a lattice $\Lambda$ of $n$ qubits, embedded in the Euclidean metric space $\mathbb R^D$. Assume that every unit ball contains ${{O}}(1)$ qubits and $h_X = 0$ if $\diam(X) > 1$. Also assume that every local term $h_X(t)$ is efficiently computable (e.g., analytic), piecewise slowly varying on time domain $[0,T]$, and has $\norm{h_X(t)} \le 1$ for any $X$ and $t$. Then, there exists a quantum algorithm that can approximate the time evolution of $H$ for time $T$ to accuracy $\epsilon$ using ${{O}}( Tn \polylog(Tn/\epsilon))$ 2-qubit local gates, and has depth ${{O}}(T \polylog(Tn/\epsilon))$. \label{thm:main} \end{restatable} Our algorithm uses $O(1)$ ancillas per system qubit on which $H$ is defined. The ancillas are interspersed with the system qubits, and all the gates respect the locality of the lattice. \para{Lower bounds} We also prove a lower bound on the gate complexity of problem of simulating the time evolution of a time-dependent lattice Hamiltonian. This lower bound matches, up to logarithmic factors, the gate complexity of the algorithm presented in \Cref{thm:main}. Note that unlike previous lower bounds on Hamiltonian simulation~\cite{BAC+07,BerryEtAl2014,BCK15}, which prove lower bounds on query complexity, this is a lower bound on the number of gates required to approximately implement the time-evolution unitary. To our best knowledge, this is the first nontrivial lower bound on the gate complexity of the simulation problem. For concreteness, we focus on a 1-dimensional time-dependent local Hamiltonian in this section, although the lower bound extends to other constant dimensions with minor modifications. The lower bounds are proved in \Cref{sec:lowerbound}. Before stating the result formally, let us precisely define the class of Hamiltonians for which we prove the lower bound. We say a Hamiltonian $H(t)$ acting on $n$ qubits is a ``piecewise constant 1D Hamiltonian'' if $H(t)=\sum_{j=1}^{n-1}H_j(t)$, where $H_j(t)$ is only supported on qubits $j$ and $j+1$ with $\max_t \norm{H_j(t)} = {{O}}(1)$, and there is a time slicing $0 = t_0 < t_1 < \cdots < t_M = T$ where $t_m - t_{m-1} \le 1$ and $M = {{O}}(T)$ such that $H(t)$ is time-independent within each time slice. For such Hamiltonians, the time evolution operator for time $T$ can be simulated with error at most $\epsilon$ using \Cref{thm:main} with ${{O}}(Tn \polylog(Tn/\epsilon))$ $2$-qubit local gates (i.e., the 2-qubit gates only act on adjacent qubits). In particular, for any constant error, the simulation only requires ${\widetilde{\calO}}(Tn)$ 2-qubit local gates. We prove a matching lower bound, where the lower bound even holds against circuits that may use non-geometrically local (i.e., acting on non-adjacent qubits) $2$-qubit gates from a possibly infinite gate set and unlimited ancilla qubits. \begin{restatable}{theorem}{lowerboundgeneral} \label{thm:lowerboundgeneral} For any integers $n$ and $T \leq 4^n$, there exists a piecewise constant bounded 1D Hamil{-}tonian $H(t)$ on $n$ qubits, such that any quantum circuit that approximates the time evolution due to $H(t)$ for time $T$ to constant error must use ${\widetilde{\Omega}}(Tn)$ $2$-qubit gates. The quantum circuit may use unlimited ancilla qubits and the gates may be non-local and come from a possibly infinite gate set. \end{restatable} Note that this lower bound only holds for $T\leq 4^n$, because any unitary on $n$ qubits can be implemented with ${\widetilde{\calO}}(4^n)$ 2-qubit local gates~\cite{BBC+95,Kni95}. We can also strengthen our lower bound to work in the situation where we are only interested in measuring a local observable at the end of the simulation. The simulation algorithm presented in \Cref{thm:main} provides a strong guarantee: the output state is $\epsilon$-close to the ideal output state in trace distance. Trace distance captures distinguishability with respect to arbitrary measurements, but for some applications it might be sufficient for the output state to be close to the ideal state with respect to local measurements only. We show that even in this limited measurement setting, it is not possible to speed up our algorithm in general. In fact, our lower bound works even if the only local measurement performed is a computational basis measurement on the first output qubit. \begin{restatable}{theorem}{lowerboundlocal} \label{thm:lowerboundlocal} For any integers $n$ and $T$ such that $1 \le n\leq T\leq 2^n$, there exists a piecewise constant bounded 1D Hamiltonian $H(t)$ on $n$ qubits, such that any quantum circuit that approximates the time evolution due to $H(t)$ for time $T$ to constant error on any local observable must use ${\widetilde{\Omega}}(Tn)$ 2-qubit gates. If $T\leq n$, we have a lower bound of ${\widetilde{\Omega}}(T^2)$ gates. (The quantum circuit may use unlimited ancilla qubits and the gates may be non-local and come from a possibly infinite gate set.) \end{restatable} Note that the fact that we get a weaker lower bound of ${\widetilde{\Omega}}(T^2)$ when $T\leq n$ is not a limitation, but reflects the fact that small time evolutions are actually easier to simulate when the measurement is local. To see this, consider first simulating the time evolution using the algorithm in \Cref{thm:main}. This yields a circuit with ${\widetilde{\calO}}(Tn)$ 2-qubit local gates. But if we only want the output of a local measurement after time $T$, qubits that are far away from the measured qubits cannot affect the output, since the circuit only consists of 2-qubit local gates. Hence we can simply remove all gates that are more than distance equal to the depth of the circuit, ${\widetilde{\calO}}(T)$, away from the measured qubits. We are then left with a circuit that uses ${\widetilde{\calO}}(T^2)$ gates, matching the lower bound in \Cref{thm:lowerboundlocal}. \subsection{Techniques} \para{Algorithm} Our algorithm is based on a decomposition of the time evolution unitary using Lieb-Robinson bounds~\cite{LiebRobinson1972,Hastings2004LSM,NachtergaeleSims2006,HastingsKoma2006,Hastings2010}, that was made explicit by Osborne~\cite{Osborne2006} (see also Michalakis~\cite[Sec.~III]{Michalakis2012}), which when combined with recent advances in Hamiltonian simulation~\cite{TS,QSP,LC16}, yields \Cref{thm:main}. Lieb-Robinson bounds are theorems that informally state that information travels at a constant speed in geometrically local Hamiltonians. For intuition, consider a 1-dimensional lattice of qubits and a geometrically local Hamiltonian that is evolved for a short amount of time. If the time is too short, no information about the first qubit can be transmitted to the last qubit. Lieb-Robinson bounds make this intuition precise, and show that the qubit at position $n$ is only affected by the qubits and operators at position 1 after time $\Omega(n)$. Note that if this were a small-depth unitary circuit of geometrically local $2$-qubit gates such a statement would follow using a ``lightcone'' argument. In other words, after one layer of geometrically local $2$-qubit gates, the influence of qubit 1 can only have spread to qubit 2. Similarly, after $k$ layers of $2$-qubit gates, the influence of qubit 1 can only have spread up to qubit $k$. The fact that this extends to geometrically local Hamiltonians is nontrivial, and is only approximately true. See \Cref{lem:LR} for a formal statement of a Lieb-Robinson bound. We use these ideas to chop up the large unitary that performs time evolution for the full Hamiltonian $H$ into many smaller unitaries that perform time evolution for a small portion of the Hamiltonian. Quantitatively, we break Hamiltonian simulation for $H$ for time $O(1)$ into $O(n/\log(nT/\epsilon))$ pieces, each of which is a Hamiltonian simulation problem for a Hamiltonian on an instance of size $O(\log(nT/\epsilon))$ to exponentially small error. At this point we can use any Hamiltonian simulation algorithm for the smaller piece as long as it has polynomial gate cost and has exponentially good dependence on $\epsilon$. While Hamiltonian simulation algorithms based on product formulas do not have error dependence that is $\polylog(1/\epsilon)$, recent Hamiltonian simulation algorithms, such as \cite{BerryEtAl2014,TS,BCK15,QSP,LC16} have $\polylog(1/\epsilon)$ scaling. Thus our result crucially uses the recent advances in Hamiltonian simulation with improved error scaling. \para{Lower bound} As noted before, we lower bound the gate complexity (or total number of gates) required for Hamiltonian simulation, which is different from prior work which proved lower bounds on the query complexity of Hamiltonian simulation. As such, our techniques are completely different from those used in prior work. Informally, our lower bounds are based on a refined circuit-size hierarchy theorem for quantum circuits, although we are technically comparing two different resources in two different models, which are simulation time for Hamiltonians versus gate cost for circuits. As a simple motivating example, consider circuit-size hierarchy theorems for classical or quantum circuits more generally. Abstractly, a hierarchy theorem generally states that a computational model with $X$ amount of a resource (e.g., time, space, gates) can do more if given more of the same resource. For example, it can be shown that for every $G \ll 2^n/n$, there exists a Boolean function on $n$ bits that cannot be computed by a circuit of size $G$, but can be computed by a circuit of size $G+O(n)$. We show similar hierarchy theorems for quantum circuit size, except that we show that the circuit of larger size that computes the function actually comes from a weaker family of circuits. Informally, we are able to show that there are functions that can be computed by a larger circuit that uses only geometrically local $2$-qubit gates from a fixed universal gate set that cannot be a computed by a smaller circuit, even if we allow the smaller circuit access to unlimited ancilla bits and non-geometrically local $2$-qubit from an infinite gate set. We then leverage this asymmetric circuit size hierarchy theorem to show that there is a Hamiltonian whose evolution for time $T$ cannot be simulated by a circuit of size $\ll nT$, by embedding the result of any quantum circuit with geometrically local $2$-qubit gates into a piecewise constant Hamiltonian with time proportional to the depth of the circuit. \section{Algorithm and analysis} \label{sec:algorithm} In this section we establish our main algorithmic result, restated below for convenience: \begin{figure*}[t] \centering \includegraphics[width=0.85\textwidth]{algorithm.pdf} \caption{Decomposition of time evolution operator for time $t = {{O}}(1)$. The time is going upwards. Each block $\square$ represents the forward time evolution, $e^{-it H_\square}$, if the arrow is upward, and backward time evolution, $e^{+it H_\square}$, if the arrow is downward. Here, $H_\square$ is the sum of local terms in the Hamiltonian supported within the block. The overlap has size $\ell$. (a) shows a one-dimensional setting, but a generalization to higher $D$ dimensions is readily achieved by regarding each block as a $(D-1)$-dimensional hyperplane so that the problem reduces to lower dimensions. (b) shows a two-dimensional setting. The approximation error from the depicted decomposition is $\epsilon = {{O}}(e^{-\mu \ell} L^D / \ell)$ where $L$ is the linear system size, $\ell$ is the width of the overlap between blocks, and $\mu > 0$ is a constant that depends only on the locality of the Hamiltonian. One can use any algorithm to further decompose the resulting ``small'' unitaries on ${{O}}(\log(L/\epsilon))$ qubits into elementary gates. To achieve gate count that is linear (up to logarithmic factors) in spacetime volume, the algorithm for simulating the blocks needs to be polynomial in the block size and polylogarithmic in accuracy. } \label{fig:algorithm} \end{figure*} \main* The algorithm is depicted in \Cref{fig:algorithm}. Before showing why this algorithm works, we provide a high-level overview of the algorithm and the structure of the proof. Since a time evolution unitary $U(T;0)$ is equal to $U(T=t_M; t_{M-1})U(t_{M-1},t_{M-2}) \cdots U(t_2;t_1)U(t_1; t_0 = 0)$, we will focus on a time evolution operator $U(t;0)$ where $t = {{O}}(1)$, generated by a slowly varying bounded Hamiltonian. The key idea, as shown in \Cref{fig:algorithm}, is that the time-evolution operator, $e^{-itH}$ due to the full Hamiltonian $\sum_{X\subseteq \Lambda} h_X$ can be approximately written as a product \begin{align} e^{-itH} \approx \left( e^{-itH_A} \right) \left( e^{+itH_Y} \right) \left( e^{-itH_{Y\cup B}} \right). \end{align} Here $A\cup B = \Lambda$ and we think of $A$ and $B$ as large regions, but $Y$ as a small subset of $A$. The error in the approximation is exponentially small as long as $Y$ is large enough. This is formally proved in \Cref{lem:decomposition}, which is supported by \Cref{lem:ode} and \Cref{lem:LRB}. Applying this twice, using \begin{align} e^{-itH_{Y\cup B}} \approx \left( e^{-itH_B} \right) \left( e^{+itH_Z} \right) \left( e^{-itH_{Y \cup Z}} \right) \end{align} leads to a symmetric approximation as depicted at the bottom left of \Cref{fig:algorithm}. This procedure can then be repeated for the large operators supported on $A$ and $B$ to reduce the size of all the operators involved, leading to the pattern in \Cref{fig:algorithm} (a). This reduces the problem of implementing the time-evolution operator for $H$ into the problem of implementing smaller time-evolution operators, which can be implemented using known quantum algorithms. We now establish the lemmas needed to prove the result. \begin{lemma} Let $A_t$ and $B_t$ be continuous time-dependent Hermitian operators, and let $U^A_t$ and $U^B_t$ with $U^A_0 = U^B_0 = {\mathbf{1}}$ be the corresponding time evolution unitaries. Then the following hold: \begin{enumerate \item[(i)] $W_t=(U^B_t)^\dagger U^A_t$ is the unique solution of $i\partial_t W_t = \left((U^B_t)^\dagger (A_t-B_t) U^B_t \right) W_t$ and $W_0 = {\mathbf{1}}$. \item[(ii)] If $\norm{A_s-B_s} \le \delta$ for all $s \in [0,t]$, then $\norm{U^A_t - U^B_t} \le t \delta$. \end{enumerate} \label{lem:ode} \end{lemma} \begin{proof} (i) Differentiate. The solution to the ordinary differential equation is unique. (ii) Apply Jensen's inequality for $\norm{\cdot}$ (implied by the triangle inequality for $\norm{\cdot}$) to the equation $W_t - W_0 = \int_0^t {\mathrm{d}} s \partial_s W_s$. Then, invoke (i) and the unitary invariance of $\norm{\cdot}$. \end{proof} \begin{lemma}[Lieb-Robinson bound~\cite{LiebRobinson1972,Hastings2004LSM,NachtergaeleSims2006,HastingsKoma2006}] \label{lem:LR}\label{lem:LRB} Let $H=\sum_X h_X$ be a local Hamiltonian and $O_X$ be any operator supported on $X$, and put $\ell = \lfloor \dist(X,\Lambda\setminus \Omega) \rfloor$. Then \begin{align} &\norm{(U^{H}_t)^\dagger O_X U^{H}_t - (U^{H_{ \Omega}}_t)^\dagger O_X U^{H_{ \Omega}}_t} \le \nonumber \\ &|X|\norm{O_X} \frac{(2\zeta_0 |t|)^\ell}{\ell!}, \label{eq:LRB} \end{align} where $\zeta_0 = \max_{p \in \Lambda} \sum_{Z \ni p} |Z|\norm{h_Z} = {{O}}(1)$. In particular, there are constants $v_{LR} > 0$, called the Lieb-Robinson velocity,% \footnote{ Strictly speaking, the Lieb-Robinson velocity is defined to be the infimum of any $v_{LR}$ such that \cref{eq:exteriorLightcone} holds. } and $\mu>0$, such that for $\ell \geq v_{LR} |t|$, we have \begin{align} &\norm{(U^{H}_t)^\dagger O_X U^{H}_t - (U^{H_{ \Omega}}_t)^\dagger O_X U^{H_{ \Omega}}_t} \nonumber \\ &\le {{O}}(|X| \norm{O_X} \exp(- \mu \ell)). \label{eq:exteriorLightcone} \end{align} \end{lemma} \begin{proof} See \ref{app:pfLRB}. \end{proof} We are considering strictly local interactions (as in \Cref{thm:main}), where $h_X = 0$ if $\diam(X)>1$, but similar results hold with milder locality conditions such as $\norm{h_X} \le e^{-\diam(X)}$~\cite{LiebRobinson1972,Hastings2004LSM,NachtergaeleSims2006,HastingsKoma2006,Hastings2010}; see the appendix for a detailed proof. Below we will only use the result that the error is at most ${{O}}(e^{ - \mu \ell})$ for some $\mu > 0$ and fixed $t$. For slower decaying interactions, the bound is weaker and the overlap size $\ell$ in \Cref{fig:algorithm} will have to be larger. The Lieb-Robinson bound implies the following decomposition. \begin{lemma} Let $H = \sum_X h_X$ be a local Hamiltonian (as in \Cref{thm:main}, or a more general definition for which \Cref{lem:LRB} still holds). Then there are constants $v,\mu >0$ such that for any disjoint regions $A,B,C$, we have \begin{align} &\norm{U_t^{H_{A\cup B}} (U_{t}^{H_{B}})^\dagger U_t^{H_{B \cup C}} - U_t^{H_{A\cup B \cup C}}} \le \nonumber \\ &{{O}}( e^{vt - \mu \dist(A,C)} ) \sum_{X: \text{bd}(AB,C)}\norm{h_X} \end{align} where $X:\text{bd}(AB,C)$ means that $X \subseteq A \cup B \cup C$ and $X \not\subseteq A \cup B$ and $X \not\subseteq C$. \label{lem:decomposition} \end{lemma} \begin{proof} We omit ``$\cup$'' for the union of disjoint sets. The following identity is trivial but important: \begin{align} U^{H_{ABC}}_t = U^{H_{AB} + H_{C}}_t \underbrace{(U^{H_{AB} + H_{C}}_t )^\dagger U^{H_{ABC}}_t}_{=W_t}. \end{align} By \Cref{lem:ode} (i), $W_t$ is generated by~\cite{Osborne2006,Michalakis2012} \begin{align} &(U^{H_{AB} + H_{C}}_t)^\dagger (\underbrace{H_{ABC}-H_{AB}-H_C}_{H_\text{bd}}) U^{H_{AB} + H_{C}}_t \nonumber \\ &\quad = (U^{H_{B} + H_{C}}_t)^\dagger H_\text{bd} U^{H_{B} + H_{C}}_t + \underbrace{{{O}}(\norm{H_\text{bd}} e^{ v t -\mu \ell})}_{=\delta} \label{eq:truncation} \end{align} where $\ell$ is the distance from the support of the boundary terms $H_\text{bd}$ to $A$, and the estimate of $\delta$ is due to \Cref{lem:LRB} applied to local terms in $H_\text{bd}$. Since $H_\text{bd}$ contains terms that cross between $AB$ and $C$, the distance $\ell$ is at least $\dist(A,C)$ minus 2. By \Cref{lem:ode} (i) again, the unitary generated by the first term of \eqref{eq:truncation} is $(U^{H_{B} + H_{C}}_t)^\dagger U^{H_{BC}}_t$, which can be thought of as the ``interaction picture'' time-evolution operator of the Hamiltonian in \eqref{eq:truncation}. This is our simplification of the ``patching'' unitary, which is $t \delta$-close to $W_t$ by \Cref{lem:ode} (ii). \end{proof} \begin{proof}[Proof of \protect{\Cref{thm:main}}] The circuit for simulating the Hamiltonian is described in \Cref{fig:algorithm}. The decomposition of time evolution unitary in \Cref{fig:algorithm} is a result of iterated application of \Cref{lem:decomposition}. For a one-dimensional chain, let $L$ be the length of the chain, so there are ${{O}}(L)$ qubits. Take a two contiguous blocks $Y$ and $Z$ of the chain that overlaps by length $\ell \ll L$. Under periodic boundary conditions there are two components in the intersection, and under open boundary conditions, there is one component in the intersection. Applying \Cref{lem:decomposition}, we decompose the full unitary into two blocks on $Y$ and $Z$, respectively, and one or two blocks in the intersection. Every block unitary in the decomposition is a time evolution operator with respect to the sum of Hamitonian terms within the block, and we can recursively apply the decomposition. Making the final blocks as small as possible, we end up with a layout of small unitaries as shown in \Cref{fig:algorithm} (a). The error from this decomposition is ${{O}}(\delta L/ \ell)$, which is exponentially small in $\ell$ for $t = {{O}}(1)$. Going to higher dimensions $D > 1$, we first decompose the full time evolution into unitaries on ${{O}}(L/\ell)$ hyperplanes (codimension 1). This entails error ${{O}}(e^{-\mu \ell} L^D / \ell)$ since the boundary term has norm at most ${{O}}(L^{D-1})$. For each hyperplane the decomposition into ${{O}}(L/\ell)$ blocks of codimension 2 gives error ${{O}}(e^{-\mu \ell} (\ell L^{D-2}) (L/\ell))$. Summing up all the hyperplanes, we get ${{O}}(e^{-\mu \ell} L^{D}/\ell)$ for the second round of decomposition. After $D$ rounds of the decomposition the total error is ${{O}}(e^{-\mu \ell} D L^{D}/\ell)$, and we are left with ${{O}}((L/\ell)^D)$ blocks of unitaries for $t = {{O}}(1)$. For longer times, apply the decomposition to each factor of $U(T=t_M; t_{M-1})U(t_{M-1},t_{M-2}) \cdots U(t_2;t_1)U(t_1; t_0 = 0)$ It remains to implement the unitaries on $m = {{O}}(T L^D/\ell^D)$ blocks $\square$ of ${{O}}(\ell^D)$ qubits where $\ell = {{O}}(\log (T L/\epsilon))$ to accuracy $\epsilon / m$. All blocks have the form $U^{H_{ \square}}_t$, and can be implemented using any known Hamiltonian simulation algorithm. For a time-independent Hamiltonian, if we use an algorithm that is polynomial in the spacetime volume and polylogarithmic in the accuracy such as those based on signal processing~\cite{QSP,LC16} or linear combination of unitaries~\cite{BerryEtAl2014,TS,BCK15}, then the overall gate complexity is ${{O}}(T L^D \polylog(T L / \epsilon)) = {{O}}(Tn \polylog(Tn/\epsilon))$, where the exponent in the $\polylog$ factor depends on the choice of the algorithm.% \footnote{ If we use the quantum signal processing based algorithms~\cite{QSP,LC16} to implement the blocks of size ${{O}}(\ell^D)$, then we need ${{O}}(\log \ell)$ ancilla qubits for a block. Thus, if we do not mind implementing them all in serial, then it follows that the number of ancillas needed is ${{O}}(\log \log (T n / \epsilon))$, which is much smaller than what would be needed if the quantum signal processing algorithm was directly used to simulate the full system. } For a slowly varying time-dependent Hamiltonian, we can use the fractional queries algorithm~\cite{BerryEtAl2014} or the Taylor series approach~\cite{TS,Low2018,Kieferova2018} to achieve the same gate complexity. The Taylor series approach uses a subroutine $\ket t \mapsto \ket t \left( \sum_j \abs{\alpha_j(t)} \right)^{-1/2} \sum_{j} \sqrt{\alpha_j(t)} \ket j$, where $\alpha_j(t)$ is the real coefficient of Pauli operator $P_j$ in the Hamiltonian, which must be efficiently evaluated. \end{proof} For not too large system sizes $L$, it may be reasonable to use a bruteforce method to decompose the block unitaries into elementary gates~\cite[Chap. 8]{KitaevBook}. \section{Optimality} \label{sec:lowerbound} In this section we prove a lower bound on the gate complexity of problem of simulating the time evolution of a time-dependent local Hamiltonian. (Recall that throughout this paper we use \emph{local} to mean geometrically local.) \subsection{Lower bound proofs} We now prove \Cref{thm:lowerboundgeneral} and \Cref{thm:lowerboundlocal}, starting with \Cref{thm:lowerboundlocal}. This lower bound follows from the following three steps. First, in \Cref{lem:circuittoHamiltonian}, we observe that for every depth-$T$ quantum circuit on $n$ qubits that uses local $2$-qubit gates, there exists a Hamiltonian $H(t)$ of the above form such that time evolution due to $H(t)$ for time $T$ is equal to applying the quantum circuit. Then, in \Cref{lem:countlower} we show that the number of distinct Boolean functions on $n$ bits computed by such quantum circuits is at least exponential in ${\widetilde{\Omega}}(Tn)$, where we say a quantum circuit has computed a Boolean function if its first output qubit is equal to the value of the Boolean function with high probability. Finally, in \Cref{lem:countupper} we observe that the maximum number of Boolean functions that can be computed (to constant error) by the class of quantum circuits with $G$ arbitrary non-local $2$-qubit gates from any (possibly infinite) gate set is exponential in ${\widetilde{\calO}}(G\log n)$. Since we want this class of circuits to be able to simulate all piecewise constant bounded 1D Hamiltonians for time $T$, we must have $G = {\widetilde{\Omega}}(Tn)$. \begin{lemma} \label{lem:circuittoHamiltonian} Let $U$ be a depth-$T$ quantum circuit on $n$ qubits that uses local $2$-qubit gates from any gate set. Then there exists a piecewise constant bounded 1D Hamiltonian $H(t)$ such that the time evolution due to $H(t)$ for time $T$ exactly equals $U$. \end{lemma} \begin{proof} We first prove the claim for a depth-$1$ quantum circuit. This yields a Hamiltonian $H(t)$ that is defined for $t\in[0,1]$, whose time evolution for unit time equals the given depth-$1$ circuit. Then we can apply the same argument to each layer of the circuit, obtaining Hamiltonians valid for times $t\in[1,2]$, and so on, until $t\in[T-1,T]$. This yields a Hamiltonian $H(t)$ defined for all time $t\in[0,T]$ whose time evolution for time $T$ equals the given unitary. If the individual terms in a given time interval have bounded spectral norm, then so will the Hamiltonian defined for the full time duration. For a depth $1$ circuit with local $2$-qubit gates, since the gates act on disjoint qubits we only need to solve the problem for one $2$-qubit unitary and sum the resulting Hamiltonians. Consider a unitary $U_j$ that acts on qubits $j$ and $j+1$. By choosing $H_j = i \log U_j$, we can ensure that $e^{-iH_j} = U_j$ and $\norm{H_j} = {{O}}(1)$. The overall Hamiltonian is now piecewise constant with $T$ time slices. \end{proof} Note that it also possible to use a similar construction to obtain a Hamiltonian that is continuous (instead of being piecewise constant) with a constant upper bound on the norm of the first derivative of the Hamiltonian. \begin{lemma} \label{lem:countlower} For any integers $n$ and $T$ such that $1 \le n \leq T \leq 2^n$, the number of distinct Boolean functions $f:\{0,1\}^n\to \{0,1\}$ that can be computed by depth-$T$ quantum circuits on $n$ qubits that use local $2$-qubit gates from a finite gate set is at least $2^{{\widetilde{\Omega}}(Tn)}$. \end{lemma} \begin{proof} We first divide the $n$ qubits into groups of $k=\log_2 T$ qubits, which is possible since $T \leq 2^n$. On these $k$ qubits, we will show that it is possible to compute $2^{{\widetilde{\Omega}}(T)}$ distinct Boolean functions with a depth $T$ circuit that uses local $2$-qubit gates. One way to do this is to consider all Boolean functions on $k'<k$ bits. Any Boolean function $f_x$ that evaluates to $f_x(x)=1$ on exactly one input $x$ of size $k'$ can be computed with a circuit of ${\widetilde{\calO}}(k')$ gates and ${\widetilde{\calO}}(k')$ depth using only $2$-qubit gates and $1$ ancilla qubit in addition to one output qubit~\cite[Corollary 7.4]{BBC+95}. An arbitrary Boolean function $f:\{0,1\}^{k'} \to \{ 0,1\}$ is a sum of such functions: $f = \sum_{x \in f^{-1}(1)} f_x = \bigoplus_{x \in f^{-1}(1)} f_x$. Implementing all $f_x$ for $x \in f^{-1}(1)$ in serial using a common output qubit, we obtain a circuit for the full function $f$. Since $f^{-1}(1)$ consists at most $2^{k'}$ bit strings, this will yield a circuit of size ${\widetilde{\calO}}(2^{k'})$ and depth ${\widetilde{\calO}}(2^{k'})$. Making all the gates local using SWAP gates does not change these expressions by more than a log factor in the exponent. By choosing $k' = k - \Theta(\log k)$, we can compute all Boolean functions on $k'$ bits with depth at most $T$. Since there are $2^{2^{k'}} = 2^{{\widetilde{\Omega}}(T)}$ distinct Boolean functions on $k'$ bits, we have shown that circuits with depth $T$ using $k=\log_2 T$ qubits can compute at least $2^{{\widetilde{\Omega}}(T)}$ distinct Boolean functions. We can compute $2^{{\widetilde{\Omega}}(T)}$ distinct Boolean functions on each of the $n/k$ blocks of $k$ qubits to obtain $(2^{{\widetilde{\Omega}}(T)})^{n/k} = 2^{{\widetilde{\Omega}}(Tn)}$ distinct Boolean functions with $n/k$ outputs. I.e., we have computed a function $\{0,1\}^n \to \{0,1\}^{n/k}$. Since we want to obtain a single-output Boolean function, as the overall goal is to prove lower bounds against simulation algorithms correct on local measurements, we combine these Boolean functions into one. We do this by computing the parity of all the outputs of these $n/k$ Boolean functions using CNOT gates. Computing the parity uses at most $n$ 2-qubit local gates and has depth $n$. The circuit now has depth $T + n \leq 2T$ and by rescaling $T$ we can make this circuit have depth $T$, while retaining the lower bound of $2^{{\widetilde{\Omega}}(Tn)}$ distinct Boolean functions. Unfortunately, after taking the parity of these $n/k$ functions, it is not true that the resulting functions are all distinct. For example, the parity of functions $f(x)$ and $g(y)$ is a new function $f(x) \oplus g(y)$, which also happens to be the parity of the functions $\neg f(x)$ and $\neg g(y)$. To avoid this overcounting of functions, we do not use all possible functions on $k'$ bits in the argument above, but only all those functions that map the all-zeros input to 0. This only halves the total number of functions, which does not change the asymptotic expressions above. With this additional constraint, it is easy to see that if $f(x) \oplus g(y) = f'(x) \oplus g'(y)$, this implies that $f$ and $f'$ are the same, by fixing $y$ to be the all-zeros input, and similarly that $g$ and $g'$ are the same. \end{proof} We say a quantum circuit $U$ computes a Boolean function $f:\{0,1\}^n\to\{0,1\}$ with high probability if measuring the first output qubit of $U|x_1x_2\cdots x_n0\cdots 0\rangle$ yields $f(x)$ with probability at least $2/3$. \begin{lemma} \label{lem:countupper} The number of Boolean functions $f:\{0,1\}^n\to \{0,1\}$ that can be computed with high probability by quantum circuits with unlimited ancilla qubits using $G$ non-local $2$-qubit gates from any gate set is at most $2^{{\widetilde{\calO}}(G\log n)}$. \end{lemma} \begin{proof} First we note that if a circuit $U$ with $G$ arbitrary $2$-qubit gates from any gate set computes a Boolean function with probability at least $2/3$, then there is another circuit with ${\widetilde{\calO}}(G)$ gates from a finite 2-qubit non-local gate set that computes the same function with probability at least $2/3$. We do this by first boosting the success probability of the original circuit using an ancilla qubit to a constant larger than $2/3$ and then invoking the Solovay--Kitaev theorem \cite{NC00} to approximate each gate in this circuit to error ${{O}}(1/G)$ with a circuit from a finite gate set of $2$-qubit gates. This increases the circuit size to ${\widetilde{\calO}}(G)$ gates. Since each gate has error ${{O}}(1/G)$, the overall error is only a constant, and the new circuit approximates computes the Boolean function $f$ with high probability. We now have to show that the number of Boolean functions on $n$ bits computed by a circuit with ${\widetilde{\calO}}(G)$ non-local 2-qubit gates from a finite gate set is at most $2^{{\widetilde{\calO}}(G\log n)}$. To do so, we simply show that the total number of distinct circuits with ${\widetilde{\calO}}(G)$ non-local 2-qubit gates from a finite gate set is at most $2^{{\widetilde{\calO}}(G \log n)}$. First observe that a circuit with ${\widetilde{\calO}}(G)$ gates can only use ${\widetilde{\calO}}(G)$ ancilla qubits, since each $2$-qubit gate can interact with at most 2 new ancilla qubits. Furthermore, the depth of a circuit cannot be larger than the number of gates in the circuit. Let us now upper bound the total number of quantum circuits of this form. Each such circuit can be specified by listing the location of each gate and which gate it is from the finite gate set. Specifiying the latter only needs a constant number of bits since the gate set is finite, and the location can be specified using the gate's depth, and the labels of the two qubits it acts on. The depth only requires ${{O}}(\log G)$ bits to specify, and since there are at most $n+{\widetilde{\calO}}(G)$ qubits, this only needs ${{O}}(\log n + \log G)$ bits to specify. In total, since there are ${\widetilde{\calO}}(G)$ gates, the entire circuit can be specified with ${\widetilde{\calO}}(G\log n)$ bits. Finally, since any such circuit can be specified with ${\widetilde{\calO}}(G\log n)$ bits, there can only be $2^{{\widetilde{\calO}}(G \log n)}$ such circuits. \end{proof} \begin{proof}[Proof of \protect{\Cref{thm:lowerboundlocal}}] Suppose that any piecewise constant bounded 1D Hamiltonian on $n$ qubits can be simulated for time $T$ using $G$ 2-qubit non-local gates from any (possibly infinite) gate set. Then using \Cref{lem:circuittoHamiltonian} and \Cref{lem:countlower}, we can compute at least $2^{{\widetilde{\Omega}}(Tn)}$ distinct Boolean functions using such Hamiltonians. By assumption, each of these Boolean functions can be approximately computed by a circuit with $G$ gates. Now invoking \Cref{lem:countupper}, we know that such circuits can compute at most $2^{{\widetilde{\calO}}(G\log n)}$ $n$-bit Boolean functions. Hence we must have $G\log n = {\widetilde{\Omega}}(Tn)$, which yields $G = {\widetilde{\Omega}}(Tn)$. The proof for $T\leq n$ follows in a black-box manner from the first part of the theorem statement by only using $T$ out of the $n$ available qubits. In this case the first part of the theorem applies and yields a lower bound of ${\widetilde{\Omega}}(T^2)$. \end{proof} We now prove \Cref{thm:lowerboundgeneral}, which follows a similar outline. The first step is identical, and we can reuse \Cref{lem:circuittoHamiltonian}. For the next step, instead of counting distinct Boolean functions, we count the total number of ``distinct'' unitaries. Unlike Boolean functions on $n$ bits, there are infinitely many unitaries on $n$ qubits. Hence we count unitaries that are ``distinguishable.'' Formally, we say $U$ and $V$ are distinguishable if they are some constant, say $0.1$ for concreteness, apart in diamond norm. This is equivalent to the existence of a state $|\psi\rangle$ such that $U|\psi\rangle$ and $V|\psi\rangle$ have trace distance $0.1$. In \Cref{lem:Ucountlower} we show that the number of distinguishable unitaries computed by quantum circuits on $n$ qubits with depth $T$ is exponential in ${\widetilde{\Omega}}(Tn)$. As before, we then show that the maximum number of distinguishable unitaries that can be computed (to constant error) by the class of quantum circuits with $G$ arbitrary non-local $2$-qubit gates from any (possibly infinite) gate set is exponential in ${\widetilde{\calO}}(G\log n)$. \begin{lemma} \label{lem:Ucountlower} For any integer $n$ and integer $n\leq T \leq 4^n$, there exists a set of unitaries of size $2^{{\widetilde{\Omega}}(Tn)}$, such that every unitary in the set can be computed by a depth-$T$ quantum circuit on $n$ qubits that uses local $2$-qubit gates from a finite gate set, and the diamond norm distance between any $U \neq V$ from this set is at least $0.1$. \end{lemma} \begin{proof} We divide the $n$ qubits into groups of $k=\log_4 T$ qubits, which is possible since $T \leq 4^n$. On these $k$ qubits, we will compute $2^{{\widetilde{\Omega}}(T)}$ distinguishable unitaries (i.e., unitaries that are at least distance $0.1$ apart from each other) with a depth $T$ circuit that uses local $2$-qubit gates. We can do this by considering a maximal set of unitaries on $k'$ qubits that is distinguishable. More precisely, on $k'$ qubits there exist $2^{\Omega(4^{k'})}$ unitaries such that each pair of unitaries is at least distance $0.1$ apart; see e.g.~\cite{Szarek1997}. (This follows from the fact that in the group of $d \times d$ unitaries with metric induced by operator norm, a ball of radius $0.1$ has volume exponentially small in $d^2$.) We know that any unitary on $k'$ qubits can be exactly written as a product of ${\widetilde{\calO}}(4^{k'})$ arbitrary 2-qubit gates~\cite{BBC+95,Kni95}. Making these gates local and from a finite gate set only adds polynomial factors in $k'$. By choosing $k' = k - \Theta(\log k)$, we can compute this set of $2^\Omega(4^{k'}) = 2^{{\widetilde{\Omega}}(T)}$ distinguishable unitaries with depth at most $T$. Since we can compute $2^{{\widetilde{\Omega}}(T)}$ pairwise-distant unitaries on each of the $n/k$ blocks of $k$ qubits, we can compute $(2^{{\widetilde{\Omega}}(T)})^{n/k} = 2^{{\widetilde{\Omega}}(Tn)}$ unitaries on all $n$ qubits by considering all possible combinations of unitaries on the different blocks. Finally, if $U$ and $V$ are distinguishable, then so are $U \otimes X$ and $V \otimes Y$, since the distinguisher can simply ignore the second register. \end{proof} \begin{lemma} \label{lem:Ucountupper} Let $S$ be a set of distinguishable unitaries (i.e., the diamond norm distance between any $U \neq V$ from this set is at least $0.1$). Then if any unitary in $S$ can be computed by a quantum circuit with $G$ non-local $2$-qubit gates from any gate set, then $|S| = 2^{{\widetilde{\calO}}(G\log n)}$. \end{lemma} \begin{proof} This proof is essentially the same as that of \Cref{lem:countupper}. We first observe that if a circuit over an arbitrary gate set computes a unitary $U$, we can approximate it to error less than $0.04$ using the Solovay--Kitaev theorem and increase the circuit size to ${\widetilde{\calO}}(G)$ gates. Importantly, since the unitaries are a distance $0.1$ apart, one circuit cannot simultaneously approximate two different unitaries to error $0.04$. Then exactly the same counting argument as in \Cref{lem:countupper} shows there can only be $2^{{\widetilde{\calO}}(G \log n)}$ such circuits. \end{proof} \begin{proof}[Proof of \protect{\Cref{thm:lowerboundgeneral}}] Suppose that any piecewise constant bounded local Hamiltonian on $n$-qubits could be simulated for time $T$ using $G$ 2-qubit non-local gates from any (possibly infinite) gate set. Then using \Cref{lem:circuittoHamiltonian} and \Cref{lem:Ucountlower}, we can produce a set $S$ of distinguishable unitaries of size $2^{{\widetilde{\Omega}}(Tn)}$. By assumption, each of these unitaries can be approximately computed by a circuit with $G$ non-local 4-qubit gates. Now invoking \Cref{lem:countupper}, we know that such circuits can approximate at most $2^{{\widetilde{\calO}}(G\log n)}$ distinguishable unitaries on $n$ qubits. Hence we must have $G\log n = {\widetilde{\Omega}}(Tn)$, which yields $G = {\widetilde{\Omega}}(Tn)$. \end{proof} \section{Discussion} We have only analyzed local Hamiltonians on (hyper)cubic lattices embedded in some Euclidean space, but Lieb-Robinson bounds with exponential dependence on the separation distance hold more generally. However, on more general graphs, it may be more difficult to find an appropriate decomposition that gives a small error; this must be analyzed for each graph. One advantage of the method here is that the accuracy improves for smaller Lieb-Robinson velocity. This can occur if the terms in the Hamiltonian have a small commutator (see Appendix). The decomposition based on Lieb-Robinson bounds looks very similar to higher order Lie-Trotter-Suzuki formulas. The difference is in the fact that the overlap is chosen to be larger and larger (though very slowly) as the simulated spacetime volume increases. If we want an algorithm that does not use any ancilla qubits, similar to algorithms based on Lie-Trotter-Suzuki formulas, then we can simulate the small blocks from Lieb-Robinson bounds by high order Suzuki formulas~\cite{Suzuki1991,BAC+07} where the accuracy dependence is polynomial (power-law) of arbitrarily small exponent $a >0$. This combination results in an algorithm of total gate complexity $O(Tn(Tn/\epsilon)^a)$, similar to what is claimed to be achievable in Ref.~\cite[Sec.~4.3]{JordanLeePreskill2014}. Application to fermions is straightforward but worth mentioning. Since Hamiltonian terms always have fermion parity even, Lieb-Robinson bounds hold without any change. Given the block decomposition based on the Lieb-Robinson bound, we should implement each small blocks in $\polylog(Tn/\epsilon)$ gates. The Jordan-Wigner transformation, a representation of Clifford algebra, is a first method one may consider: \begin{align} \gamma_{2j-1} &\mapsto \sigma^z_1 \otimes \cdots \otimes \sigma^z_{j-1} \otimes \sigma^x_j,\\ \gamma_{2j} &\mapsto \sigma^z_1 \otimes \cdots \otimes \sigma^z_{j-1} \otimes \sigma^y_j, \end{align} where $\gamma_{2j-1},\gamma_{2j}$ are Majorana (real) fermion operators, and the right-hand side is a tensor product of Pauli matrices. Often, the tensor factor of $\sigma^z$ preceding $\sigma^x$ or $\sigma^y$ is called a {\it Jordan-Wigner string}. In one spatial dimension, the above representation where the ordering of $\gamma$ is the same as the chain's direction gives a local qubit Hamiltonian, since in any term Jordan-Wigner strings cancel. The ordering of fermions is thus very important. (Under periodic boundary conditions, at most one block may be nonlocal; however, we can circumvent the problem by regarding the periodic chain, a circle, as a double line of finite length whose end points are glued: $ \big( [-1,+1] \times \{\uparrow,\downarrow\} \big) / \{ (-1,\uparrow) \equiv (-1,\downarrow), (+1,\uparrow) \equiv (+1,\downarrow)\} $. This trick doubles the density of qubits in the system, but is applicable in any dimensions for periodic boundary conditions.) In higher dimensions with fermions, a naive ordering of fermion operators turns most of the small blocks into nonlocal operators under the Jordan-Wigner transformation. However, fortunately, there is a way to get around this, at a modest cost, by introducing auxiliary fermions and let them mediate the interaction of a target Hamiltonian~\cite{Verstraete2005}. The auxiliary fermions are ``frozen,'' during the entire simulation, by an auxiliary Hamiltonian that commutes with the target Hamiltonian. With a specific ordering for the fermions, one can represent all the new interaction terms as local qubit operators. The key is that if $c_j c_k$ is a fermion coupling whose Jordan-Wigner strings do not cancel, we instead simulate $c_j c_k \gamma_1 \gamma_2$, where $\gamma_{1,2}$ are auxiliary, such that the Jordan-Wigner strings of $\gamma_1,\gamma_2$ cancel those of $c_j,c_k$, respectively. The auxiliary $\gamma$'s may be ``reused'' for other interaction terms if the interaction term involves fermions that are close in a given ordering of fermions. (Ref.~\cite{Verstraete2005} explains the manipulation for quadratic terms but it is straightforward that any higher order terms can be treated similarly. They also manipulate the Hamiltonian for the auxiliary $\gamma$ to make it local after Jordan-Wigner transformation, but for our simulation purposes it suffices to initialize the corresponding auxiliary qubits.) In this approach, if we insert ${{O}}(1)$ auxiliary fermion per fermion in the target system, the gate and depth complexity is the same as if there were no fermions. Note that we can make the density of auxiliary fermions arbitrarily small by increasing the simulation complexity. Divide the system with non-overlapping blocks of diameter $\ell$, which is e.g. ${{O}}(\log n)$, that form a hypercubic lattice. (These blocks have nothing to do with our decomposition by Lieb-Robinson bounds.) Put ${{O}}(1)$ auxiliary fermions per block, and order all the fermions lexicographically so that all the fermions in a block be within a consecutive segment of length ${{O}}(\ell^D)$ in the ordering. Interaction terms within a block have Jordan-Wigner string of length at most ${{O}}(\ell^D)$, and so do the inter-block terms using the prescription of \cite{Verstraete2005}. The gate and depth complexity of this modified approach has $\mathrm{poly}(\ell)$ overhead.
\section{Introduction} The chemical substance calcium titanate CaTiO$_3$ was reported first in 1840 by Rose as the mineral perovskite \cite{Rose40} and is now the prototype of the perovskite crystal structure. Although the mineral was first reported to belong to the regular (cubic) crystal system, this assumption is wrong: at least at room temperature a $Pbnm$ structure is stable. Instead, the cubic space group $Pm\bar{3}m$ is found for CaTiO$_3$ only at high temperatures. In this phase, Ti$^{4+}$ is octahedrally coordinated by six oxygen atoms and the larger Ca$^{2+}$ is placed in the center of a regular cuboctahedron of 12 oxygen atoms. Upon cooling the TiO$_6$ octahedra become distorted and rotated which leads in a series \begin{equation} Pm\bar{3}m \xlongleftrightarrow{1523-1634\,\mathrm{K}} I4/mcm \xlongleftrightarrow{1423-\approx1523\,\mathrm{K}} Pbnm \label{eq:PTs} \end{equation} to crystal structures with lower symmetry. The transformation temperatures in equation (\ref{eq:PTs}) are reported controversially in the literature \cite{Redfern96,Ali05,Yashima09}. Kennedy et al. \cite{Kennedy99} reported an additional $Cmcm$ phase between $Pbnm$ and $I4/mcm$ that could not be confirmed by other authors. According to different authors \cite{Kaufman88,Jongejan70,DeCapitani98,FactSage7_1}, the $Pm\bar{3}m$ phase of CaTiO$_3$ melts congruently around $T_\mathrm{f}\approx2174-2262$\,K, but despite some reports \cite{Merker62} the phase transitions (\ref{eq:PTs}) result in twinned crystals during melt growth \cite{Jiang98}. The transition from the cubic to the tetragonal phase is lower for congruently melting Ba$_{1-x}$Ca$_x$TiO$_3$ ($x=0.227$) mixed crystals, but also there twinning occurs \cite{Kuper97}. It should be noted that CaTiO$_3$ is the only intermediate compound in the CaO--TiO$_2$ system that shows congruent melting. Two other intermediate compounds, both containing more CaO, undergo peritectic decomposition: Ca$_3$Ti$_2$O$_7$ melts peritectically under the formation of Ca$_4$Ti$_3$O$_{10}$ which later melts peritectically under the formation of CaTiO$_3$ \cite{Kaufman88,DeCapitani98}. These CaO-rich calcium titanates belong to a series of Ruddlesden-Popper phases \cite{Elcombe91}. In cases where crystals cannot be grown from their congruent melts, often crystallization from high temperature melt solutions provides an alternative approach \cite{Elwell75}. The growth of millimeter-sized CaTiO$_3$ crystals was reported from different melt solutions based on ingredients like KF, B$_2$O$_3$, PbF$_2$, CaCl$_2\cdot2$\,H$_2$O, BaCl$_2\cdot2$\,H$_2$O, CaF$_2$, CsF, MoO$_3$ \cite{Watts89}. However it is a drawback of all these solvents that they add foreign ions to the melts that may enter up to a few percents in the crystal structure of the solute CaTiO$_3$. In recent studies the growth of high quality SrTiO$_3$ proved possible from an excess of TiO$_2$ as solvent \cite{Guguschev14,Guguschev17b}. The eutectic temperature of SrTiO$_3$/TiO$_2$ $T_\mathrm{eut}=1722\pm3$\,K is significantly lower than the congruent melting point of SrTiO$_3$ $T_\mathrm{f}=2352\pm20$\,K. Corresponding literature data for the CaTiO$_3$/TiO$_2$ eutectic range from $T_\mathrm{eut}=1690$\,K \cite{Kaufman88} to $T_\mathrm{eut}=1726$\,K \cite{DeCapitani98}, which indicates a less significant lowering of the liquidus temperature at the eutectic composition. Good solvents are compounds that form a eutectic system with the solute, with vanishing solubility of the solvent in the solid phase of the solute \cite{Elwell75}. Besides this, the requirements for a good solvent are somewhat contradictory: On the one side, a low melting solvent results in a low $T_\mathrm{eut}$ and offers the possibility to perform the growth process at low $T$ -- possibly below the critical phase transitions (\ref{eq:PTs}). On the other side, the eutectic composition $x_\mathrm{eut}$ with a low melting solvent shifts close to the solvent, which lowers the yield of the growth process \cite{Klimm14c}. In this paper several solvents for the melt solution growth of CaTiO$_3$ crystals are tested on a thermoanalytic basis. The emphasis was on finding a solvent that allows a growth temperature below critical phase transformations, but with acceptable solubility for CaTiO$_3$. At the same time, the incorporation of foreign solvent ions should be avoided to the highest possible degree. \section{Experimental} Differential thermal analysis (DTA) with simultaneous thermogravimetry (TG) was performed using a NETZSCH STA 449C ``Jupiter'' thermal analyzer. A DTA/TG sample holder with Pt/Pt90Rh10 thermocouples and platinum crucibles allowed measurements up to 1920\,K in a flowing mixture of 20\,ml/min Ar + 20\,ml/min O$_2$. Only for the re-determination of the poorly defined melting point of pure CaTiO$_3$ (see previous section), a powder sample was melted in a NETZSCH STA 429C analyzer with W/Re thermocouples and tungsten crucibles. Usually the DTA samples were melted twice to ensure good mixing, and the second heating curves were used for further analysis. Crystal phase and lattice parameter analysis of starting materials and of annealed samples was performed by X-ray diffraction using an XRD 3003 TT (GE Inspection Technologies). Cu K$_{\alpha1}$ radiation and a Bragg-Brentano setup were used with a scintillation detector. A heating stage by MRI (Materials Research Instruments) allowed XRD analysis up to 1600\,K. The chemical composition of the grown crystals was investigated by micro X-ray fluorescence ($\mu$-XRF) measurements. The measurements were performed at low vacuum conditions (1 to 4\,mbar) using a Bruker M4 TORNADO spectrometer. The measurement system was equipped with a Rh X-ray source operated at 50\,kV and 200\,$\mu$A. Polycapillary X-ray optics were used to focus the Bremsstrahlung at the surface of the sample, which enabled a high spatial resolution of 25\,$\mu$m. The measurement time per point was set to 10\,s. The signals were detected using a circular silicon drift detector. For the accurate determination of the chemical composition, the XRF spectrometer was calibrated using a sintered CaTiO$_3$ pellet. \section{Results and Discussion} \subsection{Pure CaTiO$_3$} \label{sec:pure} The synthesis of CaTiO$_3$ powder was performed from a stoichiometric CaCO$_3$ (Fox Chemicals, 99.99\%)/TiO$_2$ (Alfa Aesar, 99.995\%) = 1:1 mixture. When this mixture is heated at 10\,K/min in the thermal analyzer, mass loss and endo\-thermal signal between $\approx1050$\,K and $\approx1200$\,K indicate the decomposition of CaCO$_3$ to CaO and CO$_2$. A subsequent sharp exothermal effect close to 1740\,K results from the reaction \begin{equation} \mathrm{CaO + TiO}_2 ~ \longrightarrow ~ \mathrm{CaTiO}_3 \qquad (\Delta H=-75.1\,\mathrm{kJ/mol\;@\;1740\,K}) \label{eq:formation} \end{equation} which proceeds without mass change. If the polycrystalline CaTiO$_3$ powder is heated repeatedly, small but reproducible endothermal peaks ($\lesssim300$\,J/mol, insert of Fig.~\ref{fig:X-ray}) around 1520\,K and 1625\,K indicate the orthorhombic/tetragonal and tetragonal/cubic phase transitions of the material (\ref{eq:PTs}). It should be noted that the latent heat for the first transition is significantly lower than reported in the FactSage database \cite{FactSage7_1}, but both values are very small compared to the heat of fusion (see below), with consequently large experimental error. The third DTA peak in Fig.~\ref{fig:X-ray} near 1723\,K coincides with the eutectic temperature between CaTiO$_3$ and TiO$_2$. One can assume that remaining inhomogeneity of the ceramic samples is responsible for this peak. The position of these DTA peaks reveals that simply working in a CaTiO$_3$--TiO$_2$ eutectic system cannot suppress the liquidus temperature below the phase transition temperatures. A series of X-ray diffraction studies between room temperature and 1573\,K demonstrated the shift of X-ray peaks to smaller diffraction angles $2\,\Theta$, resulting from thermal expansion (Fig.~\ref{fig:X-ray}). Some peaks that are separated in the orthorhombic phase merge in the tetragonal phase, resulting from the higher symmetry (e.g. 022 and 202). The melting behavior of this CaTiO$_3$ powder was investigated in the STA 429C and was compared for calibration to the melting of pure Al$_2$O$_3$ ($T_\mathrm{f}=2327$\,K, heat of fusion $\Delta H_\mathrm{f}=118.4$\,kJ/mol \cite{FactSage7_1}). From this measurement $T_\mathrm{f}=(2220\pm20)$\,K and $\Delta H_\mathrm{f}=113.3$\,kJ/mol were found for CaTiO$_3$. Even if a DTA measurement at such high temperatures gives usually only a rough estimation of $\Delta H_\mathrm{f}$ with errors of typically 20\%, this experimental value is in good agreement with FactSage \cite{FactSage7_1}, where 106.6\,kJ/mol are given. \begin{figure}[ht] \centering \includegraphics[width=0.70\textwidth]{X-ray} \caption{X-ray powder patterns of CaTiO$_3$ in the orthorhombic phase at room temperature (298\,K) and in the tetragonal phase at 1573\,K. Orthorhombic indexing for space group setting $Pbnm$ \cite{Sasaki87}. Insert: DTA curve (5\,K/min, $2^\mathrm{nd}$ heating) of polycrystalline CaTiO$_3$.} \label{fig:X-ray} \end{figure} \subsection{System CaTiO$_3$--KF} \label{sec:KF} Potassium fluoride was already successfully used for the melt solution growth of CaTiO$_3$ but has at least the drawback of high volatility which impedes long growth runs \cite{Watts89}. Besides, the molar solvent:solute ratio was 12:1, which limits significantly the yield of the crystallization process. Thus Watts et al. obtained from crucibles with 50\,ml volume starting at 1443\,K after 28 days only crystal sizes up to $2\times2\times2$\,mm$^3$ \cite{Watts89}. To understand this growth process, DTA measurements of CaTiO$_3$--KF mixtures were performed up to ca. 1220\,K. This lower $T$ limit was chosen to avoid serious evaporation of KF that would otherwise shift the composition of DTA samples. Heating curves of four KF-rich compositions are given in Fig.~\ref{fig:KF}a) and show initially the expected drop of the liquidus temperature from pure KF, that hints at a CaTiO$_3$--KF eutectic. With higher concentration of the solute, starting with $x=0.965$, an unexpected small peak appears near 1050\,K. The lowermost curve in Fig.~\ref{fig:KF}a) almost corresponds to the melt growth solution that was used by Watts et al. \cite{Watts89}, except for a small CaO excess that was used there. \begin{figure}[ht] \centering \includegraphics[width=0.98\textwidth]{KF} \caption{a) DTA curves for the $2^\mathrm{nd}$ heating of different compositions starting from pure KF with $x=n\mathrm{[KF]}/(n\mathrm{[KF]}+n\mathrm{[CaTiO_3]})=0$. Onsets of DTA peaks are given in Kelvin. b) Phase diagram CaF$_2$--KF as published by Ishaque \cite{Ishaque52}.} \label{fig:KF} \end{figure} One can suspect that an disadvantageous ion exchange reaction of the kind \begin{equation} \mathrm{CaTiO}_3 \, + \,2\,\mathrm{KF} \rightleftarrows \mathrm{CaF}_2 \, + \, \mathrm{K}_2\mathrm{TiO}_3 \label{eq:K2TiO3} \end{equation} produces some CaF$_2$ in the melt. Calcium fluoride is known to form with excess KF the perovskite type double fluoride KCaF$_3$ which is the only intermediate phase in the CaF$_2$--KF system \cite{Ishaque52,Hidaka84}. Because the publication of this system is rather old, several CaF$_2$/KF mixtures around the eutectic compositions in Fig.~\ref{fig:KF}b) were re-investigated by DTA. For the left eutectic, $(1054\pm2)$\,K, and for the right eutectic $(1328\pm3)$\,K were found which is a good confirmation of the literature data \cite{Ishaque52}. The formation of CaF$_2$ (\ref{eq:K2TiO3}) and subsequently KCaF$_3$ reduces further the already small CaTiO$_3$ assay in the melt solution, which finally limits the efficiency of the growth process. Similar disadvantageous results were obtained with a series of other typical melt solution solvents, such as BaCl$_2$, SrF$_2$, NaF, CaCl$_2$, MgF$_2$. Details on these experiments can be found in the accompanying material. \subsection{System CaTiO$_3$--CaF$_2$--TiO$_2$} \label{sec:ternary} The results of the previous section~\ref{sec:KF} showed that the application of solvents based on foreign cations (such as K$^+$) is critical because they might give rise to parasitic phases. Besides the formation of solid solutions between solvent and solute is a typical issue that was observed e.g. for growth from solutions containing PbF$_2$ where Pb$^{2+}$ substitutes partially for Ca$^{2+}$ in CaTiO$_3$ \cite{Watts89}. In a series of DTA measurements the pseudobinary system CaTiO$_3$--CaF$_2$ was investigated up to 1723\,K and it was found to be eutectic. Fig.~\ref{fig:CaF2}a) shows that the liquidus drops from the melting point of pure CaF$_2$ ($T_\mathrm{f}=(1692\pm3)$\,K) to $T_\mathrm{eut}=(1654\pm3)$\,K which is reached at $x_\mathrm{eut}\approx0.9$ CaF$_2$. The isotherm at 1424\,K marks the $\alpha/\beta$ transition of CaF$_2$ which has, however, only a marginal thermal effect \cite{Mirwald78}. $T_\mathrm{eut}$ is 29\,K higher than the highest \textit{t/c} transition of CaTiO$_3$. For samples $x\lesssim x_\mathrm{eut}$, the liquidus temperature can be exceeded during the DTA measurements and during cooling rectangular crystallites with dimensions $\leq0.5$\,mm are formed. Their surfaces, however, are concave stepped and microscopic inspection shows typical flaws resulting from phase transitions that occurred after crystallization. \begin{figure}[ht] \centering \includegraphics[width=0.98\textwidth]{CaF2} \caption{a) Experimental points and thermodynamic assessment \cite{FactSage7_1} of the CaF$_2$--CaTiO$_3$ system. The insert shows the DTA crucible after measuring an almost eutectic ($x\approx0.9$) sample with CaTiO$_3$ crystallites. b) Experimental points and thermodynamic assessment of the CaF$_2$--TiO$_2$ system. The insert shows the DTA crucible after measuring a sample $x\approx0.6$ with TiO$_2$ (rutile) needles.} \label{fig:CaF2} \end{figure} It was mentioned in the introduction that for SrTiO$_3$ the growth temperature could be lowered substantially using melt compositions that are close to the SrTiO$_3$/TiO$_2$ eutectic. Because the corresponding reduction of the liquidus temperature is insufficient for the growth of CaTiO$_3$, it seemed worthwhile to study a combination of CaF$_2$ and TiO$_2$ as prospective solvent. In a first step, the pseudobinary system CaF$_2$--TiO$_2$ had to be investigated. Hillert \cite{Hillert65} published a CaF$_2$--TiO$_2$ phase diagram based on annealing experiments and found it to be eutectic with a monotectic miscibility gap in the liquid. In his study $x_\mathrm{eut}$ is almost in the middle of the system, on the TiO$_2$-rich side of the monotectic. Fig.~\ref{fig:CaF2}b) shows the present DTA results that are contradictory: The monotectic line at $T=1623$\,K extends to the TiO$_2$ side of the system and $x_\mathrm{eut}$ is CaF$_2$-rich. Besides, both isothermal lines are significantly lower in the present study: $T_\mathrm{eut}=(1584\pm2)$\,K rather than 1633\,K \cite{Hillert65}, and monotectic demixing at $(1623\pm3)$\,K rather than 1638\,K \cite{Hillert65}. One can expect as a result of the opposite position of $x_\mathrm{eut}$ that the stable form of solid TiO$_2$ (tetragonal rutile) has a wide range of primary crystallization in the phase diagram. Indeed, visual inspection of DTA samples with $0.4\leq x\leq0.7$ showed dark rutile needles at the melt surface. One example is shown in the insert of Fig.~\ref{fig:CaF2}b). The eutectic temperature in Fig.~\ref{fig:CaF2}b) is 41\,K below the tetragonal/cubic transition of CaTiO$_3$ that was measured in section~\ref{sec:pure}. This raises the hope that a mixture of CaF$_2$ and TiO$_2$ could be used as a solvent from which CaTiO$_3$ can be crystallized at least below that transition. In a series of DTA measurements, to samples starting from ``pure solvent'' 0.75\,CaF$_2$ + 0.25\,TiO$_2$ (set to $x'=1$), increasing amounts of CaTiO$_3$ were added up to \[x'=\frac{n(0.75\,\mathrm{CaF}_2+0.25\,\mathrm{TiO}_2)}{n{(0.75\,\mathrm{CaF}_2+0.25\,\mathrm{TiO}_2)+n(\mathrm{CaTiO}_3)}}=0.79 \] ($n$ -- corresponding molar quantities). The experimental results of this study, together with published data on the CaO--TiO$_2$ binary, allowed the construction of the concentration triangle CaTiO$_3$--CaF$_2$--TiO$_2$ that is shown in Fig.~\ref{fig:ternary}. \begin{figure}[ht] \centering \includegraphics[width=0.60\textwidth]{ternary} \caption{Liquidus projection on the CaTiO$_3$--CaF$_2$--TiO$_2$ ternary system with 20\,K difference between isotherms. The red arrow at the bottom marks the solvent composition $x'=0.75$\,CaF$_2$ + 0.25\,TiO$_2$.} \label{fig:ternary} \end{figure} To calculate this graph, data for the solids CaTiO$_3$ (cub, tet, ort), CaF$_2$ ($\alpha$-, $\beta$-), and TiO$_2$ were taken from the FactSage \cite{FactSage7_1} databases if possible. A sufficient model for the excess Gibbs free energy of the melt was found by Redlich-Kister \cite{Redlich48} polynomials for the binaries \begin{equation} G^\mathrm{ex} = \sum_{i=0}^n ~^i\!L_\mathrm{AB} \, x_\mathrm{A} \, x_\mathrm{B} (x_\mathrm{A}-x_\mathrm{B})^i \label{eq:G_ex} \end{equation} with parameters $^i\!L_\mathrm{AB}$ that are given in Table~\ref{tab:Parameter}. It should be noted that these parameters were not the subject of a detailed numerical assessment, because insufficient experimental data were available, especially inside the ternary region. Nevertheless a reasonable description of all DTA results was possible on this basis even without using additional ternary interaction parameters. \begin{table}[ht] \centering \begin{tabular}{lrrrr} System & $i=0$ & $i=1$ & $i=2$ & $i=8$ \\ \hline $L$(CaTiO$_3$--CaF$_2$) & -3000 & -10000 & 10000 & 8000 \\ $L$(CaF$_2$--TiO$_2$) & 11500 & 20500 & -16000 & -- \\ $L$(CaTiO$_3$--TiO$_2$) & -19500 & -- & -- & -- \\ \hline \end{tabular} \caption{Redlich-Kister \cite{Redlich48} parameters $^i\!L_\mathrm{AB}$ for binary interactions in the liquid phase (\ref{eq:G_ex}).} \label{tab:Parameter} \end{table} As expected, the cubic modification of CaTiO$_3$ crystallizes from melt compositions that are close to this corner of the concentration triangle Fig.~\ref{fig:ternary}. The insert of Fig.~\ref{fig:CaF2}a) showed already that primary crystallization of this phase results in distorted crystallites because they undergo a critical phase transition upon cooling. Below the bold gray isotherm, however, CaTiO$_3$(tet) crystallizes first, and the insert of Fig.~\ref{fig:CaF2}b) showed that such crystallites are less prone to distortions. This primary crystallization field of CaTiO$_3$(tet) is partially covered by a phase field where demixing of the melt occurs. Fig.~\ref{fig:CaF2}b) shows that also there the system is completely molten for $T>1623$\,K which is sufficient to prevent crystallization of CaTiO$_3$(cub). Indeed, the DTA samples with compositions inside the primary crystallization field of CaTiO$_3$(tet) contained small ($\leq0.5$\,mm) CaTiO$_3$ crystallites that were free of distortions. \begin{figure}[ht] \centering \includegraphics[width=0.40\textwidth]{X-tal} \caption{First CaTiO$_3$ crystals obtained by unseeded growth in a 30\,ml crucible. The starting composition is marked by a red dot in Fig.~\ref{fig:ternary}.} \label{fig:X-tal} \end{figure} In a first unseeded crystal growth experiment similar conditions were checked on a larger scale. A 30\,ml Pt crucible (diameter 40\,mm, height 35\,mm) was filled with 15.62\,g of a 3:1:1 (molar) mixture of CaF$_2$, TiO$_2$ and CaTiO$_3$ powders, and was covered by a Pt lid. In a muffle furnace the crucible was heated at 5\,K/min to 1673\,K and held there 3\,h for homogenization. Then the crucible was cooled at a rate of 4\,K/h to 1073\,K where the heating power was switched off. Fig.~\ref{fig:X-tal} shows a photograph of the crucible after this process, together with the magnification of one of the crystals that could be found in the solidified melt. These crystals are located in the vicinity of the crucible wall. Most of them are cubes or cuboids with edge length up to 2.5\,mm; all of them are free of the flaws that were found in crystals grown at higher temperature. Even if the crystals are clear, they exhibit a bright brown coloring. X-ray fluorescence analysis revealed a stoichiometric composition since, within the range of typical measurement uncertainties, no significant differences from the sintered standard pellet were detected. It turned out, unfortunately, that it is very difficult to remove crystals from the melt body. \section{Discussion and Conclusions} It could be shown that a combination of TiO$_2$ and CaF$_2$ represents a suitable solvent for solution growth of CaTiO$_3$ crystals. This combination has the benefit that foreign cations are completely omitted, and F$^-$ is the only foreign ion at all. A molar ratio solute (CaTiO$_3$) to solvent (CaF$_2$+TiO$_2$) of 1:4 can be used for the growth process which is considerably better than for other solvents such as KF (see section~\ref{sec:KF}) were the ratio is in the order of 1:12. Melts with high concentrations of CaF$_2$ and TiO$_2$ exhibit a monotectic miscibility gap, which is shown near the bottom line of the concentration triangle in Fig.~\ref{fig:ternary}, or for the CaF$_2$--TiO$_2$ system without CaTiO$_3$ in Fig.~\ref{fig:CaF2}b, respectively. The corresponding ``\textit{liq$_1$+liq$_2$}'' phase fields are beneficial for crystal growth from melt solution, because they reduce significantly the temperature where the first precipitation of a solid phase from the melt(s) occurs. In Fig.~\ref{fig:CaF2}b already for $x\geq0.4$ the whole system is liquid above 1623\,K. This would not be the case if the system were simply eutectic, because the melting point of TiO$_2$ is rather high. \begin{figure}[ht] \centering \includegraphics[width=0.50\textwidth]{demixing} \caption{Gibbs energy reduction $\Delta G=G^\mathrm{demixed}-G^\mathrm{mixed}$ of melts with composition $x$\,CaF$_2+(1-x)$\,TiO$_2$ in the vicinity of the ``$liq_1+liq_2$'' phase field of Fig.~\ref{fig:CaF2}b) for different temperatures.} \label{fig:demixing} \end{figure} A positive (repulsive) excess Gibbs free energy contribution $\Delta G$ which can be described by the parameters in Table~\ref{tab:Parameter} is the origin of the miscibility gap. The total amount of this ``demixing'' contribution to $G^\mathrm{ex}$ is shown in Fig.~\ref{fig:demixing} and exceeds never 200\,J/mol which is so small, that an experimental detection by normal DTA measurements at high $T\geq1600$\,K is difficult. According to the experimental data that are presented here, the positive $\Delta G$ shrinks as to expected with $T$ and disappears at $T\approx2075$\,K. The inflection points which are marked by symbols in the $\Delta G(x)$ functions in Fig.~\ref{fig:demixing} mark the points where spinodal decomposition of the melt occurs. The outer symbols on the curves mark the equilibrium concentration where demixing begins at the corresponding temperature. From the thermodynamic dataset that was used for the calculation of Fig.~\ref{fig:ternary} the ternary eutectic point between CaTiO$_3$, CaF$_2$ and TiO$_2$ is at $T_\mathrm{eut}=1522$\,K and just 8\,K below the tetragonal/orthorhombic phase transition of CaTiO$_3$ which comes out in this calculation at 1530\,K. The minor CaTiO$_3$(ortho) phase field is, however, not labeled in this figure because it is very small and hard to recognize. So far it cannot be decided if the growth process that led to the crystals shown in Fig.~\ref{fig:X-tal} were crystallized in the tetragonal phase and transformed to the room temperature orthorhombic phase without distortion, or if they crystallized directly in the stable orthorhombic phase. Possibly also crystallization inside the CaTiO$_3$(tet) phase field could lead to the immediate crystallization of CaTiO$_3$(ort), if supercooling occurs. Severe supercooling is known to be a common phenomenon during oxide crystal growth, including titanates \cite{Wanklyn84b,Nabokin03}. \section*{Acknowledgements} The authors are grateful to Albert Kwasniewski for performing X-ray measurements. We thank Detlev Schulz for reading the manuscript. \section*{References}
\section{Introduction} Recent discovery of a Higgs-like boson at the LHC \cite{ATLAS12,CMS12} completes the standard model (SM) as a renormalizable theory, and its observed mass $M_h = 125.9 \pm 0.4$ GeV validates the perturbativity of weak interactions in the model \cite{Lee77}. In the SM, a scalar mass receives additive quantum corrections proportional to the momentum cut-off squared, $\Lambda^2$ at one-loop level. This quadratically divergent one-loop correction to the Higgs mass was first calculated by Veltman \cite{Veltman81}, and given by \begin{equation} \label{eq:1loophiggsmass} \delta M_h^2 = \frac{3\Lambda^2}{16\pi^2v_h^2} \left(M_h^2 + 2M_W^2 + M_Z^2 -4m_t^2\right), \end{equation} where $v_h$ is the vacuum expectation value (VEV) of the Higgs field and only the dominant contribution is shown in the scale $\Lambda$. If $\Lambda$ is very large, the Higgs mass suffers from the quadratic divergence of this correction, which addresses the naturalness issue of the theory resulting in the fine-tuning problem \cite{Susskind79}. Since the cut-off scale $\Lambda$ is considered to be UV boundary of the SM \cite{Georgi74}, it would be more natural that the cancellation of the quadratic divergences could be achieved by means of a symmetry principle at higher scales rather than by fine-tuning of mathematically supplemented counterterms. There have been various extensions of the SM to resolve the fine-tuning (or the hierarchy) problem of the Higgs mass by canceling the quadratic divergences such as the supersymmetry (SUSY) and the little Higgs model (LHM). However no compelling sign of evidence for new physics (NP) beyond the SM has been found at the LHC. Veltman has suggested the cancellation of the quadratic divergence of the Eq. (\ref{eq:1loophiggsmass}) by itself leading to the prediction of the Higgs mass, which is called the Veltman condition (VC). It might imply the existence of some hidden symmetry though the underlying theory is unknown. The simple VC predicted $M_h \sim 320$ GeV with the known particle masses at present ,and does not hold in the SM with the present measured value $M_h \sim 125$ GeV. In order to impose the VC to the Higgs mass, required are some new degrees of freedom which interact with the Higgs boson to contribute to the Higgs self-energy diagram \cite{Gunion08}. Simple extensions of the SM resolving the fine-tuning problem by applying the VC have been studied widely in many literatures \cite{Grzadkowski09,Pivovarov08, Masina13, Karahan14,Demir15}. Besides the fine-tuning issue, there are other motivations to search for the NP beyond the SM. One of the most important motivation is the existence of the distinct observational evidence for dark matter (DM). Thus many viable DM candidates have been suggested in various NP models at present. In order to include DM in the SM framework, we should assume the existence of additional degrees of freedom. Since any SM particle cannot be DM, DM itself should be a new degree of freedom, and new particles or new interactions are also required to connect the DM and the SM sector. In the Higgs portal model for the DM, only the Higgs quadratic term takes part in interacting with the new degrees of freedom. Thus the Higgs portal model can provide both of the DM and the interaction of new degrees of freedom with the Higgs boson to satisfy the VC for the Higgs mass. Recently there has been some efforts to investigate a possibility to explain the fine-tuning of the Higgs mass through the VC in the Higgs portal model for the dark matter. One of the simplest extension to satisfy the VC is to introduce only one new scalar to cancel the dominant top contribution in Eq. (\ref{eq:1loophiggsmass}) \cite{Karahan14,Demir15}. New scalar degrees of freedom for ameliorating the fine-tuning problem could be DM candidates in itself interacting with the SM sector through Higgs portal with a discrete $Z_2$ symmetry \cite{Drozd12}. However, a new quadratic divergence to the new scalar DM mass arises in this minimal model and we have to resolve it as well. For instance, we may introduce additional vector-like fermions to cancel the new quadratic divergence and to protect the masses of the Higgs boson and the new scalar DM simultaneously \cite{Chakraborty13}. Alternatively we consider the Higgs portal model with the singlet fermionic dark matter as a more general scenario in this paper since this model was first introduced by our earlier studies \cite{Lee07}. In this model, we have a Dirac fermion and a real scalar, which are both the SM gauge singlets. If we assign no $Z_2$ symmetry, the singlet scalar cannot be a DM since it would decay into the SM sector through mixing. Thus the DM is the singlet fermion in this model. We impose the VC on the quadratic divergences of both scalar masses of the SM-like Higgs boson and the singlet scalar in our model. Under the VC, we still find the allowed parameter space where the singlet fermion satisfies the observed relic density constraints to be the DM candidates. It implies that our model of the DM provides the improved naturalness at least at one-loop level. Since the VC is a very strong condition to fix the Higgs-scalar coupling $\lambda_2$ to a specific value, only the limited parameter sets are allowed. Also explored is the direct detections of the singlet fermion through the DM-nucleon scattering under the VC and the prospect of observation of the DM in the future is discussed in this paper. All the analyses are performed with the up-to-date cosmological data without applying the VC as well in order to clearly see the implication of the VC constraints and also for the general DM study as a reference. This model might provide richer phenomenology especially in the studies of the electroweak phase transition responsible for the baryon asymmetry in the early universe \cite{PMS}. This paper is organized as follows. In Sec. II, we briefly review our model and summarize the model parameters. We discuss the VCs for the scalar masses in Sec. III and constraints from the measurements of Higgs decays in Sec. IV. Studied are phenomenologies for the dark matter such as the relic density and the direct detection through DM-nucleon scattering in Sec. V. Finally we conclude in Sec. VI. \section{model} We adopt a dark sector consisting of a real scalar field $S$ and a Dirac fermion field $\psi$ which are SM gauge singlets studied first in Ref. \cite{Lee07,Kim16}. The dark sector Lagrangian with the renormalizable interactions is then given by \begin{equation} \label{eq:DM_Lagrangian} \mathcal{L}_{DM} = \bar{\psi}\left(i\partial\!\!\!/ - M_{\psi_0}\right)\psi + \frac{1}{2} \left(\partial_{\mu} S\right)\left(\partial^{\mu} S\right) - g_S \bar{\psi}\psi S - V_{S}(S,H), \end{equation} where the Higgs portal potential is \begin{equation} \label{eq:VS_potential} V_{S}(S,H) = \frac{1}{2} M_S^2 S^2 + \lambda_1 H^{\dagger} H S + \lambda_2 H^{\dagger} H S^2 + \frac{\lambda_3}{3!}S^3 + \frac{\lambda_4}{4!}S^4 . \end{equation} Note that the singlet fermionic DM field $\psi$ couples only to the singlet scalar $S$, and the interactions of the singlet sector to the SM sector arise only through the Higgs portal $H^{\dagger}H$. After electroweak symmetry breaking, the neutral component of the SM Higgs and the singlet scalar develop nonzero VEVs, $\langle H^0 \rangle=v_h/\sqrt{2}$ and $\langle S \rangle = v_s$, respectively. Minimizing the full scalar potentials $V_S + V_{SM}$, where \begin{eqnarray} V_{SM} = -\mu^2 H^{\dagger} H + \lambda_0 (H^{\dagger} H)^2, \end{eqnarray} the scalar mass parameters $M_S^2$ and $\mu^2$ are expressed in terms of the scalar VEVs as follows \cite{PMS} \begin{eqnarray} M_S^2 &=& - \left(\frac{\lambda_1}{2 v_s} + \lambda_2 \right)v_h^2 - \left(\frac{\lambda_3}{2v_s} + \frac{\lambda_4}{6}\right) v_s^2 , \nonumber \\[1pt] \mu^2 &=& {\lambda}_0 v_h^2 + (\lambda_1 + \lambda_2 v_s)v_s . \end{eqnarray} The neutral scalar fields $h$ and $s$ defined by $H^0=(v_h+h)/\sqrt{2}$ and $S=v_s+s$ are mixed to yield the mass matrix given by \begin{eqnarray} \mu_{h}^2 &=& 2 {\lambda}_0 v_h^2 , \nonumber \\[1pt] \mu_{s}^2 &=& - \frac{\lambda_1 v_h^2}{2 v_s} + \frac{\lambda_3}{2} v_s + \frac{\lambda_4}{3} v_s^2 , \nonumber \\[1pt] \mu_{hs}^2 &=& (\lambda_1 + 2 \lambda_2 v_s) v_h. \end{eqnarray} The corresponding scalar mass eigenstates $h_1$ and $h_2$ are admixtures of $h$ and $s$, \begin{equation} \left( \begin{array}{c} h_1 \\[1pt] h_2 \end{array} \right) = \left( \begin{array}{cc} \cos \theta &\ \sin \theta \\[1pt] - \sin \theta &\ \cos \theta \end{array} \right) \left( \begin{array}{c} h \\[1pt] s \end{array} \right) , \end{equation} where the mixing angle $\theta$ is given by \begin{eqnarray} \tan \theta = \frac{y}{1+\sqrt{1+y^2}}, \end{eqnarray} with $ \ y \equiv 2 \mu_{hs}^2 /(\mu_h^2 - \mu_s^2)$. After the mass matrix is diagonalized, we obtain the physical masses of the two scalar bosons $h_{1,2}$ as follows: \begin{eqnarray} M^2_{1,2} = \frac{\mu_h^2+\mu_s^2}{2} \pm \frac{\mu_h^2-\mu_s^2}{2}\sqrt{1+y^2}, \end{eqnarray} where the upper (lower) sign corresponds to $M_1(M_2)$. We assume that $M_1$ corresponds to the observed SM-like Higgs boson mass in what follows. The singlet fermion $\psi$ has mass $M_\psi = M_{\psi_0} + g_S v_s$ as an independent parameter of the model since $M_{\psi_0} $ is just a free model parameter, and the Yukawa coupling $g_S$ measures the interaction of $\psi$ with singlet component of the scalar particles. In total, we have eight independent model parameters relevant for DM phenomenology. The six model parameters $\lambda_0, \lambda_1, \lambda_2, \lambda_3, \lambda_4$ and $v_s$ determine the masses $M_{1,2}$, the mixing angle $\theta$, and self-couplings of the two physical scalars $h_{1,2}$. Given the fixed Higgs mass $M_1$, we constrain seven independent NP parameters taking into account various theoretical consideration and experimental measurements in the next section. \section{Veltman condition and Unitarity} \begin{figure}[!hbt] \centering% \subfigure[ ]{\label{sfdm_scalar} % \includegraphics[width=5.4cm]{sfdm_scalar_loop.pdf}} \qquad \subfigure[ ]{\label{sfdm_fermion} % \includegraphics[width=6cm]{sfdm_fermion_loop.pdf}} \caption{One-loop quadratic divergence contributions of the (a) scalars and (b) fermionic DM to the Higgs and the new scalar masses from the hidden sector. } \label{fig:oneloop} \end{figure} We apply the VC to this model as done similarly in Refs.\cite{Chakraborty13,Karahan14,Demir15}, and constrain the above model parameters from the fine-tuning problem originating from the radiative corrections to the Higgs mass. Cutting off the loop integral momenta at a scale $\Lambda$, and keeping only the dominant contributions in this scale, we obtain \begin{equation} \label{eq:radhiggsmass} M^2_h = (M^0_h)^2 + \frac{3\Lambda^2}{16\pi^2v_h^2}\left(M_h^2 + 2M_W^2 + M_Z^2 -4m_t^2 + \frac{\lambda_2}{3}v_h^2\right), \end{equation} where $M^0_h$ is the bare mass constrained in the unrenormalized Lagrangian, and small mixing effect proportional to $\theta$ is neglected. The last term proportional to $\lambda_2$ in Eq. (\ref{eq:radhiggsmass}) is obtained from the one-loop diagram in Fig. \ref{sfdm_scalar}. Following Veltman \cite{Veltman81}, note that by choosing the parameter $\lambda_2$ to be \begin{equation} \label{eq:VC_Higgs} \lambda_2 = 3(4m_t^2 - M_h^2 - 2M_W^2 - M_Z^2)/v_h^2 \sim 4.17, \end{equation} the quadratic divergences can be canceled and this could be a prediction for the parameter $\lambda_2$. This result agrees well with the prior result of Ref. \cite{Demir15} where the additional scalar mass is protected by a new hidden vector. Also, the same result for $\lambda_2$ was obtained in the (multi-)scalar DM model studied in Ref. \cite{Chakraborty13}. On the other hand, in our model, a singlet fermionic DM stabilizes the mass of the scalar mediator. Similarly to the Higgs mass case, as for the scalar singlet mass, we obtain from Fig. \ref{fig:oneloop} that \begin{equation} \label{eq:radscalarmass} M^2_s = (M^0_s)^2 + \frac{\Lambda^2}{32\pi^2}\left(\lambda_4 + 2\lambda_2 - 8g_S^2 \right), \end{equation} and the VC requires \begin{equation} \label{eq:VC_scalar} \lambda_4 = 8g_S^2 - 2\lambda_2 . \end{equation} The conditions obtained above were given only at the one-loop level, and cannot be the legitimate solution to the fine-tuning problem especially if the scale of NP is extremely large. For scales not much larger than the electroweak scale, however, one does not need very large cancellations. If the Veltman solution is by chance satisfied, the scale $\Lambda$ can be pushed at the two-loop level to a much higher value proportional to $\Lambda^2\log\Lambda$ for $\Lambda \sim 15$ TeV. Nonetheless, including two-loop (or higher-loop) corrections will modify the above condition by further powers of $O(1/16\pi^2)$, so that a modification of the one-loop VC is very small at the level of a few percent \cite{Al-sarhi92}. Of course, one can set up the model parameters to apply the VC at the two-loop or higher level. The couplings $\lambda_{2,4}$ can grow significantly with increasing renormalization scale $\Lambda$, and one can constraint those by applying the tree-level perturbative unitarity to scalar elastic scattering processes for the zeroth partial wave amplitude \cite{Lee77}. For a singlet scalar Higgs portal, the bounds on the couplings $\lambda_{2,4}$ are given by \cite{Cynolter04} \begin{equation} \label{eq:unitarity} |\lambda_2| \leq 4\pi , \quad \lambda_4 \leq 8\pi . \end{equation} The value of $\lambda_2$ obtained from the VC in Eq.(\ref{eq:VC_Higgs}) lies obviously in the range of the above bound. From the fact that the quartic coupling $\lambda_4$ should be positive, and from Eqs. (\ref{eq:VC_scalar}) and (\ref{eq:unitarity}) we obtain \begin{equation} \label{eq:VC_coupling} 1.02 < g_S < 2.05 . \end{equation} Interestingly, the obtained size of allowed DM coupling $g_S$ is similar to that of the strong interaction coupling in the SM. Using the given conditions, we will perform the numerical analysis with the various sets of the following five NP parameters: $\sin\theta, M_2, M_\psi, g_S, v_s$. In addition, we will also show the full analysis with arbitrary set of $\lambda_{2,4}$ without the VC as a comparison. \begin{figure}[!hbt] \centering% \subfigure[ ]{\label{fig:rge1} % \includegraphics[width=7.6cm]{rge1.png}} \ \subfigure[ ]{\label{fig:rge2} % \includegraphics[width=7.6cm]{rge2.png}} \caption{Running of the massless couplings and the first VC given in Eq. (\ref{eq:lambda_vc}) for (a) $\lambda_2(v) = 4.17$ and (b) $\lambda_2(v) = 2.0$ with the renormalization scale $\mu$. The vertical(violet) line indicates where one of the couplings hits Landau pole. $g_S$ and $\lambda_4$ are chosen to satisfy the second VC obtained in Eq. (\ref{eq:VC_scalar}) at (a) $\mu = v$ and (b) $\mu = 4$ TeV. } \label{fig:rge} \end{figure} Before we discuss the phenomenological aspects of this model in the next section, we briefly check the renormalization group evolution (RGE) behavior of the model parameters. The $\beta$-function of a coupling $\lambda_i$ at a scale $\mu$ in the RGE is defined as $\beta_{\lambda_i} = \partial \lambda_i/\partial \log\mu$. For dimensionless couplings in the scalar potential (including the DM Yukawa coupling), the one-loop $\beta$-functions are given by \cite{Baek12} \begin{eqnarray} \beta_{\lambda_0}^{(1)} &=& \frac{1}{16\pi^2}\left[ 24\lambda_0^2 + 12\lambda_0\lambda_t^2 -6\lambda_t^4 -3\lambda_0(3g_2^2 + g_1^2) +\frac{3}{8}\big(2g_2^4+(g_2^2+g_1^2)^2\big) + 2\lambda_2^2 \right], \nonumber \\[1pt] \beta_{\lambda_2}^{(1)} &=& \frac{\lambda_2}{16\pi^2}\left[ 12\lambda_0 -\frac{3}{2}\lambda_0(3g_2^2 + g_1^2) + 6\lambda_t^2 + 8\lambda_2 + \lambda_4 + 4g_S^2 \right], \nonumber \\[1pt] \beta_{\lambda_4}^{(1)} &=& \frac{1}{16\pi^2}\left[ 8\lambda_2^2 + \frac{1}{2} \lambda_4^2 + \frac{4}{3}\lambda_4 g_S^2 - 8g_S^4 \right], \qquad \beta_{g_S}^{(1)} = \frac{5}{16\pi^2}g_S^3, \end{eqnarray} where $g_1$ and $g_2$ are the SM U$(1)_Y$ and SU$(2)_L$ couplings, respectively, and $\lambda_t$ is the top Yukawa coupling. In terms of the running couplings, the quadratic radiative mass correction $\delta M_h^2$ in Eq. (\ref{eq:VC_Higgs}) can be rewritten at a scale $\mu$ as \begin{equation} \label{eq:lambda_vc} \delta M_h^2 (\mu) \equiv \frac{\Lambda^2}{16\pi^2}\lambda_{VC}(\mu) = \frac{\Lambda^2}{16\pi^2}\left(6\lambda_0(\mu) + \frac{9}{4}g_2^2(\mu) + \frac{3}{4}g_1^2(\mu) - 6\lambda_t^2(\mu) + \lambda_2(\mu)\right). \end{equation} It is natural to determine the values of the physical observables at a scale $\mu = v \equiv \sqrt{v_h^2 + v_s^2}$ for a study of the DM phenomenology since $v$ can be considered as the VEV of the radial component of a scalar field composed of $h$ and $s$. Since we are interested in the DM fermion (and $h_2$) lighter than 1 TeV, we choose $v \sim 400$ GeV as a benchmark point. In Fig. \ref{fig:rge}, we show the scale dependence on the RGE of the massless couplings together with the VC for two different set of parameter values: Firstly, we consider a scenario in Fig. \ref{fig:rge1} that $\lambda_2(v) = 4.17$ and $\lambda_{VC}(v) \simeq 0$ as obtained in Eq. (\ref{eq:VC_Higgs}). The scalar couplings are drastically increased above 5 TeV and hit Landau pole near at 12.6 TeV. Therefore this DM model, although renormalizable, can be considered in this case as an effective low-energy theory valid up to cut-off energies about 10 TeV. $\lambda_2(v) = 4.17$ is quite large value even if still perturbative. Introducing $N$ number of singlets brings down the value to $4.17/N$ so that Landau pole can be shifted further to a much higher scale \cite{Chakraborty13}. However we consider a simplest possible scenario ($N = 1$) as a reference. Secondly, we consider another scenario in Fig. \ref{fig:rge2} that $\lambda_2(v) = 2.0$. In this case, we found that $\lambda_{VC}$(4 TeV) $\simeq 0$ and one of the couplings hits Landau pole near at 300 TeV. At a scale $\mu = v$, the mass correction ratio becomes $\delta M_h^2/M_h^2 \sim 100$ which corresponds to fine-tuning at the level of $1\%$ following Ref. \cite{Kolda00}. Satisfying the VC at the electroweak scale($\sim v$) is not mandatory. The VC might possibly be satisfied at a higher NP scale or even at GUT scale. However, it is considered to be more `natural' if the fine-tuning measure from the radiatively induced mass ratio is within the level of a few percent. In this sense, the second scenario is also acceptable. As for the other NP couplings, $g_S$ and $\lambda_4$ are chosen to satisfy the second VC obtained in Eq. (\ref{eq:VC_scalar}) at $\mu = v$ and $\mu = 4$ TeV in the first and second scenarios, respectively. In order for clear comparison with the prior results of Refs. \cite{Demir15, Chakraborty13} which have the same extra scalar (but different DM sector) resulting in the same prediction on $\lambda_2(v) = 4.17$, we will focus on the first scenario with a simplest possible setup of the DM sector for the numerical analysis. Nevertheless, the second scenario ($\lambda_2(v) = 2.0$) will not change our numerical results much. The resolution of the fine-tuning issue suggests new weakly coupled physics at the cutoff-scale $\Lambda \sim$ 1 TeV in order to explain the currently measured Higgs mass. In our model, the first and the second scenarios push the cutoff to $\sim$ 10 TeV and 100 TeV, respectively. Similarly, as an effective theory, the LHM addressing the fine-tuning problem also allow the cutoff of the theory to be raised up to $\sim$ 10 TeV, beyond the scales probed by the current precision data. Such extensions of the SM (including SUSY) require new TeV scale particles in order to cancel the one-loop quadratic divergences. However, the current electroweak precision measurements put significant constraints on those new particles, which indicate that there is no new particle up to $\sim$ 10 TeV (unless one amends the models with extra discrete symmetries). This discrepancy creates a tension known as the little hierarchy problem \cite{Barbieri99}. However, in our model, the Higgs portal scalar can alleviate the little hierarchy problem, and no new TeV scale particles are necessary in the electroweak sector. Nevertheless, because of the non-perturbativity of the scalar quartic couplings at a few TeV scale in the first scenario ($\lambda_2(v) = 4.17$) one might want to invoke some NP in this case in order to reduce the quartic couplings at a higher scale. Even so, as far as such an NP extension resides only in the hidden sector, LHC constraints on the NP extension shall be negligible for small $\sin\theta$ such as the case of $h_2$ and DM fermion phenomenology as we will discuss in the next chapters. Besides all those, since we do not know either what kind of NP enters at a higher scale for UV completion of theory or at which scale the VC is satisfied, we also perform the full analysis with arbitrary set of $\lambda_{2,4}$ without the VC as a comparison, so that our numerical results can be applicable to various extensions of the fermionic DM models. \section{Collider Phenomenology} \begin{figure}[!hbt] \centering% \includegraphics[width=8cm]{h3c.png} \caption{Higgs triple coupling $c_{111}$ as a function of $v_s$ for different values of $\sin\theta$ and $M_2$. Dashed and Dot-dashed lines represent the expected experimental precisions on $c_{111}$ at future hadron colliders, HL-LHC and VLHC, respectively \cite{LHCHiggs14}. } \label{Branchingf} \end{figure} Due to the Higgs portal terms in Eq. \ref{eq:VS_potential}, electroweak interaction of the Higgs boson can be significantly modified, and it is possible that $h_{1,2}$ decay into one another depending on their masses. If $M_2 \leq M_1/2$, it is kinematically allowed that $h_1$ decays into a pair of $h_2$ so that the total decay width of $h_1$ increases. However, in this case, we found that the total decay width of $h_1$ exceeds too much of the currently known value of the Higgs decay width $\Gamma_\textrm{SM}$ = 4.07 MeV \cite{LHCHiggs13}, for any value of $\sin\theta$ unless $\lambda_2$ is extremely small. Therefore, we only consider a case of heavy scalar boson $h_2$ with mass $M_2 > M_1/2$. As well as the Higgs portal terms create new interactions between scalar bosons, they modify the Higgs self-couplings sizably. For instance, the Higgs triple coupling $c_{111}$ for $h_1^3$ interaction is given by the above model parameters as \begin{equation} c_{111} = 6\lambda_0 v_h \cos^3\theta + 3(\lambda_1 + 2\lambda_2 v_s)\cos^2\theta \sin \theta + 6\lambda_2 v_h\cos \theta \sin^2\theta +(\lambda_3 + \lambda_4 v_s)\sin^3\theta , \end{equation} and can be probed in double Higgs production at hadron or lepton colliders. One can see from the above equation that the coupling $c_{111}$ reduces to the well-known SM value when $\theta = 0$. The remaining triple-scalar couplings for $h_1^2 h_2$, $h_1 h_2^2$, and $h_2^3$ interactions can be found in Ref. \cite{Kim16}. In Fig. \ref{Branchingf}, we illustrate the Higgs triple coupling $c_{111}$ as a function of the scalar VEV $v_s$ for $\sin\theta$ = 0.1, 0.01, 0.001 and for $M_2$ = 80, 400 GeV. The deviation of experimental value of $c_{111}$ from the SM expectation for $\sin\theta$ = 0.1 lies within the expected precision of VLHC experiment, but not within HL-LHC precision. \begin{figure}[!hbt] \centering% \includegraphics[width=8cm]{invhiggs.png} \caption{Shaded regions are excluded by the 90\% CL limit of BR($h_1 \to$ inv.) $< 0.20$. The upper bounds are shown as different lines for three values of $\sin\theta$ = 0.1(solid blue), 0.01(dashed green), 0.001(dotted red). } \label{fig:invhiggs} \end{figure} If $M_\psi < M_1/2$, still, the SM Higgs $h_1$ can decay invisibly into a pair of DM through mixing with decay width, \begin{equation} \Gamma_\textrm{inv.} = \Gamma\left(h_1 \to \psi\bar{\psi}\right) = \frac{g_S^2M_1\sin^2\theta}{8\pi}\left(1 - \frac{4M_\psi^2}{M_1^2}\right)^{3/2} , \end{equation} and the corresponding branching fraction of the invisible Higgs decays is given by the relation BR($h_1 \to$ inv.) = $\Gamma_\textrm{inv.}/(\Gamma_\textrm{SM} + \Gamma_\textrm{inv.})$, where $\Gamma_\textrm{SM}$ = 4.07 MeV \cite{LHCHiggs13}. The most recent upper limit on the Higgs invisible decay has been set by the CMS Collaboration combined with the run II data set with the luminosity of 2.3 fb$^{-1}$ at center-of-mass energy of 13 TeV \cite{CMS16, Higgsinv}. We applied the combined 90\% CL limit of BR($h_1 \to$ inv.) $< 0.20$ to our model, and depicted the result for $\sin\theta = 0.1, 0.01, 0.001$ in Fig. \ref{fig:invhiggs}. The bounds obtained from the invisible Higgs decays shown in Fig. \ref{fig:invhiggs} are not stronger than those from the DM relic density observation, and we will discuss it in the next section. Besides the invisible Higgs decays, due to the vectorial nature and degeneracy of the DM singlet fermion, the constraints coming from oblique S,T,U parameters are negligible for $\sin\theta < 0.3$ (within the LEP II constraint) \cite{Chakraborty13, Baek12}. \section{Dark Matter Phenomenology} The combined results from the recent CMB data by the Planck experiment plus WMAP temperature polarization data gives \cite{PDG14} \begin{equation} \Omega_{CDM}h^2 = 0.1198 \pm 0.0026. \label{eq:relic_obserb} \end{equation} This relic density observation will exclude some regions in the model parameter space. The relic density analysis in this chapter includes all possible channels of $\overline{\psi}\psi$ pair annihilation into the SM particles. In this work, we implement the model described in section 2 in the FeynRules package \cite{feynrules} in order to make use of the MadGraph5 platform \cite{madgraph5}. Using the numerical package MadDM \cite{maddm2} which utilizes the MadGraph5 for computing the relevant annihilation cross sections, we obtain the DM relic density and the spin-independent DM-nucleon scattering cross sections. \begin{figure}[!hbt] \centering% \subfigure[ ]{\label{omegahr1a} % \includegraphics[width=7.6cm]{omegahr1a.png}} \ \subfigure[ ]{\label{omegahr1b} % \includegraphics[width=7.6cm]{omegahr1b.png}} \\ \subfigure[ ]{\label{omegahr2a} % \includegraphics[width=7.6cm]{omegahr2a.png}} \ \subfigure[ ]{\label{omegahr2b} % \includegraphics[width=7.6cm]{omegahr2b.png}} \caption{Allowed parameter sets of ($M_\psi, g_S$) by relic density observations at $3\sigma$ level for $\sin\theta = 0.01, 0.001$ with and without applying the VC. The shaded area above the dashed curve indicates the exclusion limit for $\sin\theta \geq 0.01$ obtained in Fig. \ref{fig:invhiggs}. } \label{fig:relicdensity} \end{figure} Instead of performing a complete analysis by varying all relevant independent NP parameters ($\sin\theta, M_2, M_\psi, g_S, v_s, \lambda_{2,4}$) in this model, we choose the benchmark points for the scalar mixing angle $\theta$, mass $M_2$, and VEV $v_s$ as follows: $\sin\theta = 0.1, 0.01, 0.001$, $M_2 = 80, 400$ GeV, and $v_s = 55, 300$ GeV as similarly considered in Ref. \cite{PMS} in order to adopt the conditions on the NP parameters that lead to a strong first order phase transition as needed to produce the observed baryon asymmetry of the universe. If the VC is applied, $\lambda_{2}$ is fixed to be about 4.17 as obtained in Eq. (\ref{eq:VC_Higgs}), and $\lambda_{4}$ is determined by the choice of the DM coupling $g_S$ as in Eq. (\ref{eq:VC_scalar}) which is constrained by the unitarity conditions as in Eq. (\ref{eq:VC_coupling}). If only the unitarity constraints are considered without the VC, the value of the coupling $g_S$ is arbitrary. In order to clearly see how the VC constraints the allowed parameter space, we also scan the whole perturbative parameter region given in Eq. (\ref{eq:unitarity}) and compare the results obtained with and without the VC applied. For illustration of the relic density constraints on the singlet fermionic DM interaction, we first plot the allowed region of the DM mass $M_\psi$ and coupling $g_S$ constrained by the current relic density observations at $3\sigma$ level for $\sin\theta = 0.01, 0.001$ in Fig. \ref{fig:relicdensity}, where four different sets of new parameters ($v_s$ and $M_2$) are chosen in the range of $0.5 < g_S < 2.11$. Without the VC constraints, of course, $g_S$ can possibly have a much smaller or larger value, but we don't consider such a case which digresses from the topic of this paper. In Fig. \ref{fig:relicdensity}, one can clearly see that the allowed DM parameter space is quite large for arbitrary values of $\lambda_{2,4}$ but much restricted to a small area once we apply the VC and the unitarity condition obtained in Eqs. (\ref{eq:VC_Higgs}-\ref{eq:VC_coupling}). Under the VC, the allowed parameter sets are located near the resonance region of $M_1$ and $M_2$ or in the mass region of $M_\psi$ heavier than around 700 GeV. For different values of $\sin\theta$, the allowed parameter regions by the relic density observation are largely overlapped. For $\sin\theta = 0.01, 0.001$, the exclusion limits from the Higgs invisible decay shown in Fig. \ref{fig:invhiggs} do not give further constraints. In the case of $\sin\theta = 0.1$, however, the allowed region by the relic density observation in the range of $0.5 < g_S < 2.11$ is excluded by the spin-independent DM-nucleon scattering result of recent LUX experiment as we will see later in this chapter, so we do not show the result here. \begin{figure}[!hbt] \centering% \includegraphics[width=8cm]{lambda2.png} \caption{Relic density $\Omega_{CDM}h^2$ as a function of $\lambda_2$ for $\lambda_4 = 3.18$, $g_S = 1.2$, $M_\psi =800$ GeV, and four different sets of $v_s$ and $M_2$. The vertical(violet) line indicates the VC constrained value obtained in Eq. (\ref{eq:VC_Higgs}), and the shaded region is allowed by the recent observation given in Eq. (\ref{eq:relic_obserb}). Note that different $\sin\theta$ ($\lesssim 0.1$) doesn't change the plots noticeably in this parameter set because $\sin\theta$ dependence is almost negligible in the heavy $M_\psi$ region. } \label{fig:lambda2} \end{figure} In the small mass region of $M_\psi$ where DM pair annihilations into $h_1 h_2$ and $h_2 h_2$ are not kinematically allowed in the early universe, the annihilation cross section is usually quite small (for the small $\sin\theta$ and $g_S$ values) so that only near Higgs resonance regions annihilation cross sections can be sizable enough to have the correct DM relic density. But if the DM pair annihilations into $h_1 h_2$ and $h_2 h_2$ are open, then the annihilation channels can be dominant since the DM pair annihilations into $h_1 h_2$ and $h_2 h_2$ through s-channel $h_2$ mediation are not suppressed even with the small $\sin\theta$. In Fig. \ref{omegahr1b} and \ref{omegahr2b}, one can clearly see that the $h_1 h_2$ channel is open for $M_\psi \gtrsim 260$ GeV (average of $M_1$ and $M_2$) and the $h_2 h_2$ channel also open for $M_\psi \gtrsim 400$ GeV. For the annihilation into $h_2 h_2$, the annihilation diagram through t-channel $\psi$ mediation is also not suppressed with the small $\sin\theta$. The Higgs triple coupling of $h_1 h_2^2$ interaction is given as $c_{122}=2\lambda_2 v_h$ in the $\sin\theta \rightarrow 0$ limit. Therefore the annihilation cross section (in turn, the relic density) dependence on $\lambda_{2,4}$ becomes more important in the heavy $M_\psi$ region. In Fig. \ref{fig:lambda2}, we show the relic density as a function of $\lambda_2$ for $\lambda_4 = 3.18$, $g_S = 1.2$, $M_\psi =800$ GeV, and four different sets of $v_s$ and $M_2$. As $\lambda_2$ grows, the Higgs triple coupling $c_{122}$ gets larger so that the annihilation cross section gets larger and in turn the relic density gets smaller. Therefore, if $\lambda_2$ is a free parameter we can adjust the $\lambda_2$ value to have a correct DM relic density. However, with the VC imposed, we do not have such freedom (here $\lambda_2$ is fixed as 4.17) and therefore only limited parameter sets are survived. \begin{figure}[!hbt] \centering% \subfigure[ ]{\label{sigmaSIr1a} % \includegraphics[width=7.6cm]{sigmaSIr1a.png}} \ \subfigure[ ]{\label{sigmaSIr1b} % \includegraphics[width=7.6cm]{sigmaSIr1b.png}} \\ \subfigure[ ]{\label{sigmaSIr2a} % \includegraphics[width=7.6cm]{sigmaSIr2a.png}} \ \subfigure[ ]{\label{sigmaSIr2b} % \includegraphics[width=7.6cm]{sigmaSIr2b.png}} \caption{Spin-independent DM-nucleon scattering results allowed by relic density observations for $0.5 < g_S < 2.11$ with and without applying the VC. Also shown are observed limits from LUX 2013, 2016, XENON100, SuperCDMS, and expected limits from DEAP-3600 and XENON10T. For $\sin\theta = 0.1$, some of allowed parameter sets by the relic density observation in low DM mass (grayed) region are excluded by the invisible Higgs decay bound given in Fig. \ref{fig:invhiggs}.} \label{fig:sigmaSI} \end{figure} In Fig. \ref{fig:sigmaSI}, we plot the spin-independent DM-nucleon scattering cross section by varying the DM mass $M_\psi$ with parameter sets allowed by the relic density observation, and compare the results with the observed upper limits obtained at 90$\%$ level from LUX 2013, 2016, XENON100, SuperCDMS, and with the expected limits from DEAP-3600 and XENON10T. One can see from the figure that $\sin\theta \gtrsim 0.1$ case obtained in the range of $0.5 < g_S < 2.11$ is not favored in this model due to the recent LUX bound \cite{LUX16}, and most of allowed regions for $\sin\theta = 0.01, 0.001$ are not excluded. Also, $\sin\theta = 0.01$ scenario can be tested sooner or later by ongoing experiments such as XENON10T. If one chooses the second scenario ($\lambda_2(v) = 2.0$) instead of the first scenario ($\lambda_2(v) = 4.17$), the allowed regions for $M_\psi > 600$ GeV with the VC applied in Fig. \ref{fig:relicdensity} and \ref{fig:sigmaSI} will be shifted a bit but not much, and still be inside of the allowed regions obtained generally without the VC. Similarly, even if one introduces additional NP in the hidden sector at a TeV scale and apply the VC at the NP scale, our numerical results can still be applicable and provide meaningful guidelines as discussed in Sec. III. \section{Concluding Remarks} In this paper, we studied the renormalizable Higgs portal model of a fermionic dark matter with a gauge singlet Dirac fermion and a real single scalar which ensure the cancellation of one-loop quadratic divergence to the Higgs and the additional singlet scalar masses. We showed that our DM model can satisfy the VCs for the quadratic divergences to the masses of the SM-like Higgs boson and the singlet scalar simultaneously. We constrained the Higgs-scalar coupling $\lambda_2$ and the scalar self-interaction coupling $\lambda_4$ using the VC. We further constraint those couplings using the perturbative unitarity conditions, and obtained the bound on the DM coupling $g_S$ as well. We showed the allowed region of NP parameters, the DM mass $M_\psi$ and coupling $g_S$, satisfying the recent measurement of relic abundance with and without the VC constraints in Fig. \ref{fig:relicdensity}. We also showed the spin-independent DM-nucleon scattering cross section of the singlet fermionic DM by varying the DM mass $M_\psi$ with parameter sets allowed by the relic density observation, and compare the results with the observed upper limits from various experiments in Fig. \ref{fig:sigmaSI}. In the figures, one can clearly see that the allowed parameter space constrained by the VC are located near the resonance region of $M_1$ and $M_2$ or in the mass region of $M_\psi$ heavier than about 700 GeV. We performed the numerical analysis for three different values of the Higgs-scalar mixing angle $\sin\theta = 0.1, 0.01, 0.001$, and the $\sin\theta = 0.1$ case is disfavored in this model due to the recent LUX bound even in the case without the VC applied. Our renormalizable DM model with a singlet Dirac fermion and a real single scalar is a minimal DM model which has allowed NP parameter space where the fine-tuning (or the hierarchy) problem of the Higgs mass is much relaxed, and this model can be expanded by introducing complex scalars and/or DM fermion multiplets. The obtained allowed parameter sets under the VC can be used as benchmark points to test proper DM model candidates as future experimental progress can further improve the bounds. \acknowledgments This work was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Science, ICT and Future Planning (Grant No. NRF-2015R1A2A2A01004532 (K.Y. Lee) and NRF-2017R1E1A1A01074699 (S.-h. Nam)), and funded by the Ministry of Education (Grant No. NRF-2016R1A6A3A11932830 (S.-h. Nam)). \def\npb#1#2#3 {Nucl. Phys. B {\bf#1}, #2 (#3)} \def\plb#1#2#3 {Phys. Lett. B {\bf#1}, #2 (#3)} \def\prd#1#2#3 {Phys. Rev. D {\bf#1}, #2 (#3)} \def\jhep#1#2#3 {J. High Energy Phys. {\bf#1}, #2 (#3)} \def\jpg#1#2#3 {J. Phys. G {\bf#1}, #2 (#3)} \def\epj#1#2#3 {Eur. Phys. J. C {\bf#1}, #2 (#3)} \def\arnps#1#2#3 {Ann. Rev. Nucl. Part. Sci. {\bf#1}, #2 (#3)} \def\ibid#1#2#3 {{\it ibid.} {\bf#1}, #2 (#3)} \def\none#1#2#3 {{\bf#1}, #2 (#3)} \def\mpla#1#2#3 {Mod. Phys. Lett. A {\bf#1}, #2 (#3)} \def\pr#1#2#3 {Phys. Rep. {\bf#1}, #2 (#3)} \def\prl#1#2#3 {Phys. Rev. Lett. {\bf#1}, #2 (#3)} \def\ptp#1#2#3 {Prog. Theor. Phys. {\bf#1}, #2 (#3)} \def\rmp#1#2#3 {Rev. Mod. Phys. {\bf#1}, #2 (#3)} \def\zpc#1#2#3 {Z. Phys. C {\bf#1}, #2 (#3)} \def\cpc#1#2#3 {Chin. Phys. C {\bf#1}, #2 (#3)} \def\jcap#1#2#3 {JCAP {\bf#1}, #2 (#3)} \def\compc#1#2#3 {Comput. Phys. Commun. {\bf#1}, #2 (#3)} \def\pdu#1#2#3 {Phys. Dark Univ. {\bf#1}, #2 (#3)}
\section{Introduction} The possibility of generating random numbers by quantum processes is an invaluable resource in cryptography. Nowadays, common solutions based on Pseudo or classical Random Number Generators rely on deterministic processes, which are in principle predictable. On the contrary, Quantum Mechanics guarantees, from a theoretic point of view, that the outcome of the measurement is completely unpredictable. However, any imperfection in the physical realization of quantum random number generators (QRNG) can leak information correlated with the generated numbers, the so called \textsl{side information}. Such classical or quantum correlations could be exploited by an eavesdropper to correctly guess the measurement outcomes. The maximal amount of randomness that can be extracted in presence of such side information is given by the so called quantum conditional \textsl{min-entropy}~\cite{konig2009operational}. Several approaches have been proposed to lower bound it, depending on the number of assumptions required on the devices used in the generator. For ``fully trusted'' QRNGs~\cite{Rarity1994,stefanov2000optical,jennewein2000fast}, the min-entropy can be evaluated because pure input states and well characterized measurement devices are assumed (see ~\cite{Vallone2014} for more details). In contrast, \textsl{device independent} (DI) protocols, by exploiting entanglement, don't need any assumption: the violation of a Bell inequality directly bounds the min-entropy, without the need of trusting the generated state and the used measurement devices. Fully trusted QRNG, including all the commercial ones, are easy to realize, but they require strong assumptions for their use in cryptography. On the contrary, DI protocols offer the highest level of security, but their realization is still too demanding for any practical use \cite{Pironio2010,Christensen2013,Bierhorst2017,Liu2018,Gomez2017}. Semi-device-independent (Semi-DI) protocols \cite{Ma2016}, are a promising approach to enhance the security with respect to standard ``fully trusted'' QRNG, achieving fast generation rate, dramatically larger than DI-QRNG. These require some weaker assumptions to bound the side information. Such assumptions can be related to the dimension of the underlying Hilbert space~\cite{Lunghi2014,Canas2014}, the measurement device \cite{Vallone2014,Marangon2017,Cao2016,Xu:16,Gomez2017} or the source \cite{Cao2015}, for example the mean photon number~\cite{Himbeeck2017semidevice} or the maximum overlap~\cite{Brask2017} of the emitted states. In this work we introduce a QRNG belonging to the family of the Semi-DI generators. In particular, we will describe a novel source-device independent (SDI) protocol by exploiting continuous variable (CV) observables of the electromagnetic (EM) field. In previously realized CV-QRNGs \cite{Gabriel2010,Marangon2017}, random numbers were generated by using a homodyne detector that measures a quadrature of the EM field. We propose and demonstrate a CV-QRNG based on heterodyne detection in the SDI framework: we will show how it is possible to obtain a lower bound on the eavesdropper quantum side information (i.e. the conditional min-entropy) and to achieve, to our knowledge, the fastest generation rate in the Semi-DI framework. The advantages of heterodyne measurement over homodyne are multiple: beside offering better tomography accuracy than homodyne \cite{Rehacek2015, Muller2016}, heterodyne measurement offers an increased generation rate since it allows a ``simultaneous measurement'' of both quadratures. In addition, the experimental setup is simplified with respect to the protocol based on homodyne introduced in \cite{Marangon2017}, since there is no need of an active switch to measure the two quadratures. Finally, it is possible to derive a constant lower bound on the conditional quantum min-entropy, that doesn't change during the experiment. Our SDI protocol assumes a trusted detector but it does not make any assumption on the source: an eavesdropper may fully control it, manipulating it in order to maximize her ability to predict the outcomes of the generator. Such approach is very effective in taking into account any imperfect state preparation. Moreover, we will show the results of a practical realization of the protocol with a compact fiber optical setup that employs only standard telecom components. In this way, we are able to demonstrate a generation rate of secure random numbers greater than $17$ Gbit/s. \section{A HETERODYNE QRNG} In standard CV-QRNGs, random numbers are obtained by measuring with an homodyne detector a quadrature observable of the EM fields, typically prepared in a vacuum state. CV-QRNGs are characterized by high generation rates due to the use of fast photodiodes instead of (slow) single photon detectors: continuous spectrum of the observables typically assures more than one bit of entropy per measurement and the use of photodiodes with high bandwidth allow to sample the quadratures at GSample/s. In our QRNG, we implement a heterodyne detection scheme where two ``noisy quadrature observables'' are measured simultaneously \cite{Arthurs1965,Walker1987}. More precisely, an heterodyne measurement corresponds to the following Positive Operator Value Measurement (POVM) $\left\{\hat\Pi_\alpha\right\}_{\alpha\in \mathbb C}$ where \begin{equation} \hat\Pi_\alpha=\frac{1}{\pi}\ket{\alpha}\bra{\alpha} \,, \end{equation} and $\ket{\alpha}$ is the coherent state with complex amplitude $\alpha$. If we define $\rho_A$ the density matrix of the EM field, the output of the heterodyne measurement is represented by the random variable $X$ \begin{equation} X=\{\Re {\rm e} \left(\alpha\right),\Im {\rm m}\left(\alpha\right) \} \,, \end{equation} distributed according to the following probability density function known as \textsl{Husimi function}: \begin{equation} Q_{\rho_A}(\alpha)=\text{Tr}\left[\hat\Pi_\alpha \rho_A \right]=\frac{1}{\pi}\bra\alpha\rho_A\ket\alpha\,. \end{equation} In an ideal scenario where the QRNG user (Alice) can trust the source of random states: such scheme has the immediate advantage of doubling the generation rate with respect to an homodyne receiver. Since the \virgolette{raw} random numbers $\{\Re {\rm e}\alpha,\Im {\rm m}\alpha\}$ are typically not uniformly distributed, it is essential to process them with a randomness extractor~\cite{Ma2013}. A randomness extractor compresses the input string of raw numbers, such that the shorter output string is composed by i.i.d. random bits. In a fully-trusted QRNG, when the source is trusted and the input state is pure (such as for the vacuum) or the privacy of the generated numbers is not a concern, the number of random bits that can be extracted per sample is given by the so called classical min-entropy of $X$ \begin{equation} \label{classHmin} H_{\rm min}(X)=-\log_2[\max_\alpha Q(\alpha)] \,. \end{equation} However, ultrafast generation is worthless for cryptographic applications if the numbers are not secure and private. If security is important, quantum side information must be also taken into account and the conditional quantum min-entropy $H_{\rm min}(X|E)$ ~\cite{konig2009operational} must be evaluated. We recall that in the SDI framework an eavesdropper may have full control of the source and then may have some prior information on the generated numbers. We will show that with a heterodyne scheme it is possible to generate unpredictable and secure numbers also when the source of quantum states is controlled by the eavesdropper. \section{A Secure heterodyne (or POVM) QRNG} \subsection{Security of the CV protocol} \label{sec:security} In our SDI framework, Alice does not make any assumption on $\rho_A$, such as its dimension or purity: the source may be even controlled by a malicious QRNG manufacturer, Eve. This framework is well suited to deal with imperfect sources of quantum states~\cite{Vallone2014}. On the contrary, Alice carefully characterizes her local measurement apparatus and trusts it. In this scenario, Eve is assumed to prepare the state $\rho_A$ to be measured. In particular, Eve will prepare $\rho_A$ in order to maximize her guessing probability $P_\text{guess}$ of the outcomes of Alice heterodyne measurement. If the state $\rho_A$ is not pure, it can be prepared by Eve as a incoherent superposition of states $\hat\tau^A_\beta$ with probabilities $p(\beta)$, such as $\rho_A=\int p(\beta)\hat\tau^A_\beta d\beta$. As shown below, for quantum state $\rho_A$ with positive Glauber-Sudarshan representation, Eve optimizes her strategy by using $\hat\tau^A_\beta$ that are coherent states. When Eve generates the state $\hat\tau^A_\beta$, the best option for her is to bet on the heterodyne outcome with higher probability, namely $\max_\alpha \Tr\left[\hat\Pi_\alpha \hat\tau^A_\beta \right]$. On average, Eve's probability of guessing correctly the output of the heterodyne measurement can be written as $P_{\rm guess}(X|\mathcal E)=\int p(\beta) \max_\alpha \Tr \left[\hat\Pi_\alpha \hat\tau^A_\beta \right] d\beta$. Having full control of the source, given the state $\rho_A$, Eve chooses the decomposition $\mathcal{E}=\{p(\beta),\hat\tau^A_\beta\}$ that maximizes $P_{\rm guess}$. \begin{figure}[ht] \includegraphics[width=\linewidth]{Fig1.pdf} \caption{In the general SDI scenario, Eve prepares the state $\rho_A$ that she sends to Alice such that her purification gives her the maximal guessing probability on Alice's outcome. The structure of the POVM chosen by Alice to measure $\rho_A$ already impose a lower bound on $H_{min}(X|E)$, independently from the input state or the output of her measurement (see \href{prop1}{Proposition 1}). This bound is used to calibrate an extractor that returns secure random bits when applied to Alice's outcomes.} \label{img:schemaPOVM} \end{figure} According to the Leftover Hash Lemma (LHL)~\cite{Tomamichel2011}, the extractable randomness in the presence of side information is quantified by the quantum conditional min-entropy \begin{equation} H_\text{min}(X|\mathcal{E}) = -\log_2 P_\text{guess}(X|\mathcal{E})\,, \label{eq:cond_min_entropy} \end{equation} where $P_\text{guess}(X|\mathcal{E})$ is maximum probability of guessing $X$ conditioned on the quantum side information $\mathcal{E}$ \begin{equation} P_\text{guess}(X|\mathcal{E})=\max_{\substack{\{p(\beta),\hat\tau^A_\beta\}}} \int p(\beta) \max_\alpha \Tr\left[\hat\Pi_\alpha \hat\tau^A_\beta \right] d\beta \,. \label{eq:gues_cond} \end{equation} The maximization in \eqref{eq:gues_cond} is performed over all possible decomposition $\mathcal{E}=\{p(\beta),\hat\tau^A_\beta\}$ that satisfy $\rho_A=\int p(\beta) \hat\tau^A_\beta d\beta$. The above considerations are valid not only for the heterodyne measurement, but are correct for any POVM measurement (also with Hilbert spaces of finite dimensions). Fig. \ref{img:schemaPOVM} represents a general protocol within this framework. It is worth noticing that $P_{\rm guess}$ is a true probability for finite dimension Hilbert spaces, while it is a probability density for infinite dimension spaces (such as in the case of CV measurements). By exploiting the properties of POVMs, we now derive a lower bound on $H_\text{min}(X|\mathcal{E})$ (and thus an upper bound on $P_\text{guess}(X|\mathcal{E})$). \label{prop1} {\bf Proposition 1.} {\it For any POVM $\{\hat{ \Pi}_x\}$ the quantum conditional min-entropy $H_{\rm min}(X|\mathcal{E})$ is lower-bounded by $-\max_{ \{ x,\hat\tau_A \in \mathcal{H}_A \} }\log_2( \Tr[\hat{ \Pi}_x \hat\tau_A] )$}. \begin{proof} \label{prop:POVM} Given a set of POVM $\{\hat\Pi_x\}$, the maximum over $x$ in \eqref{eq:gues_cond} is easy bounded by $\max_x \Tr\left[\hat\Pi_x \hat\tau^A_\beta \right] \leq\max_{x,\hat\tau_A} \Tr\left[\hat\Pi_x \hat\tau_A \right] $. Then eq. \eqref{eq:gues_cond} is upper bounded by: \begin{align} \notag P_{\rm guess}(X|\mathcal{E})_\text{min} & \leq \max_{x,\hat\tau_A} \Tr\left[\hat\Pi_x \hat\tau_A \right] \max_{p(\beta),\tau_B} \int p(\beta) d\beta \\ & =\max_{ \{ x,\hat\tau_A \in \mathcal{H}_A \} } \Tr[\hat{ \Pi}_x \hat\tau_A] \end{align} from which the bound on the min-entropy easily follows by using \eqref{eq:cond_min_entropy}. \end{proof} If the POVM reduce to projective measurements, the above bound is trivial, since it always possible to find a state $\hat\tau_A$ such that $\Tr[\hat{ \Pi}_x \hat\tau_A]=1$: in this case, no randomness can be extracted. However, for an overcomplete set of POVM we may have $\max_{ \{ x,\tau_A \} } \Tr[\hat{ \Pi}_{x} \hat\tau_A] < 1$ and therefore randomness can always be extracted. We now exploit the above proposition for the specific case of heterodyne measurement. \begin{cor} \label{cor:het} For the heterodyne measurement the quantum conditional min-entropy $H_{\rm min}(X|\mathcal{E})$ is lower-bounded by $\log_2\pi$. The bound is tight for quantum state with positive Glauber-Sudarshan $\mathcal P(\alpha)$ representation. \end{cor} \begin{proof} It is well known that the Husimi function is upper bounded by $\frac1\pi$. Then $\Tr[\hat{ \Pi}_\alpha \hat\tau_A]=\frac{1}{\pi} \bra{\alpha}\tau_A\ket{\alpha}=Q_{\tau_A}(\alpha)\leq\frac1\pi$, $\forall \tau_A$. By proposition 1, it follows that $H_{\rm min}(X|\mathcal{E})_\text{min} \geq \log_2\pi$. To show the tightness, we note that any matrix $\rho_A$ can be written as $\rho_A= \int \mathcal P(\alpha) \ket{\alpha}\bra{\alpha} d^2\alpha$ where $\mathcal P(\alpha)$ is the Glauber-Sudarshan P-function. If $\mathcal P(\alpha)$ is positive it can be interpreted as a probability density and the state $\rho_A$ can be seen as an incoherent superposition of coherent states. Since coherent states maximize the output probability for the heterodyne POVM, then the optimal decomposition in \eqref{eq:gues_cond} is precisely $\mathcal E=\{\mathcal P(\alpha),\ket{\alpha}\bra{\alpha}\}$ and the quantum conditional min-entropy is exactly $H_{\rm min}(X|\mathcal E)=\log_2\pi$. \end{proof} By using an heterodyne measurement scheme, a quantum tomography of the input state is also obtained \cite{leonhardt1997measuring}: while Alice generates the raw random numbers, she also reconstructs the state $\rho_A$. Then it is possible to evaluate numerically the quantum conditional min-entropy by using \eqref{eq:cond_min_entropy} and \eqref{eq:gues_cond}. Although for a qubit system, this problem was elegantly addressed by \cite{Fiorentino2007a}, it is not of easy solution in the CV case. On the other hand, Corollary 1 gives an easy lower bound on $H_{\rm min}(X|\mathcal E)$. Alice knows that even if Eve forges a state with an optimal $\mathcal{E}$, such side information will not let Eve guess the heterodyne outcome with a probability (density) larger than $\frac{1}{\pi}$. In the presence on an imperfect source of quantum states, this is the most conservative strategy to adopt, but ensures the generation of completely secure random numbers while avoiding a complex numerical maximization. It is worth noticing that in many cases such lower bound is {\it tight}: indeed, coherent and thermal states have positive Glauber-Sudarshan $\mathcal P(\alpha)$ function and for those states the bound $\log_2\pi$ is tight. Moreover, in contrast to other Semi-DI QRNG where the min-entropy needs to be estimated in real time to provide security \cite{Lunghi2014,Brask2017,Marangon2017}, in our protocol it depends on the structure of the heterodyne POVM and it is always constant. Hence, Alice can apply on $X$ a randomness extractor calibrated on $\log_2\pi$ and erase any guessing advantage of Eve. In the following we adapt the bound of Corollary 1 to realistic POVMs with finite resolution. \subsection{Practical Bound} \begin{figure*}[!t] \includegraphics[width=\textwidth]{Fig2.jpg} \caption{Schematic representation of the experimental setup. Only commercial off-the-shelf devices were used.} \label{img:schema3D} \end{figure*} In a real implementation, any heterodyne measurement is discretized. This means that the possible outcomes of the measure are discrete with a resolution given by $\delta_q$ and $\delta_p$ for the two ``quadratures''. The discretized version of the POVM $\hat\Pi_\alpha$ is then given by $ \hat \Pi^{\delta}_{m,n}= \int_{m\delta_q}^{(m+1)\delta_q}\!\!d\Re{\rm e}\alpha \int_{n\delta_p}^{(n+1)\delta_p}\!\!d\Im \text{m}\alpha \,\,\hat\Pi_\alpha $ and the average probability of guessing their outputs is given by $P_\text{guess}(X|\mathcal{E})= \max_{\{p_\beta ,\hat\tau^A_\beta \}} \int p(\beta) \max_{m,n} \Tr\left[\hat\Pi^\delta_{m,n} \hat\tau^A_\beta \right] $. The term $\text{Tr}\left[\hat\Pi^\delta_{m,n} \hat\tau^A_\beta \right]$ is upper bounded by $\frac{\delta_q\delta_p}{\pi}$. Then the probability $P_\text{guess}$ is upper bounded by $\frac{\delta_p\delta_q}{\pi}$ and the quantum min-entropy is lower bounded by \begin{equation} \label{eq:bound} H_\text{min}(X_\delta|\mathcal{E}) \geq \log_2\frac{\pi}{\delta_q\delta_p}\,. \end{equation} Hence, in the real-life implementation, the min-entropy of the random numbers is bounded by a function that depends on the measurement resolution only. The measurement, in this scenario, is under control of the user: Alice can readily obtain the min-entropy (\ref{eq:bound}) by measuring $\delta_p$ and $\delta_q$ of her well characterized apparatus. The min-entropy is constant and Alice does not need to worry updating its value, as long as she trusts the apparatus. \section{ Experimental results} The proposed new protocol has been implemented with an all-fiber setup at telecom wavelength with the scheme in Fig. \ref{img:schema3D}; in this way is possible to exploit the availability of fast off-the-shelf components for classical telecommunication while keeping the setup compact. The heart of the experiment lies in the heterodyne detection of the vacuum state, that samples the $Q$ function with the help of a coherent field $\ket{\alpha}$ of a Local Oscillator (LO). We employed a narrow linewidth ECL laser at $1550 \si{\nano\meter}$ (Thorlabs SFL1550) followed by and electronically-controlled Variable Optical Attenuator (VOA) and a in-line Polarization Controller (PC). In this way we were able to finely control the intensity and the polarization of our LO, besides making the calibration procedure automatized. Before entering the heterodyne measurement, $10\%$ of the LO is sent to a photodetector, for a continuous monitor of its intensity. By doing that, any anomaly to the normal functioning of the LO can be noticed in real-time, and deviations can be compensated during the post-processing. The optical heterodyne was realized with a commercial fiber integrated \virgolette{90 degree hybrid}: one port is coupled to the LO while from the other is entering the vacuum state. However, we work in the SDI scenario and, from the point of view of security, this port can be fully controlled by Eve, since we don't assume anything about the source. The 90 degree hybrid mixes the signal with the LO and returns two pairs of outputs, featuring a $\nicefrac{\pi}{2}$ phase shift. These optical signals, detected by a couple of high-bandwidth balanced detectors ($1.6\, \si{\giga\hertz} $ Thorlabs-PDB480C), are proportional to the quadratures of the signal, Re$\left[ \alpha \right]$, Im$\left[ \alpha \right]$. We sampled both signals coming from the detectors using a fast oscilloscope with a sampling rate of $10$ GSamples/s at 10 bits of resolution (Lecroy HDO 9404). Each samples contains 20 bits of raw data, 10-bit for Re$\left[\alpha\right]$ and 10-bit for Im$\left[\alpha\right]$. The raw signals of the ADC are proportional to the quadratures and directly sample the Q-function in the phase space, as shown in Fig. \ref{img:fig_exp}. The resolution of the ADC can be directly converted to the equivalent resolution in the phase space; in our case we got $\delta\text{Re}\left[\alpha\right]=(14.05 \pm 0.02)\cdot10^{-3} $ and $\delta\text{Im}\left[\alpha\right]=(14.14 \pm 0.02)\cdot10^{-3}$, respectively. \begin{figure}[!ht] \begin{center} \includegraphics[width=\linewidth]{Fig3.png} \end{center} \caption{The plot shows the Husimi function for the vacuum (meshed curve) and the measured state (colored histogram). The measured variance is slightly larger that the one expected for the vacuum due to the electronic noise that widens the distribution. } \label{img:fig_exp} \end{figure} The raw data are then digitally filtered, taking only a $1.25\, \si{\giga\hertz} $ window in the central part of the spectrum obtained by the detectors. This is necessary in order to remove classical noise that is coupled with the detector. Finally, the data are downsampled at $1.25$ GSample/s, matching the bandwidth of the signal and removing any correlation introduced by the oversampling. We acquired $6\cdot10^{10}$ measurements obtaining $\sigma^2_{\text{Re}\left[\alpha\right]}=0.55135 \pm 0.00001$ and $\sigma^2_{\text{Im}\left[\alpha\right]}=0.56732 \pm 0.00001$. As it can be seen from Fig. \ref{img:fig_exp}, the measured Q-function is slightly larger than the one expected for a pure vacuum state, where both variances are expected to be equal to 1/2. The increase of the variances is due to classical noise of the detectors: in our approach, such noise is regarded as a ``spreading'' of the Q-function and thus is already included in our analysis for the quantum min-entropy. The classical min-entropy $H_{\rm min}(X)$ corresponds to the larger probability of output and it is given by \begin{equation} \label{eq:HminClassical} H_{\rm min}(X)=14.100\,. \end{equation} However, the quantum min-entropy can be lower bounded by eq. \eqref{eq:bound}. With the quadrature resolutions used for the experiment, we obtain \begin{equation} H_{\rm min}(X|\mathcal{E}) \geq 13.949\,, \label{eq:hmin} \end{equation} for an equivalent secure generation rate of 17.42 Gbit/s. It is worth noticing that the high gain in security guaranteed by the conditional quantum min-entropy of eq. \eqref{eq:hmin} with respect to the classical min-entropy eq. \eqref{eq:HminClassical} implies a very small reduction of the generation rate (from 14.10 to 13.949 bits per sample). In addition, these rates are not calculated in the asymptotic regime, i.e. in the limit of infinite repetitions of the protocol, but are valid for single shot measurements. In fact, the conditional min-entropy $H_{\text{min}}(X|\mathcal{E})$ is not estimated from the data, but it's bounded considering the structure of the POVM and the optimal strategy for the attacker, making it independent from the number of rounds of the protocol. Finally, a Toeplitz randomness extractor \cite{Frauchiger2013} is calibrated using $H_{\rm min}(X|\mathcal{E})$, and extracts the certified numbers from the raw data. As a final check, we applied a series of statistical tests from the DieHarder and NIST suite: all of them are successfully passed, as shown in Appendix \ref{sec:statistica_tests}. \section{Conclusions} In this work we demonstrated the versatility of heterodyne detection scheme for the generation of secure random numbers in a CV-SDI framework, where no assumption on the source of quantum state is required. In fact, exploiting the properties of the POVM implemented by the heterodyne measurement, in Corollary 1 we obtained a direct lower bound to the conditional min-entropy, and hence on its security. This bound enables the user to erase all the side information related with an imperfect or malicious source of quantum states. Compared to previous SDI-QRNGs \cite{Vallone2014,Ma2016,Marangon2017} this security is obtained without affecting the generation rate: in the previous protocols, part of the generated numbers were consumed to estimate and update the bound to the conditional min-entropy. In the protocol introduced here, the bound is constant, since it is determined by the resolution of the trusted measurement apparatus only. Hence, \textsl{all} the secure numbers are available to the user. Such simplification has many advantages for any practical implementation of the protocol. Our approach allows indeed to merge the speed of heterodyne measurements and the security of semi-device-independent protocols. Indeed, we realized the protocol with off-the-shelf components achieving 17.42 Gbit/s rates, which is to our knowledge the fastest random generation rate for a semi-DI QRNG. \begin{acknowledgments} The authors thank R. Filip for fruitful discussions. \end{acknowledgments}
\section{Summary and conclusion} By looking at the luminosity spectra generated for this study, the expected rise in luminosity for the proposed ILC250 parameter sets is confirmed. The total luminosity resulting from the new official beam parameter set (A) is increased by about \SI{97}{\percent} with respect to the original beam parameters, leading to a new value of \SI{1.62e34}{\per\centi\meter\squared\per\second}. The background studies indicate that the new beam parameters increase the \Pep\Pem pair background density and the SiD vertex detector occupancy by only a factor of about 2-3 in comparison to the original TDR beam parameters. As for a precision detector the aim is to keep the overall ratio of so-called ``dead'' cells with a full buffer below a per mill level, any rise in the occupancy level can be critical. Although the density of the pair background close to the interaction point rises, the normalized vertex detector occupancy for the new set is well below 10$^{-4}$. The highest occupancy is reached in the innermost layer with a fraction of dead cells of about \num{5e-5}, assuming a buffer depth of four.\\ The SiD Optimization group is confident that this rise in the occupancy can be accommodated in the design of the SiD vertex detector without a loss in precision for the physics studies. Therefore, the SiD group welcomes the decision to change the beam parameters in order to gain higher luminosities and to strengthen the physics program. \section{The pair background envelopes} \label{sec:Envelopes} For all ILC250 parameter sets listed in Table~\ref{tab:Parameters}, a full bunch train (1312 bunch crossings) of the pair background particles was generated. The GuineaPig\xspace generation does not take the crossing angle of \SI{14}{\milli\radian} into account. The calculation of the helix tracks that the pairs form in the SiD solenoid field with a strength of \SI{5}{\tesla} was done using the algorithm described in a former note presenting the pair envelopes of the ILC500 scheme~\cite{HelixProceeding}. Figure~\ref{fig:Envelopes} shows the density of pairs in the area around the interaction point. Since the particles are deflected in the solenoid field, they form helix tracks that reach out towards the innermost layers of the detector. The red solid lines in the plots represent the outline of the beam pipe. The beam envelopes of schemes (B) and (C) are significantly expanded with respect to the beam envelopes of the TDR scheme, whilst the pair envelope for set (A) is still contained within the beam pipe. The projection of the pair background density along $x$ (Figure~\ref{fig:Projection_Envelopes}) shows that the number of pairs in set (A) is increased by a factor of 2-3 in comparison to the TDR scheme, and by a factor of 6-7 in sets (B) and (C). Nevertheless, the envelopes for all parameter schemes are well contained within the beam pipe. At a beam pipe radius of \SI{12}{\milli\meter}, one can expect less than 10 interactions of pairs with the material of the beam pipe per bunch crossing. \begin{figure} \centering \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=\textwidth] {Helix_tracks_xz_100bunches_250GeV_5T_DanielJeans-1.jpg} \caption{\textit{ILC250 set (TDR)}} \end{subfigure} \hspace*{0.08cm} \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=\textwidth] {Helix_tracks_xz_80bunches_250GeV_5T_Reduced_Emittance_x-1.jpg} \caption{\textit{ILC250 set (A)}} \end{subfigure} \\ \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=\textwidth] {Helix_tracks_xz_50bunches_250GeV_5T_Reduced_Emittance_x_Reduced_Beta_x-1.jpg} \caption{\textit{ILC250 set (B)}} \end{subfigure} \hspace*{0.08cm} \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=\textwidth] {Helix_tracks_xz_50bunches_250GeV_5T_Reduced_Emittance_x_Reduced_Beta_x_Increased_Beta_y-1.jpg} \caption{\textit{ILC250 set (C)}} \end{subfigure} \caption{\textit{Pair background density for the different ILC250 beam parameter sets for a full bunch train (1312 bunch crossings). Although the pairs are deflected in the SiD solenoid field, the high-p\textsubscript{T} pairs reach past the beam pipe towards the inner layers of the detector. The beam pipe is represented by the red solid lines.}} \label{fig:Envelopes} \end{figure} \begin{figure} \centering \includegraphics[width=0.78\textwidth] {HelixEnvelope_Projection_Comparison_250GeV_parametersets_LEG.png} \caption{\textit{Projection of the pair background density for a full bunch train (1312 bunch crossings), which is shown in Figure~\ref{fig:Envelopes}, along the x direction. The projection is done for z $=$ \SI{62}{\milli\meter}, the z position of the first beam pipe kink. At that position, the background envelopes are the largest compared to the beam pipe radius. The beam pipe is indicated by the pink solid lines.}} \label{fig:Projection_Envelopes} \end{figure} \iffalse The projection of the helix tracks from the pair background particles of one bunch crossing are shown in the xz- and yz-plane in Figures a) and c). The color scales shows how many particle tracks are in the single bins of these plots. To get a better grasp, Figures b) and d) show the envelopes outlining certain fractions of helix tracks. Therefore, the blue line represents the envelope of 99\% of all pair tracks. In all subfigures, the thin red lines represent the beam pipe. The helix tracks were calculated for a homogeneous magnetic field of \unit{5}\,{T}. \fi \section{The luminosity spectra of the ILC250 beam parameter sets} \label{sec:Envelopes} The processes, in which the beamstrahlung from beam-beam interactions produces secondary \Pep \Pem pairs, were simulated with GuineaPig\xspace~\cite{Schulte:1997nga}. GuineaPig\xspace is a Monte Carlo (MC) background event generator comparable to CAIN~\cite{CAIN}, which was used for the ILC250 background studies presented at AWLC17~\cite{AWLC_Jeans}.\\ Using the beam particle distributions generated by GuineaPig\xspace, the luminosity spectra of the ILC250 stage parameters can be plotted as shown in Figure~\ref{fig:Lumi_Spectra}. \begin{figure}[h] \centering \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=\textwidth] {Lumi_Spectrum.png} \caption{} \end{subfigure} \hspace*{0.08cm} \begin{subfigure}[t]{0.49\textwidth} \centering \includegraphics[width=1.02\textwidth] {Lumi_Spectrum_zoom.png} \caption{} \end{subfigure} \caption{\textit{Luminosity spectra generated with GuineaPig\xspace, using the ILC250 parameter sets listed in Table~\ref{tab:Parameters}. Figure (b) shows the spectra zoomed in at around \SI{250}{\GeV}.}} \label{fig:Lumi_Spectra} \end{figure} \\Comparing the total luminosity resulting from the spectra in Figure~\ref{fig:Lumi_Spectra}, the expected rise in the luminosity due to the reduction of the horizontal beam emittance and the beta function is demonstrated. \\The value for the TDR set (\SI{8.26e33}{\per\centi\meter\squared\per\second}) confirms the calculations of the luminosity done for the Change Request CR-005, which states a value of \SI{8.2e33}{\per\centi\meter\squared\per\second}~\cite{CR-005}. The new official beam parameters of set (A) produce a luminosity of \SI{1.62e34}{\per\centi\meter\squared\per\second}, which is an increase of about \SI{97}{\percent}. \begin{table}[h] \centering \begin{tabularx}{0.4\textwidth}{cc} \hline\hline \textbf{Set} & Luminosity [\si{\per\centi\meter\squared\per\second}]\\ \hline \cline{1-2} \hline TDR & \num{8.26e33}\\ \rowcolor{Gray} (A) & \num{1.62e34}\\ (B) & \num{2.38e34}\\ (C) & \num{2.15e34}\\ \hline\hline \end{tabularx} \caption{\textit{The total luminosities resulting from the luminosity spectra generated with GuineaPig\xspace for the different ILC250 beam parameter sets.}} \label{tab:Luminosity} \end{table} \section{Introduction} \label{sec:introduction} In November 2017, the panel of the International Committee for Future Accelerators (ICFA) made an official statement that the first stage of the International Linear Collider (ILC) will have a center-of-mass energy of \SI{250}{\GeV} instead of \SI{500}{\GeV}, with the goal to reduce the total costs of the ILC project~\cite{ICFA_Statement}. In order to increase the luminosity of this ILC250 stage, new beam parameters were suggested at the Americas Workshop on Linear Colliders (AWLC2017) at SLAC in June 2017~\cite{AWLC_Yokoya, AWLC_Jeans}. The changes to the parameter sets were officially approved as the Change Request CR-0016 by the Technical Change and Management Board (TCMB) in September 2017~\cite{CR-0016}.\\ The changes include the reduction of the horizontal beam emittance, which causes a rise in the luminosity. The luminosity is the topic of the first section of this note. The reduced beam emittance on the other hand also leads to a larger electron positron pair background from increased beam-beam interactions, and to an effect on the spatial distribution of these pairs. The magnetic solenoid field of the detectors forces the pair background particles into helix tracks which extend to the inner layers of the detector. Since the detector concepts proposed for the ILC will be designed to deliver measurements with unprecedented precisions, the detector geometry and the readout designs have to be carefully optimized.\\ This note presents a study of the density of the \Pep\Pem pair particles for four different beam parameter sets of the ILC250 stage. Additionally, the vertex detector occupancy of the Silicon Detector (SiD) was analyzed in order to see the effect of the increased background on the detector. The performance of the vertex detector plays a crucial role for the precision of physics studies. Therefore, the aim is to keep the overall ratio of so-called dead cells below a per mill level. By definition, a detector pixel cell is ``dead'' when no further hits can be stored in its available buffers.\\ The plots in the sections regarding the background density and the arising detector occupancy display the envelopes of the pair helix tracks, as well as the vertex detector occupancy for the new ILC250 parameter set in comparison to other possible beam parameters. Adapting the naming scheme of the change request CR-0016, the beam parameter schemes are as listed in Table~\ref{tab:Parameters}. The new official beam parameters are given by set (A), for which the horizontal beam emittance $\epsilon_x$ is reduced by half compared to the original parameters given in the Technical Design Report (TDR)~\cite[p. 11]{TDR1}. \begin{table}[h] \centering \begin{tabularx}{0.52\textwidth}{llll} \hline\hline \textbf{Set} & \textbf{$\epsilon_x$ [\murm m]} & \textbf{$\beta^*_x$ [mm]} & \textbf{$\beta^*_y$ [mm]}\\ \hline \cline{1-4} \hline TDR & 10 & 13.0 & 0.41\\ \rowcolor{Gray} (A) & 5 & 13.0 & 0.41\\ (B) & 5 & 9.19 & 0.41\\ (C) & 5 & 9.19 & 0.58\\ \hline\hline \end{tabularx} \caption{\textit{The new official beam parameter set is set (A)~\cite{CR-0016}. Sets (B) and (C) were further possibilities that were under discussion. The table only lists the parameters that are to be changed with respect to the original ILC250 parameters (set (TDR)) given in the Technical Design Report (TDR)~\cite[p. 11]{TDR1}.\\ For all new sets, the horizontal emittance $\epsilon_x$ is reduced. Additionally, the horizontal and vertical beta functions at the IP, $\beta^*_x$ and $\beta^*_y$, are reduced for sets (B) and (C).}} \label{tab:Parameters} \end{table} \input{Luminosity} \input{Envelopes} \input{Occupancies} \input{Conclusions} \section*{Acknowledgments} The author would like to thank the SiD Optimization group, as well as Daniel Jeans (KEK) for useful discussions and helpful input to the presented studies. \bibliographystyle{unsrt} \section{SiD vertex detector occupancies} The occupancy of the SiD vertex detector is calculated by counting the hits from the pair background per pixel for a full bunch train (1312 bunch crossings). The sensor buffers are read out after every train, and therefore have to be suitable for the expected detector occupancy. For the study of the occupancy, the pair background events were taken from GuineaPig, as described in Section \ref{sec:Envelopes}, and used as input for a full Geant4~\cite{geant_ref,geant_ref2} detector simulation with SLIC~\cite{SLIC}. The crossing angle was applied in this simulation step.\\ Regarding the SiD detector geometry, a pixel size of \SI{20x20}{\micro\meter} was assumed for the vertex detector. The SiD vertex detector is a high-resolution pixel detector with the following requirements: \begin{itemize} \item Spatial hit resolution: $<$ \SI{4}{\micro\meter} \item Momentum resolution: $\sim$ 2-\SI{5e-5}{\GeV} \item $\sim$ \SI{0.1}{\percent} X\textsubscript{0} per layer \end{itemize} Table~\ref{tab:KeyParametersSiD} lists further key parameters and measurements of the vertex detector, for which a visualization is shown in Figure~\ref{fig:SiD}. \begin{table}[h] \centering \begin{tabularx}{\textwidth}{l|llll} \hline\hline & Technology & Inner radius & Outer radius & z extent\\ \hline VXD barrel & Silicon pixels & 1.4 & 6.0 & $\pm 6.25$ \\ \hline\hline & Technology & Inner z & Outer z & Outer radius\\ \hline VXD endcap & Silicon pixels & 7.3 & 83.4 & 16.6 \\ \hline\hline \end{tabularx} \caption{\textit{Key design parameters of the baseline SiD vertex detector (VXD). All dimensions are given in cm.}} \label{tab:KeyParametersSiD} \end{table} \begin{figure} \centering \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{SiD_new.png} \caption{\textit{Visualization of the full SiD detector}} \end{subfigure} \hspace*{0.3cm} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=\textwidth]{SiDVertexDetector.png} \caption{\textit{Visualization of the SiD vertex detector}} \end{subfigure} \caption{\textit{Visualizations of the current design models of the SiD detector (a), and the SiD vertex detector (b).}} \label{fig:SiD} \end{figure} \newpage \subsection{Occupancy studies for the current SiD design} The current SiD design with an L$^*$ of \SI{4.1}{\meter} (the distance between the interaction point and the last quadrupole magnet of the Final-Focus system) foresees an anti-DiD magnet with a magnetic field strength of \SI{600}{\gauss}. It reduces the pair background occupancy by sweeping the pair background particles through the outgoing beam pipe. The following plots show occupancy studies using the current SiD geometry.\\ On the left hand side of Figure~\ref{fig:All_layers_Occupancy}, the normalized occupancy for the full vertex detector is shown. From that, the ratio of dead cells was calculated (right). A cell is ``dead'' when the number of hits in this cell has reached the cell's buffer depth. Therefore, the number of dead cells is plotted as a function of the assumed buffer depth for the vertex detector cells. For all layers combined, the new parameter scheme (A) leads to a fraction of dead cells that is 2-3 times higher than for the TDR set. Again, for the schemes (B) and (C), the fraction is even higher. \\In general, the occupancy in layer 0 is higher than in the other layers, as it is the layer closest to the interaction point. Here, the occupancy for the new sets is significantly increased with respect to the TDR scheme (see Figure~\ref{fig:Layer0_Occupancy}). \begin{figure}[h] \centering \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.06\textwidth]{Occupancy_Comparison_All_layers_wrt_cells_ILC250_Comparison_ALL_SETS_5T_w_antiDiD_LEG.png} \caption{\textit{Normalized Occupancy:\\Number of cells containing a certain amount of hits, normalized by the total number of cells of the vertex detector.}} \end{subfigure} \hspace*{0.3cm} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{Occupancy_Comparison_All_layers_deadcells_ILC250_Comparison_ALL_SETS_5T_w_antiDiD_LEG.png} \caption{\textit{Ratio of dead cells in comparison to all cells of the vertex detector.}} \end{subfigure} \caption{\textit{Pair background occupancy in the SiD vertex detector for all vertex detector layers combined, after a full bunch train (1312 bunch crossings).}} \label{fig:All_layers_Occupancy} \end{figure} \begin{figure}[h!] \centering \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{Occupancy_Comparison_Layer_0_numcells_ILC250_Comparison_ALL_SETS_5T_w_antiDiD_LEG.png} \caption{\textit{Layer 0: Normalized Occupancy}} \end{subfigure} \hspace*{0.3cm} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{Occupancy_Comparison_Layer_0_deadcells_ILC250_Comparison_ALL_SETS_5T_w_antiDiD_LEG.png} \caption{\textit{Layer 0: Ratio of dead cells}} \end{subfigure} \caption{\textit{Pair background occupancy in the SiD vertex detector layer 0, after a full bunch train (1312 bunch crossings). The plot on the left hand side shows the normalized occupancy, the ratio of dead cells is shown on the right side.}} \label{fig:Layer0_Occupancy} \end{figure} \subsection{Occupancy studies as a comparison of different SiD designs} In the following, different SiD designs are compared by observing the vertex detector occupancy for the new ILC250 parameter set (A). The studied designs are different combinations of the old L$^*$ value (\SI{3.5}{\meter}) vs. the new value, and of the inclusion or exclusion of the anti-DiD field. Again, the normalized occupancy is plotted for all vertex detector layers combined, as well as only for layer 0 (see Figure~\ref{fig:SiD_comparison}). \begin{figure}[!h] \centering \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{Occupancy_Comparison_All_layers_wrt_cells_ILC250_Comparison_Set_A_All_SiD_designs_LEG.png} \caption{\textit{All layers combined}} \end{subfigure} \hspace*{0.3cm} \begin{subfigure}[t]{0.45\textwidth} \centering \includegraphics[width=1.05\textwidth]{Occupancy_Comparison_Layer_0_numcells_ILC250_Comparison_Set_A_All_SiD_designs_LEG.png} \caption{\textit{Layer 0}} \end{subfigure} \caption{\textit{Pair background occupancy in the SiD vertex detector for different SiD designs, after a full bunch train (1312 bunch crossings). The plot on the left hand side shows the normalized occupancy for all layers combined, whilst the normalized occupancy for only layer 0 is shown on the right.}} \label{fig:SiD_comparison} \end{figure} \\Figure~\ref{fig:SiD_comparison} shows that the SiD design does not have a big impact on the vertex detector occupancy from the pair background. The lowest occupancy is reached for the SiD design with the old L$^*$ and anti-DiD.\\ However, the current SiD design (new L$^*$ with anti-DiD) shows occupancy levels that are only marginally worse. Assuming a buffer depth of four, just above 10$^{-5}$ of all cells in layer 0 would have full buffers, filled with exactly four hits. With the rule of thumb that the vertex detector occupancy for backgrounds should be below 10$^{-4}$, the occupancies for all studies shown in this note are well below this boundary.
\section{Introduction} Let $G$ be a connected graph of order at least $2$ and {\em diameter} $D(G)$. The {\em Wiener polynomial} of $G$ is defined as \[ W(G;x)=\sum x^{d(u,v)}, \] where $d(u,v) = d_G(u,v)$ is the {\em distance} between $u$ and $v$, and the sum is taken over all distinct unordered pairs of vertices $u$ and $v$ of $G$. Thus if $d_i(G)$ denotes the number of pairs of vertices distance $i$ apart in $G$, for $i = 1,2,\ldots,D(G)$, then \[ W(G;x) = \sum_{i=1}^{D(G)} d_i(G)x^i. \] If $G$ is clear from context, then we write $d_i$ and $D$ instead of $d_i(G)$ and $D(G),$ respectively. Note that we restrict our discussions to connected graphs of order at least $2$ throughout, so that the Wiener polynomial is well-defined and nonzero. Adding loops or multiple edges to a connected graph has no effect on the Wiener polynomial, so we lose no generality by considering only simple graphs. The successful study of the chromatic~\cite{Chromatic}, characteristic~\cite{Characteristic}, independence~\cite{Independence} and reliability~\cite{Reliability} polynomials of graphs has motivated the study of various other graph polynomials. The Wiener polynomial was introduced in \cite{Hos} and independently in \cite{SYZ}, and has since been studied several times (see \cite{di,GKYY, WRSSG, YYY}, for example). Unlike many other graph polynomials (such as the chromatic, reliability and independence polynomials), the Wiener polynomial can be calculated in polynomial time. Interest in the Wiener polynomial first arose out of work on the {\em Wiener index} of a connected graph, introduced in \cite{Wien} and defined as the sum of the distances between all pairs of vertices of the graph. It can readily be seen that the Wiener index of $G$ is obtained by evaluating the derivative of the Wiener polynomial of $G$ at $x=1$. The Wiener index of a molecular graph is closely correlated with certain physical properties of the substance, such as its melting and boiling point; see \cite{Wien, GK, ST, RC}. Applications of the Wiener index have also been found outside of chemisty, for example in the design of architectural floor plans~\cite{architect}. Wiener polynomials of trees will be of particular interest to us, so we mention that the Wiener polynomial of a tree also arises in the context of network reliability. Given a graph $G$ in which each edge is operational with probability $p$, the \emph{resilience} or \emph{pair-connected reliability} of $G$ is the expected number of pairs of vertices of $G$ that can communicate~\cite{Colbourn, ASS1993}. In particular, in a tree $T$, the probability that any pair of vertices $u$ and $v$ can communicate is simply $p^{d(u,v)}$. Therefore, the resilience of $T$ is exactly $W(T;p)$. In this article, we focus on the study of the roots of the Wiener polynomial of a graph $G$, which we call the \emph{Wiener roots} of $G$. The Wiener roots of all connected graphs of order $8$ are shown in Figure~\ref{order8}. Though the Wiener roots of some narrow families of graphs were studied in \cite{di}, little is known about the nature and location of the Wiener roots of graphs in general. Given that properties of the roots of other graph polynomials have been well-studied, it is natural to study the roots of the Wiener polynomial in greater depth. \begin{figure}[ht] \centering \begin{tikzpicture} \node[inner sep=0pt,left] (plot) at (0,0) {\includegraphics[scale=0.5]{order8.eps}}; \node[right] at (0,-0.05) {\footnotesize $\mbox{Re}(z)$}; \node at (-0.55,1.4) {\footnotesize $\mbox{Im}(z)$}; \end{tikzpicture} \caption{The Wiener roots of all connected graphs of order $8$.} \label{order8} \end{figure} Since $W(G;x) = x(d_1+d_2x+ \ldots +d_Dx^{D-1})$, we see that $x=0$ is a root of every Wiener polynomial. The remaining roots are those of the polynomial $\widehat{W}(G;x) = d_1+d_2x+ \ldots +d_Dx^{D-1}$, which we will refer to as the {\em reduced Wiener polynomial} of $G$. Note that the value of $d_{1}$ is the number of edges, so that if the order of $G$ is at least $2$, then $0$ is \emph{not} a root of $\widehat{W}(G;x)$ (and hence is a simple root of the original Wiener polynomial $W(G;x)$). The layout of the article is as follows. In Section~\ref{BoundSection}, we determine that $\binom{n}{2}-1$ is the maximum modulus among all Wiener roots of connected graphs of order $n$, and we describe the extremal graphs which have a root of this maximum modulus. In contrast, we then show that for trees, the rate of growth of the maximum modulus is $\Theta(n)$. Finally, we determine that $\tfrac{2}{n-2}$ is the minimum modulus among all nonzero Wiener roots of connected graphs of order $n$, and again we are able to describe the extremal graphs (which are trees). In Section~\ref{DensitySection}, we prove that the closure of the collection of all real Wiener roots of connected graphs is $( -\infty, 0]$, and that for trees, the closure of all real Wiener roots still contains $(-\infty,-1]$. In Section~\ref{RealAndImagSection}, we study the real and imaginary parts of Wiener roots. We show that there are Wiener roots of trees with arbitrarily large imaginary part, and that there are Wiener roots of trees with arbitrarily large positive real part. This work culminates in a proof of the fact that the collection of complex Wiener roots of all graphs is not contained in any {\em half-plane} (a region in the complex plane consisting of all points on one side of a line and no points on the other side). Finally, we prove that almost all graphs have all real Wiener roots, and we find purely imaginary Wiener roots. Throughout, we compare and contrast our results with what is known about the roots of other graph polynomials. \section{Bounding the Modulus of Wiener Roots}\label{BoundSection} Bounding the modulus of roots of various graph polynomials has been a central point of interest in the literature. For example, Sokal~\cite{S} settled an outstanding problem in proving that the modulus of a chromatic root (a root of the chromatic polynomial) of a graph of maximum degree $\Delta$ is at most a constant times $\Delta$. This implies that the modulus of any chromatic root of a graph of order $n$ is at most $Cn$ for some positive constant $C$; the precise value of the smallest such constant is still unknown. The \emph{independence polynomial} of a graph $G$ is the generating function for the number of independent sets of each cardinality in $G$. Among all graphs of order $n$ and fixed independence number $\beta$, the maximum modulus of an independence root is $(n/\beta)^{\beta-1}+O\left({n}^{\beta - 2}\right)$~\cite{BN}. For the \emph{all-terminal reliability} polynomial, it is suspected that the collection of all roots is bounded in modulus (as no roots have been found outside of the disk $|z-1|\leq 1.2$). Currently the best known upper bound on the modulus of the roots for all graphs of order $n$ is linear in $n$ as shown in ~\cite{BM}. For the independence polynomials, the all-terminal-reliability polynomials and the chromatic polynomials, the extremal graphs that yield roots of maximum modulus are not known. In contrast we completely determine the extremal graphs for which the Wiener polynomials, of all connected graphs of order $n$, have maximum modulus of any root. To do so, we will make use of the classical Enestr\"{o}m-Kakeya Theorem~\cite{EK}. \begin{theorem}[The Enestr\"{o}m-Kakeya Theorem] If $f(x) = a_0+a_1x+ \ldots+a_nx^n$ has positive real coefficients, then all complex roots of $f$ lie in the annulus \[r \le |z| \le R\] where $r =\min \left\{\frac{a_i}{a_{i+1}}: 0 \le i \le n-1\right\}$ and $R =\max\left\{\frac{a_i}{a_{i+1}}: 0 \le i \le n-1\right\}$.\hfill \qed \end{theorem} As a straightforward application of the Enestr\"om-Kakeya Theorem, consider the path $P_n$ of order $n\geq 3$. The reduced Wiener polynomial of $P_n$ is given by \[ \widehat{W}(P_n;x)=\sum_{i=1}^{n-1} (n-i)x^{i-1}. \] Thus by the Enestr\"om-Kakeya Theorem, the nonzero Wiener roots of $P_n$ lie in the annulus $1<\frac{n-1}{n-2}\leq |z| \leq 2$. This improves a result from~\cite{di}. We now turn our attention to the collection of all Wiener roots of connected graphs of order $n$. We find the exact maximum modulus among all roots in this collection, and we describe the unique graph with a Wiener root of this maximum modulus. \begin{theorem} The maximum modulus among Wiener roots of connected graphs of order $n \geq 2$ is $\binom{n}{2}-1$. Moreover, for $n \geq 3$, $K_n-e$ is the unique graph of order $n$ with a Wiener root of this modulus. \end{theorem} \begin{proof} If $G$ is a complete graph, then $W(G;x) = nx$, whose only root is $0$. So we may assume that $G$ is not complete, and hence has order $n\geq 3$ and diameter $D\geq 2$. Let $z$ be any root of the reduced Wiener polynomial $\widehat{W}(G;x) =\sum_{i=1}^{D} d_ix^{i-1}$. By the Enestr\"{o}m-Kakeya Theorem, \[ |z| \le \max\left\{\tfrac{d_i}{d_{i+1}}: 1 \le i \le D-1\right\}. \] Since all the $d_{i}$ are at least $1$, $\sum_{i=1}^D d_i = \tbinom{n}{2}$, and $D \geq 2$, we observe that \[ \max\left\{d_i: 1 \le i \le D\right\} \leq \tbinom{n}{2}-1 \ \ \ \mbox{ and } \ \ \ \min\left\{d_i : 1 \le i \le D\right\} \ge 1. \] Hence, by the Enestr\"{o}m-Kakeya Theorem, $|z| \le \binom{n}{2}-1$. Finally, we note that \[ W(K_{n}-e;x) = \left( \tbinom{n}{2}-1 \right) x + x^{2} \] has a root at $x =-\left(\binom{n}{2}-1\right)$. Moreover, if $\max\{d_i/d_{i+1}\colon\ 1\leq i\leq D-1\} = \binom{n}{2}-1$, then $D = 2$, $d_{1} = \binom{n}{2}-1$ and $d_{2} = 1$, which implies that $G\cong K_{n}-e$. We conclude that $K_n-e$ is the unique connected graph of order $n \geq 3$ with a Wiener root of modulus $\binom{n}{2}-1$. \end{proof} Thus, the growth of the maximum modulus among all Wiener roots of graphs of order $n$ is only $\Theta(n^2)$. However, the problem is quite different for trees. We show now that the growth rate of the maximum modulus among all Wiener roots of trees of order $n$ is $\Theta(n)$. We begin with a lemma that will allow us to apply the Enestr\"{o}m-Kakeya Theorem directly. Throughout, we use the fact that in any tree $T$, pairs at distance $k$ correspond exactly to paths of length $k$. \begin{lemma} \label{treelemmamodulus} Let $T$ be a tree of order $n \ge 3$ with diameter $D$. Then \[ \frac{d_k(T)}{d_{k+1}(T)} \le 2(n-D) \] for $1 \le k < D$. \end{lemma} \begin{proof} We proceed by induction on $n$. If $n=3$, then $T\cong P_3,$ so $D=2,$ $d_1(T)=2,$ and $d_2(T)=1$. The result readily follows in this case. Now assume, for some $n > 3$, that the result holds for all trees with $n-1$ vertices. Let $T$ be a tree of order $n>3$ and with diameter $D$. Let $1 \le k < D$. A simple induction on $n$ shows that $d_2 \ge n-2$, so that \[ \frac{d_1}{d_{2}} \leq \frac{n-1}{n-2} = 1 + \frac{1}{n-2} < 2 \leq 2(n-D),\] so we can assume $k \ge 2$. There are two cases to consider. \medbreak \noindent {\bf Case 1:} {\itshape There is a leaf $v$ on a longest path of $T$ such that $T-v$ has diameter $D$.} \noindent Thus, $D\leq n-2$. Let $u$ be the neighbour of $v$ in $T$ and let $T' = T-v$. Let $d_{\ell}(T',u)$ denote the number of paths of length $\ell \ge 1$ in $T'$ that have $u$ as end-vertex. Observe that since $v$ was on a diametral path of $T$ (that is, a shortest path of length $D(G)$), there is some path of length $D-1$ extending from $u$ in $T'$, so $d_\ell(T',u)\geq 1$ for all $l\in\{1,2,\dots,D-1\}$. Further, this implies that there are at most $n-1-(D-1)=n-D$ vertices at distance $\ell$ from $u$ in $T'$ for $\ell \in \{1,\ldots,D-1\}$. All together, we have $1\leq d_\ell(T',u)\leq n-D$ for all $\ell\in\{1,2,\dots,D-1\}.$ Using this fact and the induction hypothesis we see that \begin{align*} d_k(T)&= d_k(T') + d_{k-1}(T',u)\\ & \le 2(n-1-D)d_{k+1}(T') + d_{k-1}(T',u)\\ &=2(n-1-D)\left[d_{k+1}(T)-d_k(T',u)\right]+d_{k-1}(T',u)\\ &=2(n-1-D)d_{k+1}(T) -2(n-1-D)d_k(T',u) + d_{k-1}(T',u)\\ &\le 2(n-1-D)d_{k+1}(T) -2(n-1-D) + n-D\\ &\le 2(n-1-D)d_{k+1}(T)-(n-D-2)\\ &\le 2(n-1-D)d_{k+1}(T)\\ & < 2(n-D)d_{k+1}(T). \end{align*} This holds for all $k$, $2 \le k < D$. \medbreak \noindent{\bf Case 2:} {\itshape If $v$ is any leaf vertex on a longest path of $T$, then $D(T-v) = D-1.$} \noindent It follows that there is a unique diametral path in $T$, say between leaves $u$ and $v$, and both $u$ and $v$ are adjacent to a vertex of degree $2$ in $T$. Let $T'=T-v$, which has order $n-1$ and diameter $D-1$. If $2\le k \le D-2$, then the induction hypothesis applies to $T'$, and the argument is similar to that of Case 1: \begin{align*} d_k(T)&= d_k(T') + d_{k-1}(T',u)\\ & \le 2((n-1)-(D-1))d_{k+1}(T') + d_{k-1}(T',u)\\ &=2(n-D)\left[d_{k+1}(T)-d_k(T',u)\right]+d_{k-1}(T',u)\\ &=2(n-D)d_{k+1}(T) -2(n-D)d_k(T',u) + d_{k-1}(T',u)\\ &\le 2(n-D)d_{k+1}(T) -2(n-D) + n-D\\ &\le 2(n-D)d_{k+1}(T)-(n-D)\\ &< 2(n-D)d_{k+1}(T). \end{align*} Suppose now that $k=D-1$. Since $T'$ has diameter $D-1$, the induction hypothesis does not apply as above. However, we know that $d_D(T)=1,$ so it suffices to show that $d_{D-1}(T)\leq 2(n-D)$. First, we show that every path of length $D-1$ in $T$ has an end in $\{u,v\}$. Suppose otherwise that there is a pair of vertices $\{x,y\}$ at distance $D-1$ in $T$, with $\{x,y\}\cap\{u,v\}=\emptyset.$ Let $P:x = w_{1},w_{2},\ldots,w_{D}=y$ be the path between $x$ and $y$, let $P_{u}$ be the shortest path from $u$ to $P$, say meeting $P$ in vertex $w_{i}$ and similarly define $P_{v}$ as the shortest path from $v$ to $P$, meeting $P$ in vertex $w_{j}$; without loss, $i \leq j$ (see Figure~\ref{pathdiagram}). As the path between $u$ and $v$ is the unique diametral path, it must be the case that the path $P_{u}$ is at most the length of the path between $x$ and $w_{i}$ (otherwise, the path between $u$ and $y$ would be a second diametral path). Likewise, the path $P_{v}$ is at most the length between $v$ and $w_{j}$. However, then the path between $u$ and $v$ would have length at most that of $P$, which is $D-1$, a contradiction. \begin{figure}[ht] \centering \begin{tikzpicture} \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (2,0) {}; \node[vertex] (3) at (3,0) {}; \node[vertex] (4) at (4,0) {}; \node[vertex] (5) at (6,0) {}; \node[vertex] (6) at (7,0) {}; \node[vertex] (7) at (8,0) {}; \node[vertex] (8) at (10,0) {}; \node[vertex] (9) at (2,2) {}; \node[vertex] (10) at (8,2) {}; \path (2) edge (3) (3) edge (4) (5) edge (6) (6) edge (7); \draw (0,0) -- (0.5,0); \draw[dotted] (0.5,0) -- (1.5,0); \draw (1.5,0) -- (2,0); \draw (4,0) -- (4.5,0); \draw[dotted] (4.5,0) -- (5.5,0); \draw (5.5,0) -- (6,0); \draw (8,0) -- (8.5,0); \draw[dotted] (8.5,0) -- (9.5,0); \draw (9.5,0) -- (10,0); \draw (2,2) -- (2.25,1.5); \draw[dotted] (2.25,1.5) -- (2.75,0.5); \draw (2.75,0.5) -- (3,0); \draw (8,2) -- (7.75,1.5); \draw[dotted] (7.75,1.5) -- (7.25,0.5); \draw (7.25,0.5) -- (7,0); \draw (0,-0.4) node {\footnotesize $x=w_1$}; \draw (2,-0.4) node {\footnotesize $w_{i-1}$}; \draw (3,-0.4) node {\footnotesize $w_{i}$}; \draw (4,-0.4) node {\footnotesize $w_{i+1}$}; \draw (6,-0.4) node {\footnotesize $w_{j-1}$}; \draw (7,-0.4) node {\footnotesize $w_{j}$}; \draw (8,-0.4) node {\footnotesize $w_{j+1}$}; \draw (10,-0.4) node {\footnotesize $y=w_D$}; \draw (2,2.4) node {\footnotesize $u$}; \draw (8,2.4) node {\footnotesize $v$}; \end{tikzpicture} \caption{The shortest $x$--$y$ path meets the shortest $u$--$v$ path.} \label{pathdiagram} \end{figure} Thus every pair of vertices at distance $D-1$ in $T$ contains either $u$ or $v$. But since there is a path of length $D$ between $u$ and $v$, and exactly one vertex on this path is at distance $D-1$ from $u$, there are at most $n-D$ vertices at distance $D-1$ from $u$. Similarly, there are at most $n-D$ vertices at distance $D-1$ from $v$. Therefore, $d_{D-1}(T)\leq 2(n-D),$ as desired. \end{proof} Note that Lemma~\ref{treelemmamodulus} implies immediately that $\tfrac{d_k(T)}{d_{k+1}(T)}\leq 2(n-2)$ for any tree $T$ of order $n\geq 3$ and any $1\leq k<D(T)$, since $D(T)\geq 2$ for any tree of order at least $3$. We can prove a stronger result for trees of order $n\geq 5$. We use the following notation. For each $2\leq i\leq \lfloor\tfrac{n}{2}\rfloor$, let $D_{i,n-i}$ denote the double star of order $n$ with $i-1$ leaves attached to one internal vertex and $n-i-1$ leaves attached to the other (see Figure~\ref{doublestar}). Note that all double stars of order $n$ have this form for some $2\leq i\leq \lfloor\tfrac{n}{2}\rfloor$. \begin{figure}[ht] \centering \begin{tikzpicture} \node[vertex] (1) at (1,0) {}; \node[vertex] (2) at (2,0) {}; \node[vertex] (3) at (0,0.5) {}; \node[vertex] (4) at (0,0.2) {}; \node[vertex] (5) at (0,-0.5) {}; \node[vertex] (6) at (3,0.7) {}; \node[vertex] (7) at (3,0.4) {}; \node[vertex] (8) at (3,-0.7) {}; \path (1) edge (2) (1) edge (3) (1) edge (4) (1) edge (5) (2) edge (6) (2) edge (7) (2) edge (8); \draw[dotted] (0,0) -- (0,-0.3); \draw[dotted] (3,0.1) -- (3,-0.4); \draw [decorate,decoration={brace,amplitude=4pt,mirror},xshift=-4pt,yshift=0pt] (0,0.65) -- (0,-0.65) node [left,black,midway,xshift=-3pt] {\footnotesize $i-1$}; \draw [decorate,decoration={brace,amplitude=4pt},xshift=4pt,yshift=0pt] (3,0.85) -- (3,-0.85) node [right,black,midway,xshift=3pt] {\footnotesize $n-i-1$}; \end{tikzpicture} \caption{The double star $D_{i,n-i}$.} \label{doublestar} \end{figure} \begin{corollary}\label{UpperBound} Let $T$ be a tree of order $n\geq 5$. Then \[ \tfrac{d_k}{d_{k+1}}\leq 2(n-4) \] for $1\leq k<D,$ where $D$ is the diameter of $T$. \end{corollary} \begin{proof} By Lemma~\ref{treelemmamodulus}, \[ \tfrac{d_k}{d_{k+1}}\leq 2(n-D) \] for all $1\leq k<D$, so if $D\geq 4$ then we are done. Since $n\geq 5,$ we only need to consider the cases $D=2$ and $D=3.$ \medbreak \noindent{\bf Case 1: }{\itshape $D=2$.} \noindent Then $T\cong K_{1,n-1},$ and \[ W(T;x)=(n-1)x+\binom{n-1}{2}x^2. \] Thus $\tfrac{d_1}{d_2}=\tfrac{2}{n-2}<2(n-4)$ for all $n\geq 5.$ \medbreak \noindent{\bf Case 2: }{\itshape $D=3$.} \noindent Then $T=D_{i, n-i}$ for some $2 \le i \le \lfloor \frac{n}{2} \rfloor$. By straightforward counting, we find \[ W(D_{i,n-i};x)=(n-1)x+\left[\binom{i}{2}+\binom{n-i}{2}\right]x^2+(i-1)(n-i-1)x^3. \] Thus \[ \frac{d_1}{d_2}=\frac{n-1}{\binom{i}{2}+\binom{n-i}{2}}<\frac{n-1}{2}\leq 2(n-4) \ \ \ \ \ \mbox{ for } n\geq 5, \] and \[ \frac{d_2}{d_3}=\frac{\binom{i}{2}+\binom{n-i}{2}}{(i-1)(n-i-1)}\leq \frac{2\binom{n-i}{2}}{(i-1)(n-i-1)}=\frac{n-i}{i-1}\leq n-2\leq 2(n-4) \ \ \mbox{ for } n\geq 6. \] Finally, when $n=5$, we necessarily have $i=2$, and we compute directly that $\tfrac{d_2}{d_3}=2,$ which satisfies the desired bound. \end{proof} Now for any $n\geq 5$, the upper bound of Corollary~\ref{UpperBound} is also an upper bound on the modulus of any Wiener root of a tree of order $n$ by the Enestr\"om-Kakeya Theorem. \begin{corollary}\label{TreeRootBound} Let $T$ be a tree of order $n\geq 5$. If $z$ is a Wiener root of $T$ then $|z|\leq 2(n-4)$. \hfill \qed \end{corollary} While we have observed that the bound of Corollary~\ref{TreeRootBound} is not tight for small values of $n$, we demonstrate in the next theorem that there is a tree $T_n$ (see Figure~\ref{treeexamplemaxmod}) of order $n$ that has a Wiener root whose modulus approaches $\left(1+\tfrac{1}{\sqrt{2}}\right)n$ asymptotically. This means that the growth of the maximum modulus, among all Wiener roots of trees of order $n$, is $\Theta(n)$. We have verified that $T_n$ is the unique tree with Wiener root of maximum modulus among all trees of order $n$ for $5\leq n\leq 17,$ and suspect that this is true for all $n\geq 5.$ \begin{figure}[ht] \centering \begin{tikzpicture} \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (2,0) {}; \node[vertex] (4) at (3,0) {}; \node[vertex] (5) at (4,0) {}; \node[vertex] (6) at (1.3,1) {}; \node[vertex] (7) at (1.7,1) {}; \node[vertex] (8) at (2.7,1) {}; \path (1) edge (2) (2) edge (3) (3) edge (4) (4) edge (5) (3) edge (6) (3) edge (7) (3) edge (8); \draw[dotted] (1.9,1) -- (2.5,1); \draw [decorate,decoration={brace,amplitude=4pt},yshift=4pt] (1.15,1) -- (2.85,1) node [above,black,midway,yshift=3pt] {\footnotesize $n-5$}; \end{tikzpicture} \caption{The tree $T_{n}$.} \label{treeexamplemaxmod} \end{figure} \begin{theorem} For $n \geq 6$, the tree $T_n$ has a real Wiener root in the interval \[ \left(-\left( 1 + \tfrac{1}{\sqrt{2}}\right)n+7, -\left( 1 + \tfrac{1}{\sqrt{2}}\right)n + 8\right). \] \end{theorem} \begin{proof} Observe that \begin{align*} \widehat{W}(T_{n};x) & = n-1 + \left( \tbinom{n-3}{2} +2 \right) x + 2(n-4) x^{2} + x^{3} \end{align*} In particular, \[ \widehat{W}\left(T_{n};-\left( 1 + \tfrac{1}{\sqrt{2}}\right)n + 7\right) = \left( \frac{3}{4} \sqrt{2}-\frac{3}{2}\right)n^2+\left(-\frac{43}{2} \sqrt{2}+\frac{63}{2} \right)n+6, \] which is negative for $n \geq 6$, and \[ \widehat{W}\left(T_{n};-\left( 1 + \tfrac{1}{\sqrt{2}}\right)n + 8\right) = \left( \frac{7}{4}\sqrt{2}-\frac{1}{2}\right)n^2+(-36\sqrt{2}+29)n+63, \] which is positive for all $n$. By the Intermediate Value Theorem, $\widehat{W}(T_{n};x)$, and hence $W(T_n;x)$, has a root in the interval $\left(-\left( 1 + \tfrac{1}{\sqrt{2}}\right)n+7, -\left( 1 + \tfrac{1}{\sqrt{2}}\right)n + 8\right)$ for all $n \geq 6$. \end{proof} Having obtained an upper bound on the modulus of any Wiener root of a graph (or tree) of order $n$, we now turn to a lower bound. Of course, the Wiener root of smallest modulus among all connected graphs of order $n$ is $0$, as $0$ is a root of every Wiener polynomial, but what about the {\em nonzero} root of smallest modulus? Equivalently, what is the smallest modulus of a root of the reduced Wiener polynomial of a connected graph of order $n$? Below we prove a lower bound on the ratio of successive coefficients of the Wiener polynomial which allows us to apply the Enestr\"om-Kakeya Theorem once more. \begin{lemma}\label{RatioLowerBound} Let $G$ be a connected graph of order $n\geq 3$ and diameter $D\geq 2$. Then \[ \frac{d_k}{d_{k+1}} \geq \frac{2}{n-k-1} \] for $1\leq k<D.$ \end{lemma} \begin{proof} Let $k\in\{1,\dots,D-1\}.$ We count ordered pairs $(w,\{u,v\})$, where $d(u,v)=k$ and either $w$ is joined to $u$ and at distance $k+1$ from $v$, or $w$ is joined to $v$ and at distance $k+1$ from $u$; let ${\mathcal S}_{k}$ be the set of all such ordered pairs. Clearly, $|S_k|$ is at most $(n-(k+1))d_{k} = (n-k-1)d_{k}$, as for any pair of vertices $\{u,v\}$ at distance $k$, the $k+1$ vertices on any shortest path between $u$ and $v$ cannot serve as the point $w$. On the other hand, for any pair of vertices $x$ and $y$ at distance $k+1$, fix a path $P$ of this length between them, with vertex $x_1$ adjacent to $x$ on $P$, and $y_1$ adjacent to $y$ on $P$ (it may be the case that $x_1 = y_1$, if $k=1$). Then we can form two distinct ordered pairs, $(x,\{x_1,y\})$ and $(y,\{x,y_1\})$, both of which belong to ${\mathcal S}_{k}$. Working over all pairs of vertices at distance $k+1$, we generate $2d_{k+1}$ pairs through this process, and we claim that they are all distinct. Note first of all that the first coordinate in any ordered pair generated in this manner is adjacent to precisely one element of the second coordinate. Suppose that two pairs $\{x,y\}$ and $\{x',y'\}$ at distance $k+1$ yield the same member of ${\mathcal S}_k$, say $(x,\{x_1,y\})$. Then either $x'=x$ or $y' = x$. Without loss of generality, assume that $x'=x$. Since $x$ is adjacent to $x_1$ and $d(x',y')=k+1>1$, it follows that $y'\neq x_1,$ and thus $y'=y$. We conclude that \[ (n-k-1)d_{k} \geq |{\mathcal S}_{k}| \geq 2d_{k+1}. \qedhere \] \end{proof} \begin{corollary} Among all connected graphs of order $n \geq 3$, the graph $K_{1,n-1}$ has nonzero Wiener root of mimimum modulus $\tfrac{2}{n-2}$. Moreover, $K_{1,n-1}$ is the unique graph of order $n$ with a Wiener root of this modulus for all $n\geq 3$. \end{corollary} \begin{proof} Since $W(K_{1,n-1};x)=(n-1)x+\binom{n-1}{2}x^2,$ the star $K_{1,n-1}$ has a single nonzero Wiener root $-\tfrac{2}{n-2}.$ Now let $G$ be a connected graph of order $n$ and size $m$. Let \[ r=\min\left\{\tfrac{d_k}{d_{k+1}}\colon\ 1\leq k<D\right\}. \] From Lemma~\ref{RatioLowerBound}, $\tfrac{d_k}{d_{k+1}} \geq \tfrac{2}{n-k-1}\geq \tfrac{2}{n-2}$ for all $1\leq k<D.$ Thus, by the Enestr\"om-Kakeya Theorem, if $z$ is a nonzero Wiener root of $G$, then \[ |z|\geq r \geq \tfrac{2}{n-2}. \] To see that the star is the unique connected graph of order $n$ with a Wiener root of modulus $\tfrac{2}{n-2},$ it suffices to show that if $G\not\cong K_{1,n-1},$ then $r>\tfrac{2}{n-2}$. By Lemma \ref{RatioLowerBound}, \[ \tfrac{d_k}{d_{k+1}}\geq \tfrac{2}{n-k-1}\geq \tfrac{2}{n-3} \ \ \ \ \mbox{ for all } 2\leq k<D. \] It remains only to show that $\tfrac{d_1}{d_2}>\tfrac{2}{n-2}$ if $G\not\cong K_{1,n-1}$. If $G$ is not a tree, then $d_1\geq n$ and $d_2\leq \binom{n}{2}-n=\tfrac{n(n-3)}{2}$, so \[ \tfrac{d_1}{d_2}\geq \frac{n}{\tfrac{n(n-3)}{2}}=\tfrac{2}{n-3}>\tfrac{2}{n-2}. \] If $G$ is a tree but $G\not\cong K_{1,n-1},$ then $G$ has diameter at least $3$. So $d_1=n-1$ and $d_2<\binom{n}{2}-(n-1)=\binom{n-1}{2}.$ Hence, \[ \tfrac{d_1}{d_2}>\frac{n-1}{\tfrac{(n-1)(n-2)}{2}}=\tfrac{2}{n-2}. \] This completes the proof. \end{proof} \section{Density of Real Wiener Roots}\label{DensitySection} From the work of Jackson~\cite{Jackson} and Thomassen~\cite{Thom}, it is known that the closure of the collection of real chromatic roots of all graphs is $\{0,1\} \cup [32/27, \infty)$. In \cite{BHN} it is shown that the closure of the real roots of independence polynomials of graphs is $(-\infty, 0]$, and in~\cite{BC} it is proven that the closure of the collection of all real roots of all-terminal reliability polynomials is $\{0\} \cup [1,2]$. Since the coefficients of the Wiener polynomial of any connected graph are all positive, any real Wiener root lies in $(-\infty, 0]$. The next result addresses the density of the real Wiener roots in this interval. \begin{theorem}\label{Dense} The collection of all real Wiener roots is dense in $(-\infty, 0]$, even when restricted to graphs of diameter $2$. \end{theorem} \begin{proof} Let $m,n$ be positive integers where $n\geq 3$ and $n-1 \le m < \binom{n}{2}$. Then there is a graph of order $n$, size $m$ and of diameter $2$. Such a graph can be obtained by starting with the star $K_{1,n-1}$ and adding edges between any $m-n+1$ non-adjacent pairs of vertices. The Wiener polynomial for any graph $H$ constructed in this way is given by \[ W(H;x) =mx +\left(\tbinom{n}{2}-m\right) x^2. \] This Wiener polynomial has root $\frac{-m}{\binom{n}{2} -m}$. We now show that the collection of all such roots is dense in $(-\infty, 0].$ Let $a,b \in {\mathbb{N}}$. We construct a graph of diameter 2 with Wiener root $-\frac{a}{b}$. Since the negative rationals are dense in $(-\infty,0],$ the result follows immediately. Let $n=2(a+b)$ and $m =a(2(a+b) -1)$. Note that $n\geq 3$ and $n-1\leq m<\binom{n}{2}$. By the above observation, there is a graph of diameter $2$ on $n$ vertices and $m$ edges, which has Wiener root \[ \frac{-m}{\binom{n}{2} -m}=\frac{a(2(a+b)-1)}{(a+b)(2(a+b)-1)-a(2(a+b)-1)}=-\frac{a}{b}.\qedhere \] \end{proof} \bigbreak Next we consider a similar problem for trees: is the collection of real Wiener roots of trees dense in $(-\infty,0]$? While this problem appears more difficult, we prove that the closure of the collection of real Wiener roots of trees contains $(-\infty,-1]$. We will use the family of double stars in our proof, so we first prove that the Wiener roots of all double stars of sufficiently large order are all real. Recall that for $n\geq 4$ and $2\leq k\leq \lfloor n/2\rfloor$, $D_{k,n-k}$ denotes the double star of order $n$ with two internal vertices adjacent to $k-1$ and $n-k-1$ leaves, respectively (see Figure~\ref{doublestar}). \begin{lemma}\label{DoubleStarReal} Let $n\geq 15$ and $2\leq k\leq \lfloor n/2\rfloor$. Then the Wiener roots of the double star $D_{k,n-k}$ are all real. \end{lemma} \begin{proof} The Wiener polynomial of $D_{k,n-k}$ is given by \[ W(D_{k,n-k};x)=(n-1)x + \left(\tbinom{k}{2}+ \tbinom{n-k}{2}\right)x^2 + (k-1)(n-k-1) x^3. \] The discriminant of the reduced Wiener polynomial $\widehat{W}(D_{k,n-k};x)$ is given by \[\left(\tbinom{k}{2}+ \tbinom{n-k}{2}\right)^2-4(n-1)(k-1)(n-k-1).\] By applying elementary Calculus to each of the two terms in this expression we see that \begin{align*} &\left(\tbinom{k}{2}+ \tbinom{n-k}{2}\right)^2-4(n-1)(k-1)(n-k-1) \\ &\geq \left( \left(\tfrac{n}{2} \right)\left(\tfrac{n}{2} -1 \right) \right)^2 - 4(n-1) \left(\tfrac{n}{2}-1\right)\left(n-\tfrac{n}{2}-1\right)\\ & = \tfrac{1}{16}(n^2-16n+16)(n-2)^2\\ & > 0. \end{align*} Thus we conclude that the Wiener roots of any double star of order $n\geq 15$ are all real. \end{proof} Using a computer algebra system it was verified that there are double stars of each order $4\leq n\leq 14$ with nonreal Wiener roots; so we cannot avoid the assumption that $n\geq 15$ in the previous lemma. We are now ready to prove our result concerning the closure of the collection of real Wiener roots of trees. \begin{theorem}\label{TreeDense} The closure of the collection of real Wiener roots of trees contains the interval $(-\infty, -1]$. \end{theorem} \begin{proof} Let $r =\frac{a}{b}$ where $a, b \in \mathbb{N}$. Let $n = (2a+b)\ell$ for some $\ell \in \mathbb{N}$ with $\ell\geq 5$ (so that $n\geq 15$), and define $k=\frac{n}{2r+1}.$ Then \[ k=\frac{n}{2r+1}=\frac{(2a+b)\ell}{2\tfrac{a}{b}+1}=\ell b. \] So $k$ is an integer and certainly $2\leq k\leq n-2$. The Wiener polynomial of the double star $D_{k,n-k}$ is given by \[ W(D_{k,n-k};x)=(n-1)x + \left(\tbinom{k}{2}+ \tbinom{n-k}{2}\right)x^2 + (k-1)(n-k-1) x^3. \] From Lemma~\ref{DoubleStarReal}, all of the roots of $D_{k,n-k}$ are real. Substituting $k=\frac{n}{2r+1}$ into this polynomial, and solving for the nonzero roots using the quadratic formula, and then taking the limit of the left-most root as $\ell \rightarrow \infty$, we see that this root approaches $-r-\frac{1}{4r}$. Therefore, the set of limit points of real Wiener roots of double stars contains the set $\left\{-r-\tfrac{1}{4r}|r \in \mathbb{Q}^+\right\}$. Using elementary calculus it can be shown that the real-valued function $f(x) = -x -\frac{1}{4x}$, for $x > 0$, attains its maximum value of $-1$ at $r = \frac{1}{2}$. We see immediately that there is a double star with Wiener root as close as we wish to $-1$. Moreover, $\lim_{x \rightarrow \infty}f(x) = -\infty$. Thus for every $y \in (-\infty, -1)$ there is an $x \in (1/2, \infty)$ such that $f(x)=y$. Since $f$ is continuous on $(1/2, \infty)$ there is for every $\epsilon > 0$ a $\delta >0$ such that if $\overline{x} \in (x- \delta, x+\delta)$, then $|y-f(\overline{x})| < \epsilon$. Since the rational numbers are dense in the real numbers, there is a rational $r \in (x-\delta, x+\delta)$. Thus $|y-f(r)| < \epsilon$. Hence there is a double star with a root as close as we wish to a given real number in $(-\infty, -1]$. \end{proof} \section{Imaginary and Real Parts of Wiener Roots}\label{RealAndImagSection} We now consider the collection of all \emph{complex} Wiener roots of graphs, and focus on the imaginary and real parts. We have already seen that there are real Wiener roots of arbitrarily large modulus, but we have only seen examples of arbitrarily large negative real Wiener roots. In this section we show that there are Wiener roots with arbitrarily large positive real part and that there are Wiener roots with arbitrarily large imaginary part (even if we restrict to trees). The family of ``brooms'' is useful for proving these results. For integers $n > k \ge 3$ the {\em broom} $B_{k,n-k}$ of order $n$ having a {\em handle} of order $k$ is obtained from a path of order $k$ by joining $n-k$ leaves to exactly one of its end-vertices. \begin{figure}[ht] \centering \begin{tikzpicture} \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (3,0) {}; \node[vertex] (4) at (4,0) {}; \node[vertex] (5) at (5,0.7) {}; \node[vertex] (6) at (5,0.4) {}; \node[vertex] (7) at (5,-0.7) {}; \path (1) edge (2) (3) edge (4) (4) edge (5) (4) edge (6) (4) edge (7); \draw (1,0) -- (1.5,0); \draw[dotted] (1.5,0) -- (2.5,0); \draw (2.5,0) -- (3,0); \draw[dotted] (5,0.1) -- (5,-0.4); \draw [decorate,decoration={brace,amplitude=4pt},xshift=4pt,yshift=0pt] (5,0.85) -- (5,-0.85) node [right,black,midway,xshift=3pt] {\footnotesize $n-k$}; \draw [decorate,decoration={brace,amplitude=4pt,mirror},xshift=0pt,yshift=-6pt] (-0.15,0) -- (4.15,0) node [below,black,midway,yshift=-3pt] {\footnotesize $k$}; \end{tikzpicture} \caption{The broom $B_{k,n-k}$.} \label{broom} \end{figure} \begin{proposition}\label{LargeImaginaryPart} There are connected graphs (even trees) with Wiener roots having arbitrarily large imaginary part. \end{proposition} \begin{proof} For $n\geq 4$, let $G_n$ denote the graph obtained from $K_{n-1}-e$ by attaching a leaf to one of the vertices of degree $n-3$. Then \[ W(G_n;x)=\binom{n-1}{2}x+(n-2)x^2+x^3, \] which has nonzero roots \[ -\tfrac{n}{2}+1\pm\tfrac{1}{2}\sqrt{2n-n^2}, \] whose imaginary parts tend to $\pm\tfrac{n}{2}$ asymptotically. It remains to show that there are trees with Wiener roots having arbitrarily large imaginary part. We consider a collection of brooms to achieve this result. Using straightforward counting techniques, we find \[ W(B_{4,n-4};x)=(n-1)x+\left(\tbinom{n-3}{2}+2\right)x^2+(n-3)x^3+(n-4)x^4. \] Using a computer algebra system, we obtain explicit expressions for the roots of the reduced Wiener polynomial $\widehat{W}(B_{4,n-4};x)$ in terms of $n$. These include a pair of nonreal roots $a_n\pm b_ni$ for which \[ \lim_{n\rightarrow \infty}\tfrac{b_n}{\sqrt{n}}=2^{-1/2}.\qedhere \] \end{proof} It follows that the largest imaginary part of a Wiener root of a connected graph of order $n$ is $\Omega(n),$ while the largest imaginary part of a Wiener root of a tree of order $n$ is only known to be $\Omega(\sqrt{n})$. We now consider the positive real part of Wiener roots. We first summarize what we know for connected graphs and trees of small order; this information has been verified using a computer algebra system. For $n\leq 5$, we found that there are no graphs of order $n$ with Wiener roots having positive real part. For $6\leq n\leq 9,$ the connected graph with Wiener root of largest positive real part is the path $P_n,$ and in fact, for $6\leq n\leq 15$, the tree with Wiener root of largest positive real part is $P_n$. We have already mentioned that the Wiener roots of $P_n$ all have modulus at most $2$ (and hence real part at most $2$). However, we found that the trees of order $n$ with the Wiener root of largest positive real part are not paths for $n=16$ and $n=17$ (see Figure~\ref{Tree16} and Figure~\ref{Tree17}, respectively). We show below that the largest positive real part of a Wiener root of a connected graph (or tree) of order $n$ has growth rate $\Omega(\sqrt[3]{n}).$ As for Proposition~\ref{LargeImaginaryPart}, a particular family of brooms is used. \begin{figure}[htb] \centering \begin{tikzpicture}[scale=0.7] \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (2,0) {}; \node[vertex] (4) at (3,0) {}; \node[vertex] (5) at (4,0) {}; \node[vertex] (6) at (5,0) {}; \node[vertex] (7) at (6,0) {}; \node[vertex] (8) at (7,0) {}; \node[vertex] (9) at (8,0) {}; \node[vertex] (10) at (9,0) {}; \node[vertex] (11) at (10,0) {}; \node[vertex] (12) at (11,0) {}; \node[vertex] (13) at (12,0) {}; \node[vertex] (14) at (13,0) {}; \node[vertex] (15) at (14,0) {}; \node[vertex] (16) at (7,1) {}; \path (1) edge (2) (2) edge (3) (3) edge (4) (4) edge (5) (5) edge (6) (6) edge (7) (7) edge (8) (8) edge (9) (9) edge (10) (10) edge (11) (11) edge (12) (12) edge (13) (13) edge (14) (14) edge (15) (16) edge (8); \end{tikzpicture} \caption{The tree of order $16$ with a Wiener root of largest positive real part.} \label{Tree16} \end{figure} \begin{figure}[htb] \centering \begin{tikzpicture}[scale=0.7] \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (2,0) {}; \node[vertex] (4) at (3,0) {}; \node[vertex] (5) at (4,0) {}; \node[vertex] (6) at (5,0) {}; \node[vertex] (7) at (6,0) {}; \node[vertex] (8) at (7,0) {}; \node[vertex] (9) at (8,0) {}; \node[vertex] (10) at (9,0) {}; \node[vertex] (11) at (10,0) {}; \node[vertex] (12) at (11,0) {}; \node[vertex] (13) at (12,0) {}; \node[vertex] (14) at (5,1) {}; \node[vertex] (15) at (5.67,1) {}; \node[vertex] (16) at (6.33,1) {}; \node[vertex] (17) at (7,1) {}; \path (1) edge (2) (2) edge (3) (3) edge (4) (4) edge (5) (5) edge (6) (6) edge (7) (7) edge (8) (8) edge (9) (9) edge (10) (10) edge (11) (11) edge (12) (12) edge (13) (14) edge (7) (15) edge (7) (16) edge (7) (17) edge (7); \end{tikzpicture} \caption{The tree of order $17$ with a Wiener root of largest positive real part.} \label{Tree17} \end{figure} \begin{proposition}\label{LargeReal} There are connected graphs (even trees) with Wiener roots having arbitrarily large positive real part. \end{proposition} \begin{proof} Using straightforward counting techniques, we find \[ W(B_{5,n-5};x)=(n-1)x+\left(\tbinom{n-4}{2}+3\right)x^2+(n-3)x^3+(n-4)x^4+(n-5)x^5. \] Using a computer algebra system, we obtain an explicit expression for the roots of the reduced Wiener polynomial $\widehat{W}(B_{5,n-5};x)$ in terms of $n$. These include a pair of nonreal roots $a_n\pm b_ni$ for which \[ \lim_{n\rightarrow \infty}\tfrac{a_n}{\sqrt[3]{n}}=2^{-4/3}. \qedhere \] \end{proof} Taken together, Theorem~\ref{TreeDense}, Proposition~\ref{LargeImaginaryPart}, and Proposition~\ref{LargeReal} imply that the collection of Wiener roots of all connected graphs (or trees) is not contained in any \emph{half-plane}; a region in the complex plane consisting of all points on one side of a line (and no points on the other side). This is at least weak evidence that the collection of all complex Wiener roots may be dense in the entire complex plane, even if we only consider trees. \begin{theorem} The collection of complex Wiener roots of all graphs (or trees) is not contained in any half-plane. \end{theorem} \begin{proof} Suppose otherwise that the Wiener roots of all trees are contained in some half-plane $H$. If $H$ is described by a horizontal line, this contradicts Proposition~\ref{LargeImaginaryPart}, since complex roots of polynomials with real coefficients come in conjugate pairs. Otherwise, $H$ is described by a line that intersects the real axis. We have two cases. \medbreak \noindent {\bf Case 1: }{\itshape Some interval $(-\infty,a)$ of the real line is not contained in $H$.} \noindent This contradicts Theorem~\ref{TreeDense}. \medbreak \noindent {\bf Case 2: }{\itshape Some interval $(b,\infty)$ of the real line is not contained in $H$.} \noindent Then at least one of the quarter planes $\{z\in \mathbb{C}\colon\ \Re(z)>b \mbox{ and } \Im(z)\geq 0\}$ or $\{z\in\mathbb{C}\colon\ \Re(z)>b \mbox{ and } \Im(z)\leq 0\}$ is not contained in the half-plane. Since complex roots of polynomials with real coefficients come in conjugate pairs, this contradicts Proposition~\ref{LargeReal}. \end{proof} \medbreak We close this section with some interesting observations. Firstly, we note that there are graphs with purely imaginary Wiener roots. Figure~\ref{smallpurelyimaginary} contains the graph of smallest order that has a purely imaginary Wiener root, and Figure~\ref{treewieneri} shows the tree of smallest order with $i$ as a Wiener root. This observation is interesting in light of the fact that although chromatic roots are known to be dense in the complex plane, it is widely suspected that there are no purely imaginary chromatic roots~\cite{Bohn}. Moreover, it is not known whether there are independence or reliability polynomials with purely imaginary roots. \begin{figure}[htb] \centering \begin{tikzpicture} \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (2,0) {}; \node[vertex] (4) at (3,0) {}; \node[vertex] (5) at (-0.8,0.5) {}; \node[vertex] (6) at (-0.8,-0.5) {}; \path (1) edge (2) (2) edge (3) (3) edge (4) (1) edge (6) (1) edge (5) (5) edge (6); \end{tikzpicture} \caption{Smallest graph with a purely imaginary Wiener root.} \label{smallpurelyimaginary} \end{figure} \begin{figure}[htb] \centering \begin{tikzpicture} \node[vertex] (1) at (0,0) {}; \node[vertex] (2) at (1,0) {}; \node[vertex] (3) at (1.8,0.7) {}; \node[vertex] (4) at (1.8,0) {}; \node[vertex] (5) at (-0.8,0.5) {}; \node[vertex] (6) at (-0.8,-0.5) {}; \node[vertex] (7) at (1.8,-0.7) {}; \node[vertex] (8) at (-1.8,0.5) {}; \node[vertex] (9) at (2.8,0.7) {}; \node[vertex] (10) at (2.8,0) {}; \node[vertex] (11) at (3.8,0) {}; \node[vertex] (12) at (2.8,-0.7) {}; \path (1) edge (2) (2) edge (3) (2) edge (4) (1) edge (6) (1) edge (5) (2) edge (7) (5) edge (8) (3) edge (9) (4) edge (10) (10) edge (11) (7) edge (12); \end{tikzpicture} \caption{Smallest tree with $i$ as a Wiener root.} \label{treewieneri} \end{figure} Finally, we discuss graphs whose Wiener roots are all real. The property of having all real roots is of interest combinatorially, since if the roots of a (real) polynomial with positive coefficients are all real, then the sequence of coefficients is log-concave, and hence unimodal -- see \cite{Stanley}, for example. This condition has facilitated several proofs that certain graph theoretical sequences are log-concave. For example, it was used to prove that the sequence of coefficients of the independence polynomial (the number of independent sets of each cardinality) of any clawfree graph is log-concave \cite{Chudnovsky}. The Wiener roots of any graph of diameter $2$ are all real (as the corresponding reduced Wiener polynomial is linear). Since it is well-known that almost every random graph $G \in {\mathcal G}(n,p)$ for fixed $p \in (0,1)$ has diameter $2$, we conclude that the Wiener roots of almost all graphs are real. On the other hand, we have seen that there are infinitely many graphs with nonreal Wiener roots. In contrast, for other graph polynomials, either almost all graphs have a nonreal root (as is the case for the chromatic~\cite{BW} and independence polynomial~\cite{BN2}) or the roots are always real (as is the case for the matching polynomial~\cite{HL}). \section{Open Problems} We conclude with a number of open problems. First, while we have maximized the modulus of Wiener roots of connected graphs of order $n$, and found the extremal graphs, our solution for trees is only asymptotic. \begin{problem} What is the tree of order $n$ with the Wiener root of largest modulus? \end{problem} \noindent Calculations suggest that the extremal graph is the tree $T_{n}$ shown in Figure~\ref{treeexamplemaxmod}. \medbreak While we have determined the closure of the real Wiener roots of graphs in general, we have not completed the discussion for trees. We propose the following. \begin{problem} Is the closure of real Wiener roots of trees the entire interval $(-\infty,0]$? \end{problem} \noindent While we have found many Wiener roots in the interval $(-1,0)$, we have been unable to prove that the closure contains this interval. On a related note, the closure of the collection of all complex Wiener roots is intriguing. We have observed that the Wiener roots of almost all graphs are real, however, we also demonstrated that the collection of complex Wiener roots is not contained in any half-plane, even if we restrict ourselves to trees. \begin{problem} Is the closure of the collection of Wiener roots of connected graphs (or trees) the entire complex plane? \end{problem} \noindent At this time, we do not know if the closure of the collection of complex Wiener roots contains a set of positive measure. \medbreak We have shown that the minimum real part of a Wiener root of a graph of order $n$ is precisely $-\left( \binom{n}{2} - 1 \right)$. Currently the best result we have for the maximum positive real part, and the maximum (and minimum) imaginary parts are growth rates of $\Omega (\sqrt[3]{n})$ and $\Omega (n)$, respectively. \begin{problem} What connected graph of order $n$ has a Wiener root of (i) largest real part? and (ii) of largest imaginary part? What are the rates of growth (as a function of $n$) of these parameters? \end{problem} We have already seen that the roots of Wiener polynomials of almost all graphs are all real, since almost all graphs have diameter $2$, and any graph of diameter $2$ has all real Wiener roots. We have also shown that the roots of the Wiener polynomials of all trees of order $n\geq 15$ and diameter $3$ are real. In fact, there are trees of arbitrarily large diameter for which the Wiener roots are all real (and rational). We describe such a family of trees recursively. Suppose $T_0$ is a tree with all real Wiener roots; for example, $P_3$ has this property. Let $T_1$ be the tree obtained from $T_0$ by adding a leaf to each of its vertices. Then \[ W(T_1;x) = x^2W(T_0;x)+ 2xW(T_0;x) +W(T_0;x)=(x+1)^2W(T_0;x) \] and $D(T_1)=D(T_0)+2$. If $T_k$ has been defined for some $k \ge 1$, then let $T_{k+1}$ be obtained from $T_k$ by joining a leaf to each of its vertices. Then each $T_k$ has only real roots and $D(T_k) = D(T_0) + 2k$. If $T_0$ is chosen in such a way that it has only rational roots, then $T_k$ in fact has only rational roots. \begin{problem} What graphs have the property that their Wiener roots are all real? What trees have this property? \end{problem} \providecommand{\bysame}{\leavevmode\hbox to3em{\hrulefill}\thinspace} \providecommand{\MR}{\relax\ifhmode\unskip\space\fi MR } \providecommand{\MRhref}[2]{% \href{http://www.ams.org/mathscinet-getitem?mr=#1}{#2} } \providecommand{\href}[2]{#2}
\section{Typesetting instructions -- please read carefully} \newcounter{count:constr} \newcounter{count:constr2} \section{Introduction} \DC\ is the following problem: we are given a graph $G=(V,E)$, and two integer parameters $\C,\D$, and are asked whether there exists a partition of $V$ into at most $\C$ sets (color classes), such that each set induces a graph with maximum degree at most $\D$. \DC, which is also sometimes referred to in the literature as \textsc{Improper Coloring}, is a natural generalization of the classical \textsc{Coloring} problem, which corresponds to the case $\D=0$. The problem was introduced more than thirty years ago \cite{andrews1985generalization,CCW86}, and since then has attracted a great deal of attention \cite{AchuthanAS11,AngeliniBLD0KMR17,Archdeacon87,BorodinKY13,ChoiE16,CowenGJ97,FrickH94,GoddardX16,HavetS06,KangM10,KimKZ14,KimKZ16}. From the point of view of applications, \DC\ is particularly interesting in the context of wireless communication networks, where the assignment of colors to vertices often represents the assignment of frequencies to communication nodes. In many practical settings, the requirement of traditional coloring that all neighboring nodes receive distinct colors is too rigid, as a small amount of interference is often tolerable, and may lead to solutions that need drastically fewer frequencies. \DC\ allows one to model this tolerance through the parameter $\D$. As a result the problem's complexity has been well-investigated in graph topologies motivated by such applications, such as unit-disk graphs and various classes of grids \cite{AraujoBGHMM12,ArchettiBHCG15,Bang-JensenH15,BermondHHS10,GudmundssonMS16,HavetKS09}. For more background we refer to \cite{frick1993survey,Kang08}. In this paper we study \DC\ from the point of view of parameterized complexity \cite{CyganFKLMPPS15,DowneyF13,FlumG06,Niedermeier06}. The problem is of course NP-hard, even for small values of $\C,\D$, as it generalizes \textsc{Coloring}. We are therefore strongly motivated to bring to bear the powerful toolbox of structural graph parameters, such as treewidth, which have proved extremely successful in tackling other intractable hard problems. Indeed, \textsc{Coloring} is one of the success stories of this domain, since the complexity of this flagship problem with respect to treewidth (and related parameters pathwidth, feedback vertex set, vertex cover) is by now extremely well-understood \cite{LokshtanovMS11a,JaffkeJ17}. We pose the natural question of whether similar success can be achieved for \DC, or whether the addition of $\D$ significantly alters the complexity behavior of the problem. Such results are not yet known for \DC, except for the fact that it was observed in \cite{BelmonteLM17} that the problem admits (by standard techniques) a roughly $(\C\D)^\mathrm{tw}$-time algorithm, where $\mathrm{tw}$ is the graph's treewidth. In parameterized complexity terms, this shows that the problem is FPT parameterized by $\mathrm{tw}+\D$. One of our main motivating questions is whether this running time can be improved qualitatively (is the problem FPT parameterized only by $\mathrm{tw}$?) or quantitavely. Our first result is to establish that the problem is W-hard not just for treewidth, but also for several much more restricted structural graph parameters, such as pathwidth, tree-depth, and feedback vertex set. We recall that for \textsc{Coloring}, the standard $\C^\mathrm{tw}$ algorithm is FPT by $\mathrm{tw}$, as graphs of bounded treewidth also have bounded chromatic number (Lemma \ref{lem:basic}). Our result shows that the complexity of the problem changes drastically with the addition of the new parameter $\D$, and it appears likely that $\mathrm{tw}$ must appear in the exponent of $\D$ in the running time, even when $\D$ is large. More strongly, we establish this hardness even for the case $\C=2$, which corresponds to the problem of partitioning a graph into two parts so as to minimize their maximum degree. This identifies \DC\ as another member of a family of generalizations of \textsc{Coloring} (such as \textsc{Equitable Coloring} or \textsc{List Coloring}) which are hard for treewidth \cite{FellowsFLRSST11}. As one might expect, the W-hardness results on \DC\ parameterized by treewidth (or pathwidth, or tree-depth) easily carry over for values of $\C$ larger than $2$. Surprisingly, we show that this is \emph{not} the case for the parameter feedback vertex set, for which the only W-hard case is $2$-coloring: we establish with a simple win/win argument that the problem is FPT for any other value of $\C$. We also show that if one considers sufficiently restricted parameters, such as vertex cover, the problem does eventually become FPT. Our second step is to enhance the W-hardness result mentioned above with the aim of determining as precisely as possible the complexity of \DC\ parameterized by treewidth. Our reduction for tree-depth and feedback vertex set is quadratic in the parameter, and hence implies that no algorithm can solve the problem in time $n^{o(\sqrt{\mathrm{tw}})}$ under the Exponential Time Hypothesis (ETH) \cite{IPZ01}. We therefore present a second reduction, which applies only to pathwidth and treewidth, but manages to show that no algorithm can solve the problem in time $n^{o(\mathrm{pw})}$ or $n^{o(\mathrm{tw})}$ under the ETH. This lower bound is tight, as it matches asymptotically the exponent given in the algorithm of \cite{BelmonteLM17}. To complement the above results, we also consider the problem from the point of view of (parameterized) approximation. Here things become significantly better: we give an algorithm using a technique of \cite{Lampis14} which for any $\C$ and error $\epsilon>0$ runs in time $(tw/\epsilon)^{O(\mathrm{tw})}n^{O(1)}$ and approximates the optimal value of $\D$ within a factor of $(1+\epsilon)$. Hence, despite the problem's W-hardness, we produce a solution arbitrarily close to optimal in FPT time. Motivated by this algorithm we also consider the complementary approximation problem: given $\D$ find a solution that comes as close to the minimum number of colors needed as possible. By building on the approximation algorithm for $\D$, we are able to present a $(\mathrm{tw})^{O(\mathrm{tw})}n^{O(1)}$ algorithm that achieves a $2$-approximation for this problem. One can observe that this is not far from optimal, since an FPT algorithm with approximation ratio better than $3/2$ would contradict the problem's W-hardness for $\C=2$. However, this simple argument is unsatisfying, because it does not rule out algorithms with a ratio significantly better than $3/2$, if one also allows a small additive error; indeed, we observe that when parameterized by feedback vertex set the problem admits an FPT algorithm that approximates the optimal $\C$ within an additive error of just $1$. To resolve this problem we present a gap-introducing version of our reduction which, for any $i$ produces an instance for which the optimal value of $\C$ is either $2i$, or at least $3i$. In this way we show that, when parameterized by tree-depth, pathwidth, or treewidth, approximating the optimal value of $\C$ better than $3/2$ is ``truly'' hard, and this is not an artifact of the problem's hardness for $2$-coloring. \begin{table} \centering \begin{tabular}{|p{2cm}|p{3.5cm}|l|p{3.5cm}|l|} \hline Parameter & Result (Exact solution) & Ref. & Result (Approximation) & Ref. \\ \hline Feedback\hspace{0.5cm} Vertex Set & W[1]-hard for $\C=2$ & Thm \ref{thm:fvs1} & $+1$-approximation in time $\mathrm{fvs}^{O(\mathrm{fvs})}$ & Cor \ref{thm:fvs-approx} \\ & FPT for $\C\neq 2$ & Thm \ref{thm:alg-fvs}&& \\ \hline Tree-depth & W[1]-hard for any $\C\ge2$ & Thm \ref{thm:fvs1} & W[1]-hard to color with $(3/2-\epsilon)\C+O(1)$ colors & Thm \ref{thm:apxhard} \\ \hline Treewidth, Pathwidth & No $n^{o(\mathrm{pw})}$ or $n^{o(\mathrm{tw})}$ algorithm under ETH & Thm \ref{thm:eth} & $(1+\epsilon)$-approximation for $\D$ in $(\mathrm{tw}/\epsilon)^{O(\mathrm{tw})}$& Thm \ref{thm:tw-approx1}\\ & & & $2$-approximation for $\C$ in $\mathrm{tw}^{O(\mathrm{tw})}$& Thm \ref{thm:tw-approx2}\\ \hline Vertex Cover & $\mathrm{vc}^{O(\mathrm{vc})}$ algorithm & Thm \ref{thm:alg-vc} && \\ \hline \end{tabular} \caption{Summary of results. Hardness results for tree-depth imply the same bounds for treewidth and pathwidth. Conversely, algorithms which apply to treewidth apply also to all other parameters.} \end{table} \section{Definitions and Preliminaries} For a graph $G=(V,E)$ and two integers $\C\ge 1$, $\D\ge 0$, we say that $G$ admits a $(\C,\D)$-coloring if one can partition $V$ into $\C$ sets such that the graph induced by each set has maximum degree at most $\D$. \DC\ is the problem of deciding, given $G,\C,\D$, whether $G$ admits a $(\C,\D)$-coloring. For $\D=0$ this corresponds to \textsc{Coloring}. We assume the reader is familiar with basic notions in parameterized complexity, such as the classes FPT and W[1]. For the relevant definitions we refer to the standard textbooks \cite{CyganFKLMPPS15,DowneyF13,FlumG06,Niedermeier06}. We rely on a number of well-known graph measures: treewidth \cite{BodlaenderK08}, pathwidth, tree-depth \cite{NesetrilM06}, feedback vertex set, and vertex cover, denoted respectively as $\mathrm{tw}(G),\mathrm{pw}(G),\mathrm{td}(G),\mathrm{fvs}(G),\mathrm{vc}(G)$, where we drop $G$ if it is clear from the context. \begin{lemma}\label{lem:basic} For any graph $G$ we have $\mathrm{tw}(G)-1 \le \mathrm{fvs}(G) \le \mathrm{vc}(G)$ and $\mathrm{tw}(G) \le \mathrm{pw}(G) \le \mathrm{td}(G) -1 \le \mathrm{vc}(G)$. Furthermore, any graph $G$ admits a $(\mathrm{tw}(G)+1,0)$-coloring, a $(\mathrm{pw}(G)+1,0)$-coloring, a $(\mathrm{td}(G),0)$-coloring, and a $(\mathrm{fvs}(G)+2,0)$-coloring. \end{lemma} The Exponential Time Hypothesis (ETH) states that 3-\textsc{SAT} on instances with $n$ variables and $m$ clauses cannot be solved in time $2^{o(n+m)}$ \cite{IPZ01}. We define the \MCC\ problem as follows: we are given a graph $G=(V,E)$, a partition of $V$ into $k$ independent sets $V_1,\ldots,V_k$, such that for all $i\in\{1,\ldots,k\}$ we have $|V_i|=n$, and we are asked if $G$ contains a $k$-clique. It is well-known that this problem is W[1]-hard parameterized by $k$, and that it does not admit any $n^{o(k)}$ algorithm, unless the ETH is false \cite{CyganFKLMPPS15}. \section{W-hardness for Feedback Vertex Set and Tree-depth}\label{sec:whard} The main result of this section states that deciding if a graph admits a $(2,\D)$-coloring, where $\D$ is part of the input, is W[1]-hard parameterized by either $\mathrm{fvs}$ or $\mathrm{td}$. Because of standard relations between graph parameters (Lemma \ref{lem:basic}), this implies also the same problem's W-hardness for parameters $\mathrm{pw}$ and $\mathrm{tw}$. As might be expected, it is not hard to extend our proof to give hardness for deciding if a $(\C,\D)$-coloring exists, for any constant $\C$, parameterized by tree-depth (and hence, also treewidth and pathwidth). What is perhaps more surprising is that this cannot be done in the case of feedback vertex set. Superficially, the reason we cannot extend the reduction in this case is that one of the gadgets we use in many copies in our construction has large $\mathrm{fvs}$ if $\C>2$. However, we give a much more convincing reason in Theorem \ref{thm:alg-fvs} of Section \ref{sec:exact} where we show that \DC\ is FPT parameterized by $\mathrm{fvs}$ for $\C\ge 3$, and therefore, if we could extend our reduction in this case it would prove that FPT=W[1]. The main theorem of this section is stated below. We then present the reduction in Sections \ref{sec:fvsred0}, \ref{sec:fvsred1}, and give the Lemmata that imply Theorem \ref{thm:fvs1} in Section \ref{sec:fvsred2}. \begin{theorem} \label{thm:fvs1} Deciding if a graph $G$ admits a $(2,\D)$-coloring, where $\D$ is part of the input, is W[1]-hard parameterized by $\mathrm{fvs}(G)$. Deciding if a graph $G$ admits a $(\C,\D)$-coloring, where $\C\ge 2$ is any fixed constant and $\D$ is part of the input is W[1]-hard parameterized by $\mathrm{td}(G)$. \end{theorem} \subsection{Basic Gadgets}\label{sec:fvsred0} Before we proceed, we present some basic gadgets that will be useful in all the reductions of this paper (Theorems \ref{thm:fvs1}, \ref{thm:eth}, \ref{thm:apxhard}). We first define a building block $\T(i,j)$ which is a graph that can be properly colored with $i$ colors, but admits no $(i-1,j)$-coloring (similar constructions appears in \cite{HavetS06}). We then use this graph to build two gadgets: the Equality Gadget and the Palette Gadget (Definitions \ref{def:eq} and \ref{def:palette}). Informally, for given $\C,\D$, the equality gadget allows us to express the constraint that two vertices $v_1,v_2$ of a graph must receive the same color in any valid $(\C,\D)$-coloring. The palette gadget will be used to express the constraint that, among three vertices $v_1,v_2,v_3$, there must exist two with the same color. For both gadgets we first prove formally that they express these constraints (Lemmata \ref{lem:eq} and \ref{lem:palette}). We then show that, under certain conditions, these gadgets can be added to any graph without significantly increasing its tree-depth or feedback vertex set (Lemmata \ref{lem:eq2} and \ref{lem:palette2}). \begin{definition} Given two integers $i>0, j\ge 0$, we define the graph $\T(i,j)$ recursively as follows: $T(1,j) = K_1$ for all $j$; for $i>1$, $T(i,j)$ is the graph obtained by taking $(j+1)$ disjoint copies of $T(i-1,j)$ and adding to the graph a new universal vertex. \end{definition} \begin{lemma}\label{lem:T} For all $i>0, j\ge 0$ we have: $\T(i,j)$ admits an $(i,0)$-coloring; $\T(i,j)$ does not admit an $(i-1,j)$-coloring; $\mathrm{td}(\T(i,j)) = \mathrm{pw}(\T(i,j)) +1 = \mathrm{tw}(\T(i,j))+1 = i$. \end{lemma} \begin{definition}\label{def:eq}(Equality Gadget) For $i\ge 2, j\ge0$, we define the graph $Q(u_1,u_2,i,j)$ as follows: $Q$ contains $ij+1$ disjoint copies of $\T(i-1,j)$ as well as two vertices $u_1,u_2$ which are connected to all vertices except each other. \end{definition} \begin{lemma}\label{lem:eq} Let $G=(V,E)$ be a graph with $v_1,v_2\in V$ and let $G'$ be the graph obtained from $G$ by adding to it a copy of $Q(u_1,u_2,\C,\D)$ and identifying $u_1$ with $v_1$ and $u_2$ with $v_2$. Then, any $(\C,\D)$-coloring of $G'$ must give the same color to $v_1,v_2$. Furthermore, if there exists a $(\C,\D)$-coloring of $G$ that gives the same color to $v_1,v_2$, this coloring can be extended to a $(\C,\D)$-coloring of $G'$. \end{lemma} \begin{lemma}\label{lem:eq2} Let $G=(V,E)$ be a graph, $S\subseteq V$, and $G'$ be a graph obtained from $G$ by repeated applications of the following operation: we select two vertices $v_1,v_2\in V$ such that $v_1\in S$, add a new copy of $Q(u_1,u_2,\C,\D)$ and identify $u_i$ with $v_i$, for $i\in\{1,2\}$. Then $\mathrm{td}(G') \le \mathrm{td}(G\setminus S) + |S|+\C-1$. Furthermore, if $\C=2$ we have $\mathrm{fvs}(G') \le \mathrm{fvs}(G\setminus S) + |S|$. \end{lemma} \begin{definition}\label{def:palette}(Palette Gadget) For $i\ge 3, j\ge 0$ we define the graph $P(u_1,u_2,u_3,i,j)$ as follows: $P$ contains ${i\choose 2}j+1$ copies of $\T(i-2,j)$, as well as three vertices $u_1,u_2,u_3$ which are connected to every vertex of $P$ except each other. \end{definition} \begin{lemma}\label{lem:palette} Let $G=(V,E)$ be a graph with $v_1,v_2,v_3\in V$ and let $G'$ be the graph obtained from $G$ by adding to it a copy of $P(u_1,u_2,u_3,\C,\D)$ and identifying $u_i$ with $v_i$ for $i\in\{1,2,3\}$. Then, in any $(\C,\D)$-coloring of $G'$ at least two of the vertices of $\{v_1,v_2,v_3\}$ must share a color. Furthermore, if there exists a $(\C,\D)$-coloring of $G$ that gives the same color to two of the vertices of $\{v_1,v_2,v_3\}$, this coloring can be extended to a $(\C,\D)$-coloring of $G'$. \end{lemma} \begin{lemma}\label{lem:palette2} Let $G=(V,E)$ be a graph, $S\subseteq V$, and $G'$ be a graph obtained from $G$ by repeated applications of the following operation: we select three vertices $v_1,v_2,v_3\in V$ such that $v_1,v_2\in S$, add a new copy of $P(u_1,u_2,u_3,\C,\D)$ and identify $u_i$ with $v_i$, for $i\in\{1,2,3\}$. Then $\mathrm{td}(G') \le \mathrm{td}(G\setminus S) + |S|+\C-2$. \end{lemma} \subsection{Construction}\label{sec:fvsred1} We are now ready to present a reduction from \MCC. In this section we describe a construction which, given an instance of this problem $(G,k)$ as well as an integer $\C\ge 2$ produces an instance of \DC. Recall that we assume that in the initial instance $G=(V,E)$ is given to us partitioned into $k$ independent sets $V_1,\ldots, V_k$, all of which have size $n$. We will produce a graph $H(G,k,\C)$ and an integer $\D$ with the property that $H$ admits a $(\C,\D)$-coloring if and only if $G$ has a $k$-clique. In the next section we prove the correctness of the construction and give bounds on the values of $\mathrm{td}(H)$ and $\mathrm{fvs}(H)$ to establish Theorem \ref{thm:fvs1}. In our new instance we set $\D=|E|-{k\choose 2}$. Let us now describe the graph $H$. Since we will repeatedly use the gadgets from Definitions \ref{def:eq} and \ref{def:palette}, we will use the following convention: whenever $v_1,v_2$ are two vertices we have already introduced to $H$, when we say that we add an equality gadget $Q(v_1,v_2)$, this means that we add to $H$ a copy of $Q(u_1,u_2,\C,\D)$ and then identify $u_1,u_2$ with $v_1,v_2$ respectively (similarly for palette gadgets). To ease presentation we will gradually build the graph by describing its different conceptual parts. \smallskip \noindent\textbf{Palette Part}: Informally, the goal of this part is to obtain two vertices ($p_A,p_B$) which are guaranteed to have different colors. This part contains the following: \begin{enumerate} \item \label{it1} Two vertices called $p_A, p_B$ which we will call the main palette vertices. \item \label{it2} For all $i\in \{1,\ldots,\D\}$, $j\in \{A,B\}$ a vertex $p^i_j$. \item \label{it3} For all $i\in \{1,\ldots,\D\}$, $j\in \{A,B\}$ we add an equality gadget $Q(p_j,p^i_j)$. \item \label{it4} An edge between $p_A, p_B$. \item \label{it5} For all $i\in \{1,\ldots,\D\}$, $j\in \{A,B\}$ an edge from $p_j$ to $p^i_j$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} \smallskip \noindent\textbf{Choice Part}: Informally, the goal of this part is to encode a choice of a vertex in each $V_i$. To this end we make $2n$ choice vertices for each color class of the original instance. The selection will be encoded by counting how many of the first $n$ of these vertices have the same color as $p_A$. Formally, this part contains the following: \begin{enumerate} \setcounter{enumi}{\value{count:constr}} \item \label{it6} For all $i\in \{1,\ldots, k\}$, $j\in \{1,\ldots,2n\}$ the vertex $c^i_j$. We call these the choice vertices. \item \label{it7} For all $i\in \{1,\ldots, k\}$, $j\in \{A,B\}$ the vertex $g^i_j$. We call these the guard vertices. \item \label{it8} For all $i\in \{1,\ldots, k\}$, $j\in \{1,\ldots, 2n\}$ edges between $c^i_j$ and the vertices $g^i_A$ and $g^i_B$. \item \label{it9} For all $i\in \{1,\ldots, k\}$, $j\in \{A,B\}$ we add an equality gadget $Q(p_j,g^i_j)$. \item \label{it10} If $\C\ge 3$, for all $i\in \{1,\ldots, k\}$, $j\in \{1,\ldots, 2n\}$ we add a palette gadget $P(p_A,p_B,c^i_j)$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} \smallskip \noindent\textbf{Transfer Part}: Informally, the goal of this part is to transfer the choices of the previous part to the rest of the graph. For each color class of the original instance we make $(k-1)$ ``low'' transfer vertices, whose deficiency will equal the choice made in the previous part, and $(k-1)$ ``high'' transfer vertices, whose deficiency will equal the complement of the same value. Formally, this part of $H$ contains the following: \begin{enumerate} \setcounter{enumi}{\value{count:constr}} \item \label{it11} For $i,j\in \{1,\ldots,k\}$, $i\neq j$ the vertex $h_{i,j}$ and the vertex $l_{i,j}$. We call these the high and low transfer vertices. \item \label{it12} For $i,j\in \{1,\ldots,k\}$, $i\neq j$ and for all $l\in\{1,\ldots,n\}$ an edge from $l_{i,j}$ to $c^i_l$. \item \label{it13} For $i,j\in \{1,\ldots,k\}$, $i\neq j$ and for all $l\in\{n+1,\ldots,2n\}$ an edge from $h_{i,j}$ to $c^i_l$. \item \label{it14} For all $i,j\in \{1,\ldots, k\}$, $i\neq j$ we add an equality gadget $Q(p_A,l_{i,j})$ and an equality gadget $Q(p_A,h_{i,j})$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} \smallskip \noindent \textbf{Edge representation}: Informally, this part contains a gadget representing each edge of $G$. Each gadget will contain a special vertex which will be able to receive the color of $p_B$ if and only if the corresponding edge is part of the clique. Formally, we assume that all the vertices of each $V_i$ are numbered $\{1,\ldots,n\}$. For each edge $e$ of $G$, if $e$ connects the vertex with index $i_1$ from $V_{j_1}$ with the vertex with index $i_2$ from $V_{j_2}$ (assuming without loss of generality $j_1<j_2$) we add the following vertices and edges to $H$: \begin{enumerate} \setcounter{enumi}{\value{count:constr}} \item \label{it15} Four independent sets $L^1_e, H^1_e, L^2_e, H^2_e$ with respective sizes $n-i_1$, $i_1$, $n-i_2$, $i_2$. \item \label{it16} Edges connecting the vertex $l_{j_1,j_2}$ (respectively, $h_{j_1,j_2},l_{j_2,j_1},h_{j_2,j_1}$) with all vertices of the set $L^1_e$ (respectively the sets $H^1_e, L^2_e, H^2_e$). \item \label{it17} A vertex $c_e$, connected to all vertices in $L^1_e\cup H^1_e \cup L^2_e \cup H^2_e$. \item \label{it18} If $\C\ge 3$, for each $v\in L^1_e\cup H^1_e\cup L^2_e\cup H^2_e\cup \{c_e\}$ we add a palette gadget $P(p_A,p_B,v)$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} Finally, once we have added a gadget (as described above) for each $e\in E$, we add the following structure to $H$ in order to ensure that we have a sufficient number of edges included in our clique: \begin{enumerate} \setcounter{enumi}{\value{count:constr}} \item \label{it19} A vertex $c_U$ (universal checker) connected to all $c_e$ for $e\in E$. \item \label{it20} An equality gadget $Q(p_A,c_U)$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} \smallskip \noindent \textbf{Budget-Setting}: Our construction is now almost done, except for the fact that some crucial vertices have degree significantly lower than $\D$ (and hence are always trivially colorable). To fix this, we will effectively lower their deficiency budget by giving them some extra neighbors. Formally, we add the following: \begin{enumerate} \setcounter{enumi}{\value{count:constr}} \item \label{it21} For each guard vertex $g^i_j$, with $j\in \{A,B\}$, we construct an independent set $G^i_j$ of size $\D-n$ and connect it to $g^i_j$. For each $v\in G^i_j$ we add an equality gadget $Q(p_j,v)$. \item \label{it22} For each transfer vertex $l_{i,j}$ (respectively $h_{i,j}$), we construct an independent set of size $\D-n$ and connect all its vertices to $l_{i,j}$ (or respectively to $h_{i,j}$). For each vertex $v$ of this independent set we add an equality gadget $Q(p_A,v)$. \item \label{it24} For each vertex $c_e$ we add an independent set of size $\D$ and connect all its vertices to $c_e$. For each vertex $v$ of this independent set we add an equality gadget $Q(p_B,v)$. \setcounter{count:constr}{\value{enumi}} \end{enumerate} This completes the construction of the graph $H$. \subsection{Correctness}\label{sec:fvsred2} To establish Theorem \ref{thm:fvs1} we need to establish three properties of the graph $H(G,k,\C)$ described in the preceding section: that the existence of a $k$-clique in $G$ implies that $H$ admits a $(\C,\D)$-coloring; that a $(\C,\D)$-coloring of $H$ implies the existence of a $k$-clique in $G$; and that the tree-depth and feedback vertex set of $G$ are bounded by some function of $k$. These are established in the Lemmata below. \begin{lemma}\label{lem:fvsred1} For any $\C\ge 2$, if $G$ contains a $k$-clique, then the graph $H(G,k,\C)$ described in the previous section admits a $(\C,\D)$-coloring. \end{lemma} \begin{proof} Consider a clique of size $k$ in $G$ that includes exactly one vertex from each $V_i$. We will denote this clique by a function $f:\{1,\ldots,k\} \to \{1,\ldots,n\}$, that is, we assume that the clique contains the vertex with index $f(i)$ from $V_i$. We produce a $(\C,\D)$-coloring of $H$ as follows: vertex $p_A$ receives color $1$, while vertex $p_B$ receives color 2. All vertices for which we have added an equality gadget with one endpoint identified with $p_A$ (respectively $p_B$) take color 1 (respectively 2). We use Lemma \ref{lem:eq} to properly color the internal vertices of the equality gadgets. We have still left uncolored the choice vertices $c^i_j$ as well as the internal vertices $L^1_e,H^1_e,L^2_e,H^2_e,c_e$ of the edge gadgets. We proceed as follows: for all $i\in\{1,\ldots,k\}$ we use color $1$ on the vertices $c^i_l$ such that $l\in\{1,\ldots,f(i)\}\cup \{n+1,\ldots, 2n-f(i)\}$; we use color $2$ on all remaining choice vertices. For every $e\in E$ that is contained in the clique we color all vertices of the sets $L^1_e, H^1_e, L^2_e, H^2_e$ with color $1$, and $c_e$ with color $2$. For all other edges we use the opposite coloring: we color all vertices of the sets $L^1_e, H^1_e, L^2_e, H^2_e$ with color $2$, and $c_e$ with color $1$. We use Lemma \ref{lem:palette} to properly color the internal vertices of palette gadgets, since all palette gadgets that we add use either color $1$ or color $2$ twice in their endpoints. This completes the coloring. To see that the coloring we described is a $(\C,\D)$-coloring, first we note that by Lemmata \ref{lem:eq},\ref{lem:palette} internal vertices of equality and palette gadgets are properly colored. Vertices $p_A,p_B$ have exactly $\D$ neighbors with the same color; guard vertices $g^i_j$ have exactly $n$ neighbors with the same color among the choice vertices, hence exactly $\D$ neighbors with the same color overall; choice vertices have at most $k$ neighbors of the same color, and we can assume that $k<|E|-{k\choose 2}$; the vertex $c_U$ has exactly $\D=|E|-{k\choose 2}$ neighbors with color $1$, since the clique contains exactly $k\choose 2$ edges; all internal vertices of edge gadgets have at most one neighbor of the same color. Finally, for the transfer vertices $l_{i,j}$ and $h_{i,j}$, we note that $l_{i,j}$ (respectively $h_{i,j}$) has exactly $f(i)$ (respectively $n-f(i)$) neighbors with color $1$ among the choice vertices. Furthermore, when $i<j$, $l_{i,j}$ (respectively $h_{i,j}$) has $|L^1_e|$ (respectively $|H^1_e|$) neighbors with color $1$ in the edge gadgets, those corresponding to the edge $e$ that belongs in the clique between $V_i$ and $V_j$. But by construction $|L^1_e|=n-f(i)$ and $|H^1_e|=f(i)$, and with similar observations for the case $j<i$ we conclude that all vertices have deficiency at most $\D$. \end{proof} \begin{lemma}\label{lem:fvsred2} For any $\C\ge 2$, if the graph $H(G,k,\C)$ described in the previous section admits a $(\C,\D)$-coloring, then $G$ contains a $k$-clique. \end{lemma} \begin{lemma}\label{lem:fvsred3} For any $\C\ge 2$, the graph $H(G,k,\C)$ described in the previous section has $\mathrm{td}(H) = O(k^2 + \C)$. Furthermore, if $\C=2$, then $\mathrm{fvs}(H) = O(k^2)$. \end{lemma} Theorem \ref{thm:fvs1} now follows directly from the reduction we have described and Lemmata \ref{lem:fvsred1},\ref{lem:fvsred2},\ref{lem:fvsred3}. \section{ETH-based Lower Bounds for Treewidth and Pathwidth}\label{sec:eth} In this section we present a reduction which strengthens the results of Section \ref{sec:whard} for the parameters treewidth and pathwidth. In particular, the reduction we present here establishes that, under the ETH, the known algorithm for \DC\ for these parameters is essentially best possible. We use a similar presentation order as in the previous section, first giving the construction and then the Lemmata that imply the result. Where possible, we re-use the gadgets we have already presented. The main theorem of this section states the following: \begin{theorem}\label{thm:eth} For any fixed $\C\ge 2$, if there exists an algorithm which, given a graph $G=(V,E)$ and parameters $\C,\D$ decides if $G$ admits a $(\C,\D)$-coloring in time $n^{o(\mathrm{pw})}$, then the ETH is false. \end{theorem} \subsection{Basic Gadgets} We use again the equality and palette gadgets of Section \ref{sec:whard} (Definitions \ref{def:eq},\ref{def:palette}). Before proceeding, let us show that adding these gadgets to the graph does not increase the pathwidth too much. For the two types of gadget $Q,P$, we will call the vertices $u_1,u_2(,u_3)$ the endpoints of the gadget. \begin{lemma}\label{lem:eq-pw} Let $G=(V,E)$ be a graph and let $G'$ be the graph obtained from $G$ by repeating the following operation: find a copy of $Q(u_1,u_2,\C,\D)$, or $P(u_1,u_2,u_3,\C,\D)$; remove all its internal vertices from the graph; and add all edges between its endpoints which are not already connected. Then $\mathrm{tw}(G)\le \max\{\mathrm{tw}(G'),\C\}$ and $\mathrm{pw}(G)\le \mathrm{pw}(G')+\C$. \end{lemma} \subsection{Construction} We now describe a construction which, given an instance $G=(V,E),\ k$, of \MCC\ and a constant $\C$ returns a graph $H(G,k,\C)$ and an integer $\D$ such that $H$ admits a $(\C,\D)$-coloring if and only if $G$ has a $k$-clique, and the pathwidth of $H$ is $O(k+\C)$. We use $m$ to denote $|E|$, and we set $\D=m-{k\choose 2}$. As in Section \ref{sec:whard} we present the construction in steps to ease presentation, and we use the same conventions regarding adding $Q$ and $P$ gadgets to the graph. \smallskip \noindent \textbf{Palette Part}: This part repeats steps \ref{it1}-\ref{it5} of the construction of Section \ref{sec:whard}. We recall that this creates two main palette vertices $p_A,p_B$ (which are eventually guaranteed to have different colors). \smallskip \noindent \textbf{Choice Part}: In this part we construct a sequence of independent sets, arranged in what can be thought of as a $k\times 2m$ grid. The idea is that the choice we make in coloring the first independent set of every row will be propagated throughout the row. We can therefore encode $k$ choices of a number between $1$ and $n$, which will encode the clique. \begin{enumerate} \setcounter{enumi}{5} \item \label{itb6} For each $i\in\{1,\ldots,k\}$, for each $j\in\{1,\ldots,2m\}$ we construct an independent set $C_{i,j}$ of size $n$. \item (Backbone vertices) For each $i\in\{1,\ldots,k\}$, for each $j\in\{1,\ldots,2m-1\}$, for each $l\in\{A.B\}$ we construct a vertex $b_{i,j}^l$. We connect $b_{i,j}^l$ to all vertices of $C_{i,j}$ and all vertices of $C_{i,j+1}$. \item For each backbone vertex $b_{i,j}^l$ added in the previous step, for $l\in\{A,B\}$, we add an equality gadget $Q(p_l,b_{i,j}^l)$. \setcounter{count:constr2}{\value{enumi}} \end{enumerate} \smallskip \noindent \textbf{Edge Representation}: In the $k\times 2m$ grid of independent sets we have constructed we devote two columns to represent each edge of $G$. In the remainder we assume some numbering of the edges of $E$ with the numbers $\{1,\ldots,m\}$, as well as a numbering of each $V_i$ with the numbers $\{1,\ldots,n\}$. Suppose that the $j$-th edge of $E$, where $j\in\{1,\ldots,m\}$ connects the $j_1$-th vertex of $V_{i_1}$ to the $j_2$-th vertex of $V_{i_2}$, where $j_1,j_2\in\{1,\ldots,n\}$ and $i_1,i_2\in\{1,\ldots,k\}$. We perform the following steps for each such edge. \begin{enumerate} \setcounter{enumi}{\value{count:constr2}} \item We construct four independent sets $H_j^1,L_j^1,H_j^2,L_j^2$ with respective sizes $n-j_1,j_1,n-j_2,j_2$. \item \label{itb10} We construct four vertices $h_j^1,l_j^1,h_j^2,l_j^2$. We connect $h_j^1$ (respectively $l_j^1,h_j^2,l_j^2$) with all vertices of $H_j^1$ (respectively $L_j^1,H_j^2,L_j^2$). \item We connect $h_j^1$ to all vertices of $C_{i_1,2j-1}$, $l_j^1$ to all vertices of $C_{i_1,2j}$, $h_j^2$ to all vertices of $C_{i_2,2j-1}$, $l_j^2$ to all vertices of $C_{i_2,2j}$. \item \label{itb12} We add equality gadgets $Q(p_A,h_j^1), Q(p_A,l_j^1), Q(p_A,h_j^2), Q(p_A,l_j^2)$. \item \label{itb13} We add a checker vertex $c_j$ and connect it to all vertices of $H_j^1\cup L_j^1\cup H_j^2\cup L_j^2$. \setcounter{count:constr2}{\value{enumi}} \end{enumerate} \smallskip \noindent \textbf{Validation and Budget-Setting}: Finally, we add a vertex that counts how many edges we have included in our clique, as well as appropriate vertices to diminish the deficiency budget of various parts of our construction. \begin{enumerate} \setcounter{enumi}{\value{count:constr2}} \item \label{itb14} We add a universal checker vertex $c_U$ and connect it to all vertices $c_j$ added in step \ref{itb13}. We add an equality gadget $Q(p_A,c_U)$. \item \label{itb15} For every vertex $c_j$ added in step \ref{itb13} we construct an independent set of size $\D$ and connect all its vertices to $c_j$. For each vertex $v$ in this set we add an equality gadget $Q(p_B,v)$. \item For each vertex constructed in step \ref{itb10} ($h_j^1, l_j^1, h_j^2, l_j^2$), we construct an independent set of size $\D-n$ and connect it to the vertex. For each vertex $v$ of this independent set we add an equality gadget $Q(p_A,v)$. \item \label{itb17} For each backbone vertex $b_{i,j}^l$, with $l\in\{A,B\}$, we construct an independent set of size $\D-n$ and connect it to $b_{i,j}^l$. For each vertex $v$ of this independent set we add an equality gadget $Q(p_l,v)$. \item \label{itb18} If $\C\ge3$, for each vertex $v$ added in steps \ref{itb6}-\ref{itb17} we add a palette gadget $P(p_A,p_B,v)$. \end{enumerate} \subsection{Correctness} \begin{lemma}\label{lem:eth1} For any $\C\ge 2$, if $G$ contains a $k$-clique then the graph $H(G,k,\C)$ described in the previous section admits a $(\C,\D)$-coloring. \end{lemma} \begin{lemma}\label{lem:eth2} For any $\C\ge2$, if the graph $H(G,k,\C)$ described in the previous section admits a $(\C,\D)$-coloring, then $G$ contains a $k$-clique. \end{lemma} \begin{lemma}\label{lem:eth3} For the graph $H(G,k,\C)$ described in the previous section $\mathrm{pw}(H)=O(k+\C)$. \end{lemma} The proof of Theorem \ref{thm:eth} now follows directly from Lemmata \ref{lem:eth1},\ref{lem:eth2},\ref{lem:eth3}. \section{Exact Algorithms for Treewidth and Other Parameters}\label{sec:exact} In this section we present several exact algorithms for \DC. Theorem \ref{thm:tw-exact} gives a treewidth-based algorithm which can be obtained using standard techniques. Essentially the same algorithm was already sketched in \cite{BelmonteLM17}, but we give another version here for the sake of completeness and because it is a building block for the approximation algorithm of Theorem \ref{thm:tw-approx1}. Theorem \ref{thm:alg-fvs} uses a win/win argument to show that the problem is FPT parameterized by $\mathrm{fvs}$ when $\C\neq 2$ and therefore explains why the reduction presented in Section \ref{sec:whard} only works for $2$ colors. Theorem \ref{thm:alg-vc} uses a similar argument to show that the problem is FPT parameterized by $\mathrm{vc}$ (for any $\C$). \begin{theorem}\label{thm:tw-exact} There is an algorithm which, given a graph $G=(V,E)$, parameters $\C,\D$, and a tree decomposition of $G$ of width $\mathrm{tw}$, decides if $G$ admits a $(\C,\D)$-coloring in time $(\C\D)^{O(\mathrm{tw})}n^{O(1)}$. \end{theorem} \begin{theorem}\label{thm:alg-fvs} \DC\ is FPT parameterized by $\mathrm{fvs}$ for $\C\neq 2$. More precisely, there exists an algorithm which given a graph $G=(V,E)$, parameters $\C, \D$, with $\C\neq2$, and a feedback vertex set of $G$ of size $\mathrm{fvs}$, decides if $G$ admits a $(\C,\D)$-coloring in time $\mathrm{fvs}^{O(\mathrm{fvs})}n^{O(1)}$. \end{theorem} \begin{theorem}\label{thm:alg-vc} \DC\ is FPT parameterized by $\mathrm{vc}$. More precisely, there exists an algorithm which, given a graph $G=(V,E)$, parameters $\C,\D$, and a vertex cover of $G$ of size $\mathrm{vc}$, decides if $G$ admits a $(\C,\D)$-coloring in time $\mathrm{vc}^{O(\mathrm{vc})}n^{O(1)}$. \end{theorem} \section{Approximation Algorithms and Lower Bounds}\label{sec:approx} In this section we present two approximation algorithms which run in FPT time parameterized by treewidth. The first algorithm (Theorem \ref{thm:tw-approx1}) is an \emph{FPT approximation scheme} which, given a desired number of colors $\C$, is able to approximate the minimum feasible value of $\D$ for this value of $\C$ arbitrarily well (that is, within a factor $(1+\epsilon)$). The second algorithm, which also runs in FPT time parameterized by treewidth, given a desired value for $\D$, produces a solution that approximates the minimum number of colors $\C$ within a factor of $2$. These results raise the question of whether it is possible to approximate $\C$ as well as we can approximate $\D$, that is, whether there exists an algorithm which comes within a factor $(1+\epsilon)$ (rather than $2$) of the optimal number of colors. As a first response, one could observe that such an algorithm probably cannot exist, because the problem is already hard when $\C=2$, and therefore an FPT algorithm with multiplicative error less than $3/2$ would imply that FPT=W[1]. However, this does not satisfactorily settle the problem as it does not rule out an algorithm that achieves a much better approximation ratio, if we allow it to also have a small additive error in the number of colors. Indeed, as we observe in Corollary \ref{thm:fvs-approx}, it is possible to obtain an algorithm which runs in FPT time parameterized by feedback vertex set and has an additive error of only $1$, as a consequence of the fact that the problem is FPT for $\C\ge 3$. This poses the question of whether we can design an FPT algorithm parameterized by treewidth which, given a $(\C,\D)$-colorable graph, produces a coloring with $\rho\C+O(1)$ colors, for $\rho<3/2$. In the second part of this section we settle this question negatively by showing, using a recursive construction that builds on Theorem \ref{thm:fvs1}, that such an algorithm cannot exist. More precisely, we present a gap-introducing version of our reduction: the ratio between the number of colors needed to color Yes and No instances remains $3/2$, even as the given $\C$ increases. This shows that the ``correct'' multiplicative approximation ratio for this problem really lies somewhere between $3/2$ and $2$, or in other words, that there are significant barriers impeding the design of a better than $3/2$ FPT approximation for $\C$, beyond the simple fact that $2$-coloring is hard. \subsection{Approximation Algorithms} Our first approximation algorithm, which is an approximation scheme for the optimal value of $\D$, relies on a method introduced in \cite{Lampis14} (see also \cite{AngelBEL16}), and a theorem of \cite{BodlaenderH98}. The high-level idea is the following: intuitively, the obstacle that stops us from obtaining an FPT running time with the dynamic programming algorithm of Theorem \ref{thm:tw-exact} is that the dynamic program is forced to store some potentially large values for each vertex. More specifically, to characterize a partial solution we need to remember not just the color of each vertex in a bag, but also how many neighbors with the same color this vertex has already seen (which is a value that can go up to $\D$). The main trick now is to ``round'' these values in order to decrease the number of possible states a vertex can be found in. To do this, we select an appropriate value $\delta$ (polynomial in $\frac{\epsilon}{\log n}$), and try to replace every value that the dynamic program would calculate with the next higher integer power of $(1+\delta)$. This has the advantage of limiting the number of possible values from $\D$ to $\log_{(1+\delta)}\D \approx \frac{\log \D}{\delta}$, and this is sufficient to obtain the promised running time. The problem is now that the rounding we applied introduces an approximation error, which is initially a factor of at most $(1+\delta)$, but may increase each time we apply an arithmetic operation as part of the algorithm. To show that this error does not get out of control we show that in any bag of the tree all values stored are within a factor $(1+\delta)^h$ of the correct ones, where $h$ is the height of the bag. We then use a theorem of Bodlaender and Hagerup \cite{BodlaenderH98} which states that any tree decomposition can be balanced in such a way that its height is at most $O(\log n)$, and as a result we obtain that all values are sufficiently close to being correct. The second algorithm we present in this section (Theorem \ref{thm:tw-approx2}) uses the approximation scheme for $\D$ to obtain an FPT $2$-approximation for $\C$. The idea here is that, given a $(\C,\D)$-colorable graph, we first produce a $(\C,(1+\epsilon)\D)$-coloring using the algorithm of Theorem \ref{thm:tw-approx1}, and then apply a procedure which uses $2$ colors for each color class of this solution but manages to divide by two the number of neighbors with the same color of every vertex. This is achieved with a simple polynomial-time local search procedure. \begin{theorem}\label{thm:bodlaender} \cite{BodlaenderH98} There is a polynomial-time algorithm which, given a graph $G=(V,E)$ and a tree decomposition of $G$ of width $\mathrm{tw}$, produces a tree decomposition of $G$ of width at most $3\mathrm{tw}+2$ and height $O(\log n)$. \end{theorem} \begin{theorem}\label{thm:tw-approx1} There is an algorithm which, given a graph $G=(V,E)$, parameters $\C,\D$, a tree decomposition of $G$ of width $\mathrm{tw}$, and an error parameter $\epsilon>0$, either returns a $(\C,(1+\epsilon)\D)$-coloring of $G$, or correctly concludes that $G$ does not admit a $(\C,\D)$-coloring, in time $(\mathrm{tw}/\epsilon)^{O(\mathrm{tw})}n^{O(1)}$. \end{theorem} \begin{lemma}\label{lem:max-cut} There exists a polynomial-time algorithm which, given a graph with maximum degree $\Delta$, produces a two-coloring of that graph where all vertices have at most $\Delta/2$ neighbors of the same color.\end{lemma} \begin{theorem}\label{thm:tw-approx2} There is an algorithm which, given a graph $G=(V,E)$, parameters $\C,\D$, and a tree decomposition of $G$ of width $\mathrm{tw}$, either returns a $(2\C,\D)$-coloring of $G$, or correctly concludes that $G$ does not admit a $(\C,\D)$-coloring, in time $(\mathrm{tw})^{O(\mathrm{tw})}n^{O(1)}$. \end{theorem} \subsection{Hardness of Approximation} The main result of this section is that $\C$ cannot be approximated with a factor better than $3/2$ in FPT time (for parameters tree-depth, pathwidth, or treewidth), even if we allow the algorithm to also have a constant additive error. We remark that an FPT algorithm with additive error $1$ is easy to obtain for feedback vertex set (Corollary \ref{thm:fvs-approx}). \begin{theorem}\label{thm:apxhard} For any fixed $\C>0$, if there exists an algorithm which, given a graph $G=(V,E)$ and a $\D\ge 0$, correctly distinguishes between the case that $G$ admits a $(2\C,\D)$-coloring, and the case that $G$ does not admit a $(3\C-1,\D)$-coloring in FPT time parameterized by $\mathrm{td}(G)$, then FPT=W[1]. \end{theorem} \begin{corollary}\label{cor:apxhard} For any constants $\delta_1,\delta_2>0$, if there exists an algorithm which, given a graph $G=(V,E)$ that admits a $(\C,\D)$-coloring and parameters $\C,\D$, is able to produce a $((\frac{3}{2}-\delta_1)\C+\delta_2,\D)$-coloring of $G$ in FPT time parameterized by $\mathrm{td}(G)$, then FPT=W[1]. \end{corollary} \begin{corollary}\label{thm:fvs-approx} There is an algorithm which, given a graph $G=(V,E)$, parameters $\C,\D$, and a feedback vertex set of $G$ of size $\mathrm{fvs}$, either returns a $(\C+1,\D)$-coloring of $G$, or correctly concludes that $G$ does not admit a $(\C,\D)$-coloring, in time $(\mathrm{fvs})^{O(\mathrm{fvs})}n^{O(1)}$. \end{corollary} \section{Conclusions} In this paper we classified the complexity of \DC\ with respect to some of the most well-studied graph parameters, given essentially tight ETH-based lower bounds for pathwidth and treewidth, and explored the parameterized approximability of the problem. Though this gives a good first overview of the problem's parameterized complexity landscape, there are several questions worth investigating next. First, is it possible to make the lower bounds of Section \ref{sec:eth} even tighter, by precisely determining the base of the exponent in the algorithm's dependence? This would presumably rely on a stronger complexity assumption such as the SETH, as in \cite{LokshtanovMS11a}. Second, can we determine the complexity of the problem with respect to other structural parameters, such as clique-width \cite{CourcelleMR00}, modular-width \cite{GajarskyLO13}, or neighborhood diversity \cite{Lampis12}? For some of these parameters the existence of FPT algorithms is already ruled out by the fact that \DC\ is NP-hard on cographs \cite{BelmonteLM17}, however the complexity of the problem is unknown if we also add $\C$ or $\D$ as a parameter. Finally, it would be very interesting to close the gap between $2$ and $3/2$ on the performance of the best treewidth-parameterized FPT approximation for $\C$. \newpage
\section{Introduction} \label{sec:intro} Calculating many-body physics exactly is a great challenge due to the exponentially increasing numerical cost of storing the wavefunction with increasing particle number. To overcome this problem, Density Functional Theory (DFT) \cite{Parr1994,Burke2012} uses the density as a basic variable to describe the system's ground-state properties. At the heart of DFT lies the Hohenberg-Kohn theorem where the ground-state wavefunction and density are demonstrated to have a one-to-one mapping \cite{Hohenberg}. Although this is a key concept for DFT, the relationship is not fully understood. Here we follow on from previous research \cite{DAmico,S&D,S&D2,Skelt2017}, using these metrics to further understanding of this one-to-one mapping of density and wavefunction. Metrics are used as a measure of distance, and in particular ``natural'' metrics have previously been used to study density distances and wavefunction distances. The relationship between these two distances for families of closely related systems in their ground state was shown to be quasi-linear; linear for most distances, but deviating from this linear relationship close to the maximum distances to ensure these distances are reached together in the wavefunction and density \cite{DAmico,S&D}. Recent work has extended this to show that this relationship extends beyond related systems to families of unrelated single-electron systems, and has been expanded further to look at time-dependent systems using the metrics. This has been used to characterise quantum dynamics and adiabaticity in single-electron quantum systems \cite{Skelt2017}. Here we show how to generate the random systems used in Ref.~\cite{Skelt2017}, ensuring the electrons remain confined whilst still providing a range of systems with rich physics to explore. We then apply metrics to time dependent single electron systems, looking at the mapping between wavefunctions and densities. As the number of electrons increases, the relationship between the wavefunction and the density gets increasingly more complicated, and so it is the natural progression to look at larger systems using these metrics. Therefore we move on to applying these techniques to two-electron ground-state systems. We explore the wavefunction-density mapping for DFT using the metrics, and compare interacting and non-interacting results, which can be useful when considering Kohn-Sham systems in DFT \cite{Kohn1965}. \section{Random potentials for quantum systems} \label{sec:rand} Much of the work looking at solving quantum systems exactly uses very well known systems, such as the Hubbard model or Hooke's atom \cite{DAmico,S&D,Herrera2017}. However, the iDEA code has the ability to numerically exactly solve any 1, 2 or 3 electron system in one dimension for the density and the wavefunction \cite{Hodgson}. We therefore look at methods of randomly generating a wide range of systems, ``random potentials'', to be solved exactly by iDEA. By generating a wide range of systems, we can explore systems with diverse physics. There are not the constraints of just varying one or two parameters of the Hamiltonian, such as the frequency of the Hooke's atom. However, we still require some constraints. The potential must be confining overall, and the shape must be smooth so the system is still physical. Using these requirements, we look at using polynomials and Fourier series with randomly generated coefficients to produce the random potentials. \subsection{Polynomials} \label{sec:poly} To generate the random potentials using polynomials, we used polynomial series up to even powers, to ensure the confinement of the electrons. Each term in the series was then assigned a random coefficient from a uniform distribution. However it was seen that these were insufficient for producing varied secondary wells in the potential, `microwells', and the potential was predominantly flat. This was exacerbated when an $x^{10}$ confining potential was applied to affirm the electron confinement. \subsection{Fourier series} \label{sec:fourier} To improve on the polynomial series for obtaining random potentials, we turn to a Fourier series with random coefficients. Since the electrons still need to be confined, an overall potential of $x^{10}$ is applied, but scaled by $1/10^{11}$ to ensure the oscillations from the Fourier series are still dominant. An $x^2$ confining potential was also investigated but it was found to be too dominating at the edges of the system. The form of the Fourier series is: \begin{equation} \label{eq:rand_pot} V_{ext} = \frac{x^{10}}{10^{11}} + \Lambda \sum_{n=1}^3 \left( a_n \cos \frac{n \pi x}{L} + b_n \sin \frac{n \pi x}{L} \right), \end{equation} where $\Lambda$ is the confining strength of the potential microwells, $L$ is half the system size (in atomic units\footnote{We denote atomic units using a.u., where $\hbar = m = e = 4 \pi \varepsilon_0 = 1 $.}) and $a_n$ and $b_n$ are random numbers from a uniform distribution ranging from $-L/3$ to $L/3$. \begin{figure} \includegraphics[width=0.48\textwidth]{potentials2.pdf} \caption{A range of potentials generated using Eq.~\ref{eq:rand_pot}, shifted so the ground-state energy lies at 0 (shown by the horizontal dotted line).} \label{fig:pots} \end{figure} As we can see from Fig.~\ref{fig:pots}, Eq.~\ref{eq:rand_pot} yields a wide variety of confining potentials. Note that these potentials all have three microwells due to Eq.~\ref{eq:rand_pot} being a Fourier series up to 3 terms of $\cos(x)$ and $\sin(x)$. For more wells, the series just needs to be extended to the number of microwells desired. To increase (decrease) the tunneling between wells, $\Lambda$ can be decreased (increased). The system size can also be increased to accommodate more microwells if necessary. Eq.~\ref{eq:rand_pot} is a versatile method for generating a wide range of physical quantum systems. We see that this formulation gives a wide range of potentials leading to diverse static and dynamic behaviours. This way of generating systems, therefore, enables broader studies of quantum phenomena. This is enhanced by the iDEA code's ability to exactly solve any potential for one, two or three electron systems. \section{Metrics} \label{sec:mets} Metrics are a useful way to measure the distance between quantities. In Ref.~\cite{DAmico}, ``natural'' metrics for calculating the wavefunction distance and density distance were developed from conservation laws. While other metrics could in principle be used, this protocol for deriving metrics ensures that they are at the same time not arbitrary and physically sound. These ``natural'' metrics are: \begin{equation} \label{eq:wf_met} D_{\psi}\left(\psi_1, \psi_2 \right) = \left[ 2N - 2 \left| \int \psi^*_1 \psi_2 \, dr_1 \ldots dr_N \right| \right]^{\frac{1}{2}} \, ; \end{equation} \begin{equation} \label{eq:den_met} D_{n}\left( n_1, n_2 \right) = \int |n_1(\textbf{r}) - n_2(\textbf{r})|d^3\textbf{r} \, . \end{equation} It has been studied how these metrics can show the relationship between ground state densities and wavefunctions for families of systems where one parameter is varied \cite{DAmico,S&D}. These results showed that there was a quasi-linear relationship for these related systems, the gradient of which was dependent on the number of electrons, $N$ (up to $N=8$) \cite{DAmico}. More recent research has extended this to show that this relationship holds beyond related families of systems, to families of unrelated, random potentials of one electron. This is then used to determine adiabaticity in quantum systems \cite{Skelt2017}. We will extend the use of metrics to look at this relationship for single electron random systems under very fast dynamics. This opens up questions about the ergodicity of wavefunctions and densities in metric space. We will also see here how this relationship also holds for two-electron random systems in their ground-state, providing a good basis for the use of metrics to compare any two systems of $N$-electrons in their ground-state. This can then be used for investigating the one-to-one mapping of the density and wavefunction, at the heart of DFT, or for characterising quantum dynamics and adiabaticity (as has already been shown for single electron systems), among other applications. \section{Time-dependent single electron random-potential systems} \label{sec:1e} In this section, we apply the metrics to a range of random potentials (see Table~\ref{tab:sys_param} in Appendix~\ref{sec:append} for the parameters used in Eq.~\ref{eq:rand_pot} to generate these random potentials), focusing on the time-dependent single-electron systems. It is noted that for ground-state single-electron systems, the linear relationship is seen with a gradient of $\sim$1.5 \cite{Skelt2017}, as reported by the black dashed line in Fig.~\ref{fig:1e_td} A family of 10 random single electron systems is perturbed by a constant, uniform, electric field of strength 0.01 a.u. at $t=0$. This relatively strong electric field creates a current flow that is highly position- and time-dependent. These systems' dynamics were compared to a reference system within the family, at each time step. Fig.~\ref{fig:1e_td} shows how the systems evolve with respect to each other, in terms of the density distance and wavefunction distance. \begin{figure} \includegraphics[width=0.48\textwidth]{snail_plot_paper_color} \caption{Density distance ($D(n_1(x,t),n_2(x,t))$) against wavefunction distance ($D(\psi_1(x,t),\psi_2(x,t))$) for a family of random systems experiencing an electric field of strength 0.01 a.u. at $t=0$. The field induces a strongly out-of-equilibrium dynamics. The `ground-state line', along which the systems would align if in the ground-state or if adiabatic, is shown by the black dashed line ($y=1.55x$). The distances between the ground-states at $t=0$ are marked by the black crosses, and indeed can be seen to lay close to the ground-state line. Once the perturbation is applied, the distances, seen by the red trails, no longer remain on the ground-state line.} \label{fig:1e_td} \end{figure} Under this highly out-of-equilibrium regime, the ratio between the density distance and wavefunction distance (between any two systems) does not remain linear, but in fact begins to explore the region below the ground-state line (Fig.~\ref{fig:1e_td}). This suggests a non-ergodic nature of quantum dynamics in metric spaces. Also from this exploration of the lower triangle, it can be seen that the wavefunction distance is, on average, affected more than the density distance under out-of-equilibrium dynamics. There is no guarantee that two similar densities, with a small distance between them, correspond to two similar wavefunctions, and the exploration of this lower triangle corresponds to these situations. However the reverse of two similar wavefunctions corresponding to two very different densities, which would lead to the upper triangle being explored, is not observed.\footnote{The Runge-Gross theorem does not prohibit two systems, propagated by (possibly different) time-dependent potentials from different initial many-body states from having the same density at some later instant. Such a case would provide a trajectory that touches the very bottom of the lower triangle in Fig.~\ref{fig:1e_td}: $D_n=0$ while $D_{\psi} \neq 0$. This provides further support for time-evolution in the metric space of Fig.~\ref{fig:1e_td}. being predominantly concentrated away from the upper triangle.} This provides intricate details of the mapping between densities and wavefunctions. \section{Ground-state two electron random-potential systems} \label{sec:2e} It was seen that the ground-state quasi-linear relationship between wavefunction distances and density distances was not just for families of related systems, but also indeed holds for families of single-electron random systems. We now investigate whether this is the case for systems of 2 electrons with random potentials (see Table~\ref{tab:sys_param} in Appendix~\ref{sec:append} for the parameters used in Eq.~\ref{eq:rand_pot} to generate these random potentials), for both interacting and non-interacting systems. It must be noted that Eqs.~\ref{eq:wf_met} and \ref{eq:den_met} are normalised to the number of electrons, $\sqrt{N}$ and $N$ respectively, but Figs.~\ref{fig:2e_int} and \ref{fig:2e_non_int} normalise the metrics to 1. This is for ease of comparison with the quasi-linear relationships found in Ref.~\cite{DAmico}. \subsection{Interacting systems} \label{sec:int} \begin{figure} \includegraphics[width=0.48\textwidth]{denpsi_plot_2e_int_7.pdf} \caption{The relationship between the distances of densities and distances of wavefunctions for a family of two-electron random-potential systems is seen to be quasi-linear with a gradient of $\sim$1.06 (black dashed line).} \label{fig:2e_int} \end{figure} We generate a family of 10 random potentials with two interacting electrons, using Eq.~\ref{eq:rand_pot} with $\Lambda = 0.1$ and $L = 15$, and then compare every system to every other system in the family using Eqs.~\ref{eq:wf_met} and \ref{eq:den_met}. We obtain the results shown in Fig.~\ref{fig:2e_int} using the iDEA code, which uses the reduced Coulomb interaction: $1/(|x-x'|+1)$. These two-electron ground-state results display a striking linearity between the wavefunction distances and the density distances, even though the families of systems vary by several parameters (unlike previous studies where families of systems only varied by one parameter, such as the frequency in the Hooke's atom \cite{DAmico}). The ratio of this relationship, for these interacting two electron random systems, is $\sim$1.06, consistent with the one of $\sim$1 found in Ref.~\cite{DAmico}, for the isoelectronic Helium series, Hooke's atom and the two electron Hubbard model. The relationship between the ratio of the distances and the number of electrons, seen in ~\cite{DAmico}, is also observed for unrelated random systems, supporting that this may be a general property for comparisons of any systems. This can be used to gain insight into the one-to-one mapping between densities and wavefunctions, in turn improving understanding of the Hohenberg-Kohn theorem for DFT. \subsection{Non-interacting systems} \label{sec:non-int} \begin{figure} \includegraphics[width=0.48\textwidth]{denpsi_plot_2e_nonint_7.pdf} \caption{For a family of two electron non-interacting random systems, the relationship between the density distances and wavefunction distances is also seen to be quasi-linear with a gradient of $\sim$0.97 (black dashed line).} \label{fig:2e_non_int} \end{figure} Considering the same family of systems as used in Sec.~\ref{sec:int} but with non-interacting electrons yields the results shown in Fig.~\ref{fig:2e_non_int}. We see the ratio of distances to be $\sim$0.97, which is very similar to the value seen for the interacting two-electron random-potential systems, and to the value found in \cite{DAmico} for families obtained by varying a parameter in the Hamiltonians. The striking linearity for both interacting and non-interacting systems opens up many opportunities for these metrics to be used to investigate relationships for a wide range of many-body systems. The quasi-linear relationship for the ratio of distances remaining in non-interacting systems enables applications of metrics for Kohn-Sham systems within DFT. Some work in this direction has been done in Ref.~\cite{Sharp2016} and using metrics for Kohn-Sham systems is currently being investigated. We note that, while the individual points change between the interacting and non-interacting graphs, the overall trend is similar, therefore using this method one can gain information on the effect of interactions for individual systems, as well as on the general trend of families of systems. \section{Conclusion} \label{sec:conc} We have seen how a Fourier series combined with a tailored confining potential, provides a wide range of random potentials with the ability to explore many different quantum systems displaying diverse physics. From these random potentials, we use metrics to gain insight into the relationship between the density and wavefunction mapping for time-dependent single electron systems. This mapping is also at the core of time-dependent DFT \cite{Runge,Marques2006}, where metrics have the potential to play a role at furthering understanding. We see that the wavefunction distance is impacted greater than the density distance by highly out-of-equilibrium dynamics, and that the quantum systems explored are non-ergodic in metric space. Extending the use of these random potentials, we have shown that families of two-electron random systems in their ground state still have a quasi-linear relationship between wavefunction distance and density distance, proportional to the number of electrons (the normalisation of the wavefunction has an impact on this relationship, so care needs to be taken when comparing across research). This is seen to be true in both interacting and non-interacting cases, leading to the possibility of using metrics to investigate Kohn-Sham systems for DFT. We have seen that Hohenberg-Kohn and Runge-Gross theorems can be described by the metrics for the one and two particle random systems. This has already highlighted the intricate relationship between wavefunctions and densities in a visual way. As the number of electrons increases, this relationship becomes more complicated. Therefore metrics have the potential to provide further insight into, and visually represent, this relationship with the Hohenberg-Kohn theorems for ground states, the Runge-Gross theorems for the time-dependent systems, the link between the ground states and time-dependent systems, and also looking at approximations used for Kohn-Sham systems. \begin{acknowledgements} We acknowledge helpful discussions with P. Sharp, J. Wetherell and M. Hodgson, and advice on the iDEA code from J. Wetherell. AHS acknowledges support from EPSRC; IDA acknowledges support from the Conselho Nacional de Desenvolvimento Cientfico e Tecnologico (CNPq, Grant: PVE Processo: 401414/2014-0) and from the Royal Society (Grant no. NA140436). \end{acknowledgements}
\section{Introduction}\label{S:Introduction} Consider a network represented as a weighted and undirected graph $\ccalG$, consisting of a node set $\ccalN$ of cardinality $N$, an edge set $\ccalE$ of unordered pairs of elements in $\ccalN$, and edge weights $A_{ij}\in\reals$ such that $A_{ij}=A_{ji}\neq 0$ for all $(i,j)\in\ccalE$. The edge weights $A_{ij}$ are collected in the \textit{symmetric} adjacency matrix $\bbA\in\reals^{N\times N}$. More broadly, one can define a generic \emph{graph-shift operator} (GSO) $\bbS\in\reals^{N\times N}$ as any matrix having the same sparsity pattern than that of $\ccalG$~\cite{SandryMouraSPG_TSP13}. Although the choice of $\bbS$ can be adapted to the problem at hand, it is often chosen as either $\bbA$, the Laplacian $\bbL:={\mathrm{diag}}(\bbA\bbone)-\bbA$, or its normalized counterparts~\cite{EmergingFieldGSP}. Our focus in this paper is on identifying graphs that explain the structure of a random signal. Formally, let $\bbx=[x_1,...,x_N]^T \in\mbR^N$ be a zero-mean graph signal with covariance matrix $\bbC_\bbx=\E{\bbx\bbx^T}$, in which the $i$th element $x_i$ denotes the signal value at node $i$ of an \emph{unknown graph} $\ccalG$ with shift operator $\bbS$. We say that the graph $\bbS$ represents the structure of the signal $\bby\in\mbR^N$ if there exists a diffusion process in the GSO $\bbS$ that produces the signal $\bby$ from the input signal $\bbx$, that is \begin{equation}\label{eqn_diffusion} \bby = \textstyle \alpha_0 \prod_{l=1}^{\infty} (\bbI_N-\alpha_l \bbS) \bbx = \sum_{l=0}^{\infty}\beta_l \bbS^l\,\bbx, \end{equation} for some set of parameters $\{\alpha_l\}$ or, equivalently, $\{\beta_l\}$. While $\bbS$ encodes local one-hop interactions, each successive application of the shift in \eqref{eqn_diffusion} percolates $\bbx$ over $\ccalG$; see e.g.~\cite{segarra2015graphfilteringTSP15}. The product and sum representations in~\eqref{eqn_diffusion} are common equivalent models for the generation of random network processes. Indeed, any process that can be understood as the linear propagation of an input signal through a static graph can be written in the form in \eqref{eqn_diffusion}, subsuming heat diffusion~\cite{vespignanibook}, consensus and the classic DeGroot model of opinion dynamics~\cite{DeGrootConsensus}, as well as symmetric structural equation models (SEMs) \cite{kolaczyk2009book} as special cases. When $\bbx$ is white so that $\bbC_\bbx=\bbI_N$, \eqref{eqn_diffusion} is equivalent to saying that the graph process $\bby$ is \emph{stationary} in $\bbS$; see e.g., \cite[Def. 1]{marques2016stationaryTSP16},~\cite{perraudinstationary2016},~\cite{girault_stationarity} and Section \ref{ssec:stationarity} for further details. Here though, we deal with more general non-stationary signals $\bby$ that adhere to linear diffusion dynamics as in \eqref{eqn_diffusion}, but where the input covariance $\bbC_{\bbx}$ can be arbitrary. This is for instance relevant to (geographically) correlated sensor network data, urban population mobility patterns, or to models of opinion dynamics, where (even before engaging in discussion) the network agents can be partitioned into communities according to their standing on the subject matter. The justification to say that $\bbS$ represents the structure of $\bby$ is that we can think of the edges of $\bbS$ as direct (one-hop) relations between the elements of the signal. The diffusion described by \eqref{eqn_diffusion} modifies the original correlation by inducing indirect (multi-hop) relations. In this context, our goal is to recover the fundamental relations dictated by $\bbS$ from a set of independent samples of a non-stationary random signal $\bby$, as well as realizations of $\bbx$, or more pragmatically, knowledge of $\bbC_\bbx$. This additional information on the input $\bbx$ is the price paid to accommodate the more general non-stationary generative models for $\bby$, and is not needed when identifying the structure of stationary graph signals~\cite{segarra2016topoidTSP16}, since $\bbC_\bbx = \bbI_N$ in that case. \noindent \textbf{Relation to prior work.} Under the assumption that the signals are related to the topology of the graph where they are supported, the goal of graph signal processing (GSP) is to develop algorithms that fruitfully leverage this relational structure, and can make inferences about these relationships when they are only partially observed~\cite{EmergingFieldGSP,SandryMouraSPG_TSP13}. Most GSP efforts to date assume that the underlying network is known, and then analyze how the graph's algebraic and spectral characteristics impact the properties of the graph signals of interest. However, such assumption is often untenable in practice and arguably most graph construction schemes are largely informal, distinctly lacking an element of validation. Network topology inference is a prominent task in Network Science~\cite[Ch. 7]{kolaczyk2009book}. It is also central to predicting emergent complex behavior as well as monitoring the operation of (networked) critical infrastructures, including the smart power grid, transportation systems and the Internet backbone~\cite{smartgrid_spmag,mobility_network_fiori,network_tomography}. Since networks typically encode similarities between nodes, several topology, inference approaches construct graphs whose edge weights correspond to nontrivial correlations or coherence measures between signal profiles at incident nodes~\cite{kolaczyk2009book,sporns2012book}. Acknowledging that the observed correlations can be due to latent network effects, alternative methods rely on inference of full partial correlations~\cite[Ch. 7.3.2]{kolaczyk2009book}. Under Gaussianity assumptions, there are well-documented connections with covariance selection~\cite{dempster_cov_selec} and sparse precision matrix estimation~\cite{GLasso2008,banerjee2008jlmr,Lake10discoveringstructure,slawski2015estimation,egilmez2017jstsp}, as well as high-dimensional sparse linear regression~\cite{meinshausen06}. Extensions to directed graphs include SEMs~\cite{BazerqueGeneNetworks,BainganaInfoNetworks,shen2017tensors}, Granger causality~\cite{Brovelli04Granger,sporns2012book}, or their nonlinear (kernelized) variants~\cite{Karanikolas_icassp16,shen2016kernelsTSP16}. Recent GSP-based network inference frameworks postulate instead that the network exists as a latent underlying structure, and that observations are generated as a result of a network process defined in such graph~\cite{segarra2016topoidTSP16,pasdeloup2016inferenceTSIPN16,thanou17,MeiGraphStructure,DongLaplacianLearning,Kalofolias2016inference_smoothAISTATS16}. Different from~\cite{thanou17,DongLaplacianLearning,MeiGraphStructure, Kalofolias2016inference_smoothAISTATS16} that operate on the graph domain, the goal here is to identify graphs that endow the given observations with desired spectral (frequency-domain) characteristics. Two works have recently explored this approach by identifying a GSO given its eigenvectors~\cite{segarra2016topoidTSP16,pasdeloup2016inferenceTSIPN16}, but both rely on observations of stationary graph signals. Different from~\cite{DongLaplacianLearning,Kalofolias2016inference_smoothAISTATS16,sandeep_icassp17,mike_icassp17} that infer structure from signals assumed to be smooth over the sought graph, here the measurements are related to the graph via filtering (e.g., modeling the diffusion of an idea or the spread of a disease). Smoothness models are subsumed as special cases found with diffusion filters having a low-pass frequency response. \noindent \textbf{Paper outline.} In Section \ref{S:prelim_problem} we formulate the problem of identifying a GSO that explains the fundamental structure of a random signal diffused on a graph. While for stationary $\bby$ the sought GSO shares its eigenvectors with the signal's covariance matrix~\cite{marques2016stationaryTSP16, perraudinstationary2016,segarra2016topoidTSP16}, in the general (non-stationary) setting dealt with here this no longer holds and we elaborate on the ensuing challenges (Section \ref{ssec:stationarity}). Still, the graph's eigenvectors are preserved by the polynomial graph filter that governs the underlying diffusion dynamics~\eqref{eqn_diffusion}. This motivates a novel two-step network topology inference approach whereby we: i) identify the GSO's eigenbasis from a judicious \textit{graph filter estimate}; and ii) rely on these \emph{spectral templates} to estimate the GSO's eigenvalues such that the inferred graph exhibits desirable structural characteristics (e.g., sparsity or minimum-energy edge weights; see also Section \ref{Ss:Finding_the_eigenvalues}). The estimation of the diffusion filter in step i), which is not required when the signals are stationary~\cite{segarra2016topoidTSP16}, has merit on its own and is of interest beyond topology inference. Feasibility of this additional system identification task requires extra information on the excitation signal $\bbx$. Section \ref{S:NonStationary_InputSignals} addresses the (simpler) scenario where direct observations of the inputs are available so that the unknown filter matrix and the input-output signal pairs are linearly related. The focus in Section \ref{S:NonStationary_InputStatistics} shifts to scenarios where second-order statistical information is used, and the relationship between the input-output covariances and the filter is quadratic. Identifiability conditions for the noise-free case are discussed and particular cases for which the problem can be recast as a convex quadratic optimization are described. Section \ref{S:algorithms} develops projected gradient descent and semidefinite relaxation-based algorithms with complementary strengths, to deal with the (non-convex) fourth-order polynomial minimization associated with the recovery problem in Section \ref{S:NonStationary_InputStatistics}. Numerical tests with synthetic and real-world data corroborate the effectiveness of the novel approach in recovering the topology of social, brain and transportation networks (Section \ref{S:Simulations}). Concluding remarks are given in Section \ref{S:Conclusions}. \noindent \textbf{Notation.} The entries of a matrix $\mathbf{X}$ and a (column) vector $\mathbf{x}$ are denoted by $X_{ij}$ and $x_i$, respectively. Sets are represented by calligraphic capital letters. The notation $^T$ and $^\dag$ stands for transpose and pseudo-inverse, respectively; $\mathbf{0}$ and $\mathbf{1}$ refer to the all-zero and all-one vectors; while $\bbI_N$ denotes the $N\times N$ identity matrix. For a vector $\bbx$, ${\mathrm{diag}}(\mathbf{x})$ is a diagonal matrix whose $i$th diagonal entry is $x_i$. The operators $\otimes$, $\odot$, and $\text{vec}(\cdot)$ stand for Kronecker product, Khatri-Rao (columnwise Kronecker) product, and matrix vectorization, respectively. Lastly, $\| \bbX \|_p$ denotes the $\ell_p$ norm of $\text{vec}(\bbX)$ and $\mathrm{ker}(\bbX)$ refers to the null space of $\bbX$. The spectral radius of matrix $\bbX$ is denoted by $\lambda_{\max}(\bbX)$. \section{Problem Statement}\label{S:prelim_problem} Consider the generative model in \eqref{eqn_diffusion}, whereby the properties of the graph signal $\bby$ depend on those of the excitation input $\bbx$ and the underlying graph $\ccalG$ represented by the GSO $\bbS$. Given realizations of the output and prior information on the input, the goal is to infer a parsimonious graph representation that explains the structure of $\bby$. Alternatively, we can say that the goal is to recover the GSO which encodes direct relationships between the elements of $\bby$ from observable indirect relationships generated by a diffusion process. To formally state the problem, consider the symmetric GSO $\bbS$ associated with the undirected graph $\ccalG$. Define the eigenvector matrix $\bbV:=[\bbv_1,\ldots,\bbv_N]$ and the eigenvalue matrix $\bbLam:={\mathrm{diag}}(\lam_1,\ldots,\lam_N)$ to write $\bbS =\bbV\bbLam\bbV^T$. Now observe that while the diffusion expressions in \eqref{eqn_diffusion} are polynomials on the GSO of possibly infinite degree, the Cayley-Hamilton theorem asserts they are equivalent to polynomials of degree smaller than $N$. Upon defining the vector of coefficients $\bbh:=[h_0,\ldots,h_{L-1}]^T\in\reals^L$ and the symmetric graph filter $\bbH:=\sum_{l=0}^{L-1} h_l \bbS^l\in \reals^{N\times N}$~\cite{SandryMouraSPG_TSP13}, the generative model in \eqref{eqn_diffusion} can be rewritten as \begin{equation}\label{E:Filter_input_output_time} \bby = \textstyle \big(\sum_{l=0}^{L-1}h_l \bbS^l\big)\,\bbx = \bbH \bbx, \end{equation} for some particular $\bbh$ and $L\leq N$. Given a set $\ccalY\!:=\!\{\bby^{(p)}\}_{p=1}^P$ of $P$ independent samples of a non-stationary random signal $\bby$ adhering to the network diffusion model \eqref{E:Filter_input_output_time}, the problem is to identify the GSO $\bbS$ which is optimal in some sense as described in Section \ref{Ss:Finding_the_eigenvalues}. Fundamental to the topology inference approach developed here is to note that because $\bbH$ is a polynomial on $\bbS$, then: i) all such graph filters (spanned by the unknown coefficients $\bbh$) have the \textit{same eigenvectors}; and ii) such eigenvectors are the same as those of the shift, namely $\bbV$. In other words, while the diffusion implicit in $\bbH$ obscures the eigenvalues of the GSO, the eigenvectors $\bbV$ are preserved as \emph{spectral templates} of the underlying network topology. Next, Section \ref{ssec:stationarity} describes how to leverage \eqref{E:Filter_input_output_time} to obtain the GSO eigenbasis from a set of nodal observations $\ccalY$, by first estimating the unknown graph filter $\bbH$. We show that the information in $\ccalY$ is in general not enough to uniquely recover $\bbH$. Hence, we will resort to additional knowledge on the input signal $\bbx$ (either realizations, sparsity properties, or, second-order statistical information) and also possibly on the structure of the graph filter $\bbH$. Section \ref{Ss:Finding_the_eigenvalues} outlines how to use the spectral templates $\bbV$ to recover the desired GSO by estimating its eigenvalues $\bbLambda$ and, as byproduct, the graph shift $\bbS=\bbV\bbLambda\bbV^T$ itself. \subsection{Stationary versus non-stationary observations}\label{ssec:stationarity} Consider that the $P$ observations in $\ccalY$ correspond to independent realizations of a process $\bby$ adhering to the generative model in \eqref{E:Filter_input_output_time}. The goal is to use $\ccalY$ to estimate the spectral templates $\bbV$ of the filter $\bbH$ that governs the diffusion in \eqref{E:Filter_input_output_time}. To gain insights, suppose first that $\bbx$ is white so that $\bbC_\bbx = \bbI_N$~\cite{segarra2016topoidTSP16}. Then the covariance matrix of $\bby=\bbH\bbx$ is \begin{equation}\label{E:covariance_y} \bbC_\bby:={\mathbb E}[\bby\bby^T]={\mathbb E}[\bbH\bbx(\bbH\bbx)^T]= \bbH {\mathbb E}[\bbx\bbx^T]\bbH = \bbH^2. \end{equation} In obtaining the third equality with used that $\bbH$ is symmetric, because it is a polynomial in the symmetric GSO $\bbS$. Using the spectral decomposition of $\bbS =\bbV\bbLam\bbV^T$ to express the filter as $\bbH = \sum_{l=0}^{L-1} h_l (\bbV\bbLam\bbV^T)^l =\bbV(\sum_{l=0}^{L-1} h_l \bbLam^l)\bbV^T$, we can diagonalize the covariance matrix as \begin{equation}\label{eqn_diagonalize_covariance} \bbC_\bby=\textstyle \bbV\left(\sum_{l=0}^{L-1}h_l\bbLam^l\right)^2\bbV^T. \end{equation} Such a covariance expression is precisely the requirement for a graph signal to be stationary in $\bbS$~\cite[Def. 2.b]{marques2016stationaryTSP16}. Remarkably, if $\bby$ is graph stationary, or equivalently if $\bbx$ is white, \eqref{eqn_diagonalize_covariance} shows that the \textit{eigenvectors} of the shift $\bbS$, the filter $\bbH$, and the covariance $\bbC_\bby$ are \textit{all the same}. As a result, to estimate $\bbV$ from the observations $\{\bby^{(p)}\}_{p=1}^P$ it suffices to form the \textit{sample covariance} $\hbC_{\bby}=\frac{1}{P}\sum_{p=1}^{P}\bby^{(p)}(\bby^{(p)})^T$ and use its eigenvectors as spectral templates to recover $\bbS$~\cite{segarra2016topoidTSP16,pasdeloup2016inferenceTSIPN16}; see also Section \ref{Ss:Finding_the_eigenvalues}. In this context, the broader focus of the present paper is on identifying the GSO $\bbS$ that is considered to be the best possible description of the structure of a \emph{non-stationary} signal $\bby=\bbH\bbx$ [cf. \eqref{E:Filter_input_output_time}, where $\bbx$ is not white]. For generic (non-identity) input covariance matrix $\bbC_\bbx$, we face the challenge that the signal covariance [cf. \eqref{E:covariance_y}] \begin{equation}\label{E:covariance_y_ns} \bbC_\bby=\bbH\bbC_\bbx\bbH \end{equation} \emph{is no longer simultaneously diagonalizable with $\bbS$}. This rules out using the eigenvectors of the sample covariance $\hbC_\bby$ as spectral templates of $\bbS$. Still, as argued following \eqref{E:Filter_input_output_time} the eigenvectors of the GSO coincide with those of the graph filter $\bbH$ that governs the underlying diffusion dynamics. This motivates using realizations of observed signals together with additional information on the excitation inputs $\bbx$ (either realizations of the graph signals, sparsity assumptions, or the covariance matrix $\bbC_{\bbx}$ \cite{shen2017tensors}) to \textit{identify the filter} $\bbH$, with the ultimate goal of estimating its eigenvectors $\bbV$. This system identification task in the graph setting is the subject dealt with in Sections \ref{S:NonStationary_InputSignals} and \ref{S:NonStationary_InputStatistics}, but before we close the loop showing how to recover $\bbS$ given its estimated eigenbasis $\hbV$. \subsection{Using the spectral templates to recover the shift}\label{Ss:Finding_the_eigenvalues} Given estimates $\hbV$ of the filter eigenvectors, recovery of $\bbS$ amounts to selecting its eigenvalues $\bbLam$ and to that end we assume that the shift of interest is optimal in some sense. At the same time, we should account for the discrepancies between $\hbV$ and the actual eigenvectors of $\bbS$, due to finite sample size constraints and unavoidable errors in estimating the filter $\bbH$. Accordingly, we build on~\cite{segarra2016topoidTSP16} and seek for the shift operator $\bbS$ that: (a) is optimal with respect to (often convex) criteria $f ( \bbS)$; (b) belongs to a convex set $\ccalS$ that specifies the desired type of shift operator (e.g., the adjacency $\bbA$ or Laplacian $\bbL$); and (c) is close to $\hbV\bbLambda\hbV^T$ as measured by a convex matrix distance $d(\cdot,\cdot)$. Formally, one can solve \begin{equation}\label{E:general_problem} \bbS^* := \argmin_{\bbLambda, \bbS \in \ccalS} \ f ( \bbS) , \quad \text{s. to }\:d(\bbS,\hbV\bbLambda\hbV^T)\leq \epsilon \end{equation} which is a convex optimization problem provided $f ( \bbS)$ is convex, and $\epsilon$ is a tuning parameter chosen based on a priori information on the imperfections. Within the scope of the signal model \eqref{eqn_diffusion}, the formulation \eqref{E:general_problem} entails a general class of network topology inference problems parametrized by the choices in (a)-(c) above. The spectrum of alternatives is briefly outlined next, while concrete choices are made for the numerical tests in Section \ref{S:Simulations}. \noindent\textbf{Criteria.} The selection of $f(\bbS)$ allows to incorporate physical characteristics of the desired graph into the formulation, while being consistent with the spectral templates $\hbV$. For instance, the matrix (pseudo-)norm $f(\bbS)=\|\bbS\|_0$ which counts the number of nonzero entries in $\bbS$ can be used to minimize the number of edges towards identifying sparse graphs (e.g., of direct relations among signal elements); $f ( \bbS)=\|\bbS\|_1$ is a convex proxy for the aforementioned edge cardinality function. Alternatively, the Frobenius norm $ f ( \bbS)=\|\bbS\|_F$ can be adopted to minimize the energy of the edges in the graph, or $f ( \bbS)=\|\bbS\|_{\infty}$ can be chosen to obtain shifts $\bbS$ associated with graphs of uniformly low edge weights. This can be meaningful when identifying graphs subject to capacity constraints. \noindent\textbf{Constraints.} The constraint $\bbS \in \ccalS$ in \eqref{E:general_problem} incorporates a priori knowledge about $\bbS$. If we let $\bbS = \bbA$ represent the adjacency matrix of an undirected graph with non-negative weights and no self-loops, we can explicitly write $\ccalS$ as follows \begin{align} \label{E:SparseAdj_def_S} \ccalS_{\mathrm{A}} \!:= \! \{ \bbS \, | \, S_{ij} \geq 0, \;\, \bbS\!\in\!\ccalH_N\!,\;\, S_{ii} = 0, \;\, \textstyle\sum_j S_{j1} \! = \! 1 \}. \end{align} The first condition in $\ccalS_{\mathrm{A}}$ encodes the non-negativity of the weights whereas the second condition incorporates that $\ccalG$ is undirected, hence, $\bbS$ must belong to the set $\ccalH_N$ of real and symmetric $N \! \times \! N$ matrices. The third condition encodes the absence of self-loops, thus, each diagonal entry of $\bbS$ must be null. Finally, the last condition fixes the scale of the admissible graphs by setting the weighted degree of the first node to $1$, and rules out the trivial solution $\bbS\!=\!\bbzero$. Other GSOs (e.g., the Laplacian $\bbL$ and its normalized variants) can be accommodated in our framework via minor modifications to $\ccalS$; see~\cite{segarra2016topoidTSP16}. The form of the convex matrix distance $d(\cdot, \cdot)$ depends on the particular application. For instance, if $\|\bbS-\hbV\bbLambda\hbV^T\|_F$ is chosen the focus is more on the similarities across the entries of the shifts, while $\|\bbS-\hbV\bbLambda\hbV^T\|_2$ focuses on their spectrum. \section{(Bi)linear graph filter identification}\label{S:NonStationary_InputSignals} Consider $m=1,\ldots,M$ diffusion processes on $\ccalG$, and assume that the observed non-stationary signal $\bby_m$ corresponds to an input $\bbx_m$ diffused by an unknown graph filter $\bbH=\sum_{l=0}^{L-1} h_l\bbS^l$, which encodes the structure of the network via $\bbS$. In this section we show how additional knowledge about \emph{realizations} of the input signals $\bbx_m$ can be used to identify $\bbH$ and, as byproduct, its eigenvectors $\bbV$. We consider settings in which this extra information comes either from direct observation of $\{\bbx_m\}_{m=1}^M$, or through an assumption on input signal sparsity. \subsection{Input-output signal realization pairs}\label{Ss:linear_equations} Suppose first that realizations of $M$ output-input pairs $\{\bby_m,\bbx_m\}_{m=1}^M$ are available, which can be arranged in the data matrices $\bbY=[\bby_1,...,\bby_M]$ and $\bbX=[\bbx_1,...,\bbx_M]$. The goal is to identify a symmetric filter $\bbH\in\ccalH_N$ such that the observed signal $\bby_m$ and the predicted one $\bbH \bbx_m$ are close in some sense. In the absence of measurement noise this simply amounts to solving a system of $M$ linear matrix equations \begin{equation}\label{E:linear_system} \bby_m=\bbH\bbx_m, \quad m=1,\ldots,M. \end{equation} When noise is present, using the workhorse least-squares (LS) criterion the filter can be estimated as \begin{equation}\label{E:opt_filter_inputoutput_opt} \bbH^*\!\!=\!\mathop{\mathrm{argmin}}_{\bbH\in\ccalH_N }\sum_{m=1}^M\!\!\|\bby_m\!-\!\bbH\bbx_m\|_2^2. \end{equation} Because $\bbH$ is symmetric, the free optimization variables in \eqref{E:opt_filter_inputoutput_opt} correspond to, say, the lower triangular part of $\bbH$, meaning the entries on and below the main diagonal. These $N_{\bbH}:=N(N\!+\!1)/2$ non-redundant entries can be conveniently arranged in the so-termed half-vectorization of $\bbH$, i.e., a vector $\textrm{vech}(\bbH) \in \reals^{N_{\bbH}}$ from which one can recover $\textrm{vec}(\bbH)\in\reals^{N^2}$ via duplication. Indeed, there exists a unique duplication matrix $\bbD_N \in \{0,1\}^{N^2 \times {N_{\bbH}}}$ such that one can write $\bbD_N \text{vech}(\bbH) = \text{vec}({\bbH})$~\cite{duplication_matrices}. The Moore-–Penrose pseudoinverse of $\bbD_N$, denoted as $\bbD_N^\dagger$, possesses the property $\text{vech}(\bbH) =\bbD_N ^\dagger \text{vec}({\bbH})$. With this notation in place, several properties of the solution $\bbH^*$ of \eqref{E:opt_filter_inputoutput_opt} are stated next. \begin{myproposition}\label{P:Closedform_inputoutputpairs} Let $M_r$ denote the rank of matrix $\bbX\in\reals^{N\times M}$. Then, it holds that:\\ \noindent a) The entries of the symmetric filter $\bbH^*$ that solves \eqref{E:opt_filter_inputoutput_opt} are \begin{equation} \normalfont\text{vech}(\bbH^*) = \left[\big(\bbX^T\otimes\bbI_{N}\big)\bbD_N\right]^\dagger\text{vec}(\bbY).\label{E:opt_filter_inputoutput_closedform} \end{equation} \noindent b) ${\normalfont\text{rank}}\left(\big(\bbX^T\otimes\bbI_{N}\big)\bbD_N\right)\leq N_{\bbH}-(N-M_r+1)(N-M_r)/2$.\\ \noindent c) The minimizer of \eqref{E:opt_filter_inputoutput_opt} is unique if and only if $M_r\! =\! N$. \end{myproposition} \noindent\textbf{Proof:} See Appendix~\ref{ProofAppMinimizerInputOutput}. \hfill $\blacksquare$ \noindent Proposition \ref{P:Closedform_inputoutputpairs} asserts that if the excitation input set $\{\bbx_m\}_{m=1}^M$ is sufficiently rich -- i.e., if $M\geq N$ and the excitation signals are linearly independent --, the entries of the diffusion filter $\bbH$ can be found as the solution of an LS problem. Interestingly, that $\bbH$ has only $N(N+1)/2$ different entries cannot be exploited to reduce the number $M$ of input signals required to identify the filter. The reason is that the matrix $(\bbX^T \otimes \bbI_N)\bbD_N$ is rank deficient if $\bbX^T$ has a non-trivial null space. In other words, when using input-output pairs to estimate the filter $\bbH$ one needs the same number of pairs, regardless of whether the graph is symmetric or not. Symmetry, however, can be exploited to enhance performance in overdetermined scenarios with noisy observations; see also the tests in Section \ref{S:Simulations}. As explained in Section \ref{Ss:Finding_the_eigenvalues}, once $\bbH^*$ is estimated using \eqref{E:opt_filter_inputoutput_closedform}, the next step is to decompose the filter as $\bbH^*=\hbV\hbLambda\hbV^T$ and use $\hbV$ as input for the GSO identification problem \eqref{E:general_problem}. Note that obtaining such an eigendecomposition is always possible since filter estimates $\bbH^*\in\ccalH_N$ are constrained to be symmetric. \subsection{Sparse input signals}\label{Ss:input_sparsity} It is not uncommon to encounter application domains in which the diffused graph signals adhere to linear network dynamics $\bby=\bbH\bbx$ and the input $\bbx$ is sparse, having only a few nonzero entries. Sparsity in $\bbx$ is well-motivated due to its practical relevance and modeling value -- network processes such as $\bby$ are oftentimes the diffused version of few localized sources, hereby indexed by $\text{supp}(\bbx):=\{i:x_{i}\neq 0\}$~\cite{segarra2016blind,thanou17}. For instance, opinion formation processes in social networks have been modeled using graph filters (see e.g.,~\cite{segarra2015graphfilteringTSP15, DeGrootConsensus}), and sparse $\bbx$ could represent the initial opinion of those few influential actors that instilled the observed status-quo. Similar ideas are naturally relevant to linear network dynamics encountered with rumor spreading, adoption of new technologies, epidemic outbreaks~\cite{segarra2016blind}, as well as with identification of heat, pollutant, or seismic localized sources~\cite{thanou17}. Given realizations of $M$ diffusion processes $\{\bby_m\}_{m=1}^M$ arranged as columns of matrix $\bbY\in\reals^{N\times M}$, a possible formulation of the graph filter identification problem amounts to finding $\bbH\in\ccalH_N$ such that $\bbY$ is close to $\bbH\bbX$, where the unobserved matrix $\bbX=[\bbx_1,...,\bbx_M]$ is assumed to be sparse. Different from Section \ref{Ss:linear_equations}, input realizations are now unavailable and the resulting bilinear problem entails finding the decomposition factors up to unavoidable scaling and permutation ambiguities. In the absence of noise, recent fundamental results and accompanying algorithms developed in~\cite{pmlr-v23-spielman12} can be brought to bear here. Regarding identifiability, it is established therein that $M=\ccalO(N \log N)$ samples are sufficient to uniquely determine the decomposition with high probability, under the assumption that $\bbX$ is generated by a sparsity-inducing Bernoulli-Gaussian or Bernoulli-Rademacher process~\cite[Theorem 1]{pmlr-v23-spielman12}. From an algorithmic standpoint, an efficient dictionary learning procedure called Exact Recovery of Sparsely-Used Dictionaries (ER-SpUD) is proposed that solves a sequence of linear programs with varying constraints. Under the aforementioned assumptions, the algorithm exactly recovers $\bbH$ and $\bbX$ with high probability. This result holds when: (i) the sparsity level measured by the expected number of nonzero elements in each column of $\bbX$ is at most of order $\sqrt{N}$; and (ii) the number of samples $M$ is at least of order $N^2\log^2N$. Related blind identification problems on graphs were formulated in~\cite{segarra2016blind}, where $\bbH=\sum_{l=0}^{L-1} h_l \bbS$ is assumed to be a polynomial graph filter of unknown coefficients $\bbh$ but where the GSO $\bbS$ is known. Given the particular structure of $\bbH$, it should not be surprising that sparse inputs in $\bbX$ along with the filter coefficients $\bbh$ can be identified from few measurements of $\bbY=\bbH\bbX$. Instead, the remarkable results in~\cite{pmlr-v23-spielman12} are valid for arbitrary $\bbH\in\reals^{N\times N}$; hence, useful when the graph is unknown as in the topology inference setting dealt with here. \section{Quadratic graph filter identification}\label{S:NonStationary_InputStatistics} In a number of applications, realizations of the excitation input process $\bbx_m$ may be challenging to acquire, but information about the \textit{statistical} description of $\bbx_m$ could still be available. To be specific, assume that the excitation input processes are zero mean and their covariance $\bbC_{\bbx,m}={\mathbb E}[\bbx_m\bbx_m^T]$ is known. Further suppose that for each input $\bbx_m$, we have access to a set of output observations $\{\bby_m^{(p)}\}_{p=1}^{P_m}$, which are then used to estimate the output covariance as $\hbC_{\bby,m}=\frac{1}{P_m}\sum_{p=1}^{P_m}\bby_m^{(p)}(\bby_m^{(p)})^T$. Since under \eqref{E:Filter_input_output_time} the \textit{ensemble covariance} is $\bbC_{\bby,m} = {\mathbb E} [\bby_m\bby_m^T] = \bbH \bbC_{\bbx,m}\bbH$ [cf. \eqref{E:covariance_y_ns}], the aim is to identify a filter $\bbH$ such that matrices $\hbC_{\bby,m}$ and $\bbH \bbC_{\bbx,m} \bbH$ are close. Assuming for now perfect knowledge of the signal covariances, the above rationale suggests studying the solutions of the system of matrix \emph{quadratic} equations \begin{equation}\label{E:quadratic_system} \bbC_{\bby,m}=\bbH \bbC_{\bbx,m} \bbH, \quad m=1,\ldots,M. \end{equation} To gain some initial insights, consider first the case where $M=1$ and henceforth drop the subindex $m$ so that we can write \eqref{E:quadratic_system} as \eqref{E:covariance_y_ns}. Given the eigendecomposition of the symmetric and positive semidefinite (PSD) covariance matrix $\bbC_{\bby}=\bbV_{\bby}\bbLambda_{\bby}\bbV_{\bby}^T$, the \emph{principal square root} of $\bbC_{\bby}$ is the unique symmetric and PSD matrix $\bbC_{\bby}^{1/2}$ which satisfies $\bbC_{\bby}=\bbC_{\bby}^{1/2}\bbC_{\bby}^{1/2}$. It is given by $\bbC_{\bby}^{1/2}=\bbV_{\bby}\bbLambda_{\bby}^{1/2}\bbV_{\bby}^T$, where $\bbLambda_{\bby}^{1/2}$ stands for a diagonal matrix with the nonnegative square roots of the eigenvalues of $\bbC_{\bby}$. With this notation in place, introduce the matrices $\bbC_{\bbx\bby\bbx}:=\bbC_{\bbx}^{1/2} \bbC_{\bby} \bbC_{\bbx}^{1/2}$ and $\bbH_{\bbx\bbx}:=\bbC_{\bbx}^{1/2}\bbH \bbC_{\bbx}^{1/2}$. Clearly, $\bbC_{\bbx\bby\bbx}$ is both symmetric and PSD. Regarding the transformed filter $\bbH_{\bbx\bbx}$, note that by construction we have that $\bbH_{\bbx\bbx}$ is symmetric. Moreover, if $\bbH$ is assumed to be PSD, then so will be $\bbH_{\bbx\bbx}$. These properties will be instrumental towards characterizing the solutions of the matrix quadratic equation $\bbC_\bby=\bbH\bbC_\bbx\bbH$ in \eqref{E:covariance_y_ns}, which can be equivalently recovered from the solutions $\bbH_{\bbx\bbx}$ of \begin{equation}\label{E:square_root_NS_one_sym} \bbC_{\bbx\bby\bbx}\!=\!\bbC_{\bbx}^{1/2} \bbC_{\bby} \bbC_{\bbx}^{1/2}\!=\!\bbC_{\bbx}^{1/2}\bbH \bbC_{\bbx} \bbH \bbC_{\bbx}^{1/2}\!=\!\bbH_{\bbx\bbx}\bbH_{\bbx\bbx}. \end{equation} \subsection{Positive semidefinite graph filters}\label{Ss:PSD_filter} Let us suppose first that $\bbH$ is PSD (henceforth denoted $\bbH\in\ccalH_N^{++}$), so that $\bbH_{\bbx\bbx}$ in \eqref{E:square_root_NS_one_sym} is PSD as well. Such filters arise, for example, with heat diffusion processes of the form $\bby=(\sum_{l=0}^\infty \beta^l \bbL^l)\bbx$ with $\beta>0$, where the Laplacian shift $\bbL$ is PSD and the filter coefficients $h_l=\beta^l$ are all positive. In this setting, the solution of \eqref{E:square_root_NS_one_sym} is unique and given by the principal square root \begin{equation} \bbH_{\bbx\bbx}=\bbC_{\bbx\bby\bbx}^{1/2}. \end{equation} Consequently, if $\bbC_{\bbx}$ is nonsingular (so that the excitation inputs are not degenerate), the definition of $\bbH_{\bbx\bbx}$ can be used to recover $\bbH$ via \begin{equation}\label{E:filt_estimate_psd} \bbH = \bbC_{\bbx}^{-1/2} \bbC_{\bbx\bby\bbx}^{1/2} \bbC_{\bbx}^{-1/2}. \end{equation} The previous arguments demonstrate that the assumption $\bbH\in\ccalH_N^{++}$ gives rise to a strong identifiability result. Indeed, if $\{\bbC_{\bby,m}\}_{m=1}^M$ are known perfectly, a PSD graph filter is identifiable even for $M=1$. However, in pragmatic settings where only empirical covariances are available, then observation of multiple ($M>1$) diffusion processes can improve the performance of the system identification task. Given empirical covariances $\{\hbC_{\bby,m}\}_{m=1}^M$ respectively estimated with enough samples $P_m$ to ensure they are of full rank, for each $m$ define $\hbC_{\bbx\bby\bbx,m}:=\bbC_{\bbx,m}^{1/2} \hbC_{\bby,m} \bbC_{\bbx,m}^{1/2}$. The quadratic equation \eqref{E:square_root_NS_one_sym} motivates solving the LS problem \begin{equation}\label{E:opt_filter_PSD_opt} \bbH^*=\mathop{\mathrm{argmin}}_{\bbH\in\ccalH_N^{++}}\sum_{m=1}^M\|\hbC_{\bbx\bby\bbx,m}^{1/2}-\bbC_{\bbx,m}^{1/2}\bbH\bbC_{\bbx,m}^{1/2}\|_F^2. \end{equation} Whenever the number of samples $P_m$ -- and accordingly the accuracy of the empirical covariances $\hbC_{\bby,m}$ -- differs significantly across diffusion processes $m=1,\ldots, M$, it may be prudent to introduce non-uniform coefficients to downweigh those residuals in \eqref{E:opt_filter_PSD_opt} with inaccurate covariance estimates. The following proposition offers insights on the solution to \eqref{E:opt_filter_PSD_opt}, and extensions to weighted LS criteria are straightforward. \begin{myproposition}\label{P:PSD_filter_opt} Define the matrices $\barbX=[\bbC_{\bbx,1}^{1/2}\otimes\bbC_{\bbx,1}^{1/2},...,\bbC_{\bbx,M}^{1/2}\otimes\bbC_{\bbx,M}^{1/2}]^T$ and $\barbY=[\hbC_{\bbx\bby\bbx,1}^{1/2},...,\hbC_{\bbx\bby\bbx,M}^{1/2}]^T$. Then, the filter $\bbH^*$ that solves \eqref{E:opt_filter_PSD_opt} can be found as \begin{equation} \normalfont\text{vec}(\bbH^*)=\barbX^{\dagger}\text{vec}(\barbY^T).\label{E:minimizer_PSD_closedform} \end{equation} Moreover, if $M=1$ and matrix $\bbC_{\bbx,1}$ is nonsingular, the minimizer $\bbH^*$ is unique and given by \begin{equation} \bbH^*=\bbC_{\bbx,1}^{-1/2}\hbC_{\bbx\bby\bbx,1}^{1/2}\bbC_{\bbx,1}^{-1/2}.\label{E:minimizer_PSD_filter_2} \end{equation} \end{myproposition} \noindent\textbf{Proof:} To show \eqref{E:minimizer_PSD_closedform} one can follow steps similar to those for \eqref{E:opt_filter_inputoutput_closedform} in Proposition \ref{P:Closedform_inputoutputpairs}. The identifiability result for $M=1$ follows from the arguments leading to \eqref{E:filt_estimate_psd}, noting that the cost in \eqref{P:PSD_filter_opt} vanishes if $\bbH^*$ is selected to satisfy $\hbC_{\bbx\bby\bbx,1}^{1/2}=\bbC_{\bbx,1}^{1/2}\bbH^* \bbC_{\bbx,1}^{1/2}$. Left and right multiplying both sides of the equality by $\bbC_{\bbx,1}^{-1/2}$, \eqref{E:minimizer_PSD_filter_2} follows. \hfill $\blacksquare$ \subsection{Symmetric graph filters}\label{Ss:symmetric_filter} Consider now a more general setting whereby $\bbH$ is only assumed to be symmetric, and once more let $M=1$ first to simplify notation. With the unitary matrix $\bbV_{\mathbf{xyx}}$ denoting the eigenvectors of $\bbC_{\mathbf{xyx}}$ and with $\bbb\in\{-1,1\}^N$ being a binary (signed) vector, one can conclude that solutions to \eqref{E:square_root_NS_one_sym} have the general form \begin{equation} \bbH_{\mathbf{xx}}= \bbC_{\mathbf{xyx}}^{1/2}\bbV_{\mathbf{xyx}}{\mathrm{diag}}(\bbb)\bbV_{\mathbf{xyx}}^T. \end{equation} If the input covariance matrix $\bbC_{\bbx}$ is nonsingular, all symmetric solutions $\bbH\in\ccalH_{N}$ of \eqref{E:square_root_NS_one_sym} [and hence of \eqref{E:covariance_y_ns}] are given by \begin{equation}\label{E:filter_solutions_symmetric} \bbH= \bbC_{\bbx}^{-1/2}\bbC_{\mathbf{xyx}}^{1/2}\bbV_{\mathbf{xyx}}{\mathrm{diag}}(\bbb)\bbV_{\mathbf{xyx}}^T\bbC_{\bbx}^{-1/2}. \end{equation} In the absence of the PSD assumption, the problem for $M=1$ is non-identifiable. Inspection of \eqref{E:filter_solutions_symmetric} shows there are $2^N$ possible solutions to the quadratic equation \eqref{E:covariance_y_ns}, which are parametrized by the binary vector $\bbb$. For the PSD setting in Section \ref{Ss:PSD_filter} the solution is unique and corresponds to $\bbb=\mathbf{1}$. For $M>1$, the set of feasible solutions to the system of equations \eqref{E:quadratic_system} is naturally given by \begin{align}\label{E:solution_set} \ccalH_{M}^{\text{sym}}\!\!=&\bigcap_{m=1}^M\left\{\bbH\in\ccalH_{N} \:| \:\bbb_m\!\in\!\{-1,1\}^N\;\;\text{and}\;\;\right.\\ &\left.\bbH\!=\!\bbC_{\bbx,m}^{-1/2}\bbC_{\mathbf{xyx},m}^{1/2}\bbV_{\mathbf{xyx},m}{\mathrm{diag}}(\bbb_m)\bbV_{\mathbf{xyx},m}^T\bbC_{\bbx,m}^{-1/2}\right\}.\nonumber \end{align} It is thus conceivable that as $M$ grows and, therefore, the number of equations increases, the cardinality of $\ccalH_{M}^{\text{sym}}$ shrinks and the problem is rendered identifiable (up to an unavoidable sign ambiguity because if $\bbH\in\ccalH_{N}$ is a solution of \eqref{E:quadratic_system}, so is $-\bbH$). Next, we show that even with two excitation inputs having covariances $\bbC_{\bbx,1}$ and $\bbC_{\bbx,2}$ with \textit{identical} eigenvectors, uniqueness can be established as long as their eigenvalues are sufficiently different. \begin{myproposition}\label{P:identifiability} Consider the system of quadratic equations \eqref{E:quadratic_system} for $M=2$ and suppose $\bbC_{\bbx,1}= \bbU{\normalfont\text{diag}}(\bblambda_1)\bbU^T$ and $\bbC_{\bbx,2}=\bbU{\normalfont\text{diag}}(\bblambda_2)\bbU^T$. Then \eqref{E:quadratic_system} has a unique symmetric solution, i.e., $\bbH=\bbV\bbLambda\bbV^T$ is identifiable up to a sign ambiguity if the following conditions hold: \\ A-1) All eigenvalues in $\bblambda_1$ are distinct; \\ A-2) $\lambda_{1,i} \, \lambda_{2,j} \neq \lambda_{1,j} \, \lambda_{2,i}$ for all $i,j$;\\ A-3) $\bbV$ and $\bbU$ do not share any eigenvector; and\\ A-4) ${\normalfont\text{rank}}(\bbH)=N$. \end{myproposition} \noindent\textbf{Proof:} See Appendix~\ref{ProofAppIdentifiabilityConvariances}. \hfill $\blacksquare$ \noindent Conditions A-1) and A-2) encode a notion of richness on the excitation signals. In fact, condition A-2) is the specification for $M=2$ of a generalizable requirement based on the Kruskal rank of a matrix related to the eigenvalues of the excitation processes (see Appendix~\ref{ProofAppIdentifiabilityConvariances}). Under this perspective, it becomes immediate that larger $M$ facilitate the fulfillment of this more general requirement, leading to the expected conclusion that the more input processes we consider, the easier it becomes to identify $\bbH$. Moreover, from the proof arguments it follows that symmetry of $\bbH$ is essential (see Lemma \ref{L:appendix} in Appendix~\ref{ProofAppIdentifiabilityConvariances}). Actually, if one lifts the symmetry assumption and all input covariances have the same eigenvectors, the problem remains non-identifiable even for high values of $M$ (regardless of the input covariance eigenvalues). \section{Algorithms}\label{S:algorithms} Building on the findings in Section \ref{Ss:symmetric_filter}, here we propose two algorithms with complementary strengths to tackle the quadratic filter identification problem when the only assumption is for $\bbH$ to be symmetric (undirected graph), but not (necessarily) PSD. \subsection{Projected gradient descent}\label{Ss:PGD} Going back to the beginning of Section \ref{S:NonStationary_InputStatistics}, given realizations $\{\bby_m^{(p)}\}_{p=1}^{P_m}$ of the diffusion processes the goal is to identify a symmetric filter $\bbH\in\ccalH_N$ that drives $\{\bbH\bbC_{\bbx,m}\bbH\}_{m=1}^M$ close to the empirical covariances $\{\hbC_{\bby,m}\}_{m=1}^M$. Such quadratic functions of $\bbH$ can be formed under perfect knowledge on the input covariances $\{\bbC_{\bbx,m}\}_{m=1}^M$. Accordingly, adopting a constrained LS criterion yields a graph filter estimate \begin{equation}\label{E:opt_filter_genericfilter_opt} \bbH^*=\mathop{\mathrm{argmin}}_{\bbH\in\ccalH_N }\! \sum_{m=1}^{M} \|\hbC_{\bby,m}-\bbH\bbC_{\bbx,m}\bbH^T\|_F^2, \end{equation} where the transpose of the symmetric $\bbH$ is written explicitly to simplify subsequent mathematical derivations. Weighted variants of the criterion could also be pertinent here, as discussed following \eqref{E:opt_filter_PSD_opt}. Problem \eqref{E:opt_filter_genericfilter_opt} is a non-convex fourth-order polynomial optimization, which can potentially have multiple solutions. Since finding $\bbH^*$ is challenging, we seek computationally efficient algorithms capable of finding stationary solutions. A viable approach is to rely on projected gradient descent (PGD)~\cite{bertsekas_nonlinear}, which embedded as part of a feasible direction method boils down to the following update rule ($k=1,2,\ldots$ denotes iterations) \begin{align} \label{E:PGD_update_rule} \bar{\bbH}_{k} &= {} \ccalP_{\ccalH_{N}}(\bbH_{k} - \eta \nabla \varepsilon(\bbH_{k})),\nonumber \\ \bbH_{k+1} &={} \bbH_{k}+\alpha_k(\bar{\bbH}_{k}-\bbH_{k}). \end{align} Here $\alpha_k$ and $\eta$ are step size parameters and $\varepsilon(\bbH) := \sum_{m=1}^{M} \|\hbC_{\bby,m}-\bbH\bbC_{\bbx,m}\bbH^{T}\|_F^2$ is the objective function in \eqref{E:opt_filter_genericfilter_opt}, whose gradient is given by $\nabla \varepsilon(\bbH) = 4\sum_{m=1}^{M} (\bbH \bbC_{\bbx,m} \bbH^T\bbH \bbC_{\bbx,m}-\hbC_{\bby,m} \bbH \bbC_{\bbx,m} )$. In addition, the operator $\ccalP_{\ccalH_{N}}(\cdot)$ denotes the Euclidean projection onto the set $\ccalH_N$ of symmetric matrices defined as \begin{align} \ccalP_{\ccalH_{N}}(\bbH):=\mathop{\mathrm{argmin}}_{\bbX\in\ccalH_N }\: \|\bbX - \bbH\|_F^2\:=(\bbH + \bbH^{T})/2.\nonumber \end{align} Thus, to obtain matrix $\bar{\bbH}_{k}$ we take a gradient descent step and project the result onto $\ccalH_N$. Finally, we take a step along the feasible direction $\bar{\bbH}_{k}-\bbH_{k}$ with step size $\alpha_k$ to yield $\bbH_{k+1}$. One possible choice of the step size $\alpha_k$ is via the Armijo rule over the interval $[0,1]$. For scalars $\mu,\beta\in(0,1)$, one sets $\alpha_k=\beta^{m_k}$, where $m_k$ is the first integer $m\geq 0$ for which \begin{equation}\label{E:Armijo} \varepsilon(\bbH_k)-\varepsilon(\bbH_k+\beta^m(\bar{\bbH}_{k}-\bbH_{k}))\geq -\mu\beta^m\nabla\varepsilon(\bbH_k)^T(\bar{\bbH}_{k}-\bbH_{k}). \end{equation} \begin{algorithm}[t] \caption{Graph filter identification using PGD} \label{A:PGD} \begin{algorithmic}[1] \STATE \textbf{Input:} $ \{ \bbC_{\bbx,m} , \hbC_{\bby,m} \}_{m=1}^{M}$, step size $\eta > 0$, parameters $\mu,\beta\in(0,1)$, and tolerance $\delta > 0$. \STATE \textbf{Initialize} $k=0$ and $\bbH_0 \in \ccalH_{N}$ at random. \REPEAT \STATE $\nabla \varepsilon(\bbH_k) \!=\! 4 \!\!\sum\limits_{m=1}^{M} \! \bbH_{k} \bbC_{\bbx,m} \bbH_{k}^T\bbH_{k} \bbC_{\bbx,m} - \hbC_{\bby,m} \bbH_{k} \bbC_{\bbx,m}$. \STATE $\bar{\bbH}_{k}= \left((\bbH_{k} - \eta \nabla\varepsilon(\bbH_k))+(\bbH_{k} - \eta \nabla\varepsilon(\bbH_k))^{T}\right)/2$. \STATE Set $\alpha_k=\beta^{m_k}$, for $m_k$ chosen via the Armijo rule \eqref{E:Armijo}. \STATE $\bbH_{k+1} = \bbH_{k}+\alpha_k(\bar{\bbH}_{k}-\bbH_{k})$. \STATE $k \gets k+1$. \UNTIL{$\lVert \bbH_{k}- \bbH_{k-1} \rVert_{F} \leq \delta$} \STATE \textbf{Return} $\hbH=\bbH_k$ \end{algorithmic} \end{algorithm} Putting all the pieces together, the PGD update rule in \eqref{E:PGD_update_rule} results in the iterations tabulated under Algorithm \ref{A:PGD}. The updates entail multiplications and additions of $N\times N$ matrices, and accordingly the computational complexity per iteration is $\ccalO(MN^3)$. For the adopted step size selection rule, convergence to a stationary point can be guaranteed~\cite[Prop. 2.3.1]{bertsekas_nonlinear}. Since multiple stationary points exist, we typically run Algorithm \ref{A:PGD} for $I$ random initializations. Among the $I$ estimated filters we select the one whose eigenvectors lead to e.g., the sparsest graph shift $\bbS$ when solving \eqref{E:general_problem} with $f(\bbS)=\|\bbS\|_1$; see also the numerical tests in Section \ref{S:Simulations}. Before moving on to algorithms based on semidefinite relaxations, a remark is in order. \begin{remark}[Combining multiple sources of information] \normalfont The formulations in \eqref{E:linear_system} and \eqref{E:opt_filter_genericfilter_opt} can be combined if e.g., both input covariances and pairs of input-output realizations are available. It is also relevant in scenarios where the inputs are not zero mean but their first and second moments are known. Defining $\hbmu_{\bby,m}:=\frac{1}{P_m}\sum_{p=1}^{P_m} \bby_m^{(p)}$ and $\bbmu_{\bbx,m}:={\mathbb E}[\bbx_m]$, a natural cost would be $\tilde{\varepsilon}(\bbH)=\nu\sum_{m=1}^M \|\hbmu_{\bby,m}-\bbH\bbmu_{\bbx,m}\|^2 + \varepsilon(\bbH)$, where $\nu$ is a tuning parameter and $\varepsilon(\bbH)$ is the cost function of \eqref{E:opt_filter_genericfilter_opt}. PGD iterations silmilar to those in Algorithm \ref{A:PGD} can be derived to minimize the cost $\tilde{\varepsilon}(\bbH)$. \end{remark} \subsection{Semidefinite relaxation}\label{Ss:SDR} Here we show that the graph filter identification task can also be tackled using semidefinite relaxation (SDR)~\cite{luo2010semidefinite}, a convexification technique which has been successfully applied to a wide variety of non-convex quadratically-constrained quadratic programs (QCQP) in applications such as MIMO detection \cite{tan2001application} and transmit beamforming \cite{gershman2010convex}. To that end, we first cast the filter identification problem as a Boolean quadratic program (BQP). \begin{myproposition}\label{P:BQPt} For $m=1,\ldots,M$ consider matrices $\bbA_{m} := (\bbC_{\bbx,m}^{-1/2}\bbV_{\mathbf{xyx},m}) \odot ( \bbC_{\bbx,m}^{-1/2}\bbC_{\mathbf{xyx},m}^{1/2}\bbV_{\mathbf{xyx},m}) \in \reals^{N^{2} \times N}$ and unknown binary vectors $\bbb_m\in\{-1,1\}^N$. Define $\bbPsi\in \reals^{N^{2}(M-1) \times NM}$ as \begin{equation} \label{e:matrix_A} \bbPsi := \left[\begin{array}{cccccc} \bbA_{1}&-\bbA_{2}&\mathbf{0}&\cdots &\mathbf{0}&\mathbf{0}\\ \mathbf{0}&\bbA_{2}&-\bbA_{3}&\cdots &\mathbf{0}&\mathbf{0}\\ \vdots&\vdots&\vdots&\ddots &\vdots&\vdots\\ \mathbf{0}&\mathbf{0}&\mathbf{0}&\cdots &\bbA_{M-1}&-\bbA_{M}\\ \end{array}\right] \end{equation} and $\bbb:=[\bbb_1^T,\ldots,\bbb_{M}^T]^T\in \{-1,1\}^{NM}$. If ${\normalfont{\text{rank}}}(\bbPsi )=NM-1$, then the filter can be exactly recovered (up to a sign) as ${\normalfont\textrm{vec}(\bbH^*)}= \bbA_1\bbb^{*}_{1}$, where $\bbb^{*}_{1}$ is the first $N\times 1$ sub-vector of the solution to the following BQP problem \begin{equation} \bbb^* = \argmin_{\bbb \in \{-1,1\}^{NM}} \bbb^T\bbPsi^T\bbPsi \bbb. \label{e:BQP} \end{equation} \end{myproposition} \noindent\textbf{Proof:} Using properties of the Khatri-Rao product, feasible graph filters $\bbH\in\ccalH_{M}^{\text{sym}}$ satisfy the system of equations [cf.~\eqref{E:solution_set}] \begin{equation} \label{E:A_m_b_m_H_hat} \bbA_m \bbb_m = \text{vec}(\bbH), \quad m=1,\ldots,M, \end{equation} with matrices $\bbA_{m}$ defined in the statement of the proposition and for some binary vectors $\bbb_m \in \{-1,1\}^N$. Based on \eqref{e:matrix_A}, the equations in \eqref{E:A_m_b_m_H_hat} can be compactly and equivalently rewritten as \begin{equation} \label{E:A_b_0} \bbPsi \bbb= \bb0, \quad \bbA_1 \bbb_1=\text{vec}(\bbH). \end{equation} Under the assumption that the covariances $\{\bbC_{\bby, m}\}_{m=1}^N$ are perfectly known, then the filter $\bbH$ can be uniquely identified (up to a sign ambiguity) provided $\text{rank}(\bbPsi)=NM-1$. This way, $\mathrm{ker}(\bbPsi)$ has dimensionality one and the basis vector $\bbb^*=[(\bbb_1^*)^T,\ldots,(\bbb_{M}^*)^T]^T\in\{-1,1\}^{NM}$ of the aforementioned null space can be used to recover the filter via $\bbA_1 \bbb_1^*=\text{vec}(\bbH)$. Moreover, the desired solution of \eqref{E:A_b_0} can be equivalently obtained from the BQP \begin{equation*} \bbb^* = \argmin_{\bbb \in \{-1,1\}^{NM}} \|\bbPsi \bbb\|^2, \end{equation*} which is identical to \eqref{e:BQP}. \hfill $\blacksquare$ Problem \eqref{e:BQP} offers a natural formulation for the pragmatic setting whereby $\{\bbC_{\bby, m}\}_{m=1}^M$ are replaced by sample estimates, and one would aim at minimizing the residuals $\sum_{m=1}^{M-1} \| \hbA_m \bbb_m - \hbA_{m+1} \bbb_{m+1} \|^2=\|\hbPsi \bbb\|^2$ in the LS sense. Given a solution of \eqref{e:BQP} with $\hbPsi$ replacing $\bbPsi$, $\bbH\in\ccalH_{N}$ can be estimated as [cf.~\eqref{E:filter_solutions_symmetric}] \begin{equation} \label{e:estimate_filter_SDR} \hbH= \frac{1}{M} \sum_{m=1}^{M} \bbC_{\bbx,m}^{-1/2}\hbC_{\mathbf{xyx},m}^{1/2}\hbV_{\mathbf{xyx},m}{\mathrm{diag}}(\bbb^{*}_{m})\hbV_{\mathbf{xyx},m}^T\bbC_{\bbx,m}^{-1/2}. \end{equation} Even though the BQP is a classical NP-hard combinatorial optimization problem~\cite{luo2010semidefinite}, via SDR one can obtain near-optimal solutions with provable approximation guarantees. To derive the SDR of \eqref{e:BQP}, first introduce the $NM\times NM$ symmetric PSD matrices $\bbW:=\bbPsi^T\bbPsi$ and $\bbB := \bbb \bbb^{T}$. By construction, the binary matrix $\bbB$ has rank one and its diagonal entries are $B_{ii} = b_{i}^{2} = 1$. Conversely, any matrix $\bbB\in\reals^{NM\times NM}$ that satisfies $\bbB \succeq 0$, $B_{ii} = 1$, and $\text{rank}(\bbB) = 1$ necessarily has the form $\bbB = \bbb \bbb^{T}$, for some $\bbb \in \{-1,1\}^{NM}$. Using these definitions, one can write $\bbb^{T} \bbW \bbb = \text{trace}(\bbb^{T} \bbW \bbb) = \text{trace}(\bbW \bbb \bbb^{T}) = \text{trace}(\bbW \bbB)$ and accordingly \eqref{e:BQP} is equivalent to \begin{align} \label{e:opt_prob_QP_equi} \min_{\bbB}{} &{} \text{trace}(\bbW \bbB)\\ \text{s. to } &{} \bbB \succeq \bb0,\nonumber\\ & \text{rank}(\bbB) = 1,\nonumber\\ & B_{ii}=1, \quad i=1,\ldots,NM. \nonumber \end{align} The only source of non-convexity in \eqref{e:opt_prob_QP_equi} is the rank constraint, and dropping it yields the convex SDR \begin{align}\label{e:opt_prob_QP_SDR} \bbB^*= \argmin_{\bbB }{} &{} \text{trace}(\bbW \bbB)\\ \text{s. to } &{} \bbB \succeq \bb0,\nonumber\\ & B_{ii}=1, \quad i=1,\ldots,NM. \nonumber \end{align} which coincides with the bidual (dual of the dual) problem of \eqref{e:BQP}. Problem \eqref{e:opt_prob_QP_SDR} is a semidefinite program (SDP) and can be solved using an off-the-shelf interior-point method~\cite{ye1998interior}. \begin{algorithm}[t] \caption{Graph filter identification using SDR} \label{A:SDR} \begin{algorithmic}[1] \STATE \textbf{Input:} $ \bbW=\bbPsi^T\bbPsi \in \ccalH_{NM}$ and $L \in \naturals$. \STATE Solve the SDP in \eqref{e:opt_prob_QP_SDR} to obtain $\bbB^*$. \FOR{$l=1,\ldots,L$} \STATE Draw $\bbz_{l} \sim \ccalN(\bb0,\bbB^*)$. \STATE Round $\hbb_{l} = \text{sgn}(\bbz_{l})$. \ENDFOR \STATE Determine $l^*$ by solving \eqref{e:best_sample}. \STATE \textbf{Return} $\hbb_{l^*}$ \end{algorithmic} \end{algorithm} It is immediate that a rank-one optimal solution $\bbB^*=\bbb^*(\bbb^*)^T$ of \eqref{e:opt_prob_QP_SDR} solves the original BQP as well; however, in general $\text{rank}(\bbB^*)\neq 1$. To generate a feasible solution of \eqref{e:BQP} from $\bbB^*$, we adopt the so-termed Gaussian randomization procedure~\cite{nesterov1998semidefinite,luo2010semidefinite}. Specifically, interpreting $\bbB^*$ as a covariance matrix we draw $L$ i.i.d. samples $\bbz_l \sim \ccalN(\bb0,\bbB^*)$ and form $\hbb_{l} := \text{sgn}(\bbz_{l})$, where sgn(.) is the element-wise sign function. The retained feasible solution corresponds to the best one among those $L$ generated, namely $\hbb_{l^*}$ where \begin{equation}\label{e:best_sample} l^*= \argmin_{l=1,\ldots,L} \hbb_{l}^{T} \bbW \hbb_{l}. \end{equation} The overall procedure is tabulated under Algorithm \ref{A:SDR} and the quality of the rounded solutions is evaluated via computer simulations in Section \ref{S:Simulations}. The computational complexity is discussed under Remark \ref{R:SDR_vs_PGD}. Interestingly, it is also possible to obtain theoretical approximation guarantees for the feasible solutions generated via the SDR scheme in Algorithm \ref{A:SDR}. We will leverage a result in~\cite{nesterov1998semidefinite} stated as Theorem \ref{theorem:approximation} below, which offers guarantees for an extension to the maximum cut problem~\cite{goemans1995improved} \begin{equation} \max_{\bbb \in \{-1,1\}^{NM}} \bbb^{T} \bbW' \bbb \label{e:partitioning_BQP}, \end{equation} where the weight matrix $\bbW'\succeq \bb0$ may have negative entries. As we show next, \eqref{e:partitioning_BQP} can be rendered equivalent to the BQP \eqref{e:BQP}. Define $\bbW' := \lambda_{\max}\bbI_{NM} - \bbW \succeq \bb0 $, where $\lambda_{\max}$ is the largest eigenvalue of $\bbW$. For $\bbb \in \{-1,1\}^{NM}$, we have $\bbb^{T} \bbW' \bbb = \lambda_{\max} \sum_{i=1}^{NM} b_{i}^{2} - \bbb^{T} \bbW \bbb = NM\lambda_{\max} - \bbb^{T} \bbW \bbb$ and the problems are equivalent. \begin{mytheorem}[\!\!\cite{nesterov1998semidefinite}]\label{theorem:approximation} Let $\bbb^*$ be the solution of problem \eqref{e:BQP} or equivalently \eqref{e:partitioning_BQP} for $\bbW' := \lambda_{\max}\bbI_N - \bbW \succeq \bb0 $. Let $\hbb_{l^*}$ be the output of Algorithm \ref{A:SDR}. Then, \begin{equation*} \frac{2}{\pi}(\bbb^{*})^{T} \bbW' \bbb^* \leq \E{(\hbb_{l^*})^T \bbW'\hbb_{l^*}} \leq (\bbb^{*})^{T} \bbW' \bbb^*, \end{equation*} where $\frac{2}{\pi} \approx 0.636$. \end{mytheorem} \noindent A guarantee for the BQP \eqref{e:BQP} thus follows immediately. \begin{mycorollary} \label{C:approximation} Let $\bbb^*$ be the solution of problem \eqref{e:BQP} and $\hbb_{l^*}$ be the output of Algorithm \ref{A:SDR}. For $\gamma=\left(1-\frac{2}{\pi}\right)\lambda_{\max}NM>0$, then % \begin{equation} \label{e:Nesterov} \gamma+\frac{2}{\pi}(\bbb^{*})^{T} \bbW \bbb^* \geq \E{(\hbb_{l^*})^T \bbW\hbb_{l^*}} \geq (\bbb^{*})^{T} \bbW \bbb^*. \end{equation} % \end{mycorollary} \noindent Notice that although the bounds in \eqref{e:Nesterov} offer guarantees in terms of the expected objective value, particular realizations $\hbb_{l^*}$ tend to fall within those bounds with high probability if $L$ is chosen sufficiently large. All in all, the recipe to estimate the graph filter via the SDR approach entails the following steps. First we calculate $\{\hbA_m\}_{m=1}^{M}$ from $\{\hbC_{\bby,m}, \bbC_{\bbx , m}\}_{m=1}^{M}$ using the expression in the statement of Proposition \ref{P:BQPt}, and form $\hbPsi$ as in \eqref{e:matrix_A} to finally obtain $\hbW = \hbPsi^{T} \hbPsi$. Next, a feasible solution $\hbb_{l^*}$ to the BQP is obtained after running Algorithm \ref{A:SDR} with $\hbW$ and an appropriate choice of $L$ as inputs. Finally, $\hbH$ is estimated using \eqref{e:estimate_filter_SDR}. \begin{remark}[SDR versus PGD] \label{R:SDR_vs_PGD}\normalfont Although SDR has well-documented merits when dealing with non-convex BQPs (and other quadratic problems), the relaxation entails dropping a rank constraint after ``lifting'' a (binary) vector-valued problem with $NM$ variables to a matrix-valued one with $NM(NM+1)/2$ variables. This entails an increase in memory and computational cost, since the complexity of a general-purpose interior point method to solve the resulting SDP is $\ccalO (N^7 M^7 \text{log}(1/\epsilon))$, for a prescribed solution accuracy $\epsilon > 0$~\cite{luo2010semidefinite}. Such additional cost could hinder applicability of the SDR approach in Algorithm \ref{A:SDR} to problems involving very large networks. In those scenarios, the PGD iterations in Algorithm \ref{A:PGD} can still find stationary solutions with lower memory requirements and $\ccalO (M N^3)$ complexity per iteration. While nothing can be said a priori on the quality of the aforementioned stationary points, the more costly SDR-based solutions offer quantifiable approximation guarantees as asserted in Theorem \ref{theorem:approximation}. \end{remark} \section{Numerical tests}\label{S:Simulations} We study the recovery of real-world graphs to assess the performance of the proposed network topology inference algorithms. To this end, we specialize the problem in \eqref{E:general_problem} to recover a sparse adjacency matrix (thus $f(\bbS) = \| \bbS \|_1$ and $\ccalS = \ccalS_{\mathrm{A}}$) that is close in the Frobenius-norm sense to being diagonalized by the estimated eigenbasis $\hat{\bbV}$. Accordingly, given $\hbV$ we solve the following convex optimization problem \begin{equation}\label{E:SparseAdj_l1_obj_noisy_matrix} \bbS^* := \argmin_{\bbLambda, \bbS \in \ccalS_\mathrm{A}} \ \|\bbS\|_1, \quad \text{s. to }\:\|\bbS-\hbV\bbLambda\hbV^T\|_F \leq \epsilon. \end{equation} We first analyze the inference performance in controlled synthetic settings (Section~\ref{Ss:real_nets_synt_signals}), and then use this framework to gain insights about urban mobility patterns in New York City from data of Uber pickups in 2015 (Section~\ref{Ss:Uber}). \subsection{Inferring real-world networks from synthetic signals}\label{Ss:real_nets_synt_signals} Throughout this section, we infer real-world networks from the observation of diffusion processes that are synthetically generated via graph filtering as in \eqref{E:Filter_input_output_time}. Denoting by $\bbS = \bbA$ the (possibly weighted) adjacency matrix of the sought undirected graph $\ccalG$, we consider two types of filters $\bbH_1 = \sum_{l=0}^{2}h_l \bbS^l$ and $\bbH_2 = (\mathbf{I} + \alpha \bbS)^{-1}$, where the coefficients $\{h_l\}$ and $\alpha$ are drawn uniformly on $[0,1]$. Notice that when inferring PSD graph-shift operators, we consider a modified $\bbS$ to ensure positive semi-definiteness of the filter. As a measure of recovery error, we consistently adopt $\|{\bbS}^*-\bbS\|_F/\|\bbS\|_F$ (averaged over multiple independent realizations of the experiment), where ${\bbS}^*$ is obtained after solving \eqref{E:SparseAdj_l1_obj_noisy_matrix} and $\bbS$ denotes the ground-truth GSO. \begin{figure}[t] \centering {\includegraphics[width=0.95\linewidth]{TSPinputoutputnoiseless.eps}} {\includegraphics[width=0.95\linewidth]{TSPinputoutputnoisy.eps}} \caption{Graph topology inference from input-output realization pairs. (top) Error in recovering a geographical graph of the US as a function of the number $M$ of noiseless input-output pairs observed for two different types of graph filters. When $M\geq N=49$, the graph is perfectly recovered. (bottom) Counterpart of the top figure but for noisy observations. We discriminate two cases: one in which the symmetric structure of the filters is leveraged for recovery and one in which is not.} \label{fig:TSP_input_output} \vspace{-0.5cm} \end{figure} \noindent\textbf{Inference from input-output realization pairs.} We illustrate the method proposed in Section~\ref{Ss:linear_equations} by recovering a geographical network of the United States (US). More specifically, we consider a graph with $N=49$ nodes given by the 48 states in continental US plus the District of Columbia, and with unweighted edges indicating pairs of states that share a border\footnote{Dataset from \url{http://konect.uni-koblenz.de/networks/contiguous-usa}}. We then generate $M$ i.i.d. random input-output pairs $\{\bbx_m,\bby_m\}_{m=1}^M$ as explained in Section~\ref{Ss:linear_equations}, where signals (with uniformly-distributed entries in $[0,100]$) are diffused on the US graph via either the FIR filter $\bbH_1$ or the IIR filter $\bbH_2$. Given such data, the respective graph filters are estimated by forming \eqref{E:opt_filter_inputoutput_closedform}. Problem \eqref{E:SparseAdj_l1_obj_noisy_matrix} with $\hat{\bbV}$ given by the eigenvectors of the estimated filter is then solved in order to infer the graph. In Fig.~\ref{fig:TSP_input_output} (top) we plot the recovery error as a function of $M$ for both types of filters. First, notice that the performance is roughly independent of the filter type. More importantly, for $M \geq N$, the optimal filter minimizing \eqref{E:opt_filter_inputoutput_closedform} is unique (cf. Proposition~\ref{P:Closedform_inputoutputpairs}) and leads to perfect recovery. We also consider the case where observations of the output signals $\bby_m$ are corrupted by additive Gaussian noise with $-10$dB power; see Fig.~\ref{fig:TSP_input_output} (bottom). For this latter case, we also plot the error when the symmetry of the filter is ignored and, thus, not leveraged to improve recovery performance (cf. discussion prior to Proposition~\ref{P:Closedform_inputoutputpairs}). First we notice that even though the estimation improves with increasing $M$, a larger number of observations is needed to guarantee successful recovery of the graph. Moreover, exploiting symmetry reduces the degrees of freedom in the filter to be inferred, thus markedly improving the recovery performance for the US graph adjacency matrix. Even though not shown in Fig. \ref{fig:TSP_input_output}, the performance was observed to degrade gracefully when the noise level increases. \begin{figure}[t] \centering {\includegraphics[width=0.95\linewidth]{Fig2.eps}} \caption{Error in recovering Zachary's karate club social network as a function of the number $P$ of opinion profiles observed, and parametrized by the number of topics $M$. As expected, the graph estimate becomes increasingly accurate with increasing values of $P$ and $M$.} \label{fig:TSP_PSD} \vspace{-0.5cm} \end{figure} \noindent\textbf{Inference of PSD graph shifts.} We consider the karate club social network studied by Zachary~\cite{Zachary1977}, which is represented by a graph $\ccalG$ consisting of $N=34$ nodes or members of the club and undirected edges symbolizing friendships among them. Denoting by $\bbL_\mathrm{n}$ the normalized Laplacian of $\ccalG$, we define the graph-shift operator $\bbS \!=\! \bbI \!-\! \eta \bbL_\mathrm{n}$ with $\eta \!=\! 1/\lambda_{\max}(\bbL_\mathrm{n})$, modeling the diffusion of opinions between the members of the club. A graph signal $\bby$ can be regarded as a unidimensional opinion of each club member regarding a specific topic, and each application of $\bbS$ can be seen as an opinion update. Our goal is to recover $\bbL_\mathrm{n}$ -- hence, the social structure of the Karate club -- from the observations of opinion profiles. We consider $M$ different processes in the graph -- corresponding, e.g., to opinions on $M$ different topics -- and assume that an opinion profile $\bby_m$ is obtained by diffusing through the network an initial belief $\bbx_m$. More precisely, for each topic $m = 1, \ldots, M$, we model $\bbx_m$ as a zero-mean process with known covariance $\bbC_{\bbx,m}$. We are then given a set $\{\bby^{(p)}_m\}_{p=1}^P$ of independent opinion profiles generated from different sources $\{\bbx^{(p)}_m\}_{p=1}^P$ diffused through filter $\bbH_1$ of unknown nonnegative coefficients. From these $P$ opinion profiles we first form an estimate $\hat{\bbC}_{\bby, m}$ of the output covariance. Leveraging that $\bbS$ is PSD and $h_l \geq 0$ for $l = 0,1,2$ (cf.~Section~\ref{Ss:PSD_filter}), then we estimate the filter $\bbH_1$ via \eqref{E:minimizer_PSD_closedform} and solve \eqref{E:SparseAdj_l1_obj_noisy_matrix} using the eigenbasis $\hat{\bbV}$ of the estimated filter. Set $\ccalS$ is modified accordingly for the recovery of a normalized Laplacian instead of an adjacency matrix; see \cite{segarra2016topoidTSP16}. In Fig.~\ref{fig:TSP_PSD} we plot the recovery error as a function of the number of observations $P$ and for three different values of $M\in\{1,5,10\}$. As $P$ increases, the estimate $\hat{\bbC}_{\bby, m}$ becomes more reliable entailing a better estimation of the underlying filter and, ultimately, leading to more accurate eigenvectors $\hat{\bbV}$. Hence, we observe a decreasing error with increasing $P$. Moreover, for a fixed number of observations $P$, the error in the estimation of $\hat{\bbC}_{\bby, m}$ can be partially overcome by observing multiple diffusion processes, thus, larger values of $M$ lead to smaller graph recovery errors. The results also confirm that, when only second-order statistical information is available and so the relationship between the input and output covariances is quadratic, more observations are needed (for reliable network inference) relative to those required for the linear graph-filter identification task in the previous test case (cf. Fig. \ref{fig:TSP_input_output}). \begin{figure}[t] \centering {\includegraphics[width=0.95\linewidth]{Fig3.eps}} \caption{Error in recovering a brain network as a function of the number $M$ of graph processes observed for different recovery algorithms. We assume perfect second-order statistical knowledge of the processes. SDR outperforms PGD at the expense of a higher computational complexity (cf.~Remark~\ref{R:SDR_vs_PGD}). The mismatched stationarity assumption in~\cite{segarra2016topoidTSP16} explains its worse performance.} \label{fig:TSP_Generic} \end{figure} \noindent\textbf{Inference of general symmetric graph shifts.} We consider a symmetric brain graph with $N=66$ nodes or neural regions and edge weights given by the density of anatomical connections between regions~\cite{hagmann2008mapping}. We generate input-output covariance pairs $\{ \mathbf{C}_{\mathbf{x},m} , \mathbf{C}_{\mathbf{y},m} \}_{m=1}^{M}$ and evaluate the performance of the two algorithms presented in Section~\ref{S:algorithms}. Once more, signals are generated using the FIR diffusion filter $\bbH_1$ and so the covariances satisfy $\mathbf{C}_{\mathbf{y},m}=\bbH_1\mathbf{C}_{\mathbf{x},m}\bbH_1$ for each $m$. We first estimate the graph filter using either the PGD approach in Algorithm~\ref{A:PGD} or the SDR approach in Algorithm~\ref{A:SDR}, and then solve \eqref{E:SparseAdj_l1_obj_noisy_matrix} to recover the adjacency matrix of the structural brain network. Fig. \ref{fig:TSP_Generic} depicts the recovery error versus $M$ for Algorithms~\ref{A:PGD} and~\ref{A:SDR} as well as for a baseline GSP-based algorithm that assumes that the observed graph processes are stationary~\cite{segarra2016topoidTSP16}. First, we notice that as $M$ increases the recovery error associated with the PGD algorithm decreases monotonically. For instance, we can achieve perfect recovery with $M = 10$ observed covariances. The SDR approach, on the other hand, presents a superior performance with almost perfect recovery even when $M = 2$. Recall that this gain in performance comes at the price of a higher computational complexity as explained in Remark~\ref{R:SDR_vs_PGD}. Finally, both proposed methods outperform the algorithm in~\cite{segarra2016topoidTSP16} for all $M$. This is expected due to the model mismatch suffered when incorrectly assuming that the observed graph processes are stationary, and accordingly using the output covariance eigenvectors as spectral templates of the recovered graph. While not shown in Fig. \ref{fig:TSP_Generic} to avoid hindering clarity of presentation, large errors were also obtained for the workhorse statistical approach termed graphical lasso~\cite{GLasso2008}. This is expected since the graph recovered by graphical lasso corresponds to the maximum-likelihood estimate of the precision matrix $\mathbf{C}_{\mathbf{y}}^{-1}=\bbH_1^{-1}\mathbf{C}_{\mathbf{x}}^{-1}\bbH_1^{-1}$, that bears no direct relation with $\bbS$. \begin{figure}[t] \centering {\includegraphics[width=0.95\linewidth]{limitedbudget.eps}} \caption{Error in recovering a collaboration network using SDR for varying budgets (number of processes $M$ times the signals observed per process $P$). For a fixed budget it is better to allocate the sensing resources in learning $M\!=\!2$ processes as accurately as possible, rather than having a coarser estimate of more ($M>2$) processes.} \label{fig:limited_budget} \end{figure} \noindent\textbf{Inference with a fixed signal budget.} In the previous test case we saw that when perfect second-order statistical knowledge of the processes is available, SDR can typically recover the unknown graph with $M \geq 2$. However, in practice we estimate output covariances from observed signals via sample averaging. In particular, assume that we estimate the covariance of each of the $M$ processes by observing $P$ independent graph signals. For the cases where the total budget of signals $M\times P$ is fixed, this numerical test studies the trade-off between $M$ and $P$ as it pertains to recovery performance. Is it better to have accurate estimates of a few processes' covariances (larger $P$ and smaller $M$), or instead, coarser estimates of more processes (smaller $P$ and larger $M$)? In order to answer this question, we consider the collaboration network of $N=31$ scientists working in the field of Network Science presented in~\cite{segarra2016topoidTSP16} (see~\cite{newman2001scientific} for more information), and model the diffusion of ideas among the scientists via simple linear dynamics as per $\bbH_1$. We implement Algorithm \ref{A:SDR} (SDR) for $L=10$ random draws to recover the collaboration graph from $M$ processes, each inferred from $P$ signals such that $M\times P$ is fixed. Fig.~\ref{fig:limited_budget} depicts the recovery error as a function of the total budget ($M\times P$) of observed signals, parametrized by $M\in\{2,3,4,5\}$. As expected, the error decreases for increasing budget for all values of $M$, since we can better estimate the covariances of all the processes. More interestingly, for a fixed budget it is better to consider only $M=2$ processes. Given that SDR can often recover the filter with perfect knowledge of $M=2$ covariances, it is better to focus on just two process and obtain the most accurate estimates of the associated covariances. \begin{figure}[t] \centering \includegraphics[width=0.9\linewidth]{uber2_arxiv.eps} \caption{New York City's mobility pattern inferred from 2015 Uber pickups data. Most edges connect Manhattan with the other boroughs indicating that Uber is widely used to commute to/from the suburbs. Airports (Kennedy, Newark and LaGuardia) can also be distinguished as high degree nodes.} \label{fig:uber} \vspace{-0.5cm} \end{figure} \subsection{Unveiling urban mobility patterns from Uber pickups}\label{Ss:Uber} We implement our SDR graph topology inference method (Algorithm~\ref{A:SDR}) in order to detect mobility patterns in New York City from Uber pickups data\footnote{Dataset from \url{https://github.com/fivethirtyeight/uber-tlc-foil-response}}. We have access to times and locations of pickups from January 1\textsuperscript{st} to June 29\textsuperscript{th} 2015 for $263$ known location IDs. For simplicity, we cluster the locations into $N=30$ zones based on their geographical proximity; these are shown as red pins in Fig.~\ref{fig:uber}. These zones represent the nodes of the graph to be recovered. The total number of pickups aggregated by zone during a specific time horizon can be regarded as graph signals defined on the unknown graph. More specifically, we consider $M=2$ graph processes: weekday ($m=1$) and weekend ($m=2$) pickups. Moreover, we consider that the pickups from 6am to 11am constitute the inputs of our process whereas the pickups from 3pm to 8pm comprise the outputs of our process. To be more precise, for a specific day we aggregate all the pickups within 6-11am to form an input signal $\bbx$ and similarly we group all the pickups within 3-8pm to generate the associated output signal $\bby$. If the day considered is a weekday, we think of this pair as being generated from process $m=1$, and if it is a weekend we consider the pair coming from process $m=2$. We repeat this procedure for all the days included in the period of study, and estimate input-output covariance pairs $\{\hat{\bbC}_{\bbx , m},\hat{\bbC}_{\bby, m}\}_{m=1}^{2}$. We then run Algorithm~\ref{A:SDR} to infer an underlying graph filter $\hbH$ and solve~\eqref{E:SparseAdj_l1_obj_noisy_matrix} given the estimated eigenbasis of $\hbH$ to find a sparse mobility pattern. The modeling presumption is that thorughout the day, the population diffuses over an unknown graph of mobility patterns we seek to identify. The recovered graph is depicted in Fig.~\ref{fig:uber}, where the weights of the recovered edges is represented by the line widths in the figure. Given the nature of the input and output processes considered, the graph obtained is a sparse description of the mobility pattern of people throughout the day. Notice that most connections occur between Manhattan and the other boroughs (Queens, Bronx, Staten Island, Brooklyn and Newark), while only a few edges connect zones within Manhattan. This indicates that people use Uber to commute from their homes in the suburbs to their work (or leisure activities in the weekends) in the city. These findings are consistent with exploratory research of this same dataset~\cite{538blogpost} as well as a recent New York Times article that writes: \emph{``Uber has deployed thousands of black cars across Manhattan, going bumper-to-bumper with yellow taxis for passengers and fares in lucrative commercial and tourist areas. But the ride-hail app has increasingly shifted its focus to the city's other four boroughs, where frustration over subway overcrowding and delays and fewer taxi options have made it the ride of choice for many. As a result, Uber is booming in the other boroughs, with half of all Uber rides now starting outside Manhattan\ldots''}~\cite{NYT2017}. Lastly, observe that the JFK, Newark and LaGuardia airports are strongly connected with Manhattan and the other boroughs, as expected. \section{Concluding Summary}\label{S:Conclusions} We studied the problem of inferring an undirected network from observations of \emph{non-stationary} signals diffused on the unknown graph. Relative to the stationary setting, the main challenge is that the GSO eigenvectors differ from those of the signal covariance matrix. To overcome this hurdle, we leverage that the sought eigenbasis is preserved by the polynomial graph filter that governs the diffusion process. As a result, the novel approach is to first identify the GSO eigenvectors from a judicious graph filter estimate, and then we rely on these spectral templates to estimate the eigenvalues by imposing desirable properties (such as edge sparsity) on the graph to be recovered. We propose different estimators of the symmetric diffusion filter depending on whether: i) explicit realizations; or, ii) second-order statistical information is available from the input-output graph signal pair. These estimators arise as solutions of systems of linear and quadratic matrix equations, respectively. We thus investigate identifiability properties of the resulting problems, and we develop PGD and SDR algorithms with complementary strengths to compute near-optimal solutions of the said system of quadratic equations. The overall network topology inference pipeline is validated via comprehensive numerical tests on real social, author collaboration, and structural brain networks. Moreover, we show how the developed graph inference tools can be utilized to unveil mobility patters in New York City, from data of Uber pickups across Manhattan and the outer boroughs. As future work, it is of interest to expand the scope of the proposed topology inference framework to accommodate directed graphs that represent the structure of signals (possibly) generated via nonlinear network interactions. Adaptive algorithms that can track slowly-varying graphs, and effect memory and computational savings by processing the signals on-the-fly is subject of ongoing investigation.
\section{Introduction} The goal of finding habitable planets and even planets with signs of (primitive) life around other stars is extremely challenging and requires a variety of complementary observations. Experience gained so far in exoplanet atmospheric research shows that a broad wavelength coverage and sufficiently high spectral resolution are required to break the degeneracies in composition and climate associated with retrieval of atmospheric spectra. In that regard, an important wavelength regime is the mid-infrared (5-20~$\mu$m). It provides data to measure key planetary parameters, such as the size, temperature, the presence of an atmosphere, as well as the presence of important atmospheric molecules such as H$_2$O, CO$_2$, O$_3$, CH$_4$, and N$_2$O (see Table~\ref{tab1}). From an observational standpoint, it also has the considerable advantage of offering a more favorable planet/star contrast than at visible wavelengths (10$^{-7}$ vs 10$^{-10}$) for an Earth-Sun system.\\ \begin{table}[!t] \caption{Information on planets that can be obtained from low-resolution (R$\simeq$20) mid-infrared observations (5-20~$\mu$m). Two continuum (Cont.) bands (2 and 3) are also given, where in a cloud-free atmosphere, emission from the surface might be seen \citep[data from][]{Desmarais:2002,Seager:2016,Airapetian:2017}. Values given for N$_2$O and NO are approximative. {\bf The wavelength columns ($\lambda_{\rm MIN}$, $\lambda_{\rm MAX}$, and $\lambda_{\rm AVG}$) are given in microns. R gives the corresponding spectral resolution.}} \begin{center} \begin{tabular}{l l c c c c c c} \hline \hline & Information on planet & Species & $\lambda_{\rm MIN}$ & $\lambda_{\rm MAX}$ & $\lambda_{\rm AVG}$ & R\\ \hline 1 & Orbit characteristics & Cont.~1 & 6.00 & 20.0 & 13.0 & 1\\ 2 & Combination of temperature, & Cont.~2 & 10.1 & 12.4 & 11.2 & 5\\ & radius, and albedo & Cont.~3 & 8.16 & 9.24 & 8.67 & 8\\ 3 & Existence of atmosphere & Cont.~1 & 6.00 & 20.0 & 13.0 & 1\\ & & CO$_2$ & 9.07 & 9.56 & 9.31 & 19\\ & & & 10.1 & 10.7 & 10.4 & 16\\ & & & 13.3 & 17.0 & 15.0 & 4\\ & & NO & 5.1 & 5.5 & 5.3 & 20\\ 4 & Presence of water & H$_2$O & 6.67 & 7.37 & 7.00 & 10\\ & & & 17.4 & 25.0 & 20.5 & 3 \\ 5 & Suggestion of life & CH$_4$ & 7.37 & 7.96 & 7.65 & 13\\ & & & 7.37 & 8.70 & 7.98 & 6\\ & & N$_2$O & 7.50 & 9.00 & 7.25 & 10\\ & & O$_3$ & 9.37 & 9.95 & 9.65 & 17\\ \hline \end{tabular} \end{center} \label{tab1} \end{table} Mid-infrared observations from the ground are however very challenging due to the turbulence and brightness of the atmosphere. For instance, the atmosphere is approximately 10 billion times brighter than a 300K Earth-sized planet located at 10\,pc when observed with an 8-m telescope. Overcoming the background photon noise limit alone requires prohibitively long integration times to study rocky exoplanets, even around nearby stars. In addition, because the Earth's atmosphere is mostly opaque at the wavelengths corresponding to major molecular absorption features (such as H$_2$O and CO$_2$), searching for the broad spectral signatures of major molecular species in planetary atmospheres will generally be very difficult from the ground. To overcome these issues, access to space is mandatory. In the short term, the study of transiting systems is highly promising for planets larger than a few Earth radii and will be a major focus for the James Webb Space Telescope \citep{Beichman:2014}. Nevertheless, the rarity of nearby planetary systems suitably aligned to produce a transit, the short duration of the transit, and the noise produced by the host star means that the study of the atmospheres of terrestrial planets, especially those orbiting Sun-like stars, is probably unachievable via this technique. Thus, techniques which separate the light of the planet from the glare of the host star and can characterize exoplanets with any orbital configuration are essential.\\ In order to spatially resolve the systems closest to Earth (within 10\,pc) in the mid-infrared, an aperture of at least 80\,m in diameter would however be required and this is presently not feasible. A way to increase the spatial resolution is to use an interferometer as initially proposed by \citet{Bracewell:1978} and significantly improved by \cite{Angel:1986}. The concept of such an instrument was extensively studied in the 1990s and 2000s by both ESA and NASA. In Europe, ESA focused mainly on the D{\sc arwin\,} project \citep[e.g.,][]{Leger:1996,Cockell:2009}, which consisted of a space-based flotilla of mid-infrared telescopes using nulling interferometry as the measurement principle. In the United states, a similar concept, called the Terrestrial Planet Finder Interferometer \citep[TPF-I,][]{Angel:1997}, was considered as the final piece of NASA's ambitious Navigator program to characterize Earth-like exoplanets \citep{Lawson:2006}. Between 1996 and 2007, considerable efforts have been carried out by both agencies to define the best mission design and to advance the technologies required for such an ambitious endeavor. Several mission architectures were proposed, key enabling technologies were developed and demonstrated on laboratory test-benches, and advanced data reduction techniques were investigated. These efforts, which resulted in hundreds of articles in the technical literature, culminated in 2007 with the convergence and consensus on a mission architecture called the Emma X-array {\bf \citep{Cockell:2009}}. In parallel, both agencies also appointed teams to investigate the scientific issues related to the search for life on exoplanets \citep[e.g.,][]{Lawson:2007,Fridlund:2010}. Some of the key questions are: What are the atmospheric compositions of rocky exoplanets? Are they habitable? What is a biosignature? Do exoplanets show signs of biological activity? How common is a planet like Earth? How do rocky planets form? While most D{\sc arwin\,} and TPF-I activities stopped after 2007 because of fundings reasons, these scientific questions are still a central focus. Today, the exoplanet landscape has greatly changed compared to 2007 but the general consensus in the exoplanet community is still the same: mid-infrared spectra will be required to tackle these fundamental questions {\bf \citep[see e.g.,][]{Fujii:2018}}.\\ \section{Studying planetary atmospheres in the mid-infrared} \label{sec:science} \subsection{Presence of an atmosphere and basic planetary properties}\label{sec:phasecurves} For any atmospheric composition, monitoring the variations of thermal emission of an exoplanet during its orbital motion provides a fundamental constraint on meridional transport (hence atmospheric mass) as well as on cloud coverage \citep[e.g.,][]{Selsis2004}. With an increasing number of thermal emission bands monitored, additional planetary properties can be inferred or constrained by orbital photometry: rotation, albedo, obliquity, radius \citep{Selsis2011,Cowan2012,Maurin2012,Selsis2013}, presence of a large satellite \citep{Moskovitz2009}, response to eccentricity \citep{Bolmont2016}. Thermal phase curves have successfully been used to characterize unresolved transiting \citep{Knutson2007,Stevenson:2014} and even non-transiting giant planets \citep{Crossfield2010} but the stellar variability and the required photometric precision make these measurements very difficult. With directly imaged planets, this method will show its full potential. Although the inner working angle will limit the access to the smallest phase angles, only a moderate photometric precision of $\sim 10$\% will be required to achieve a crucial diagnostic and first classification of the targets. Another strength of the method comes from the favorable distribution of orbit orientations. For the median inclination of randomly oriented orbits ($60^{\circ}$), the amplitude of phase curves is only decreased by 10~\% compared with the maximum variations, reached for a $90^{\circ}$ inclination \citep{Maurin2012}. Only a few observations covering one orbit would be sufficient to start deriving constraints on the climate and several low-resolution or broadband observations would be necessary to resolve the orbital motion of the planet. {\bf Note finally that a by-product of thermal emission monitoring is the orbit characteristics, such as semi-major axis, period, inclination, and position angle.} \subsection{Surface conditions, atmospheric composition, and habitability} In addition to the constraints from orbital broadband photometry, mid-infrared spectroscopy is fundamental to investigate the nature of planetary atmospheres by detecting spectral features, constraining the temperature and pressure structure, the cloudiness and by determining whether the planet could potentially be habitable. Indeed, several important species have mid-infrared spectral signatures that can be detected at low to medium spectral resolving power (e.g., H$_2$O, CO$_2$, O$_3$, CH$_4$, N$_2$O). {\bf The wavelength (minimum, maximum, and average) and corresponding spectral resolution for each spectral feature are given in Table~\ref{tab1}}). In addition, surface conditions (temperature and pressure) can be characterised relatively well from mid-infrared observations (to within $\sim$10 K at 3-$\sigma$) with S/Ns between 10 and 30, depending on spectral resolution \citep{vonParis:2013}. By observing a large number of Habitable Zone (HZ) rocky exoplanets, it will be possible to correlate the concept of habitability with key parameters and processes like spectral type of the parent star, degree of stellar activity, the temperature/pressure structure of the atmosphere, gaseous composition, the circulation and heat transfer of the atmosphere, the {atmospheric chemistry} and photochemistry, the outgassing of atmospheric species, and the presence of a magnetic field. \subsection{Understanding the concept of biosignature} A biosignature can be defined as ``an observable feature of a planet, such as its atmospheric composition, that our present models cannot reproduce when including the abiotic physical and chemical processes we know about" \citep{Leger:2011}. {\bf In a recent review, \cite{Catling:2018} define a biosignature as ``any phenomenon, substance, or group of substances that provides evidence of the presence of life.'' These include biosignature gases in the atmosphere, oxygen (O$_2$), ozone (O$_3$), methane (CH$_4$), nitrous oxide (N$_2$O), and methyl chloride (CH$_3$Cl); and a surface biosignature, the vegetation ``red edge,'' a unique reflectance spectrum from plant leaves and a sign of oxygenic photosynthesis. Over the past few years, researchers have probed the efficacy of these signs of biogenic gases and photosynthesis for exoplanets and identified additional candidates. In particular, \cite{Schwieterman:2018} have presented an exhaustive review of the mechanisms, sources, sinks, and environmental by-products for gas and surface biosignature candidates to date. While the scientific community keeps improving the list of potential biosignature species \citep[e.g.,][]{Seager:2016,Kiang:2018},} it appears clear that our theoretical models are currently limited and the emerging vision is that studying the atmospheres of a large number of exoplanets will be required to provide an essential context for interpreting possible detections of bio-signatures. A good approach could be to create the planetary equivalent of a ``Hertzsprung-Russel`` diagram including species suggestive of life. Only after observing a sufficient number of planetary atmospheres, will it be possible to identify possible anomalies in this diagram that cannot be explained without the presence of life. To make progress in that direction, the mid-infrared regime has a key role to play since it contains spectral signatures of important molecules such as H$_2$O, CO$_2$, O$_3$, N$_2$O, and CH$_4$. In fact, the triple signature (i.e., O$_3$, CO$_2$, H$_2$O) was considered as the most robust indicator for life at the time of the D{\sc arwin}/TPF studies and would still today be considered as a serious hint of biological activity. The advantage of O$_3$ over O$_2$ is that O$_3$ is a highly sensitive indicator for the existence of even a trace amount of O$_2$ and hence easier to detect at low O$_2$ concentrations \citep{Desmarais:2002}. It is also difficult to produce abiotic O$_3$ if water is present, due to catalytic cycles initiated by water photolysis, which removes O$_3$. {\bf An in-depth review of O$_2$ as a biosignature, rigorously examining the nuances of false positives and false negatives for evidence of life can be found in \cite{Meadows:2018}.} \section{Space-based interferometer concept} \label{sec:tech} \subsection{Extracting the planetary photons by nulling interferometry}\label{sec:nulling} The basic principle of nulling interferometry is to combine the beams coming from two telescopes with a 180 degree phase shift so that a dark fringe appears on the line of sight towards the hosts star, which strongly suppresses its light. On the other hand, off-axis emission, such as that of a planet, can be transmitted by optimizing the baseline length since the nearest bright fringe is located $\lambda$/2/baseline from the dark fringe. However, even when the stellar emission is sufficiently reduced, it is generally not possible to detect Earth-like planets with a static array configuration, because their emission is dominated by the thermal contribution of a series of other extraneous and generally dominant signals originating from the telescope itself (thermal background, readout noise), material in the Solar system (the local zodiacal emission), or around the target star (exozodiacal light). This is the reason why Bracewell proposed to rotate the interferometer so that the planetary signal gets modulated by alternatively crossing high and low transmission regions, while the stellar signal and the background emission remain constant. The planetary signal can then be retrieved by synchronous demodulation. This modulation technique is in many ways similar to the use of a chopper wheel that allows the detection of infrared sources against a thermal background and/or drifting detector offsets. \subsection{The Emma X-array configuration}\label{sec:emma} During the D{\sc arwin}/TPF-I studies, it was quickly realized that the interferometric array cannot be rotated sufficiently fast to mitigate low frequency instrumental drifts to a level sufficiently low to enable the observation of an Earth-like exoplanet around a Sun-like star \citep[e.g.,][]{Lay:2004}. A solution proposed to overcome this problem is to use more than two telescopes and phase chopping, which consists in synthesizing two different transmission maps with the same telescope array, by applying different phase shifts in the beam combination process. In addition to allowing more precise differential measurements, it is also possible to isolate the planetary signal from the contributions of symmetric brightness emissions such as the star, local zodiacal cloud, exozodiacal cloud, stray light, thermal, or detector gain. After the investigation of several interferometer architectures \citep[e.g.,][]{Angel:1997b,Mennesson:1997}, two array architectures have been thoroughly investigated by ESA during two parallel assessment studies carried out by EADS Astrium and Alcatel-Alenia Space in 2005-2006: the four-telescope X-array and the Three-Telescope Nuller \citep[TTN,][]{Karlsson:2004}. These studies included the launch requirements, payload spacecraft, and the ground segment during which the actual mission science would be executed. Almost simultaneously, NASA/JPL initiated a similar study for TPF-I and focused in particular on the Dual-chopped Bracewell \citep{Lay:2004} and X-array configurations. These efforts on both sides of the Atlantic have finally resulted in a convergence and consensus on mission architecture, the so-called non-coplanar (aka Emma-type) X-array. The baseline design consisted in four collector spacecraft, flying in rectangular formation and feeding light to the beam combiner spacecraft located approximately 1200\,m from the array. This arrangement makes available baselines up to 170\,m for nulling measurements and up to 500\,m for the general astrophysics program (constructive imaging with an angular resolution of 4\,mas at 10~$\mu$m).\\ \subsection{Exoplanet yield}\label{sec:yield} The number of planetary atmospheres that can be studied with such an instrument is a critical metric to estimate the science return of the mission. During the D{\sc arwin}/TPF studies, the exoplanet yield has been extensively studied and cross-validated between ESA and NASA using various assumptions on the existing exoplanet population and prevalence of exozodiacal dust, which were both unknown at that time \citep[e.g.,][]{Defrere:2010}. Today, the occurrence of HZ rocky exoplanets has been measured by Kepler \citep[e.g.,][]{Winn:2015} and the prevalence of exozodiacal dust has been very well constrained by ground-based nulling interferometers \citep[][Ertel et al. in prep]{Mennesson:2014}. It is therefore possible to predict the exoplanet yield of direct imaging instruments more precisely. Recently, based on planet occurrence statistics from Kepler and using Monte-Carlo simulations, \citet[][]{Kammerer:2017,Quanz:2018} estimated that $\sim$315$_{-77}^{+113}$ exoplanets with radii between 0.5~R$_\oplus$ and 6~R$_\oplus$ can be detected during $\sim$0.52 years of mission time assuming four 2-m apertures and throughputs 3.5 times worse than those for the JWST and 40\% overheads. Approximately 85 planets could be habitable (radii between 0.5~R$_\oplus$ and 1.75~R$_\oplus$ and equilibrium temperatures between 200\,K and 450\,K) and would be prime targets for follow-up spectroscopic observations. While this exoplanet yield can be interpreted as an upper limit because no exozodiacal dust was assumed in this study, new results from the NASA's Hunt for Observable Signatures of Terrestrial planetary Systems \citep[HOSTS,][]{Danchi:2014} survey on the Large Binocular Telescope Interferometer \citep[LBTI,][]{Hinz:2016} suggest that exozodiacal dust disks would not be a major source of noise \citep{Ertel:2018a,Ertel:2018b}. New science yield estimates based on HOSTS upper limits are currently under study. \subsection{Technology state-of-the-art} \subsubsection{Formation flying} \label{sec:ff} Formation flying is a key technology for the deployment and success of a space-based interferometer. Remarkable advances in technology have been made in Europe in recent years with the space-based demonstration of this technology by the PRISMA mission \citep{Damico:2012}. PRISMA demonstrated a sub-cm positioning accuracy between two spacecraft (see Figure~\ref{fig:prisma}), mainly limited by the metrology system (GPS and RF). The launch of ESA's PROBA-3 mission in 2020 will provide further valuable free-flyer positioning accuracy results (sub-mm), which exceeds the requirements for a space-based interferometer that relies on fast pathlength correctors for precise Optical Path Delay (OPD) control. Extending the flight-tested building-block functionality from a distributed two-spacecraft instrument to an instrument with more spacecraft mainly relies on the replication of the coordination functionality and does not present additional complexity in terms of procedures according to the PRISMA navigation team. While formation flying can then be considered to have reached a technical readiness level (TRL) of 9 once PROBA-3 has flown, an uncertainty remains regarding fuel usage and the possible lifetime of such a mission. \begin{figure}[!t] \begin{center} \includegraphics[height=4.6 cm]{prisma.pdf} \caption{Demonstration of Formation Flying between the two PRISMA spacecraft, Tango and Mango. A distance of 100\,m was maintained during four hours with a standard deviation of few centimeters (see bottom right panel), limited by the accuracy of the radio frequency sensors. ESA's Proba 3 instrument, scheduled for a launch in 2021, should reduce this error to a few 100 microns.\textcopyright~Swedish Space Corporation, CNES and DLR.}\label{fig:prisma} \vspace{-1.5em} \end{center} \end{figure} \subsubsection{Spatial filters} Spatial filters are optical devices which significantly reduce the optical aberrations in wavefronts. Consequently, they are very important for nulling interferometry, making extremely deep nulls possible. To provide spatial filtering over large bandwidths, a variety of techniques can be applied, including single-mode fiber optics, photonic crystal fibers, or integrated optics. Developments of single-mode fibers for the mid-infrared were funded by NASA between 2003 and 2008 \citep[][]{Ksendzov:2007,Ksendzov:2008}. Fiber optics made of chalcogenide and silver halide materials have been demonstrated to yield 25 dB or more rejection of higher-order spatial modes at 10~$\mu$m, but they would require the division of the 6--20\,$\mu$m band into two parts. Although this performance is sufficient for flight, it would be greatly advantageous to improve the throughput of these devices and to test them over the full wavelength range in cryogenic conditions. Spatial filter technology would then be at TRL 5. The spatial filtering capabilities of photonic crystal fibers should also be investigated for use at mid-infrared wavelengths, because of the improved throughput that they may provide and the possibility to cover the whole wavelength range with a single device. Note finally that, given the recent developments in wavefront control with extreme adaptive optics systems \citep[e.g.,][]{Jovanovic:2015}, it is not clear whether such a filtering technology will be required. This should be addressed in the future. \subsubsection{Beam combination} Classical optical designs of four-telescope nulling beam combiners \citep{Martin:2010} have been demonstrated to flight requirement levels albeit at room temperature and using signals much stronger than those from astronomical sources. Recently, a very promising grating nuller approach was proposed and shown to achieve nulls of 4$\times$10$^{-5}$ over the full 18\% bandwidth K-band \citep{Martin:2017}. Alternatively, {\it integrated optics} (IO) beam combination can be achieved by a network of single-mode waveguides embedded in a cm-scale glass chip. This solution bypasses complex optical interferometric trains sensitive to vibrational, thermal and mechanical stress, hence reducing the risk associated with bulky science instruments. As for fibers, IO can furthermore achieve wavefront cleaning to mitigate phase errors \citep{Wallner:2002,Mennesson:2002}. Silica-based IO solutions are now being successfully implemented in operating near-infrared 4-telescope interferometers \citep{Eisenhauer:2011,Lebouquin:2011} and have also been investigated for nulling applications in the near-infrared at 1.5\,$\mu$m \citep{Weber:2004,Errmann:2015} with stable nulls down to 10$^{-4}$ over 5\% bandwidth. Since silica glasses are opaque to IR radiation for $\lambda$$>$2\,$\mu$m, the extension of the IO approach to the mid-infrared in the 3-30\,$\mu$m range requires an adequate material and technological platform to manufacture high quality optical chips.\\ \subsubsection{Starlight suppression}\label{sec:star_suppr} \begin{figure}[!t] \begin{center} \includegraphics[height=5.00 cm]{martin2012.pdf} \caption{The left panel shows the planet signal detected with the Planet Detection Testbed \citep{Martin:2012}. Each point is an item of data from the 2-s chop cycle and the whole trace shows the null signal obtained over a 360 degree effective rotation of the interferometer array. The line is a fit to the signal from a planet at a nominal angular radius of $6.35\times10^{-7}$~rad (or 132\,mas) from the star. By comparison, the equivalent angular fringe distance from the short baseline is $4.7\times10^{-7}$~rad. Near the center and at the ends of the plot, the planet crosses the null fringe. The right panel shows the equivalent sensitivity map of the interferometer array. Array rotation causes the planet location to orbit (solid line) around the central null fringe (gray), and thus its signal is modulated both by the higher frequency fringes on the long baseline and by the chopping. {\bf Note that this demonstration was realized at room temperature with high flux levels. Technological developments are required to repeat this demonstration in cryogenic conditions with optical fluxes similar to those expected from astronomical sources (see Section~\ref{sec:tec})}.}\label{fig:nulling} \vspace{-1.5em} \end{center} \end{figure} A considerable expertise has been developed in the field of starlight suppression over the past 20 years, both in academic and industrial centers across the globe. These efforts culminated with laboratory demonstrations of the recombination scheme to flight requirements at the \emph{Jet Propulsion Laboratory} (JPL) in the US. In particular, mid-infrared nulls of 10$^{-5}$ were achieved with both the Adaptive Nuller \citep{Peters:2010} and the planet detection testbed \citep[][see Figure~\ref{fig:nulling}]{Martin:2012}, but with fluxes much higher than those expected from stars and planets allowing working at room temperature without being disturbed by the thermal emission of the environment. In parallel, the operation of high-precision ground-based interferometers has matured in both Europe and the US. In particular, Europe has gained a strong expertise in the field of fringe sensing, tracking, and stabilization with the operation of the \emph{Very Large Telescope Interferometer} (VLTI). In the United states, considerable technical expertise was gained by operating several nulling interferometers such as the Keck Interferometer Nuller \citep[KIN,][]{Colavita:2009}, the Palomar Fiber Nuller \citep[PFN,][]{Mennesson:2011a}, and the Large Binocular Telescope Interferometer \citep[][]{Hinz:2016}. All have produced excellent scientific results \citep[e.g.,][]{Mennesson:2014,Defrere:2015}, which have pushed high-resolution mid-infrared imaging to new limits \citep{Defrere:2016}. Innovative data reduction techniques have also been developed to improve the accuracy of nulling instruments \citep{Hanot:2011,Mennesson:2011b} but more work is required to adapt this technique to four-telescope configurations. \section{Prospects} \subsection{Current context} \begin{figure}[!t] \begin{center} \includegraphics[height=7.8 cm]{synergies.pdf} \caption{Flux at 10~$\mu$m as a function of angular separation of putative 300\,K blackbody planets located in the middle of the HZ of nearby single main-sequence stars \citep[DASSC catalog,][]{Kaltenegger:2010}. The 10-$\sigma$ sensitivity in one day of current and planned mid-infrared instruments is indicated by the colored rectangles \citep[values scaled from][]{Brandl:2014} and compared to that of a four 2m-aperture space-based nulling instrument (see blue rectangle, assuming no exozodiacal dust). Note that this plot does not take into account aperture masking modes, which improve the angular resolution but reduce the sensitivity.}\label{fig:synergies} \vspace{-1.5em} \end{center} \end{figure} Because it is a very challenging observational task partially requiring further technological developments, the spectroscopic characterisation of small HZ exoplanets by direct imaging is currently not possible with existing instruments. Future instruments considered to achieve this goal cover generally two distinct and complementary wavelength ranges: the visible, which favors the angular resolution, and the mid-infrared, which favors the contrast. Focusing first on the mid-infrared regime, we can see in Figure~\ref{fig:synergies} that none of current or foreseen instruments can approach a space-based nulling interferometer when it comes to achieving the necessary sensitivity at a small angular separation from the parent star. In the case of JWST, the impressive sensitivity provided by the large collecting area (25~m$^2$) and cold (40\,K) telescope optics can only be utilized by coronagraphs which are expected to achieve a best case contrast at 10.6~$\mu$m of 10$^{-4}$ to 10$^{-5}$, for separations larger than 0.5 to 1.0 arcsecond \citep[][]{Boccaletti:2015}. With such performances, the detection of warm and young exo-Jupiters is the closest that the JWST/MIRI instrument can approach to this project's goal of exo-Earth characterisation. For the E-ELT, the massive gain in collecting area (980~m$^2$) compared to the JWST offsets the impact of having warm optics to give comparable sensitivity limits for the METIS instrument, operating at 3 to 19~$\mu$m. METIS \citep[e.g.,][]{Brandl:2016} will be equipped with coronagraphs which can in principle achieve contrasts of $\sim$10$^{-7}$ at separation of $\sim$0.7 arcsecond necessary to directly image a putative exo-Earth orbiting $\alpha$~Cen and $\sim$10 small planets (1 to 4 R$_\oplus$) with equilibrium temperatures between 200 and 500\,K around the nearest stars \citep{Quanz15}. However, achieving this performance in practice at a ground-based observatory where image quality and stability are dependent on an advanced adaptive optics system, will be challenging. Further, due to the scarcity of available photons, the measurement would be restricted to a photometric detection, with little hope of spectroscopic follow-up.\\ Regarding the characterisation of HZ exoplanets in the visible, NASA is currently studying two concepts in preparation for the 2020 US decadal survey in Astronomy: (i) LUVOIR, a 10-16 m segmented, visible light telescope designed for an ambitious program of general astrophysics as well as detection of Earth-sized exoplanets and characterisation of dozens to hundreds of nearby stars; and (ii) HabEx, a 4-8 m monolithic telescope optimized for detection of Earth-sized exoplanets and characterisation of a smaller number of systems using either a highly optimized coronagraph or possibly a star shade. Both missions will likely include spectroscopy in the visible to near-infrared of Earth-sized planets in the HZ of nearby stars, searching for signs of habitability (H$_{2}$O) and bio-signature gases (O$_{2}$, O$_{3}$). A possible near-infrared extension (up to $\sim$2.5 microns) of these high contrast spectroscopic capabilities would help further establish whether these gases were created by biotic processes or not, i.e., looking for species such as CO$_{2}$, CO, O$_{3}$, CH$_{4}$, and N$_2$O. {\bf Scientifically, there is no clear advantage of one wavelength range over the other as described in various reviews \citep[see e.g.,][]{Desmarais:2002,Fujii:2018}. Note that mid-infrared observations may also be used to estimate the planetary radius, which otherwise remains unobservable unless the planet transits.} \subsection{Precursor concepts} The path towards space-based interferometry is regularly discussed and this often involves the need for precursor missions \citep[e.g.,][]{Rinehart:2016}. In addition to free-flying demonstrators already discussed in Section~\ref{sec:ff}, concepts of small-scale space-based infrared nulling interferometers were seriously considered both in Europe and in the US: the Fourier-Kelvin Stellar Interferometer \citep[FKSI,][]{Danchi:2008} and Pegase \citep[][]{Ollivier:2009}. Opportunities for testing technologies and for pushing new developments also exist with current ground-based facilities. For instance, in addition to ongoing research with current instruments as discussed in Section~\ref{sec:star_suppr}, there is currently a plan to build a nulling interferometer for the VLTI \citep[i.e., the Hi-5 project,][]{Defrere:2018b}. There is also a science-driven, international initiative to develop the roadmap for a future ground-based facility that will be optimised to image planet-forming disks on the spatial scale where the protoplanets are assembled, which is the Hill Sphere of the forming planets. This \textit{Planet Formation Imager} \citep[PFI,][]{Monnier:2016} is designed to detect and characterise protoplanets during their first $\sim 100$ million years and trace how the planetary population changes due to migration processes, unveiling the processes that determine the final architecture of exoplanetary systems. With $\sim 20$ telescope elements and baselines of $\sim 3$~km, the PFI concept is optimised for imaging complex scenes at mid-infrared wavelengths ($3-12\mu$m) and at 0.1 milliarcsecond resolution. This clearly complements the capabilities of a space interferometer that would be optimised to achieve the sensitivity and contrast required to characterise the atmospheres of mature exoplanets. \subsection{Required technological developments}\label{sec:tec} The main remaining technological challenge is the implementation of a cryogenic interferometer system that achieves the necessary starlight suppression and actual planet detection from 5 to 20~$\mu$m with optical fluxes similar to those expected from astronomical sources (typically $\sim$0.2 photons/s/m$^2$ for an Earth-like planet located at 10\,pc). To achieve this goal, preliminary system studies are required to (i) define the cryogenic design for passive cooling of the optics and active cooling of the detectors; (ii) characterize and minimize the vibrations of the interferometer in cryogenic conditions; (iii) validate the cryogenic deformable mirrors, and (iv) develop spatial filters (if needed) and beam combiners that can provide the necessary performance from 6 to 20~$\mu$m under cryogenic conditions. Specific developments in terms of fringe tracking (taking into account residual vibrations) and data reduction will undoubtedly be needed to reach the required level of performance in terms of starlight suppression. Dedicated developments will also be required in the field of mid-infrared detectors, although the JWST legacy will be particularly useful in this context. \section{Conclusions} Mid-infrared space-based interferometry is a technology of direct imaging that can uniquely characterise the atmospheres of terrestrial exoplanets around nearby main-sequence stars. The use of formation-flying telescopes makes it possible to observe and study a wide variety of planetary systems, including HZ terrestrial planets around M dwarfs such as Proxima b \citep{Defrere:2018}. Currently, no other technology can obtain mid-infrared spectra of a statistically-meaningful number of temperate rocky exoplanets, which is required to make progress towards the search for life in the Universe. Significant investments would have to be made today in order to ensure that the development of such an instrument is possible in the not too distant future. \section*{Acknowledgements} This work was partly funded by the European Research Council under the European Union's Seventh Framework Program (ERC Grant Agreement n.~337569) and by the French Community of Belgium through an ARC grant for Concerted Research Action. DD and OA acknowledge funding from the FRS-FNRS. Some of research described in this publication was carried out in part at the Jet Propulsion Laboratory, California Institute of Technology, under a contract with the National Aeronautics and Space Administration. Part of this work has been carried out within the frame of the National Center for Competence in Research PlanetS supported by the Swiss National Science Foundation. SPQ acknowledges the financial support of the SNSF. NCS was supported by Funda\c{c}\~ao para a Ci\^encia e a Tecnologia (FCT, Portugal) through national funds and by FEDER through COMPETE2020 in the context of the projects and grants reference UID/FIS/04434/2013 \& POCI-01-0145-FEDER-007672, PTDC/FIS-AST/1526/2014 \& POCI-01-0145-FEDER-016886, and IF/00169/2012/CP0150/CT0002. SL acknowledges support from ERC Starting Grant n.~639248. SK acknowledges support from an STFC Rutherford Fellowship (ST/J004030/1) and ERC Starting Grant n.~639889. \bibliographystyle{spbasic}
\section{Introduction} \label{intro} In nature there are a number of isotopes, which are considered as {\it stable}, nevertheless their radioactive decay is energetically allowed. Among these a valuable example is given by $^{209}$Bi, which was supposed to be stable until 2003, when its $\alpha$ decay~\cite{Bi209,Bi209exc} was observed for the first time. However, their rate of decay is largely suppressed by selection rules for angular momentum and parity between the initial and the final states of the nucleus. The naturally occurring Vanadium isotope $^{50}$V is one of three isotopes, together with $^{113}$Cd and $^{115}$In, for which a non-unique 4-fold forbidden $\beta^-$-decay may occur - parity of the decay does not change, while the angular momentum changes by four units $\Delta l ^{\Delta\pi}$= 4$^+$. The study of $^{50}$V decay is a useful probe to clarify the crucial problem of the quenching of the weak axial-vector coupling constant g$_{A}$ in the nuclear media~\cite{iachello}. A study of the spectral shape of the decay may shade light on the value of g$_A$, as suggested in~\cite{Suhonen}. In the last 60 years many studies have been carried out for the investigation of $^{50}$V decay \cite{1V,2V,3V,4V,5V,6V,7V,8V,9V,10V,11V}. The isotope is very interesting, since the decay to the ground state of the daughter nucleus is strongly suppressed, being a 6-fold forbidden decay. Thus, $^{50}$V can either undergo 4-fold forbidden $\beta^-$ decay to the first excited state of $^{50}$Cr or it can decay through electron capture to the first excited level of $^{50}$Ti, see Fig.~\ref{fig:scheme}. The estimated theoretical half-life of this nucleus is $>$10$^{17}$~y~\cite{1V}. For a detector of few kilograms in zero-background conditions, only few events per month are expected. This makes the investigation of this rare process extremely difficult, given the elusive counting rate. In 1989, J.J.~Simpson et al.~\cite{10V} measured for the first time the half-life of $^{50}$V electron capture decay to be (2.05$\pm$0.49)$\times$10$^{17}$~y, while up to now no clear observation of the $^{50}$V $\beta^-$ decay has been found. The strongest limit on the half-life of this decay is set at $>$8$\times$10$^{17}$~y~\cite{11V}. \begin{figure}[b] \centering \includegraphics[width=0.4\textwidth]{scheme.pdf} \caption{$^{50}$V decay scheme.} \label{fig:scheme} \end{figure} \section{Scintillating bolometers for rare event investigations} \label{sec:1} Significant progress has been made in the field of rare decay investigation during the past decade exploiting the scintillating bolometric technique~\cite{Pirro_rev}. After the discovery of the $^{209}$Bi $\alpha$ decay (T$_{1/2}$ = 1.9$\times$10$^{19}$~y) in 2003~\cite{Bi209}, the $\alpha$ decay of $^{180}$W~\cite{W180} to the ground state and the decay of $^{209}$Bi to the excited state~\cite{Bi209exc} were detected few years later. Then, the most stringent experimental limits on the half-lives of Pb isotopes $\alpha$ decay were set~\cite{pbwo4}. Recently $^{151}$Eu and $^{148}$Sm $\alpha$ decays were observed~\cite{Eu151,Sm148}. The main benefit for using scintillating bolometers for the investigation of rare $\alpha$ decays is to have the detector absorber made of the decay source. In all the previously mentioned measurements the scintillating bolometer detector was made of the decay source, thus ensuring high detection efficiency at the level of $>$95\%. In this work, we used an undoped YVO$_4$ single crystal as bolometer for the feasibility of studying of $^{50}$V $\beta^-$ decay. We discuss the crystal properties in terms of light yield and internal radiopurity, as well as its bolometric performance in terms of energy resolution and signal amplitude. \subsection{Crystal characteristics} YVO$_4$ is an attractive compound given its large mass fraction of Vanadium (about 18\%). The crystal production technology is well-established, conventional Czochralski method, and it is available on the market. Nevertheless, only small size crystal are purchasable with volume around 7~cm$^3$. The crystal has good mechanical properties and it features a wide transparency range from 400~nm up to 3~$\mu$m, for these reasons it is largely employed in laser applications. The crystal characterized in this work was purchased on the market without no specifications on its properties, other than being undoped. It weighs 22~g and it has a cylindrical shape of 18~mm of diameter and 20~mm of height. \subsection{Detector working principle} A cryogenic particle detector, namely a bolometer, is a crystal absorber made of a proper material, which is directly coupled to a suitable thermometer. If a particle traverses the absorber and releases energy, a temperature rise is induced in the crystal and measured by the thermometer. In order to reduce the temperature fluctuations and to enhance the signal amplitude, the experimental set-up is operated at cryogenic temperature so that the heat capacity of the absorber is reduced to the level where a single particle interaction can induce a sizeable positive temperature variation. When the crystal absorber is also an efficient scintillator at low temperature, then a fraction of the deposited energy is transformed into a scintillation signal which can be measured by means of a suitable light detector (LD). The double heat-light read-out allows for an efficient identification of the nature of the interacting particle, using the Light Yield (LY) discrimination~\footnote{We define the Light Yield as the ratio between the measured light, in keV, and the nominal energy of an event, in MeV.}. Scintillating bolometers are outstanding devices for the investigation of rare nuclear processes such as the 4-fold forbidden $\beta^-$ decay of $^{50}$V. In fact, they ensures high detection efficiency - the detector is made of the decay source - low background - using the double read-out heat and light - and excellent energy resolution over a wide energy range - at the level of permille. \subsection{Experimental set-up} A 22~g crystal of YVO$_4$ was enclosed in a high-purity Cu structure, following the same procedure adopted in~\cite{LiMoNe}, where the crystal is kept in position by means of PTFE clamps, which act also as heat sink for keeping the crystal at cryogenic temperature, as shown in Fig.~\ref{fig:setup}. The YVO$_4$ absorber is fully surrounded, except for the top face, by a VIKUITI-3M$^{\textregistered}$ reflecting foil, which guarantees an efficient light collection to the LD. \begin{figure}[h!] \centering \includegraphics[width=0.4\textwidth]{setup.pdf} \caption{Detector's set-up. The YVO$_4$ crystal is surrounded by VIKUITI-3M reflecting foil, except for its top side which is faced by a cryogenic Ge Light Detector. Light and heat signals are both read by means of two thermistors coupled on the absorbers. The whole structure is housed in a high purity copper structure. A permanent $^{55}$Fe source is mounted facing the LD for its energy calibration.} \label{fig:setup} \end{figure} The LD employed for the detection of the scintillation light produced in the YVO$_4$ crystal is a thin wafer of High-Purity Germanium operated as auxiliary bolometer in coincidence with the main crystal. More details on operation of LD's can be found in~\cite{LD_characterization}. Ge-NTD (Neutron Transmutation Doped) thermistors are used as thermal sensors for the measurement of the temperature rise induced by particle interactions in the absorbers. The signals are read from the voltage drop across the electrical connections on the thermistors. The YVO$_4$ and its LD were installed in a $^3$He/$^4$He dilution refrigerator at the underground Laboratori del Gran Sasso of INFN. This location guarantees a muon flux reduction of about a factor 10$^6$ compared to sea level. Reducing the particle flux that can interact with the experimental set-up is mandatory while operating bolometers due to their slow signal development of few seconds~\cite{muon}. To further reduce the rate of interactions in the absorber, the cryostat is shielded against natural radioactivity with 10~cm of low-radioactivity Pb (50~Bq/kg) and a multilayer of paraffin and borated polyethylene for the thermalization and absorption of high energy neutrons. The whole set-up is enclosed inside an anti-Radon box continuously flushed with boil-off N$_2$ gas. During the data taking the acquired signals are amplified by JFETs and then fed into a 6 poles low-pass Bessel filter, and finally recorded by an 18~bit NI-6284 PXI ADC unit. For more details on the electronics contribution on the detector performance, see~\cite{Zn82Se}. The YVO$_4$ absorber and the LD waveforms are sampled at 1~kHz frequency. The software trigger is set so that 250~ms and 125~ms long time-windows are acquired when it fires on the YVO$_4$ and on the LD respectively. Moreover when the trigger on the YVO$_4$ is fired, the corresponding waveform from the LD is always recorded, irrespectively of its trigger. This allows for an efficient synchronization of the heat and light signals~\cite{light_sync}. In Fig.~\ref{fig:pulso} is shown a standard $\beta$/$\gamma$ event on the YVO$_4$ crystal and its corresponding light signal acquired on the LD. The LD signal develops few ms before the one of the YVO$_4$, given the different heat capacities of the two systems, smaller for the LD and larger for the YVO$_4$. \begin{figure}[b] \centering \includegraphics[width=0.5\textwidth]{pulso.pdf} \caption{Synchronization of heat and light signals induced by a $\beta$/$\gamma$ event. The pulse with the dashed line is acquired on the YVO$_4$ detector, while the one with a solid line is the corresponding scintillation light signal detected on the LD. The two pulses have different acquisition time-windows.} \label{fig:pulso} \end{figure} \section{Data Processing and Analysis} A first level of analysis is performed on the acquired data, over more than 120~h of background and calibration runs. This consists in filtering the triggered pulses by means of the Optimum Filter technique~\cite{OF}, which maximizes the signal-to-noise ratio analysing the characteristic frequency of the acquired pulses and of the noise. The role of the filter is to weigh the frequency components of the signal in order to suppress those frequencies that are more affected by noise. Once the optimal signal amplitude is estimated, the gain instabilities of the detector are corrected. This procedure is carried out exploiting the fixed energy reference thermal pulses produced on the detector by means of the heater resistor coupled to the absorbers. The last operation performed in this first-level analysis is the conversion of the stabilized optimal amplitudes into the corresponding energy values. During the data taking, specially designed $^{232}$Th sources were inserted in the cryogenic system for calibrating the detector energy response. The LD, due to their small mass, is calibrated by means of permanent X-rays $^{55}$Fe source facing the Ge wafer. The energy spectra for the two detectors are composed by events which passed two classes of data selection. The first one is meant to exclude excess of noise from the data analysis (e.g. external electromagnetic interferences or irreducible mechanical vibrations of the system). The second cut selects only particle-induced events rejecting non-physical triggered data (e.g. electronic spikes). This selection is performed through a pulse-shape analysis, comparing template pulses with the acquired ones. In Table~\ref{tab:eff} are reported the efficiencies for the pulse-shape data selection cuts and the pile-up rejection efficiency. The low efficiency on the pulse shape cuts is mainly due to the high count rate of the detector which is evaluated to be about 120~mHz. The efficiencies are computed following the same procedure adopted in~\cite{pbwo4}. \begin{table} \begin{center} \caption{Data selection efficiencies for the main $\alpha$ peaks: pulse-shape cut, pile-up rejection and total efficiency.} \begin{tabular}{lcccc} \hline\noalign{\smallskip} Nuclide & Q-value & $\epsilon_{PS}$ & $\epsilon_{Pile-up}$ & $\epsilon_{TOT}$ \\ \noalign{\smallskip}\hline\noalign{\smallskip} $^{232}$Th & 4082~keV & 0.44$\pm$0.01 & 0.97$\pm$0.01 & 0.43$\pm$0.02 \\ $^{238}$U & 4270~keV & 0.45$\pm$0.01 & 0.97$\pm$0.01 & 0.44$\pm$0.02 \\ $^{234}$U & 4858~keV & 0.46$\pm$0.01 & 0.97$\pm$0.01 & 0.45$\pm$0.02 \\ $^{226}$Ra & 4871~keV & 0.40$\pm$0.02 & 0.97$\pm$0.01 & 0.39$\pm$0.02 \\ $^{210}$Po & 5407~keV & 0.43$\pm$0.02 & 0.97$\pm$0.01 & 0.42$\pm$0.02 \\ $^{235}$U & 4678~keV & 0.33$\pm$0.02 & 0.97$\pm$0.01 & 0.32$\pm$0.02 \\ $^{147}$Sm & 2516~keV & 0.47$\pm$0.02 & 0.97$\pm$0.01 & 0.46$\pm$0.02 \\ \noalign{\smallskip}\hline \end{tabular} \label{tab:eff} \end{center} \end{table} \section{Detector perfomance} The detector bolometric performance parameters are reported in Tab.~\ref{tab:bolo}. The FWHM$_{0keV}$ represents the noise fluctuation at the filtered output, which is mainly caused by microphonic noise of the cryogenic infrastructure. It does not depend on the absolute signal amplitude. The rise ($\tau_{rise}$) and decay ($\tau_{decay}$) times are computed as the time interval between the 10\% and 90\% of the leading edge of the pulse amplitude and as the 90\% and 30\% of the trailing part of the pulse amplitude, respectively. The large signal amplitude and the fast time response of the crystal makes it a good candidate for cryogenic operation. \begin{table} \begin{center} \caption{Bolometric performance of the detector set-up: YVO$_4$ and Light Detector. The signal amplitude refers to the sensitivity of the detectors, the FWHM$_{0keV}$ to the baseline energy resolution. $\tau_{rise/decay}$ are the rise time and decay time computed as the time interval between the 10\% and 90\% of the leading edge of the pulse amplitude and as the 90\% and 30\% of the trailing part of the pulse amplitude, respectively. } \begin{tabular}{lcccc} \hline\noalign{\smallskip} Crystal & Signal Amplitude & FWHM$_{0keV}$ & $\tau_{rise}$ & $\tau_{decay}$ \\ & [$\mu$V/MeV]& [keV] & [ms] & [ms]\\ \noalign{\smallskip}\hline\noalign{\smallskip} YVO$_4$ & 215 & 1.22 & 6 & 25 \\ LD & 770 & 0.19 & 3 & 10\\ \noalign{\smallskip}\hline \end{tabular} \label{tab:bolo} \end{center} \end{table} The data acquired during the entire 115~h of the background run are shown in Fig.~\ref{fig:scatter}. Each point in the plot represents an event occurring in the YVO$_4$ crystal and the corresponding induced light signal in the LD. We can identify clearly two bands, one produced by $\beta$/$\gamma$ interaction which extends from the energy threshold up to 2~MeV$_{\alpha}$ and one which extends to higher energies induced by $\alpha$ interactions. The first class of event is mostly induced by the external $^{232}$Th sources and it is characterized by: \begin{equation} LY_{\beta/\gamma}~=~59.4\pm0.1~keV/MeV. \end{equation} About 6~\% of the energy deposited in the crystal is detected as light signal. The fraction of energy converted into light in similar set-ups of other low temperature scintillating bolometers is ca. 8\% for CsI~\cite{CsI} , ca. 2\% for ZnWO$_4$~\cite{ZWO}, ca. 1\% for BGO~\cite{BGO}, demonstrating that this compound has a light output comparable to other well-established scintillating compounds. We also compute the LY for $\alpha$ interacting particle. In order to evaluate this parameter we take advantage of the internal $\alpha$ contamination of the crystal. The LY$_{\alpha}$ ranges from 8.9$\pm$0.4~keV/MeV for $^{147}$Sm to 11.6$\pm$0.1~keV/MeV for $^{234}$U. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{scatterz.pdf} \caption{Energy scatter plot Heat vs. Light. The X-axis shows the energy released in the YVO$_4$ absorber and it is energy-calibrated using the internal $\alpha$ radioactive contamination, while the Y-axis shows the light signal induced in the Light Detector.} \label{fig:scatter} \end{figure} Unfortunately, the small dimensions of the crystal, together with the low intensity of the $^{232}$Th calibration source did not allow us to properly calibrate the $\beta/\gamma$ energy spectrum. For this reason we decided to deploy a $^{137}$Cs $\gamma$ source with higher activity and with lower energy to enhance the detection efficiency for its full-energy photoelectric-peak at 661~keV. In Fig.~\ref{fig:Cs}, we show the energy scatter plot for the $^{137}$Cs calibration run, which lasted 2.5~hours. We measure a FWHM energy resolution at 661~keV of 9$\pm$2~keV. \begin{figure}[h] \centering \includegraphics[width=0.5\textwidth]{cs_all.pdf} \caption{Calibration energy scatter plot with a $^{137}$Cs source. In the inset is shown a histogram energy spectrum of $\beta/\gamma$ events produced by the source, in particular the characteristic $\gamma$-line at 661~keV.} \label{fig:Cs} \end{figure} The $\alpha$-band in Fig.~\ref{fig:scatter}, in concurrence with Birk's law~\cite{Birks}, has a lower LY compared to the $\beta$/$\gamma$ one. The events in this band are uniquely ascribed to $\alpha$ decays occurring on the detector surface and in the bulk, which produce respectively a continuum of events and some peaks~\cite{sticking}. This energy region is favourable for studying the detector internal radiopurity, because we can benefit from the advantageous signal-to-noise ratio compared to the $\beta$/$\gamma$ region, where the background induced by external $\beta$/$\gamma$ interactions is higher. We select the $\alpha$ band by applying a single cut on the LY$<$20~keV/MeV with an efficiency in rejecting $\beta$/$\gamma$ events $>$~99\%. In Fig.~\ref{fig:alpha} the $\alpha$ energy spectrum of the selected events is shown. The energy scale is calibrated using the known energies of the peaks in the spectrum.\\ \begin{figure}[t] \centering \includegraphics[width=0.5\textwidth]{alpha2.pdf} \caption{YVO$_4$ alpha energy spectrum after applying all cuts for event selection for 115~h of effective data taking. The most relevant peaks are produced by internal radioactive contaminations, i.e. natural radioactivity of $^{232}$Th and $^{238/235}$U.} \label{fig:alpha} \end{figure} In Table~\ref{tab:cont} the internal radioactive contaminations of the crystal are reported. These values are computed by analysing the various $\alpha$ peaks of the energy spectrum shown in Fig.~\ref{fig:alpha}. The high counting rate of the crystal is mainly caused by the rather high U content, both in $^{238}$U and $^{235}$U. If we assume that U is present in the crystal with the natural isotopic abundance~\cite{bohlke2005} ($^{235}$U~:~$^{238}$U = 0.72\%~:~99.27\%) we would expect to measure an activity ratio $^{235}$U/$^{238}$U of 0.046, while the value obtained from the measured activity of the crystal is 0.020. This hints towards a depleted $^{235}$U contamination, which seems to be reasonable according to~\cite{Vanadium}. In fact Vanadium is mostly available on the Earth crust in the form of a carnotite mineral (K$_2$(UO$_2$)$_2$(VO$_4$)$_2$) in Uranium ores. We may speculate that the raw materials used for the crystal production come from U extraction from rocks, and in particular from the enrichment process of $^{235}$U. The detector shows also a sizeable $^{147}$Sm contamination of 2.3$\pm$0.5~mBq/kg. This is most probably ascribed to its chemical affinity with Y. \begin{table}[htp] \caption{Evaluated internal radioactive contaminations for the YVO$_4$ crystal from $\alpha$ and $\gamma$ spectroscopy, with a bolometric and HP-Ge measurement respectively. Limits evaluated for $^{40}$K, $^{137}$Cs, $^{60}$Co and $^{88}$Y have to be considered as off February 2014. These are evaluated at 90\% C.L.} \begin{center} \begin{tabular}{lccc} \hline\noalign{\smallskip} Chain & Nuclide & Activity & Activity \\ & & [mBq/kg] & [mBq/kg]\\ \noalign{\smallskip}\hline\noalign{\smallskip} & & Bolometer & HP-Ge\\ \hline $^{232}$Th & \\ & $^{232}$Th & 8$\pm$1 & - \\ & $^{228}$Ra &- & $<$12 \\ & $^{228}$Th&- & $<$10 \\ \noalign{\smallskip}\hline\noalign{\smallskip} $^{238}$U & \\ & $^{238}$U & 1373$\pm$2 & - \\ & $^{234}$Th&- & 1600$\pm$400 \\ & $^{234m}$Pa&- & 1200$\pm$500 \\ & $^{234}$U & 1351$\pm$2 & - \\ & $^{226}$Ra & 5$\pm$1 & $<$12\\ & $^{210}$Po & 5$\pm$1 & - \\ \noalign{\smallskip}\hline\noalign{\smallskip} $^{235}$U & \\ & $^{235}$U & 56$\pm$5 & 100$\pm$30 \\ \noalign{\smallskip}\hline\noalign{\smallskip} & $^{147}$Sm&2.3$\pm$0.5 & - \\ \noalign{\smallskip}\hline\noalign{\smallskip} & $^{40}$K&- & $<$220 \\ \noalign{\smallskip}\hline\noalign{\smallskip} & $^{137}$Cs &-& $<$8.6 \\ \noalign{\smallskip}\hline\noalign{\smallskip} & $^{60}$Co&- & $<$22 \\ \noalign{\smallskip}\hline\noalign{\smallskip} & $^{88}$Y&- & $<$7.4 \\ \noalign{\smallskip}\hline\noalign{\smallskip} \end{tabular} \label{tab:cont} \end{center} \end{table} Furthermore a $\gamma$ spectrometric analysis of the YVO$_4$ crystal was performed to evaluate the presence of other radionuclide, which could not be easily investigated with a bolometric measurement, i.e. $\beta$-$\gamma$ cascades. We would like to mention that the evaluation on the concentration of U and Th radionuclides using $\gamma$ spectroscopy was in agreement with the one measured by the bolometric measurement The measurement was carried out at the STELLA (SubTerranean Low Level Assay) facility at LNGS. The YVO$_4$ sample was placed directly on the end-cap of a ultra-low-background High-Purity Germanium (HP-Ge) detector. A coaxial p-type Ge detector was used with an active volume of about 450 cm$^3$, and a relative efficiency of 120\%. The detector end-cap is made of a thin Cu window of 1~mm thickness. The detector is surrounded by 25~cm of low-radioactivity lead, 5~cm of copper, and in the inner part of the set-up by few cm of ancient lead. Finally, the shielding are housed in an acrylic box continuously flushed by boil-off N$_2$ gas. The activity of the investigated radionuclides are reported in Table~\ref{tab:cont}. These were evaluated during a measurement time of 208~h. \section{Constraints on the development of a bolometric detector for $^{50}$V $\beta^-$ decay investigations} The expected signals induced by $^{50}$V decay in the YVO$_4$ bolometer are two, as shown in Fig.~\ref{fig:scheme}. The first one is due to the electron capture decay and it is expected to produce a monochromatic line at 1153~keV. On the other side the $\beta^-$ decay, never observed, would induce a continuum of events which extends up to 1038~keV. The decay on the 2$^+$ state will consequently de-excite by a prompt emission, after 8~psec, of a 783~keV $\gamma$ quantum. Most of the $\beta/\gamma$ natural radioactivity ($^{235/238}$U and $^{232}$Th) induce an overwhelming background in the region of interest, as it is the case of the measurement described in this work, thus limiting the sensitivity to the rare decay investigation. In a single YVO$_4$ bolometric detector the $\beta^-$ decay and the de-excitation $\gamma$ will pile-up without inducing a peaking signal. This is caused by the extremely poor time resolution for disentangling the $\beta$-$\gamma$ cascade, for this reason we propose an innovative experimental set-up for the detection of the characteristic 783~keV $\gamma$ quantum, as shown in Fig.~\ref{fig:new}. A YVO$_4$ crystal is operated together with a LD as scintillating bolometer for the identification of $\beta$/$\gamma$ events. Simultaneously a massive high quality crystal, like a TeO$_2$, is operated as bolometric veto. In this configuration the $\beta^-$ decay in the YVO$_4$ acts as a trigger for the TeO$_2$ detector that has to absorb the 783~keV $\gamma$ quantum. We take advantage of the different mean-free path of the $\beta$ and $\gamma$ in the detector source. TeO$_2$ crystal is the best choice as external veto detector given its high radiopurity~\cite{TeO2_2vDBD}, excellent energy resolution~\cite{CUORE-0_detector} and availability of massive size~\cite{TeO2_massive}. \begin{figure}[h] \centering \includegraphics[width=0.4\textwidth]{new.pdf} \caption{Schematic view of a triple-coincidence detector for the positive tagging of $^{50}$V $\beta$/$\gamma$ decay. Any $\beta$ decay in the YVO$_4$ crystal can be identified by means of the heat-light read-out. When the event produced is a $\beta$, then a veto window is open the acquisition of the external veto bolometer which will help in identifying the escaping 783~keV $\gamma$ quantum produced in the $^{50}$Cr de-excitation.} \label{fig:new} \end{figure} We ran a MonteCarlo simulation where the experimental set-up is the same shown in Fig.~\ref{fig:new}, where the YVO$_4$ crystal has the same dimensions as the crystal described in this work and the TeO$_2$ crystal is a cube with side of 10~cm. We generate the $\beta/\gamma$ cascade in the YVO$_4$ crystal and we evaluate the detection efficiency of the expected signals. About 90\% of the simulated $\beta$ events will be confined in the YVO$_4$ crystal without inducing a signal in the TeO$_2$ veto, while the detection efficiency of the 783~keV $\gamma$ in the TeO$_2$ is about 40\%. These values hint towards a feasibility of the detection of the $^{50}$V $\beta^-$ decay observation with this innovative experimental set-up. Nevertheless a thorough assay of radiopure raw materials for the production of high purity YVO$_4$ crystals has to be carried out in order to perform a highly sensitive investigation of the 4-fold forbidden decay. In fact, crystals available on the market, as the one operated in this work do not meet the requirements for such studies. The high internal $^{235/238}$U and $^{232}$Th concentration underline the need for the development of purification techniques of raw materials for the growth of radiopure YVO$_4$ crystals. Innovative purification procedures are currently under development~\cite{serge}. One of the most promising technique is electron-beam melting that is able to reduce by a factor 10 and 100, respectively for U and Th contaminations, in a Vanadium metal sample. \section{Conclusions} We operated for the first time a YVO$_4$ as a cryogenic scintillating bolometer, it showed great bolometric performance and an excellent light output. On the other hand the radiopurity of the detector is compromised by a high $^{235/238}$U concentration which currently limits its sensitivity for the the investigation of the $^{50}$V $\beta^-$ decay branch. Currently cutting-edge technologies developed for the purification of raw materials for the production of radiopure YVO$_4$ crystals, which may help in suppressing the background induced by natural radioactivity. We propose an innovative approach for an efficient detection of the characteristic de-excitation $\gamma$ following $^{50}$V $\beta^-$ decay using a triple-coincidence system. Preliminary MonteCarlo simulations demonstrate the feasibility of such a technique.
\section{Introduction} The NASA \emph{K2} mission \citep{Howell2014} is in its third year of surveying the ecliptic plane. The mission uses the repurposed \emph{Kepler Space Telescope} to tile the ecliptic, and consists of successive $\sim$80-day observations of 12$\times$12 degree regions of sky known as campaigns. Each campaign yields high-precision, high-cadence calibrated pixel files and time-series photometry on anywhere from 13,000 to 28,000 targets, which are released to the public within three months of the end of the observing campaign. This deluge of data is immediately inspected by professional exoplanet hunters, producing rapid announcements of interesting new planetary systems, e.g. the recent examples of HD~106315 \citep{Crossfield2017,Rodriguez2017} and HD~3167 \citep{Vanderburg2016}. There are many features in time-series data which can be matched to potential transit signals by signal-processing algorithms. These features can be either astrophysical in origin (e.g. pulsating variable stars, eclipsing binaries, flaring stars, cosmic-ray pixel strikes), or instrumental (e.g. apparent variations in the brightness in a photometric aperture caused by spacecraft pointing drift, or by focus drifts in response to the changing thermal environment). While these artifacts can confuse automated procedures, the human brain is optimised for pattern matching, and is remarkably good at discriminating these artifacts from a train of planet transits. This ability is exploited in information security technology for instance, with the CAPTCHA algorithm \citep{vonAhn2003} being a well-known example. In light curve analysis, humans can readily recognise the differences in the underlying phenomena causing the putative signals and identify the transit signals. This ability, along with the strong interest held by the public in being involved in the process of scientific discovery, has led to the ongoing success of the Planet Hunters\footnote{\url{www.planethunters.org}} project \citep[e.g.][]{Fischer2012}. Hosted by the Zooniverse platform \citep{Lintott2008}, the project displays to users the publicly available \emph{Kepler} and \emph{K2} time series photometry, and asks them to identify transit-like dips. Inspired by their success, we started the Exoplanet Explorers\footnote{\url{www.exoplanetexplorers.org}} project in April 2017. In this project we run a signal detection algorithm to identify potential transit signals in the \emph{K2} time series photometry, and ask the users to sift through the resulting candidates to identify those most closely resembling planetary transits. Here we present K2-138, the first \emph{K2} planetary system discovered by citizen scientists. In Section \ref{sec:obs}, we describe the \emph{K2} data set. We describe the Exoplanet Explorers project and the identification of K2-138 in Section \ref{sec:results}, and the derivation of the stellar parameters in Section \ref{sec:stellar}. In Section \ref{sec:parameters} we describe the analysis of the planet parameters. Finally, in Section \ref{sec:disc} we place the K2-138 system in context of other high-multiplicity systems and discuss prospects for future characterisation. \section{Observations and Photometric Reduction} \label{sec:obs} \begin{figure} \plotone{zooniverse_b.pdf} \plotone{zooniverse_c.pdf} \plotone{zooniverse_d.pdf} \plotone{zooniverse_e.pdf} \caption{The set of diagnostic plots presented on the Exoplanet Explorers project, for the target K2-138. From top to bottom the four plots are for the putative signals for K2-138 c, d, e, and f. In each case, the left panel shows the individual transit events, with an arbitrary vertical offset and alternating color for visual clarity. The top right panel shows the entire light curve folded at the period of the putative transit signal. The black points are the original \emph{K2} data, and the yellow circles are binned data. The bottom right panel shows the same phase-folded light curve, zoomed in on the transit event itself. An initial fitted planet model is overlaid in blue. \label{fig:zooniverse}} \end{figure} \emph{K2} data are downlinked from the spacecraft, processed into calibrated pixel files and photometric time series, and released to the public via the Mikulski Archive for Space Telescopes (MAST)\footnote{\url{https://archive.stsci.edu/kepler/}}. Unlike the original \emph{Kepler} mission, the target list is entirely guest observer driven: all observed targets are proposed to the project by the community. Campaign 12 (C12), which was observed for 79 days from 2016 December 15 to 2017 March 4, contained the target star TRAPPIST-1 \citep{Gillon2016,Gillon2017,Luger2017,Wang2017}. In order to facilitate rapid analysis of the \emph{K2} observations of TRAPPIST-1, the data were released to the public immediately after downlink from the spacecraft on 2017 March 9 as raw pixel files. We downloaded the raw pixel files from MAST for the stellar targets that were proposed by K2's large exoplanet search programs, and calibrated these data using the \texttt{kadenza} software \citep{Barentsen2017}, generating calibrated pixel files. We then used the publicly available \texttt{k2phot} photometry code\footnote{\url{https://github.com/petigura/k2phot}}, which generates aperture photometry and performs corrections for the spacecraft pointing jitter using Gaussian Processes \citep{Rasmussen2005}, to generate light curves suitable for searching for periodic transit signals. Using the publicly available TERRA algorithm\footnote{\url{https://github.com/petigura/terra}} \citep{Petigura2013a,Petigura2013b}, we generated both a list of potential transiting planet signals from the detrended light curves, and a set of accompanying diagnostic plots. TERRA identified a total of 4,900 candidate transit signals in the C12 stellar data. \section{Transit Identification} \label{sec:results} For each signal from C12 and the earlier campaigns already processed, we uploaded a subset of the standard TERRA diagnostic plots to the Exoplanet Explorers project. The plots included a phase-folded light curve and a stack of the individual transit events; users examined these plots and selected whether the putative signal looked like a true transiting planet candidate. Figure \ref{fig:zooniverse} shows an example set of diagnostic plots. On 2017 April 4, the Exoplanet Explorers project was featured on the Stargazing Live ABC broadcast in Australia. Between April 4, 2017 01:00 UTC and April 6, 2017 19:48 UTC, the live project received 2,100,643 classifications from 7,270 registered Zooniverse classifiers and 7,677 not-logged-in IP addresses. Of these, 130,365 classifications from 4,325 registered classifiers and 2,012 not-logged-in IP addresses were for candidate signals in the C12 data. C12 candidates received a median of 26 classifications each; the C12 candidate with the lowest classification count received 14 classifications, and the most-classified C12 candidate received 43 classifications. The classifications were aggregated for each candidate to provide the fraction of classifiers who indicated they saw a transiting planet signal. \begin{figure} \epsscale{1.15} \plotone{c12_dispositions.pdf} \caption{The distribution of user votes on the C12 candidate transiting planet signals. All signals received 14 or more votes, and the percentage of `yes' votes is shown: the small blue dots represent signals for which fewer than 60\% of users voted `yes'. The green stars, yellow $+$ symbols and red circles show signals for which greater than 60\%, 75\% and 90\% of users voted `yes'. \label{fig:dispositions}} \end{figure} Of the 4,900 potential transiting signals identified in the C12 data, 72 were voted by more than 60\% of users as looking like transiting planet candidates. The dispositions of the full set of C12 signals are shown in Figure \ref{fig:dispositions}; the signals with the highest confidence are unsurprisingly at shorter periods (with a higher number of individual events contributing to the signal for the users to assess) and higher signal-to-noise values. The highly voted signals were inspected visually and K2-138\ (EPIC~245950175) was rapidly identified as a promising multi-planet system. The initial automated search of the light curve produced four distinct transiting signatures, each with a high ($>$90\%) fraction of votes from the participants; the four diagnostic plots that were voted on are shown in Figure \ref{fig:zooniverse}. EPIC~245950175 was proposed for observations by four teams, in Guest Observing Programs 12049, 12071, 12083, and 12122 (PIs Quintana, Charbonneau, Jensen, and Howard). The full, unfolded light curve of K2-138\ is shown in Figure \ref{fig:lc}. After the system was flagged by the citizen scientists, additional examination of the light curve revealed the signature of a fifth transiting signal, interior to the four signals identified by the TERRA algorithm and on the same 3:2 resonant chain. Characterisation of the five detected planet signals is detailed in Section \ref{sec:parameters}. In addition, two individual transit events were identified, shown in Figure \ref{fig:candidate}, separated by 41.97 days. The transits have consistent depths and durations, and if confirmed, would correspond to an additional $\sim$2.8R$_{\oplus}$ sub-Neptune planet in the K2-138\ system, bringing the total to six planets. Additional observations are required to secure a third epoch and confirm that the two transits seen in the \emph{K2} data arise from a single planet, and are not individual transits of two similarly-sized, longer-period planets. \begin{figure} \epsscale{1.25} \plotone{quadsuperaqua_candidate.pdf} \caption{The two transits of the putative 42-day period planet candidate that fall in the \emph{K2} C12 data. The time of the second transit has been offset by 41.97 days to demonstrate the consistency in depth and duration of the two events, which correspond to a $\sim$2.8R$_{\oplus}$ planet. \label{fig:candidate}} \end{figure} \begin{figure*} \plotone{timeseries.pdf} \caption{The time series of the K2 data, with the five-planet transit model shown in blue. The planets of the individual transits are marked with the appropriate letter; the times of the two transits of the putative planet candidate discussed in Section \ref{sec:results} are shown as `g'. The 5-day gap two-thirds of the way through the campaign was the result of a spacecraft safe-mode event. \label{fig:lc}} \end{figure*} \section{Stellar Characterisation} \label{sec:stellar} On 2017 June 1 we obtained a spectrum of K2-138\ using Keck/HIRES, without the iodine cell as is typical of the precision radial velocity observations. We derive stellar parameters using SpecMatch \citep{Petigura2015}, given in Table \ref{tab:stellar}. Following the procedure in \citet{Crossfield2016}, we estimate the stellar radius and mass using the publicly available {\texttt isochrones} Python package \citep{Morton2015} and the Dartmouth stellar evolution models \citep{Dotter2008}. The California Kepler Survey \citep[CKS;][]{Petigura2017} finds mass and radius uncertainty floors for similar spectral types of 6\% and 9\% respectively, motivated by comparisons between stellar radii derived using \texttt{isochrones} and spectroscopic parameters (as is done here for K2-138) and asteroseismic radii \citep{Johnson2017}. We therefore adopt these uncertainties on the mass and radius of K2-138\ to incorporate the isochrone model uncertainties. Additional estimates of the parameters of K2-138\ are available in the Ecliptic Plane Input Catalog \citep[EPIC,][]{Huber2016} on the MAST and are consistent with those from the RAVE spectrum and \texttt{isochrones}. The HIRES/\texttt{isochrones} parameters and the EPIC parameters are consistent with a solar-metallicity, main-sequence, early-K type star at a distance of $\sim$180 pc when comparing to the color-temperature relations of \citet{Pecaut2013}. We adopt a spectral type of K1V~$\pm$~1. We measure a log~$R\prime_{HK}$ value of $-4.63$, indicating a modestly magnetically active star, which may present a challenge for precision radial velocity measurements of the system.\\ On 2017 May 31 we obtained a high-resolution image of K2-138\ in $K$-band using the Altair AO system on the NIRI camera at Gemini Observatory \citep{Hodapp2003} under program GN-2105B-LP-5 (PI Crossfield). We observed at five dither positions, and used the dithered images to remove sky background and dark current; we then aligned, flat-fielded and stacked the individual images. The inset in Figure \ref{fig:ao} shows the final stacked image, and the plot shows the detection limits of the final image. The limits were determined by injecting simulated sources into the final image, with separation from K2-138\ determined by integer multiples of the FWHM, as in \citet{Furlan2017}. We see no other source of contaminating flux in the AO image within 4$^{\prime\prime}$, the size of one \emph{K2} pixel. In addition to the AO data, we examine the HIRES spectrum for evidence of additional stellar lines, following the procedure of \citet{Crossfield2016}. This method is sensitive to secondary stars that lie within 0.4$^{\prime\prime}$ of the primary star (one half of the slit width) and that are up to 5 magnitudes fainter than the primary star in the $V$- and $R$-bands \citep{Kolbl2015}, complementing the sensitivity limits of the NIRI observations. We are able to rule out companions with T$_{\rm{eff}}$ = 3400--6100 K and $\Delta$(RV)$>$10 kms$^{-1}$. We further discuss the possibility of the observed periodic signals originating from a faint star $\sim$14$^{\prime\prime}$ away in Section \ref{sec:validation}, but for the following analysis we assume the putative planet signals arise from K2-138.\\ \begin{figure} \epsscale{1.0} \plotone{245950175I-dc20170531K_plot.pdf} \caption{\emph{Inset:} The Gemini/NIRI AO image of K2-138. We detect no additional sources of flux. \emph{Plot:} The 5-$\sigma$ contrast limits for additional companions, in $\Delta$magnitude, are plotted against angular separation in arcseconds; the black points represent one step in the FWHM resolution of the images.\label{fig:ao}} \end{figure} \begin{table} \footnotesize \begin{center} \caption{K2-138\ stellar parameters \label{tab:stellar}} \begin{tabular}{ll} \hline EPIC ID & 245950175\\ 2MASS ID & J23154776-1050590 \\ RA (J2000.0) & 23:15:47.77 \\ Dec (J2000.0) & -10:50:58.91 \\ $V$ (mag) & 12.21 \\ $K$ (mag) & 10.305 \\ Spectral type & K1V $\pm$ 1\\ T$_{\rm{eff}}$ (K) & 5378 $\pm$ 60\\ log $g$ (cgs) & 4.59 $\pm$ 0.07 \\ \lbrack Fe/H\rbrack & 0.16 $\pm$ 0.04 \\ R$_\star$ (R$_{\odot}$) & 0.86 $\pm$ 0.08\\ M$_\star$ (M$_{\odot}$) & 0.93 $\pm$ 0.06\\ Distance (pc)\footnote{EPIC classification, see \citet{Huber2016} and \texttt{https://github.com/danxhuber/galclassify} } & 183 $\pm$ 17 \\ $v$ sin $i$ (km/s) & 2.7 $\pm$ 1.5 \\ \tableline \end{tabular} \end{center} \end{table} \section{Planet Parameters} \label{sec:parameters} We analyzed the five transit signals independently in the K2-138\ light curve, using the same modeling, fitting, and MCMC procedures as described in \citet{Crossfield2016}. In summary, we fit the following model parameters: mid-transit time (T$_0$); the candidate’s orbital period and inclination (P and i); the scaled semimajor axis (R$_p$/a); the fractional candidate size (R$_*$/a); the orbital eccentricity and longitude of periastron (e and $\omega$), the fractional level of dilution ($\delta$) from any other sources in the aperture; a single multiplicative offset for the absolute flux level; and quadratic limb-darkening coefficients (u1 and u2). We explore the posterior distribution using the \texttt{emcee} software \citep{Foreman2013}. We find that the signals correspond to five sub-Neptune-sized planets ranging from 1.6--3.3R$_{\oplus}$; the best fitting transit models are shown in Figure~\ref{fig:transitmodel}. As a self-consistency check, we note that the stellar density values derived from the independent transit fits are consistent across all five planets, and also consistent with the direct calculation from the stellar mass and radius.\\ \begin{figure} \epsscale{1.0} \plotone{EE1-transits_f.pdf} \caption{The folded transits of K2-138\ b, c, d, e, and f overplotted with the best fitting transit model in red. Binned data points are shown in blue. The planets range in size from 1.57 to 3.29 R$_{\oplus}$. \label{fig:transitmodel}} \end{figure} All five planets have periods under 13 days, making K2-138\ an example of a tightly-packed system of small planets. One particularly interesting aspect to the K2-138\ architecture, discussed further in Section \ref{sec:disc}, is that each successive pair of planets is just outside the first-order 3:2 resonance. \subsection{Validation} \label{sec:validation} \citet{Lissauer2012} analysed the distribution of \emph{Kepler} planet candidates and showed that systems with multiple candidate signals were substantially more likely to be true planetary systems than false positives. This provides a `multiplicity boost' to the statistical validation of candidates in multi-planet systems. Here, we validated each candidate individually using the publicly available \texttt{vespa} code\footnote{\url{https://github.com/timothydmorton/VESPA}}, which computes the likelihood of various astrophysical false positive scenarios. We use as input a photometric exclusion radius of 13$^{\prime\prime}$, the $K$-band and \emph{Kepler} magnitudes, and the HIRES stellar parameters. The results are false positive probabilities of 0.20\%, 0.11\%, 0.76\%, 0.027\%, and 0.24\% for planets b, c, d, e, and f respectively. Since we have multiple candidates orbiting a single star, the `multiplicity boost' (and an additional `near-resonance boost') further suppresses these FPPs \citep{Lissauer2012,Sinukoff2016}. Applying the \emph{K2} multiplicity boost derived by \citet{Sinukoff2016}, we find final FPPs of 8.3$\times 10^{-5}$, 4.6$\times 10^{-5}$, 3.17$\times 10^{-4}$, 1.1$\times 10^{-5}$, and 1.0$\times 10^{-4}$. Recently, \citet{Cabrera2017} showed that stars within the \emph{Kepler} photometry aperture but outside the small area surveyed by high-resolution imaging were responsible for several falsely validated planets. Here we examine the possibility that the five periodic signals do not arise from the brightest star in the \emph{K2} aperture. Given that the signals form an unbroken chain of near first-order resonances, we consider the possibility that some number of the signals arise on one star and the remainder on a star coincident with the line of sight to be unlikely, and consider the five signals as a related set. The brightest nearby star is 2MASS~J23154868-1050583, which is $\sim$14$^{\prime\prime}$ from EPIC~245950175, and 5.6 magnitudes fainter in $R$-band. This star is shown to the west of EPIC~245950175 in Figure \ref{fig:finderchart}. Following from Eq. (5) of \citet{Ciardi2015}, we find that the putative planets would be 13.2 times larger if they orbited the fainter target, increasing to 1.9--4.0 R$_{\rm{J}}$. These would be as large or larger than the largest planet known to date with a radius measured by the transit method, WASP-79b with a radius of 2.09$\pm$0.14 R$_{\rm{J}}$ \citep{Smalley2012}. Therefore we conclude that the five putative planets are extremely unlikely to orbit 2MASS~J23154868-1050583. \begin{figure} \plotone{finderchart.pdf} \caption{A 60$\times$60 arcsecond image from the SDSS DR7 $r$-band. The companion to the west is $\sim$14 arcseconds away, and is 5.6 magnitudes fainter than EPIC 245950175 in $R$. \label{fig:finderchart}} \end{figure} \section{Discussion} \label{sec:disc} One of the interesting discoveries from the NASA \emph{Kepler} mission is the prevalence of compact, highly co-planar, and often dynamically packed systems of small ($<4R_\oplus$) planets \citep{Latham2011,Lissauer2011,Fabrycky2014,Howard2012,Winn2015}. This has continued in the \emph{K2} mission, including the discoveries of the K2-3 \citep{Crossfield2015}, K2-37 \citep{Sinukoff2016}, and K2-72 \citep{Crossfield2016} systems. Multi-planet systems are crucial laboratories for testing planetary formation, migration and evolution theories. A further interesting subset of these systems are those demonstrating resonances, or chains of resonances. The five validated planets of K2-138\ lie close to a first-order resonant chain. We find period ratios of 1.513, 1.518, 1.528 and 1.544 for the b-c, c-d, d-e, and e-f pairs respectively, just outside the 3:2 resonance. \citet{Fabrycky2014}, examining the large population of multi-transiting planet systems in the \emph{Kepler} data, showed that pair-wise period ratios pile-up just outside of the first- and second-order resonances. They offer several possible explanations for this, including gravitational scattering slightly out of resonance by the additional bodies in the system, or tidal dissipation preferentially acting to drag the inner planets inward from the resonance. \citet{Lithwick2012} and \citet{Batygin2013} investigate the suggestion of tidal dissipation as a mechanism for keeping individual pairs of planets just outward of the resonance; they note that in systems with more than two planets, where the planets can inhabit multiple resonances, the planets can remain close to resonance despite tidal dissipation. Recently, \citet{Ramos2017} analytically derived the expected offset from a first-order resonance for a pair of planets due to Type I migration. Their Fig. 3 shows that for periods shorter than $\sim$10 days, the resonance period ratio is 1.505--1.525, depending on the mass of the inner planet and the mass ratio of the two planets, with higher period ratios expected as the mass ratio approaches unity. Therefore it is possible that the K2-138\ b-c and c-d pairs may be captured in the 3:2 resonance, but unlikely that the d-e or e-f pairs are in resonance.\\ It is illustrative to compare K2-138\ to the other known systems with multiple planets, and to examine whether 3:2 period ratios are common. Figure \ref{fig:multisystems} shows, for the confirmed multi-planet systems, the distance of each period ratio in the system from a 3:2 period ratio. K2-138 is the only system with an unbroken chain of four period ratios near 3:2. There are seven systems with planets in consecutive 3:2 pairs: Kepler-23 \citep{Ford2012}; Kepler-85 and Kepler-114 \citep{Xie2013,Rowe2014}; Kepler-217 \citep{Rowe2014,Morton2016}; Kepler-339 and Kepler-402 \citep{Rowe2014}; and Kepler-350 \citep{Rowe2014,Xie2014}. There are an additional nine systems with a `broken' chain of 3:2 pairs, i.e. a configuration like K2-138 but where one planet is missing, or perhaps undiscovered: GJ 3293 \citep{Astudillo2015,Astudillo2017}; K2-32 \citep{Dai2016}; Kepler-192 and Kepler-304 \citep{Rowe2014,Morton2016}; Kepler-215, Kepler-254, Kepler-275 and Kepler-363 \citep{Rowe2014}; and Kepler-276 \citep{Rowe2014,Xie2014}. These systems are highlighted in red. A small number of systems contain four planets in different configurations of first order resonances, also highlighted in Figure \ref{fig:multisystems}. Kepler-223 is comparable to K2-138\ : a compact system of four sub-Neptune-sized planets with periods shorter than 20 days, in a 3:4:6:8 resonant chain \citep{Rowe2014,Mills2016}. In the case of Kepler-223, the period ratios are much closer to resonance than for K2-138, with ratios of 1.3333, 1.5021, and 1.3338 for the b-c, c-d, and d-e pairs respectively. Kepler-223 demonstrates significant transit timing variations, allowing for robust mass constraints to be placed. Kepler-79 \citep{Jontof-Hutter2014} is a scaled-up version of K2-138\ and Kepler-223, with four sub-Saturn-sized planets in a 1:2:4:6 resonant chain with periods from 13--81 days. Finally, the benchmark TRAPPIST-1 system hosts seven planets in a resonant chain, with successive period ratios of 8:5, 5:3, 3:2, 3:2, 4:3, and 3:2 \citep{Gillon2017,Luger2017}. Like TRAPPIST-1, K2-138\ may represent a pristine chain of resonances indicative of slow, inward disk migration. Another notable feature of the TRAPPIST-1 system is that the seven known planets form a complex chain of linked three-body Laplace resonances \citep{Luger2017}. Similarly, Kepler-80 (KOI-500) is a five-planet system where the four outer planets form a tightly linked pair of three-body resonances \citep{Lissauer2011,MacDonald2016}; Kepler-223, described above, also contains a pair of three-body resonances. One other system, Kepler-60, appears to be in either a true three-body Laplace resonance or a chain of two-planet mean motion resonances \citep{Gozd2016}. A three-body resonance satisfies the condition that $(p/P_1) - [(p+q)/P_2] + (q/P_3) \approx 0$, where $p$ and $q$ are integers and $P_i$ the period of the $i$th planet. For K2-138\, we find that the three consecutive sets of three planets (bcd, cde, and def) all satisfy this condition with $(p,q)=(2,3)$, resulting in values of 4.2$\pm$1.7$\times$10$^{-4}$ days$^{-1}$, $-1.6\pm$0.9$\times$10$^{-4}$ days$^{-1}$, and $-2.4\pm$4.9$\times$10$^{-4}$ days$^{-1}$ respectively, all close to zero. In simulating the Kepler-80 system, \citet{MacDonald2016} find that their migration simulations can naturally describe the final system architecture, with dissipative forces pushing the interlocked planets out of two-body resonances and into three-body resonances; the K2-138\ system may have undergone something similar. K2-138\ joins a relatively modest population of known systems with four or more planets in or close to a resonant chain, and a very small population of systems with interlocking chains of three-body resonances, making it an ideal target to study for transit timing variations. \begin{figure} \epsscale{1.15} \plotone{other-compact-multi-planet-systems-v2.pdf} \caption{The distribution of distances from 3:2 period ratios in confirmed multi-planet systems that have three or more planets in a compact geometry (defined as having three planets with Period/Shortest Period $<$ 4). Planetary systems with multiple near-3:2 resonances are highlighted in red. K2-138 is the only system near an unbroken chain of four near-3:2 resonances. Kepler-79 and Kepler-223 (shown in blue) both have four planets in or near a chain of resonances. The vertical lines indicate the positions of successive 3:2 period ratios. \label{fig:multisystems}} \end{figure} We calculated the transit times of K2-138\ c, d, e, and f shown in Figure \ref{fig:ttvs}. For each transit, we fix the model transit parameters to the best-fit values given in Table \ref{tab:planets}, and allow only the mid-transit time to vary. To calculate the uncertainties, we compute the residuals from the best-fit model and perform a bootstrap analysis using the closest 100 timestamps, re-fitting the mid-transit time at each timestamp permutation. \citep{Wall2003}. Examining the resulting transit times, we do not find evidence of significant variations at the level of the average 8--10 minute timing precision from the \emph{K2} data The individual transits of K2-138~b have insufficient signal-to-noise for robust transit time calculation. In order to estimate the amplitude of potential transit timing variations (TTVs), we use the mass-radius relation of \citet{Weiss2014} for planet radii in the range 1.5--4R$_{\oplus}$ ($M_p=2.69\times R_p^{0.93}$), predicting that the five planets have masses between 4--7$M_{\oplus}$. Near resonance, TTV amplitudes depend on planet masses, proximity to resonance, and orbital eccentricities. Using the \texttt{TTVFaster} code\footnote{\url{https://github.com/ericagol/TTVFaster}} \citep{Agol2016}, we estimate potential TTV amplitudes of 2.5, 5.1, 7.1, 6.9 and 4.8 minutes for planets b, c, d, e, and f respectively, assuming circular orbits; for eccentric orbits, these amplitudes could be higher. We can also estimate the `super-period' of the planets: when two planets are close to resonance, their transit timing variations evolve on a larger timescale referred to as the super-period. Using Equation 5 from \citep{Lithwick2012b}, we calculate super-periods of 139.4~d, 148.1~d, 144.7~d and 144.2~d for the b-c, c-d, d-e, and e-f pairs, respectively. The \emph{K2} observations span slightly more than half of this amount of time, but as shown the uncertainties on the measured transit times with the processed photometry are large enough to swamp the amplitude of the expected signal. However, with careful sampling over a longer observing baseline and higher precision photometry, the TTVs may be accessible. One possibility is the NASA \emph{Spitzer} telescope. For K2-18b, \citet{Benneke2017} measure a transit timing precision of $\sim$0.9 minutes with \emph{Spitzer}. Using the error approximation of \citet{Carter2008} and scaling for the properties of the K2-138\ planets, we estimate that \emph{Spitzer} would achieve transit timing precision of $\sim$2 minutes, which would be sufficient to measure the TTVs of the outer planets. Another possibility for measuring TTVs is the ESA CHEOPS mission \citep{Broeg2013}, although K2-138 ($V=12.2$, $K=10.3$) is at the faint end of their target range. \begin{figure} \epsscale{1.25} \plotone{quadsuperaqua_ttvs_4_bootstrap_nov9.pdf} \caption{Examining the transit times of K2-138 c, d, e, and f. There are no significant variations observed at the timing precision of the \emph{K2} 30-minute cadence observations. \label{fig:ttvs}} \end{figure} The empirical relation of \citet{Weiss2014} disguises a large scatter in the measured masses for planets ranging from 2--3R$_{\oplus}$, spanning nearly an order of magnitude from roughly 2--20$M_{\oplus}$ \citep[see Fig.~11 of][]{Christiansen2017}. This diversity is due to a wide, degenerate mix of rock, volatile and gas compositions that can comprise this size of planet. Although the K2-138\ planets do not demonstrate significant transit timing variations in the \emph{K2} data, their masses may be accessible to radial velocity observations. By comparing to the ensemble of mass-radius measurements to date, we estimate a minimum mass of $4 M_\oplus$ for the four outer planets, and therefore RV semi-amplitudes of $\gtrsim$2~m~s$^{-1}$. Achieving this precision on K2-138\ may be a challenge, given the aforementioned stellar activity level. If any of the planets are measured to be lower density, and therefore likely volatile rich (such as the resonant planets in Kepler-79), they may be interesting yet challenging prospects for atmosphere characterization, given the moderate brightness of the host star. \section{Conclusions} We have presented K2-138, the first discovery from the citizen scientists participating in the Exoplanet Explorers project. K2-138 is a compact system of five sub-Neptune-sized planets orbiting an early K star in a chain of successive near-first order resonances; in addition the planets are locked in a set of three-body Laplace resonances. The planets may be accessible to mass measurement via dedicated radial velocity monitoring, and possibly via transit timing variations with improved timing precision. The Exoplanet Explorers project has provided an additional 68 candidate planets from the C12 light curves which likely contain additional planet discoveries, and we plan to upload potential detections for consideration from the rest of the available \emph{K2} campaigns. \acknowledgments We thank the anonymous referee for thoughtful and detailed comments that improved the analysis presented in this paper. This project has been made possible by the contributions of approximately 14,000 volunteers in the Exoplanet Explorers project. The contributions of those volunteers who registered on the project are individually acknowledged at {\url{https://www.zooniverse.org/projects/ianc2/exoplanet-explorers/about/team}}. We thank production teams from the British and Australian Broadcasting Corporations as well as Fremantle Media for their help in including Exoplanet Explorers on the \textit{Stargazing Live} programs broadcast in April 2017. This paper includes data collected by the \emph{K2} mission. Funding for the \emph{K2} mission is provided by the NASA Science Mission directorate. This publication uses data generated via the \url{Zooniverse.org} platform, development of which is funded by generous support, including a Global Impact Award from Google, and by a grant from the Alfred P. Sloan Foundation. BDS acknowledges support from the National Aeronautics and Space Administration (NASA) through Einstein Postdoctoral Fellowship Award Number PF5-160143 issued by the Chandra X-ray Observatory Center, which is operated by the Smithsonian Astrophysical Observatory for and on behalf of NASA under contract NAS8-03060. This research has made use of the NASA/IPAC Infrared Science Archive, which is operated by the Jet Propulsion Laboratory, California Institute of Technology, under contract with the National Aeronautics and Space Administration. This research has also made use of the NASA Exoplanet Archive and the Exoplanet Follow-up Observation Program website, which are operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program. Funding for the SDSS and SDSS-II has been provided by the Alfred P. Sloan Foundation, the Participating Institutions, the National Science Foundation, the U.S. Department of Energy, the National Aeronautics and Space Administration, the Japanese Monbukagakusho, the Max Planck Society, and the Higher Education Funding Council for England. The SDSS Web Site is http://www.sdss.org/. \facility{Kepler, Keck:I (HIRES), Gemini:South (NIRI), Exoplanet Archive, IRSA, MAST, Sloan}
\section{Introduction and main results} \label{I} Let $\Delta_p u= \div( |\nabla u|^{p-2} \nabla u)$ denote the $p$-Laplacian operator. We consider, for any $1<p<\infty$, the boundary value problem \begin{equation} \label{Plambda} \tag{$P_{\lambda}$} \pLaplac u = \lambda c(x)|u|^{p-2}u + \mu(x)|\nabla u|^p + h(x)\,, \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation} under the assumptions \[\label{B10_i} \tag{$A_{0}$} \left \{ \begin{aligned} & \Omega \subset \R^N,\, N \geq 2\,, \textup{ is a bounded domain with } \partial \Omega \textup{ of class } \mathcal{C}^{0,1},\\ & c \textup{ and } h \textup{ belong to } L^q(\Omega) \textup{ for some } q > \max\{N/p,1\}, \\ & c \gneqq 0 \textup{ and } \mu \in L^{\infty}(\Omega)\,. \end{aligned} \right. \] The study of quasilinear elliptic equations with a gradient dependence up to the critical growth $|\nabla u|^p$ was initiated by L. Boccardo, F. Murat and J.P. Puel in the 80's and it has been an active field of research until now. Under the condition $\lambda c(x) \leq -\alpha_0 < 0$ for some $\alpha_0 > 0$, which is now referred to as the \textit{coercive case}, the existence of solution is a particular case of the results of \cite{B_M_P_1983, B_M_P_1992, DA_G_P_2002}. The \textit{weakly coercive case} ($\lambda=0$) was studied in \cite{F_M_2000} where, for $\| \mu h\|_{N/p}$ small enough, the existence of a unique solution is obtained, see also \cite{AH_BV_2010}. The \textit{limit coercive case}, where one just require that $\lambda c(x) \leq 0$ and hence $ c$ may vanish only on some parts of $\Omega$, is more complex and was left open until \cite{A_DC_J_T_2015}. In that paper, for the case $p = 2$, it was observed that, under the assumption \eqref{B10_i}, the existence of solutions to \eqref{Plambda} is not guaranteed. Sufficient conditions in order to ensure the existence of solution were given. \medbreak The case $\lambda c(x) \gneqq 0$ also remained unexplored until very recently. First, in \cite{J_S_2013} the authors studied problem \eqref{Plambda} with $p = 2$. Assuming $\lambda > 0$ and $\mu h$ small enough, in an appropriate sense, they proved the existence of at least two solutions. This result has now be complemented in several ways. In \cite{J_RQ_2016} the existence of two solutions is obtained, allowing the function $c$ to change sign with $c^{+} \not\equiv 0$ but assuming $h \gneqq 0$. In both \cite{J_RQ_2016, J_S_2013} $\mu >0$ is assumed constant. In \cite{A_DC_J_T_2015} the restriction $\mu$ constant was removed but assuming that $h \gneqq 0$. Finally, in \cite{DC_J_2017}, under stronger regularity on the coefficients, cases where $\mu$ is non constant and $h$ is non-positive or has no sign were treated. Actually in \cite{DC_J_2017}, under different sets of assumptions, the authors clarify the structure of the set of solutions to \eqref{Plambda} in the non-coercive case. Now, concerning \eqref{Plambda} with $p\not=2$, the only results in the case $\lambda c \gneqq 0$ are, up to our knowledge, presented in \cite{I_L_U_2010, AH_BV_2010}. In \cite{I_L_U_2010} the case $c$ constant and $h\equiv0$ is covered and in \cite{AH_BV_2010}, the model equation is $\pLaplac u = |\nabla u|^p + \lambda f(x)(1+u)^b\,,\, b \geq p-1$ and $f \gneqq 0$. \medbreak To state our first main result let us define \begin{equation*} m_{p,\lambda}^{+}:= \left\{ \begin{aligned} & \inf_{u \in W_{\lambda }} \int_{\Omega} \Big(|\nabla u|^p - \big(\frac{\|\mu^{+}\|_{\infty}}{p-1}\big)^{p-1}h(x)|u|^p\,\Big)\, dx, \quad & \textup{ if } W_{\lambda} \neq \emptyset\,, \\ & +\infty, & \textup{ if } W_{\lambda} = \emptyset\,, \end{aligned} \right. \end{equation*} and \begin{equation*} m_{p,\lambda}^{-}:= \left\{ \begin{aligned} & \inf_{u \in W_{\lambda }} \int_{\Omega} \Big(|\nabla u|^p - \big(\frac{\|\mu^{-}\|_{\infty}}{p-1}\big)^{p-1}h(x)|u|^p\,\Big) \,dx, \quad & \textup{ if } W_{\lambda} \neq \emptyset\,, \\ & +\infty, & \textup{ if } W_{\lambda} = \emptyset\,. \end{aligned} \right. \end{equation*} where \[ W_{\lambda }:= \{ w \in W_0^{1,p}(\Omega): \lambda c(x)w(x) = 0 \textup{ a.e. } x \in \Omega\,,\ \|w\| = 1\}\,. \] Note that $W_{0} = W_0^{1,p}(\Omega)$ and $W_{\lambda}$ is independent of $\lambda$ when $\lambda \neq 0$. Using these notations, we state the following result which generalizes the results obtained in \cite[Section 3]{A_DC_J_T_2015}. In fact, if $h$ is either non-negative or non-positive our hypothesis corresponds to the ones introduced in \cite{A_DC_J_T_2015} for $p = 2$. However, if $h$ does not have a sign, our hypothesis are weaker even for $p=2$. \begin{theorem}\label{coercive-louis} Assume that \eqref{B10_i} holds and that $ \lambda \leq 0$. Then if $m_{p,\lambda }^{+} > 0$ and $m_{p, \lambda }^{-} > 0$, the problem \eqref{Plambda} has at least one solution. \end{theorem} In the rest of the paper we assume that $\mu$ is constant. Namely, we replace \eqref{B10_i} by \[\label{A1} \tag{$A_{1}$} \left \{ \begin{aligned} & \Omega \subset \R^N,\, N \geq 2\,, \textup{ is a bounded domain with } \partial \Omega \textup{ of class } \mathcal{C}^{0,1},\\ & c \textup{ and } h \textup{ belong to } L^q(\Omega) \textup{ for some } q > \max\{N/p,1\}, \\ & c \gneqq 0 \textup{ and } \mu >0\, \end{aligned} \right. \] Observe that there is no loss of generality in assuming $\mu > 0$ since, if $u$ is a solution to \eqref{Plambda} with $\mu < 0$, then $w = -u$ satisfies \[ \pLaplac w = \lambda c(x)|w|^{p-2}w - \mu |\nabla w|^p - h(x)\,.\] \medbreak In \cite{A_DC_J_T_2014}, for $p=2$ but assuming only \eqref{B10_i}, the uniqueness of solution when $\lambda \leq 0$ was obtained as a direct consequence of a comparison principle, see \cite[Corollary 3.1]{A_DC_J_T_2014}. As we show in Remark \ref{pascomparaison}, such kind of principle does not hold in general when $p\neq 2$. Actually the issue of uniqueness for equations of the form of $(P_{\lambda})$ appears widely open. If partial results, assuming for example $1 <p \leq 2$ or $\lambda c(x) \leq - \alpha_0 <0$, seem reachable adapting existing techniques, see in particular \cite{L_P_R_2017, P_2008, P_S_2007}, a result covering the full generality of \eqref{Plambda} seems, so far, out of reach. Theorem \ref{uniqueness} below, whose proof makes use of some ideas from \cite{A_P_2003}, crucially relies on the assumption that $\mu$ is constant. It permits however to treat the limit case $(P_0)$ which plays an important role in our paper \begin{theorem} \label{uniqueness} Assume that \eqref{A1} holds and suppose $\lambda \leq 0$. Then \eqref{Plambda} has at most one solution. \end{theorem} \medbreak Let us now introduce \begin{equation}\label{mp} m_p:= \inf \Big\{ \int_{\Omega} \Big(|\nabla w|^p - \big(\frac{\mu}{p-1} \big)^{p-1}h(x) |w|^p \Big)\,dx: w \in W_0^{1,p}(\Omega),\, \|w\| = 1 \Big\}\,. \end{equation} We can state the following result. \begin{theorem} \label{th3} Assume that \eqref{A1} holds. Then $(P_0)$ has a solution if, and only if, $m_p > 0$. \end{theorem} Theorem \ref{th3} provides, so to say, a characterization in term of a first eigenvalue of the existence of solution to $(P_0)$. This result again improves, for $\mu$ constant, \cite{A_DC_J_T_2015} and it allows to observe that, in case $h\lneqq 0$, $(P_0)$ has always a solution while the case $h\gneqq0$ is the ``worse'' case for the existence of a solution. In case $h$ changes sign, the negative part of $h$ ``helps'' in order to have a solution to $(P_0)$. We give in Appendix \ref{AR}, sufficient conditions on $h^+$ in order to ensure $m_p>0$. \medbreak \begin{remark}\label{reverse} Observe that the sufficient part of Theorem \ref{th3} is direct. Indeed, if $m_p>0$ then $m_{p,0}^{+} >0$ and $ m_{p,0}^{-} >0 $ and Theorem \ref{coercive-louis} implies that $(P_0)$ has a solution. \end{remark} \begin{remark} We see, combining Theorems \ref{coercive-louis} and \ref{th3}, that if $(P_0)$ has a solution then \eqref{Plambda} has a solution for any $\lambda \leq 0$. Moreover this solution is unique by Theorem \ref{uniqueness}. \end{remark} Now, we turn to the study the non-coercive case, namely when $\lambda > 0$. First, using mainly variational techniques we prove the following result. \begin{theorem} \label{th1} Assume that \eqref{A1} holds and suppose that $(P_0)$ has a solution. Then there exists $\Lambda > 0$ such that, for any $0 < \lambda < \Lambda$, \eqref{Plambda} has at least two solutions. \end{theorem} As we shall see in Corollary \ref{corlambdaimplique 0.2}, the existence of a solution to $(P_0)$ is, in some sense, necessary for the existence of a solution when $\lambda>0$. \medbreak Next, considering stronger regularity assumptions, we derive informations on the structure of the set of solutions in the non-coercive case. These informations complement Theorem \ref{th1}. We denote by $\gamma_1 >0$ the first eigenvalue of the problem \begin{equation} \label{BVPeigenvalue} \pLaplac u = \gamma c(x) |u|^{p-2} u\,, \quad u \in W_0^{1,p}(\Omega)\,, \end{equation} and, under the assumptions \[ \label{A2} \tag{$A_{2}$} \left \{ \begin{aligned} & \Omega \subset \R^N,\, N \geq 2\,, \textup{ is a bounded domain with } \partial \Omega \textup{ of class } \mathcal{C}^2,\\ & c \textup{ and } h \textup{ belong to } L^{\infty}(\Omega)\,, \\ & c \gneqq 0 \textup{ and } \mu > 0\,, \end{aligned} \right. \] we state the following theorem. \begin{theorem} \label{th2} Assume that \eqref{A2} holds and suppose that $(P_0)$ has a solution. Then: \begin{itemize} \item If $h \lneqq 0$, for every $\lambda > 0$, \eqref{Plambda} has at least two solutions $u_1$, $u_2$ with $u_1\ll0$. \item If $h \gneqq 0$, then $u_0\gg0$ and there exists $\overline{\lambda} \in(0, \gamma_1)$ such that: \begin{itemize} \item for every $0 < \lambda < \overline{\lambda}$, \eqref{Plambda} has at least two solutions satisfying $u_i\geq u_0$; \item for $\lambda = \overline{\lambda}$, \eqref{Plambda} has at least one solution satisfying $u\geq u_0$; \item for any $\lambda > \overline{\lambda}$, \eqref{Plambda} has no non-negative solution. \end{itemize} \end{itemize} \end{theorem} \begin{center} \begin{figure}[h] \begin{tikzpicture}[line width = 0.35mm, scale = 1.6, >=stealth] \draw[->](-0.5,0)--(2,0); \draw[->](0,-0.5)--(0,2); \draw(2,0) node[right]{$\lambda$}; \draw[smooth,line width = 0.45mm] plot coordinates{(1.97,0.31)(1.75,0.33)(1.5,0.36)(1.25,0.4)(1,0.45)(0.9,0.48)(0.7,0.57)(0.5,0.69)(0.3,0.92)(0.15,1.5)(0.1,1.98)}; \draw[smooth,line width = 0.45mm] plot coordinates{(-0.5,-0.1)(0,-0.125) (0.25,-0.15)(0.5,-0.175)(0.75,-0.2)(1,-0.23)(1.25,-0.27)(1.5,-0.32)(1.75,-0.38)(1.97,-0.45)}; \end{tikzpicture} \caption{Illustration of Theorem \ref{th2} with $h \lneqq 0$} \label{fig1} \end{figure} \begin{figure}[h] \begin{tikzpicture}[line width = 0.35mm, scale = 1.6, >=stealth] \draw[->](-0.5,0)--(2,0); \draw[->](0,-0.2)--(0,2); \draw(1,0) node[below]{$\overline{\lambda}$}; \draw(2,0) node[right]{$\lambda$}; \draw[dashed](1,0)--(1,2); \draw[smooth,line width = 0.45mm] plot coordinates{(-0.5,0.1)(0,0.125) (0.25,0.15)(0.5,0.175)(0.75,0.2)(1,0.26)}; \draw[smooth,line width = 0.45mm] plot coordinates{(1,0.465)(0.9,0.48)(0.7,0.57)(0.5,0.69)(0.3,0.92)(0.15,1.5)(0.1,1.98)}; \end{tikzpicture} \caption{Illustration of Theorem \ref{th2} with $h \gneqq 0$} \label{fig2} \end{figure} \end{center} \newpage \begin{remark}$ $ \begin{itemize} \item[a)] As observed above, in the case $h \lneqq 0$, the assumption that $(P_0)$ has a solution is automatically satisfied. \item[b)] In the case $\mu<0$, we have the opposite result i.e., two solutions for every $\lambda>0$ in case $h \gneqq 0$ and, in case $h \lneqq 0$, the existence of $\overline \lambda>0$ such that \eqref{Plambda} has at least two negative solutions, at least one negative solution or no non-positive solution according to $0<\lambda<\overline\lambda$, $\lambda=\overline\lambda$ or $\lambda>\overline\lambda$. \end{itemize} \end{remark} In case $h \gneqq 0$, we know that for $\lambda > \overline{\lambda}$, \eqref{Plambda} has no non-negative solution but this does not exclude the possibility of having negative or sign changing solutions. Actually, we are able to prove the following result changing a little the point of view. We consider the boundary value problem \begin{equation} \label{eq cor} \tag{$P_{\lambda,k}$} \pLaplac u = \lambda c(x)|u|^{p-2}u+ \mu |\nabla u|^p + kh(x)\,, \quad u \in W^{1,p}_0(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation} with a dependence in the size of $h$ and we obtain the following result. \begin{theorem} \label{th4} Assume that \eqref{A2} holds and that $h \gneqq 0$. Let \[ k_0=\sup\Big\{ k\in [0, +\infty) : \forall\ w\in W_0^{1,p}(\Omega)\,,\ \int_{\Omega} \Big(|\nabla w|^p - \big(\frac{\mu}{p-1} \big)^{p-1} k\, h(x) |w|^p \Big)\,dx>0\Big\}\,. \] Then: \begin{itemize} \item For all $\lambda\in(0,\gamma_1)$, there exists $\overline k= \overline k(\lambda)\in(0,k_0)$ such that, for all $k\in(0,\overline k)$, the problem \eqref{eq cor} has at least two solutions $u_1$, $u_2$ with $u_i\gg0$ and for all $k> \overline k$, the problem \eqref{eq cor} has no solution. Moreover, the function $\overline k(\lambda)$ is non-increasing. \item For $\lambda=\gamma_1$, the problem \eqref{eq cor} has a solution if and only if $k=0$. In that case, the solution is unique and it is equal to $0$. \item For all $\lambda>\gamma_1$, there exist $0<\tilde k_1\leq \tilde k_2<+\infty$ such that, for all $k\in(0,\tilde k_1)$, the problem \eqref{eq cor} has at least two solutions with $u_{\lambda,1}\ll 0$ and $\min u_{\lambda,2}<0$, for all $k> \tilde k_2$, the problem \eqref{eq cor} has no solution and, in case $\tilde k_1< \tilde k_2$, for all $k\in(\tilde k_1, \tilde k_2)$, the problem \eqref{eq cor} has at least one solution $u$ with $u\not\ll 0$ and $\min u<0$. Moreover, the function $\widetilde{k}_1(\lambda)$ is non-decreasing. \end{itemize} \end{theorem} \begin{center} \begin{figure}[h] \begin{tikzpicture}[line width = 0.4mm, scale = 2, >=stealth] \fill[color=gray!15] (0,0) -- (1,0) -- (0.75,0.18) -- (0.5,0.38) -- (0.25,0.55) -- (0,0.65) -- cycle ; \fill[color=gray!15] (2.97,0)--(1,0)--(1.25,0.15)--(1.5,0.25)--(1.75,0.32)--(2,0.39)--(2.25,0.42)--(2.5,0.45)--(2.75,0.47)--(2.97,0.485) -- cycle ; \fill[color=gray!55] (1,0)--(1.25,0.28)--(1.5,0.45)--(1.75,0.55)--(2,0.62)--(2.25,0.66)--(2.5,0.69)--(2.75,0.71)--(2.97,0.725)--(2.97,0.485)--(2.75,0.47)--(2.5,0.45)--(2.25,0.42)--(2,0.39)--(1.75,0.32)--(1.5,0.25)--(1.25,0.15)--(1,0)--cycle; \draw(0.33,0.22) node{2}; \draw(2.15,0.18) node{2}; \draw(2.15,0.510) node{1}; \draw(1,0.35) node{0}; \draw(0.5,0.6) node{$\overline{k}(\lambda)$}; \draw(1,0) node[below]{$\gamma_1$}; \draw(3,0) node[right]{$\lambda$}; \draw[-](-0.03,0.66)--(0.03,0.66); \draw(0,0.65) node[left]{$k_0$}; \draw(0,1.25) node[above]{$k$}; \draw[smooth, line width = 0.6mm] plot coordinates{(0,0.65)(0.25,0.54)(0.5,0.38)(0.75,0.18)(1,0)}; \draw[smooth, line width = 0.6mm] plot coordinates{(1,0)(1.25,0.15)(1.5,0.25)(1.75,0.33)(2,0.39)(2.25,0.42)(2.5,0.45)(2.75,0.47)(2.97,0.485)}node[right]{$\widetilde{k}_1(\lambda)$}; \draw[smooth, line width = 0.6mm] plot coordinates{(1,0)(1.25,0.28)(1.5,0.45)(1.75,0.55)(2,0.62)(2.25,0.66)(2.5,0.69)(2.75,0.71)(2.97,0.725)}node[right]{$\widetilde{k}_2(\lambda)$}; \draw[->](-0.2,0)--(3,0); \draw[->](0,-0.2)--(0,1.25); \end{tikzpicture} \caption{Existence regions of Theorem \ref{th4}} \label{fig3} \end{figure} \end{center} Let us now say some words about our proofs. First note that when $\mu$ is assumed constant it is possible to perform a Hopf-Cole change of variable. Introducing $$ v = \frac{p-1}{\mu} \Big( e^{\frac{\mu}{p-1}u} -1 \Big)\,, $$ we can check that $u$ is a solution of \eqref{Plambda} if, and only if, $v > -\frac{p-1}{\mu}$ is a solution of \begin{equation} \label{pbm2} \pLaplac v = \lambda c(x) g(v) + \Big( 1 + \frac{\mu}{p-1}v\Big)^{p-1} h(x)\,, \quad v \in W_0^{1,p}(\Omega)\,, \end{equation} where $g$ is an arbitrary function satisfying $$ g(s) = \Big|\frac{p-1}{\mu}\big( 1+\frac{\mu}{p-1}s \big) \ln \big(1+ \frac{\mu}{p-1}s \big)\Big|^{p-2} \frac{p-1}{\mu}\big( 1+\frac{\mu}{p-1}s \big) \ln \big(1+ \frac{\mu}{p-1}s \big), \quad \mbox{if }s > -\frac{p-1}{\mu}\,. $$ Working with problem \eqref{pbm2} presents the advantage that one may assume, with a suitable choice of $g$ when $s \leq -\frac{p-1}{\mu}$, that it has a variational structure. Nevertheless from this point we face several difficulties. \medbreak First, we need a control from below on the solutions to \eqref{pbm2}, i.e. having found a solution to \eqref{pbm2} one needs to check that it satisfies $v > -\frac{p-1}{\mu}$, in order to perform the opposite change of variable and obtain a solution to \eqref{Plambda}. To that end, in Section \ref{TLSATAP-L}, we prove the existence of a lower solution $\underline{u}_{\lambda}$ to \eqref{Plambda} such that every upper solution $\beta$ of \eqref{Plambda} satisfies $\beta\geq \underline{u}_{\lambda}$. This allows us to transform the problem \eqref{pbm2} in a new one, which has the advantage of being completely equivalent to \eqref{Plambda}. Note that the existence of the lower solution ultimately relies on the existence of an a priori lower bound. See Lemma \ref{lowerBound} for a more general result. \medbreak We denote by $I_{\lambda}$ the functional associated to the new problem, see \eqref{defI} for a precise definition. The ``geometry" of $I_{\lambda}$ crucially depends on the sign of $\lambda$. When $\lambda \leq 0$ is it essentially coercive and one may search for a critical point as a global minimum. When $\lambda >0$ the functional $I_{\lambda}$ becomes unbounded from below and presents something like a concave-convex geometry. Then, in trying to obtain a critical point, the fact that $g$ is only slightly superlinear at infinity is a difficulty. It implies that $I_{\lambda}$ does not satisfies an Ambrosetti-Rabinowitz-type condition and proving that Palais-Smale or Cerami sequences are bounded may be challenging. In the case of the Laplacian, when $p=2$, dealing with this issue is now relatively standard but for elliptic problems with a $p$-Laplacian things are more complex and we refer to \cite{ DF_G_RQ_U_2017, I_L_U_2010, I_S_U_2014, L_Y_2010} in that direction. Note however that in these last works, it is always assumed a kind of homogeneity condition which is not available here. Consequently, some new ideas are required, see Section \ref{OTCCATMPG}. \medbreak Having at hand the Cerami condition for $I_{\lambda}$ with $\lambda > 0$, in order to prove Theorems \ref{th1}, \ref{th2} and \ref{th4}, we shall look for critical points which are either local-minimum or of mountain-pass type. In Theorem \ref{th1} the geometry of $I_{\lambda}$ is ``simple" and permits to use only variational arguments. In Theorems \ref{th2} and \ref{th4} however it is not so clear, looking directly to $I_{\lambda}$, where to search for critical points. We shall then make uses of lower and upper solutions arguments. In both theorems a first solution is obtained through the existence of well-ordered lower and upper solutions. This solution is further proved to be a local minimum of $I_{\lambda}$ and it is then possible to obtain a second solution by a mountain pass argument. Our approach here follows the strategy presented in \cite{Chang_1, Chang_2, DF_S_1983}. See also \cite{A_B_C_1994}. \medbreak Finally, concerning Theorem \ref{coercive-louis}, where $\mu$ is not assumed to be constant, we obtain our solution through the existence of lower and an upper solution which correspond to solutions to $(P_{\lambda})$ where $\mu = -\|\mu^-\|_{\infty}$ and $\mu = \|\mu^+\|_{\infty}$ respectively, see Section \ref{Coercive-Case}. \bigbreak The paper is organized as follows. In Section \ref{P}, we recall preliminary general results that are used in the rest of the paper. In Section \ref{CPAUR}, we give a comparison principle and prove the uniqueness result for $\lambda\leq 0$. Section \ref{TLSATAP-L} is devoted to the existence of the lower solution. In Section \ref{TLSATAP}, we construct the modified problem that we use to obtain the existence results. The coercive and limit-coercive cases, corresponding to $\lambda \leq 0$ are studied in Section \ref{Coercive-Case} where we prove Theorem \ref{coercive-louis}. Theorem \ref{th3} which gives a necessary and sufficient condition to the existence of a solution to $(P_0)$ is established in Section \ref{Weakly-coercive-Case}. In Section \ref{OTCCATMPG} we show that $I_{\lambda}$ has, for $\lambda >0$ small, a mountain pass geometry and that the Cerami compactness condition holds. This permits to give the proof of Theorem \ref{th1}. Section \ref{SER2} contains the proofs of Theorems \ref{th2} and \ref{th4}. Finally in an Appendix we give conditions on $h^+$ that ensure that $m_p>0$. \medbreak \noindent \textbf{Acknowledgments.} The authors thank warmly L. Jeanjean for his help improving the presentation of the results. \medbreak \begin{center} \textbf{Notation.} \end{center} \begin{enumerate}{\small \item[1)] For $p\in [1,+\infty[$, the norm $(\int_{\Omega}|u|^pdx)^{1/p}$ in $L^p(\Omega)$ is denoted by $\|\cdot\|_p$. We denote by $p^{\prime}$ the conjugate exponent of $p$, namely $p^{\prime} = p/(p-1)$ and by $p^*$ the Sobolev critical exponent i.e. $p^*=\frac{Np}{N-p}$ if $p<N$ and $p^*=+\infty$ in case $p\geq N$. The norm in $L^{\infty}(\Omega)$ is $\|u\|_{\infty}=\mbox{esssup}_{x\in \Omega}|u(x)|$. \item[2)] For $v \in L^1(\Omega)$ we define $v^+= \max(v,0)$ and $v^- = \max(-v,0)$. \item[3)] The space $W^{1,p}_0(\Omega)$ is equipped with the norm $\|u\|:=\big( \int_\Omega |\nabla u|^p\,dx\big)^{1/p}$. \item[4)] We denote $\mathbb R^+=(0,+\infty)$ and $\mathbb R^-=(-\infty,0)$.} \item[5)] For $a$, $b \in L^1(\Omega)$ we denote $\{a \leq b\} = \{x\in \Omega:\, a(x)\leq b(x)\}\,.$ \end{enumerate} \section{Preliminaries} \label{P} In this section we present some definitions and known results which are going to play an important role throughout all the work. First of all, we present some results on lower and upper solutions adapted to our setting. Let us consider the problem \begin{equation} \label{p1} \pLaplac u + H(x,u,\nabla u) = f(x)\,, \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation} where $f$ belongs to $L^1(\Omega)$ and $H: \Omega \times \R \times \mathbb{R}^{N}} %R^{N \rightarrow \R$ is a Carath\'eodory function. \begin{definition} \label{lowerUpperSolution} We say that $\alpha \in W^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is a \textit{lower solution of \eqref{p1}} if $\alpha^{+} \in W_0^{1,p}(\Omega)$ and, for all $\varphi \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ with $\varphi \geq 0$, if follows that \[ \int_{\Omega} |\nabla \alpha|^{p-2} \nabla \alpha \nabla \varphi\,dx + \int_{\Omega} H(x,\alpha, \nabla \alpha) \varphi\, dx \leq \int_{\Omega} f(x) \varphi\,dx\,. \] Similarly, $\beta \in W^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is an \textit{upper solution of \eqref{p1}} if $\beta^{-} \in W_0^{1,p}(\Omega)$ and, for all $\varphi \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ with $\varphi \geq 0$, if follows that \[ \int_{\Omega} |\nabla \beta|^{p-2} \nabla \beta \nabla \varphi\,dx + \int_{\Omega} H(x,\beta, \nabla \beta) \varphi\, dx \geq \int_{\Omega} f(x) \varphi\,dx\,. \] \end{definition} \begin{theorem} \rm \cite[Theorems 3.1 and 4.2]{B_M_P_1988} \label{BMP1988} \it Assume the existence of a non-decreasing function $b: \R^{+} \rightarrow \R^{+}$ and a function $k \in L^1(\Omega)$ such that \[ |H(x,s,\xi)| \leq b(|s|)[ k(x) + |\xi|^p ], \quad \textup{a.e. } x \in \Omega, \,\, \forall (s,\xi) \in \R \times \mathbb{R}^{N}} %R^{N\,.\] If there exist a lower solution $\alpha$ and an upper solution $\beta$ of \eqref{p1} with $\alpha \leq \beta$, then there exists a solution $u$ of \eqref{p1} with $\alpha \leq u \leq \beta$. Moreover, there exists $u_{min}$ (resp. $u_{max}$) minimum (resp. maximum) solution of \eqref{p1} with $\alpha \leq u_{min}\leq u_{max} \leq \beta$ and such that, every solution $u$ of \eqref{p1} with $\alpha \leq u \leq \beta$ satisfies $u_{min}\leq u \leq u_{max}$. \end{theorem} Next, we state the strong comparison principle for the $p$-Laplacian and the following order notions. \begin{definition} For $h_1$, $h_2\in L^1(\Omega)$ we write \begin{itemize} \item $h_1\leq h_2$ if $h_1(x)\leq h_2(x)$ for a.e. $x\in\Omega$, \item $h_1\lneqq h_2$ if $h_1\leq h_2$ and $\mbox{meas}(\{x\in\Omega: h_1(x)<h_2(x)\})>0$. \end{itemize} For $u$, $v \in \mathcal{C}^{1}(\overline{\Omega})$ we write \begin{itemize} \item $u < v$ if, for all $x \in \Omega\,,$ $u(x) < v(x)$, \item $u \ll v$ if $u < v$ and, for all $x \in \partial \Omega$, either $u(x) < v(x)$, or, $u(x) = v(x)$ and $\frac{\partial u}{\partial \nu}(x) > \frac{\partial v}{\partial \nu}(x)$, where $\nu$ denotes the exterior unit normal. \end{itemize} \end{definition} \begin{theorem}\rm \cite[Theorem 1.3]{L_P_2004} \cite[Proposition 2.4]{C_T_2000} \label{smpLP} \it Assume that $\partial \Omega$ is of class $\mathcal{C}^2$ and let $f_1$, $f_2 \in L^{\infty}(\Omega)$ with $f_2 \gneqq f_1\geq0$. If $u_1$, $u_2 \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})\,,\ 0 < \tau \leq 1\,,$ are respectively solution of \[ \tag{$P_i$} \pLaplac u_i = f_i\,, \quad \textup{ in } \Omega\,,\ \textup{ for } i = 1,2\,,\] such that $u_2 = u_1 = 0$ on $\partial \Omega$. Then $u_2 \gg u_1$. \end{theorem} We need also the following anti-maximum principle. \begin{prop}\rm \cite[Theorem 5.1]{G_G_P_2002} \label{anti} \it Let $\Omega \subset \R^N$, $N \geq 2$, a bounded domain with $\partial \Omega$ of class $\mathcal{C}^{1,1}$, $c$, $\bar{h}\in L^{\infty}(\Omega)$, $\gamma_1$ the first eigenvalue of \eqref{BVPeigenvalue}. If $\bar{h} \gneqq 0$, then there exists $\delta_0>0$ such that, for all $\lambda \in (\gamma_1,\gamma_1+\delta_0)$, every solution $w$ of \begin{equation} \label{cll} \pLaplac w = \lambda \, c(x) |w|^{p-2}w + \bar{h}(x),\quad u \in W^{1,p}_0(\Omega) \end{equation} satisfies $w\ll0$. \end{prop} The following result is the well known Picone's inequality for the $p$-Laplacian. We state it for completeness. \begin{prop}\rm \cite[Theorem 1.1]{A_H_1998} \label{picone} \it Let $u$, $v\in W^{1,p}(\Omega)$ with $u \geq 0$, $v > 0$ in $\Omega$ and $\frac{u}{v}\in L^{\infty}(\Omega)$. Denote \begin{equation*} \begin{aligned} L(u,v) & = |\nabla u|^p + (p-1)\Big( \frac{u}{v} \Big)^p |\nabla v|^p - p \Big( \frac{u}{v} \Big)^{p-1} |\nabla v|^{p-2}\nabla v \nabla u \, ,\\ R(u,v) & = |\nabla u|^p - \nabla \Big( \frac{u^p}{v^{p-1}} \Big)|\nabla v|^{p-2} \nabla v\,. \end{aligned} \end{equation*} Then, it follows that \begin{itemize} \item $L(u,v) = R(u,v) \geq 0$ a.e. in $\Omega$. \item $L(u,v) = 0$ a.e. in $\Omega$ if, and only if, $u = kv$ for some constant $k \in \R$. \end{itemize} \end{prop} \medbreak Now, we consider the boundary value problem \begin{equation} \label{p2} \pLaplac v = g(x,v) , \qquad v \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation} being $g: \Omega \times \R \rightarrow \R$ a Carath\'eodory function such that, for all $s_0 > 0$, there exists $A > 0$, with \begin{equation} \label{linftyCarat} |g(x,s)| \leq A\,, \quad \textup{ a.e. } x \in \Omega\,, \,\, \forall\ s \in [-s_0,s_0]\,. \end{equation} This problem can be handled variationally. Let us consider the associated functional $\Phi: W_0^{1,p}(\Omega) \rightarrow \R$ defined by \[ \Phi(v) := \frac{1}{p} \int_{\Omega} |\nabla v|^p\,dx - \int_{\Omega}G(x,v)\,dx\,, \quad \mbox{ where } \quad G(x,s) := \int_0^s g(x,t)\,dt\,. \] We can state the following result. \begin{prop}\rm \cite[Proposition 3.1]{DF_G_U_2009} \label{minimumInterval} \it Under the assumption \eqref{linftyCarat}, assume that $\alpha$ and $\beta$ are respectively a lower and an upper solution of \eqref{p2} with $\alpha \leq \beta$ and consider \[ M:= \big\{ v \in W_0^{1,p}(\Omega): \alpha \leq v \leq \beta \big\}.\] Then the infimum of $\Phi$ on $M$ is achieved at some $v$, and such $v$ is a solution of \eqref{p2}. \end{prop} \begin{definition} A \textit{lower solution} $\alpha \in \mathcal{C}^1(\overline{\Omega})$ is said to be \textit{strict} if every solution $u$ of \eqref{p1} with $u\geq \alpha$ satisfies $u\gg\alpha$. \smallbreak Similarly, an \textit{upper solution} $\beta\in \mathcal{C}^1(\overline{\Omega})$ is said to be \textit{strict} if every solution $u$ of \eqref{p1} such that $u\leq \beta$ satisfies $u\ll\beta$. \end{definition} \begin{cor} \label{localMinimizer} Assume that \eqref{linftyCarat} is valid and that $\alpha$ and $\beta$ are strict lower and upper solutions of \eqref{p2} belonging to $\mathcal{C}^{1}(\overline{\Omega})$ and satisfying $\alpha \ll \beta$. Then there exists a local minimizer $v$ of the functional $\Phi$ in the $\mathcal{C}_0^1$-topology. Furthermore, this minimizer is a solution of \eqref{p2} with $\alpha \ll v \ll \beta$. \end{cor} \begin{proof} First of all observe that Proposition \ref{minimumInterval} implies the existence of $v \in W_0^{1,p}(\Omega)$ solution of \eqref{p2}, which minimizes $\Phi$ on $ M:= \{ v \in W_0^{1,p}(\Omega): \alpha \leq v \leq \beta\}$. Moreover, since $g$ is an $L^{\infty}$-Carath\'eodory function, the classical regularity results (see \cite{DB_1983, L_1988}) imply that $v \in \mathcal{C}^{1,\tau}(\overline{\Omega})$ for some $0 < \tau < 1$. Since the lower and the upper solutions are strict, it follows that $\alpha \ll v \ll \beta$ and so, there is a $\mathcal{C}_0^1$-neighbourhood of $v$ in $M$. Hence, it follows that $v$ minimizes locally $\Phi$ in the $\mathcal{C}_0^1$-topology. \end{proof} \begin{prop}\rm \cite[Proposition 3.9]{DF_G_U_2009} \label{c01vsWop} \it Assume that $g$ satisfies the following growth condition \[ |g(x,s)| \leq d \, (1+ |s|^{\sigma}), \quad \textup{a.e. }x \in \Omega\,,\ all\ s \in \R\,,\] for some $\sigma \leq p^{\ast} - 1$ and some positive constant $d$. Let $v \in W_0^{1,p}(\Omega)$ be a local minimizer of $\Phi$ for the $\mathcal{C}_0^1$-topology. Then $v \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})$ for some $0 < \tau < 1$ and $v$ is a local minimizer of $\Phi$ in the $W_0^{1,p}$-topology. \end{prop} We now recall abstract results in order to find critical points of $\Phi$ other than local minima. \begin{definition} \label{defCerami} Let $ (X , \| \cdot \|) $ be a real Banach space with dual space $ (X^{\ast}, \| \cdot \|_{\ast}) $ and let $\Phi: X \rightarrow \R$ be a $\mathcal{C}^1$ functional. The functional $ \Phi $ satisfies the \textit{Cerami condition at level $c \in \R$} if, for any \textit{Cerami sequence} at level $c \in \R$, i.e. for any sequence $\{x_n\} \subset X$ with \begin{equation*} \begin{aligned} &\Phi(x_n) \to c \quad \textup{ and } \quad \|\Phi'(x_n)\|_{\ast} (1+\|x_n\|) \to 0\,, \end{aligned} \end{equation*} there exists a subsequence $\{x_{n_k}\}$ strongly convergent in $X$. \end{definition} \begin{theorem}\rm \cite[Corollary 9, Section 1, Chapter IV]{E_1990} \label{mpTheorem} \it Let $ (X , \| \cdot \|) $ be a real Banach space. Suppose that $\Phi: X \rightarrow \R$ is a $\mathcal{C}^1$ functional. Take two points $e_1$, $e_2 \in X$ and define \[ \Gamma := \{ \varphi \in \mathcal{C}([0,1],X): \varphi(0) = e_1, \,\varphi(1) = e_2\}\,,\] and \[ c := \inf_{\varphi \in \Gamma} \max_{t \in [0,1]} \Phi(\varphi(t))\,.\] Assume that $\Phi$ satisfies the Cerami condition at level $c$ and that \[ c > \max \{ \Phi(e_1),\Phi(e_2)\}\,.\] Then, there is a critical point of $\Phi$ at level $c$, i.e. there exists $x_0 \in X$ such that $\Phi(x_0) = c$ and $\Phi'(x_0) = 0$. \end{theorem} \begin{theorem}\rm \cite[Corollary 1.6]{G_1993} \label{characterizacionMinimizer} \it Let $ (X , \| \cdot \|) $ be a real Banach space and let $\Phi: X \rightarrow \R$ be a $\mathcal{C}^{1}$ functional. Suppose that $u_0 \in X$ is a local minimum, i.e. there exists $\epsilon > 0$ such that \[ \Phi(u_0) \leq \Phi(u), \quad \textup{ for } \|u-u_0\| \leq \epsilon\,,\] and assume that $\Phi$ satisfies the Cerami condition at any level $d \in \R$. Then, the following alternative holds: \begin{enumerate} \item[i)] either there exists $0 < \gamma < \epsilon$ such that $ \inf \{\Phi(u): \|u-u_0\| = \gamma \} > \Phi(u_0),$ \item[ii)] or, for each $0 < \gamma < \epsilon$, $\Phi$ has a local minimum at a point $u_{\gamma}$ with $\|u_{\gamma}-u_0\| = \gamma$ and $\Phi(u_{\gamma}) = \Phi(u_0)$. \end{enumerate} \end{theorem} \begin{remark} In \cite{G_1993}, Theorem \ref{characterizacionMinimizer} is proved assuming the Palais-Smale condition which is stronger than our Cerami condition. Nevertheless, modifying slightly the proof, it is possible to obtain the same result with the Cerami condition. \end{remark} \section{Comparison principle and uniqueness results} \label{CPAUR} In this section, we state a comparison principle and, as a consequence, we obtain uniqueness result for \eqref{Plambda} with $\lambda \leq 0$, proving Theorem \ref{uniqueness}. Consider the boundary value problem \begin{equation} \label{pCompPrinciple} \pLaplac u = \mu |\nabla u|^p + f(x,u)\,, \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation} under the assumption \begin{equation} \label{aCompPrinciple} \left \{ \begin{aligned} & \Omega \subset \R^N,\, N \geq 2\,, \textup{ is a bounded domain with } \partial \Omega \textup{ of class } \mathcal{C}^{0,1}\,,\\ &f: \Omega \times \R \to \R \mbox{ is a $L^1$-Carath\'eodory function with } f(x,s) \leq f(x,t) \textup{ for a.e. } x\in \Omega\mbox{ and all } t \leq s, \\ & \mu >0. \end{aligned} \right. \end{equation} \begin{remark} \label{muPositve2} As above, the assumption $\mu>0$ is not a restriction. If $u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is a solution of \eqref{pCompPrinciple} with $\mu < 0$ then $w = -u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is a solution of \begin{equation*} \label{pCoercive} \pLaplac w = - \mu|\nabla w|^p - f(x,-w)\,, \quad w \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,, \end{equation*} with $-f(x,-s)$ satisfying the assumption \eqref{aCompPrinciple}. \end{remark} Under a stronger regularity on the solutions, we can prove a comparison principle for \eqref{pCompPrinciple}. The proof relies on the Picone's inequality (Proposition \ref{picone}) and is inspired by some ideas of \cite{A_P_2003}. \begin{theorem} \label{compPrinciple} Assume that \eqref{aCompPrinciple} holds. If $u_1$, $u_2 \in W^{1,p}(\Omega) \cap \mathcal{C}(\overline{\Omega})$ are respectively a lower and an upper solution of \eqref{pCompPrinciple}, then $u_1 \leq u_2$. \end{theorem} \begin{proof} Suppose that $u_1$, $u_2$ are respectively a lower and an upper solution of \eqref{pCompPrinciple}. For simplicity denote $t = \frac{p\mu}{p-1}$ and consider as test function \[ \varphi = \big[ e^{tu_1} - e^{tu_2} \big]^{+} \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,.\] First of all, observe that \[ \nabla \varphi = t \big[ \nabla u_1 e^{tu_1} - \nabla u_2 e^{tu_2} \big] \chi_{\{u_1 > u_2\}},\] with $\chi_A$ the characteristic function of the set $A$. Hence, using assumptions \eqref{aCompPrinciple}, it follows that \begin{equation*} \begin{aligned} \int_{\{u_1 > u_2\}} \!\!\! \Big(\big[ |\nabla u_1|^{p-2} \nabla u_1 - |\nabla u_2 |^{p-2} \nabla u_2 \big] \big( t\, \nabla u_1 e^{tu_1} -& t\, \nabla u_2 e^{tu_2} \big) - \mu \big[ |\nabla u_1|^p - |\nabla u_2|^p \big] \big(e^{tu_1} - e^{tu_2} \big)\Big)\, dx \\ & \leq \int_{\{u_1 > u_2\}} \big( f(x,u_1) - f(x,u_2) \big) \big(e^{tu_1} - e^{tu_2} \big)\, dx \leq 0. \end{aligned} \end{equation*} Observe that \begin{equation} \label{cp1} \begin{aligned} \int_{\{u_1 > u_2\}} & \Big[ |\nabla u_1|^{p-2} \nabla u_1 - |\nabla u_2 |^{p-2} \nabla u_2 \Big] \big( t\, \nabla u_1 e^{tu_1} - t\, \nabla u_2 e^{tu_2} \big)\, dx \\ & \hspace{37mm} - \mu \int_{\{u_1 > u_2\}} \Big[ |\nabla u_1|^p - |\nabla u_2|^p \Big] \big(e^{tu_1} - e^{tu_2} \big)\, dx \\ & = \int_{\{u_1 > u_2\}} e^{tu_1} \Big[ |\nabla u_1|^p (t - \mu) + \mu |\nabla u_2 |^p - t |\nabla u_2|^{p-2} \nabla u_2 \nabla u_1 \Big] \, dx \\ & \hspace{37mm} + \int_{\{u_1 > u_2\}} e^{tu_2} \Big[ |\nabla u_2|^p (t - \mu) + \mu |\nabla u_1 |^p - t |\nabla u_1|^{p-2} \nabla u_1 \nabla u_2 \Big] \, dx . \end{aligned} \end{equation} Next, as $\nabla e^{tu_i} = t\, \nabla u_i e^{tu_i}$, $i = 1,2$, we have \[ |\nabla u_i |^p = \frac{|\nabla e^{t u_i}|^p}{t^p e^{tpu_i}} \qquad i = 1,2\,.\] Hence, using the above identities, and as $\frac{\mu}{t-\mu} = p-1$ and $\frac{t}{t-\mu} = p$, it follows that, \begin{equation*} \begin{aligned} e^{tu_1} \big[ |\nabla u_1|^p (t - \mu) & + \mu |\nabla u_2 |^p - t |\nabla u_2|^{p-2} \nabla u_2 \nabla u_1 \big \\ & = \frac{t-\mu}{t^p e^{t(p-1)u_1}} \Big[ |\nabla e^{tu_1}|^p + (p-1) \big( \frac{e^{tu_1}}{e^{tu_2}} \big)^p |\nabla e^{tu_2} |^p - p \big( \frac{e^{tu_1}}{e^{tu_2}} \big)^{p-1} |\nabla e^{tu_2}|^{p-2} \nabla e^{tu_2} \nabla e^{tu_1} \Big] \\ e^{tu_2} \big[ |\nabla u_2|^p (t - \mu) &+ \mu |\nabla u_1 |^p - t |\nabla u_1|^{p-2} \nabla u_1 \nabla u_2 \big] \\ & = \frac{t-\mu}{t^p e^{t(p-1)u_2}} \Big[ |\nabla e^{tu_2}|^p + (p-1) \big( \frac{e^{tu_2}}{e^{tu_1}} \big)^p |\nabla e^{tu_1} |^p - p \big( \frac{e^{tu_2}}{e^{tu_1}} \big)^{p-1} |\nabla e^{tu_1}|^{p-2} \nabla e^{tu_1} \nabla e^{tu_2} \Big] \end{aligned} \end{equation*} Then, by \eqref{cp1}, we have \begin{equation} \label{cp2} \begin{aligned} & \int_{\{u_1 > u_2\}} \frac{t-\mu}{t^p e^{t(p-1)u_1}} \Big[ |\nabla e^{tu_1}|^p + (p-1) \big( \frac{e^{tu_1}}{e^{tu_2}} \big)^p |\nabla e^{tu_2} |^p - p \big( \frac{e^{tu_1}}{e^{tu_2}} \big)^{p-1} |\nabla e^{tu_2}|^{p-2} \nabla e^{tu_2} \nabla e^{tu_1} \Big] dx \\ & + \int_{\{u_1 > u_2\}} \frac{t-\mu}{t^p e^{t(p-1)u_2}} \Big[ |\nabla e^{tu_2}|^p + (p-1) \big( \frac{e^{tu_2}}{e^{tu_1}} \big)^p |\nabla e^{tu_1} |^p - p \big( \frac{e^{tu_2}}{e^{tu_1}} \big)^{p-1} |\nabla e^{tu_1}|^{p-2} \nabla e^{tu_1} \nabla e^{tu_2} \Big] dx \leq 0\,.\hspace{-2.3mm} \end{aligned} \end{equation} By Picone's inequality (Proposition \ref{picone}), we know that both brackets in \eqref{cp2} are positive and are equal to zero if and only if $e^{tu_1}=k e^{tu_2}$ for some $k\in \mathbb R$. As $t-\mu > 0$, thanks to \eqref{cp2}, we deduce the existence of $k\in \mathbb R$ such that \begin{equation} \label{15v} e^{tu_1}=k e^{tu_2} \quad \mbox{ in } \{u_1>u_2\}. \end{equation} Since $u_1$ and $u_2$ are continuous on $\overline\Omega$ and satisfy $u_1-u_2\leq 0$ on $\partial\Omega$, we deduce that $u_1=u_2$ on $\partial \{u_1>u_2\}$. Hence, \eqref{15v} applied to $x\in \partial \{u_1>u_2\}$, implies $k=1$. This implies that $u_1=u_2$ in $\{u_1>u_2\}$, which proves $u_1\leq u_2\,,$ as desired. \end{proof} \begin{cor} \label{compPrincipPlambda} Assume that \eqref{A1} holds and suppose $\lambda \leq 0$. If $u_1$, $u_2 \in W^{1,p}(\Omega) \cap \mathcal{C}(\overline{\Omega})$ are respectively a lower and an upper solution of \eqref{Plambda}, then $u_1 \leq u_2$. \end{cor} \begin{proof} Define the function $f: \Omega \times \R \rightarrow \R$ given by \[ f(x,s) = \lambda c(x)|s|^{p-2}s + h(x)\,.\] Since \eqref{A1} holds and $\lambda \leq 0$, $f$ is a $L^1$-Carath\'eodory function which satisfies \eqref{aCompPrinciple}. Consequently, the proposition follows from Theorem \ref{compPrinciple} \end{proof} The following result guarantees the regularity that we need to apply the previous comparison principle. \begin{lemma} \label{lemmaUniqueness} Assume that \eqref{A1} holds and suppose $\lambda \leq 0$. Then, any solution of \eqref{Plambda} belongs to $\mathcal{C}^{0,\tau}(\overline{\Omega})$. \end{lemma} \begin{proof} This follows directly from \cite[Theorem IX-2.2]{L_U_1968}. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{uniqueness}}] The proof is just the combination of Corollary \ref{compPrincipPlambda} and Lemma \ref{lemmaUniqueness}. \end{proof} \begin{remark} It is important to note that this comparison and uniqueness results do not hold in general for solution belonging only to $W_0^{1,p}(\Omega)$. See \cite[Example 1.1]{P_2008} \end{remark} \begin{remark}\label{pascomparaison} The following counter-example (see \cite[p.7]{P_S_2007}) shows that there is no hope to obtain, when $p \neq 2$, a comparison principle like \cite[Corollary 3.1]{A_DC_J_T_2014}. For $N = 2$ and $R>0$, consider the following problem on the ball \begin{equation*} \left\{ \begin{aligned} -\Delta_4 u & = |\nabla u|^2 \qquad \textup{ in } B(0,R)\,,\\ u & = 0 \qquad \qquad \textup{ on } \partial B(0,R)\,. \end{aligned} \right. \end{equation*} We easily see that $u_1 = 0$ and $u_2 = \frac{1}{8}(R^2 - |x|^2)$ are both solutions of the above problem belonging to $W_0^{1,4}(B(0,R)) \cap L^{\infty}(B(0,R))$. \end{remark \section{A priori lower bound and existence of a lower solution } \label{TLSATAP-L} As explained in the introduction, the aim of this section is to find a lower solution below every upper solution of problem \eqref{Plambda}. First of all, we show that under a rather mild assumption (in particular no sign on $c$ is required) the solutions to \eqref{Plambda} admit a lower bound. Precisely we consider problem \eqref{Plambda} assuming now \begin{equation} \label{lb2} \left \{ \begin{aligned} & \Omega \subset \R^N,\, N \geq 2\,, \textup{ is a bounded domain with } \partial \Omega \textup{ of class } \mathcal{C}^{0,1}\,.\\ & c \textup{ and } h \textup{ belong to } L^q(\Omega) \textup{ for some } q > \max\{N/p,1\}, \\ & \mu \in L^{\infty}(\Omega) \textup{ satisfies } 0 < \mu_1 \leq \mu (x) \leq \mu_2. \end{aligned} \right. \end{equation} Adapting the proof of \cite[Lemma 3.1]{DC_J_2017}, based in turn on ideas of \cite{A_P_P_2007}, we obtain \begin{lemma}\label{lowerBound} Under the assumptions \eqref{lb2}, for any $\lambda \geq 0$, there exists a constant $M_{\lambda}>0$ with $M_{\lambda}:= M(N,p,q,|\Omega|,\lambda, \mu_1,$ $\|c^{+}\|_q,\|h^-\|_q ) > 0$ such that, every $u \in W^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ upper solution of \eqref{Plambda} satisfies \[ \min_{\Omega} u > -M_{\lambda}.\] \end{lemma} \begin{proof} Let us split the proof in two steps. \medbreak \noindent \textbf{Step 1:} \textit{There exists a positive constant $M_1 = M_1(p,q,N,|\Omega|,\lambda,\mu_1, \|c^{+}\|_q, \|h^{-}\|_q) > 0$ such that $\|u^{-}\| \leq M_1 $.} \medbreak First of all, observe that for every function $u\in W^{1,p}(\Omega)$, it follows that \begin{equation} \label{(1)} \nabla \big( (u^{-})^{\frac{p+1}{p}} \big) = \frac{p+1}{p} (u^{-})^{1/p} \nabla u^{-}, \quad \mbox{ and so, } \quad |\nabla u^{-}|^p u^{-} = \big( \frac{p}{p+1}\big)^p \big| \nabla (u^{-})^{\frac{p+1}{p}} \big|^p. \end{equation} Suppose that $u \in W^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is an upper solution of \eqref{Plambda} and let us consider $\varphi = u^{-}$ as a test function. Under the assumptions \eqref{lb2}, it follows that \begin{equation} \label{(2)} \begin{aligned} -\int_{\Omega} |\nabla u^{-}|^p dx & \geq - \lambda \int_{\Omega} c(x)|u^{-}|^p dx + \int_{\Omega} \mu(x) |\nabla u^{-}|^p u^{-} dx + \int_{\Omega} h(x)u^{-} dx \\ & \geq -\lambda \int_{\Omega} c^{+}(x)|u^{-}|^p dx + \mu_1 \int_{\Omega} |\nabla u^{-}|^p u^{-} dx - \int_{\Omega} h^{-}(x) u^{-} dx . \end{aligned} \end{equation} By \eqref{(1)} and \eqref{(2)}, we have that \begin{equation} \label{lb3} \mu_1 \Big( \frac{p}{p+1}\Big)^p \int_{\Omega} \big| \nabla (u^{-})^{\frac{p+1}{p}} \big|^p dx + \int_{\Omega} |\nabla u^{-}|^p dx \leq \lambda \int_{\Omega} c^{+}(x)|u^{-}|^p dx + \int_{\Omega} h^{-}(x)u^{-} dx\,. \end{equation} Firstly, we apply Young's inequality and, for every $\epsilon > 0$, it follows that \begin{equation*} \begin{aligned} \int_{\Omega} c^{+}(x)|u^{-}|^p dx & = \int_{\Omega} (c^{+}(x))^{1/p} |u^{-}|^{1/p} (c^{+}(x))^{\frac{p-1}{p}} |u^{-}|^{\frac{(p+1)(p-1)}{p}} dx \\ & \leq C(\epsilon) \int_{\Omega} c^{+}(x)u^{-} dx + \epsilon \int_{\Omega} c^{+}(x) \big( (u^{-})^{\frac{p+1}{p}} \big)^p dx \end{aligned} \end{equation*} Moreover, applying H\"older and Sobolev inequalities, observe that \begin{equation*} \int_{\Omega} c^{+}(x) \big( (u^{-})^{\frac{p+1}{p}} \big)^p dx \leq \|c^{+}\|_q \|(u^{-})^{\frac{p+1}{p}} \|_{\frac{qp}{q-1}}^p \leq S\, \|c^{+}\|_q \| \nabla (u^{-})^{\frac{p+1}{p}}\|_p^p \end{equation*} with $S$ the constant from the embedding from $W^{1,p}_0(\Omega)$ into $L^{\frac{qp}{q-1}}(\Omega)$. Hence, choosing $\epsilon$ small enough to ensure that $\epsilon\,S\,\lambda \|c^{+}\|_q\leq \frac{\mu_1}{2 } \big( \frac{p}{p+1} \big)^p$ and substituting in \eqref{lb3}, we apply again H\"older and Sobolev inequalities and we find a constant $C=C(\mu_1,\lambda, \|c^{+}\|_q, p, q, |\Omega|, N)$ such that \begin{equation*} \begin{aligned} \frac{\mu_1}{2} \Big( \frac{p}{p+1} \Big)^p \|\nabla (u^{-})^{\frac{p+1}{p}} \|_p^p + \|\nabla u^{-}\|_p^p \leq \big(\|h^{-}\|_{q} + C(\epsilon) \|c^{+}\|_q\big) \|u^{-}\|_{\frac{q}{q-1}} \leq C ( \|h^{-}\|_q + \|c^{+}\|_q )\|\nabla u^{-}\|_p. \end{aligned} \end{equation*} This allows to conclude that \begin{equation*} \|u^{-}\| \leq \Big(C\big( \|h^{-}\|_q + \|c^{+}\|_q \big)\Big)^{\frac{1}{p-1}} =: M_1 \, . \end{equation*} \noindent \textbf{Step 2:} \textit{Conclusion.} \medbreak Since \eqref{lb2} holds, every $u \in W^{1,p} (\Omega)\cap L^{\infty}(\Omega) $ upper solution of \eqref{Plambda} satisfies \begin{equation} \label{lbS2} \pLaplac u \geq \lambda c(x)|u|^{p-2}u - h^-(x)\,, \quad \textup{ in } \Omega\,. \end{equation} Moreover, observe that $0$ is also an upper solution of \eqref{lbS2}. Hence, since the minimum of two upper solution is an upper solution (see \cite[Corollary 3.3]{C_1997}), it follows that $\min(u,0)$ is an upper solution of \eqref{lbS2}. Furthermore, observe that $\min(u,0)$ is an upper solution of \[ \pLaplac u \geq \lambda c^{+}(x) |u|^{p-2} u - h^{-}(x)\,, \quad \textup{ in } \Omega\,.\] Hence, applying \cite[Theorem 6.1.2]{P_S_2007}, we have the existence of $M_2 = M_{2}(N,p,\lambda,|\Omega|,\|c^{+}\|_q) > 0$ and $M_3 = M_{3}(N,p,\lambda,|\Omega|,\|c^{+}\|_q) > 0$ such that \[ \sup_{\Omega}u^{-} \leq M_{2} \big[ \|u^{-}\|_p + \|h^-\|_q \big] \leq M_3 \big[\|u^{-}\| + \|h^-\|_q \big].\] Finally, the result follows by Step 1. \end{proof} \begin{remark} $ $ \begin{itemize} \item[a)]Observe that the lower bound does not depend on $h^+$ and $c^{-}$. In particular, we have the same lower bound for all $h\geq 0$ and all $c \leq 0$. \label{remuniflb} \item[b)]Since $c $ does not have a sign, there is no loss of generality in assuming $\lambda \geq 0$. If we consider $\lambda \leq 0$, we recover the same result with $M_{\lambda}$ depending on $\|c^{-}\|_q$ instead of $\|c^{+}\|_q\,.$ \end{itemize} \end{remark} \begin{prop} \label{lowerSol} Under the assumptions \eqref{A1}, for any $\lambda \in \R$, there exists $\underline{u}_{\lambda} \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ lower solution of \eqref{Plambda} such that, for every $\beta$ upper solution of \eqref{Plambda}, we have $\underline{u}_{\lambda} \leq \min\{0,\beta\}$. \end{prop} \begin{proof} We need to distinguish in our proof the cases $\lambda \leq 0$ and $\lambda \geq 0$. First we assume that $\lambda \leq 0$. By Lemma \ref{lowerBound}, we have a constant $M > 0$ such that every upper solution $\beta$ of \eqref{Plambda} satisfies $\beta \geq -M$. Let $\alpha$ be the solution of \begin{equation*}\label{B4} \pLaplac u = - h^{-}(x), \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega). \end{equation*} It is then easy to prove that $\underline{u} = \alpha -M \in W^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is a lower solution of \eqref{Plambda} with $\underline{u} \leq -M$. By the choice of $M$, this implies that $\underline{u}\leq \overline{u}$ for every upper solution $\overline{u}$ of \eqref{Plambda}. \medbreak Now, when $\lambda \geq 0$ we first introduce the auxiliary problem \begin{equation} \label{ls1} \left \{ \begin{aligned} \pLaplac u & = \lambda c(x) |u|^{p-2} u + \mu |\nabla u|^p - h^{-}(x) -1, & \textup{ in } \Omega\, , \\ u & = 0\, , & \textup{ on } \partial \Omega\, . \end{aligned} \right. \end{equation} Thanks to the previous lemma, there exists $M_{\lambda} > 0$ such that, for every $\beta_1 \in W^{1,p} (\Omega)\cap L^{\infty}(\Omega)$ upper solution of \eqref{ls1}, we have $\beta_1 \geq -M_{\lambda}$. Now, for $k > M_{\lambda}$, we introduce the problem \begin{equation} \label{ls2} \left \{ \begin{aligned} \pLaplac u & = -\lambda c(x) k^{p-1} - h^{-}(x) - 1\,, & \textup{ in } \Omega\, , \\ u & = 0\,, & \textup{ on } \partial \Omega\, , \end{aligned} \right. \end{equation} and denote by $\alpha_{\lambda}$ its solution. Since $-\lambda c(x) k^{p-1}- h^{-}(x) - 1 < 0$, the comparison principle (see for instance \cite[Lemma A.0.7]{P_1997}) implies that $\alpha_{\lambda} \leq 0$. Observe that, for every $\beta_1$ upper solution of \eqref{Plambda}, we have that \begin{equation*} \pLaplac \beta_1 \geq \lambda c(x)|\beta_1|^{p-2}\beta_1 + \mu |\nabla \beta_1|^p -h^{-}(x) -1 \geq - \lambda c(x) k^{p-1} - h^{-}(x) - 1 = \pLaplac \alpha_{\lambda}. \end{equation*} Consequently, it follows that \begin{equation*} \left\{ \begin{aligned} \pLaplac \beta_1 & \geq \pLaplac \alpha_{\lambda}\,, & \textup{ in } \Omega\,,\\ \beta_1 & \geq \alpha_{\lambda} = 0\,, & \textup{ on } \partial \Omega, \end{aligned} \right. \end{equation*} and, applying again the comparison principle, that $\beta_1 \geq \alpha_{\lambda}$. \smallbreak Now, we introduce the problem \begin{equation} \label{ls3} \left \{ \begin{aligned} \pLaplac u & = \lambda c(x) |\widetilde{T}_k(u)|^{p-2} \widetilde{T}_k(u) + \mu |\nabla u|^p - h^{-}(x) -1, & \textup{ in } \Omega, \\ u & = 0 & \textup{ on } \partial \Omega, \end{aligned} \right. \end{equation} where \begin{equation*} \widetilde{T}_k(s) = \left\{ \begin{aligned} -k\,, \qquad&\textup{ if } s \leq -k\,,\\ s\,, \qquad&\textup{ if } s > -k\,. \end{aligned} \right. \end{equation*} Observe that $\beta_1$ and $0$ are upper solutions of \eqref{ls3}. Recalling that the minimum of two upper solution is an upper solution (see \cite[Corollary 3.3]{C_1997}), it follows that $\overline{\beta} = \min \{0,\beta_1\}$ is an upper solution of \eqref{ls3}. As $\alpha_{\lambda}$ is a lower solution of \eqref{ls3} with $\alpha_{\lambda} \leq \overline{\beta}$, applying Theorem \ref{BMP1988}, we conclude the existence of $\underline{u}_{\lambda}$ minimum solution of \eqref{ls3} with $\alpha_{\lambda} \leq \underline{u}_{\lambda} \leq \overline{\beta} = \min \{0,\beta_1\}$. \smallbreak As, for every upper solution $\beta$ of \eqref{Plambda}, $\beta$ is an upper solution of \eqref{ls3}, we have $\alpha_{\lambda}\leq\beta$. Recalling that $\underline{u}_{\lambda}$ is the minimum solution of \eqref{ls3} with $\alpha_{\lambda}\leq \underline{u}_{\lambda} \leq 0$, we deduce that $\underline{u}_{\lambda}\leq \beta$. \smallbreak It remains to prove that $\underline{u}_{\lambda}$ is a lower solution of \eqref{Plambda}. First, observe that $\underline{u}_{\lambda}$ is an upper solution of \eqref{ls1}. By construction, this implies that $\underline{u}_{\lambda} \geq -M_{\lambda} > -k$. Consequently, $\underline{u}_{\lambda}$ is a solution of \eqref{ls1} and so, a lower solution of \eqref{Plambda}. \end{proof} \section{The Functional setting}\label{TLSATAP} Let us introduce some auxiliary functions which are going to play an important role in the rest of the work. Define \begin{equation} \label{defg} g(s) = \left \{ \begin{aligned} & \Big|\frac{p-1}{\mu}\Big( 1+\frac{\mu}{p-1}s \Big) \ln \Big(1+ \frac{\mu}{p-1}s \Big)\Big|^{p-2} \frac{p-1}{\mu}\Big( 1+\frac{\mu}{p-1}s \Big) \ln \Big(1+ \frac{\mu}{p-1}s \Big), \quad s > -\frac{p-1}{\mu}\,, \\ & \ 0\,, \hspace{116mm} s \leq - \frac{p-1}{\mu}\,, \end{aligned} \right.\hspace{-1mm} \end{equation} \[ G(s) = \int_{0}^s g(t)\, dt\, \qquad \mbox{ and } \qquad H(s) = \frac{1}{p}g(s)s - G(s)\,.\] In the following lemma we prove some properties of these functions. \begin{lemma} \label{gProperties} $ $ \begin{enumerate} \item[i)] The function $g$ is continuous on $\R$, satisfies $g > 0$ on $\R^{+}$ and there exists $D > 0$ with $-D \leq g \leq 0$ on $\R^{-}$. Moreover, $G \geq 0$ on $\R$. \item[ii)] For any $\delta > 0$, there exists $\overline{c} = \overline{c}(\delta,\mu,p) > 0$ such that, for any $s > \frac{p-1}{\mu}$, $g(s) \leq \overline{c}\, s^{p-1+\delta}$. \item[iii)] $\lim_{s\to +\infty}g(s)/s^{p-1} =+ \infty$ and $\lim_{s\to+\infty}G(s)/s^p = + \infty$. \item[iv)] There exists $R > 0$ such that the function $H$ satisfies $H(s) \leq \big(\frac{s}{t}\big)^{p-1}H(t)$, for $R \leq s \leq t$. \item[v)] The function $H$ is bounded on $\R^{-}$. \end{enumerate} \end{lemma} \begin{proof} \noindent \textit{i)} By definition, it is obvious that $g$ is continuous, $g > 0$ on $\R^{+}$ and $g$ is bounded and $g \leq 0$ on $\R^{-}$. This implies also that $ G \geq 0$ by integration. \medbreak \noindent \textit{ii)} First of all, recall that for any $\epsilon > 0$ there exists $c = c(\epsilon) > 0$ such that $\ln(s) \leq c(\epsilon)s^{\epsilon}$ for all $s \in (1,\infty)$. This implies that, for any $\delta>0$, $$ \lim_{s\to+\infty} \frac{g(s)}{s^{p-1+\delta}}= \lim_{s\to+\infty} \Big(\frac{(p-1)(1+\frac{\mu}{p-1}s)}{\mu s}\Big)^{p-1} \frac{\big(\ln(1+\frac{\mu}{p-1}s)\big)^{p-1}}{s^{\delta}}=0\,. $$ Hence, there exists $R>\frac{p-1}{\mu}$ such that, for all $s>R$, $$ \frac{g(s)}{s^{p-1+\delta}}\leq 1\,. $$ As the function $ \frac{g(s)}{s^{p-1+\delta}}$ is continuous on the compact set $[\frac{p-1}{\mu},R]$, we have a constant $C>0$ with $$ \frac{g(s)}{s^{p-1+\delta}}\leq C \quad \mbox{ on } [\tfrac{p-1}{\mu},R]\,. $$ The result follows for $\overline C = \max (C,1)$. \medbreak \noindent \textit{iii)} As $$ \lim_{s\to+\infty} \frac{\frac{p-1}{\mu}\big(1+\frac{\mu}{p-1}s\big) \ln\big(1+\frac{\mu}{p-1}s\big) }{s}=+\infty\,, $$ and $p>1$, we easily deduce that $$ \lim_{s\to+\infty}\frac{g(s)}{s^{p-1}} =+\infty $$ and, by L'Hospital's rule $$ \lim_{s\to+\infty}\frac{G(s)}{s^{p}} =+\infty\,. $$ \noindent \textit{iv)} First of all, integrating by parts, we observe that, for any $s \geq 0\,,$ \begin{equation*} G(s) = \Big( \frac{p-1}{\mu} \Big)^{p} \Big[ \frac{1}{p} \Big(1+\frac{\mu}{p-1} s \Big)^p \Big(\ln\big(1+\frac{\mu}{p-1} s \big)\Big)^{p-1} - \frac{\mu}{p} \int_0^s \Big(1+\frac{\mu}{p-1} t \Big)^{p-1} \Big(\ln\big(1+\frac{\mu}{p-1} t \big)\Big)^{p-2} dt \Big], \end{equation*} and so, for any $s \geq 0$, it follows that \begin{equation*} H(s) = \frac{1}{p} \Big( \frac{p-1}{\mu} \Big)^{p} \Big[ \mu \int_0^s \Big(1+\frac{\mu}{p-1} t \Big)^{p-1} \Big(\ln\big(1+\frac{\mu}{p-1} t \big)\Big)^{p-2} dt - \Big(1+\frac{\mu}{p-1} s \Big)^{p-1}\Big(\ln\big(1+\frac{\mu}{p-1} s \big) \Big)^{p-1} \Big]. \end{equation*} To prove \textit{iv)}, we show that the function $\varphi(s):= \frac{H(s)}{s^{p-1}}$ is non-decreasing on $[R,+\infty)$ for some $R>0$. Observe that $$ \varphi'(s) = \frac{1}{s^p}[ H'(s)s-(p-1)H(s)]\,. $$ Hence, we just need to prove that $H'(s)s-(p-1)H(s) \geq 0$ for $s\geq R$. After some simple computations, we see that it is enough to prove the existence of $R>0$ such that, for all $s\geq R$, $\kappa(s)\geq 0$ where $$ \begin{aligned} \kappa(s)=& \Big(1 + \frac{\mu}{p-1} s \Big)^{p-2} \Big(\ln\big(1 + \frac{\mu}{p-1} s \big) \Big)^{p-2} \Big( \big( \frac{\mu s}{p-1} \big)^2 + \ln\big(1 + \frac{\mu}{p-1} s \big) \Big) \\ &\hspace{70mm} - \mu \int_0^s \Big(1+\frac{\mu}{p-1} t \Big)^{p-1} \Big(\ln\big(1+\frac{\mu}{p-1} t \big)\Big)^{p-2} dt \,. \end{aligned} $$ Observe that \begin{equation*} \begin{aligned} \kappa'(s) & = \frac{\mu}{p-1} \Big(1 + \frac{\mu}{p-1} s \Big)^{p-3} \Big(\ln \big(1 + \frac{\mu}{p-1} s \big) \Big)^{p-3} \\ &\hspace{50mm} \Big[ (p-2)\Big(\frac{\mu s} {p-1} - \ln\big(1 + \frac{\mu}{p-1} s \big) \Big)^{2} + \Big(\frac{\mu s}{p-1}\Big)^2 \ln\big(1 + \frac{\mu}{p-1} s \big) \Big] . \end{aligned} \end{equation*} Hence, we distinguish two cases: \begin{enumerate} \item[i)] In case $p \geq 2$, it is obvious that $\kappa'(s) > 0$, for any $s > 0$. This implies that $\kappa$ is increasing and so, that $\kappa(s) > 0$ for $s > 0$, since $\kappa(0) = 0$. \item[ii)] If $ 1 < p < 2$, as $\lim_{s\to\infty} \kappa'(s)=+\infty$, there exists $R_1 > 0$ such that, for any $s \geq R_1$, we have $\kappa'(s) > 1$ and hence, there exists $R_2 \geq R_1$ such that $\kappa(s) > 0$, for any $s \geq R_2$. \end{enumerate} In any case, we can conclude the existence of $R \geq 0$ such that $\kappa(s) > 0$ for any $s \geq R$. Consequently, there exists $R > 0$ such that $\varphi'(s) > 0$, for $s \geq R$, which means that $\varphi$ is non-decreasing for $s \geq R$ and hence $H$ satisfies $H(s) \leq \big(\frac{s}{t}\big)^{p-1}H(t)$, for $R \leq s \leq t$. \medbreak \noindent \textit{v)} This follows directly from the definition of the functions $g$ and $G$. \end{proof} Next, we define the function \begin{equation} \label{alpha} \alpha_{\lambda} = \frac{p-1}{\mu} \Big( e^{\frac{\mu}{p-1}\underline{u}_{\lambda}} -1 \Big) \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\, , \end{equation} where $\underline{u}_{\lambda} \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is the lower solution of \eqref{Plambda} obtained in Proposition \ref{lowerSol}. Before going further, since $\underline{u}_{\lambda} \leq 0$, observe that $0 \geq \alpha_{\lambda} \geq -\frac{p-1}{\mu}+\epsilon$ for some $\epsilon>0$. \medbreak Now, for any $\lambda \in \R$, let us consider the auxiliary problem \[ \label{Qlambda} \tag{$Q_{\lambda}$} \pLaplac v = f_{\lambda}(x,v)\,, \quad v \in W_0^{1,p}(\Omega)\,,\] where \begin{equation} \label{flambda} f_{\lambda}(x,s) = \left\{ \begin{aligned} & \lambda c(x) g(s) + \Big( 1 + \frac{\mu}{p-1}s\Big)^{p-1} h(x)\,, \quad &\mbox{if }s \geq \alpha_{\lambda}(x)\,,\\ & \lambda c(x) g(\alpha_{\lambda}(x)) + \Big( 1 + \frac{\mu}{p-1}\alpha_{\lambda}(x) \Big)^{p-1} h(x)\,, \quad &\mbox{if } s \leq \alpha_{\lambda}(x)\,, \end{aligned} \right. \end{equation} where $g$ is defined by \eqref{defg}. In the following lemma, we prove some properties of the solutions of \eqref{Qlambda}. \begin{lemma} \label{linkProblem} Assume that \eqref{A1} holds. Then, it follows that: \begin{enumerate} \item[i)] Every solution of \eqref{Qlambda} belongs to $L^{\infty}(\Omega)$. \item[ii)] Every solution $v$ of \eqref{Qlambda} satisfies $v \geq \alpha_{\lambda}$. \item[iii)] A function $v \in W_0^{1,p}(\Omega)$ is a solution of \eqref{Qlambda} if, and only if, the function \[ u = \frac{p-1}{\mu} \ln \big( 1 + \frac{\mu}{p-1}v \big) \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\] is a solution of \eqref{Plambda}. \end{enumerate} \end{lemma} \begin{proof} \textit{i)} This follows directly from \cite[Theorem IV-7.1]{L_U_1968}. \medbreak \noindent \textit{ii)} First of all, observe that $\alpha_{\lambda}$ is a lower solution of \eqref{Qlambda}. For a solution $v \in W_0^{1,p}(\Omega)$ of \eqref{Qlambda}, we have $v \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ by the previous step and, for all $\varphi \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ with $\varphi \geq 0$, \[ \int_{\Omega} \big[ |\nabla v|^{p-2} \nabla v - |\nabla \alpha_{\lambda}|^{p-2} \nabla \alpha_{\lambda} \big] \nabla \varphi\, dx \geq \int_{\Omega} \big[ f_{\lambda}(x,v) - f_{\lambda}(x,\alpha_{\lambda}) \big] \varphi\, dx.\] Now, since there exist constants $d_1$, $d_2 > 0$ such that for all $\xi$, $\eta \in \mathbb{R}^{N}} %R^{N$, \begin{equation} \label{peralScalarProduct} \langle |\xi|^{p-2}\xi - |\eta|^{p-2}\eta \,, \xi - \eta \rangle \geq \left\{ \begin{aligned} & d_1 (|\xi|+|\eta|)^{p-2}|\xi-\eta|^2\,, \textup{ if } 1<p<2\,,\\ & d_2 |\xi-\eta|^p\,, \textup{ if } p \geq 2\,, \end{aligned} \right. \end{equation} (see for instance \cite[Lemma A.0.5]{P_1997}), we choose $\varphi = (\alpha_{\lambda} - v)^{+}$ and obtain that \begin{equation*} 0 \geq \int_{ \{\alpha_{\lambda} \geq v\} } \big[ |\nabla v|^{p-2} \nabla v - |\nabla \alpha_{\lambda}|^{p-2} \nabla \alpha_{\lambda} \big] \nabla (\alpha_{\lambda} - v)\, dx \geq \int_{ \{\alpha_{\lambda} \geq v\} } \big[ f_{\lambda}(x,v) - f_{\lambda}(x,\alpha_{\lambda}) \big] (\alpha_{\lambda} - v)\, dx = 0\,. \end{equation*} Consequently, using again \eqref{peralScalarProduct}, we deduce that $\alpha_{\lambda} = v$ in $\{\alpha_{\lambda} \geq v\} $ and so, that $v \geq \alpha_{\lambda}$. \medbreak \noindent \textit{iii)} Suppose that $v \in W_0^{1,p}(\Omega)$ is a solution of \eqref{Qlambda}. The first parts, $i)$, $ii)$ imply that $v \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is such that $v \geq \alpha_{\lambda} \geq -\frac{p-1}{\mu}+\epsilon$ with $\epsilon>0$ and hence $u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$. Let us prove that $u$ is a (weak) solution of \eqref{Plambda}. Let $\phi$ be an arbitrary function belonging to $\mathcal{C}_0^{\infty}(\Omega)$ and define $\varphi = \phi/(1+\frac{\mu}{p-1}v)^{p-1}$. It follows that $\varphi \in W_0^{1,p}(\Omega)$. As $e^{\frac{\mu u}{p-1}} = 1 + \frac{\mu}{p-1}v$, we have the following identity \begin{equation*} \begin{aligned} \int_{\Omega} |\nabla v |^{p-2} \nabla v \nabla \varphi\ dx & = \int_{\Omega} e^{\mu u} |\nabla u|^{p-2} \nabla u \Big( \frac{\nabla \phi}{\big(1 + \frac{\mu}{p-1}v\big)^{p-1}} - \frac{\mu\, \phi\, \nabla v}{\big(1+\frac{\mu}{p-1}v\big)^p} \Big) \,dx \\ & = \int_{\Omega} \frac{e^{\mu u}}{\big(1 + \frac{\mu}{p-1}v\big)^{p-1}} |\nabla u|^{p-2} \nabla u \Big( \nabla \phi - \dfrac{\mu \phi \nabla \big(\frac{p-1}{\mu}(e^{\frac{\mu}{p-1}u}-1)\big)}{1+ \frac{\mu}{p-1}v} \Big) \,dx \\ & = \int_{\Omega} |\nabla u|^{p-2} \nabla u \big( \nabla \phi - \mu \phi \nabla u \big) \,dx = \int_{\Omega}|\nabla u|^{p-2} \nabla u \nabla \phi\, dx - \mu \int_{\Omega} |\nabla u|^p \phi\, dx. \end{aligned} \end{equation*} On the other hand, by definition of $g$, observe that \begin{equation*} \begin{aligned} \int_{\Omega} \Big[ \lambda c(x) g(v) +& \big(1+\frac{\mu}{p-1}v\big)^{p-1} h(x) \Big] \varphi\, dx \\ & = \int_{\Omega} \Big[ \lambda c(x) \Bigl|\frac{p-1}{\mu} \ln\bigl(1+\frac{\mu}{p-1}v \bigr)\Bigr|^{p-2} \Big(\frac{p-1}{\mu} \ln \bigl(1+\frac{\mu}{p-1}v \bigr)\Big) +h(x) \Big] \phi\, dx \\ & = \int_{\Omega} \bigl[ \lambda c(x) |u|^{p-2}u + h(x) \bigr] \phi\, dx. \end{aligned} \end{equation*} As $v$ is a solution of \eqref{Qlambda} we deduce from these two identities that \[ \int_{\Omega}|\nabla u|^{p-2} \nabla u \nabla \phi\ dx = \int_{\Omega} \bigl[ \lambda c(x) |u|^{p-2}u + \mu |\nabla u|^p +h(x) \bigr] \phi\, dx,\] and so, $u$ is a solution of \eqref{Plambda}, as desired. \medbreak In the same way, assume that $u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ is a solution of \eqref{Plambda}. By Proposition \ref{lowerSol} we know that $u \geq\underline{u}_{\lambda}$. Hence, it follows that $ v = \frac{p-1}{\mu} \big( e^{\frac{\mu u}{p-1}} - 1 \big) \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ and satisfies $v \geq \alpha_{\lambda} \geq -\frac{p-1}{\mu}+\epsilon$ for some $\epsilon>0$. Arguing exactly as before, we deduce that $v$ is a solution of \eqref{Qlambda}. \end{proof} \begin{remark} \label{linkLowerUpper} Arguing exactly as in the proof of Lemma \ref{linkProblem}, $iii)$, we can show that $v_1 \in H^1(\Omega) \cap L^{\infty}(\Omega)$ (respectively $v_2 \in H^1(\Omega) \cap L^{\infty}(\Omega)$) is a lower solution (respectively an upper solution) of \eqref{Qlambda} if, and only if, the function \[ u_1 = \frac{p-1}{\mu} \ln\big(1+\frac{\mu}{p-1}v_1 \big) \qquad \qquad \Big( \textup{respectively } u_2 = \frac{p-1}{\mu} \ln\big(1+\frac{\mu}{p-1}v_2 \big) \Big)\] is a lower solution (respectively an upper solution) of \eqref{Plambda}. \end{remark} The interest of problem \eqref{Qlambda} comes from the fact that it has a variational formulation. We can obtain the solutions of \eqref{Qlambda} as critical points of the functional $I_{\lambda}: W_0^{1,p}(\Omega) \rightarrow \R$ defined as \begin{equation}\label{defI} I_{\lambda}(v) = \frac{1}{p} \int_{\Omega} |\nabla v|^p \,dx- \int_{\Omega} F_{\lambda}(x,v) dx\,, \end{equation} where we define $F_{\lambda}(x,s)=\int_0^s f_{\lambda}(x,t)\,dt$ i.e. \begin{equation} \label{defFLambdaPos} F_{\lambda}(x,s) = \lambda c(x)G(s) + \frac{p-1}{\mu p} \Big( 1 + \frac{\mu}{p-1} s \Big)^p h(x), \quad\textup{ if } s \geq \alpha_{\lambda}(x)\,, \end{equation} and \begin{equation} \label{defFLambdaNeg} \begin{aligned} F_{\lambda}(x,s) = \Big[\lambda c(x)g(\alpha_{\lambda}(x)) & + \big(1 + \frac{\mu}{p-1}\alpha_{\lambda}(x)\big)^{p-1}h(x) \Big](s-\alpha_{\lambda}) \\ & + \lambda c(x)G(\alpha_{\lambda}(x)) + \frac{p-1}{\mu p} \big( 1 + \frac{\mu}{p-1} \alpha_{\lambda}(x) \big)^p h(x), \quad \textup{ if } s\leq \alpha_{\lambda}(x)\,. \end{aligned} \end{equation} Observe that under the assumptions \eqref{A1}, since $g$ has subcritical growth (see Lemma \ref{gProperties}), $I \in \mathcal{C}^1(W_0^{1,p}(\Omega),\R)$ (see for example \cite{D_J_M_2001} page 356). \begin{lemma} \label{strongConvergenceCerami} Assume that \eqref{A1} holds and let $\lambda \in \R$ be arbitrary, Then, any bounded Cerami sequence for $I_{\lambda}$ admits a convergent subsequence. \end{lemma} \begin{proof} Let $\{v_n\} \subset W_0^{1,p}(\Omega)$ be a bounded Cerami sequence for $I_{\lambda}$ at level $d \in \R$. We are going to show that, up to a subsequence, $v_n \rightarrow v \in W_0^{1,p}(\Omega)$ for a $ v \in W_0^{1,p}(\Omega)$. \medbreak Since $\{v_n\}$ is a bounded sequence in $W_0^{1,p}(\Omega)$, up to a subsequence, we can assume that $v_n \rightharpoonup v$ in $W_0^{1,p}(\Omega)$, $v_n \rightarrow v$ in $L^r(\Omega)$, for $1 \leq r < p^{\ast}$, and $v_n \rightarrow v$ a.e. in $\Omega$. First of all, recall that $\langle I_{\lambda}'(v_n), v_n-v \rangle \to 0$ with \begin{equation*} \begin{aligned} \langle I_{\lambda}'(v_n), v_n-v \rangle = \int_{\Omega} &|\nabla v_n|^{p-2} \nabla v_n \nabla (v_n-v)\, dx - \int_{\{v_n \geq \alpha_{\lambda}\}} \lambda c(x)g(v_n)(v_n-v) \, dx \\ & - \int_{\{v_n \geq \alpha_{\lambda}\}} \big(1+\frac{\mu}{p-1}v_n\big)^{p-1} (v_n-v)\, h(x)\, dx - \int_{\{v_n \leq \alpha_{\lambda}\}} f_{\lambda}(x,\alpha_{\lambda}(x))(v_n-v)\, dx . \end{aligned} \end{equation*} Let $0<\delta<(\frac{p}{N}-\frac1q)p^*$, $r<p^*$ and $s<\frac{p^*}{p-1+\delta}$ such that $\frac1q+\frac1r+\frac1s=1$. Using Lemma \ref{gProperties} $ii)$, and the Sobolev embedding as well as H\"older inequality, we have that \begin{equation*} \begin{aligned} \Big| \lambda \int_{\{v_n \geq \alpha_{\lambda}\}} c(x)g(v_n)(v_n-v)\, dx \Big| &\leq |\lambda| \int_{\Omega} |c(x)||g(v_n)||v_n-v|\, dx \leq |\lambda| \|c\|_q \|g(v_n)\|_s \|v_n - v\|_r \\ & \leq D|\lambda| \|c\|_q \big( 1+\|v_n\|_{(p-1+\delta)s}^{p-1+\delta} \big) \|v_n-v\|_r \\ & \leq DS |\lambda| \|c\|_q \big( 1+\|v_n\|^{p-1+\delta} \big) \|v_n-v\|_r\,. \end{aligned} \end{equation*} Since $\|v_n\|$ is bounded and $v_n \rightarrow v$ in $L^r(\Omega)$, for $1 \leq r < p^{\ast}$, we obtain \[ \lambda \int_{\{v_n \geq \alpha_{\lambda}\}} c(x)g(v_n)(v_n-v) \,dx \to 0\,.\] Arguing in the same way, we have \[ \int_{\{v_n \geq \alpha_{\lambda}\}} \big(1+\frac{\mu}{p-1}v_n\big)^{p-1} (v_n-v)\, h(x)\, dx + \int_{\{v_n \leq \alpha_{\lambda}\}} f_{\lambda}(x,\alpha_{\lambda}(x)) (v_n-v)\, dx \to 0\,.\] So, we deduce that \begin{equation} \label{sc1} \int_{\Omega} |\nabla v_n|^{p-2} \nabla v_n \nabla(v_n-v)\, dx \to 0\,. \end{equation} Hence, applying \cite[Theorem 10]{D_J_M_2001}, we conclude that $v_n \rightarrow v $ in $W_0^{1,p}(\Omega)$, as desired. \end{proof} \section{Sharp existence results on the limit coercive case} \label{Coercive-Case} In this section, following ideas from \cite[Section 3]{A_DC_J_T_2015}, we prove Theorem \ref{coercive-louis}. As a preliminary step, considering $\mu >0$ constant, we introduce \begin{equation*} m_{p,\lambda}:= \left\{ \begin{aligned} & \inf_{u \in W_{\lambda}} \int_{\Omega} \Big(|\nabla u|^p - \big(\frac{\mu}{p-1}\big)^{p-1}h(x)|u|^p\,\Big) dx\,, \quad & \textup{ if} \quad W_{\lambda} \neq \emptyset\,, \\ & +\infty\,, & \textup{ if} \quad W_{\lambda} = \emptyset\,. \end{aligned} \right. \end{equation*} where \[ W_{\lambda}:= \{ w \in W_0^{1,p}(\Omega): \lambda c(x)w(x) = 0 \textup{ a.e. } x \in \Omega\,,\ \|w\| = 1\}\, \] and we define \[ m:= \inf_{u \in W_0^{1,p}(\Omega)} I_{\lambda}(u) \in \R \cup \{-\infty\}\,.\] \begin{prop} \label{globalMinimum} Assume that \eqref{A1} holds, $\lambda \leq 0$ and that $m_{p,\lambda} > 0$. Then $m$ is finite and it is reached by a function $v \in W_0^{1,p}(\Omega)$. Consequently the problem \eqref{Plambda} has a solution. \end{prop} \begin{proof} To prove that $I_{\lambda}$ has a global minimum since, by Lemma \ref{strongConvergenceCerami}, any bounded Cerami sequence has a convergent subsequence it suffices to show that $I_{\lambda}$ is coercive. Having found a global minimum $v \in W_0^{1,p}(\Omega)$ we deduce, by Lemma \ref{linkProblem}, that $u = \frac{p-1}{\mu} \ln \big( 1 + \frac{\mu}{p-1}v \big)$ is a solution of \eqref{Plambda}. To show that $I_{\lambda}$ is coercive we consider an arbitrary sequence $\{v_n\} \subset W_0^{1,p}(\Omega)$ such that $\|v_n\| \to \infty$ and we prove that \[ \lim_{n \rightarrow \infty} I_{\lambda}(v_n) = +\infty\,.\] \medbreak Assume by contradiction that, along a subsequence, $I_{\lambda}(v_n)$ is bounded from above and hence \begin{equation} \label{B7} \limsup_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \leq 0\,. \end{equation} We introduce the sequence $w_n = \frac{v_n}{\|v_n\|}$, for all $n \in \N$ and observe that, up to a subsequence $w_n \rightharpoonup w$ weakly in $W_0^{1,p}(\Omega)$, $w_n \rightarrow w$ in $L^r(\Omega)$, for $1 \leq r < p^{\ast}\,,$ and $w_n \rightarrow w$ a.e. in $\Omega$. We consider two cases: \medbreak \noindent\textit{Case 1): $w^+ \not \in W_{\lambda}$.} In that case, the set $\Omega_0 = \{ x \in \Omega: \lambda c(x)w^+(x) \neq 0\} \subset \Omega$ has non-zero measure and so, it follows that $v_n(x) = w_n(x)\,\|v_n\| \to \infty$ a.e. in $\Omega_0$. Hence, taking into account that $G \geq 0$ and $\lim_{s\to+\infty}G(s)/s^p = + \infty$ (see Lemma \ref{gProperties}) and using Fatou's Lemma, we have \begin{equation} \label{B8} \begin{aligned} \limsup_{n \rightarrow \infty} \int_{\Omega} \frac{\lambda c(x)G(v_n)}{|v_n|^p} |w_n|^p\, dx & \leq \limsup_{n \rightarrow \infty} \int_{\Omega_0} \frac{\lambda c(x)G(v_n)}{|v_n|^p} |w_n|^p \,dx \\ &\leq \int_{\Omega_0} \limsup_{n \rightarrow \infty} \frac{\lambda c(x)G(v_n)}{|v_n|^p}|w_n|^p \, dx = -\infty\,. \end{aligned} \end{equation} On the other hand, observe that for any $v \in W_0^{1,p}(\Omega)$, we can rewrite \begin{equation*} \begin{aligned} & I_{\lambda}(v) = \frac{1}{p} \int_{\Omega} |\nabla v|^p \, dx - \int_{\Omega} \lambda c(x) G(v) \, dx + \int_{\{v \leq \alpha_{\lambda}\}} \lambda c(x)G(v)\, dx \\ & \hspace{58mm} -\frac{p-1}{p\mu} \int_{\{v \geq \alpha_{\lambda}\}} \Big(1+\frac{\mu}{p-1}v \Big)^p h(x)\, dx - \int_{\{v \leq \alpha_{\lambda}\}} F_{\lambda}(x,v)\, dx\,. \end{aligned} \end{equation*} Hence, considering together \eqref{B7} and \eqref{B8}, we obtain \[ 0 \geq \limsup_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \geq \liminf_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \geq -C - \limsup_{n \rightarrow \infty} \int_{\Omega} \frac{\lambda c(x)G(v_n)}{\|v_n\|^p} \, dx = + \infty\,,\] and so, \textit{Case 1)} cannot occur. \medbreak \noindent\textit{Case 2): $w^+ \in W_{\lambda}$.} First of all, since $\lambda c \leq 0$ and $G \geq 0$ (see Lemma \ref{gProperties}), observe that for any $v \in W_0^{1,p}(\Omega)$, \begin{equation*} \begin{aligned} & I_{\lambda}(v) \geq \frac{1}{p}\int_{\Omega} \Big( |\nabla v|^p - \big(\frac{\mu}{p-1} \big)^{p-1} h(x) (v^{+})^p \Big) \,dx - \frac{1}{p}\big(\frac{\mu}{p-1}\big)^{p-1} \int_{\{v \geq \alpha_{\lambda}\}}h(x) (v^{-})^p \, dx \\ & \hspace{40mm}- \frac{p-1}{\mu p} \int_{\{v \geq \alpha_{\lambda}\}} \Big[\big(1+\frac{\mu}{p-1}v\big)^{p} -\big(\frac{\mu}{p-1}\big)^p |v|^p \Big]h(x)\,dx - \int_{\{v \leq \alpha_{\lambda}\}} F_{\lambda}(x,v) \,dx\,. \end{aligned} \end{equation*} Moreover, observe that \begin{equation} \label{ineqPminus1} \begin{aligned} \frac{1}{p} \Big| \int_{\{v \geq \alpha_{\lambda}\}} \Big[ \big( 1 + \frac{\mu}{p-1} v \big)^p & - \big( \frac{\mu}{p-1} \big)^p |v|^p \Big] h(x) \,dx \Big| \\ & \hspace{20mm}= \Big| \int_{\{v \geq \alpha_{\lambda}\}} \Big( \int_0^1 \big| s + \frac{\mu}{p-1} v \big|^{p-2} \big( s + \frac{\mu}{p-1} v \big) \,ds \Big) h(x) \, dx \Big| \\ & \hspace{20mm}\leq \int_{\Omega} \Big( 1+\frac{\mu}{p-1} |v| \Big)^{p-1} |h(x)|\, dx \leq D \|h\|_q\, \big(1+ \|v\|^{p-1}\big)\,, \end{aligned} \end{equation} for some constant $D > 0$. Thus, for any $v \in W_0^{1,p}(\Omega)$, it follows that \begin{equation} \label{B13} \begin{aligned} I_{\lambda}(v) \geq \frac{1}{p}\int_{\Omega} \Big( |\nabla v|^p - \big(\frac{\mu}{p-1} \big)^{p-1} h(x) (v^{+})^p \Big) \,dx & - \frac{1}{p}\big(\frac{\mu}{p-1}\big)^{p-1} \int_{\{v \geq \alpha_{\lambda}\}}h(x) (v^{-})^p \, dx \\ & - D \|h\|_q\, \big(1+\|v\|^{p-1}\big)- \int_{\{v \leq \alpha_{\lambda}\}} F_{\lambda}(x,v) \,dx\,. \end{aligned} \end{equation} Hence, using that by the definition of $F_{\lambda}$ (see \eqref{defFLambdaPos} and \eqref{defFLambdaNeg}) there exists $m \in L^q(\Omega)\,,\ q > \max\{N/p,1\}$, such that, for a.e. $x \in \Omega$ and all $s \leq 0$, \begin{equation} \label{Flambdaminus} |F_{\lambda}(x,s)|\leq m(x) (1+|s|)\,, \end{equation} and applying \eqref{B7} and \eqref{B13}, we deduce, as $w^{+} \in W_{\lambda}$, that \[ 0 \geq \limsup_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \geq \liminf_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \geq \frac{1}{p} \int_{\Omega} \Big( |\nabla w|^p - \big(\frac{\mu}{p-1} \big)^{p-1} h(x) (w^{+})^p \Big) \,dx \geq \frac{1}{p} \min\{1, m_{p,\lambda}\} \|w\|^p \geq 0\,,\] and so, that \begin{equation*} \lim_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} = 0 \qquad \textup{ and } \qquad w \equiv 0\,. \end{equation*} Finally, taking into account that $w_n \rightarrow 0$ in $L^r(\Omega)$, for $1 \leq r < p^{\ast}$, we obtain the contradiction \[ 0 = \lim_{n \rightarrow \infty} \frac{I_{\lambda}(v_n)}{\|v_n\|^p} \geq \frac{1}{p}\,.\] Hence, \textit{Case 2)} cannot occur. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{coercive-louis}}] To prove this result, we look for a couple of lower and upper solutions $(\alpha, \beta)$ of \eqref{Plambda} with $\alpha \leq \beta$ and then we apply Theorem \ref{BMP1988}. First, assume that both $\|\mu^{+}\|_{\infty} >0$ and $\|\mu^{-}\|_{\infty} >0$. Observe that any solution of \begin{equation} \label{B11} \pLaplac u = \lambda c(x)|u|^{p-2}u + \|\mu^{+}\|_{\infty}|\nabla u|^p + h(x), \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega), \end{equation} is an upper solution of \eqref{Plambda} and, any solution of \begin{equation} \label{B12} \pLaplac u = \lambda c(x)|u|^{p-2}u - \|\mu^{-}\|_{\infty}|\nabla u|^p + h(x), \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega), \end{equation} is a lower solution of \eqref{Plambda}. Now, since $m_{p,\lambda}^{+} > 0$, Proposition \ref{globalMinimum} ensures the existence of $\beta \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ solution of \eqref{B11}. In the same way, $m_{p,\lambda}^{-} > 0$ implies the existence of $v\in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ solution of \begin{equation*} \pLaplac v = \lambda c(x)|v|^{p-2}v + \|\mu^{-}\|_{\infty}|\nabla v|^p - h(x), \quad v \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega), \end{equation*} and hence $\alpha=-v$ is a solution of \eqref{B12}. Moreover, Lemma \ref{lemmaUniqueness} implies $\alpha$, $\beta \in W_0^{1,p}(\Omega) \cap \mathcal{C}(\overline{\Omega})$. Hence, since $\alpha$ is a lower solution of \eqref{B11}, it follows that $\alpha \leq \beta$, thanks to Theorem \ref{compPrinciple}. Thus, we can apply Theorem \ref{BMP1988} to conclude the proof. Now note that if $\|\mu^{+}\|_{\infty} =0$, \eqref{B11} reduces to \begin{equation} \pLaplac u = \lambda c(x)|u|^{p-2}u + h(x), \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega), \end{equation} which has a solution by \cite[Theorem 13]{D_J_M_2001}. This solution corresponds again to an upper solution to $(P_{\lambda})$. Similarly, we can justify the existence of the lower solution when $\|\mu^{-}\|_{\infty} =0$. \end{proof} \section{A necessary and sufficient condition for the existence of a solution to $(P_0)$} \label{Weakly-coercive-Case} In this section we prove Theorem \ref{th3}. First of all, following the ideas of \cite{A_DC_J_T_2015}, inspired in turn in ideas of \cite{A_DA_P_2006}, we find a necessary condition for the existence of a solution of \eqref{P0}. Recall that the problem \eqref{P0} is given by \[ \label{P0} \tag{$P_0$} \pLaplac u = \mu |\nabla u|^p + h(x)\, , \quad u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)\,.\] \begin{prop} \label{necessaryCondition} Assume that \eqref{A1} holds and suppose that \eqref{P0} has a solution. Then $m_p$ defined by \eqref{mp} satisfies $m_p > 0$. \end{prop} \begin{proof} Assume that \eqref{P0} has a solution $u \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$. Then, for any $\phi \in \mathcal{C}_0^{\infty}(\Omega)$, it follows that \begin{equation}\label{nc1} \int_{\Omega} |\nabla u|^{p-2} \nabla u \nabla(|\phi|^p )\, dx - \mu \int_{\Omega} |\nabla u|^p |\phi|^p\,dx - \int_{\Omega}h(x)|\phi|^p \,dx = 0\,. \end{equation} Now, applying Young's inequality, observe that \begin{equation*} \begin{aligned} \int_{\Omega} |\nabla u|^{p-2}\nabla u \nabla (|\phi|^p)\, dx & = p \int_{\Omega} |\phi|^{p-2}\phi |\nabla u|^{p-2}\nabla u \nabla \phi \, dx \leq p \int_{\Omega} |\phi|^{p-1} |\nabla u|^{p-1} | \nabla \phi| \, dx \\ & \leq \mu \int_{\Omega} |\phi|^p |\nabla u|^p\, dx + \left( \frac{p-1}{\mu} \right)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx\,. \end{aligned} \end{equation*} Hence, substituting in \eqref{nc1}, multiplying by $\left( \frac{\mu}{p-1} \right)^{p-1}$ and using the density of $\mathcal{C}_0^{\infty}(\Omega)$ in $ W_0^{1,p}(\Omega)$, we obtain \begin{equation}\label{nc2} \int_{\Omega} \Big(|\nabla \phi|^p - \big( \frac{\mu}{p-1} \big)^{p-1} h(x) |\phi|^p \Big)\,dx \geq 0\,, \quad \forall\ \phi \in W_0^{1,p}(\Omega)\,. \end{equation} Arguing by contradiction, assume that \[ \inf\Bigg\{ \int_{\Omega} \Big(|\nabla \phi|^p - \big( \frac{\mu}{p-1} \big)^{p-1} h(x) |\phi|^p \Big)\,dx: \phi \in W_0^{1,p}(\Omega),\ \|\phi\| = 1 \Bigg\} = 0. \] By standard arguments there exists $ \phi_0 \in \mathcal{C}^{0,\tau}(\overline{\Omega})$ for some $\tau \in (0,1)$, with $\phi_0 > 0$ in $\Omega$ such that \begin{equation}\label{nc3} \int_{\Omega} |\nabla \phi_0 |^p\, dx = \Big( \frac{\mu}{p-1} \Big)^{p-1} \int_{\Omega} h(x) |\phi_0|^p \,dx\,. \end{equation} Now, substituting the above identity in \eqref{nc1} with $\phi = \phi_0$, we have that \begin{equation}\label{nc4} \int_{\Omega} \Big(|\nabla \phi_0|^p + (p-1) \big( \frac{\mu}{p-1} \big)^{p} \phi_0^p |\nabla u|^p - p \big( \frac{\mu}{p-1} \big)^{p-1} \phi_0^{p-1} |\nabla u|^{p-2}\nabla u \nabla \phi_0\Big)\, dx = 0\,. \end{equation} Finally, observe that \[ \frac{\mu}{p-1}\nabla u = \frac{1}{e^{\frac{\mu}{p-1}u}} \nabla e^{\frac{\mu}{p-1}u}.\] Hence, by substituting in \eqref{nc4}, we deduce that \begin{equation} \label{nc5} \int_{\Omega} \Big( |\nabla \phi_0|^p + (p-1) \big( \frac{\phi_0}{e^{\frac{\mu}{p-1}u}} \big)^{p} |\nabla e^{\frac{\mu}{p-1}u}|^p - p \big( \frac{\phi_0}{e^{\frac{\mu}{p-1}u}} \big)^{p-1} |\nabla e^{\frac{\mu}{p-1}u}|^{p-2}\nabla e^{\frac{\mu}{p-1}u} \nabla \phi_0\Big)\, dx = 0\,. \end{equation} Applying Proposition \ref{picone}, this proves the existence of $k\in \mathbb R$ such that $$ \phi_0=k e^{\frac{\mu}{p-1}u}. $$ As $\phi_0=0$ and $e^{\frac{\mu}{p-1}u}=1$ on $\partial\Omega$, this implies that $k=0$ which contradicts the fact that $\phi_0>0$ in $\Omega$. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{th3}}] The proof is just the combination of Proposition \ref{necessaryCondition} and of Remark \ref{reverse}. \end{proof} \section{On the Cerami conditon and the Mountain-Pass Geometry} \label{OTCCATMPG} \medbreak We are going to show that, for any $\lambda > 0$, the Cerami sequences for $I_{\lambda}$ at any level are bounded. The proof is inspired by \cite{J_S_2013}, see also \cite{J_1999}. Nevertheless it requires to develop some new ideas. In view of Lemma \ref{strongConvergenceCerami}, this will imply that $I_{\lambda}$ satisfies the Cerami condition at any level $d \in \R$. \begin{lemma} \label{boundednessCerami} Fixed $\lambda > 0$ arbitrary, assume that \eqref{A1} holds and suppose that $m_p> 0$ with $m_p$ defined by \eqref{mp}. Then, the Cerami sequences for $I_{\lambda}$ at any level $d \in \R$ are bounded. \end{lemma} \begin{proof} Let $\{v_n\} \subset W_0^{1,p}(\Omega)$ be a Cerami sequence for $I_{\lambda}$ at level $d \in \R$. First we claim that $\{v_n^{-}\}$ is bounded. Indeed since $\{v_n\}$ is a Cerami sequence, we have that \begin{equation}\label{bc1} \langle I_{\lambda}'(v_n), v_n^{-} \rangle = - \int_{\Omega}|\nabla v_n^{-}|^p dx - \int_{\Omega} f_{\lambda} (x, v_n) \, v_n^{-} \, dx \to 0\, \end{equation} from which, since $f_{\lambda} (x,s)$ is bounded on $\Omega\times \mathbb R^-$, the claim follows. To prove that $\{v_n^{+}\}$ is also bounded we assume by contradiction that $\|v_n\| \rightarrow \infty$. We define \[ \Omega_n^{+} = \{x \in \Omega: v_n(x) \geq 0\} \qquad \textup{ and } \qquad \Omega_n^{-} = \Omega \setminus \Omega_n^+,\] and introduce the sequence $\{w_n\} \subset W_0^{1,p}(\Omega) $ given by $w_n = v_n/\|v_n\|$. Observe that $\{w_n\} \subset W_0^{1,p}(\Omega)$ is bounded in $W_0^{1,p}(\Omega)$. Hence, up to a subsequence, it follows that $w_n \rightharpoonup w$ in $W_0^{1,p}(\Omega)$, $w_n \rightarrow w$ strongly in $L^r(\Omega)$ for $1 \leq r < p^{\ast}$, and $w_n \rightarrow w$ a.e. in $\Omega$. We split the proof in several steps. \bigbreak \noindent \textbf{Step 1:} $cw \equiv 0$. \medbreak As $\|v_n^-\|$ is bounded and by assumption $\|v_n\|\to\infty$, clearly $w^{-} \equiv 0$. It remains to show that $cw^{+} \equiv 0$. Assume by contradiction that $cw^{+} \not\equiv 0$ i.e., defining $\Omega^{+} := \{ x \in \Omega: c(x)w(x) > 0\}$, we assume $|\Omega^{+}| > 0$. Since $\|v_n\| \rightarrow \infty$ and $\langle I_{\lambda}'(v_n), v_n \rangle\to 0$, it follows that \begin{equation} \label{p18.1} \frac{\langle I_{\lambda}'(v_n), v_n \rangle}{\|v_n\|^p } \to 0\,. \end{equation} First of all, observe that \begin{equation} \label{cw00} \begin{aligned} \langle I_{\lambda}'(v_n), v_n \rangle = \|v_n\|^p & - \big( \frac{\mu}{p-1} \big)^{p-1} \int_{\Omega_n^+} h(x) |v_n|^p \, dx - \int_{\Omega_n^+} \lambda c(x)g(v_n)v_n \,dx - \int_{\Omega_n^-} f_{\lambda}(x,v_n) \,v_n \,dx \\ & - \int_{\Omega_n^+} \Big[ \big(1+\frac{\mu}{p-1} v_n\big)^{p-1} - \big( \frac{\mu}{p-1} \big)^{p-1} |v_n|^{p-2} v_n \Big] v_n h(x)\, dx . \end{aligned} \end{equation} Now, since $f_{\lambda}(x,s)$ is bounded on $\Omega\times \R^{-}$, we deduce that \begin{equation} \label{p18.2} \frac{1}{\|v_n\|^p} \int_{\Omega_n^{-}} f_{\lambda}(x,v_n) \,v_n\, dx \to 0\,. \end{equation} Moreover, using that $w_n \rightarrow w$ in $L^r(\Omega)$, $1 \leq r < p^{\ast}$, with $w^{-} \equiv 0$, we have \begin{equation} \label{p18.3} \frac{1}{\|v_n\|^p} \int_{\Omega_n^{+}} |v_n|^p h(x)\, dx = \int_{\Omega_n^{+}} |w_n|^p h(x)\, dx \to \int_{\Omega} w^p h(x)\, dx\,, \end{equation} Next, we are going to show that \begin{equation} \label{p19.1} \frac{1}{\|v_n\|^p} \int_{\Omega_n^{+}} \Big[ \big( 1+\frac{\mu}{p-1} v_n \big)^{p-1} - \big(\frac{\mu}{p-1}\big)^{p-1}|v_n|^{p-2}v_n \Big] v_n h(x)\, dx \to 0\,. \end{equation} Observe that \begin{equation*} \int_{\Omega_n^+} \Big[ \big( 1+\frac{\mu}{p-1}v_n \big)^{p-1} - \big(\frac{\mu}{p-1}\big)^{p-1}v_n^{p-1} \Big] v_n h(x)\, dx = (p-1) \int_{\Omega_n^+} \Big[ \int_0^1 \big( s + \frac{\mu}{p-1}v_n\big)^{p-2} ds \Big] v_n h(x)\, dx\,. \end{equation*} We consider separately the case $p\geq 2$ and the case $1<p<2$. In case $p\geq 2$, there exists $D>0$ such that $$ \Big|\int_{\Omega_n^+} \Big[ \int_0^1 \big( s + \frac{\mu}{p-1}v_n\big)^{p-2} ds \Big] v_n h(x)\, dx \Big| \leq \frac{p-1}{\mu} \int_{\Omega_n^+} \Big( 1 + \frac{\mu}{p-1}v_n\Big)^{p-1} |h(x)|\, dx \leq D \|h\|_q ( 1 + \|v_n\|^{p-1})\,. $$ On the other hand, in case $1 < p < 2$, we have a constant $D>0$ with $$ \Big|\int_{\Omega_n^+} \Big[ \int_0^1 \big( s + \frac{\mu}{p-1}v_n\big)^{p-2} ds \Big] v_n h(x)\, dx \Big| \leq \frac{p-1}{\mu} \int_{\Omega_n^+} \Big(\frac{\mu}{p-1}v_n\Big)^{p-1} |h(x)|\, dx \leq D \|h\|_q\|v_n\|^{p-1}\,. $$ The claim \eqref{p19.1} follows then directly from the above inequalities. So, substituting \eqref{cw00}, \eqref{p18.2}, \eqref{p18.3} and \eqref{p19.1} in \eqref{p18.1} and using that $g$ is bounded on $\R^{-}$, we deduce that \begin{equation} \label{cw01} \lambda \int_{\Omega} c(x) \frac{g(v_n)}{v_n^{p-1}} w_n^p\, dx \to 1 - \Big( \frac{\mu}{p-1} \Big)^{p-1} \int_{\Omega} w^p h(x)\, dx. \end{equation} Let us prove that this is a contradiction. By Lemma \ref{gProperties}, we know that $\lim_{s\to+\infty} g(s)/s^{p-1} = +\infty$ and as $w_n \rightarrow w > 0$ a.e. in $\Omega^{+}$, it follows that \[ c(x) \frac{g(v_n)}{v_n^{p-1}} w_n^p \to + \infty \textup{ a.e. in } \Omega^{+}.\] Since $|\Omega^{+}| > 0$, we have \begin{equation} \label{cw02} \int_{\Omega^{+}} c(x) \frac{g(v_n)}{v_n^{p-1}} w_n^p dx \to +\infty\,. \end{equation} On the other hand, as $g\geq 0$ on $\R^+$, $\frac{g(s)}{s^{p-1}}$ is bounded on $\R^-$ and $\|w_n\|_{pq'}$ is bounded, we have \begin{equation} \label{cw04} \int_{\Omega \setminus \Omega^{+}} c(x) \frac{g(v_n)}{v_n^{p-1}} w_n^p \,dx \geq -D. \end{equation} So \eqref{cw02} and \eqref{cw04} together give a contradiction with \eqref{cw01}. Consequently, we conclude that $cw \equiv 0$. \medbreak \noindent \textbf{Step 2:} \textit{Let us introduce a new functional $J_{\lambda}: W_0^{1,p}(\Omega) \rightarrow \R$ defined as} \begin{equation*} J_{\lambda}(v) = I_{\lambda}(v) - \frac{p-1}{\mu p} \int_{\{v \geq \alpha_{\lambda}\}} \Big[ \big(1+\frac{\mu}{p-1}v \big)^p - \big( \frac{\mu}{p-1} \big)^p|v|^p \Big] h^{-}(x)\, dx \end{equation*} \textit{and let us introduce the sequence $\{z_n\} \subset W_0^{1,p}(\Omega)$ defined by $z_n = t_n v_n$, where $t_n\in [0,1]$ satisfies \[ J_{\lambda}(z_n) = \max_{t \in [0,1]} J_{\lambda}(t v_n)\,,\] (if $t_n$ is not unique we choose its smallest possible value). We claim that} \[ \lim_{n \rightarrow \infty} J_{\lambda}(z_n) = + \infty\,.\] \medbreak We argue again by contradiction. Suppose the existence of $M < +\infty$ such that \begin{equation} \label{zn1} \liminf_{n \rightarrow \infty} J_{\lambda}(z_n) \leq M, \end{equation} and introduce a sequence $\{k_n\} \subset W_0^{1,p}(\Omega)$, defined as \[ k_n = \Big(\frac{2pM}{m_p}\Big)^{\frac{1}{p}}w_n = \Big(\frac{2pM}{m_p}\Big)^{\frac{1}{p}} \frac{v_n}{\|v_n\|}\,.\] Let us prove, taking $M$ bigger if necessary, that for $n$ large enough we have \begin{equation} \label{zn10} J_{\lambda}(k_n) > \frac32 M\,. \end{equation} As $\Big(\frac{2pM}{m_p}\Big)^{\frac{1}{p}} \frac{1}{\|v_n\|}\in [0,1]$ for $n$ large enough, this will give the contradiction $$ \frac32 M\leq\liminf_{n \rightarrow \infty} J_{\lambda}(k_n)\leq \liminf_{n \rightarrow \infty}J_{\lambda}(z_n)\leq M. $$ First of all, observe that $k_n \rightharpoonup k:= \big(\frac{2pM}{m_p}\big)^{\frac{1}{p}} w$ in $W_0^{1,p}(\Omega)$, $k_n \rightarrow k$ in $L^r(\Omega)$, for $1 \leq r < p^{\ast}$, and $k_n \rightarrow k$ a.e. in $\Omega$. By the properties of $G$ (see Lemma \ref{gProperties}) together with $k\geq 0$ and $c\, k\equiv 0$, it is easy to prove that \begin{equation} \label{zn2} \int_{\{k_n \geq \alpha_{\lambda}\}} c(x)G(k_n)\, dx \to \int_{\Omega} c(x)G(k) \, dx=0. \end{equation} As $w^-\equiv0$, we have $\chi_n^-\to 0$ a.e. in $\Omega$ where $\chi_n^-$ is the characteristic function of $\Omega_n^-$. Recall (see \eqref{Flambdaminus}) that we have $m\in L^q(\Omega)\,,\ q > \max\{N/p,1\}$, such that, for a.e. $x\in \Omega$ and all $s\leq 0$, $$ |F_{\lambda}(x,s)|\leq m(x)(1+|s|)\,. $$ This implies that \begin{equation} \label{zn3} \int_{\{k_n \leq \alpha_{\lambda}\}} F_{\lambda}(x,k_n) \, dx \to 0\,, \qquad \mbox{ as well as }\qquad \int_{\{k_n \leq \alpha_{\lambda}\}} |k_n|^p h(x)\, dx \to 0\,. \end{equation} Taking into account \eqref{zn2} and \eqref{zn3} we obtain that \begin{equation} \label{zn8} \begin{aligned} J_{\lambda}(k_n) = \frac{1}{p} \int_{\Omega} \Big(|\nabla k_n|^p &- \big(\frac{\mu}{p-1} \big)^{p-1} h(x)|k_n|^p\Big)\, dx \\ & - \frac{p-1}{p\mu} \int_{\{k_n \geq \alpha_{\lambda}\}} \Big[ \big( 1 + \frac{\mu}{p-1}k_n \big)^p - \big( \frac{\mu}{p-1}\big)^p |k_n|^p \Big] h^{+}(x)\, dx + o(1)\,. \end{aligned} \end{equation} Now, observe that, by definition of $m_p$, \begin{equation} \label{zn9} \frac{1}{p} \int_{\Omega} \Big(|\nabla k_n|^p - \big(\frac{\mu}{p-1} \big)^{p-1} h(x)|k_n|^p \Big) \,dx \geq \frac{1}{p} m_p \|k_n\|^p = 2 M\,. \end{equation} Furthermore, arguing as in \eqref{ineqPminus1}, observe that \begin{equation*} \begin{aligned} \frac{1}{p} \Big| \int_{\{k_n \geq \alpha_{\lambda}\}} \Big[ \big( 1 + \frac{\mu}{p-1} k_n \big)^p &- \big( \frac{\mu}{p-1} \big)^p |k_n|^p \Big] h^{+}(x) \,dx \Big| \leq C \|h^+\|_q \Big(1+ \big(\frac{2pM}{m_p}\big)^{\frac{p-1}{p}} \Big), \end{aligned} \end{equation*} where $C$ is independent of $M$. This implies that \[ J_{\lambda}(k_n) \geq 2M - C \|h^+\|_q \Big(1+ \big(\frac{2pM}{m_p}\big)^{\frac{p-1}{p}} \Big)+ o(1)\,,\] and, taking $M$ bigger if necessary, for any $n \in \N$ large enough, \eqref{zn10} follows. \medbreak \noindent \textbf{Step 3:} For $n \in \N$ large enough, $t_n \in (0,1)$. \medbreak By the definition of $J_{\lambda}$ and using that \[ \big(1+\frac{\mu}{p-1}s \big)^p - \big(\frac{\mu}{p-1} \big)^p s^p \geq 0\,, \quad \forall\ s \geq 0\,,\] observe that \begin{equation*} \begin{aligned} J_{\lambda}(v_n) \leq I_{\lambda}(v_n) & - \frac{p-1}{p \mu} \int_{\{\alpha_{\lambda}\leq v_n \leq 0\}} \Big[ \big( 1 + \frac{\mu}{p-1} v_n \big)^p - \big(\frac{\mu}{p-1} \big)^p |v_n|^p \Big] h^{-}(x)\, dx \\ \leq I_{\lambda}(v_n) & + \frac{1}{p} \big(\frac{\mu}{p-1}\big)^{p-1} \int_{\{ \alpha_{\lambda} \leq v_n \leq 0\}} |v_n|^p\, h^{-}(x) dx \\ \leq I_{\lambda}(v_n) & + \frac{1}{p} \big(\frac{\mu}{p-1}\big)^{p-1} \|\alpha_{\lambda}\|_{\infty}^p \|h^{-}\|_1\,. \end{aligned} \end{equation*} Consequently, since $I_{\lambda}(v_n) \rightarrow d$, there exists $D>0$ such that, for all $n\in \mathbb N$, $J_{\lambda}(v_n) \leq D$. Thus, taking into account that $J_{\lambda}(0) = - \frac{p-1}{p\mu} \|h^{+}\|_1$ and $J_{\lambda}(t_nv_n)\to+\infty$, we conclude that $t_n \in (0,1)$ for $n$ large enough. \medbreak \noindent \textbf{Step 4:} \textit{Conclusion.} \medbreak First of all, as $t_n\in(0,1)$ for $n$ large enough, by the definition of $z_n$, observe that $\langle J_{\lambda}'(z_n),z_n\rangle = 0$, for those $n$. Thus, it follows that \begin{equation*} \begin{aligned} J_{\lambda}(z_n) & = J_{\lambda}(z_n) - \frac{1}{p}\langle J_{\lambda}'(z_n), z_n \rangle \\ & = \lambda \int_{\{z_n \geq \alpha_{\lambda}\}} c(x)H(z_n)\,dx - \frac{p-1}{p\mu}\int_{\{z_n \geq \alpha_{\lambda}\}} \big(1+\frac{\mu}{p-1}z_n \big)^{p-1} h^{+}(x) \,dx \\ & \hspace{70mm} - \int_{\{z_n \leq \alpha_{\lambda}\}} \big[F_{\lambda}(x,z_n)-\frac1p f_{\lambda}(x,z_n) \, z_n\big]\,dx. \end{aligned} \end{equation*} Using the definition of $f_{\lambda}(x,s)$ for $s\leq \alpha_{\lambda}(x)$ and the fact that $\|z_n^-\|$ is bounded, we easily deduce the existence of $D_1>0$ such that, for all $n$ large enough, % \begin{equation} \label{cc1} \frac{p-1}{p\mu} \int_{\Omega} \Big|1+\frac{\mu}{p-1}z_n\Big|^{p-2} \Big(1+\frac{\mu}{p-1}z_n\Big) h^{+}(x)\, dx \leq -J_{\lambda}(z_n) + \lambda \int_{\Omega} c(x)H(z_n) \,dx + D_1\,. \end{equation} Now, since $\{v_n\}$ is a Cerami sequence, observe that (again for $n$ large enough) \begin{equation*} \begin{aligned} d+1 & \geq I_{\lambda}(v_n) - \frac{1}{p} \langle I_{\lambda}'(v_n), v_n \rangle \\ & = \lambda \int_{\{v_n \geq \alpha_{\lambda}\}} c(x)H(v_n) \, dx - \frac{p-1}{p\mu} \int_{\{v_n \geq \alpha_{\lambda}\}} \big(1+\frac{\mu}{p-1}v_n\big)^{p-1} h(x)\, dx \\ & \hspace{70mm} - \int_{\{v_n \leq \alpha_{\lambda}\}} \big[F_{\lambda}(x,v_n)-\frac1p f_{\lambda}(x,v_n) \, v_n\big]\,dx \end{aligned} \end{equation*} and, as above, there exists a constant $D_2>0$ such that \begin{equation} \label{cc2} \lambda \int_{\Omega}c(x)H(v_n)\, dx \leq \frac{p-1}{p\mu} \int_{\Omega} \Big|1+\frac{\mu}{p-1}v_n\Big|^{p-2} \Big(1+\frac{\mu}{p-1}v_n \Big)h(x)\, dx + D_2. \end{equation} Moreover, observe that \begin{equation*} \begin{aligned} \int_{\Omega} & \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h(x)\, dx \\ & = \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{+}(x)\, dx - \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx \\ & = \frac{1}{t_n^{p-1}} \int_{\Omega} \big| t_n + \frac{\mu}{p-1} z_n \big|^{p-2} \big(t_n + \frac{\mu}{p-1} z_n \big)\,h^{+}(x)\, dx - \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx \\ & \leq \frac{1}{t_n^{p-1}} \int_{\Omega} \big| 1 + \frac{\mu}{p-1} z_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} z_n \big)\,h^{+}(x)\, dx - \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx\,. \end{aligned} \end{equation*} Considering together this inequality with \eqref{cc1} and \eqref{cc2}, we obtain that \begin{equation}\label{cc3} \begin{aligned} \lambda \int_{\Omega}c(x)H(v_n)\, dx \leq &D_2 - \frac{J_{\lambda}(z_n)}{t_n^{p-1}} + \frac{\lambda}{t_n^{p-1}} \int_{\Omega} c(x)H(z_n)\, dx + \frac{D_1}{t_n^{p-1}} \\ &\hspace{27mm} - \frac{p-1}{p\mu} \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx. \end{aligned} \end{equation} Now, since $H$ is bounded on $\R^{-}$, there exists $D_3>0$ such that, for all $n\in \N$, \begin{equation} \label{cc4} \int_{\Omega_n^{-}} c(x)H(z_n)\, dx \leq D_3\,. \end{equation} On the other hand, using $iv)$ of Lemma \ref{gProperties}, it follows that \begin{equation} \label{cc5} \int_{\Omega_n^{+}} c(x)H(z_n)\, dx \leq t_n^{p-1} \int_{\Omega_n^{+}} c(x)H(v_n)\, dx + D_4, \end{equation} for some positive constant $D_4$. Hence, substituting \eqref{cc4} and \eqref{cc5} in \eqref{cc3}, it follows that \begin{equation*} \lambda \int_{\Omega_n^{-}}c(x)H(v_n)\, dx \leq D_5 - \frac{J_{\lambda}(z_n)-D_6}{t_n^{p-1}} - \frac{p-1}{p\mu} \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx. \end{equation*} Arguing as in the previous steps, observe that \begin{equation*} \int_{\Omega} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-2} \big(1 + \frac{\mu}{p-1} v_n \big)\,h^{-}(x)\, dx \geq - \int_{\Omega_n^{-}} \big| 1 + \frac{\mu}{p-1} v_n \big|^{p-1}\, h^{-}(x)\, dx \geq -D_7 \|h^{-}\|_q \big(1+ \|v_n^{-}\|^{p-1}\big), \end{equation*} and so, we have that \begin{equation*} \lambda \int_{\Omega_n^{-}}c(x)H(v_n)\, dx \leq D_5 - \frac{J_{\lambda}(z_n)-D_6}{t_n^{p-1}} +D_7 \|h^{-}\|_q \big(1+ \|v_n^{-}\|^{p-1}\big)\,. \end{equation*} By Step 1, we know that $\|v_n^{-}\|$ is bounded and Step 4 shows that $J_{\lambda}(z_n) \rightarrow \infty$. Recall also that, by Step 4, $t_n \in (0,1)$. This implies that \begin{equation} \label{cc6} \lambda \int_{\Omega_n^{-}}c(x)H(v_n)\, dx \to - \infty \end{equation} which contradicts the fact that $H$ is bounded on $\R^{-}$. This allows to conclude that the Cerami sequences for $I_{\lambda}$ at level $d \in \R$ are bounded. \end{proof} Now, we turn to the verification of the mountain pass geometry when $\lambda \geq 0$ is small. \begin{lemma} \label{geometrySmall1} Assume that \eqref{A1} holds and suppose that $m_p > 0$. For $\lambda \geq 0$ small enough, there exists $r > 0$ such that $I_{\lambda}(v) > I_{\lambda}(0)$ for $\|v\| = r$. \end{lemma} \begin{proof} For an arbitrary fixed $r >0$, let $v \in W_0^{1,p}(\Omega)$ be such that $\|v\| = r$. We can write \begin{equation*} \begin{aligned} I_{\lambda}(v) & = \frac{1}{p} \int_{\Omega} \Big(|\nabla v|^p - \big( \frac{\mu}{p-1} \big)^{p-1} (v^{+})^p h(x)\Big)\, dx - \frac{1}{p} \big( \frac{\mu}{p-1} \big)^{p-1} \int_{\{\alpha_{\lambda} \leq v \leq 0\}} |v|^p h(x)\, dx \\ & \qquad - \frac{p-1}{p\mu} \int_{\{v \geq \alpha_{\lambda}\}} \Big[ \big( 1 + \frac{\mu}{p-1}v \big)^p - \big( \frac{\mu}{p-1} \big)^{p} |v|^p \Big] h(x)\,dx \\ & \qquad - \int_{\{v \leq \alpha_{\lambda}\}} h(x) \Big[ \big(1+\frac{\mu}{p-1}\alpha_{\lambda} \big)^{p-1} (v-\alpha_{\lambda}) + \frac{p-1}{p\mu} \big(1+\frac{\mu}{p-1}\alpha_{\lambda} \big)^{p} \Big]\, dx \\ & \qquad - \lambda \Big( \int_{\{v \geq \alpha_{\lambda}\}} c(x)G(v)\,dx + \int_{\{v \leq \alpha_{\lambda}\}} c(x)\big[ g(\alpha_{\lambda})(v-\alpha_{\lambda}) + G(\alpha_{\lambda}) \big] \, dx \Big). \end{aligned} \end{equation*} Now, observe that, as above, \begin{equation*} \Bigg| \int_{\{v \geq \alpha_{\lambda}\}} \Big[ \big(1+\frac{\mu}{p-1}v \big)^p - \big( \frac{\mu}{p-1} \big)^p |v|^p \Big] h(x)\,dx \Bigg| \leq p \int_{\Omega} \big( 1 + \frac{\mu}{p-1}|v| \big)^{p-1} |h(x)|\, dx \leq D_1 (1+r^{p-1}), \end{equation*} with $D_1$ independent of $\lambda$. In the same way, using the fact that $\alpha_{\lambda}\in [-\frac{p-1}{\mu},0]$, we deduce that $$ \begin{array}{c} \displaystyle \Big| - \frac{1}{p} \big( \frac{\mu}{p-1} \big)^{p-1} \int_{\{\alpha_{\lambda} \leq v \leq 0\}} |v|^p h(x)\, dx \Big| \leq D_2\,, \\[2mm] \displaystyle \Big| - \int_{\{v \leq \alpha_{\lambda}\}} h(x) \Big[ \big(1+\frac{\mu}{p-1}\alpha_{\lambda} \big)^{p-1} (v-\alpha_{\lambda}) + \frac{p-1}{p\mu} \big(1+\frac{\mu}{p-1}\alpha_{\lambda} \big)^{p} \Big]\, dx \Big| \leq D_3+D_4 r\,, \end{array} $$ with $D_2$, $D_3$ and $D_4$ independent of $\lambda$. Finally, observe that \begin{equation*} \begin{aligned} \int_{\Omega} \Big(|\nabla v|^p - \big( \frac{\mu}{p-1} \big)^{p-1} (v^{+})^p h(x)\Big)\, dx & = \int_{\Omega} \Big(|\nabla v^{+}|^p - \big( \frac{\mu}{p-1} \big)^{p-1} (v^{+})^p h(x)\Big)\, dx + \int_{\Omega} |\nabla v^{-}|^p\, dx \\ & \geq m_p \|v^{+}\|^p + \|v^{-}\|^p \geq \min\{1,m_p\} \|v\|^p = \min\{1,m_p\}\,r^p\,. \end{aligned} \end{equation*} So, we obtain that \begin{equation} \label{minI} \begin{aligned} I_{\lambda}(v) \geq \frac{1}{p} \min\{1,m_p\}\, r^p &- D_1 r^{p-1} - D_4 r - D_5\,, \\ - \lambda \Big( \int_{\{v \geq \alpha_{\lambda}\}} c(x)G(v)\,dx + \int_{\{v \leq \alpha_{\lambda}\}} c(x)\big[ g(\alpha_{\lambda})(v-\alpha_{\lambda}) + G(\alpha_{\lambda}) \big]\, dx \Big), \end{aligned} \end{equation} where the constants $D_i$ are independent of $\lambda$. Moreover, observe that for $r$ large enough, \begin{equation} \label{mpg7} \frac{1}{p} \min\{1,m_p\}\, r^p - D_1 r^{p-1} - D_4 r - D_5 \geq \frac{1}{2p} \min\{1,m_p\}\, r^p +I_{\lambda}(0)\,. \end{equation} On the other hand, by Lemma \ref{gProperties}, for every $\delta>0$, \begin{equation} \label{mpg8} \Big| \Big( \int_{\{v \geq \alpha_{\lambda}\}} c(x)G(v)\,dx + \int_{\{v \leq \alpha_{\lambda}\}} c(x)\big[ g(\alpha_{\lambda})(v-\alpha_{\lambda}) + G(\alpha_{\lambda}) \big] \,dx \Big) \Big| \leq D_6 r^{p+\delta} + D_7 r + D_8, \end{equation} for some constant $D_6$, $D_7$, $D_8$ independent of $\lambda$. Hence, for $\lambda$ small enough, we have \begin{equation} \label{mpg12} \lambda \Big( \int_{\{v \geq \alpha_{\lambda}\}} c(x)G(v)\,dx + \int_{\{v \leq \alpha_{\lambda}\}} c(x)\big[ g(\alpha_{\lambda})(v-\alpha_{\lambda}) + G(\alpha_{\lambda}) \big] \, dx \Big) \leq \frac{1}{4p} \min\{1,m_p\}\, r^p, \end{equation} and so, gathering \eqref{minI}, \eqref{mpg7} and \eqref{mpg12}, we conclude that \[ I_{\lambda}(v) \geq \frac{1}{4p} \min\{1,m_p\}\, r^p + I_{\lambda}(0) > I_{\lambda}(0)\,. \] \end{proof} \begin{lemma} \label{geometrySmall2} Assume that \eqref{A1} holds and that $m_p > 0$. For any $\lambda >0$, $M >0$, and $r>0$, there exists $w \in W_0^{1,p}(\Omega)$ such that $\|w\| > r$ and $I_{\lambda}(w) \leq -M$. \end{lemma} \begin{proof} Consider $v \in \mathcal{C}_0^{\infty}(\Omega)$ such that $v \geq 0$ and $cv \not\equiv 0$ and let us take $t \in \R^{+}$, $t \geq 1$. First of all, as $\alpha_{\lambda} \leq 0$, observe that \begin{equation*} \begin{aligned} I_{\lambda}(tv) & \leq \frac{1}{p} t^p \int_{\Omega} \Big(|\nabla v|^p - \big( \frac{\mu}{p-1} \big)^{p-1} |v|^p h(x)\Big)\, dx - \lambda t^p \int_{\Omega} c(x)v^p \frac{G(tv)}{t^p v^p}\, dx \\ & \hspace{50mm}+ \frac{p-1}{p\mu} \int_{\Omega} \Big[ \big( 1 + \frac{\mu}{p-1}tv \big)^p - \big( \frac{\mu}{p-1} \big)^p (tv)^p \Big] h^{-}(x)\, dx. \end{aligned} \end{equation*} As above, we have $$ \frac{1}{p} \int_{\Omega} \Big[ \big( 1 + \frac{\mu}{p-1}tv \big)^p - \big( \frac{\mu}{p-1} \big)^p (tv)^p \Big] h^{-}(x)\, dx \leq t^{p-1} \int_{\Omega} \big(1+ \frac{\mu}{p-1}v \big)^{p-1} h^{-}(x)\, dx. $$ Hence we obtain \begin{equation*} I_{\lambda}(tv) \leq t^p \Bigg[ \frac{1}{p} \int_{\Omega}\Big( |\nabla v|^p - \big( \frac{\mu}{p-1} \big)^{p-1} |v|^p h(x)\Big)\, dx - \lambda \int_{\Omega} c(x)v^p \frac{G(tv)}{t^p v^p}\, dx + \frac{1}{t} \frac{p-1}{\mu} \Big\|1+ \frac{\mu}{p-1}v \Big\|_{\infty}^{p-1} \| h^{-}\|_1 \Bigg]\,. \end{equation*} Now, since by Lemma \ref{gProperties}, we have \[ \lim_{t \rightarrow \infty} \lambda \int_{\Omega} c(x)v^p \frac{G(tv)}{(tv)^p}\, dx = \infty\,,\] we deduce that $ \displaystyle \lim_{t \rightarrow \infty} I_{\lambda}(tv) = - \infty$ from which the lemma follows. \end{proof} \begin{prop} \label{localMinimumSmall} Assume that \eqref{A1} holds and suppose that $m_p > 0$. Moreover, suppose that $\lambda \geq 0$ is small enough in order to ensure that the conclusion of Lemma \ref{geometrySmall1} holds. Then, $I_{\lambda}$ possesses a critical point $v \in B(0,r)$ with $I_{\lambda}(v) \leq I_{\lambda}(0)$, which is a local minimum of $I_{\lambda}$. \end{prop} \begin{proof} From Lemma \ref{geometrySmall1}, we see that there exists $r > 0$ such that \[ m:= \inf_{v \in B(0,r)} I_{\lambda}(v) \leq I_{\lambda}(0) \qquad \textup{ and } \qquad I_{\lambda}(v) > I_{\lambda}(0) \,\,\textup{ if }\,\, \|v\| = r\,.\] Let $\{v_n\} \subset B(0,r)$ be such that $I_{\lambda}(v_n) \to m$. Since $\{v_n\}$ is bounded, up to a subsequence, it follows that $v_n \rightharpoonup v \in W_0^{1,p}(\Omega)$. By the weak lower semicontinuity of the norm and of the functional $I_{\lambda}$, we have \[ \|v\| \leq \liminf_{n \to \infty} \|v_n\| \leq r \quad \textup{ and } \quad I_{\lambda}(v) \leq \liminf_{n \to \infty} I_{\lambda}(v_n) = m \leq I_{\lambda}(0)\,.\] Finally, as $I_{\lambda}(v) > I_{\lambda}(0)$ if $\|v\| = r$, we deduce that $v \in B(0,r)$ is a local minimum of $I_{\lambda}$. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{th1}}] Assume that $\lambda > 0$ is small enough in order to ensure that the conclusion of Lemma \ref{geometrySmall1} holds. By Proposition \ref{localMinimumSmall} we have a first critical point, which is a local minimum of $I_{\lambda}$. On the other hand, since the Cerami condition holds, in view of Lemmata \ref{geometrySmall1}. and \ref{geometrySmall2}, we can apply Theorem \ref{mpTheorem} and obtain a second critical point of $I_{\lambda}$ at the mountain-pass level. This gives two different solutions of \eqref{Qlambda}. Finally, by Lemma \ref{linkProblem}, we obtain two solutions of \eqref{Plambda} \end{proof} \section{Proof of Theorems \ref{th2} and \ref{th4}} \label{SER2} In this section, we assume the stronger assumption \eqref{A2}. In that case, we are able to improve our results on the non-coercive case. \begin{prop} \label{lmhNonPos} Assume that \eqref{A2} holds with $h \lneqq 0$. Then, for every $\lambda > 0$, there exists $v \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})$, for some $0 < \tau < 1$, with $v \ll 0$, which is a local minimum of $I_{\lambda}$ in the $W_0^{1,p}$-topology and a solution of \eqref{Qlambda} with $v\geq \alpha_{\lambda}$ (with $\alpha_{\lambda}$ defined by \eqref{alpha}). \end{prop} \begin{proof} First of all, observe that, as $h \lneqq 0$, we have $m_p>0$ and hence, by Theorem \ref{th3}, \eqref{P0} has a solution $u_0 \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$. By Lemma \ref{linkProblem}, \[ v_0 = \frac{p-1}{\mu} \big( e^{\frac{\mu}{p-1}u_0} - 1 \big) \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega), \] is then a weak solution of \begin{equation*} \left\{ \begin{aligned} \pLaplac v_0 & = \big(1+\frac{\mu}{p-1}v_0 \big)^{p-1} h(x)\lneqq 0, & \qquad \textup{ in } \Omega,\\ v_0 & = 0, & \qquad \textup{ on } \partial \Omega. \end{aligned} \right. \end{equation*} As moreover, $\big(1+\frac{\mu}{p-1}v_0 \big)^{p-1} h(x)\in L^{\infty}(\Omega)$, it follows from \cite{DB_1983, L_1988} that $v_0 \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})$, for some $\tau \in (0,1)$ and, by the strong maximum principle (see \cite{V_1984}), that $v_0 \ll 0$. Now, we split the rest of the proof in three steps. \medbreak \noindent\textbf{Step 1:} \textit{$0$ is a strict upper solution of \eqref{Qlambda}.} \medbreak Observe that $0$ is an upper solution of \eqref{Qlambda}. In order to prove that $0$ is strict, let $v \leq 0$ be a solution of \eqref{Qlambda}. As $g \leq 0$ on $\R^{-}$ (see Lemma \ref{gProperties}), it follows that $v$ is a lower solution of $(Q_0)$ and so, thanks to the comparison principle, see Corollary \ref{compPrincipPlambda}, $v \leq v_0 \ll 0$. Hence, $0$ is a strict upper solution of \eqref{Qlambda}. \medbreak \noindent\textbf{Step 2:} \textit{\eqref{Qlambda} has a strict lower solution $\underline\alpha\ll0$.} \medbreak By construction $\underline{\alpha} = \alpha_{\lambda} - 1$ is a lower solution of \eqref{Qlambda}. Moreover, as every solution $v$ of \eqref{Qlambda} satisfies $v \geq \alpha_{\lambda}\gg\underline{\alpha}$, we conclude that $\underline{\alpha}$ is a strict lower solution of \eqref{Qlambda}. \medbreak \noindent\textbf{Step 3:} \textit{Conclusion.} \medbreak By Corollary \ref{localMinimizer}, Proposition \ref{c01vsWop}, and Lemma \ref{linkProblem}, we have the existence of $v \in W_0^{1,p}(\Omega)\cap \mathcal{C}_0^{1,\tau}(\overline{\Omega})$, local minimum of $I_{\lambda}$ and solution of \eqref{Qlambda} such that $\alpha_{\lambda}\leq v \ll0$ as desired. \end{proof} \begin{proof}[\textbf{Proof of the first part of Theorem \ref{th2}}] By Proposition \ref{lmhNonPos}, there exists a first critical point, which is a local minimum of $I_{\lambda}$. By Theorem \ref{characterizacionMinimizer} and since the Cerami condition holds, we have two options. If we are in the first case, then together with Lemma \ref{geometrySmall2}, we see that $I_{\lambda}$ has the mountain-pass geometry and by Theorem \ref{mpTheorem}, we have the existence of a second solution. In the second case, we have directly the existence of a second solution of \eqref{Qlambda}. Then by Lemma \ref{linkProblem} we conclude to the existence of two solutions to \eqref{Plambda}. \end{proof} Now, we consider the case $h \gneqq 0$. \begin{lemma} \label{lemmaBehaviour} Assume that \eqref{A2} holds and suppose that $h \gneqq 0$. Recall that $\gamma_1$ denotes the first eigenvalue of \eqref{BVPeigenvalue}. It follows that: \begin{enumerate} \item[i)] For any $0 \leq \lambda < \gamma_1$, any solution $u$ of the problem \eqref{Plambda} satisfies $u\gg0$. \item[ii)] For $\lambda = \gamma_1$, the problem \eqref{Plambda} has no solution. \item[iii)] For $\lambda > \gamma_1$, the problem \eqref{Plambda} has no non-negative solution. \end{enumerate} \end{lemma} \begin{proof} Observe first that, taking $u^{-}$ as test function in \eqref{Plambda}, we obtain \begin{equation} \label{Lemeq1} - \int_{\Omega} \bigl( |\nabla u^{-}|^p - \lambda\, c(x) |u^{-}|^p \bigr)\, dx = \int_{\Omega} \bigl( \mu |\nabla u |^p u^{-} + h(x) u^{-} \bigl)\, dx. \end{equation} \noindent\textit{i)} For $\lambda < \gamma_1$, there exists $\epsilon>0$ such that, for every $u\in W_0^{1,p}(\Omega)$, \[ \int_{\Omega} \bigl( |\nabla u|^p - \lambda c(x) |u|^p \bigr) \, dx \geq \epsilon \|u\|^p\,.\] Consequently, as $h \gneqq 0$ and $\mu > 0$, we have that \[ 0 \geq -\epsilon \|u^-\|^p \geq - \int_{\Omega} \bigl( |\nabla u^{-}|^p - \lambda c(x) |u^{-}|^p \bigr) \,dx = \int_{\Omega} \bigl( \mu |\nabla u |^p u^{-} + h(x) u^{-} \bigl) \,dx \geq 0,\] which implies that $u^{-} = 0$ and so that $u \geq 0$. Hence $\pLaplac u\gneqq 0$ and by the strong maximum principle (see \cite{V_1984}), we have $u \gg 0$. \medbreak \noindent \textit{ii)} In case $\lambda=\gamma_1$ we have, for every $u\in W_0^{1,p}(\Omega)$, \begin{equation} \label{Lemeq2} \int_{\Omega} \bigl( |\nabla u|^p - \gamma_1 c(x) |u|^p \bigr) \, dx \geq0. \end{equation} Assume by contradiction that \eqref{Plambda} has a solution $u$. By \eqref{Lemeq1} and \eqref{Lemeq2}, and using that $h \gneqq 0$ and $\mu > 0$, we have in particular \[ \int_{\Omega} \Bigl( |\nabla u^{-}|^p - \gamma_1 c(x) |u^{-}|^p \Bigr)\, dx=0.\] This implies that $u^-=k\varphi_1$ for some $k\in \mathbb R$ and $\varphi_1$ the first eigenfunction of \eqref{BVPeigenvalue} and hence, either $u\equiv 0$ or $u\ll0$. As $h\not\equiv0$, the first case cannot occur as $0$ is not a solution of \eqref{Plambda}. In the second case, as $h\gneqq 0$, we have \[\int_{\Omega} h(x) u^{-} \, dx>0\] which contradicts \eqref{Lemeq1}, \eqref{Lemeq2} and $\mu>0$. \medbreak \noindent \textit{iii)} Suppose by contradiction that $u$ is a non-negative solution of \eqref{Plambda}. As in the proof of i), we prove $u\gg0$ and hence, there exists $D_1>0$ such that $u\geq D_1 d$ with $d(x)=\operatorname{dist}(x, \partial\Omega)$. Let $\varphi_1 > 0$ be the first eigenfunction of \eqref{BVPeigenvalue}. As $\varphi_1 \in {\mathcal C}^1(\overline\Omega)$, we have $D_2>0$ such that $\varphi_1\leq D_2 d$. This implies that $\frac{\varphi_1}{u} \in L^{\infty}(\Omega)$ and $\frac{\varphi_1^p}{u^{p-1}} \in W_0^{1,p}(\Omega)$ with \[ \nabla\Big(\frac{\varphi_1^p}{u^{p-1}}\Big) =p \Big(\frac{\varphi_1}{u}\Big)^{p-1} \nabla\varphi_1 - (p-1) \Big(\frac{\varphi_1}{u}\Big)^{p} \nabla u. \] Hence we can take $\frac{\varphi_1^p}{u^{p-1}}$ as test function in \eqref{Plambda} and we have that \[ \lambda \int_{\Omega} c(x) \varphi_1^p\, dx + \int_{\Omega}\Big[ \mu |\nabla u|^p + h(x)\Big] \frac{\varphi_1^p}{u^{p-1}}\, dx = \int_{\Omega} \nabla \Big( \frac{\varphi_1^p}{u^{p-1}} \Big) |\nabla u|^{p-2} \nabla u\, dx\,. \] On the other hand, applying Proposition \ref{picone}, we obtain \[ \gamma_1 \int_{\Omega} c(x) \varphi_1^p \,dx = \int_{\Omega} |\nabla \varphi_1|^p\, dx \geq \int_{\Omega} \nabla \Big( \frac{\varphi_1^p}{u^{p-1}} \Big) |\nabla u|^{p-2} \nabla u\, dx.\] Consequently, gathering together both inequalities, we have the contradiction \begin{equation} \label{contradiction} 0\geq (\gamma_1 - \lambda) \int_{\Omega} c(x) \varphi_1^p \, dx \geq \int_{\Omega} [ \mu |\nabla u|^p + h(x)] \frac{\varphi_1^p}{u^{p-1}}\, dx>0\,. \end{equation} \end{proof} \begin{cor} \label{corlambdaimplique 0} Assume that \eqref{A2} holds. If, for some $\lambda >0$, \eqref{Plambda} has a solution $u_{\lambda}\geq0$ then \eqref{P0} has a solution. \end{cor} \begin{proof} Observe that $u_{\lambda}$ is an upper solution of \eqref{P0}. By Proposition \ref{lowerSol}, we know that \eqref{P0} has a lower solution $\alpha$ with $\alpha\leq u_{\lambda}$. The conclusion follows from Theorem \ref{BMP1988}. \end{proof} \begin{cor} \label{corlambdaimplique 0.2} Assume that \eqref{A2} holds with $h \gneqq 0$. If \eqref{Plambda} has a solution for some $\lambda \in(0, \gamma_1)$, then \eqref{P0} has a solution. \end{cor} \begin{proof} If \eqref{Plambda} has a solution $u$, by Lemma \ref{lemmaBehaviour}, we have $u\gg0$. The result follows from Corollary \ref{corlambdaimplique 0}. \end{proof} \begin{prop} \label{lmhNonNeg} Assume that \eqref{P0} has a solution $u_0 \in W_0^{1,p}(\Omega) \cap L^{\infty}(\Omega)$ and suppose that \eqref{A2} holds with $h \gneqq 0$. Then there exists $\overline{\lambda}< \gamma_1$ such that: \begin{enumerate} \item[i)] For every $0 < \lambda < \overline{\lambda}$, there exists $v \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})$, for some $0 < \tau < 1$, with $v \gg 0$, which is a local minimum of $I_{\lambda}$ in the $W_0^{1,p}$-topology and a solution of \eqref{Qlambda}. \item[ii)] For $\lambda = \overline{\lambda}$, there exists $u \in \mathcal{C}_0^{1,\tau}(\overline{\Omega})$, for some $0 < \tau < 1$, with $u \geq u_0$, which is a solution of \eqref{Plambda}. \item[iii)] For $\lambda > \overline{\lambda}$, the problem \eqref{Plambda} has no non-negative solution. \end{enumerate} \end{prop} \begin{proof} Defining \[ \overline{\lambda} = \sup\{ \lambda: \eqref{Plambda} \textup{ has a non-negative solution } u_{\lambda} \},\] we directly obtain that, for $\lambda > \overline{\lambda}$, the problem \eqref{Plambda} has no non-negative solution and, by Lemma \ref{lemmaBehaviour} $ii)$, we see that $\overline{\lambda} \leq \gamma_1$. Moreover, arguing exactly as in the first part of Proposition \ref{lmhNonPos}, we deduce that \[ v_0 = \frac{p-1}{\mu} \big( e^{\frac{\mu}{p-1}u_{0}} - 1 \big) \in W_0^{1,p}(\Omega) \cap \mathcal{C}_0^1(\overline{\Omega})\] satisfies $v_0\gg0$. Now, fix $\lambda\in (0, \overline{\lambda})$. \medbreak \noindent\textbf{Step 1:} \textit{$0$ is a strict lower solution of \eqref{Qlambda}.} \medbreak The proof of this step follows the corresponding one of Proposition \ref{lmhNonPos}. \medbreak \pagebreak \noindent\textbf{Step 2:} \textit{\eqref{Qlambda} has a strict upper solution.} \medbreak By the definition of $\overline{\lambda}$ we can find $\delta \in (\lambda, \overline{\lambda})$ and a non-negative solution $u_{\delta}$ of $(P_{\delta})$. As above, we easily see that \[ v_{\delta} = \frac{p-1}{\mu} \big( e^{\frac{\mu}{p-1}u_{\delta}} - 1 \big) \in W_0^{1,p}(\Omega) \cap \mathcal{C}_0^1(\overline{\Omega})\ \] is a non-negative upper solution of \eqref{Qlambda} and $v_{\delta}\gg0$. Moreover, if $v$ is a solution of \eqref{Qlambda} with $v \leq v_{\delta}$, Theorem \ref{smpLP} implies that $v \ll v_{\delta}$. Hence, $v_{\delta}$ is a strict upper solution of \eqref{Plambda}. \medbreak \noindent\textbf{Step 3:} \textit{Proof of i).} \medbreak The conclusion follows as in Proposition \ref{lmhNonPos}. \medbreak \noindent\textbf{Step 4:} \textit{Existence of a solution for $\lambda = \overline{\lambda}$.} \medbreak Let $\{\lambda_n\}$ be a sequence with $\lambda_n< \overline{\lambda}$ and $\lambda_n\to \overline{\lambda}$ and $\{v_n\}$ be the corresponding sequence of minimum of $I_{\lambda_n}$ obtained in i). This implies that $\langle I'_{\lambda_n}(v_n), \varphi\rangle =0$ for all $\varphi\in W_0^{1,p}(\Omega)$. By the above construction, we also have \[ I_{\lambda_n}(v_n)\leq I_{\lambda_n}(0)= -\frac{p-1}{p\mu} \int_{\Omega}h(x)\,dx. \] Arguing exactly as in Lemmata \ref{boundednessCerami} and \ref{strongConvergenceCerami}, we prove easily the existence of $v\in W_0^{1,p}(\Omega)$ such that $v_n\to v$ in $W_0^{1,p}(\Omega)$ with $v$ a solution of \eqref{Qlambda} for $\lambda=\overline \lambda$. As $v_n\geq 0$ we obtain also $v\geq 0$, and, by Lemma \ref{linkProblem}, we have the existence of a solution $u$ of \eqref{Plambda} with $u\geq 0$. As $u$ is then an upper solution of \eqref{P0}, we conclude that $u\geq u_0$. \medbreak \noindent\textbf{Step 5:} \textit{$\overline{\lambda}<\gamma_1$.} \medbreak As by Lemma \ref{lemmaBehaviour}, the problem \eqref{Plambda} has no solution for $\lambda=\gamma_1$, this follows from Step 4. \end{proof} \begin{proof}[\textbf{Proof of the second part of Theorem \ref{th2}}] By Lemma \ref{lemmaBehaviour}, we have $u_0\gg0$. Let us consider $\overline{\lambda} \in (0,\gamma_1)$ given by Proposition \ref{lmhNonNeg}. Hence, for $\lambda<\overline{\lambda}$, there exists a first critical point $u_1$, which is a local minimum of $I_{\lambda}$. We then argue as in the proof of the first part to obtain the second solution $u_2$ of \eqref{Plambda}. By Lemma \ref{lemmaBehaviour}, these two solutions satisfy $u_i\gg0$ and, by Theorem \ref{compPrinciple}, we conclude that $u_i\geq u_0$. Now, for $\lambda = \overline{\lambda}$, respectively $\lambda > \overline{\lambda}$, the result follows respectively from Proposition \ref{lmhNonNeg} \textit{ii)} and \textit{iii)}. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{th4}}] \noindent\textbf{Part 1:} \textbf{Case $\boldsymbol{\lambda\in(0,\gamma_1)}$.} \medbreak \noindent\textbf{Step 1:} \textit{There exists $k>0$ such that \eqref{eq cor} has at least one solution.} \medbreak Let $\lambda_0\in(\lambda, \gamma_1)$ and $\delta$ small enough such that $$ \lambda_0 \, s^{p-1}\geq \lambda \Big(\frac{p-1}{\mu}\big( 1+\frac{\mu}{p-1}s \big) \ln \big(1+ \frac{\mu}{p-1}s \big)\Big)^{p-1}, \qquad \forall\ s\in [0,\delta]. $$ Define $w$ as a solution of \begin{equation} \label{cll3g} \pLaplac w = \lambda_0 \, c(x) |w|^{p-2}w + h(x),\quad w \in W^{1,p}_0(\Omega). \end{equation} As $\lambda_0<\gamma_1$, we have $w\gg0$. For $l$ small enough, $\tilde \beta= l w$ satisfies $0\leq \tilde \beta\leq\delta$ and, for $k$ such that $l^{p-1}\geq \big(1+ \frac{\mu}{p-1}\delta \big)^{p-1}k$, it is easy to prove that $\beta= \frac{p-1}{\mu} \ln \big(1+ \frac{\mu}{p-1}\tilde\beta \big)$ is an upper solution of \eqref{eq cor} with $\beta\geq0$. As $0$ is a lower solution of \eqref{eq cor}, the claim follows from Theorem \ref{BMP1988}. \medbreak \noindent\textbf{Step 2:} \textit{For $k\geq k_0$, the problem \eqref{eq cor} has no solution.} \medbreak Let $u$ be a solution of \eqref{eq cor}. By Lemma \ref{lemmaBehaviour}, we have $u\gg0$. This implies that $u$ is an upper solution of $(P_{0,k})$. As $0$ is a lower solution of $(P_{0,k})$, by Theorem \ref{BMP1988}, the problem $(P_{0,k})$ has a solution and hence, by Proposition \ref{necessaryCondition}, $m_p>0$ which means that $k< k_0$. This implies that, for $k\geq k_0$, the problem \eqref{eq cor} has no solution. \medbreak \pagebreak \noindent\textbf{Step 3:} \textit{$\overline k = \sup\{k\in(0,k_0): \eqref{eq cor} \mbox{ has at least one solution}\} <k_0$.} \medbreak Assume by contradiction that $\overline k=k_0$. Let $\{k_n\}$ be an increasing sequence such that $k_n\to \overline k$, $k_n\geq \frac12\overline k$ and there exists $\{u_{n}\}$ a sequence of solutions of $(P_{\lambda,k_n})$. As in the previous step we have that $u_{n}$ is an upper solution of $(P_{0,\frac12\overline k})$. By Theorem \ref{compPrinciple}, we know that $u_{n}\geq u_0$ with $u_0\gg0$ the solution of $(P_{0,\frac12\overline k})$. Now, let $\phi \in W_0^{1,p}(\Omega)\cap {\mathcal C}^1_0(\overline\Omega)$ with $\phi\gg0$ and \[ \Big( \frac{p-1}{\mu} \Big)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx = k_0 \int_{\Omega} h(x) \phi^p \,dx. \] Using $\phi^p$ as test function and applying Young inequality as in the proof of Proposition \ref{necessaryCondition}, it follows that \begin{equation*} \begin{aligned} \Big( \frac{p-1}{\mu} \Big)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx &\geq \int_{\Omega} |\nabla u_n|^{p-2}\nabla u_n \nabla (|\phi|^p)\, dx - \mu \int_{\Omega} |\phi|^p |\nabla u_n|^p\, dx \\ &= \lambda \int_{\Omega} c(x)|u_n|^{p-2}u_n \phi^p \,dx + k_n \int_{\Omega} h(x) \phi^p \,dx \\ &\geq \lambda \int_{\Omega} c(x)|u_0|^{p-2}u_0 \phi^p \,dx + k_n \int_{\Omega} h(x) \phi^p \,dx. \end{aligned} \end{equation*} Passing to the limit, we have the contradiction \begin{equation*} \Big( \frac{p-1}{\mu} \Big)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx \geq \lambda \int_{\Omega} c(x)|u_0|^{p-2}u_0 \phi^p \,dx + \Big( \frac{p-1}{\mu} \Big)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx. \end{equation*} \medbreak \noindent\textbf{Step 4:} \textit{For $k> \overline k$, the problem \eqref{eq cor} has no solution and for $k< \overline k$, the problem \eqref{eq cor} has at least two solutions $u_1$, $u_2$ with $u_i\gg0$.} \medbreak The first statement is obvious by definition of $\overline k$. Now, for $k< \overline k$, let $\tilde k \in (k, \overline k)$ such that $(P_{\lambda, \tilde k})$ has a solution $\tilde u$. By Lemma \ref{lemmaBehaviour}, we have $\tilde u\gg0$. Then, it is easy to observe that $\beta_1=\big(\frac{k}{\tilde k}\big)^{\frac{1}{p-1}}\tilde u$ and $\beta_2= \tilde u$ are both upper solutions of \eqref{eq cor} with $0\ll \beta_1\ll \beta_2$. Observe that $0$ is a strict lower solution of \eqref{eq cor}. As $\beta_1\gg0$ is an upper solution of \eqref{eq cor}, by Theorem \ref{BMP1988}, the problem \eqref{eq cor} has a minimum solution $u_1$ with $0\ll u_1\leq \beta_1$. In order to prove the existence of the second solution, observe that if $\beta_2$ is not strict, it means that \eqref{eq cor} has a solution $u_2$ with $u_2\leq \beta_2$ but $u_2\not\ll \beta_2$. Then $u_2\not=u_1$ and we have our two solutions. If $\beta_2$ is strict, we argue as in the proof of Theorem \ref{th2}. \bigbreak \noindent\textbf{Step 5:} \textit{The function $\overline k(\lambda)$ is non-increasing.} \medbreak Let us consider $\lambda_1<\lambda_2$, $\tilde k < \overline k(\lambda_2)$ and $\tilde u\gg0$ a solution of $(P_{\lambda_2, \tilde k})$. It is easy to prove that $\tilde u$ is an upper solution of $(P_{\lambda_1, \tilde k})$. As $0$ is a lower solution of $(P_{\lambda_1, \tilde k})$ with $0\leq \tilde u$, by Theorem \ref{BMP1988}, the problem $(P_{\lambda_1, \tilde k})$ has a solution. This implies that $\overline k(\lambda_1)\geq \overline k(\lambda_2)$. \medbreak \noindent\textbf{Part 2:} \textbf{Case $\boldsymbol{\lambda=\gamma_1}$.} \medbreak By Lemma \ref{lemmaBehaviour}, we know that the problem $(P_{\gamma_1})$ has no solution for $k>0$. Moreover, by \eqref{Lemeq1}, we see that if $(P_{\gamma_1})$ with $h\equiv 0$ has a non-trivial solution, then $u\gneqq 0$ and hence, by the strong maximum principle $u\gg0$. Arguing as in the proof of iii) of Lemma \ref{lemmaBehaviour}, we obtain the same contradiction \eqref{contradiction}. \medbreak \noindent\textbf{Part 3:} \textbf{Case $\boldsymbol{\lambda>\gamma_1}$.} \medbreak \noindent\textbf{Step 1:} \textit{There exists $k>0$ such that \eqref{eq cor} has at least one solution $u\ll0$.} \medbreak By Proposition \ref{anti} with $\bar{h} =h$, there exists $\delta_0>0$ such that, for $\lambda\in(\gamma_1,\gamma_1+\delta_0)$, the solution of \begin{equation} \label{cll2} \pLaplac w = \lambda \, c(x) |w|^{p-2}w + h(x)\,,\quad w \in W^{1,p}_0(\Omega)\,, \end{equation} satisfies $w\ll0$. Let us fix $\lambda_0\in (\gamma_1,\min(\gamma_1+\delta_0, \lambda))$ and $\delta$ small enough such that $$ \lambda_0|s|^{p-2}s\geq \lambda \Big|\frac{p-1}{\mu}\big( 1+\frac{\mu}{p-1}s \big) \ln \big(1+ \frac{\mu}{p-1}s \big)\Big|^{p-2} \frac{p-1}{\mu}\big( 1+\frac{\mu}{p-1}s \big) \ln \big(1+ \frac{\mu}{p-1}s \big), \quad \forall\ s\in [-\delta,0]\,. $$ Define $w$ as a solution of \begin{equation} \label{cll3g} \pLaplac w = \lambda_0 \, c(x) |w|^{p-2}w + h(x),\quad u \in W^{1,p}_0(\Omega). \end{equation} As $\gamma_1<\lambda_0<\gamma_1+\delta_0$, we have $w\ll0$. For $l$ small enough, $\tilde \beta= l w$ satisfies $-\min(\delta, \frac{p-1}{\mu}) < \tilde \beta\leq 0$ and, for $k\leq l^{p-1}$, it is easy to prove that $\beta= \frac{p-1}{\mu} \ln \big(1+ \frac{\mu}{p-1}\tilde\beta \big)$ is an upper solution of \eqref{eq cor} with $\beta\ll0$. By Proposition \ref{lowerSol}, \eqref{eq cor} has a lower solution $\alpha$ with $\alpha\leq \beta$ and the claim follows from Theorem \ref{BMP1988}. \medbreak \noindent\textbf{Step 2:} \textit{For $k$ large enough, the problem \eqref{eq cor} has no solution.} \medbreak Otherwise, let $u$ be a solution of \eqref{eq cor}. By Lemma \ref{lowerBound} and Remark \ref{remuniflb}, we have $M_{\lambda}>0$ such that, for all $k>0$, the corresponding solution $u$ satisfies $u\geq -M_{\lambda}$. Let $\phi \in {\mathcal C}^1_0(\overline\Omega)$ with $\phi\gg0$. Using $\phi^p$ as test function, by Young inequality as in the proof of Proposition \ref{necessaryCondition}, it follows that \begin{equation*} \begin{aligned} \Big( \frac{p-1}{\mu} \Big)^{p-1} \int_{\Omega} | \nabla \phi|^p \,dx &\geq \int_{\Omega} |\nabla u|^{p-2}\nabla u \nabla (\phi^p)\, dx - \mu \int_{\Omega} \phi^p |\nabla u|^p\, dx \\ &= \lambda \int_{\Omega} c(x)|u|^{p-2}u \phi^p \,dx + k\int_{\Omega} h(x) \phi^p \,dx \\ &\geq - \lambda M^{p-1}\int_{\Omega} c(x) \phi^p \,dx + k \int_{\Omega} h(x) \phi^p \,dx. \end{aligned} \end{equation*} which is a contradiction for $k$ large enough. \medbreak \noindent\textbf{Step 3:} \textit{Define $\tilde k_1 = \sup\{k>0: \eqref{eq cor} \mbox{ has at least one solution } u \ll0 \}$. For $k< \tilde k_1 $, the problem \eqref{eq cor} has at least two solutions with $u_1\ll0$ and $\min u_2<0$.} \medbreak For $k< \tilde k_1 $, let $\tilde k \in (k, \tilde k_1 )$ such that $(P_{\lambda, \tilde k})$ has a solution $\tilde u\ll0$. It is then easy to observe that $\beta_1= \tilde u$ and $\beta_2=\big(\frac{k}{\tilde k}\big)^{\frac{1}{p-1}}\tilde u$ are both upper solutions of \eqref{eq cor} with $ \beta_1\ll \beta_2\ll0$. By Proposition \ref{lowerSol}, \eqref{eq cor} has a lower solution $\alpha$ with $\alpha\leq \beta_1$ and hence, by Theorem \ref{BMP1988}, the problem \eqref{eq cor} has a minimum solution $u_1$ with $\alpha \leq u_1\leq \beta_1$. In order to prove the existence of the second solution, observe that if $\beta_2$ is not strict, it means that \eqref{eq cor} has a solution $u_2$ with $u_2\leq \beta_2$ but $u_2\not\ll \beta_2$. Then $u_2\not=u_1$ and we have our two solutions. If $\beta_2$ is strict, we argue as in the proof of Theorem \ref{th2}. \medbreak \noindent\textbf{Step 4:} \textit{Define $\tilde k_2 = \sup\{k>0: \eqref{eq cor} \mbox{ has at least one solution}\}$. For $k> \tilde k_2 $, the problem \eqref{eq cor} has no solution and, in case $\tilde k_1< \tilde k_2$, for all $k\in(\tilde k_1, \tilde k_2)$, the problem \eqref{eq cor} has at least one solution $u$ with $u\not\ll 0$ and $\min u<0$.} \medbreak The first statement follows directly from the definition of $\tilde k_2$. In case $\tilde k_1< \tilde k_2$, for $k\in(\tilde k_1, \tilde k_2)$, let $\tilde k \in (k, \tilde k_2)$ such that $(P_{\lambda, \tilde k})$ has a solution $\tilde u$. Observe that $\tilde u$ is an upper solution of \eqref{eq cor}. Again, Proposition \ref{lowerSol} gives us a lower solution $\alpha$ of \eqref{eq cor} with $\alpha\leq \tilde u$ and hence, by Theorem \ref{BMP1988}, the problem \eqref{eq cor} has a solution $u$. By definition of $\tilde k_1$, we have that $u\not\ll0$ and by Lemma \ref{lemmaBehaviour}, we know that $\min u<0$. \medbreak \noindent\textbf{Step 5:} \textit{The function $\tilde k_1(\lambda)$ is non-decreasing.} \medbreak Let us consider $\lambda_1<\lambda_2$, $k < \tilde k_1(\lambda_1)$ and $u\ll0$ a solution of $(P_{\lambda_1, k})$. It is easy to prove that $u$ is an upper solution of $(P_{\lambda_2, k})$. Again, applying Proposition \ref{lowerSol} and Theorem \ref{BMP1988}, we prove that the problem $(P_{\lambda_2, k})$ has a solution $u \ll 0$. This implies that $\tilde k_1(\lambda_1)\leq \tilde k_1(\lambda_2)$. \end{proof}
\section{Introduction} Type Ia supernovae (SNe Ia) are defined as SNe with strong SiII absorption lines in their spectra, but without H and He lines nearby their maximum luminosity (see Filippenko 1997). They happen in all kinds of galaxies, including young and old stellar populations (e.g. Branch et al. 1993; Wang et al. 1997). SNe Ia are accurate distance measurements in cosmology due to the uniformity of their light curves, revealing the accelerating expansion of the current Universe driven by dark energy (e.g., Riess et al. 1998; Perlmutter et al. 1999; Howell 2011). They are element factories in the chemical evolution of galaxies, which are the main producer of iron to their host galaxies (e.g., Greggio \& Renzini 1983; Matteucci \& Greggio 1986). They are also the sources of kinetic energy in galaxy evolution, the accelerators of cosmic rays, and the endings of binary evolution (e.g., Helder et al. 2009; Powell et al. 2011; Fang \& Zhang 2012). The Phillips relation is adopted when SNe Ia are applied as distance indicators, which is a width-luminosity relation among SNe Ia; events with wider light curves are brighter (see Phillips 1993; Phillips et al. 1999). However, more and more observational evidence indicates that there exists spectroscopic diversity among SNe Ia and not all SNe Ia obey the Phillips relation (e.g., Li et al. 2001, 2011a; Wang et al. 2006; Branch et al. 2009; Foley et al. 2009, 2018; Blondin et al. 2012; Zhang et al. 2014, 2016; Zhai et al. 2016; Taubenberger 2017). The light curves of SNe Ia are powered by the radioactive decay of $^{56}$Ni $\rightarrow$ $^{56}$Co $\rightarrow$ $^{56}$Fe (e.g., Arnett 1982; Branch \& Tammann 1992). It has been suggested that some stellar parameters at the moment of SN explosion may affect the final amount of $^{56}$Ni, and thus the maximum light of SNe Ia, for example, the metallicity (e.g., Timmes et al. 2003; Podsiadlowski et al. 2006; Sullivan et al. 2010; Bravo et al. 2010), the average ratio of carbon to oxygen of a WD (e.g., Umeda et al. 1999), and the transition density from deflagration to detonation or the number of ignition points in the center of WDs (e.g., Hillebrandt \& Niemeyer 2000; Kasen et al. 2009; H\"{o}flich et al. 2010), etc. Maeda et al. (2010) argued that the observed SN Ia diversity may be a result of off-center ignition coupled with the observer's viewing angle (see also Parrent et al. 2011). Note that Meng et al. (2017) recently argued that all kinds of SNe Ia may obey the same polarization sequence that might be explained by the delayed-detonation explosion model. SNe Ia are thought to be outcomes of thermonuclear explosions of mass-accreting carbon-oxygen white dwarfs (CO WDs) that have mass close to the Chandrasekhar limit (${M}_{\rm Ch}$; e.g., Hoyle \& Fowler 1960; Nomoto et al. 1984). The WD explosion with ${M}_{\rm Ch}$ can reproduce the observed light curves and spectroscopy of most SNe Ia (e.g., H\"{o}flich et al.1996; Podsiadlowski et al. 2008; Leung \& Nomoto 2017), and most SNe Ia are inferred to have total ejecta masses close to ${M}_{\rm Ch}$ (see Mazzali et al. 2007). Umeda et al. (1999) suggested that the birth mass of a CO WD is usually $<$1.1\,${M}_\odot$ (see also Siess 2006; Doherty et al. 2015, 2017), and thus a CO WD needs to obtain enough mass from its companion in a binary before it explodes as an SN Ia. However, the nature of the companion of the CO WD is still not well determined over the past 60 years of SN research though there exist many observational constraints (e.g., Mannucci et al. 2006; F\"{o}rster et al. 2006, 2013; Aubourg et al. 2008; Maoz et al. 2011; Wang et al. 2013a; Graur \& Maoz 2013; Mart\'{i}nez-Rodr\'{i}guez et al. 2017; Heringer et al. 2017), which involves the progenitor issue of SNe Ia (for recent reviews see Wang \& Han 2012; Maoz \& Mannucci 2012; H\"{o}flich et al. 2013; Hillebrandt et al. 2013; Maoz et al. 2014; Ruiz-Lapuente 2014; Parrent et al. 2014; Maeda \& Terada 2016; Branch \& Wheeler 2017; Soker 2018). Many progenitor models have been proposed to explain the observed diversity among SNe Ia, in which the most studied models are the single-degenerate (SD) model, the double-degenerate (DD) model and the sub-${M}_{\rm Ch}$ model. (1) \textit{The SD model}. In this model, a CO WD accretes H-/He-rich material from a non-degenerate donor. The WD may produce an SN Ia when it grows in mass close to ${M}_{\rm Ch}$ (e.g., Whelan \& Iben 1973; Nomoto et al.1984). (2) \textit{The DD model}. In this model, a CO WD merges with another CO WD, the merging of which is due to the gravitational wave radiation, producing an SN Ia finally (e.g., Webbink 1984; Iben \& Tutukov 1984). (3) \textit{The sub-${M}_{\rm Ch}$ model}. In this model, the thermonuclear explosion of a CO WD results from the detonation at the bottom of a He-shell, in which the CO WD has the mass below ${M}_{\rm Ch}$ (e.g., Nomoto 1982a; Woosley et al. 1986). In this article, I mainly review recent studies on mass-accreting WDs and different progenitor models of SNe Ia. In Sect. 2, I review recent studies of H- and He-accreting WDs in detail. I also review recent progress on the currently most discussed progenitor models of SNe Ia, including the SD model in Sect. 3, the DD model in Sect. 4, and the sub-${M}_{\rm Ch}$ model in Sect. 5. In Sect. 6, I summarize some other potential progenitor models of SNe Ia. Finally, a summary is given in Sect. 7. For more discussions on the progenitors, explosion mechanisms and observational properties of SNe Ia, see previous reviews, e.g., Branch et al. (1995), Nomoto et al. (1997), Hillebrandt \& Niemeyer (2000), Livio (2000), Wang \& Wheeler (2008) and Podsiadlowski (2010). \section{Mass-accreting white dwarfs} A WD in a binary system can usually accrete H-/He-rich material from its mass donor. The process of mass-accretion onto WDs is important for the studies of binary evolution and accretion physics. Employing the stellar evolution code called Modules for Experiments in Stellar Astrophysics (MESA; see Paxton et al. 2011, 2013, 2015), Wang et al. (2015a) recently studied the long-term evolution of the He-accreting WDs with various initial WD masses (${M}^{\rm i}_{\rm WD}=0.5-1.35\,{M}_\odot$) and accretion rates ($\dot{M}_{\rm acc}=10^{-8}-10^{-5}\,M_\odot\,\mbox{yr}^{-1}$). The super-Eddington wind is supposed as the mass-loss mechanism during He-shell flashes (e.g., Denissenkov et al. 2013; Ma et al. 2013). The initial WD models in Wang et al. (2015a) have a metallicity of 2\%, and the accreted He-rich material consists of 98\% He and 2\% metallicity. In this article, I simulated the long-term evolution of the H-accreting WDs with various ${M}^{\rm i}_{\rm WD}$ and $\dot{M}_{\rm acc}$ using MESA (version 7624), in which the accreted H-rich material consists of 70\% H, 28\% He and 2\% metallicity. Basic assumptions and input here are similar to those of Wang et al. (2015a). In my computations, the WDs were resolved with $>$2000 meshpoints. \subsection{Stable burning regime} \begin{figure*} \begin{center} \includegraphics[width=10.2cm,angle=0]{f1a.eps} \includegraphics[width=10.2cm,angle=0]{f1b.eps} \caption{Stable H-/He-shell burning regime in the ${M}^{\rm i}_{\rm WD}-\dot{M}_{\rm acc}$ plane. In panel (a), it shows the stable H-shell burning regime. The red solid lines are the results of my simulations, the blue dotted lines are taken from Iben \& Tutukov (1989), and the black dashed lines are from Nomoto et al. (2007). In panel (b), it presents the stable He-shell burning regime. The red solid lines are taken from Wang et al. (2015a), the blue dotted line is taken from Nomoto (1982b), and the black dashed line is from Piersanti et al. (2014). } \end{center} \end{figure*} In Fig. 1, I show the stable H-/He-shell burning regime in the ${M}^{\rm i}_{\rm WD}-\dot{M}_{\rm acc}$ plane. In this steady burning regime, WD binaries have been identified as supersoft X-ray sources in the observations (e.g., van den Heuvel et al. 1992). In the case of H-accreting WDs (see Fig. 1a), the final fate of mass-accreting WDs is mainly determined by ${M}^{\rm i}_{\rm WD}$ and $\dot{M}_{\rm acc}$. If $\dot{M}_{\rm acc}$ is larger than the maximum accretion rate $\dot{M}_{\rm cr}$ for stable H-shell burning, the WD will expand to red-giant dimensions and form a red-giant-like star due to the continuous pileup of the accreted material on its surface or, alternatively, the red-giant-like regime is replaced by the optically thick wind regime (for more discussions see Sect. 3). If $\dot{M}_{\rm acc}$ is below the minimum accretion rate $\dot{M}_{\rm st}$ for stable H-shel burning, the WD will experience multicycle H-shell flashes like nova outbursts due to unstable nuclear burning. The values of $\dot{M}_{\rm cr}$ and $\dot{M}_{\rm st}$ for H-accreting WDs can be approximated by the following formula \begin{equation} \small{\dot{M}_{\rm cr}=0.27\times10^{-7}({M}_{\rm WD}^2+25.52{M}_{\rm WD}-9.02)}, \end{equation} \begin{equation} \small{\dot{M}_{\rm st}=2.93\times10^{-7}(-{M}_{\rm WD}^3+4.41{M}_{\rm WD}^2-3.38{M}_{\rm WD}+0.84)}, \end{equation} where ${M}_{\rm WD}$ is in units of ${M}_\odot$, and $\dot{M}_{\rm cr}$ and $\dot{M}_{\rm st}$ are in units of $M_\odot\,\mbox{yr}^{-1}$. I also compared my results with previous investigations of Iben \& Tutukov (1989) and Nomoto et al. (2007). It seems that my results are almost coincident with those of Iben \& Tutukov (1989), but have some differences with those of Nomoto et al. (2007), probably resulted from different methods adopted. Nomoto et al. (2007) studied the mass-accretion process through a linear stability analysis, whereas I carried out a detailed stellar evolution computations. In the case of He-accreting WDs (see Fig. 1b), the final fate of the WDs is also determined by $\dot{M}_{\rm acc}$ and ${M}_{\rm WD}$. The values of $\dot{M}_{\rm cr}$ and $\dot{M}_{\rm st}$ are given as below \begin{equation} \small{\dot{M}_{\rm cr}=2.17\times10^{-6}({M}_{\rm WD}^2+0.82{M}_{\rm WD}-0.38)}, \end{equation} \begin{equation} \small{\dot{M}_{\rm st}=1.46\times10^{-6}(-{M}_{\rm WD}^3+3.45{M}_{\rm WD}^2-2.60{M}_{\rm WD}+0.85)}. \end{equation} It has been assumed that a WD can grow in mass to ${M}_{\rm Ch}$ in this stable He-shell burning regime and then explodes as an SN Ia (e.g., Nomoto 1982b; Wang et al. 2009a). However, Wang et al. (2017a) recently found that off-center carbon ignition happens on the surface of the WD if $\dot{M}_{\rm acc}$ is larger than a critical value ($\sim$$2.05\times 10^{-6}\,{M}_\odot\,\mbox{yr}^{-1}$). An off-center carbon ignition will convert CO WDs to ONe WDs via an inwardly propagating carbon burning flame; ONe WDs are expected to collapse into a neutron star through electron capture on $^{24}$Mg and $^{20}$Ne when mass accretion goes on (e.g., Nomoto \& Iben 1985; Saio \& Nomoto 1985, 1998; Brooks et al. 2016; Wu \& Wang 2018). Wang et al. (2017a) found that the WD can increase its mass steadily in the regime between $\dot{M}_{\rm st}$ and the critical rate for off-center carbon burning, in which explosive carbon ignition (see Lesaffre et al. 2006; Chen et al. 2014c) can happen in the center of the WD when it grows in mass close to ${M}_{\rm Ch}$, leading to an SN Ia explosion. Note that Brooks et al. (2016) recently also reported these two possible outcomes (i.e., center or off-center carbon ignition), but they only computed over a narrower range of binary parameter space. Similar to previous studies (e.g., Iben \& Tutukov 1989; Nomoto et al. 2007), the He-shell burning underneath the H-shell was neglected for simplicity when I simulated the long-term evolution of H-accreting WDs. It is still hard for the H-accreting WD to increase its mass to ${M}_{\rm Ch}$ as steady burning regime of He-shell burning is higher than that for H-shell burning (see Fig. 1). This fundamental difficulty for double-shell (H-/He-shell) burning needs to be settled in future investigations. \subsection{Mass-accumulative efficiencies and nova cycle durations} If $\dot{M}_{\rm acc}<\dot{M}_{\rm st}$, the accreting WD will experience H-/He-shell flashes like nova outbursts. Recent studies indicate that a WD can grow in mass to ${M}_{\rm Ch}$ through multicycle nova outbursts, resulting in an SN Ia explosion finally (e.g., Wang et al. 2015a; Hillman et al. 2015, 2016; Wu et al. 2017). \begin{figure} \begin{center} \includegraphics[width=10.2cm,angle=0]{f2a.eps} \includegraphics[width=10.2cm,angle=0]{f2b.eps} \caption{Mass-accumulative efficiencies ($\eta$) vs. $\dot{M}_{\rm acc}$ for various ${M}^{\rm i}_{\rm WD}$. Panel (a): the results of H-shell flashes in my simulations. Panel (b): the results of He-shell flashes based on the studies of Wu et al. (2017).} \end{center} \end{figure} The mass-accumulative efficiency ($\eta$) during nova outbursts is defined as the mass fraction of accreted material that is retained by the WD. $\eta$ plays a fundamental role in binary evolution, which has a strong influence on the rates and delay times of SNe Ia (see, e.g., Bours et al. 2013; Toonen et al. 2014; Wang et al. 2015b; Kato et al. 2018). Fig. 2 shows the mass-accumulative efficiencies of H-/He-shell flashes for different ${M}^{\rm i}_{\rm WD}$ and $\dot{M}_{\rm acc}$. For a given ${M}_{\rm WD}$, $\eta$ increases with $\dot{M}_{\rm acc}$.This is because the degeneracy of the H-/He-shell is lower for high accretion rates, resulting in that the wind becomes weaker and more mass accumulated on the surface. Yoon et al. (2004) suggested that $\eta$ may be increased when rotation is considered. The data points of Fig. 2 can be used in the studies of binary population synthesis (BPS) computations, which can be provided on request by contacting the author. \begin{figure} \begin{center} \includegraphics[width=9.5cm,angle=0]{f3.eps} \caption{Mass-accumulative efficiencies ($\eta_{\rm He}$) vs. $\dot{M}_{\rm acc}$ for ${M}^{\rm i}_{\rm WD}=1.0{M}_\odot$. The blue solid line is taken from Kato \& Hachisu (2004), the black dashed line is from Piersanti et al. (2014), and the red dotted line is from Wu et al. (2017).} \end{center} \end{figure} Many studies on the long-term evolution of mass-accreting WDs come into some different results about the value of $\eta$ (e.g., Prialnik \& Kovetz 1995; Cassisi et al. 1998; Kato \& Hachisu 2004; Yaron et al. 2005; Wolf et al. 2013; Idan et al. 2013; Newsham et al. 2014; Wang et al. 2015a; Hillman et al. 2015, 2016; Wu et al. 2017; Kato et al. 2017). In Fig. 3, I compare the values of $\eta_{\rm He}$ obtained by different groups. From this figure, we can see that the values of $\eta_{\rm He}$ in Kato \& Hachisu (2004) are apparently higher than those in Piersanti et al. (2014) and Wu et al. (2017). Kato et al. (2018) recently discussed the reasons for such divergence in detail, and found that the mass-loss mechanism during nova outbursts is a key process of determining the value of the mass-accumulative efficiency. \begin{figure} \begin{center} \includegraphics[width=10.2cm,angle=0]{f4a.eps} \includegraphics[width=10.2cm,angle=0]{f4b.eps} \caption{Nova cycle durations ($D$) vs. $\dot{M}_{\rm acc}$ for various ${M}_{\rm WD}$. Panel (a): the results of H-shell flashes in my simulations. Panel (b): the results of He-shell flashes based on the studies of Wu et al. (2017).} \end{center} \end{figure} Nova cycle duration ($D$) is defined as the recurrence time interval between two successive outbursts, which is an important observed property for nova outbursts. Fig. 4 presents nova cycle durations during H-/He-shell flashes for different ${M}_{\rm WD}$ and $\dot{M}_{\rm acc}$. There exits a strong inverse relationship between $D$ and $\dot{M}_{\rm acc}$ for each value of ${M}_{\rm WD}$ (see also Hillman et al. 2016). For a given ${M}_{\rm WD}$, $D$ become shorter when $\dot{M}_{\rm acc}$ increases. This is because nova outbursts occur when the accumulated mass of the shell reaches almost the same critical value for a specific value of ${M}_{\rm WD}$ though $\dot{M}_{\rm acc}$ has some effect on the accumulated mass, which means that a higher $\dot{M}_{\rm acc}$ results in a shorter $D$. Moreover, for a given $\dot{M}_{\rm acc}$ the durations become shorter for massive WDs. This is because the shell mass needed for nuclear burning is smaller for massive WDs due to their stronger surface gravity. Therefore, the recurrent flashes on the massive WDs with higher $\dot{M}_{\rm acc}$ would happen more frequently than that of low-mass WDs with lower $\dot{M}_{\rm acc}$. Additionally, the He-nova cycle duration is longer than that of H-nova for a given ${M}_{\rm WD}$ and $\dot{M}_{\rm acc}$. This is because the temperature for He burning is higher than that of H burning; it needs a thick He-shell for ignition and thus more time to accrete material. \section{The single-degenerate model} In this model, a WD accretes H-/He-rich material from a non-degenerate star that could be a main-sequence or a slightly evolved subgiant star (the WD+MS channel), or a red-giant star (the WD+RG channel), or even a He star (the WD+He star channel). When the WD grows in mass close to ${M}_{\rm Ch}$, it may produce an SN Ia (see, e.g., Hachisu et al. 1996; Li \& van den Heuvel 1997; Yungelson \& Livio 1998, 2000; Langer et al. 2000; Han \& Podsiadlowski 2004). This model may explain the similarities of most SNe Ia as the WD in this model has the same explosion mass (i.e., ${M}_{\rm Ch}$). Meanwhile, there are many SD progenitor candidates of SNe Ia in the observations (for more discussions see Sects 3.1.2, 3.2.2 and 3.3.2). Importantly, this model is supported by some recent observations. For example, the signatures of circumstellar matter (CSM) before SN explosion (e.g., Patat et al. 2007; Wang et al. 2009c; Sternberg et al. 2011; Dilday et al. 2012; Silverman et al. 2013a,b), the early optical and UV emission from ejecta-companion interaction in some SNe Ia (e.g., Kasen 2010; Hayden et al. 2010; Ganeshalingam et al. 2011; Wang et al. 2012; Cao et al. 2015; Liu et al. 2015a; Marion et al. 2016; but see also Bianco et al. 2011; Shappee et al. 2016; Kromer et al. 2016; Piro \& Morozova 2016), the wind-blown cavity in some SN remnants (e.g., Badenes et al. 2007; Williams et al. 2011), and the possible pre-explosion images (e.g., Voss \& Nelemans 2008; McCully et al. 2014), etc. It is worth noting that while there is some evidence for gas outflows before SN explosion, this is only seen in a handful of SNe Ia (Ia-CSM). It is still unclear what fraction of all SNe Ia have evidence of CSM around them. Meanwhile, the pre-explosion images in SN 2012Z and the UV emission in iPTF14atg mainly relate to type Iax SNe but not normal SNe Ia (e.g., McCully et al. 2014; Cao et al. 2015). The mass donor in the SD model would survive after SN explosion and potentially be identified, whereas an SN explosion following the merger of two WDs would leave no compact remnant in the DD model. Thus, it is a possible way to identify the SD model and the DD model by searching for the surviving companion stars. It has been suggested that Tycho G may be a surviving companion star of Tycho's SN (e.g., Ruiz-Lapuente et al. 2004; for more discussions see Sect. 3.1.3). The surviving companion stars predicted by the WD+RG channel may relate to the formation of the observed single low-mass He WDs (for more discussions see Sect. 3.2.3), and the surviving companion stars from the WD+He star channel relate to the formation of hypervelocity He stars (for more discussions see Sect. 3.3.3). Note that Vennes et al. (2017) recently reported the discovery of a low-mass WD (LP 40-365) with a high proper motion, which travels with a velocity greater than the escape velocity of our Galaxy. Vennes et al. (2017) found that LP 40-365 has a peculiar atmosphere that is dominated by intermediate-mass elements, and argued that this partially burnt remnant may be ejected by an SN Ia that originates from the SD model. The optically thick wind assumption (see Hachisu et al. 1996) is widely adopted in the studies of the SD model (e.g., Li \& van den Heuvel 1997; Hachisu et al. 1999a,b; Han \& Podsiadlowski 2004; Chen \& Li 2007; Meng et al. 2009; Wang et al. 2009a, 2010). In this assumption, the red-giant-like regime in Fig. 1 can be replaced by the optically thick wind regime. If $\dot{M}_{\rm acc}$ exceeds a critical rate (i.e., $\dot{M}_{\rm cr}$ in Sect. 2), it is supposed that the accreted material burns steadily on the surface of the WD at this critical rate; the unprocessed material is blown away in the form of the optically thick wind. The optically thick wind assumption can enlarge the parameter space for producing SNe Ia and thus their rate (e.g., Li \& van den Heuvel 1997; Han \& Podsiadlowski 2004). Meanwhile, the properties of some supersoft X-ray sources and recurrent novae may be explained by this assumption (e.g., Hachisu \& Kato 2003, 2005, 2006; Hachisu et al. 2007; Kato et al. 2018). However, the optically thick wind assumption is still under hot debate. For example, the metallicity threshold predicted by this model is conflict with observations (e.g., Prieto et al. 2008; Badenes et al. 2009a; Galbany et al. 2016). Meanwhile, SNe Ia are not expected at high-redshift ($z>1.4$) for this model (see Kobayashi et al. 1998), but some high-redshift SNe Ia even at $z=2.26$ have been reported (e.g., Graur et al. 2011, 2014a; Frederiksen et al. 2012; Rodney et al. 2012, 2014, 2015; Jones et al. 2013). In addition, the wind velocity predicted by this model is too large to match observations (e.g., Patat et al. 2007; Badenes et al. 2007). According to this model, the hot WD would photoionize the surrounding interstellar medium, so some emission lines (such as He II 4686 and [O I] 6300) can be produced. And, an emission-line shell or nebula should be visible around the progenitor up to thousands of years after the explosion. These emission lines should be detected in old elliptical galaxies or around some individual SN remnants. However, any evidence for such emission has not been found so far (e.g., Woods \& Gilfanov 2013, 2016; Graur et al. 2014b; Johansson et al. 2014, 2016; Woods et al. 2017). Note that some alternative models to the optically thick wind assumption have been proposed, for example, the super-Eddington wind model (e.g., Ma et al. 2013; Wang et al. 2015a) and the common-envelope wind model (see Meng \& Podsiadlowski 2017). Additionally, a serious challenge to the SD model is the non-detection of stripped H-rich material. In the SD model, H-rich material can be removed from the surface of the non-degenerate companion star. Recent 3D hydrodynamic simulations of the interaction between SN Ia ejecta and their MS/RG companion stars indicate that the stripped H-rich material is always larger than 0.1$\,{M}_\odot$ (see Pan et al. 2012, 2014; Liu et al. 2012a, 2013a). However, no stripped H-rich material has been detected in late-time spectra of SNe Ia yet (e.g., Leonard et al. 2007; Shappee et al. 2013; Lundqivst et al. 2013, 2015; Maguire et al. 2015).\footnote{Late-time observations can afford a new diagnostic of SN Ia nebular, explosion, and progenitor physics. Graur et al. (2017a) recently summarized the progress in this field. The relevant theoretical investigations on this field include Fransson \& Kozma (1993), Seitenzahl et al. (2009) and R\"{o}pke et al. (2012). Meanwhile, the recent observational studies include Fransson \& Jerkstrand (2015), Graur et al. (2016, 2017a), Shappee et al. (2017), Kerzendorf et al. (2017a), Dimitriades et al. (2017) and Yang et al. (2018).} Furthermore, the SD model is suffering the issue of the deficit of the supersoft X-ray flux in the observations (e.g., Gilfanov \& Bogd$\acute{\rm a}$n 2010; Di Stefano 2010). Note that the supersoft X-ray source stage only accounts for a short time in the SD model, which can be alleviating the existing X-ray constraints (see also Wang \& Han 2012). \subsection{The WD+MS channel} This channel is usually called the supersoft channel, in which a CO WD accretes H-rich material from a MS or a slightly evolved subgiant star. The accreted H-rich material is burned into He, and then the He is converted to carbon and oxygen. The WD may explode as an SN~Ia when it grows in mass close to ${M}_{\rm Ch}$. For more discussions on this channel, see, e.g., Li \& van den Heuvel 1997; Hachisu et al. (1999a, 2008), Langer et al. (2000), Han \& Podsiadlowski (2004), Fedorova et al. (2004), Meng et al. (2009), Wang et al. (2010, 2014a), Chen et al. (2014a), Meng \& Podsiadlowski (2017) and Liu \& Stancliffe (2017, 2018). \subsubsection{Evolutionary scenarios and parameter space} \begin{figure} \begin{center} \epsfig{file=f5.eps,width=16cm} \caption{Evolutionary scenarios to WD+MS systems that can form SNe Ia (see also Wang \& Han 2012).} \end{center} \end{figure} In the supersoft channel, SNe Ia originate from the evolution of WD+MS systems. Fig. 5 presents the main binary evolutionary scenarios to WD+MS systems that can form SNe Ia (for details see Wang \& Han 2012; see also Meng et al. 2009; Wang et al. 2010). For Scenario A, the initial parameters of the primordial binaries are in the range of $M_{\rm 1,i}\sim4.0$$-$$7.0\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.3-0.4$, and $\log P^{\rm i}\rm(d) \sim 1.0-1.5$, in which $M_{\rm 1,i}$ and $M_{\rm 2,i}$ are the initial masses of the primordial primary and secondary, respectively, and $P^{\rm i}$ is the initial orbital period of the primordial systems. For Scenario B, the initial binary parameters are in the range of $M_{\rm 1,i}\sim2.5$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.2-0.9$, and $\log P^{\rm i}\rm(d) \sim 2.0-3.0$. For Scenario C, the initial binary parameters are in the range of $M_{\rm 1,i}\sim3.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.2-0.7$, and $\log P^{\rm i}\rm(d) \sim 2.5-3.5$. Among the three scenarios, SNe Ia are mainly produced by Scenarios A and B, in which each scenario contributes to about half of SNe Ia through the supersoft channel (see Wang et al. 2010). \begin{figure} \begin{center} \epsfig{file=f6.eps,angle=270,width=10.2cm} \caption{Initial parameter space of SNe Ia for the supersoft channel in the $\log P^{\rm i}-M^{\rm i}_2$ plane with different ${M}^{\rm i}_{\rm WD}$. Source: From Wang et al. (2010).} \end{center} \end{figure} After the formation of WD+MS systems, the WD can accrete material from a MS or a slightly evolved subgiant star. According to the optically thick wind assumption, Li \& van den Heuvel (1997) studied the supersoft channel based on detailed binary evolution computations with ${M}^{\rm i}_{\rm WD}=1.0$, 1.2$\,M_\odot$. Han \& Podsiadlowski (2004) investigated this channel in a systematic way with different ${M}^{\rm i}_{\rm WD}$ and gave the results of BPS approach. Fig. 6 shows the initial parameter space of SNe Ia for the supersoft channel in the $\log P^{\rm i}-M^{\rm i}_2$ plane with different ${M}^{\rm i}_{\rm WD}$, where $M^{\rm i}_2$ is the initial mass of the MS star and $P^{\rm i}$ is the initial orbital period of the WD+MS system. If the initial parameters of a WD+MS system are located in this parameter space, an SN Ia is supposed to be formed. The minimum ${M}^{\rm i}_{\rm WD}$ for producing SNe Ia in this channel is $0.61\,M_\odot$ that can grow in mass to ${M}_{\rm Ch}$. According to a detailed BPS simulation, Wang et al. (2010) estimated that the Galactic SN Ia rate from the supersoft channel is $\sim$$1.8\times10^{-3}\,{\rm yr}^{-1}$, mainly contributing to the observed SNe Ia with intermediate and long delay times. Note that if the new mass-accumulation efficiencies ($\eta$) in Fig. 2 are adopted, some systems with low mass MS donors in Fig. 6 will not produce SNe Ia as the values of the new $\eta$ are lower than those used in Wang et al. (2010). SN 2002ic is a peculiar SN Ia that lost a few solar mass of H-rich material before SN explosion (e.g., Hamuy et al. 2003; Deng et al. 2004). Han \& Podsiadlowski (2006) suggested that the atypical properties of SN 2002ic may be reproduced by the delayed dynamical instability in the frame of the supersoft channel, which requires that the mass donor was initially $\sim$3\,$M_{\odot}$. Han \& Podsiadlowski (2006) estimated that $<$1\% SNe~Ia should belong to SN 2002ic-like objects (see also Meng et al. 2009). \subsubsection{Progenitor candidates} In the observations, the candidates of the supersoft channel have been identified as supersoft X-ray sources and recurrent novae (e.g., van den Heuvel et al. 1992; Rappaport et al. 1994). Supersoft X-ray sources are strong candidates of SN Ia progenitors, which are WD binaries where steady nuclear burning occurs on the surface of the WDs (e.g., Chen et al. 2015). Recurrent novae usually include a massive WD with $\dot{M}_{\rm acc}<\dot{M}_{\rm st}$. Especially, U Sco (a recurrent nova) is a strong progenitor candidate of SNe Ia, including a $1.55\pm0.24\,M_{\odot}$ WD and a $0.88\pm0.17\,M_{\odot}$ MS donor with an orbit period of $\sim0.163$\,d (e.g., Hachisu et al. 2000; Thoroughgood et al. 2001). However, Mason (2011) argued that U Sco may be a nova outburst happened on the surface of an ONe WD, and thus its final fate may not be an SN~Ia but collapse to a neutron star. In addition, M31N~2008-12a is a remarkable recurrent nova in M31, and its recurrence period is $\sim$1\,yr; the WD mass in M31N~2008-12a may be $\sim$$1.38\,M_{\odot}$ with $\dot{M}_{\rm acc}=1.6\times10^{-7}\,{M}_\odot\,\mbox{yr}^{-1}$, making it a promising candidate of SN Ia progenitors (e.g., Darnley et al. 2014, 2016; Tang et al. 2014; Kato et al. 2015, 2017). In order to search the progenitor candidates of SNe Ia, Rebassa-Mansergas et al. (2017) recently obtained a large sample of detached WD+F/G/K star binaries (see also Li et al. 2014), and Toonen et al. (2017) made a detailed estimate of the number of WD+MS binaries in the Gaia sample. \subsubsection{Surviving companion stars} According to the supersoft channel, Han (2008) gave various properties of the surviving companion stars at the moment of SN explosion, which are runaway stars that are moving away from the center of SN remnants (see also Wang \& Han 2010a). The surviving companion star in the supersoft channel would evolve to a CO WD finally. Hansen (2003) argued that the supersoft channel might potentially explain the properties of high-velocity WDs in the halo, which differs from others as they consist exclusively of single stars. In order to search the surviving companion stars after SN explosion, Pan et al. (2012) carried out the impact of SN Ia ejecta on MS, RG and He star companions based on hydrodynamical simulations (see also Pan et al. 2010, 2013, 2014; Liu et al. 2012a, 2013a,b). It has been suggested that Tycho G may be a surviving companion star of Tycho's SN, which has a space velocity of $136\,{\rm km/s}$ (see Ruiz-Lapuente et al. 2004). However, the surviving companion star of Tycho's SN is still not well determined. Han (2008) found that the observed properties of Tycho G are compatible with the surviving companion star of the supersoft channel, e.g., the surface gravity, the effective temperature and the space velocity, etc (see also Wang \& Han 2010a). Lu et al. (2011) claimed that the non-thermal X-ray arc in Tycho's SN remnant may originate from the interaction between SN ejecta and the stripped mass of the companion. In addition, Zhou et al. (2016) suggested that the most plausible origin for the expanding molecular bubble surrounding Tycho's SN remnant is the fast outflow driven from a WD as it accreted material from a non-degenerate donor, which provides an evidence for a SD progenitor for Tycho's SN. Note that Fang et al. (2018) recently argued that the SN ejecta evolved in the cavity driven by the latitude-dependent wind provides an alternative explanation for the peculiar shape of the periphery of Tycho's SN remnant. For more studies on the surviving companion star of Tycho'SN, see, e.g., Fuhrmann (2005), Ihara et al. (2007), Gonz$\acute{\rm a}$lez-Hern$\acute{\rm a}$ndez et al. (2009), Kerzendorf et al. (2009, 2013), Liu et al. (2013a) and Pan et al. (2014). Note that it is still no conclusive confirmation about any surviving companion stars of SNe~Ia. \subsection{The WD+RG channel} This channel is called the symbiotic channel, usually consisting of a hot WD and a RG star. In most cases a hot WD accretes material from a RG star through stellar wind, but in some cases through Roche-lobe. The surviving companion stars in this channel may relate to the formation of the observed single low-mass He WDs (for more discussions see Sect. 3.2.3). For more discussions on this channel see, e.g., Yungelson et al. (1995), Hachisu et al. (1996, 1999b), Li \& van den Heuvel (1997), Yungelson \& Livio (1998), L\"{u} et al. (2006, 2009), Xu \& Li (2009), Wang et al. (2010), Wang \& Han (2010b), Chen et al. (2011) and Liu et al. (2018a). \subsubsection{Evolutionary scenario and parameter space} \begin{figure} \begin{center} \epsfig{file=f7.eps,width=8cm} \caption{Evolutionary scenario to WD+RG systems that can form SNe Ia (see also Wang \& Han 2012).} \end{center} \end{figure} Compared with the supersoft channel, SNe Ia in the symbiotic channel originate from wider primordial binaries. Fig. 7 shows the binary evolutionary scenario to WD+RG systems that can form SNe Ia (for details see Wang \& Han 2012; see also Wang et al. 2010). There is one binary evolutionary scenario that can produce CO WD+RG systems and then form SNe~Ia. The primordial primary first fills its Roche-lobe when it evolves to the thermal pulsing asymptotic giant branch (TPAGB) stage. A common-envelope (CE) may be formed owing to the dynamically unstable Roche-lobe overflow (RLOF). The primordial primary becomes a CO WD after the CE ejection. At this moment, a CO WD+MS system is formed. A CO WD+RG system can be formed when the MS companion evolves to the RG stage. For the symbiotic channel, SN Ia explosions happen for the binary parameter ranges of $M_{\rm 1,i}\sim5.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.1-0.5$, and $\log P^{\rm i}\rm(d) \sim 2.5-4.0$ (see Liu et al. 2018a). Previous studies suggested that the initial parameter space for producing SNe Ia from the symbiotic channel is too small as a CE is easily formed when the RG star fills its Roche lobe, and thus a low rate of SNe Ia (e.g., Yungelson et al. 1995; Li \& van den Heuvel 1997, Yungelson \& Livio 1998; L\"{u} et al. 2006; Wang et al. 2010). In order to avoid the formation of a CE once the RG star fills its Roche-lobe, Hachisu et al. (1999b) supposed that a stellar wind from the WD strips some mass of the RG star to stabilize the mass-transfer process, known as the mass-stripping model. However, this model has not been confirmed by the observations. Note that some studies enlarged the initial parameter space for producing SNe Ia and thus obtained a high rate through the symbiotic channel (e.g., L\"{u} et al. 2006; Chen et al. 2011) , but these works strongly depends on model parameters or assumptions. \begin{figure} \begin{center} \epsfig{file=f8.eps,angle=270,width=10.2cm} \caption{Initial and final parameter space of SNe Ia for the symbiotic channel in the $\log P-M_2$ plane with different ${M}^{\rm i}_{\rm WD}$. The filled asterisk and triangle show the locations of symbiotics T CrB and RS Oph, respectively. The data points of these contours are from Liu et al. (2018a).} \end{center} \end{figure} Liu et al. (2018a) recently adopted an integrated mass-transfer prescription for the symbiotic channel based on a power-law adiabatic supposition, which is applicable for the mass-transfer from a RG star onto the WD (see Ge et al. 2010). They evolved a large number of WD+RG systems, and found that the parameter space of WD+RG systems for producing SNe Ia is significantly enlarged. The mass-transfer prescription adopted by Liu et al. (2018a) is still under debate when the RG star fills its Roche-lobe (see Woods \& Ivanova 2011), but their work at least gave an upper limit of the parameter space for producing SNe Ia. Fig. 8 shows the initial and final parameter space of SNe Ia in the $\log P-M_2$ plane with different ${M}^{\rm i}_{\rm WD}$ for the symbiotic channel. The minimum ${M}^{\rm i}_{\rm WD}$ for producing SNe Ia in this channel is $\sim$$1.0\,M_\odot$. The binary parameters of RS Oph and T CrB are located in the parameter space of WD+RG systems for producing SNe Ia (see Fig. 8); these two symbiotics may form SNe Ia in their future evolutions (for more discussions see Sect. 3.2.2). According to a detailed BPS approach, Liu et al. (2018a) found that the symbiotic channel may contribute to at most 2\% of all SNe Ia in our Galaxy, and mainly contribute to SNe Ia with intermediate and long delay times. The rate of SNe Ia in Liu et al. (2018a) is still low compared with previous studies as most of WD+RG systems are difficult to locate in the initial parameter space of Fig. 8 in the current BPS studies, which needs to be further investigated. \subsubsection{Progenitor candidates} Symbiotic novae have been proposed as progenitor candidates of SNe Ia, which are binaries where the WD accretor undergoes a classical nova eruption. In the observations, many symbiotic novae have WD mass close to ${M}_{\rm Ch}$ and have giant companions, e.g., RS Oph, T CrB and V745 Sco, etc (e.g., Hachisu \& Kato 2001; Parthasarathy et al. 2007). (1) RS Oph has a 1.2$-$$1.4\,M_\odot$ WD and a 0.68$-$$0.8\,M_\odot$ RG star with an orbital period of $\sim$454\,d (e.g., Brandi et al. 2009). Miko\l{}ajewska \& Shara (2017) recently suggested that the WD in RS Oph may be a CO WD by analyzing its spectra, making it a strong progenitor candidate of SNe Ia. (2) T CrB has a $\sim$$1.2\,M_\odot$ WD and a $\sim$$0.7\,M_\odot$ RG star with an orbital period of $\sim$227\,d (e.g., Belczy$\acute{\rm n}$ski \& Miko\l{}ajewska 1998). However, it is still uncertain whether the WD in T CrB is a CO WD or an ONe WD; the latter is expected to result in accretion-induced collapse rather than an SN Ia explosion. (3) V745 Sco is a symbiotic nova. Orlando et al. (2017) recently suggested that the WD in V745 Sco is a CO WD as this nova shows no signs of Ne enhancement. Furthermore, the ejected mass during nova outbursts in V745 Sco is considerably lower than the mass needed to initiate the thermonuclear reaction (e.g., Drake et al. 2016), making it a strong progenitor candidate of SNe Ia. Tang et al. (2012) recently found a peculiar symbiotic J0757, including a $1.1\pm0.3\,M_\odot$ WD and a $0.6\pm0.2\,M_\odot$ RG star with an orbit period of $\sim$119\,d. J0757 does not show any signature of symbiotic stars in quiescent stage, which is different from any other known classic or symbiotic novae. This implies that it is a missing population among symbiotics. In addition, J0757 had a 10\,yr flare in the 1940s, possibly from H-shell burning on the surface of the WD and without significant mass-loss, indicating that the WD in J0757 could increase mass effectively and may explode as an SNe Ia in the future. It is worth noting that the rate of symbiotic novae can put some constraints on the formation of SNe Ia, and thus more symbiotic novae are needed in the observations. \subsubsection{Surviving companion stars} The surviving companion stars of SNe Ia from the symbiotic channel relate to the formation of single low-mass He WDs (LMWDs; $<$$0.45\,M_{\odot}$), the existence of which is supported by some observations (e.g., Marsh et al. 1995; Kilic et al. 2007). Kalirai et al. (2007) suggested that single stars may form single LMWDs, especially at high metallicity environment (see also Kilic et al. 2007). However, the study of the initial-final mass relation for stars with different metallicities indicated that only LMWDs with mass $>$$0.4\,M_{\odot}$ can be formed through this way (e.g., Han et al. 1994; Meng et al. 2008). Single LMWDs can be naturally produced in binaries, in which their compact companions exploded as SNe~Ia. The surviving companion stars of the old SNe~Ia from the symbiotic channel have low masses ($<$$0.45\,M_{\odot}$), the final fate of which is single LMWDs (e.g., Justham et al. 2009; Wang \& Han 2010a). On the other hand, the existence of the single LMWDs indicates that some SNe~Ia may be happened with RG donors in symbiotics. Note that Nelemans \& Tauris (1998) argued that single LMWDs might be formed through a solar-like star accompanied by a brown dwarf or a massive planet with a relatively close orbit. Note also that Zhang et al. (2018) recently claimed that the merger remnants of He WD+MS systems can provide an alternative way for the formation of single LMWDs. \subsection{The WD+He star channel} The mass donor in this channel is a He star or a He subgiant, which can afford enough mass for the WD growing in mass to ${M}_{\rm Ch}$ and forming an SN Ia finally. This channel is known as the He star donor channel, which is a particularly favorable way for producing observed young SNe Ia (see Wang et al. 2009a,b). The surviving companion stars in this channel may be related to the formation of hypervelocity He stars (for more discussions see Sect. 3.3.3). For more discussions on this channel, see, e.g., Yoon \& Langer (2003), Ruiter et al. (2009), Wang \& Han (2010c), Liu et al. (2010), Claeys et al. (2014), Wu et al. (2016) and Wang et al. (2017a). \subsubsection{Evolutionary scenarios and parameter space} \begin{figure} \begin{center} \epsfig{file=f9.eps,width=16cm} \caption{Evolutionary scenarios to WD+He star systems that can form SNe Ia (see also Wang \& Han 2012).} \end{center} \end{figure} Fig. 9 shows the binary evolutionary scenarios to WD+He star systems that can form SNe Ia (for details see Wang \& Han 2012; see also Wang et al. 2009b). Three evolutionary scenarios can produce WD+He star systems and then form SNe~Ia. For Scenario A, the initial parameters of the primordial binaries are in the range of $M_{\rm 1,i}\sim5.0$$-$$8.0\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.2-0.9$, and $\log P^{\rm i}\rm(d) \sim 1.0-1.5$. For Scenario B, the initial binary parameters are in the range of $M_{\rm 1,i}\sim6.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}>0.9$, and $\log P^{\rm i}\rm(d) \sim 2.5-3.0$. For Scenario C, the initial binary parameters are in the range of $M_{\rm 1,i}\sim5.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}>0.9$, and $\log P^{\rm i}\rm(d)>3.0$. Among the three scenarios, Scenario A contributes to almost 90\% SNe Ia through the He star donor channel (see Wang et al. 2009b). \begin{figure} \begin{center} \epsfig{file=f10.eps,angle=270,width=10.2cm} \caption{Initial parameter space of SNe Ia for the He star donor channel. The locations of V445 Pup and HD 49798 with its WD companion are indicated in this figure. The data points of these contours are from Wang et al. (2009a).} \end{center} \end{figure} Adopting the optically thick wind assumption, Wang et al. (2009a) investigated the He star donor channel in a systematic way, in which they performed binary evolution computations for about 2600 close WD+He star systems. They determined the initial parameter space of WD+He star systems that can lead to SNe Ia in the $\log P^{\rm i}-M^{\rm i}_2$ plane (see Fig. 10). The minimum ${M}^{\rm i}_{\rm WD}$ for producing SNe Ia in this channel could be as low as $0.865\,M_{\odot}$. The binary parameters of V445 Pup and HD 49798 with its WD companion are located in the parameter space of WD+He star systems for producing SNe Ia (see Fig. 10), which means that they are progenitor candidates of SNe Ia (for more discussions see Sect. 3.3.2). The Galactic SN~Ia rate from this channel is $\sim$$0.3\times 10^{-3}\,{\rm yr}^{-1}$ and this channel can produce the observed SNe~Ia with short delay times ($\sim$45$-$140\,Myr; see Wang et al. 2009b). Wang \& Han (2010c) suggested that SNe Ia from the He star donor channel occur systemically later in low-metallicity environments. By considering the possibility of the off-center carbon burning, Wang et al. (2017a) estimated that the Galactic SN Ia rates from the He star donor channel decrease to $\sim$$0.2\times 10^{-3}\,{\rm yr}^{-1}$ based on a detailed BPS method. \subsubsection{Progenitor candidates} For the He star donor channel, two massive WD+He star systems are good candidates of SN~Ia progenitors, i.e., V445 Pup and HD 49798 with its WD companion. V445 Pup is the only He nova discovered so far, which was detected during its outburst in late 2000 (e.g., Ashok \& Banerjee 2003; Kato \& Hachisu 2003). According to the light curve fitting of V445 Pup, Kato et al. (2008) suggested that the WD have mass $\gtrsim$$1.35\,M_{\odot}$ and half of the accreted material still remains on its surface. Woudt et al. (2009) obtained the mass of the He star donor $\sim$1.2$-$$1.3\,M_{\odot}$ based on the pre-outburst luminosity of the binary (see also Piersanti et al. 2014). Goranskij et al. (2010) suggested that the most probable orbital period for this binary is $\sim$0.65\,d. The binary parameters of V445 Pup are located in the parameter space contours for producing SNe Ia (see Fig. 10). In addition, Woudt \& Steeghs (2005) suggested that the WD in V445 Pup is a CO WD but not an ONe WD as no signatures of Ne enhancement were detected. Thus, I speculate that V445 Pup is a strong candidate of SN Ia progenitors. HD 49798 is a subdwarf O6 star (1.50$\pm$0.05$\,M_{\odot}$), including a massive compact companion (1.28$\pm$0.05$\,M_{\odot}$) with an orbital period of 1.548\,d (e.g., Thackeray 1970; Bisscheroux et al. 1997; Israel et al. 1997; Mereghetti et al. 2009). However, the nature of the compact companion is still not well known (e.g., Bisscheroux et al. 1997; Liu et al. 2015b; Mereghetti et al. 2016; Popov et al. 2018). Mereghetti et al. (2016) claimed that the companion of HD 49798 is more likely a neutron star based on the new angular momentum and magnetic field analysis (see also Brooks et al. 2017a), but Popov et al. (2018) recently stated that the continuous stable spin-up of the compact companion can be reproduced through contraction of a young WD. Assuming the companion of HD 49798 is a CO WD, Wang \& Han (2010d) suggested that the massive WD can grow in mass to ${M}_{\rm Ch}$ after about $10^{4}$\,yr based on a detailed binary evolution computations. However, Wang et al. (2017a) recently argued that off-center carbon burning may occur when the WD increases its mass close to ${M}_{\rm Ch}$ owing to a high mass-transfer rate ($>$$2.05\times 10^{-6}\,{M}_\odot\,\mbox{yr}^{-1}$). Thus, the WD companion of HD 49798 may form a neutron star but not an SN Ia eventually. \subsubsection{Surviving companion stars} The surviving companion stars of SNe Ia from the He star donor channel relate to the formation of hypervelocity stars (HVSs), which are stars that can escape the gravitational pull of the Galaxy. The first HVS is a B-type star with a Galactic rest-frame radial velocity of 673\,km/s, which was discovered serendipitously by Brown et al. (2005). Up to now, over 20 HVSs have been confirmed by the observations (e.g., Hirsch et al. 2005; Edelmann et al. 2005; Li et al. 2012; Zhong et al. 2014; Zheng et al. 2014; Brown et al. 2014; Huang et al. 2017). It has been suggested that HVSs can be produced by the tidal disruption of a binary through interaction with the super-massive black hole at the Galactic center (see, e.g., Hills1988; Yu \& Tremaine 2003; Lu et al. 2010; Zhang et al. 2010). For a recent review on HVSs see Brown (2015). To date, most of HVSs discovered are B-type stars (see Brown 2015). Only one HVS (US 708, HVS2) is an extremely He-rich sdO star in the Galactic halo (see Hirsch et al. 2005). Wang \& Han (2009) studied the properties of the surviving companion stars of SNe~Ia from the He star donor channel, and suggested that this channel provides an alternative way for the production of hypervelocity He stars such as US 708 (see also Justham et al. 2009). Ziegerer et al. (2017) recently found that J2050 is the spectroscopic twin of US 708, which could be surviving companion stars of SNe Ia that happened in WD+He star systems. Note that Geier et al. (2015) recently presented a spectroscopic and kinematic analysis of US 708, and found that it is the currently fastest unbound star in our Galaxy with a velocity of $\sim$1200\,km/s. Geier et al. (2015) suggested that the surviving donors of sub-${M}_{\rm Ch}$ double-detonation SNe Ia (see Sect. 5) may explain such high velocity due to the short orbital periods at the moment of SN explosion. In order to identify the surviving companion stars of the He star donor channel, Pan et al. (2010) carried out the impact of the SN explosion on the He donors based on hydrodynamical simulations (see also Pan et al. 2013, 2014; Liu et al. 2013b). It is worth noting that some ongoing surveys are searching for more hypervelocity He stars that originate from surviving donors of SNe Ia, for example, the LAMOST LEGUE survey (e.g., Deng et al. 2012) and the Hyper-MUCHFUSS project (e.g., Tillich et al. 2011; Geier et al. 2011, 2015). \section{The double-degenerate model} In the classical DD model, SNe Ia result from the merging of double WDs with total mass $\geq$${M}_{\rm Ch}$; the merging of two WDs is due to the gravitational wave radiation that drives orbital inspiral to merger (e.g., Webbink 1984; Iben \& Tutukov 1984). It has been suggested that this model can reproduce the observed rates and delay time distributions of SNe Ia (e.g., Nelemans et al. 2001; Ruiter et al. 2009, 2013; Mennekens et al. 2010; Yungelson \& Kuranov 2017; Liu et al. 2018b), and may explain the formation of some observed super-luminous SNe~Ia that have WD explosion masses $\geq$$2\,M_\odot$ (e.g., Howell et al. 2006; Hichen et al. 2007; Scalzo et al. 2010; Silverman et al. 2011). One of the strongest pieces of evidence in favor of the DD model is the power-law delay time distribution with an index of $-1$ (e.g., Maoz \& Mannucci 2012; Maoz \& Graur 2017). This delay time distribution likely explains correlations between the SN Ia rates and galaxy properties (e.g., Graur \& Maoz 2013; Graur et al. 2017b). The DD model is also supported by some other observational facts. For example, the absence of H and He lines in the nebular spectra of most SNe Ia (e.g., Leonard 2007; Ganeshalingam et al. 2011; Maguire et al. 2015), no signature of ejecta-companion interaction in some SNe Ia (e.g., Olling et al. 2015), no detection of early radio emission (e.g., Hancock et al. 2011; Horesh et al. 2012), and no absolute evidence of surviving companion stars of SNe Ia (e.g., Badenes et al. 2007; Kerzendorf et al. 2009, 2012, 2013, 2017b; Schaefer \& Pagnotta 2012; Edwards et al. 2012; Graham et al. 2015), etc. In addition, many observational evidence indicates that SN 2011fe may result from the merging of two WDs, which is one of the nearest normal SNe Ia discovered by the Palomar Transient Factory soon after its explosion ($<1$\,d) and quickly followed by many wavebands (e.g., Li et al. 2011b; Nugent et al. 2011; Brown et al. 2012; Bloom et al. 2012; Horesh et al. 2012; Liu et al. 2012b; Shappee et al. 2013, 2017; Chomiuk 2013; Parrent et al. 2014; Lundqvist et al. 2015). Furthermore, many double WDs have been suggested to be progenitor candidates of SNe Ia (for more discussions see Sect. 4.3). Additionally, Shen et al. (2018) recently argued that prompt detonations of sub-${M}_{\rm Ch}$ WD in double WDs can account for the observations of sub-luminous SNe Ia in old stellar populations. However, the DD model has difficulties to explain the similarities of most SNe Ia as the WD explosion mass has a relatively wide range. Meanwhile, a fundamental challenge for this model is that the merger of double WDs may result in the formation of neutron stars through accretion-induced collapse but not thermonuclear explosions (e.g., Saio \& Nomoto 1985, 1998; Nomoto \& Iben 1985; Kawai et al. 1987; Timmes et al. 1994; Shen et al. 2012; Schwab et al. 2016). Due to a high $\dot{M}_{\rm acc}$ during the merger or in the post-merger cooling stage (e.g., Yoon et al. 2007), off-center carbon burning may happen on the surface of the CO WD, which likely converts CO WDs to ONe WDs through an inwardly propagating carbon flame but not SNe Ia. Note that Yoon et al. (2007) argued that the accretion-induced collapse may be avoided for a certain range of parameters when the rotation of the WDs is considered (see also Piersanti et al. 2003). \subsection{The violent merger scenario} It has been suggested that the accretion-induced collapse may be avoided when the coalescence process of double WDs is violent, known as the violent merger scenario; a prompt detonation is triggered when the merging continues, leading to an SN Ia explosion (see Pakmor et al. 2010, 2011, 2012). Pakmor et al. (2010) found that the violent merger of double WDs with almost equal-masses ($\sim$$0.9\,M_{\odot}$) is compatible with the low peak luminosity of SN 1991bg-like objects; although the predicted light curves are too broad owing to the large ejecta mass, the low expansion velocities and synthesized spectra match well with the observed SN 1991bg-like objects. Following a 3D simulation for the violent merger of double WDs with masses of 1.1 and $0.9\,M_{\odot}$, Pakmor et al. (2012) suggested that the violent merger scenario may also explain the properties of normal SNe Ia. The mass ratio of double WDs has a great influence on the outcomes of the WD mergers. Pakmor et al. (2011) argued that the minimum critical mass ratio for double WD mergers to form SNe Ia is $\sim$0.8. The absolute SN Ia brightness in this scenario are mainly determined by the mass of the primary WD as the less massive WD will be totally destroyed during the merging (e.g., Ruiter et al. 2013). It is still under debate whether the violent merger scenario can really produce SNe Ia or not (see, e.g., van Kerkwijk et al. 2010; Taubenberger et al. 2013; Kromer et al. 2013; Moll et al. 2014; Raskin et al. 2014; Fesen et al. 2015; Tanikawa et al. 2015; Chakraborti et al. 2015; Sato et al. 2016; Bulla et al. 2016). \subsection{Evolutionary scenarios and parameter space} \begin{figure} \begin{center} \epsfig{file=f11.eps,width=16cm} \caption{The common-envelope (CE) ejection scenarios to double WDs that can form SNe Ia. In Scenario C, some cases will not experience the second CE ejection (dashed box).} \end{center} \end{figure} For the DD model, it has been suggested that there are three binary evolutionary paths to form double WDs and then produce SNe~Ia; these formation paths can be named as the common-envelope (CE) ejection scenario as all double WDs originate from the CE ejection process before the formation of DD systems (see Fig. 11; e.g., Han 1998; Postnov \& Yungelson 2006; Toonen et al. 2012; Yungelson \& Kuranov 2017; Liu et al. 2018b). For Scenario A, the initial parameters of the primordial binaries are in the range of $M_{\rm 1,i}\sim4.5$$-$$9.0\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.2-0.8$, and $\log P^{\rm i}\rm(d) \sim 0.5-3.0$. For Scenario B, the initial binary parameters are in the range of $M_{\rm 1,i}\sim3.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}\sim0.3-0.9$, and $\log P^{\rm i}\rm(d) > 3.0$. For Scenario C, the initial binary parameters are in the range of $M_{\rm 1,i}\sim3.0$$-$$6.5\,M_\odot$, $q=M_{\rm 2,i}/M_{\rm 1,i}>0.9$, and $\log P^{\rm i}\rm(d)>3.0$. In Scenario C, the double WDs can be also formed after the first CE ejection directly in some cases. Among the three scenarios, SNe Ia are mainly produced by Scenarios A and B, in which each scenario contributes to about 45\% SNe Ia (see Liu et al. 2018b). Aside from the CE ejection scenario above, Ruiter et al. (2013) recently suggested an important stage to the modeling of double WDs in the context of violent mergers, namely a stage where the first-formed CO WD increases its mass by accretion of helium from a He subgaint star, which is known as the WD+He subgiant scenario; in this scenario the mass-transfer before the formation of double WD systems is dynamically stable, which can be also named as the stable mass-transfer scenario compared with the CE ejection scenario (see also Liu et al. 2016, 2018b). The WD+He subgiant scenario allows the formation of significantly more massive primary CO WDs and thus more massive double WDs, which can greatly enhance the SN Ia rate through the DD model if double WD mergers can actually produce SNe Ia. After considering the WD+He subgiant scenario, Liu et al. (2018b) found that the delay time distributions form the DD model is comparable with the observed results, and that the violent mergers through the DD model may contribute to up to 16\% of all SNe Ia. \begin{figure} \begin{center} \epsfig{file=f12.eps,angle=270,width=10.2cm} \caption{Initial parameter space of WD+He star systems for producing SNe Ia based on the DD model. The square with error bars shows the location of a WD+sdB star system KPD 1930+2752. The data points of these contours are from Liu et al. (2018b).} \end{center} \end{figure} The WD+He subgiant scenario has a significant contribution to the formation of massive double WDs. Fig. 12 shows the initial parameter space of WD+He star systems for producing SNe Ia based on the DD model in the $\log P^{\rm i}-M^{\rm i}_2$ plane with different ${M}^{\rm i}_{\rm WD}$. The contours turn to move to upstairs for lower ${M}^{\rm i}_{\rm WD}$, resulting from the assumption that the total mass of double WDs needs to be $\geq$${M}_{\rm Ch}$ for producing SNe Ia. The WD+He star systems outside the contours cannot produce SNe Ia through the DD model (for more details see Sect. 2.3 of Liu et al. 2018b). The parameters of KPD 1930+2752 are located in the parameter space of WD+He star systems for producing SNe Ia through the DD model (see Fig. 12), indicating that it is a progenitor candidate of SNe Ia. \begin{figure} \begin{center} \epsfig{file=f13.eps,angle=270,width=10.2cm} \caption{Density distribution of the masses of double WDs that can form SNe Ia in the mass-ratio and total mass plane. The blue filled triangle with error bars represent the DD core of a planetary nebula Henize 2-428, and the red filled square with error bars shows a double WDs that originates from KPD 1930+2752. The data points of the density distribution are from Liu et al. (2018b).} \end{center} \end{figure} The outcomes of WD mergers are determined by their mass-ratio and total mass (e.g., Pakmor et al. 2010; Sato et al. 2016). Fig. 13 shows the density distribution of the masses of WD mergers that can form SNe Ia in the mass-ratio and total mass plane. The total masses of double WDs for producing SNe Ia have a wide distribution ranging from 1.378$-$2.4\,$M_\odot$, and the mass-ratio are mainly located in the range of 0.6$-$0.8. The density distribution can be divided into two parts: (1) The mass ratio decreases with the total mass in the less-massive part that originates from the WD+He subgiant scenario or the CE ejection scenario. (2) The mass ratio increases with the total mass in the massive part that mainly originates from the WD+He subgiant scenario. The parameters of KPD 1930+2752 and Henize 2-428 are located in the mass-ratio and total mass plane. KPD 1930+2752 originates from the WD+He subgiant scenario, whereas Henize 2-428 originates from the CE ejection scenario (for more discussions see Sect. 4.3). \subsection{Progenitor candidates} KPD 1930+2752 and Henize 2-428 are two progenitor candidates of SNe Ia through the DD model. (1) KPD 1930+2752 is a WD+sdB system with an orbital period of $\sim$2.28\,h (see Maxted et al. 2000). The mass of the sdB star is $\sim$0.45$-$0.52\,$M_\odot$ and the total mass of the system is $\sim$1.36$-$1.48\,$M_\odot$ (see Geier et al. 2007). Liu et al. (2018b) recently suggested that KPD 1930+2752 will not experience mass-transfer until the formation of a double WDs; it takes $\sim$200\,Myr for KPD 1930+2752 to form a double WDs. After the formation of double WDs, KPD 1930+2752 will merge in $\sim$4\,Myr. (2) Henize 2-428 is a planetary nebula with a DD core that has a total mass $\sim$1.76\,$M_\odot$ and mass-ratio $\sim$1 with an orbital period of $\sim$4.2\,h (see Santander-Garc\'ia et al. 2015), which is a strong progenitor candidate of SNe Ia through the violent merger scenario. Recently, some other double WDs have been found, which may have the total mass close to ${M}_{\rm Ch}$ and likely merge in the Hubble-time. For example, WD 2020-425 (e.g., Napiwotzki et al. 2007), V458 Vulpeculae (e.g., Rodr\'{\i}guez-Gil et al. 2010), SBS 1150+599A (e.g., Tovmassian et al. 2010), and GD687 (e.g., Geier et al. 2010), etc. Kawka et al. (2017) recently argued that NLTT 12758 is a super-${M}_{\rm Ch}$ double WD system, but its merging timescale is larger than the Hubble time. So far, there are some systematic surveys for searching double WDs, for example, ESO SN~Ia Progenitor Survey (SPY; e.g., Koester et al. 2001; Geier et al. 2007; Napiwotzki et al. 2004; Nelemans et al. 2005) and the SWARMS survey (see Badenes et al. 2009b). In addition, a substantial population of double WDs may be obtained by Gaia (e.g., Carrasco et al. 2014; Toonen et al. 2017). Before Gaia DR2 is released, the GPS1 proper motion catalogue could be one of most potential catalogs to obtain a substantial population of double WDs owing to its accurate kinematic and photometric informations (see Tian et al. 2017). Furthermore, this type of WD binaries is an important kind of gravitational wave sources in our Galaxy (e.g., Yu \& Jeffery 2010, 2015; Liu et al. 2012c; Liu \& Zhang 2014). Kremer et al. (2017) recently predicted that about 2700 double WD gravitational wave sources will be observable by LISA in our Galaxy. \section{The sub-Chandrasekhar mass model} In this model, a CO WD accumulates a substantial He-shell by mass accretion with a total mass below ${M}_{\rm Ch}$, the explosion of which is triggered by the detonation at the bottom of He-shell; one detonation propagates outwardly via the He-shell, whereas another inwardly propagating pressure wave compresses the CO-core and leads to carbon ignition, which is known as the double-detonation model (e.g., Nomoto 1982a; Woosley et al. 1986; Livne 1990; Branch et al. 1995; H\"{o}flich \& Khokhlov 1996). The minimum WD mass for this model might be $\sim$0.8\,$M_\odot$ as the detonation of the WD may be not triggered for lower mass (e.g., Sim et al. 2012). It has been suggested that the sub-${M}_{\rm Ch}$ model might explain sub-luminous SN 1991bg-like objects (e.g., Branch et al. 1995; Dhawan et al. 2017; Blondin et al. 2018),\footnote{According to the sub-${M}_{\rm Ch}$ double-detonation model, Liu et al. (2017) suggested that the merging of a CO WD with a He-rich WD (a He WD or a hybrid HeCO WD) can roughly reproduce the rates of SN 1991bg-like objects.} and that this model may account for at least some substantial fraction of the observed SN Ia rates if this model can really form SNe Ia (e.g., Ruiter et al. 2009, 2011). Fink et al. (2010) argued that the double-detonation explosion in sub-${M}_{\rm Ch}$ WDs could be robust, even resulting in the formation of normal SNe Ia. According to multiwavelength radiation transport simulations, Goldstein \& Kasen (2018) recently suggested that the sub-${M}_{\rm Ch}$ model can reproduce the entirety of the width-luminosity relation of the observed SNe Ia. However, this model still fails to explain many of the main properties of the observed SNe Ia so far, and it is still \textbf{uncertain} that this model can really interpret which known SNe Ia (e.g., Nugent et al. 1997; Bildsten et al. 2007; Fink et al. 2007, 2010; Shen \& Bildsten 2009; Sim et al. 2010; Kromer et al. 2010; Ruiter et al. 2011; Woosley \& Kasen 2011). Jiang et al. (2017) recently observed a hybrid SN Ia (SN 2016jhr), which has a light curve like normal SNe Ia but with strong titanium absorptions like sub-luminous events; this SN Ia has a prominent but red optical flash at $\sim$0.5\,d after the SN explosion. Jiang et al. (2017) suggested that the early flash of such a hybrid SN Ia may be naturally interpreted by a SN explosion triggered by the detonation of a thin He-shell. Sarbadhicary et al. (2017) recently studied two young SN remnants (SN 1885A and G1.9+0.3), which are the most recent SN Ia remnants in the Local Group. They argued that SN 1885A is consistent with the sub-${M}_{\rm Ch}$ explosion model, and both ${M}_{\rm Ch}$ and sub-${M}_{\rm Ch}$ explosion models are likely for the SN remnant G1.9+0.3. \subsection{Parameter space} \begin{figure} \begin{center} \epsfig{file=f14.eps,angle=270,width=8.5cm} \caption{Initial parameter space of WD+He star systems for producing SNe Ia based on the sub-${M}_{\rm Ch}$ model. The filled star shows the location of a WD+He star system CD$-$30$^{\circ}$\,11223. The data points of these contours are from Wang et al. (2013b).} \end{center} \end{figure} In the sub-${M}_{\rm Ch}$ model, a CO WD with mass below ${M}_{\rm Ch}$ can accrete material from a non-degenerate He star. Fig. 14 shows the initial parameter space of CO WD+He star systems for producing SNe Ia based on the sub-${M}_{\rm Ch}$ model. In this figure, systems beyond the right boundary of the space will experience a high mass-transfer rate as the He star evolves to the He-shell burning phase that is not suitable to trigger double-detonation, and the left boundaries are determined by the condition that RLOF happens when the He donor is on the zero-age MS phase. The lower boundaries are set by the condition that the mass-transfer rate is high enough to form a critical He-shell to trigger a detonation on the surface of the WD. Foley et al.\ (2013) proposed a distinct sub-class of sub-luminous SNe Ia, named type Iax SNe that include SNe resembling the prototype object SN 2002cx (e.g., Li et al.\ 2003; Jha 2017; Barna et al. 2017; Lyman et al. 2018; Singh et al. 2018). Wang et al. (2013b) estimated that the Galactic SN Ia rate from the sub-${M}_{\rm Ch}$ model is in good agreement with the measured rates of type Iax SNe, and that this model can reproduce the delay time distributions and the luminosity distribution of type Iax SNe. The binary parameters of CD$-$30$^{\circ}$\,11223 (a WD+He star system) are located in the parameter space of WD+He star systems for producing SNe Ia (see Fig. 14), which means that this binary is a progenitor candidate of SNe Ia (for more discussions see Sect. 5.2). For the sub-${M}_{\rm Ch}$ model, the ignition mass for the accumulated He-shell is still not well determined, which may depend on $\dot{M}_{\rm acc}$ and change with the temperature of the WD and the CO-core mass (e.g., Iben \& Tutukov 1989; Bildsten et al. 2007; Shen \& Bildsten 2009; Ruiter et al. 2014; Neunteufel et al. 2016). \subsection{Progenitor candidates} CD$-$30$^{\circ}$\,11223 has been identified as a CO WD+He star system with a $\sim$1.2\,h orbital period, including a $\sim$$0.76\,M_{\rm\odot}$ WD and a $\sim$$0.51\,M_{\rm\odot}$ He star (see, e.g.,Vennes et al.\ 2012; Geier et al.\ 2013). Angular momentum loss from the short orbital system is large due to gravitational wave radiation. After $\sim$36\,Myr, the He star will start to fill its Roche lobe when it is still in the He MS stage. CD$-$30$^{\circ}$\,11223 may produce an SN Ia through the sub-${M}_{\rm Ch}$ model in the subsequent evolution (e.g., Wang et al. 2013b; Geier et al.\ 2013). The mass donor star in the sub-${M}_{\rm Ch}$ model would survive after the SN explosion. Geier et al. (2013) suggested that CD$-$30$^{\circ}$\,11223 and the hypervelocity He star US 708 might show two different evolutionary phases (i.e., progenitor and remnant) linked by an SN Ia explosion. Motivated by the discovery of CD$-$30$^{\circ}$\,11223, Kupfer et al. (2017) started a search for ultracompact post-CE binaries based on the Palomar Transient Factory survey. Kupfer et al. (2018) recently reported the discovery of an ultracompact WD+sdOB system OW J0741 with an orbital period of 44\,min based on the OmegaWhite survey, including a $0.72\pm0.17\,M_{\rm\odot}$ WD and a $0.23\pm0.12\,M_{\rm\odot}$ sdOB star. They argued that this binary will either end up as a stably mass-accreting AM CVn system or merge to form an R CrB star eventually. So far, OW J0741 is the most compact WD+hot subdwarf system known. It is noting that Luo et al. (2016) is searching for hot subdwarf binary systems using LAMOST data. \section{Other possible models} Aside from the SD model, the DD model and the sub-${M}_{\rm Ch}$ model above, some potential progenitor models have been proposed to explain the observed diversity among SNe~Ia. For example, the hybrid CONe WD model, the core-degenerate model, the double WD collision model, the spin-up/spin-down model, and the model of WDs near black holes, etc (for recent reviews see Wang \& Han 2012; Maoz et al. 2014; Soker 2018). \subsection{The hybrid CONe WD model} Hybrid CONe WDs have been suggested to be possible progenitors of SNe Ia, which has an unburnt CO-core surrounded by a thick ONe-shell (e.g., Denissenkov et al. 2013, 2015; Chen et al. 2014b). These hybrid WDs can easily grow in mass to ${M}_{\rm Ch}$ by accreting matter, which could increase the rates of SNe Ia if they can really form SNe Ia. Denissenkov et al. (2015) recently argued that hybrid WDs could reach a state of explosive carbon ignition though it depends on some mixing assumptions and the convective Urca process. It has been suggested that carbon abundance in hybrid CONe WDs is lower than that of CO WDs (e.g., Denissenkov et al. 2015). Therefore, hybrid CONe WDs are expected to form SNe Ia with lower peak luminosity and explosion energy, and thus a relatively low ejecta velocity. A hybrid CONe WD could increase its mass to ${M}_{\rm Ch}$ by accreting H-rich material from a MS star (the CONe WD+MS scenario; see Meng \& Podsiadlowski 2014) or from a He star (the CONe WD+He star scenario; see Wang et al. 2014b). Wang et al. (2014b) found that SNe Ia from the CONe WD+He star scenario could be as young as $\sim$28\,Myr, which are the youngest SNe Ia ever predicted. Wang et al. (2014b) also suggested that the CONe WD+He star scenario could provide an alternative way for producing type Iax SNe like SN 2012Z that may be an explosion of a WD accreting material from a He star. By calculating the hydrodynamical stage of the explosion of CONe WDs with ${M}_{\rm Ch}$, Bravo et al. (2016) recently claimed that CONe WDs cannot explain the properties of normal SNe Ia though they may form SNe Iax. For more discussions on this model, see, e.g., Willcox et al. (2016) and Brooks et al. (2017b) \subsection{The core-degenerate model} In this model, SNe Ia are produced at the final stage of common-envelope (CE) evolution through the merging of a CO WD with the hot CO-core of an AGB star (e.g., Kashi \& Soker 2011; Ilkov \& Soker 2012; Soker et al. 2013, 2014). It has been suggested that this model provides an alternative way to form super-luminous SNe Ia (e.g., Kashi \& Soker 2011; Ilkov \& Soker 2012) and some SNe Ia with circumstellar material like PTF 11kx (e.g., Soker et al. 2013). This model was also used to explain the formation of SNe 2014J and 2011fe (e.g., Soker et al. 2014; Soker 2015). According to 3D smoothed particle hydrodynamics simulations, Aznar-Sigu\'{a}n et al. (2015) recently argued that a massive CO WD can be produced through this merging process, resulting in an SN Ia explosion finally. In order to search for the surviving companion star of Kepler's SN, Ruiz-Lapuente et al. (2018) recently surveyed the remnant of this SN and suggested that Kepler's SN could originate either from the core-degenerate model or from the DD model based on the strong limits placed on luminosity, However, the rates of SNe Ia from the core-degenerate model are still not well determined. Ilkov \& Soker (2013) argued that this model can reproduce the observed rates of all SNe Ia based on a simplified BPS code. Due to more careful treatment of mass-transfer process, Wang et al. (2017b) suggested that the Galactic rates of SNe Ia from this model are no more than 20\% of all SNe Ia, mainly contributing to the observed ones with short and intermediate delay times. Wang et al. (2017b) estimated that SNe Ia with circumstellar material from the core-degenerate model can account for 0.7$-$10\% of all SNe Ia, which can explain the observed number of SNe Ia like PTF 11kx. At present, it seems that the core-degenerate model cannot be excluded as a viable way for the production of SNe Ia. Soker (2018) recently summarized the properties of different progenitor models and made detailed comparisons between the core-degenerate model and other models (see also Tsebrenko \& Soker 2015). \subsection{The double WD collision model} This model is a variant of the DD model, which involves the direct collisions of two WDs (e.g., Raskin et al. 2009, 2010; Katz \& Dong 2012; Kushnir et al. 2013). It had been commonly assumed that double WD collisions only occurred in dense stellar environments such as globular clusters and they would thus be a negligible fraction of SNe Ia (e.g., Raskin et al. 2009). In the last few years, it has been realized that the rate of double WD mergers or collisions can be significantly enhanced due to few-body dynamics in field multiples (see, e.g., Thompson et al. 2011; Katz \& Dong 2012; Pejcha et al. 2013). The study by Katz \& Dong (2012) showed that the non-secular effects of Lidov-Kozai mechanism can enhance the double WD collision rates by several orders of magnitude than previously thought and raised the possibility that the collision rate might be on the same order of magnitude with SN Ia rate. Kushnir et al. (2013) demonstrated successful detonations of double WD collisions, which could produce $^{56}$Ni masses spanning the whole range of observed SNe Ia luminosity function from SN 1991T-type events to SN 1999bg-like events. Dong et al. (2015) discovered double-peaked [CoIII] lines in the nebular phase spectra of 3 out of 20 SNe Ia and suggested that SNe Ia with intrinsic bi-modality in $^{56}$Ni may be common among sub-luminous ones ($\sim$40\% of all SNe Ia), which is naturally expected from direct collisions of two WDs due to two centers of detonations. One major open question for the double WD collision model is whether post-MS stellar evolution can produce the sufficient amount of double WDs in suitable multiple stellar systems (see Katz \& Dong 2012; Toonen et al. 2018). Further works on the effects of stellar evolution and stellar multiplicity (e.g., Klein \& Katz 2017) may help to advance our understanding of the rate issue of the collision model. \subsection{The spin-up/spin-down model} In this model, a WD can be spun up by mass accretion from its donor, which can increase its mass above ${M}_{\rm Ch}$; the WD likely needs a spin-down time before it explodes as an SN Ia (e.g., Di Stefano et al. 2011; Justham 2011). This model is a variant of the SD model, which provides a way to reproduce the observed similarities and diversity among SNe~Ia. Due to the spin-up of the WD, the SD model can naturally explain the observed super-luminous SNe~Ia (e.g., Hachisu et al. 2012; Wang et al. 2014a; Benvenuto et al. 2015). By considering the effect of rotation on accreting WDs, Wang et al. (2014a) predicted that 2\% of SNe Ia from the SD model happen with WD explosion masses $\geq$$2\,M_\odot$, which is broadly comparable with these super-luminous ones; these super-luminous events require the initial WD mass to be $>$$1.0\,\rm M_{\odot}$. Importantly, after considering the spin-down time, the SD model could be consistent with the observed properties of most SNe Ia, in particular for the absence of H line in the late-time spectra. However, the spin-down time is still quite uncertain. Meng \& Podsiadlowski (2013) recently argued that the upper limit of the spin-down time is a few $10^{7}$\,yr for progenitor systems that include a RG donor. For more discussions about this model, see, e.g., Yoon \& Langer (2004), Chen \& Li (2009) and Ghosh \& Wheeler (2017). \subsection{The model of WDs near black holes} In this model, SNe Ia are produced by relativistic enhancements of the WD self-gravity when the WD passes near a black hole; this relativistic compression can make the central density of the WD exceed the threshold for pycnonuclear reactions, leading to thermonuclear explosions (see Wilson \& Mathews 2004). The observed ``mixed-morphology'' of the Sgr A East SN remnant in the Galactic center might be explained by this mechanism (see Dearborn et al. 2005). Rosswog et al. (2009) speculated that such encounters may be frequent in the center of dwarf galaxies or globular clusters that host an intermediate-mass black holes (see also Rosswog et al. 2008). Note that the WD+black hole tidal disruption may lead to different events, depending on the mass of the black hole, mass of the WD, and pericenter orbital radius (see Kawana et al. 2017). According to high-resolution simulations, Tanikawa (2018) recently suggested that WDs near black holes can explode as SNe Ia through the tidal double-detonation mechanism (see also Tanikawa 2017). I estimate that the SN~Ia rate from this model may be relatively low as the low possibility of a WD passing close to a black hole, and this model might only explain SNe Ia nearby black holes. \section{Summary} Mass-accreting CO WDs are expected to form SNe Ia when they grow in mass close to ${M}_{\rm Ch}$. Recent studies on mass-accreting CO WDs (including H- and He-accreting WDs) are reviewed, which is important for understanding the mass increase of the WD. Currently, the most studied SN Ia progenitor models are the SD model, the DD model and the sub-${M}_{\rm Ch}$ model. I review recent progress on these progenitor models, including the initial parameter space for producing SNe Ia, the binary evolutionary paths to SNe Ia, the progenitor candidates of SNe Ia, the possible surviving companion stars of SNe Ia, and some observational constraints, etc. The issue of the progenitors of SNe Ia is still poorly understood. It is still no single progenitor model that can reproduce all the observational features and full diversity of SNe Ia. So far, it seems that two or more progenitor models, including some other potential progenitor models, may contribute to the observed diversity among SNe Ia, although the fraction of SNe Ia from each model is really uncertain. To provide further constraints on the issue of SN Ia progenitors, large samples of well-observed SNe~Ia and progenitor candidates are needed, and new progress on the theoretical side is expected. Additionally, a large number of ongoing surveys from ground and space are searching for more SNe Ia,\footnote{For example, the Panoramic Survey Telescope and Rapid Response System (Pan-STARRS), the Gaia Astrometric Mission, the Asteroid Terrestrial-impact Last Alert System (ATLAS), the Catalina Real-Time Transient Survey (CRTS), the All-Sky Automated Survey for Supernovae (ASAS-SN), the OGLE-IV wide field survey, the PMO-Tsinghua Supernova Survey (PTSS), the SkyMapper, the Dark Energy Survey, the Palomar Transient Factory (PTF), and the THU-NAOC Transient Survey (TNTS), etc (e.g., Altavilla et al. 2012; Parrent et al. 2014; Zhang et al. 2015; Chambers et al. 2016; for more, see http://www.rochesterastronomy.org).} which may build the connections between SN Ia progenitors and the observed properties of SN explosions. \begin{acknowledgements} BW acknowledges the referee for the valuable comments that helped me to improve this review. BW also thanks Zhanwen Han, Thomas Marsh, Noam Soker, Or Graur, Tyrone Woods, Subo Dong, Xiangcun Meng, Xuefei Chen, Zhengwei Liu, Jujia Zhang, Hailiang Chen, Ataru Tanikawa and Dongdong Liu for their helpful comments and suggestions. This work is supported by the National Basic Research Program of China (973 programme, 2014CB845700), the National Natural Science Foundation of China (Nos 11673059, 11521303 and 11390374), the Chinese Academy of Sciences (Nos KJZD-EW-M06-01 and QYZDB-SSW-SYS001), and the Natural Science Foundation of Yunnan Province (Nos 2013HB097 and 2017HC018). \end{acknowledgements}
\section{Conclusion} \label{sec:conclusion} Within this paper, we present a benchmark on \ac{CPDP} using effort and cost metrics. We replicated 26 approaches from the state of the art published between 2008 and 2016. Our results show that a trivial approach that predicts everything as defective performs better than the state of the art for \ac{CPDP} under cost considerations. The two best \ac{CPDP} were proposed by Liu~\textit{et al.}~\cite{Liu2010} and Canfora~\textit{et al.}~\cite{Canfora2013, Canfora2015} and are close to the trivial predictions in performance. These are also the only two approaches, that directly optimize costs. We suspect that the generally insufficient performance of \ac{CPDP} models, that was already determined in another benchmark by Herbold~\textit{et al.}~\cite{Herbold2017b}, is the reason for the bad performance of \ac{CPDP} in a cost-sensitive setting. It seems that optimizing directly for cost and not performance of the prediction model is currently the only way to produce relatively cost-efficient \ac{CPDP} models. In our future work, we will build on the findings of this benchmark and use the gained insights to advance the state of the art. We plan to define a general \ac{CPDP} framework, that will allow a better selection of optimization criteria for approaches. We want to see if it is possible to build a wrapper around the defect prediction models that can make them optimize for costs, e.g., by injecting other performance metrics into the machine learning algorithms as optimization criteria, or manipulate the training data such that performance estimations, e.g., based on the \textit{error}~ are more similar to actual costs. We hope to advance the state of the art this way to be more cost-efficient, such that \ac{CPDP} becomes a significant improvement in comparison to assuming everything is defective. In parallel to this, we will collect more defect prediction data in order to scale up the sample size and allow better conclusions about the generalizability of defect prediction results and reduce this major threat to the validity of defect prediction research. \section{Discussion} \label{sec:discussion} Our results cast a relatively devastating light on the cost efficiency of \ac{CPDP}. Based on our results, it just seems better to follow a trivial approach and assume everything as equally likely to contain defects. What we find notable is that most of the state of the art of \ac{CPDP} has ignored cost metrics. Only Khoshgoftaar08, Liu10, Uchigaki12, Canfora13, Panichella14, and YZhang15, i.e, six out of 26 approaches used any effort or cost related metrics when evaluating their work. Only two of these approaches, i.e., Liu10 and Canfora13 optimize for costs. These are also the two best ranked approaches after the trivial baseline if we use all three cost metrics. Liu10 weights false negatives fifteen times stronger than false positives, i.e., puts a strong incentive on identifying defective instances in comparison to misidentifying instances as defective. This incentive means that they optimize the metric $NECM_{15}$. As a results, Liu10-GP is better ranked than the trivial baseline, which is the only time this happend for all approaches and metrics in our benchmark. Canfora13 use two objectives for optimization: the \textit{recall}\footnote{Percentage of predicted defective instances.} and the effort in lines of code considered. This is similar to \textit{AUCEC}, but not sufficient to outperform our trivial baseline even for that metric. Thus, optimizing for cost directly seems to be vital for \ac{CPDP} if the created models should be cost efficient. Another interesting aspect of our findings is the lack of correlation between the ranking using cost metrics and machine learning metrics. One would expect that good classification models in terms of machine learning metrics, also perform well under cost considerations. We believe that this correlation is missing because the performance of the \ac{CPDP} models is too bad, especially the \textit{precision},\footnote{Percentage of defective predictions that are actually not defective.} but also in terms of \textit{recall}. According to the benchmark from Herbold~\textit{et al.}~\cite{Herbold2017d}, only very few predictions achieve a $\textit{recall}\geq0.7$ and $\textit{precision}\geq0.5$ at the same time. In other words, finding 70\% of the defects with at least 50\% of the predicted instances being actually defective is almost impossible with the state of the art of \ac{CPDP}. Herbold~\textit{et al.}~actually found that the baseline FIX is one of the best approaches when it comes to these criteria. Thus, this trivial baseline, which ranks badly in the benchmark by Herbold~\textit{et al.}, performs well in our cost setting, because it has a very high recall. We think that this explains the lack of correlation. If the general performance of \ac{CPDP} models would be higher, we believe that it is likely that the results would be correlated to costs. Both the machine learning metric benchmark by Herbold~\textit{et al.}~\cite{Herbold2017b} and our cost-sensitive benchmark share the trait that relatively na\"{i}ve baselines outperform many approaches from the state of the art and that the best ranking \ac{CPDP} approach is relatively old. In Herbold~\textit{et al.}'s\cite{Herbold2017b} benchmark, the baseline is ALL, i.e., using all data without any treatment for classification. In our case it is the trivial baseline FIX. Moreover, in both benchmarks approaches that are over 5 years old often perform better than most newer approaches. While most researchers implement comparisons to baselines, other approaches from the state of the art are only seldomly replicated. Furthermore, the amount of data is important for the generalization of results. For example, Canfora~\textit{et al.}~\cite{Canfora2015} actually compare their results with the same trivial baseline we do. The difference between their work and ours is that we use more data for our analysis. They use a subset of 10 products from the JURECZKO data, whereas we use 62 products. Together, this shows that diligent comparisons to the state of the art and baselines are vital, but also that using large data sets is mandatory to reach firm conclusions. Otherwise, many approaches will be published, which only marginally advance the state of the art, or only under very specific conditions, but not in a broader context. Please note that while we use 67 products in total, this is still only a small amount of data, in comparison to the thousands of Java projects on GitHub alone that provide sufficient data in issue tracking system and commit comments to be used for defect prediction studies. Therefore, we believe that this sample size is major threat to the validity of this benchmark and defect prediction research in general. The problem of small sample sizes was already identified as a threat to the validity of repository mining studies in general~\cite{Trautsch2016, Trautsch2017}. Without scaling up our sample sizes, we may run into a serious replication crisis. \section{introduction} \label{sec:introduction} Software defect prediction has been under investigation in our community for many years. The reason for this is the huge cost saving potential of accurately predicting in which parts of software defects are located. This information can be used to guide quality assurance efforts and ideally have fewer post release defects with less effort. Since one major problem of defect prediction approaches is the availability of training data, researchers turned towards \ac{CPDP}, i.e., the prediction of defects based on training data from other projects. A recent benchmark by Herbold~\textit{et al.}~\cite{Herbold2017b} compared the performance of 24 suggested approaches by researchers between 2008 and 2015. However, the benchmark has one major limitation: it does not consider the impact on costs directly. Instead, Herbold~\textit{et al.}~ used the machine learning metrics \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}. From a cost perspective, these metrics only make sense, if all software entities that are predicted as defective get additional quality assurance attention. Even then, the cost of missing defects would be assumed as equal to the cost of additional review effort. However, according to the literature, post-release defects cost 15-50 times more than additional quality assurance effort~\cite{Khoshgoftaar2004}. Rahman~\textit{et al.}~\cite{Rahman2012} already found, that the results regarding \ac{CPDP} may be very different, if considered from a cost-oriented perspective. Whether this finding by Rahman~\textit{et al.}~ translates to the majority of the \ac{CPDP} literature is unclear, because a cost-sensitive evaluation is missing. We close this gap with this paper. Our contribution is an adoption of the benchmark from Herbold~\textit{et al.}~\cite{Herbold2017b} for cost metrics to determine a cost-sensitive ranking of \ac{CPDP} approaches. We compare 26 \ac{CPDP} approaches published between 2008 and 2016, as well as three baselines. Our results show that a trivial baseline approach that considers all code as defective is almost never significantly outperformed by \ac{CPDP}. Only one \ac{CPDP} proposed by Liu~\textit{et al.}~\cite{Liu2010} performs better for one out of three cost metrics, but even this is only the case on one of the two data sets we use. For the other data set, the performance of not statistically significantly better. For the other two cost metrics, no \ac{CPDP} approach performs statistically significantly better than the trivial baseline. Moreover, there is no correlation between ranking \ac{CPDP} approaches based on cost metrics, and the ranking produced by Herbold~\textit{et al.}~\cite{Herbold2017b}. Hence, cost metrics should always be considered in addition to other metrics, because otherwise we do not evaluate if proposed models to what they should: reduce costs. The remainder of this paper is structured as follows. We discuss related work in Section~\ref{sec:relatedwork}. Then, we introduce our benchmark methodology including the research questions, data used, performance metrics, and statistical evaluation in Section~\ref{sec:methodology}. Afterwards, we present our results in Section~\ref{sec:results}, followed the discussion in Section~\ref{sec:discussion} and the threats to validity in Section~\ref{sec:threats}. Finally, we conclude the paper in Section~\ref{sec:conclusion}. \section{Benchmark Methodology} \label{sec:methodology} We now describe the methodology of our benchmark, including our research questions, the data we used, the baselines and classifiers, the performance metrics, and the statistical analysis. \subsection{Research Questions} We address the following six research questions within this study. \begin{itemize} \item[RQ1:] Does it matter if we use defect counts or binary labels for cost metrics? \item[RQ2:] Which approach performs best if quality assurance is applied according to the prediction? \item[RQ3:] Which approach performs best if additional quality assurance can only be applied to a small portion of the code? \item[RQ4:] Which approach performs best independent of the prediction threshold? \item[RQ5:] Which approach performs best overall in terms of costs? \item[RQ6:] Is the overall ranking based on cost metrics different from the overall ranking based on the \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}? \end{itemize} With RQ1, we address the question if binary labels as defective/non-defective are sufficient, or if defect counts are required to compare costs. Binary labels carry less information and should lead to less accurate results. For example, you save more costs if you prevent two defects, instead of one. The question is, does this really matter, i.e., do the values of performance metrics change significantly? This question is especially interesting, as not all publicly available defect prediction data sets provide defect counts. In case the impact of defect counts is large, we may only use data sets that provide this information for our benchmark. With research questions RQ2-RQ4 we consider different quality assurance scenarios. RQ2 explores the costs savings, if someone trusts the defect prediction model completely, i.e., applies quality assurance measures exactly according to the prediction of the model. RQ3 considers the case where the defect prediction model is used to identify a small portion of the code for additional quality assurance, i.e., a setting with a limited quality assurance budget. RQ2 and RQ3 have specific prediction thresholds, i.e., a certain amount of the predicted defects are considered. With RQ4, we provide a threshold independent view on costs, which is valuable for selecting an approach if the amount of effort to be invested is unclear beforehand. To provide a general purpose ranking, we throw all the considerations from RQ2-RQ4 together for RQ5 and evaluate which approach performs best if all criteria are considered. Thus, RQ5 provides an evaluation that accounts for different application and cost scenarios. With RQ6 we address the question if the usually used machine learning metrics are sufficient to estimate a cost-sensitive ranking, i.e., if they produce a similar or a different ranking from directly using cost metrics. \subsection{Data} \label{sec:data} \begin{table} \caption{Summary of used data sets.} \label{tbl:datasets} \vspace{-8pt} \begin{tabular}{lllll} \hline \textbf{Name} & \textbf{\#Products} & \textbf{\#Instances} & \textbf{\#Defective} \\ \hline JURECZKO & 62 & 17681 & 6062 \\ AEEEM & 5 & 5371 & 893 \\ \hline \end{tabular} \vspace{-12pt} \end{table} We use data from two different defect prediction data sets from the literature for our benchmark listed in Table~\ref{tbl:datasets}. These data sets are a subset of the data sets that Herbold~\textit{et al.}~\cite{Herbold2017b} used in their benchmark. The other three data sets that Herbold~\textit{et al.}~ used could not be used for different reasons. The MDP and RELINK data were infeasible due to our results regarding RQ1 (see Section~\ref{sec:results}). The NETGENE data does not contain the size of artifacts, which is required for cost-sensitive evaluations.\footnote{Accoding to the paper by Herzig~\textit{et al.}~\cite{Herzig2013}, complexity and size should be included in the data. There are archives called complexity\_diff.tar.gz available for each product in the data. However, the archives seem to contain the differences for complexity and size metrics for each transaction identified by a revision hash. We did not find absolute values for the size, which would be required for cost metrics.} We can only give a brief summary of both data sets due to space restrictions. Full lists of the software metrics, products contained, etc. can be found in the literature at the cited references for each data set or summarized in the benchmark by Herbold~\textit{et al.}~\cite{Herbold2017b}. The first data set was donated by Jureczko and Madeyski~\cite{Jureczko2010}\footnote{The data is publicly available online: \url{http://openscience.us/repo/defect/ck/} (last checked: 2017-08-25).} and consists of 48 product releases of 15 open source projects, 27 product releases of six proprietary projects and 17 academic products that were implemented by students. For each of these releases, 20 static product metrics for Java classes, as well as the number of defects are part of the data. Taking pattern from Herbold~\textit{et al.}~\cite{Herbold2017}, we use 62 of the products. We do not use the 27 proprietary products to avoid threats to the validity of our results due to mixing proprietary and open source software. Moreover, three of the academic products contain less than five defective instances, which is too few for reasonable analysis with machine learning. In the following, we will refer to this data set as JUREZCKO. The second data set was published by D'Ambros~\textit{et al.}~\cite{DAmbros2010}\footnote{The data is publicly available online: \url{http://bug.inf.usi.ch/} (last checked: 2017-08-25)} and consists of five software releases from different projects. For each of these releases, 71 software metrics for Java classes are available, that include static product metrics and process metrics, like weighted churn and linearly decayed entropy, as well as the number of defects. In the following, we refer to this data set as AEEEM, taking pattern from Nam~\textit{et al.}~\cite{Nam2013}. \subsection{Baselines and Classifiers} Because we adopt Herbold~\textit{et al.}'s~\cite{Herbold2017b} benchmark methodology for using cost metrics, our choices for baselines and classifiers are nearly identical. We adopt three performance baselines from Herbold~\textit{et al.}~\cite{Herbold2017b} that define na\"{i}ve approaches for classification models: ALL that takes all available training data as is, RANDOM which randomly classifies instances as defective with a probability of 0.5, and FIX which classifies all instances as defective. We do not adopt the baseline CV for 10x10 cross-validation, because cross-validation is not implementable in practice and is known to overestimate the performance of \ac{WPDP}~\cite{Tan2015}. This may skew rankings, as approaches may be outperformed by something that overestimates performance. Moreover, cross-validation is an estimator for \ac{WPDP} performance and, therefore, out of scope of our benchmark for \ac{CPDP} models. We use a C4.5 decision tree (DT)~\cite{Quinlan1993}, logistic regression (LR)~\cite{Cox1958}, na\"{i}ve bayes (NB)~\cite{Russell2003}, random forest (RF)~\cite{Breiman2001}, RBF network~(NET)~\cite{Caruana2006,Broomhead1988}, and a support vector machine with radial basis function kernel (SVM)~\cite{Gestel2004} for all approaches that did not propose a classifier, but rather a treatment of the training data or something similar. These are the sixteen approaches Koshgoftaar08, Watanabe08, Turhan09, Zimmermann09, CamargoCruz09, Ma12, Peters12, Peters13, Herbold13, ZHe13, PHe15, Peters15, Kawata15, Amasaki15, Ryu15, and Nam15, as well as the baseline ALL. For Menzies11, we use the WHICH classifier, which was used in the original publication together with the six classifiers from above (DR, LR, NB, RF, NET, and SVM), i.e., a total of seven classifiers. For Tantithamthavorn16 we apply the proposed hyper parameter optimization to NB, RF, and SVM with the same parameters as suggested by Tantithamthavorn~\textit{et al.}~\cite{Tantithamthavorn2016}. For DT, NET, and LR no hyper parameters to optimize are contained in the caret R package~\cite{Kuhn2016} suggested by Tantithamthavorn~\textit{et al.} Additionally, we train a C5.0 decision tree~\cite{Kuhn2015} with hyper parameter optimization, because it performs best in the evaluation by Tantithamthavorn~\textit{et al.}. We refer to these as optimized classifiers as NBCARET, RFCARET, SVMCARET and C50CARET. The remaining eight of the approaches directly propose a classification scheme, which we use: \begin{itemize} \item genetic program (GP) for Liu10; \item logistic ensemble (LE) for Uchigaki12; \item MODEP for Canfora13; \item CODEP with Logistic Regression (CODEP-LR) and CODEP with a Bayesian Network (CODEP-BN) for Panichella14; \item the value-cognitive boosted SVM (VCBSVM) for Ryu14; \item average voting (AVGVOTE), maximum voting (MAXVOTE), bagging with a C4.5 Decision Tree (BAG-DT), bagging with Na\"{i}ve Bayes (BAG-NB), boosting with a C4.5 Decision Tree (BOOST-DT), boosting with Na\"{i}ve Bayes (BOOST-NB) for YZhang15; \item spectral clustering (SC) for FZhang16; and \item search-based selection (SBS) for Hosseini16. \end{itemize} The MODEP classifier by Canfora13 requires either a constraint with a desired \textit{recall}, or a desired cost objective. Herbold~\textit{et al.}~\cite{Herbold2017b} decided to use a \textit{recall}~ of 0.7 as the constraint. In our benchmark, we sample different values for \textit{recall}~ and use the values 0.1 to 1.0 in steps of 0.1. We denote the different \textit{recall}~ constraints after the classifier name using the percentage, e.g., MODEP10 for the constraint \textit{recall}=0.1. To deal with randomization, we repeat all approaches that contain random components 10 times and then use the mean value of these repetitions for comparison with the other approaches. Following Herbold~\textit{et al.}~\cite{Herbold2017b}, these are Liu10, Canfora10, Menzies11, Peters12, Peters13, ZHe13, Peters15, as well as the baseline RANDOM. Moreover, two of the three approaches that we added to the benchmark contain random components, i.e., Hosseini16 because of the random test data splits and the genetic program and Tantithamthavorn16 because of the cross-validation for the hyper parameter optimization. \subsection{Performance Metrics} To properly evaluate our research questions, we require metrics that measure the cost for different settings. In order to not re-invent the wheel, we scanned the literature and found fitting metrics for all our research questions. For RQ2, we need a metric that can be used to evaluate the costs if one follows the classification achieved with a defect prediction model, i.e., to apply quality assurance ot everything that is predicted as defective and nothing else. We use the metric $NECM_{C_{ratio}}$, which is defined as \begin{equation} NECM_{C_{ratio}} = \frac{fp + C_{ratio}\cdot fn}{tp+fp+tn+fn} \end{equation} This metric was, e.g., used by Liu~\textit{et al.}~\cite{Liu2010} and Khoshgoftaar~\textit{et al.}~\cite{Khoshgoftaar2008} and measures the costs resulting from overhead in quality assurance effort through false positive predictions versus the costs due to missed defects through false negative predictions. $C_{ratio}$ is used to define the difference in cost for false positive and false negative predictions. Khoshgoftaar~\textit{et al.}~ and Liu~\textit{et al.}~ both use 15, 20, and 25 as values for $C_{ratio}$. The cost of missing defects may be 15-50 times higher than that of additional quality assurance measures according to the literature~\cite{Khoshgoftaar2004}. For our benchmark, we use $C_{ratio}=15$, i.e., the most conservative cost scenario, where reviews are relatively expensive in comparison to the saved costs of finding a defect through the prediction model. To evaluate RQ3, i.e, the costs when only a small part of the code shall be reviewed, we use the metric $RelB_{20\%}$, defined as the percentage of defects found when inspecting 20\% of the code. Thus, the defect prediction model is used to rank all code entities. Then, the entities are considered starting with the highest ranked entity until 20\% of the code are covered. This metric is an adoption of the metric $\textit{NofB}_{20\%}$ used by Y. Zhang~\textit{et al.}~\cite{Zhang2015a}. The only difference is that Y. Zhang~\textit{et al.}~ consider absolute numbers, whereas we consider the percentage. This difference is required due to the diversity in the size of software products. If we do not remove the strong impact of the project size from the values for this metric and use absolutes instead of ratios, our statistical analysis would be strongly influenced by the size of the products and not measure the actual defect detection capability. The metrics $NECM_{15}$~ and $RelB_{20\%}$~ evaluate the \ac{CPDP} models in such a way that a fixed amount of code is considered for additional quality assurance. For $NECM_{15}$, we follow the classification, i.e., we consider the scenario that is most likely according to the predictions of the \ac{CPDP} model. For $RelB_{20\%}$, we stop at 20\% of the code, regardless of the scores of the classification model. This is related to the notion of thresholds for classification in the machine learning world: a learned prediction model has a scoring function as output and everything above a certain threshold is then classified as defective. While there are good reasons to use the stratgies the thresholds are picked by $NECM_{15}$~ and $RelB_{20\%}$~, these thresholds are still magic numbers. To evaluate RQ4, we use the threshold independent metric \textit{AUCEC}, which is defined as the area under the curve of review effort versus number of defects found~\cite{Rahman2012}. This is a threshold independent metric that analyzes the performance of a defect likelihood ranking produced by a classifier for all possible thresholds. Thus, the value of \textit{AUCEC}~ is not a measure for a single prediction model with a fixed threshold like $NECM_{15}$~ and $RelB_{20\%}$~, but instead for a family of prediction models with all possible threshold values. Regarding costs, this means that \textit{AUCEC}~ evaluates the costs for all possible amounts of code that to which additional quality assurance is applied, starting from applying no quality assurance at all and stopping with applying quality assurance to the complete product. To evaluate RQ1 and RQ5, we use the metrics $NECM_{15}$, $RelB_{20\%}$, and \textit{AUCEC}~ together. For RQ6, we compare the findings of RQ5 to the results if we use the benchmark criteria from Herbold~\textit{et al.}~\cite{Herbold2017}. Thus we determine how different the ranking from RQ5 is from a ranking using the metrics \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}. The definition and reasons for selecting these metrics can be found in the benchmark by Herbold~\textit{et al.}~\cite{Herbold2017}. We use actual defect counts for the number of true positives and false negatives to compute the above metrics. Thus, if we have an instance with two defects, it carries twice the weight for the above performance metrics. The only exception to this is RQ1, where we compare using binary labels to using defect counts. With binary labels, we do not care about the number of defects in a class and just label it as defective or non-defective, meaning that classes with five defects have the same weight as classes with a one defect. In case of ties, i.e., two instances with the same score according to a prediction model, we use the size of the instance as tie breaker and say that the smaller instances get additional quality assurance first. This tie-breaking strategy was proposed by Rahman~\textit{et al.}~\cite{Rahman2012}. \subsection{Statistical Analysis} We use a threshold of $\alpha=0.995$ for all statistical tests instead of the usually used $\alpha=0.95$. Hence, we require that $\textit{p-value} < 0.005$ instead of the usual $\textit{p-value} < 0.05$ to reject a null hypothesis. We decided to follow the recent suggestion made by a broad array of researchers from different domains to raise the threshold for significance~\cite{Benjamin2017}. The reason for this higher threshold is to reduce the likelihood that approaches are false positively detected as significantly different, even though they are not. For RQ1, we compare the mean performance of each approach achieved using binary labels for calculating metric values with numerical values for calculating the metrics. We say that there is a difference if the mean value is statistically significantly different and the effect size is non-negligible. For the testing of statistical significance, we use the non-parametric Mann-Whitney-U test~\cite{Mann1947}. In case the difference is statistically significant, we measure the effect size using Cohen's $d$~\cite{Cohen1988}. According to Cohen, the effect size is negligible for $d < 0.2$, small for $0.2 \leq d < 0.5$, medium for $0.5 \leq d < 0.8$, and large for $d \geq 0.8$. We used Levene's test~\cite{Brown1974} to test if the homoscedasticity assumption of Cohen's $d$ is fulfilled. In case we find that binary labels lead to statistically significantly different results with a non-neglible effect size, data sets with binary labels instead of defect counts should not be used for cost-sensitive evaluations. For the research questions RQ2-RQ6, we require a ranking of multiple approaches and, thus, a more complex statistical testing procedure. Our first step was to determine if we can use ANOVA~\cite{Friedman1940} in combination with a Scott-Knott test~\cite{Scott1974}, which is a popular choice in recent defect prediction literature that compares multiple approaches to each other, e.g., \cite{Ghotra2015, Herbold2016, Tantithamthavorn2016, Tantithamthavorn2017}. The advantage of ANOVA and Scott-Knott is a clear and non-overlapping ranking of results. However, ANOVA has the heavy assumptions that all populations follow a normal distribution and are homoscedastic. We used the Shapiro-Wilk test~\cite{Shapiro1965} to test if the performance values are normally distributed and used Levene's test~\cite{Brown1974} to test for homoscedasticity. Unfortunately, both conditions are frequently broken by the data. Therefore, we decided to use the less powerful but non-parametric Friedmann test~\cite{Friedman1940} with the post-hoc Nemenyi test~\cite{Nemenyi1963} instead. The Nemenyi test compares the distances between the mean ranks of multiple pair-wise comparisons between all approaches on all products of a data set. The main drawback of this test is that the ranks between approaches may be overlapping. To deal with this issue, we follow the strategy suggested by Herbold~\textit{et al.}~\cite{Herbold2017d} to create non-overlapping groups of statistically significantly different results. Herbold~\textit{et al.}~suggest to start with the best ranked approach and always create a new group, if the difference in ranking between two subsequently ranked approaches is greater then the critical distance. At the cost of discriminatory power of the test, this ensures that the resulting groups are non-overlapping and statistically significantly different. Moreover, we took pattern from Tantithamthavorn~\textit{et al.}'s modification of the Scott-Knott test~\cite{Tantithamthavorn2017} and adopted the proposed effect size correction. This means that we use Cohen's $d$ to measure the effect size between two subsequently ranked groups and merge them if the effect size is negligible, i.e., $d < 0.2$. The final step of the statistical analysis is the generation of the \textit{rankscore}~ from the ranking. The \textit{rankscore}~ was introduced by Herbold~\textit{et al.}~\cite{Herbold2017b} to deal with the problem of different group sizes that occur when ranks of groups of approaches are created. Not every group will have the same number of approaches. This means that the number of the group-ranking becomes a bad estimator for the performance of the group. Basically, it is a difference if you are in the second-ranked group and there is one approach in the first-ranked group or there are ten approaches in the first-ranked group. The \textit{rankscore}~ takes care of this problem by transforming the ranks into a normalized representation based on the percentage of approaches that are on higher ranks, i.e., \begin{equation*} \textit{rankscore} = 1-\frac{\#\{\text{approaches ranked higher}\}}{\#\{\text{approaches}\}-1}. \end{equation*} For example, a $\textit{rankscore}=1$ is perfect meaning that no approach is ranked higher, a $\textit{rankscore}=0.7$ would mean that 30\% of approaches are ranked higher. We apply this statistical evaluation procedure to each combination of data set and performance measure. For research questions RQ2-RQ4, we then evaluate the mean \textit{rankscore}~ on both data sets for the metrics $NECM_{15}$, $RelB_{20\%}$, and \textit{AUCEC}, respectively. For RQ5, we evaluate the mean \textit{rankscore}~ on both data sets and for all three cost metrics. For RQ6, we evaluate the mean \textit{rankscore}~ on both data sets for the machine learning metrics \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}. To evaluate the relationship between the rankings produced with cost metrics and machine learning metrics for RQ6, we evaluate the correlation between both using Kendall's $\tau$~\cite{Kendall1948}. Kendall's $\tau$ is a non-parametric correlation measure between ranks of results, i.e., the ordering of results produced, which is exactly what we are interested in. \section{Related Work} \label{sec:relatedwork} \begin{table*} \caption{Related work on \ac{CPDP} included in the benchmark. Acronyms are defined following the authors and reference in the first column.} \label{tbl:relwork} \vspace{-8pt} \begin{center} \begin{tabular}{ p{0.16\linewidth} p{0.8\linewidth} } \hline \textbf{Acronym} & \textbf{Short Description} \\ \hline Khoshgoftaar08 & Khoshgoftaar~\textit{et al.}~\cite{Khoshgoftaar2008} proposed majority voting of multiple classifiers trained for each product in the training data.\\ Watanabe08 & Watanabe~\textit{et al.}~\cite{Watanabe2008} proposed standardization based on mean values of the target product. \\ Turhan09 & Turhan~\textit{et al.}~\cite{Turhan2009} proposed a log-transformation and nearest neighbor relevancy filtering. \\ Zimmermann09 & Zimmermann~\textit{et al.}~\cite{Zimmermann2009} proposed a decision tree to select suitable training data.\\ CamargoCruz09 & Camargo Cruz and Ochimizu~\cite{CamargoCruz2009} proposed a log-transformation and standardization based on the median of the target product.\\ Liu10 & Liu~\textit{et al.}~\cite{Liu2010} proposed an S-expression tree created by genetic program. \\ Menzies11 & Menzies~\textit{et al.}~\cite{Menzies2011,Menzies2013} proposed local models for different regions of the training data through clustering.\\ Ma12 & Ma~\textit{et al.}~\cite{Ma2012} proposed data weighting using the concept of gravitation. \\ Peters12 & Peters and Menzies~\cite{Peters2012} proposed an approach for data privacy using a randomized transformation called MORPH. \\ Uchigaki12 & Uchigaki~\textit{et al.}~\cite{Uchigaki2012} proposed an ensemble of univariate logistic regression models build for each attribute separately. \\ Canfora13 & Canfora~\textit{et al.}~\cite{Canfora2013,Canfora2015} proposed a multi-objective genetic program to build a logistic regression model that optimizes costs and the number of defects detected. \\ Peters13 & Peters~\textit{et al.}~\cite{Peters2013a} proposed relevancy filtering using conditional probabilities combined with MORPH data privatization. \\ Herbold13 & Herbold~\cite{Herbold2013} proposed relevancy filtering using distributional characteristics of products. \\ ZHe13 & Z. He~\textit{et al.}~\cite{He2013} proposed attribute selection and relevancy filtering using separability between training and target products. \\ Panichella14 & Panichella~\textit{et al.}~\cite{Panichella2014} proposed the CODEP meta classifier over the results of multiple classification models. \\ Ryu14 & Ryu~\textit{et al.}~\cite{Ryu2014} proposed similarity based resampling and boosting. \\ PHe15 & P. He~\textit{et al.}~\cite{He2015} proposed feature selection based on how often the metrics are used for classification models build using the training data. \\ Peters15 & Peters~\textit{et al.}~\cite{Peters2015} proposed LACE2 as an extension with further privacy of CLIFF and MORPH. \\ Kawata15 & Kawata~\textit{et al.}~\cite{Kawata2015} proposed relevancy filtering using DBSCAN clustering. \\ YZhang15 & Y. Zhang~\textit{et al.}~\cite{Zhang2015a} proposed the ensemble classifiers average voting, maximum voting, boosting and bagging. \\ Amasaki15 & Amasaki~\textit{et al.}~\cite{Amasaki2015} proposed feature selection and relevancy filtering based on minimal metric distances between training and target data. \\ Ryu15 & Ryu~\textit{et al.}~\cite{Ryu2015b} proposed relevancy filtering based on string distances and LASER classification. \\ Nam15 & Nam and Kim~\cite{Nam2015b} proposed unsupervised defect prediction based on the median of attributes. \\ Tantithamthavorn16 & Tantithamthavorn~\textit{et al.}, 2016~\cite{Tantithamthavorn2016} proposed to use hyper parameter optimization for classifiers. \\ FZhang16 & F. Zhang~\textit{et al.}~\cite{Zhang2016} proposed unsupervised defect prediction based on spectral clustering. \\ Hosseini16 & Hosseini~\textit{et al.}~\cite{Hosseini2016,Hosseini2017} proposed a genetic program and nearest neighbor relevancy filtering to select training data. \\ \hline \end{tabular} \end{center} \vspace{-8pt} \end{table*} We split our discussion of the related work into two parts. First, we discuss the related work on defect prediction benchmarks. Second, we discuss the related work on \ac{CPDP}. \subsection{Defect prediction benchmarks} Our benchmark on cost aspects is influenced by four defect prediction benchmarks from the literature. Lessmann~\textit{et al.}~\cite{Lessmann2008} and Ghotra~\textit{et al.}~\cite{Ghotra2015} evaluated the impact of different classifiers on \ac{WPDP}. D'Ambros~\textit{et al.}~\cite{DAmbros2012} compared different kinds of metrics and classification models for \ac{WPDP}. Herbold~\textit{et al.}~\cite{Herbold2017b} compared \ac{CPDP} approaches on multiple data sets using multiple performance metrics. The benchmarks by Lessmann~\textit{et al.}, D'Ambros~\textit{et al.}, and Herbold~\textit{et al.}~ followed Dem\v{s}ar's guidelines~\cite{Demsar2006} and make use of the Friedman test~\cite{Friedman1940} with the post-hoc Nemenyi test~\cite{Nemenyi1963}. Herbold~\textit{et al.}~ extended this concept using \textit{rankscores}, that allow the combination of results from multiple data sets and performance metrics into a single ranking. Ghotra~\textit{et al.}~ use a different statistical procedure based on ANOVA~\cite{Friedman1940} and the Scott-Knott test~\cite{Scott1974}. Our benchmark design is similar to the design used by Herbold~\textit{et al.}~\cite{Herbold2017b}. However, there are two major differences: 1) we focus on different research questions, i.e., the performance using cost-metrics, whereas Herbold~\textit{et al.}~ focused on machine learning metrics that do not take costs into account; and 2) we extended the statistical evaluation with a recently proposed effect size correction taking pattern from ScottKnottESD proposed by Tantithamthavorn~\textit{et al.}~\cite{Tantithamthavorn2017}. \subsection{Cross-project defect prediction} The scope of our benchmark are approaches that predict software defects in a target product using metric data collected from other projects. However, our benchmark does not cover the complete body of \ac{CPDP} research. Specifically, we do not address the following. \begin{itemize} \item Mixed-project defect prediction, i.e., approaches that require labelled training data from the target product, e.g., \cite{Turhan2011, Turhan2013, Chen2015, Ryu2015a, Xia2016}. \item Heterogenuous defect prediction, i.e., approaches that work with different metric sets for the training and target products, e.g., \cite{Nam2017, Jing2015}. \item Just-in-time defect prediction, i.e., defect prediction for specific commits, e.g., \cite{Fukushima2014, Kamei2015}. \item Approaches that require project context factors, e.g., \cite{Zhang2015}. \end{itemize} Additionally, we excluded two works that use transfer component analysis~\cite{Pan2011} by Nam~\textit{et al.}~\cite{Nam2013} and by Jing~\textit{et al.}~\cite{Jing2017}. Transfer component analysis has major scalability issues due to a very large eigenvalue problem that needs to be solved. Herbold~\textit{et al.}~\cite{Herbold2017} already determined that they could only compute results in less than one day for the smaller data sets for the approach by Nam~\textit{et al.}~\cite{Nam2013}. We tried to resolve this problem by using a scientific compute cluster, where we had access to nodes with up to 64 cores and 256 GB of memory. We were still not able to compute results for a large data set with 17681 instances\footnote{JURECZKO as defined in Section~\ref{sec:data}} before hitting the execution time limit for computational jobs of 48 hours. This leaves us with 26 approaches that were published through 29 publications listed in Table~\ref{tbl:relwork}. For each of these approaches, we define an acronym, which we will use hereafter to refer to the approach and a short description of the approach. The list in Table~\ref{tbl:relwork} is mostly consistent with the benchmark from Herbold~\textit{et al.}~\cite{Herbold2017b} on \ac{CPDP}. Additionally, we extended the work by Herbold~\textit{et al.}~ with three further replications of approaches that were published in 2016, i.e., Tantithamthavorn16, FZhang16, and Hosseini16. \section{Results} \label{sec:results} We now present the results of our benchmark. A replication kit that provides the complete source code and data required for the replication of our results, a tutorial on how to use the replication kit, as well as additional visualizations including plots for that list all classifiers and not only the best classifiers, and critical distance diagrams for the Nemenyi tests are available online.\footnote{Reference to the replication kit removed due to double blind review. Will be uploaded to Zenodo in case of acceptance and evaluated through the artifact evaluation. We provide the visualiations and the statistical analysis code as supplemental material to this submission.} \input{results_numericimpact} \begin{figure*} \caption{Mean \textit{rankscore}~ over all data sets. The black diamonds depict the mean \textit{rankscore}, the gray points in the background are the \textit{rankscores}~ over which the mean is taken. We list only the result achieved with the best classifier for each approach.} \label{fig:rq2torq5} \centering \subfigure[Results with $NECM_{15}$]{ \includegraphics[width=\columnwidth]{BEST3_RQ2} \label{fig:rq2} } \subfigure[Results with $RelB_{20\%}$]{ \includegraphics[width=\columnwidth]{BEST3_RQ3} \label{fig:rq3} } \subfigure[Results with \textit{AUCEC}]{ \includegraphics[width=\columnwidth]{BEST3_RQ4} \label{fig:rq4} } \subfigure[Results with $NECM_{15}$, $RelB_{20\%}$, and \textit{AUCEC}]{ \includegraphics[width=\columnwidth]{BEST3_RQ5} \label{fig:rq5} } \vspace{-12pt} \end{figure*} \begin{figure} \caption{Mean \textit{rankscore}~ over all data sets for the metrics \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}. The black diamonds depict the mean \textit{rankscore}, the gray points in the background the \textit{rankscores}~ over which the mean is taken. We list only the results for the classifiers that are listed in Figure~\ref{fig:rq2torq5}(d), i.e., those performing best according to the metrics $NECM_{15}$, $RelB_{20\%}$, and \textit{AUCEC}.} \includegraphics[width=\columnwidth]{SPECIFIC3_RQ6} \label{fig:rq6} \vspace{-18pt} \end{figure} \subsection*{RQ1: Does it matter if we use defect counts or binary labels for cost metrics?} Table~\ref{tbl:numericimpact} shows the mean values for all cost metrics on the two data sets where defect counts are available. We also report the \textit{p-values} determined by the Mann-Whitney-U test, and in case of significance, i.e., if $\textit{p-value}<0.005$, we also report the value for Cohen's $d$ in parenthesis. We observe statistically significant differences for $NECM_{15}$~ on the JURECZKO data. Levene's test showed that the results are homoscedastic. The effect size is $d=0.52$, i.e., medium. \begin{framed} \noindent\textbf{Answer RQ1:} For the metric $NECM_{15}$, defect counts yield significantly different results with a medium effect size in comparison to using binary labels. Therefore, only data with defect counts should be used for evaluations using $NECM_{15}$. Consequently, we conclude that only data with defect counts should be used for benchmarking with cost metrics and may not use the MDP data and RELINK data used by Herbold~\textit{et al.}~\cite{Herbold2017b} for our benchmark. \end{framed} \subsection*{RQ2: Which approach performs best if quality assurance is applied according to the prediction?} \input{resultsTableRQ2} Figure~\ref{fig:rq2torq5}(a) shows the best approaches ranked using $NECM_{15}$~ by their mean \textit{rankscore}~ over both data sets. The mean value of $NECM_{15}$\linebreak and the \textit{rankscore}~ for each of these best approaches are listed in Table~\ref{tbl:results-necm}. The best ranking approach is Liu10-GP with a perfect mean \textit{rankscore}~ of 1, i.e, for both data sets no approach is significantly better. The trivial baseline FIX, i.e., predicting all code as defective, is a close second with a mean \textit{rankscore}~ of 0.981. Thus, only one approach beats the trivial baseline FIX for this performance metric. Another approach, Canfora-MODEP100 is very close to FIX with a \textit{rankscore}~ of 0.962. If we look at the actual values of $NECM_{15}$~ and not the \textit{rankscore}, FIX actually has better mean values than Liu10-GP for all three data sets, even though the ranking is worse on the AEEEM data.\footnote{There are multiple such anomylies in our results. We checked them and they are all due to the effect we describe below and not due to problems with the statistical analyis.} This anomaly is possible due to the nature of the Nemenyi test. The Nemenyi test is based on the ranking in pairwise comparisons of all approaches, not on the mean value. Table~\ref{tbl:nemenyi} shows $NECM_{15}$~ value and ranking of both Liu10-GP and FIX on each product in the AEEEM data. The equinox and the lucene products are most interesting. On equinox, FIX has an advantage of 0.4 over Liu10-GP with respect to the metric $NECM_{15}$. However, the difference in ranks to Liu10-GP is only three. On lucene, Liu10-GP has a only an advantage of 0.12 over FIX with respect to the metric $NECM_{15}$, but the difference in ranks to FIX is 27. Thus, while this anomaly seems counter intuitive, from a ranking perspective and also for the statistical test, it is correct. Such effects are the reason why checking for assumptions and choosing appropriate statistical tests is important, as these effects are due to the heteroscedacity of the data. This also shows that pure comparisons of characteristics like mean or median values are not sufficient for the ranking of multiple approaches. \begin{table} \caption{Detailed results for $NECM_{15}$ on the AEEEM data for Liu10-GP and FIX.} \label{tbl:nemenyi} \vspace{-8pt} \begin{tabular}{rllll} \hline & \multicolumn{2}{c}{\textbf{Liu10-GP}} & \multicolumn{2}{c}{\textbf{FIX}} \\ \textbf{Product} & $NECM_{15}$ & \textbf{Rank} & $NECM_{15}$ & \textbf{Rank} \\ \hline eclipse & 0.70 & 11 & 0.68 & 9\\ equinox & 0.84 & 5 & 0.44 & 2 \\ lucene & 0.75 & 21 & 0.87 & 38 \\ mylyn & 1.03 & 6 & 0.83 & 2 \\ pde & 0.78 & 1 & 0.79 & 5\\ \hline \hline \textit{mean} & 0.82 & 8.8 & 0.72 & 11.2 \\ \hline \end{tabular} \end{table} \begin{framed} \noindent\textbf{Answer RQ2:} Liu10-GP yields the best cost performance assuming missed defects are 15 times more expensive than additional quality assurance costs through false positive predictions. The other 25 approaches perform worse in terms of expected costs than trivially assuming that all code is defective, although at least Canfora13-MODEP is very close to this trivial baseline. \end{framed} \subsection*{RQ3: Which approach performs best if additional quality assurance can only be applied to a small portion of the code?} \input{resultsTableRQ3} Figure~\ref{fig:rq2torq5}(b) shows the best approaches ranked using $RelB_{20\%}$~ by their mean \textit{rankscore}~ over both data sets. The mean value of $RelB_{20\%}$~ and the \textit{rankscore}~ for each of these best approaches are listed in Table~\ref{tbl:results-relb}. There are actually ten approaches with a perfect \textit{rankscore}~ of 1, i.e., Zimmermann09-SVM, Watanabe09-SVM, Turhan09-SVM, Ryu15-SVM, PHe15-SVM, Peters15-SVM, Ma12-SVM, CamargoCruz09-SVM, Amasaki15-SVM, and the trivial baseline FIX. Notably, all of the CPDP approaches use the SVM as classifier. Herbold~\textit{et al.}~\cite{Herbold2017b} found in their benchmark, that unless the bias towards non-defective instances is treatet, SVMs often yield trivial or nearly trivial classifiers. We checked the raw results and found that this applies here, too. All of these SVMs are either trivial classifiers predicting only one class, or nearly trivial. Thus, they are nearly the same as the trivial baseline FIX. Since we use the size of entities as tie-breaker, this means that ranking code by size starting with the smallest instances until 20\% of code is covered, is more effecient than actual \ac{CPDP}. When we investigate at the actual values of $RelB_{20\%}$, we can conclude that we find on average 32\%--35\% percent of the defects that way, depending on the data set and which of the top ranked approaches is used. \begin{framed} \noindent\textbf{Answer RQ3:} Trivial or nearly trivial predictions perform best if only a small portion of the code undergoes additional quality assurance. \end{framed} \subsection*{RQ4: Which approach performs best independent of the prediction threshold?} \input{resultsTableRQ4} Figure~\ref{fig:rq2torq5}(c) shows the best approaches ranked using \textit{AUCEC}~ by their mean \textit{rankscore}~ over both data sets. The mean value of \textit{AUCEC}~ and the \textit{rankscore}~ for each of these best approaches are listed in Table~\ref{tbl:results-aucec}. The results are very similar to the results from RQ3, i.e., we have a large group of approaches with a perfect \textit{rankscore}~ of 1, all of which use SVM as classifiers including the baseline FIX. Thus, starting with small code entities is again the best strategy. \begin{framed} \noindent\textbf{Answer RQ4:} Trivial or nearly trivial predictions perform best without a fix prediction threshold. \end{framed} \subsection*{RQ5: Which approach performs best overall?} Figure~\ref{fig:rq2torq5}(d) shows the best approches ranked using the three metrics $NECM_{15}$, $RelB_{20\%}$, and \textit{AUCEC}~ over both data sets. Given the results for RQ2-RQ4, it is not suprising that the best ranking approach is the trivial baseline FIX with a nearly perfect mean \textit{rankscore}~ of 0.994. The best \ac{CPDP} approaches are Canfora13-MODEP100 with a mean \textit{rankscore}~ of 0.969 and Liu10-GP with a mean \textit{rankscore}~ of 0.888. \begin{framed} \noindent\textbf{Answer RQ5:} No \ac{CPDP} approach outperforms our trivial baseline on average over three performance metrics. The best performing \ac{CPDP} approaches are Canfora13-MODEP100 and Liu10-GP. \end{framed} \subsection*{RQ6: Is the overall ranking based on cost metrics different from the overall ranking based on the AUC, F-measure, G-Measure, and MCC?} Figure~\ref{fig:rq6} shows the \textit{rankscores}~ of the best ranked approaches from RQ5, but ranked with \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}~ instead, i.e., the metrics used by Herbold~\textit{et al.}~\cite{Herbold2017b, Herbold2017d} for ranking with machine learning metrics that do not consider costs. In case the rankings are correlated, we would expect that the \textit{rankscores}~ are roughly sorted in descending order from top to bottom. However, this is clearly not the case. The two top ranking approaches with cost metrics, i.e., FIX and Canfora13-MODEP have both very low \textit{rankscores}~ with the metrics used by Herbold~\textit{et al.}, the next ranking approaches are much better with at least mediocore \textit{rankscores}. Please note that the \textit{rankscore}~ values here are not the same as determined by Herbold~\textit{et al.}~\cite{Herbold2017b, Herbold2017d}, because we only use two of the five data sets for this comparison. We confirmed this visual observation using Kendall's $\tau$ as correlation measure We observe almost no correlation of $\tau=-0.047$ between both rankings. \begin{framed} \noindent\textbf{Answer RQ6:} The cost-sensitive ranking is completely different from the ranking base on \textit{AUC}, \textit{F-measure}, \textit{G-measure}, and \textit{MCC}. Thus, machine learning metrics are unsuited to predict the cost efficiency of approaches, and cost metrics are likewise unsuited to predict the performance measured with machine learning metrics. \end{framed} \section{Threats to validity} \label{sec:threats} Our benchmark has several threats to its validity. We distinguish between internal validity, construct validity, and external validity. \subsection{Internal Validity} Because we replicated only existing work, we do not see any internal threats to the validity of our results. \subsection{Construct Validity} The benchmark's construction influences the results. Threats to the validity of the construction include unsuitable choice of performance metrics for the research questions, unsuitable statistical tests, noisy or mislabeled data~\cite{Jureczko2010}, as well as defects in our implementations. To address these threats, we based our metrics and statistical tests on the literature, used multiple data sets to mitigate the impact of noise and mislabeling, and tested all implementations. Moreover, we performed a sanity check against the results from Herbold~\textit{et al.}~\cite{Herbold2017}, assuming that the construct of that benchmark is valid. \subsection{External Validity} The biggest threat to the external validity is the sample size of software products. Within this benchmark, we consider 67 products, which is large for defect prediction studies, but small in relation to the overall number of software projects. Therefore, we cannot firmly conclude that we found general effects and not random effects that only hold on our used data.
\section*{Introduction} Our social and spatial behaviour are shaped by both internal and external constraints. On one hand, external factors \cite{hagerstraand1970people} such as time, cognition, age or the need for food constrain our possibilities. On the other hand, we are driven by internal needs, purposes and preferences. Specifically, within personality psychology, it has been conjectured that personality traits play a key role in shaping our choices across various situations \cite{mischel1973toward,allport1937personality}. In the social realm, individuals cope with cognitive and temporal constraints by establishing and maintaining connections in a distinctive \cite{saramaki2014persistence,miritello2013limited} and persistent \cite{saramaki2014persistence} manner. For example, the size of an individual's social circle is bounded under $\sim 150$, the so-called Dunbar number \cite{dunbar1993coevolution}, but varies among individuals around this limit \cite{roberts2009exploring}. These differences result from an interplay between physical and extrinsic factors such as gender \cite{igarashi2005gender}, age \cite{wrzus2013social} and socio-economic status \cite{mcpherson2006social} as well as from stable individual dispositions underlying personality \cite{roberts2008individual}. Spatially, individuals are characterised by an \emph{activity space} of repeatedly visited locations within which they move during their daily activities \cite{perchoux2013conceptualization}, but this geo-spatial signature varies in size \cite{gonzalez2008understanding} and spatial shape \cite{pappalardo2015returners}. However, unlike the social case, the conjecture that individuals' spatial behaviour is persistent in time \cite{aitken1991person} had not been verified until recently. Here, we capitalise on the recent discovery that the size of the activity space is conserved and correlates with the social circle size \cite{alessandretti2016evidence} to test the conjecture that the same personality dispositions in part determine social and spatial behaviour. We test this theory by analysing two long-term datasets consisting of $\sim 1000$ individuals mobility trajectories and their phone interactions (for previous studies see section `\nameref{State of the art}' below). First, we test the hypothesis that the strategies individuals adopt in order to choose where to go and with whom to interact are similar. Then, we identify and characterise the prevailing socio-spatial profiles appearing in the datasets. Finally, we show that socio-spatial profiles can be partially explained by the widely adopted big-five personality trait model, often used to describe aspects of the social and emotional life \cite{lu2009size,casciaro1998seeing,roberts2008individual,roberts2009exploring,hojat1982loneliness,branje2004relations,amato1990personality,hamburger2000relationship}. In the section `\nameref{State of the art}', we review the relevant literature; in `\nameref{Methods}' we describe data collection and pre-processing, and we provide details of the methods implemented; in `\nameref{Results}' we present our findings. \section*{State of the art} \label{State of the art} Individual-level variability in social and spatial behaviour has mostly been investigated in isolation so far, with few notable efforts to reconcile the two. Here, we briefly review the empirical findings in the two domains. \subsection*{The social domain} Individuals deal with limited time and cognitive capacity resulting in finite social networks \cite{dunbar1993coevolution,gonccalves2011modeling} by distributing time unevenly across their social circle \cite{sutcliffe2012relationships,arnaboldi2012analysis, miritello2013time, saramaki2014persistence,zhou2005discrete,marlow2009maintained}. While this is a shared strategy, there is clear evidence for individual-level variation. First, social circles vary in terms of diversity: they differ in size \cite{roberts2009exploring} - within a maximum upper-bound of $\sim 150$ individuals \cite{dunbar1993coevolution} - and in structure \cite{saramaki2014persistence,centellegher2017personality}. Second, individuals display different attitudes towards exploration of social opportunities as they are more or less keen on creating new connections \cite{wehrli2008personality,kumar2010structure,newman2001clustering,mislove2008growth}. Finally, individuals manage social interactions over time in different ways. Some are characterised by high level of stability as they maintain a very stable social circle, while others renew their social ties at high pace \cite{miritello2013limited}. These heterogeneities can be partially explained by factors including gender \cite{dunbar1995social,igarashi2005gender}, age \cite{wrzus2013social, carrasco2008far,van2009size}, socio-economic status \cite{campbell1986social,mcpherson2006social} and physical attractiveness \cite{reis1980physical}. Moreover, as conjectured by personality psychologists \cite{jaccard1974predicting,mischel1973toward}, differences in personalities partially explain the variability in social circle composition \cite{roberts2008individual,roberts2009exploring, staiano2012friends,lu2009size,asendorpf2003personality,kalish2006psychological,pollet2011extraverts,de2013predicting}, and the different attitudes towards forming \cite{wehrli2008personality,selfhout2010emerging}, developing \cite{asendorpf2006predictive,branje2004relations} and replacing \cite{centellegher2017personality} social connections. It is worth noticing that many of these findings are recent, resulting from the analysis of digital communication traces. \subsection*{The spatial domain} Constraints including physical capabilities, the distribution of resources, and the need to coordinate with others limit our possibilities to move in space \cite{hagerstraand1970people}. Individuals cope with these limitations by allocating their time within an activity space of repeatedly visited locations \cite{golledge1997spatial}, whose size is conserved over several years according to a recent study based on high-resolution trajectories \cite{alessandretti2016evidence}, and previous ones based on unevenly sampled and low spatial resolution data \cite{jarv2014understanding,schonfelder2010urban}. The activity space varies across individuals in terms of size \cite{alessandretti2016evidence} and shape \cite{pappalardo2015returners}: it was shown that two distinct classes of individuals, \emph{returners} and \emph{explorers}, can be identified based on their propensity to visit new locations, similarly to the social domain \cite{miritello2013limited}. Heterogeneities in spatial behaviour can be explained in terms of gender \cite{kwan2000gender}, age \cite{vazquez2013using,kang2010analyzing}, socio-economic \cite{zenk2011activity, carrasco2008far} and ethnic \cite{kwan2004geovisualization} differences. There has only been sporadic efforts to include personality measures in geographic research, despite the strong connections between the two \cite{van2010transport}. Recent works \cite{chorley2015personality, de2013predicting} suggest that spatial behaviour can be partially explained from personality traits. However, in \cite{chorley2015personality}, this understanding is based on biased data collected from location-based social networks. In \cite{de2013predicting}, the connection between spatial behaviour and personality is not investigated extensively, as it is not the main focus of the study. \subsection*{Social and spatial connection} Recently, connections between the social and spatial behaviour of pairs \cite{backstrom2010find,mcgee2013location,sadilek2012finding,crandall2010inferring, grabowicz2014entangling,toole2015coupling} and groups \cite{onnela2011geographic} of individuals have been demonstrated, and used to design predictive models of mobility \cite{mcgee2013location,jurgens2013s,cho2011friendship} or social ties \cite{wang2011human,sadilek2012finding,scellato2011exploiting,pham2013ebm}. Shifting the attention to the individual level, recent works based on online social network data \cite{cheng2011exploring,cranshaw2010bridging}, mobile phone calls data \cite{toole2015coupling} and evenly sampled high resolution mobility trajectories \cite{alessandretti2016evidence} have shown correlations between the activity space size and the ego network structure, calling for further research to more closely examine the connections between social and spatial behaviour at the individual level. \section*{Methods} \label{Methods} \subsection*{Data description and pre-processing} Our study is based on $850$ high resolution trajectories and call records of participants in a $24$ months longitudinal experiment, the Copenhagen Networks Study (CNS) \cite{stopczynski2014measuring}. Results on the connections between social and spatial behaviour were corroborated with data from another experiment with fixed rate temporal sampling, but lower spatial resolution and sample size: the Lausanne Mobile Data Challenge (MDC)~\cite{kiukkonen2010towards, laurila2012mobile}, lasted for $19$ months (see Table~\ref{table_data}). \renewcommand*{1.5}{1.5} \begin{table} \centering \begin{tabularx}{\columnwidth}{@{}X rrrrr@{}} & N & $\delta t$ & $T$ & $\delta x$ & $TC$\\ \midrule CNS & 850 & 16 s & 24 months & 10 m & 0.84 \\ MDC & 185 & 60 s & 19 months & 100-200 m &0.73 \\ \bottomrule \end{tabularx} \caption{\textbf{Characteristics of the mobility datasets considered.} $N$ is the number of individuals, $\delta t$ the temporal resolution, $T$ the duration of data collection, $\delta x$ the spatial resolution, $TC$ the median weekly time coverage, defined as the fraction of time an individual's location is known.} \label{table_data} \end{table} \subsubsection*{CNS dataset} The Copenhagen Networks Study (CNS) experiment took place between September 2013 and September 2015 \cite{stopczynski2014measuring} and involved $\sim 1000$ Technical University of Denmark students ($\sim 22\%$ female, $\sim 78\%$ male) typically aged between 19 and 21 years old. Participants' position over time was estimated combining their smart-phones WiFi and GPS data using the method described in~\cite{sapiezynski2015opportunities, alessandretti2016evidence}. The location estimation error is below 50 meters in 95\% of the cases. Participants' calls and sms activity was also collected as part of the experiment. Individuals' background information were obtained through a 310 questions survey including the Big Five Inventory \cite{john1999big}, which measures how individuals score on five broad domains of human personality traits: openness, conscientiousness, extraversion, agreeableness, neuroticism. The personality questionnaire used in the study is a version of the Big Five Inventory \cite{john1999big}, translated from English into Danish. It contains 44 individual items and each trait is computed as the average of 7-10 items. Data collection was approved by the Danish Data Protection Agency. All participants provided individual informed consent. Mobility patterns of participants in the CNS experiment display statistical properties consistent with previous literature \cite{gonzalez2008understanding}, as shown in \cite{alessandretti2016evidence}. \\ \subsubsection*{MDC dataset} Data was collected by the Lausanne Data Collection Campaign between October 2009 and March 2011. The campaign involved an heterogeneous sample of $\sim185$ volunteers with mixed backgrounds from the Lake Geneva region (Switzerland), who were allocated smart-phones \cite{laurila2012mobile}. In this work we used GSM data, that has the highest temporal sampling. Following Nokia's privacy policy, individuals participating in the study provided informed consent \cite{laurila2012mobile}. The Lausanne Mobile Data Challenge experiment involves 62\% male and 38\% female participants, where the age range 22-33 year-old accounts for roughly 2/3 of the population \cite{laurila2013big}. \subsection*{Metrics} In this section, we define the concepts and metrics used to quantify the social and spatial behaviour of an individual $i$. \noindent \textbf{Exploration behaviour} is characterised by the following quantities: \begin{description} \item{\textit{Number of new locations/week:}} $n_{loc}(i,t)$ is the number of locations discovered by $i$ in the week preceding $t$. \item{\textit{Number of new ties/week:}} $n_{tie}(i,t)$ is the number of individuals who had contact with $i$ (by sms or call) for the first time in the week preceding $t$. \end{description} Note that locations/ties are considered `new' only if discovered after $20$ weeks from the beginning of data collection. \noindent \textbf{Exploitation behaviour} can be quantified by considering: \begin{description} \item{\textit{Activity space:}} The set $AS(i,t)=\{\ell_1,\ell_2,...,\ell_j,...\ell_C\}$ of locations $\ell_j$ that individual $i$ visited at least twice and where she spent a time $\tau_j$ larger than $200 min$ during a time-window of $T=20$ weeks preceding time $t$ (see Supplementary Material for the analysis with $T=30$ weeks). Among the locations in the activity space, $i$ visited $\ell_j$ with probability $p (\ell_j) = \tau_j/\sum \tau_j$. (It is worth noting that this time-based definition of activity space includes all significant locations independently of their spatial position and it is only loosely connected with space-oriented definitions widespread in the geography literature such as the ``standard deviational ellipse" and the ``road network buffer" \cite{sherman2005suite}). \item{\textit{Social circle: }} The set $SC(i,t)=\{u_1,u_2,...,u_j,...u_k\}$ of individuals $u_j$ with whom individual $i$ had a number of contacts $n_j>5$ by sms or call during a time-window of $T=20$ consecutive weeks preceding time $t$ (see Supplementary Material for the analysis with $T=30$ weeks). The probability that $i$ has contact with a given member $u_j$ of her social circle is $p(u_j) = n_j/\sum n_j$. \end{description} For these two sets $AS(i,t)$ and $SC(i,t)$, we consider their sizes $C(i,t)$ and $k(i,t)$, quantifying the number of favoured locations and social ties, respectively; their entropies $H_{AS}(i,t)$ and $H_{SC}(i,t)$, measuring how time is allocated among locations and ties; their stabilities $J_{AS}(i,t)$ and $J_{SC}(i,t)$, quantifying the fraction of conserved locations and ties, respectively, across consecutive non-overlapping windows of $T=20$ weeks (see Supplementary Material for $T=30$); their rank turnovers $R_{AS}(i,t)$ and $R_{SC}(i,t)$ measuring the average absolute change in rank of an element in the set between consecutive windows. The mathematical definition of these quantities is provided in Table \ref{table_metrics} \begin{table} \centering \begin{tabularx}{\columnwidth}{@{}l X l@{}} & Activity space & Social circle \\ \midrule 1) Size & $C(i,t) = |AS_i(t)|$ & $k(i,t) = |SC(i,t)|$ \\[3ex] 2) Entropy & $H_{AS} (i,t) = -\sum\limits_{j=1}^{C(i,t)}{p(j) \log p(j)}$ & $H_{SC}(i,t) = -\sum\limits_{j=1}^{k(i,t)}{p(j) \log p(j)}$ \\[4ex] 3) Stability & $J_{SC}(i,t)=\dfrac{|SC(i,t)\cap SC(i,t-T)|}{|SC(i,t)\cup SC(i,t-T)|}^*$ & $J_{AS}(i,t)=\dfrac{|AS(i,t)\cap AS(i,t-T)|}{|AS(i,t)\cup AS(i,t-T)|}^*$ \\[4ex] \makecell[l]{4) Rank \\ \hspace{7pt} Turnover} & $R_{AS}(i,t)=\sum\limits_{j=1}^{N}\dfrac{|r(j,t) - r(j, t- T)|^{**}}{N}$ & $R_{SC}(i,t)=\sum\limits_{j=1}^{N}\dfrac{|r(j,t) - r(j, t- T)|^{**}}{N}$ \\[4ex] \midrule \multicolumn{3}{l}{\small{$^{*}$ Here $T=20$ weeks, see Supplementary Material for the analysis with $T=30$ weeks}} \\ \multicolumn{3}{l}{\small{$^{**}$ $r(\ell_k,t)$ and $r(u_k,t)$ denote the rank of a location $\ell_k$ and individual $u_k$ at $t$, respectively}} \\ \bottomrule \end{tabularx} \caption{\textbf{Definition of the metrics characterising the activity space and the social circle.} 1) The size of a set is the number of elements in the set 2) We compute the entropy of a set considering the probability $p(j)$ associated to each element $j$ of the set. 3) We measure the stability $J_{AS}$ by computing the Jaccard similarity between the activity space at $t$ and at $t-T$, with $T=20$ weeks. $J_{SC}$ is computed in the same way for the social circle. 4) We compute the rank turnover of a set by measuring for each of its elements $j$ the absolute change in rank between two consecutive time windows of length $T=20$ weeks. The rank is attributed based on the probability $p(j)$. The average absolute change in rank across all elements corresponds to the rank turnover. }. \label{table_metrics} \end{table} \subsubsection*{Other metrics} In order to compare the difference in entropy between two different sets, we compute their Jensen-Shannon divergence (JSD). The JSD between two sets $P_1$ and $P_2$ is computed as $JSD(P_1,P_2) = H(\frac{1}{2} (P_1+P_2)) - \frac{1}{2} [H(P_1) + H(P_2)]$ (see also \cite{saramaki2014persistence}). \section*{Results} \label{Results} Both in their spatial and social behaviour, individuals are constantly balancing a trade-off between the exploitation of familiar options (such as returning to a favourite restaurant or spending time with an old friend) and the exploration of new opportunities (such as visiting a new bar or going on a first date) \cite{hills2015exploration}. We adopt this exploration-exploitation perspective to analyse the relationship between social and spatial strategies in our dataset \cite{alessandretti2016evidence}. We quantify the propensity for exploration and exploitation within each individual, $i$, using the metrics reported in Table \ref{table_metrics_2}, Fig.~\ref{schema} and described in section `\nameref{Methods}'. We focus on two aspects of exploitation, (i) \textit{diversity}, characterising how individuals allocate time among their set of familiar locations and friends, and (ii) \textit{evolution}, characterising the tendency to change exploited locations and friends over time. \begin{figure*}[h!] \centering \includegraphics[width=\textwidth]{Figure1.pdf} \caption{\textbf{Schematic description of our framework.}} \label{schema} \end{figure*} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{}l X l l @{}} & {Exploration} & {Exploitation: Diversity} & {Exploitation: Evolution} \\ \midrule Spatial &New loc./week, $n_{loc}$ & Activity space size, $C$ & Activity space stability, $J_{AS}$ \\ & & Activity space entropy, $H_{AS}$ & Activity space rank turnover, $R_{AS}$ \\ Social &New ties/week, $n_{tie}$ & Social circle size, $k$ & Social circle stability, $J_{SC}$ \\ & & Social circle entropy, $H_{SC}$ & Social circle rank turnover, $R_{SC}$ \\ \bottomrule \end{tabularx} \caption{\textbf{Metrics characterising social and spatial behaviour.} The metrics are defined in section \nameref{Methods}}. \label{table_metrics_2} \end{table} \textbf{Exploration and exploitation are persistent in time.} First, we verify that individual behaviour is persistent in time. For all the aforementioned measures, we compare the individual self-variation across time $d_{self}(i)$ with a reference difference $d_{ref}(i,j)$ between individuals $i$ and $j$. In the case of the activity space size, for example, self-variation is measured as $d_{self} = \langle | C(i,t) - C(i,t-T) |\rangle $, where $\langle \cdot \rangle$ is the average across time and $T=20$ weeks (see Supplementary Material for $T=30$) ; the reference difference is computed as $d_{ref}(i,j)= |\langle C(i,t) \rangle - \langle C(j,t) \rangle|$. If $d_{self}(i)<d_{ref}(i,j)$ for most $j$, we can conclude that for individual $i$, fluctuations of the activity space size are negligible compared to the difference with other individuals. The same procedure is followed for all metrics with an adjustment in the case of entropies: The persistence of the entropy $H_{AS}$ is verified by comparing the Janson-Shannon divergences $d_{self} = JSD(AS(i,t), AS(i,t - T))$ and $d_{ref} = JSD(AS(i,t), AS(j,t))$. The same method was used for $H_{SC}$ (see Methods and \cite{saramaki2014persistence}). Results from the CNS dataset reported in Table \ref{table1_CNS} show that for all metrics $d_{self}(i)<d_{ref}(i,j)$ holds in more than $99\%$ of cases on average (MDC: $97\%$, see Supplementary Material Table S1). Moreover, the average self-variation across the population $\overline{d_{self}}$ is consistent with $\overline{d_{self}}=0$ within errors, and $ \overline{d_{self}}$ significantly smaller than the average reference difference $\overline{d_{ref}}$ (see Tables \ref{table1_CNS} and S1 in Supplementary Material). \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{}X rrr@{}} {} & $\overline{d_{self}}$ & $\overline{d_{ref}}$ & $\overline{d_{self}(i)<d_{ref}(i,j)}$ \\ \midrule Social circle size, $k$ & $0.04 \pm 0.09$ & $12 \pm 5$ & $99 $\% \\ Activity space size, $C$ & $0.04 \pm 0.07$ & $7 \pm 3$ & $99 $\% \\ New ties/week, $n_{tie}$ & $0.05 \pm 0.10$ & $0.9 \pm 0.5$ & $96 $\% \\ New locations/week, $n_{loc}$ & $0.10 \pm 0.17$ & $1 \pm 1$ & $95 $\% \\ Social circle entropy, $H_{SC}$ & $0.002 \pm 0.007$ & $0.7 \pm 0.2$ & $99 $\% \\ Activity space entropy, $H_{AS}$ & $0.002 \pm 0.005$ & $0.4 \pm 0.1$ & $99 $\% \\ Social circle stability, $J_{SC}$ & $({9} \pm {22}) \cdot10^{-4}$ & $0.13 \pm 0.05$ & $100 $\% \\ Activity space stability, $J_{AS}$ & $({9} \pm {26}) \cdot10^{-4}$ & $0.10 \pm 0.04$ & $99 $\% \\ Social circle rank turnover, $R_{SC}$ & $0.05 \pm 0.39$ & $2 \pm 1$ & $99 $\% \\ Activity space rank turnover, $R_{AS}$ & $0.04 \pm 0.10$ & $2 \pm 1$ & $99 $\% \\ \bottomrule \end{tabularx} \caption{\textbf{CNS dataset: Persistence of social and spatial behaviour.}For each of the social and spatial metrics, $\overline{d_{self}}$ is the average self-distance and $\overline{d_{ref}}$ is the reference distance between an individual and all others, averaged across individuals. The third column reports the fraction of cases where $\overline{d_{self}(i)<d_{ref}(i,j)}$, averaged across the population.} \label{table1_CNS} \end{table} These results extend previous findings \cite{saramaki2014persistence, alessandretti2016evidence} and suggest that each individual is characterised by a distinctive socio-spatial behaviour captured by the ensemble of these metrics averaged across time. In fact, these averages are heterogeneously distributed across the samples considered (see Fig.~\ref{distributions}). \begin{figure*}[h!] \centering \includegraphics[width=.9\textwidth]{Figure2.pdf} \caption{\textbf{Distribution of social (above line) and spatial (bottom line) metrics for the CNS and MDC datasets.}} \label{distributions} \end{figure*} \textbf{Exploration and exploitation are correlated in the social and spatial domain.} A natural way to test the interdependency between social and spatial behaviours is measuring the correlation between a given social metric and a corresponding spatial one. We find positive and significant correlations for all metrics and datasets (see Figs.~\ref{social vs spatial_CNS} and S1 in Supplementary Material). \begin{figure*}[h!] \centering \includegraphics[width=.9\textwidth]{Figure3.pdf} \caption{\textbf{CNS dataset: correlation between the four dimensions of social and spatial behaviour.} ({A}) Activity space vs social circle size. ({B}) Activity space vs social circle composition measured as their entropy. ({C}) Average number of new locations vs new ties per week. ({D}) Stability of the activity space vs the stability of the social circle measured as the Jaccard similarity between their composition in consecutive time-windows. ({E}) Rank turnover of the activity space vs the rank turnover of the social circle. Coloured filled areas correspond to cumulative probabilities estimated via Gaussian Kernel Density estimations. Grey lines correspond to linear fit with angular coefficient $b$ reported in the legend. The Pearson correlation coefficient, with corresponding p-value, is reported in the legend. } \label{social vs spatial_CNS} \end{figure*} We find that individuals with high propensity to explore new locations are also more keen on exploring social opportunities (see Fig.~\ref{social vs spatial_CNS}A). Those with diverse mobility routine are also likely to have a correspondingly large social circle (see Fig.~\ref{social vs spatial_CNS}B), and those that often replace social ties, have also an unstable set of favourite locations (see Fig.~\ref{social vs spatial_CNS}C and D). We verify that the observed correlations are not spurious by performing multiple regression analyses that control for other possible sources of variation: gender, age, and time coverage (the average time an individual position is known). We implement five multiple linear regression models M1, M2, M3, M4 and M5. Each regression model predicts a given spatial metric (the activity space size $C$, the activity space entropy $H_{AS}$, the number of new locations/week $n_{loc}$, the activity space stability $J_{AS}$ and the rank turnover $R_{AS}$) using the corresponding social metric and the control variables (age, gender and time coverage) as regressors. The relative importance of each regressor is assessed using the Lindeman, Merenda and Gold ($LMG$) \cite{gromping2006relative} method. Results obtained via weighted least square regression (see Tables \ref{multiple regression CNS} for the CNS dataset and S2 in Supplementary Material for the MDC dataset) reveal that the social metrics are significant predictors for spatial metrics (p value$<0.01$ in all cases except for M4 in the MDC dataset), and they typically have more importance than factors such as gender, time, coverage and age group (see Fig.~\ref{multiple regression_figure}). \begin{table} \centering \begin{tabularx}{\columnwidth}{@{}Xrrr@{}} \textbf{Model M1: Activity space size, $C$} & coeff & p val & LMG \\ \hline Social circle size, $k$ & $4 \pm 0$ & $<10^{-50}$ & 0.94 \\ gender & $-0.4 \pm 0.2$ & 0.05 & 0.05 \\ time coverage & $0.4 \pm 0.2$ & 0.06 & 0.01 \\ {[$R^2=0.32$, $F=100.44$, $p_F=0.0$ ]} \\ \\ \textbf{Model M2: Activity space entropy, $H_{AS}$ } \\ \hline Social circle entropy, $H_{SC}$ & $0.07 \pm 0.01$ & $<10^{-6}$ & 0.42 \\ gender & $-0.06 \pm 0.01$ & $<10^{-4}$ & 0.22 \\ time coverage & $-0.07 \pm 0.01$ & $<10^{-5}$ & 0.36 \\ {[$R^2=0.11$, $F=27.30$, $p_F=0.0$]} \\ \\ \textbf{Model M3: New locations/week, $n_{loc}$} & \\ \hline New ties/week, $n_{tie}$ & $0.60 \pm 0.05$ & $<10^{-32}$ & 0.9 \\ gender & $-0.16 \pm 0.05$ & $<10^{-3}$ & 0.08 \\ time coverage & $0.001 \pm 0.047$ & 1.0 & 0.01 \\ {[$R^2=0.22$, $F=61.99$, $p_F=0.0$]} & & & \\ \\ \textbf{Model M4: Activity space stability, $J_{AS}$} & \\ \hline Social circle stability, $J_{SC}$ & $0.024 \pm 0.004$ & $<10^{-10}$ & 0.6 \\ gender & $0.007 \pm 0.003$ & 0.05 & 0.04 \\ time coverage & $0.017 \pm 0.004$ & $<10^{-5}$ & 0.36 \\ {[$R^2=0.16$, $F=33.36$, $p_F=0.0$]} & & & \\ \\ \textbf{Model M5: Activity space rank turnover, $R_{AS}$} & \\ \hline Social circle rank turnover, $R_{SC}$ & $1 \pm 0$ & $<10^{-56}$ & 0.98 \\ gender & $0.12 \pm 0.07$ & 0.06 & 0.01 \\ time coverage & $-0.12 \pm 0.07$ & 0.07 & 0.01 \\ {[$R^2=0.36$, $F=108.31$, $p_F=0.0$]} & & & \\ \\ \hline \end{tabularx} \caption{\textbf{Linear regression models for the CNS dataset.} For each model, we show the coefficients (coeff) calculated by the regression model, the probability (p val) that the variable is not relevant, and the relative importance (LMG) of each regressor computed using the Lindeman, Merenda and Gold method \cite{gromping2006relative}. Gender is a binary variable taking value 1 for females and 2 for males. For this dataset, age is not relevant as all participants have similar age. For each model, we report the $R^2$ goodness of fit, the $F-test$ statistics with the corresponding p-value $p_F$. } \label{multiple regression CNS} \end{table} \begin{figure} \includegraphics[width=.9\textwidth]{Figure4.pdf} \caption{\textbf{Relative importance of regressors} LMG of each regressor computed using the Lindeman, Merenda and Gold method \cite{gromping2006relative} for models M1 (A), M2 (B), M3 (C), M4 (D) and M5 (D). Plain bars show results for the CNS dataset, dashed bars for the MDC dataset. Variables that are not significant in the regression model are marked with *. } \label{multiple regression_figure} \end{figure} Among the control variables, gender is a significant predictor of spatial behaviour in the CNS dataset: Females display higher level of routine diversity and propensity towards exploration, in accordance with \cite{mollgaard2017correlations}. Time coverage, measuring the fraction of time an individual position is known, plays a significant role in explaining spatial entropy and activity space stability, since individuals who spend long time in the same place (or leave their phone in the same place) are more easily geo-localised. Age differences are not present within the sample of students participating in the CNS study, and they are not estimated to be relevant with respect to spatial behaviour in the MDC study. \textbf{We do not identify distinct classes of individuals.} A natural question is whether or not, in the samples considered, there is evidence for distinct classes of individuals based on their socio-spatial behaviour \cite{pappalardo2015returners, miritello2013limited}. We approach this problem by reducing the set of metrics to a smaller number of uncorrelated variables by applying Principal Component Analysis \cite{wold1987principal,mika1999kernel}. The principal components represent the data through linear combinations of the original variables: In Table \ref{table_variance} we report the percentage of variance in the data explained by all components; in Table \ref{table_components} we report the coefficients $w$ describing how the original variables are linearly combined to obtain the first two principal components. In both datasets, we find that the first principal component (PC 0) explains $\sim 40\%$ of the differences between individuals (see Table \ref{table_variance}). For the CNS dataset, the variables contributing the most to PC 0 (e.g. such that $w^2>0.1$) are, in order, the activity space size $C$, the social circle size $k$, the number of new locations/week $n_{loc}$, the activity space entropy $H_{AS}$ and the number of new ties/week $n_{tie}$. $n_{loc}$ and $n_{tie}$ characterise the attitude towards exploration. The other metrics ($C$, $k$ and $H_{AS}$) are related to routine diversity, or the tendency to dispose of a large set of familiar locations and friends. Since the sign of $w$ is the same for all the metrics above, we can conclude that individuals with higher propensity towards exploration tend to have a more diverse social and spatial routine, and vice-versa. Similar conclusions could be drawn by looking at results obtained for the MDC dataset. \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{}X rrrrrrrrrr @{}} {} & PC 0 & PC 1 & PC 2 & PC 3 & PC 4 & PC 5 & PC 6 & PC 7 & PC 8 & PC 9 \\ \midrule CNS & 0.39 & 0.17 & 0.12 & 0.08 & 0.07 & 0.06 & 0.04 & 0.03 & 0.03 & 0.01 \\ MDC & 0.43 & 0.14 & 0.13 & 0.08 & 0.07 & 0.06 & 0.04 & 0.03 & 0.02 & 0.01 \\ \bottomrule \end{tabularx} \caption{\textbf{Variance explained by principal components.} The fraction of variance explained by each principal component for the CNS and MDC dataset. } \label{table_variance} \end{table} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{} X rr rr@{}} {} & \multicolumn{2}{ c }{CNS} & \multicolumn{2}{ c }{MDC} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} {} & $w$ (PC 0) & $w$ (PC 1) & $w$ (PC 0) & $w$ (PC 1) \\ \midrule Social circle size, $k$ & 0.41 & 0.16 & 0.37 & -0.15 \\ Activity space size, $C$ & 0.42 & -0.24 & 0.42 & -0.08 \\ New ties/week, $n_{tie}$ & 0.33 & 0.28 & 0.27 & 0.33 \\ New locations/week, $n_{loc}$ & 0.38 & -0.05 & 0.37 & 0.19 \\ Social circle entropy, $H_{SC}$ & 0.31 & 0.30 & 0.34 & 0.09 \\ Activity space entropy, $H_{AS}$ & 0.38 & -0.16 & 0.30 & -0.07 \\ Social circle stability, $J_{SC}$ & -0.16 & -0.46 & 0.07 & -0.72 \\ Activity space stability, $J_{AS}$ & -0.10 & -0.49 & -0.12 & -0.51 \\ Social circle rank turnover, $R_{SC}$ & -0.20 & 0.28 & -0.33 & 0.10 \\ Activity space rank turnover, $R_{AS}$ & -0.30 & 0.44 & -0.38 & 0.17 \\ \bottomrule \end{tabularx} \caption{\textbf{Contribution of the original variables to the first principal component.} The scalar projection $w$ of the first (PC 0) and second (PC 1) principal components, along the axis defined by each of the original variables. Each principal component has unit norm, hence the sum of $w^2$ is $1$. Results are shown for the CNS and MDC datasets. } \label{table_components} \end{table} The second principal component (PC 1) accounts for $\sim 15\%$ of the total variation (see Table \ref{table_variance}). It is dominated by the social circle stability $J_{SC}$ (CNS: $w^2 =0.21$, MDC: $w^2 = 0.52$) and the activity space stability $J_{AS}$ (CNS: $w^2 = 0.24$, MDC: $w^2 =0.26$) for both datasets (see Table \ref{table_components}). The sign of the coefficients $w$ for $J_{SC}$ and $J_{AS}$ are the same, further confirming that these two metrics are correlated (see also Fig. \ref{social vs spatial_CNS}). We can conclude that the second principal component accounts for the effects of routine evolution, or the tendency to change familiar locations and friends over long time scales. We consider the first two principal components, PC 0 and PC 1, to reduce the effects of noise and we test the hypothesis that there exists different classes of individuals applying the gap statistic method \cite{tibshirani2001estimating}. We apply it by looking at the gap between the within-cluster dispersion expected under a uniform distribution of the data and the dispersion obtained after applying K-means. For all possible choices of $K>1$, we find that the gap is not large enough to support the existence of more than one class of individuals. \textbf{The big-five personality traits partly explain spatial and social behaviour.} We verify if the differences between individuals can be explained by the Big five personality traits model \cite{john1999big}, typically used to describe social and emotional life (see Table \ref{table_traits}). We build two multiple linear regression models that use the Big five personality traits as regressors and one of the principal components describing socio-spatial behaviour as target. Results, shown in Table \ref{table_traits_model}, show that three personality traits, neuroticism, openness and extraversion, are relevant predictors for socio-spatial behaviour. In particular, extraversion is the most important predictor of the first principal component: it positively correlates with the tendency to diversify routine and to explore opportunities. Neuroticism and openness explain instead the second principal component, since it correlates with the tendency to change routine over time (see also Fig.~\ref{personality_socio_spatial}). Finally, we perform all analyses considering only spatial metrics. Results are in line with those obtained considering all metrics: The first two principal components account for a large fraction of the variability in the data (see Table \ref{table_variance_2}); The first component is dominated by the activity space size $C$, the number of new locations/week $n_{loc}$ and the activity space entropy $H_{AS}$, while the second is mostly controlled by the activity space stability $J_{AS}$ (Table \ref{table_components_2}). For the CNS dataset, extraversion is the most important predictor of the first principal component, while openness, extraversion and neuroticism account for the second component (see Table \ref{table_traits_model_2} and Fig.~\ref{personality_spatial}). The result presented above hold when choosing a time-window with length $T=30$ weeks (see Supplementary Material, section 2). \begin{table} \centering \begin{tabularx}{\columnwidth}{@{} X l @{}} {Trait} & {Related Adjectives} \\ \midrule Extraversion & Active, Assertive, Energetic, Enthusiastic, Outgoing, Talkative\\ Agreeableness & Appreciative, Forgiving, Generous, Kind, Sympathetic\\ Conscientiousness & Efficient, Organised, Planful, Reliable, Responsible, Thorough\\ Neuroticism & Anxious, Self-pitying, Tense, Touchy, Unstable, Worrying\\ Openness to Experience & Artistic, Curious, Imaginative, Insightful, Original, Wide Interests\\ \bottomrule \end{tabularx} \caption{The Big-Five traits and examples of adjectives describing them \cite{mccrae1992introduction}} \label{table_traits} \end{table} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{} X rrr rrr@{}} & \multicolumn{3}{r}{\makecell[c]{PC 0\\ $R^2=0.17$, $F=21.40$, $p_F=0.0$}} & \multicolumn{3}{r}{\makecell[c]{PC 1\\ $R^2=0.03$, $F=3.64$, $p_F=0.0$}} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} {} & coeff & p val & LMG & coeff & p val & LMG \\ \hline extraversion & $0.85 \pm 0.09$ & $<10^{-19}$ & 0.85 & $0.12 \pm 0.06$ & 0.05 & 0.14 \\ openness & $-0.17 \pm 0.08$ & 0.03 & 0.02 & $0.13 \pm 0.06$ & 0.02 & 0.33 \\ neuroticism & $0.25 \pm 0.09$ & 0.004 & 0.04 & $0.15 \pm 0.06$ & 0.02 & 0.3 \\ agreeableness & $0.11 \pm 0.08$ & 0.2 & 0.04 & $-0.07 \pm 0.06$ & 0.2 & 0.12 \\ conscientiousness & $0.06 \pm 0.08$ & 0.4 & 0.04 & $-0.07 \pm 0.06$ & 0.2 & 0.11 \\ \hline \end{tabularx} \caption{\textbf{Extraversion, openness, and neuroticism explain socio-spatial behaviour.} The result of a multiple linear regression explaining principal components of socio-spatial data (see Table \ref{table_components}). The value of each coefficient (coeff) is reported together with the probability (p val) that the coefficient is not relevant for the model. The relative importance of each coefficient (LMG) is computed using the LMG method \cite{gromping2006relative}. } \label{table_traits_model} \end{table} \begin{figure} \includegraphics[width=.9\textwidth]{Figure5.pdf} \caption{\textbf{Relative importance of personality traits for socio-spatial behaviour} LMG of each regressor computed using the Lindeman, Merenda and Gold method \cite{gromping2006relative} for the multiple regression model of the principal components (see also Table \ref{table_traits_model}).} \label{personality_socio_spatial} \end{figure} \begin{figure} \includegraphics[width=.9\textwidth]{Figure6.pdf} \caption{\textbf{Relative importance of personality traits for spatial behaviour} LMG of each regressor computed using the Lindeman, Merenda and Gold method \cite{gromping2006relative} for the multiple regression model of the principal components (see also Table \ref{table_traits_model_2}).} \label{personality_spatial} \end{figure} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{}X rrrrr@{}} {} & PC 0 & PC 1 & PC 2 & PC 3 & PC 4 \\ \midrule CNS & 0.53 & 0.21 & 0.13 & 0.10 & 0.04 \\ MDC & 0.56 & 0.19 & 0.13 & 0.07 & 0.04 \\ \bottomrule \end{tabularx} \caption{\textbf{Variance explained by principal components (only spatial data).} The fraction of variance explained by each principal component for the CNS and MDC dataset. } \label{table_variance_2} \end{table} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{} X rr rr @{}} {} & \multicolumn{2}{c}{CNS} & \multicolumn{2}{c}{MDC} \\ \cmidrule(lr){2-3} \cmidrule(lr){4-5} {} & PC 0 & PC 1 & PC 0 & PC 1 \\ \midrule Activity space size, $C$ & -0.58 & 0.02 & 0.55 & 0.12 \\ New locations/week, $n_{loc}$ & -0.48 & -0.19 & 0.51 & -0.09 \\ Activity space entropy, $H_{AS}$ & -0.50 & -0.08 & 0.43 & 0.20 \\ Activity space stability, $J_{AS}$ & -0.02 & 0.94 & -0.19 & 0.95 \\ Activity space rank turnover, $R_{AS}$ & 0.43 & -0.25 & -0.47 & -0.16 \\ \bottomrule \end{tabularx}\caption{\textbf{Principal Components (only spatial data).} The weight of each metric in the first two principal components, for both datasets. } \label{table_components_2} \end{table} \begin{table}[h!] \centering \begin{tabularx}{\columnwidth}{@{}X lll lll @{}} & \multicolumn{3}{c}{\makecell[c]{PC 0\\ $R^2=0.10$, $F=12.83$, $p_F=0.0$}} & \multicolumn{3}{ c}{\makecell[c]{PC 1\\ $R^2=0.03$, $F=3.50$, $p_F=0.0$}} \\ \cmidrule(lr){2-4} \cmidrule(lr){5-7} {} & coeff & p val & LMG & coeff & p val & LMG \\ \hline extraversion & $-0.50 \pm 0.07$ & $<10^{-10}$ & 0.77 & $-0.11 \pm 0.05$ & 0.02 & 0.3 \\ openness & $0.19 \pm 0.07$ & 0.004 & 0.08 & $-0.11 \pm 0.04$ & 0.009 & 0.45 \\ neuroticism & $-0.07 \pm 0.07$ & 0.4 & 0.03 & $-0.10 \pm 0.05$ & 0.03 & 0.21 \\ agreeableness & $-0.10 \pm 0.07$ & 0.2 & 0.07 & $0.01 \pm 0.05$ & 0.8 & 0.01 \\ conscientiousness & $-0.05 \pm 0.07$ & 0.5 & 0.05 & $0.03 \pm 0.04$ & 0.4 & 0.03 \\ \hline \end{tabularx} \caption{\textbf{Extraversion, openness, and neuroticism explain spatial behaviour.} The result of a multiple linear regression explaining principal components of spatial data (see Table \ref{table_components}). The value of each coefficient (coeff) is reported together with the probability (p val) that the coefficient is not relevant for the model. The relative importance of each coefficient (LMG) is computed using the LMG method \cite{gromping2006relative}. } \label{table_traits_model_2} \end{table} \section*{Discussion} Using high resolution data from two large scale studies, we have investigated the connection between social and spatial behaviour for the first time. We have shown that, in both domains, individuals balance the trade-off between exploring new opportunities and exploiting known options in a distinctive and persistent manner. We have found that, to a significant extent, individuals adopt a similar strategy in the social and spatial sphere. These strategies are heterogeneous across the two samples considered, and there is no evidence suggesting that there exist distinct classes of individuals. Finally, we have shown that the big five personality traits explain related aspects of both social and spatial behaviour. In particular, we have found that extraverted individuals are more explorative and have diverse routines in both the social and the spatial sphere while neuroticism and openness associate with high level of routine instability in the social and spatial domain. Our findings confirm the usefulness of mobile phone data to study the connections between behaviour and personality \cite{lambiotte2014tracking, bogomolov2014daily, staiano2012friends,centellegher2017personality,de2013predicting,chittaranjan2013mining}. The results are in line with previous findings on the relation between personality and social behaviour: extraversion correlates with ego-network size \cite{pollet2011extraverts, asendorpf2003personality, casciaro1998seeing} and diverse composition \cite{friggeri2012psychological}, openness to experience to social network turnover \cite{centellegher2017personality} and neuroticism does not correlate with social network size \cite{roberts2008individual}. Furthermore, our findings establish a relation between personality and spatial behaviour, validating the theories suggesting that spatial choices are partially dictated by personality dispositions \cite{aitken1991person} and that a single set of personality traits underlies many aspects of a person's behaviour \cite{mischel1973toward,allport1937personality}. Our findings on the connection between spatial behaviour and personality are consistent with the existing literature on personality. The correlation between exploration and extraversion could be explained by the fact that extraverted individuals are more likely to be risk-takers in various domains of life \cite{nicholson2005personality}. Extraverted individuals are also generally more likely to engage in social activities \cite{lucas2000cross}, which could partially explain why they allocate time among a larger set of locations. Furthermore, the key finding that individuals who score high in neuroticism and openness display a tendency to change familiar locations, and friends, over time fits well within the existing picture. In the case of neuroticism, it is well known that this trait is closely related with `stability' \cite{robinson2005neuroticism}, such that the trait of neuroticism is sometimes referred to as (low) `emotional stability' \cite{judge2001relationship}. Also, at the core of neuroticism is the tendency to experience negative emotions \cite{costa1992revised} including dissatisfaction \cite{costa1980influence}, which in turn can lead into desire for change \cite{zhou2001job,rusbult1983responses}. Finally, it is known that people scoring high in neuroticism have a larger number of weak ties \cite{kalish2006psychological} and perceive that they tend to have less social support \cite{russell1997personality,stokes1985relation}, in line with our observation that they dispose of an unstable ego-network. Openness to experience has been shown to correlate with `disloyal' behaviour also in other contexts such as politics \cite{bakker2016stay} and shopping \cite{matzler2006individual}. Our results, in agreement with previous studies on social \cite{lambiotte2014tracking, bogomolov2014daily, staiano2012friends,centellegher2017personality,de2013predicting,chittaranjan2013mining} and online \cite{bachrach2012personality,markovikj2013mining,quercia2011our,kosinski2013private} behaviour, show that personality traits explain only partially how individuals behave in specific situations \cite{fleeson2008end}. As a final point, we emphasize that the individual characterisation of spatial behaviour and connections with personality are fundamental to develop conceptual \cite{van2010transport} and predictive \cite{jiang2016timegeo} models of travel behaviour accounting for individual-level differences. \clearpage \section*{Competing interests} The authors declare that they have no competing interests. \section*{Author's contributions} LA, SL and AB designed the study; LA performed the analysis; LA, SL and AB analysed the results; LA, SL and AB wrote the paper. \section*{Acknowledgements} This work was supported by the Danish Council for Independent Research (``Microdynamics of influence in social systems", grant id. 4184-00556, SL is PI). Portions of the research in this paper used the MDC Database made available by Idiap Research Institute, Switzerland and owned by Nokia. \section*{List of Abbreviations} CNS: Copenhagen Networks Study \\ MDC: (Lausanne) Mobile Data Challenge \\ GSM: Global System for Mobile Communications \\ JSD: Jensen-Shannon divergence \\ LMG: Lindeman, Merenda and Gold \\ \clearpage \pagebreak \bibliographystyle{unsrt}
\section{Introduction} Stereo matching is one of the fundamental problems in computer vision community. The goal of stereo matching is to compute a disparity map from images collected by stereo cameras. The disparity map is widely used in 3D scene reconstruction, robotics, and autonomous driving. Driven by the emergence of large-scale data sets and fast development of computation power, deep neural networks have proven effective for stereo matching. Many state-of-the-art methods raise the performance by learning robust local features or similarity measurements for cost computation \cite{zbontar2015computing,luo2016efficient,shaked2016improved}. However, these methods still have difficulties in textureless areas and occluded regions because of the limited view field during cost computation. \begin{figure} \centering \includegraphics[width=8.3cm]{overview.pdf} \caption{Comparisons between the typical deep stereo matching pipeline and pipeline with our learning-based cost aggregation. The architecture A is the typical deep stereo matching pipeline with traditional cost aggregation method. The architecture B is our learning-based cost aggregation. The details of architectures will be shown in Figure \ref{fig:all}, where the parts are matching according to the colors. } \label{fig:first} \end{figure} To handle mismatching values of the cost computation results, which is called cost volume, the cost aggregation step is indispensable in traditional stereo matching methods. Cost aggregation is applied to the cost volume to rectify the incorrect values by aggregating the computed matching cost. It is typically performed by summing or averaging the matching cost over a support region within a constant disparity \cite{yang2012non,min2011revisit,tombari2008classification}. However, the traditional cost aggregation methods are limited by the shallow, hand-designed scheme to perform the aggregation. They cannot effectively take global view guidance into account while keeping the local fitness. In this paper, we propose a learning-based cost aggregation to keep the balance between global view and local fitness using a novel two-stream neural network. \begin{figure*} \centering \includegraphics[height=7cm]{1.pdf} \caption{Our stereo matching pipeline with learning-based cost aggregation. The different colors represent the different size of data: blue for $W\times H\times C$, orange for $D\times H\times W\times C$, green for $H\times W\times G$ and purple for $D\times H\times W\times G$. The cost computation step is divided into three components. A1 is a feature extraction sub-network using the residual Siamese network. A2 is a feature volume construction part, and the detailed illustration is shown in Figure \ref{fig:volume}. A3 computes the similarity between the feature volume using a 3D convolutional network and produces the initial cost volume. The learning-based cost aggregation is carried out by a two-stream network as a sub-architecture for the whole pipeline. The guidance stream is illustrated in B1. The proposals stream is shown in B2. The cost aggregation result is obtained by a winner-take-all strategy to select the best proposal. Finally, a soft-argmin function is employed to compute the disparity map. } \label{fig:all} \end{figure*} The proposed cost aggregation can incorporate with other deep stereo matching pipeline in an end-to-end manner because it is conducted as a sub-architecture for the whole network. With the learning-based cost aggregation, the end-to-end trainable stereo matching pipeline can not only learn the feature and similarity measurementment for cost computation but also perform the cost aggregation. The comparisons of the proposed architecture with typical deep stereo pipelines are shown in Figure \ref{fig:first}. We can see that the learning-based cost aggregation is carried out by a two-stream network in an explicit manner. The cost aggregation process is reformulated as a learning mechanism to generate potential cost aggregation results called proposals and select the best one. Accordingly, the learning-based cost aggregation is carried out by a two-stream network: one stream is used for generating the proposals and the other stream is employed for evaluating proposals. The first stream holds the local fitness by generating potential aggregation results according to the cost volume computed from the cost computation. The generation is performed by a convolutional operation along the three dimensions of the cost volume, which aggregates information both on the spatial and depth space. The second stream brings in global view guidance for the cost aggregation by evaluating each proposal. For each proposal, it is evaluated by the guidance with the same size of the image, which is considered as the global view guidance. The guidance is obtained by a light convolutional network to bring in low-level structure information which is treated as the evaluation criterion for proposals. Since the structure information only contains 2D information, which is independent in depth, the guidance is unchanged along the depth dimension. Therefore, the evaluation for each proposal shares the same guidance for different disparities. After evaluating each proposal, a winner-take-all strategy is employed to choose the best-aggregated value to form the aggregated cost volume The proposed architecture reaches a promising accuracy on the Scene Flow \cite{mayer2016large} and the KITTI benchmark \cite{menze2015object,geiger2012we}. Our contributions are three-fold. \begin{itemize} \item This work is, to the best of our knowledge, the first to explicitly model the cost aggregation in a learning-based scheme for stereo matching. We reformulate the cost aggregation as the learning process of generation and selection of cost aggregation proposals. \item We propose a novel two-stream network to carry out the generation and selection of cost aggregation proposals. The proposed two-stream network maintains the rich semantic information while brings in low-level structure information, which demonstrates the ability to fuse the high-level feature with the low-level feature. \item The proposed learning-based cost aggregation is carried out as a sub-architecture of the deep stereo matching pipeline in an end-to-end trainable manner. It is flexible for the pipelines without cost aggregation to raise accuracy. \end{itemize} \section{Related Work} \subsection{Deep neural networks for Cost computation} Using deep neural networks for stereo matching was firstly introduced by Zbontar et al. \cite{zbontar2015computing} with a Siamese network for cost computation. Luo et al. \cite{luo2016efficient} reduced the computation time by replacing the full-connection layer with an inner product. For the stereo matching task, the Siamese network is responsible for extracting deep representations for each pixel. The original simple convolutional layers are limited to generate the rich semantic representation, so the improved highway network such as the residual network was employed to improve representations under the Siamese architecture \cite{shaked2016improved,XuCVPR2017DCFlow}. Then a similarity measurementment is applied to compute the matching cost between corresponding pixels. Inspired by the progress of the dense pixel-wise task such as optical flow and semantics segmentation, the 3D auto-encoder shows excellent performance by a large view field. The closely work with our method is GC-Net which is an end-to-end pipeline using a 3D auto-encoder as the similarity measurement \cite{kendall2017end}. Similarly, we utilize the residual Siamese network for feature extraction and leverage the 3D auto-encoder to compute the similarity. For deep stereo matching pipelines, the use of volume processing has been proven effective to combine the feature extraction and similarity measurement \cite{XuCVPR2017DCFlow}. We modify the traditional concatenating construction with an additional shift operation to construct a more effective feature volume. Despite the usage of deep neural networks for cost computation improve the stereo matching performance, it still has limitations on textureless areas, weak structure, and occluded regions. Hand-designed cost aggregation methods are normally used on the initial cost volume, whose improvement is barely adequate \cite{zbontar2015computing,luo2016efficient}. In this paper, we present a learnable cost aggregation method which can collaborate with deep cost computation methods in an end-to-end trainable manner. The two-stream network is shown effective to fuse different classes of features in video action recognition \cite{simonyan2014two}. Inspired by this, we design a novel two-stream network to carry out the cost aggregation. The two-stream network is presented to maintain the rich semantics of the cost computation while bringing into low-level structure information to guide the cost aggregation. The low-level structure information can be used as the global view guidance by a light neural network architecture \cite{mahendran2015understanding,zeiler2014visualizing}. The fusion of two-stream network is always realized by a concatenating function \cite{feichtenhofer2016convolutional}, in contrast, we introduce a winner-take-all strategy to fuse the two streams. \subsection{ Cost Aggregation} According to the taxonomy of stereo matching \cite{scharstein2002taxonomy}, a typical stereo matching pipeline can be divided into four steps: matching cost computation, cost aggregation, disparity computation, and disparity refinement. Many cost aggregation methods have been proposed to obtain high-quality disparity maps. Normally, most of them were performed locally by aggregating the matching cost value among a support region within the same disparity \cite{min2011revisit}. The traditional cost aggregation is implemented by the construction of support regions obtained by a similarity function that can measurement the similarity between two potentially related pixels in the same reference image \cite{yang2012non}. Yoon and Kweon et al. proposed an adaptive support region approach whose similarity function can be interpreted as a variant of joint bilateral filtering \cite{Yoon2006Adaptive}. Cross-based approaches use a shape-adaptive window which consists of multiple horizontal lines spanning adjacent vertical rows based on the function of the color similarity and an implicit connectivity constraint \cite{zhang2009cross}. A more thorough overview of cost aggregation methods can be found in \cite{min2011revisit}. Most traditional methods, however, are limited by the shallow, hand-designed similarity function which cannot adequately build the support region for the cost aggregation. The usage of deep neural networks for cost aggregation can collaborate with deep cost computation methods in a trainable manner. With the superiority of the two-stream architecture \cite{simonyan2014two,feichtenhofer2016convolutional}, we propose an explicit learning-based cost aggregation. In this paper, we reformulate the cost aggregation process as the generation and selection of cost aggregation proposals. The proposals are obtained by generating potential cost aggregation results from the initial cost volume. The selection of proposals uses the structure information as global view guidance in a winner-take-all (WTA) strategy. \section{Network Architecture} As a pixel-wise matching task, stereo matching is required to compute similarities between each pixel in the left image with $D$ corresponding pixels in right image, where $D$ is the maximum disparity. The computed matching cost can form the cost volume $C_0 (h,w,d)$. The stereo matching pipeline with the proposed cost aggregation is carried out by an end-to-end trainable network. Compared with using networks as a black box, we take experience from classical stereo matching algorithm \cite{scharstein2002taxonomy} to conduct the cost aggregation explicitly by a two-stream network. In this paper, unless otherwise specified, we refer to the left image as the reference image and the right image as the target image, where the disparity is computed from the reference image. \begin{table}[tbp] \small \centering \caption{Architecture for Feature Extraction} \begin{tabular}{l|l|l} \hline Index &layer&output \\ \hline \hline 1 &$5\times 5\times 32$ stride 2&$1/2H\times 1/2W\times F$ \\ 2-17 &$3\times 3\times 32$ stride 2&$1/2H\times 1/2W\times F$ \\ &residual connection*8&\\ 18 &$3\times 3\times 32$ stride 2&$1/2H\times 1/2W\times F$ \\ \hline \hline \end{tabular} \label{tab:feature} \end{table} The overview of our method is illustrated in Figure \ref{fig:all}. The matching cost computation can be divided into three parts: feature extraction, volume construction and similarity computation, as shown in Figure \ref{fig:all}.A1, Figure \ref{fig:all}.A2 and Figure \ref{fig:all}.A3, respectively. The detailed volume construction method is elucidated in Figure \ref{fig:volume}. A two-stream network carries out the proposed learning-based cost aggregation: the proposal network and the guidance network which are illustrated in Figure \ref{fig:all}.B2 and Figure \ref{fig:all}.B1, respectively. The disparity computation is shown in Figure \ref{fig:all}.C, the detailed implementation of C will be discussed later in this section. \subsection{Matching Cost Computation} Matching cost computation is designed to compute the similarity between corresponding pixels at the reference image and the target image. The disparity map can then be obtained from the cost volume. To determine the pixel-wise matching cost, we firstly generate deep representations for each pixel using a residual Siamese network. Then outputs from the Siamese network is fed into the feature volume construction which can transform features into the volume. Finally, the similarity measurement using 3D auto-encoder is applied on the feature volume to compute the matching cost volume. \subsubsection{A1: Feature Extraction} To compute the similarity between two pixels, we require a powerful representation for each pixel. Compared with the traditional raw pixel intensities, deep feature representation is more effective and robust to mitigate textureless regions and thin structure. As shown in Figure \ref{fig:all}.A1, we describe a Siamese network to extract the feature of each pixel. The Siamese network consists of two shared-weight sub-networks which concurrently deal with two input images. Each sub-network is composed of several residual blocks each of which consists of two $3 \times 3$ convolutional layers. To reduce the computational demand, we apply a $5 \times 5$ convolutional layer with $2 \times 2$ stride as a sub-sampling operation before the residual connection. For each residual block, it is activated before the residual operation. Each convolutional layer is followed by a batch normalized layer and a rectified linear unit except the last layer. From the detailed layer setting shown in Table \ref{tab:feature}, we can see that the result of the Siamese network produces two $H/2 \times W/2 \times F$ feature maps, where $H$ and $W$ denotes original input images size and $F$ indicates the filter channel. The two feature maps contain the deep feature for each pixel in the reference image and the target image, respectively. \begin{figure} \centering \includegraphics[width=8cm,height=4cm]{shift.pdf} \caption{The operation for the feature volume construction. Each grid square represents the feature for the pixel. We can simply employ a shift and concatenation operation to form a feature volume.} \label{fig:volume} \end{figure} \subsubsection{A2: Feature Volume Construction} Obtained the representation of each pixel, the next step is to compute the similarities between pixels. Since the volume input can be effective for the 3D convolutional computation, we transform the extracted features into a feature volume which contains the underlying group of pixels. Each element of the feature volume represents the feature for computation of the similarity between two pixels. Because input images have been rectified, we can simply employ a shift operation to form the feature volume. We set the output of the left sub-network as the base feature and the output from the right as the shift feature. The base feature is awaiting to be concatenating at the bottom, and the shift feature slides on the base feature. As depicted in Figure \ref{fig:volume}, the shift feature slides on base feature and concatenates with the base feature along feature channel. The mathematical definition is given by \begin{equation}F(d,h,w)=B(h,w)\oplus S(d,h,(w+d)\bmod w),\end{equation} where $B$ represents the base feature, $S$ denotes the shift feature and $\oplus$ indicates the concatenating operation. After packing the concatenating results, we get a 4D feature volume of $ D\times H/2\times W/2\times 2F $ size, where $D$ denotes the maximum disparity. \begin{table}[tbp] \scriptsize \caption{Architecture for cost computation. Each layer except layer 37 is followed by batch normalization and ReLU. Layer 33-37 are 3D-deconvolutional layers.} \centering \begin{tabular}{l|c|c} \hline Index &layer&output \\ \hline \hline input &Volume Construction&$1/2D\times 1/2H\times 1/2W\times 2F$\\ \hline 19 &$3\times 3\times 3\times 32$ stride 1&$1/2D\times 1/2H\times 1/2W\times F$ \\ \hline 20 &$3\times 3\times 3\times 32$ stride 1&$1/2D\times 1/2H\times 1/2W\times F$ \\ \hline 21 &$3\times 3\times 3\times 64$ stride 2&$1/4D\times 1/4H\times 1/4W\times 2F$ \\ \hline 22 &$3\times 3\times 3\times 64$ stride 1&$1/4D\times 1/4H\times 1/4W\times 2F$ \\ \hline 23 &$3\times 3\times 3\times 64$ stride 1&$1/4D\times 1/4H\times 1/4W\times 2F$ \\ \hline 24 &$3\times 3\times 3\times 64$ stride 2&$1/8D\times 1/8H\times 1/8W\times 2F$ \\ \hline 25 &$3\times 3\times 3\times 64$ stride 1&$1/8D\times 1/8H\times 1/8W\times 2F$ \\ \hline 26 &$3\times 3\times 3\times 64$ stride 1&$1/8D\times 1/8H\times 1/8W\times 2F$ \\ \hline 27 &$3\times 3\times 3\times 64$ stride 2&$1/16D\times 1/16H\times 1/16W\times 2F$ \\ \hline 28 &$3\times 3\times 3\times 64$ stride 1&$1/16D\times 1/16H\times 1/16W\times 2F$ \\ \hline 29 &$3\times 3\times 3\times 64$ stride 1&$1/16D\times 1/16H\times 1/16W\times 2F$ \\ \hline 30 &$3\times 3\times 3\times 128$ stride 2&$1/32D\times 1/32H\times 1/32W\times 4F$ \\ \hline 31 &$3\times 3\times 3\times 128$ stride 1&$1/32D\times 1/32H\times 1/32W\times 4F$ \\ \hline 32 &$3\times 3\times 3\times 128$ stride 1&$1/32D\times 1/32H\times 1/32W\times 4F$ \\ \hline 33 &$3\times 3\times 3\times 64$ &$1/16D\times 1/16H\times 1/16W\times 2F$ \\ & upsampling stride 2& add output of layer 29\\ \hline 34 &$3\times 3\times 3\times 64$ &$1/8D\times 1/8H\times 1/8W\times 2F$ \\ & upsampling stride 2& add output of layer 26\\ \hline 35 &$3\times 3\times 3\times 64$ &$1/4D\times 1/4H\times 1/4W\times 2F$ \\ & upsampling stride 2& add output of layer 23\\ \hline 36 &$3\times 3\times 3\times 32$ &$1/2D\times 1/2H\times 1/2W\times F$ \\ & upsampling stride 2& add output of layer 20\\ \hline 37 &$3\times 3\times 3\times 1 $ stride 1 &$D\times H\times W\times 1$ \\ \hline \hline \end{tabular} \label{tab:cost} \end{table} \subsubsection{A3: Similarity Computation} The matching cost is designed to compute the similarities of corresponding pixels. The key of cost computation is the similarity measurement between two pixels. As we have obtained the feature volume, we expect to learn a similarity measurement as \begin{equation}C=T(F),\end{equation} which is designed to transform the feature volume into a cost volume. Each element of the cost volume represents the similarity computed from the corresponding element of the feature volume. 3D convolutional networks are effective to take into account the context and geometry information and operate computation from the height, width and disparity three dimensions \cite{kendall2017end}. However, the 3D convolutional operation commonly suffers from the burden on both computational time and intermediate results storage. With the auto-encoder structure, the computational burden can be reduced by subsampling and upsampling operations. The illustration of the auto-encoder with 3D convolutional layers is presented in Figure \ref{fig:all}.A3 and layer setting is shown in Table \ref{tab:cost}. We apply four sub-sampling units as the encoder and four up-sampling units as the decoder. For the encoder, each sub-sampling unit consists of three 3D-convolution layers and the first convolution layer is applied with $ 2\times 2\times 2 $ stride. For the decoder, the up-sampling unit is realized by one 3D convolution layer with $ 2\times 2\times 2 $ stride, besides, the convolution output adds the same resolution feature map from the last layer of the corresponding sub-sampling unit in the encoder. Since we apply a sub-sampling in feature extraction, to reach the same resolution as the original image, we add an extra up-sampling unit with a single convolution layer. The final output of cost computation is a cost volume with size of $D,H,W$ and each element $C(d,h,w)$ in the volume indicates the matching cost between pixel $R(h,w) $ in the reference image and pixel $T(h,w-d)$ in the target image. \subsection{Cost Aggregation} The cost aggregation method is employed to rectify the mismatching cost value computed from the local feature according to the global view guidance. Besides, the cost aggregation can ensure a high-quality disparity map with smoothness and continuity. Through the matching cost computation, we get the initial cost volume $C_0(D, H, W) $. In general, the cost aggregation generates support regions on the cost volume by a statistic or dynamic similarity function. Obtained the regions, the aggregating can be formulated as the convolutional operation on the cost volume, which is expressed as \begin{equation}C(d,h,w)=W(d,h,w)\otimes C_0 (d,h,w),\end{equation} where $W$ represents filters and $\otimes$ indicates the convolutional operation. \begin{algorithm} \small \label{aggregation} \caption{Deep Cost Aggregation \LinesNumbered \KwIn{Initial Cost Volume $C_0(d,h,w)$\\ \qquad \quad Reference Image $I(h,w,3)$ \KwOut{Aggregated Cost Volume $C_a(d,h,w)$ $\backslash *$ Generation of proposals $* \backslash $\\ Step 1: Aggregation along depth dimension: $C_d(d,h,w,g)=C_0(d,h,w,1)\otimes F_d$ \; Step 2: Aggregation along height dimension $C_h(d,h,w,g)=C_d(d,h,w,g)\otimes F_h$ \; Step 3: Aggregation along width dimension $C_w(d,h,w,g)=C_h(d,h,w,g)\otimes F_w$ \; Step 4: Normalization of aggregation proposals $C_p(d,h,w,g)=C_w(d,h,w,g)\otimes F_0$ \; $\backslash *$ Extraction of Guidance for Cost Aggregation $* \backslash $\\ Step 5: $G_0(h,w,g)=I(h,w,3)\otimes F_0$\; Step 6: $G_1(h,w,g)=G_0(h,w,g)\otimes F_1$\; Step 7: $G_2(h,w,g)=G_1(h,w,g)\otimes F_2$\; $\backslash *$ Fusion and Selection $* \backslash $\\ Step 8: Fusing the two output from the two-stream netwok: \\$C_f=C_p(d,h,w,g) \odot G_2(h,w,g)$\\ Step 9: Choosing the best evaluated proposal: $C_a(d,h,w)=max\left \{ C_f(d,h,w,g)\right \}$ \end{algorithm} Compared with the traditional cost aggregation using hand-designed similarity measurement, we propose a learning-based cost aggregation using a two-stream network. The proposed cost aggregation can be directly employed on the initial cost volume and cooperate with the deep cost computation network in an end-to-end trainable manner. Instead of using the deep neural network as a black box, we present an explicit way to leverage the neural network. The cost aggregation is formulated as the selection of cost aggregation proposals, where proposals are potential cost aggregation results. As a result, the two-stream network is designed: one stream for generating the cost aggregation proposals, the other for selecting the best proposals. The proposal stream uses a 3D convolutional network to produce possible cost aggregation results. The results maintain the large receptive field and the rich semantic information transferred from cost computation. The guidance stream directly extracts information from the reference image with a 2D convolutional network. A light convolutional network is employed to extract the low-level structure information as the global view guidance for the selection. Many works on understanding deep neural networks \cite{mahendran2015understanding,zeiler2014visualizing} have found that features of the first several convolutional layers are rich in low-level structure information. In contrast, the features from the last several layers have strong high-level semantic information. Both the structure and semantic information is crucial for the cost aggregation. The proposal stream maintains the semantic information, while the guidance stream brings into structure information. The rich semantic information is implicit in the generated proposals, and the structure information is used as global view guidance to evaluate each proposal. The cost aggregation is explicitly carried out by the fusion of these two streams. The details of our two-stream network will be discussed in the following two sub-sections. \subsubsection{B1: Proposal Sub-network} The proposal stream is designed to generate the possible cost aggregation results by aggregating matching cost values along the height, width, and depth three dimensions. The aggregating operation is implemented by a 3D convolutional network with rectangle filters. The 3D convolutional network maintains the large view field from the previous cost computation step. The structure of the proposal sub-network is illustrated in Figure \ref{fig:all}.B2. Three 3D convolutional layers are adopted to the initial cost volume. We first use $3\times 1 \times 1$ convolutional filters to aggregate the cost values along the depth dimension, then employ $1\times 3\times 1$ and $1\times 1\times 3$ filters along the height and width dimensions. The rectangle convolutional filters are used to simulate the cost value aggregation process along different dimensions. Compared with the general square filters, the rectangle filter can run in a more explicit manner to aggregate information along different dimensions while actively reduce the computational burden for the 3D convolutional operation. Finally, a convolutional layer with $1\times 1\times 1$ filter is employed to summarize the potential cost aggregation results into $G$ potential aggregation proposals with the size of $D\times H\times W\times G $, where $G$ represents the number of cost aggregation proposals. The operation along one dimension can be expressed as \begin{equation}C(d,h,w)=F_i(d,h,w)\otimes C_0 (d,h,w),\end{equation} where $F$ represents the rectangle filters, $i$ donates the convolutional direction, and $\otimes$ indicates the convolutional operation. \subsubsection{B2: Guidance Stream} Since proposals are computed from features of the last layer which has strong semantic information but lacks low-level structure information. The guidance stream is designed to introduce the structure information as the global view guidance to the selection of proposals. It can extract structure information from the reference image to evaluate the generated proposals. As shown in Figure \ref{fig:all}.B1, we employ 2D convolutional network on the reference image to extract the low-level structure information. The convolutional filter is set from $5\times 5$ to $3\times 3$ which can equip the structure information with a large field of view. Moreover, a final $1\times 1$ filter is employed to summarize the guidance to the size of $H\times W\times G $ corresponding to the generated proposals. Furthermore, the guidance is converted into probability value using the softmax method along the dimension of $G$, which ensures that the sum of the evaluation of the proposals is 1. Since we hypothesize the guidance for cost aggregation at different disparities is unchanged, the computed probability value can be treated as the evaluation for different aggregation proposals. The guidance $G_{2}(H,W,i)$ is used as the evaluation for the proposal $C_{a}(D,H,W,i)$. In the end, the selection of proposals is achieved by a fusion scheme. The fusion uses the guidance to evaluate the proposals and choose the best evaluation of the fusion results to form the aggregated cost volume. The global view guidance evaluates its corresponding aggregation proposal by a matrix multiplication in a broadcasting manner. The evaluation for each proposal is based on the structure information of the whole reference image so the guidance for the selection is global view. The aggregated cost volume can be obtained by selecting the maximum value along the dimension of $G$. The fusion scheme is indicated as \begin{equation}C_a(d,h,w)=max\left \{ C_p(d,h,w,g)*C_g(h,w,g) \right \},\end{equation} where $C_p$ are proposals, $C_g$ represents the guidance, $*$ donates the matrix multiplication and $max$ indicates the maximum function. The process of conducting the cost aggregation algorithm is shown in Algorithm 1. \subsection{C: Disparity computation} The aggregated cost volume will be transformed into disparity through a soft-argmin function similar to \cite{kendall2017end} which can retain a sub-pixel disparity accuracy. The matching cost value is converted into probability value by a softmax function along the dimension of depth. The final disparity is obtained by the weighted sum of the probability, where the weights are the corresponding depth value $d$. The mathematical equation is given by \begin{equation}D(h,w)=\sum _{d=0}^{D_{max}}d\times\sigma (-C_a(d,h,w)),\end{equation} where $\sigma$ donates the softmax function, $C_a$ is the aggregated cost volume and d is the disparity. Compared with the traditional WTA strategy, the soft-argmin function can enable the computed disparity influenced by the cost value of all disparity. Therefore, a better smoothness and sub-pixel level accuracy can be obtained. Besides, the soft-argmin is fully differentiable, which ensures that the training can be carried out using back-propagation. We train the model using the $\ell_1$ error between the ground truth and the predicted disparity. The supervised loss is defined as \begin{equation}Loss=\sum_h \sum_w \left \| D_a(h,w)-D_g (h,w)\right \|_1 ,\end{equation} where $\| \cdot \|_1$ donates the $\ell_1$ norm, $D_g$ is the ground truth disparity map and $D_a$ represents the predicted disparity map. \section{Experimental Results} We evaluate our method on three datasets, including Scene Flow \cite{mayer2016large}, KITTI2015 \cite{menze2015object} and KITTI2012 \cite{geiger2012we}. We especially compare our method with the state-of-the-art GC-Net \cite{kendall2017end} to demonstrate the effectiveness of the learning-based cost aggregation. Our architecture is implemented by the Tensoflow \cite{abadi2016tensorflow} with a standard RMSProp \cite{tieleman2012lecture} and a constant learning rate of 0.0001. We train the network on the Scene Flow dataset from a random initialization with shuffled orders. The training takes 23h after 300K iterations on a single NVIDIA 1080Ti GPU. For the KITTI dataset, we fine-tune the model pre-trained on Scene Flow dataset with 70k iterations. Limited by the computation resource, we sub-sample all data by four times using the bilinear interpolation. \begin{table}[tbp] \caption{Comparisons on Scene Flow} \centering \scriptsize \begin{tabular}{l|c|c|c|c} \hline Model &error $>$ 1px &error $>$ 3 px &MAE(px) &T(ms)\\ \hline \hline GC-Net &11.3 & 7.2&2.21&0.95\\ \hline Without guidance&12.3 &7.2&2.15&0.93\\ Without proposal&10.81 &6.8&1.83&0.85\\ Without aggregation&13.8 &7.5&2.71&0.95\\ \textbf{Our model}&\textbf{8.93}&\textbf{5.62}&\textbf{1.75}&\textbf{1.12}\\ \hline \end{tabular} \label{scene} \end{table} \begin{table}[tbp] \tiny \caption{Comparisons on KITTI2012} \centering \begin{tabular}{l|c|c|c|c|c|c|c} \hline Model &\multicolumn{2}{|c|}{$>$2px } &\multicolumn{2}{|c|}{$>5$ px}&\multicolumn{2}{|c|}{Mean Error }&T(s)\\ &Non-Occ&All&Non-Occ&All&Non-Occ&All&\\ \hline \hline PSMNet&\textbf{ 2.62} & \textbf{3.24} & \textbf{0.94} & \textbf{1.20}&\textbf{0.5}&\textbf{0.6}&1.3\\ GC-Net& 2.71 & 3.46 & 1.77 & 2.30&0.6&0.7&0.9\\ SegStereo& 3.24 & 3.82 & 1.10 & 1.35&0.6&0.6&0.6\\ Displets v2&3.43 & 4.46 &1.72 & \textbf{2.17}&0.7&0.8&265\\ L-ResMatch &3.64 & 5.06 &\textbf{1.50 } & 2.26&0.7&1.0&48\\ MC-CNN &3.90 & 5.45 &1.64 & 2.39&0.7&0.9&67\\ CATN &8.11 & 9.44 &3.31 & 4.07&1.1&1.2&10\\ S+GF &14.72 & 16.76 &5.53 & 7.79&2.1&3.4&140\\ \hline Our model&2.68 &3.42 &1.63&2.23&0.6&0.7&1.13\\ \hline \end{tabular} \label{kitti2012} \end{table} \begin{table}[tbp] \centering \caption{Comparisons on KITTI2015} \tiny \begin{tabular}{l|c|c|c|c|c|c|c} \hline Model &\multicolumn{3}{|c|}{All pixels} &\multicolumn{3}{|c|}{Non-Occluded Pixels}&Time(s)\\ &D1-bg& D1-fg& D1-all& D1-bg& D1-fg &D1-all&\\ \hline \hline PSMNet &\textbf{1.97 }&4.41 &\textbf{2.38}&\textbf{1.81}&4.00&\textbf{2.17}&1.3\\ SegStereo &2.16 &\textbf{4.02} &2.47&2.01&\textbf{3.62}&2.28&\textbf{0.6}\\ GC-Net &2.21 &6.16 &2.87&2.02&5.58&2.61&0.9\\ MC-CNN&2.89 &8.88 &3.89&2.48&7.64&3.33&67\\ Displetv v2&3.00 &5.56 &3.43&2.73&4.95&3.09&265\\ DRR&2.58 &6.04 &3.16&2.34&4.87&2.76&0.4\\ L-ResMatch&2.72 &6.95 &3.42&2.35&5.74&2.91&48\\ 3DMST&3.36 &13.03 &4.97&3.03&12.11&4.53&93\\ \hline Our model&2.17 &5.46 &2.79&2.06&5.32&2.32&1.13\\ \hline \end{tabular} \label{kitti2015} \end{table} \subsection{Benchmark results} Scene Flow is a synthetic data set for stereo matching which contains $35454$ training and $4370$ testing image pairs. Synthetic dataset ensures dense ground truth without inaccurate labels and is large enough to train a complex network without over-fitting. In Table \ref{scene}, we evaluate our method and GC-Net on the Scene Flow dataset. We observe that our method outperforms GC-Net among all pixel errors and the RMS error. In addition, to demonstrate the effectiveness of each stream of our network, we evaluate the network with different settings. From Table \ref{scene}, we can see the guidance stream is crucial to improving the performance, which demonstrates the structure information can be used as global view guidance to improve the accuracy. The KITTI benchmark consists of challenging and complex road scene collected from a moving vehicle. The ground truth of disparity image is obtained from LIDAR data. The KITTI 2012 dataset contains $192$ training and $195$ testing images, and the KITTI 2015 dataset contains $200$ training and $200$ testing images. In the Table \ref{kitti2012}, the comparisons on KITTI2012 with deep stereo methods such as GC-net \cite{kendall2017end}, Displets v2 \cite{guney2015displets}, L-ResMatch \cite{shaked2016improved} and MC-CNN \cite{zbontar2015computing} are shown, besides, the comparisons with other cost aggregation methods including CAT \cite{ha2014cost} and S+GF \cite{zhang2014cross} are also illustrated in Table \ref{kitti2015}, the leaderboard on KITTI2015 compares our method with GC-Net \cite{kendall2017end}, MC-CNN \cite{zbontar2016stereo}, Displetv v2 \cite{guney2015displets}, DRR \cite{gidaris2016detect}, L-ResMatch \cite{shaked2016improved} and 3DMST \cite{li20173d}. Our method outperforms previous works which use a hand-designed aggregation method or ignoring the aggregation step. It can be inferred that the usage of learning-based cost aggregation method can improve the performance of the deep stereo matching. \subsection{Sub-architecture Analysis} To demonstrate the effectiveness of the learning-based cost aggregation, we visualize the guidance obtained from the guidance stream in this section. According to the visualization of the Figure \ref{fig:visual}, we can infer that the guidance stream can obtain the structure information from reference image which can select the aggregation proposal with a global view. The visualized feature map of guidance sub-network is realized by averaging the output of the guidance stream along the dimension $G$. We can obviously see the guidance contains low-level structure information, which demonstrates that the two-stream network can introduce structure information as the global view guidance for the selection of proposals. \begin{figure} \centering \includegraphics[width=8.3cm]{visual.pdf} \caption{The visualization of our experimental results. From top to bottom, images are the reference image, ground-truth disparity map, predicted disparity map, error map and the visualization of the output from our guidance stream, respectively. The visualization of the guidance stream shows that it exactly extracts structure information. } \label{fig:visual} \end{figure} \section{Conclusion} In this paper, we have proposed a learning-based cost aggregation for stereo matching. The learning-based cost aggregation can be embedded into the deep stereo matching solution in an end-to-end manner. With this end-to-end trainable manner, our cost aggregation achieved a higher accuracy by effectively collaborating with the deep cost computation methods. According to the analysis of the two-stream network, we demonstrated that the low-level structure information can be used as global view guidance for selection of the proposals of the rich semantic information. Furthermore, the proposed two-stream network had the potential ability for feature fusion works such as motion recognition and scene understanding. The experiment results have demonstrated the good ability of our explicit architecture for stereo matching. \section{Acknowledgement} This work was supported in part by the Natural Science Foundation of China (NSFC) under Grants No. 61773062 and No. 61702037. \bibliographystyle{aaai}
\section{Introduction} Turbulent convection is the mechanism that efficiently transports energy through the outermost 30\% of the solar radius, and is responsible for the formation of space- and time-coherent structures observed at scales from granular \citep[see, e.g., ][and references therein]{1999A&A...344L..29B, 1999A&A...344L..33C, 2002A&A...381..253B, 2004SoPh..221...33B, 2004A&A...428.1007D, 2006A&A...451.1081N, 2007ApJ...666L.137C} to mesogranular \citep[see, e.g., ][]{1980PhDT.........3N, 1998A&A...330.1136R, 2005ApJ...632..677B, 2011ApJ...727L..30Y, 2013SoPh..282..379B} and supergranular \citep[see, e.g., ][]{1956MNRAS.116...38H, 1964ApJ...140.1120S, 2004SoPh..221...33B, 2004SoPh..221...23D, 2008ApJ...684.1469D, 2012ApJ...758L..38O, 2013ApJ...770L..36G, 2014ApJ...788..137G, 2014A&A...569A.121G, 2014ApJ...797...49G, 2014A&A...568A.102B, 2014A&A...561L...6S, 2016ApJ...820...35G}. Actually, the photospheric features observed on the Sun are the result of the action of turbulent convection and its complex non-linear interaction with the magnetic fields amplified and emerging from the convective region. This interaction deeply affects the solar activity, and is often invoked to be the basis of those physical processes that trigger the energy transfer in and to the upper layers of the solar atmosphere, such as magnetic reconnections \citep[][]{1957JGR....62..509P, 1988ApJ...330..474P}, which may originate nanoflares \citep[see, e.g., ][]{2006ApJ...652.1734V}, and the excitation of acoustic \citep[see, e.g.,][]{2006ApJ...648L.151J, 2014CEAB...38...53S} and magnetohydrodynamic (MHD) waves \citep[see, e.g., ][and references therein]{1947MNRAS.107..211A, 2007Sci...318.1574D, 2007Sci...317.1192T, 2014A&A...569A.102S, 2015A&A...577A..17S, 2017NatSR...743147S, 0004-637X-840-1-19}. Nevertheless, despite the efforts, the physics of high Rayleigh number ($Ra$) turbulent convection has major open issues and is still being largely debated \citep[see, e.g., ][]{Xiaozhou2012}. Actually, values higher than $Ra\sim10^{17}$ cannot be reached in laboratory experiments \citep[e.g., ][]{2000Nature...404N}, while for solar convection $Ra\sim10^{19}-10^{24}$ are expected \citep{2012PNAS..10911928H}. The inherent difficulty in describing a complex system like the magnetised and highly turbulent photospheric plasma, means that it is still not possible to formulate a complete and extensive theory of solar convection on all scales, from sub-granular to global. To address this problem, three different approaches have been proposed in the last decades: i) MHD simulations, ii) tracking of small-scale magnetic fields (magnetic elements), and iii) statistical study of the emerging patterns on different space and time scales. Magnetohydrodynamic simulations have been widely used in the last twenty years to reproduce all the features observed in the solar photosphere, such as granulation and the emerging of both small- and large-scale magnetic fields \citep[see, e.g., ][]{1997ASSL..225...79N, 1998ApJ...499..914S, 2001ApJ...546..585S, 2003ApJ...588.1183C, 2005A&A...429..335V, 2009Sci...325..171R, 2012A&A...539A.121B, 2015A&A...574A..28D}. As a result, MHD simulations were successful in mimicking accurately limited regions, in volume and time, of the convection zone. However, despite their capability to match the observations in a very realistic way, at present they cannot simulate simultaneously the wide range of spatial and temporal scales involved in the solar photosphere, from sub-granular to global, due to intrinsic limitations of currently available computing power. Some inherent aspects of turbulent convection related to advection/diffusion, magnetic flux concentration and organisation on different spatial and temporal scales can be alternatively investigated by tracking bright features (possibly related to magnetic elements) in G-band images \citep[see, e.g., ][]{1998ApJ...506..439B, 1998ApJ...509..918C, 1999ApJ...521..844C, 2001PhRvL..86.5894L, 2010ApJ...715L..26S, 2011ApJ...743..133A, 2012ApJ...759L..17L, 2015RAA....15..569Y, 2015ApJ...810..2Y} or magnetic elements in magnetograms \citep[see, e.g., ][]{1988SoPh..116....1W, 1999ApJ...511..932H, 2011A&A...531L...9M, 2013ApJ...770L..36G, 2014ApJ...788..137G, 2014A&A...569A.121G, 2014A&A...566A..99K, Caroli2015, 2016A&A...590A.121R, 2016arXiv160502533I}, and possibly comparing the results with those expected from simulations obtained with simplified advection/diffusion processes \citep[see, e.g., ][]{2015A&A...576A..47D}. The accuracy of this approach is based on the hypothesis that magnetic elements are passively transported across the solar photosphere by the plasma flow, so that their motion reveals the physical properties of the underlying velocity field. The statistical analysis of long-time duration data can allow us to probe the structure of photospheric and sub-photospheric plasma flows and magnetic field distribution at different spatial and temporal scales. This can be approached, for example, via the investigation of emerging correlations and the detection of coherent patterns \citep[see, e.g., ][]{2002A&A...382L...5G, 2002A&A...392L..13R, 2006SoPh..239...93G, 2008SoPh..249..307B}. By following approach iii), in this work we investigate spatial and temporal correlations of the photospheric magnetic field in the quiet Sun taking advantage of an unprecedented magnetogram time series acquired on 2 November 2010 with the SOT telescope on board Hinode \citep{2007SoPh..243....3K, 2008SoPh..249..167T} and targeted at the disc centre. The paper is organised as follows: in \S2 we present the data set used and describe the methods applied to perform the analyses; in \S3 we show the results obtained; in \S4 we discuss the results in light of the existing literature; and in \S5 we summarise the main aspects pointed out in this work and draw our conclusions. \section{Observation and data analysis} \subsection{The 24-hour Hinode data set} The data set used in this work was described exhaustively in \citet{Milan}, and previously analysed by \citet{2013ApJ...770L..36G, 2014ApJ...788..137G, 2014A&A...569A.121G} and \citet{Caroli2015} to perform their studies on the diffusion by turbulent convection of small-scale magnetic fields in the quiet Sun over a wide range of spatial and temporal scales, from granular to supergranular. It consists of a series of $959$ magnetograms acquired by Hinode SOT \citep{2007SoPh..243....3K, 2008SoPh..249..167T} with a field of view (FoV) of $\sim50$ Mm, a spatial resolution of $\sim0".3$, and a noise level - computed as the rms value in a sub-field of view (sub-FoV) free of magnetic signal convolved with a $3\times3$ spatial kernel - of $\sigma_N\simeq4$ G for single magnetograms. The series was filtered for oscillations at $3.3$ mHz \citep{Milan} in order to remove the effect of acoustic oscillations. We note that our observations are also free from any seeing effect. Particularly interesting, the large FoV contains an entire supergranule. This, together with the high spatial resolution and the absence of seeing, makes the data set very suitable for studying the evolution and structure of the quiet Sun as a consequence of the plasma dynamics induced by turbulent convection. Moreover, the series of data, acquired on 2 November 2010, spans 24 hours without interruption, with a cadence of $90$ s. \begin{figure}[ht!] \centering \includegraphics[width=10cm]{mean_Mag_frame.pdf} \caption{Mean magnetogram of the FoV averaged over $\sim24$ hours, the whole time range of the series.} \label{Fig.mean_B_Frame} \end{figure} In Fig.\ref{Fig.mean_B_Frame} we show the signed mean magnetogram averaged over $\sim24$ hours. The boundaries of the supergranular cell are clearly visible, and also outlined by the horizontal velocity maps obtained via the application of the {\it Fast Local Correlation Technique} (FLCT) described in \citet{2008ASPC..383..373F} and shown in the bottom panels of Figure \ref{Fig.maps} \citep[see also Figures 1a and 1b in][]{2014ApJ...788..137G}. The horizontal velocity field is mainly radial and directed from the central regions to the boundaries of the supergranular cell, with the velocity strength ranging from $\sim0.1$ to $\sim0.6$ kms$^{-1}$ moving outward. \subsection{Occurrence and persistence of magnetic features} In what follows, we indicate with $\Phi$ the unsigned magnetic flux density strength. \subsubsection{Occurrence} For any pixel $(x,y)$ of the FoV, we defined the {\it occurrence}, $R_{xy}$, as the number of frames in which that pixel hosted a magnetic feature with strength $\Phi_{xy}$ above a magnetic threshold $\Phi_T$, i.e. the number of times that the condition $\Phi_{xy}>\Phi_T$ is fulfilled. According to this definition, $R_{xy}$ is a measure of the tendency of a specific site to host magnetic features. The occurrence of magnetic features was investigated by performing a numerical binarisation of each image of the time series. This was obtained by setting to unity all pixels with a magnetic flux strength above $\Phi_T=13$ G, zero elsewhere. The threshold $\Phi_T$ corresponds to two values. The first is the magnetic flux strength at which the flux strength probability distribution function (PDF) departs from a semi-Gaussian shape with standard deviation $s$, namely $g(\Phi,s)$, representative of the noise \begin{equation} g(\Phi,s)=\frac{\sqrt{2}}{s\sqrt{\pi}}exp\left(-\frac{\Phi^2}{2s^2}\right) \qquad \Phi\ge0. \label{Eq.Semi-G} \end{equation} This threshold is defined as \citep{CeD2002} \begin{equation} \Phi_T=\frac{\int_0^\infty\Phi g(\Phi,s) r(\Phi,s)d\Phi}{\int_0^\infty g(\Phi,s) r(\Phi,s)d\Phi}, \end{equation} where $r(\Phi,s)$ is the residual distribution obtained as the difference between the observed PDF and $g(\Phi,s)$ (see Figure \ref{Fig.PDF_B}). The second is the commonly used threshold of three times the magnetogram noise, $3\cdot\sigma_N$. \\ Due to both i) and ii) the threshold $\Phi_T$ represents a robust value (with a probability over $99.7\%$) to discern between magnetic features and noise. \begin{figure}[h!] \centering \includegraphics[width=8cm]{PDF_B.pdf} \caption{Flux strength probability distribution function, $PDF(\Phi)$, obtained by considering all the frames in the magnetogram time series (black dots).The blue line corresponds to a semi-Gaussian fitting model, the red line to the residual. The threshold value of $\Phi_T=13$ G is marked by a vertical dashed line.} \label{Fig.PDF_B} \end{figure} The sum of binarised images normalised to their total number and expressed in percentage provided the {\it normalised occurrence}, $O_{xy}$, which can be defined pixel-by-pixel as \begin{equation} O_{xy}=\frac{R_{xy}}{N}\cdot100, \end{equation} where $N$ is the number of magnetograms included in the time series. We note that with respect to $R_{xy}$, $O_{xy}$ provides a normalised value in the range $[0,1]$ for all possible magnetogram series. For practical purposes, we refer to occurrence as the quantity $O_{xy}$ throughout the text. \subsubsection{Persistence} For any pixel in the FoV we defined the {\it persistence} as the time range, $t_D$, over which the magnetic flux is still autocorrelated. According to this definition, $t_D$ represents the characteristic time range during which {\it the same} magnetic features linger in a specific location. In order to study the pixel-by-pixel persistence in the magnetogram time series and estimate $t_D$ we proceeded as follows. For any time step and correlation time $(t, t_C)$ in the range $0<(t, t_C)\le (N-1)\Delta t$, being $\Delta t$ the time cadence of observations, we computed the correlation Pearson coefficient in order to obtain the auto correlation function \citep[ACF, see, e.g., ][]{1986nras.book.....P} \begin{equation} ACF_{xy}=\frac{cov(\Phi_{xy}(t),\Phi_{xy}(t+t_C))}{\sigma^2_{xy}}, \label{Eq.rho} \end{equation} being $\sigma^2_{xy}$ the variance of $\Phi_{xy}(t)$, namely \begin{equation} \sigma^2_{xy}=\overline{(\Phi_{xy}(t)-\bar{\Phi}_{xy})^2}, \label{Eq.sigmas} \end{equation} and \begin{equation} cov(\Phi_{xy}(t),\Phi_{xy}(t+t_C))=\left\langle (\Phi_{xy}(t)-\bar{\Phi}_{xy})(\Phi_{xy}(t+t_C)-\bar{\Phi}_{xy})\right\rangle, \label{Eq.cov} \end{equation} where in equations \ref{Eq.sigmas} and \ref{Eq.cov} the overbar stands for the mean value and the brackets $\langle...\rangle$ correspond to an ensemble average over all the pairs of the time series $\Phi_{xy}(t)$ separated by $t_C$. The ACFs computed via equations \ref{Eq.rho}-\ref{Eq.cov} peak at $t_C=0$ (where ACF is unity) and then decrease to zero in a characteristic time which is longer where the magnetic flux change is slower. For each pixel of the FoV, we estimated this decorrelation time, $t_D$, as the time at which the ACF decreases from unity to the quantity $1/e$. We note that $t_D$ is univocally defined, as there is only one time at which $ACF=1/e$. In fact, for $t>t_D$ the ACF decreases and oscillates around zero with amplitude well below $1/e$. \section{Results} \label{Sec.Results} \begin{figure*}[ht!] \centering \includegraphics[width=9cm]{BinarM13.pdf} \includegraphics[width=9cm]{Summed959_M13_Norm.pdf} \includegraphics[width=9cm]{DecMap1M.pdf} \includegraphics[width=9cm]{Ranges.pdf} \includegraphics[width=9cm]{LowOcc+Hvel.pdf} \includegraphics[width=9cm]{Hvel+Hvel+LowOcc+Dec.pdf} \caption{{\it Top left}: Binarisation map of the first magnetogram of the series, i.e. acquired at 08:00:42 UT. Pixels in white are those with magnetic flux density $\Phi\ge\Phi_T=13$ G. {\it Top right}: Occurrence map of the FoV. {\it Middle left}: Map of decorrelation times. {\it Middle right}: Map of the different regions identified in Figure \ref{Fig.Regions} in red, yellow, blue, and green (see text) superimposed on the occurrence map. {\it Bottom left}: Horizontal velocity field (gold arrows) computed with FLCT \citep{2008ASPC..383..373F} superimposed to the occurrence map. The red filled circles mark the locations with the lowest occurrences ($\le5\%$). {\it Bottom right}: Horizontal velocity strength map (grey scale). The decorrelation times map for $t_D>20$ min is superimposed with the same color code as in the middle left panel. The green filled circles mark the locations with the lowest occurrences ($\le5\%$).} \label{Fig.maps} \end{figure*} In the top left panel of Figure \ref{Fig.maps} we show the results of binarisation applied to the first magnetogram of the series. The white areas in the figure correspond to regions with magnetic flux density $\Phi\ge\Phi_T$. The largest areas that are correlated are recognisable as the boundaries of the supegranular cell. The top right panel of the same figure shows the occurrence map obtained by considering the whole data set. An occurrence greater than $95\%$ is found in just $266$ pixels (corresponding to $\sim0.1\%$ of the FoV), each located at a vertex of the supergranular cell. In the supergranular boundary, the occurrence always exceeds $\sim35-40\%$, while values of a small percent are found near the centre of the supergranular cell and in those regions of the FoV that probably correspond to the innermost parts of the adjacent supergranules \citep[bottom panels of Figure \ref{Fig.maps} and][]{Milan, 2016ApJ...820...35G}. In the upper panel of Figure \ref{Fig.PDF_Occurrence} we show the PDF of occurrence, which this time was expressed in hours instead of percentage in order to easily identify possible characteristic time scales. A peak is observed between $2.5$ and $5$ hours (red region in the figure), where the probability is $\simeq0.5\%$. Then the PDF smoothly decreases to $\simeq8$ hours. A small secondary peak is observed between $8$ and $10$ hours (yellow region in the figure), where the probability increases to $\simeq0.12\%$. After a slight decrease a last minor peak is observed between $12$ and $15$ hours (blue region in the figure), where the probability increases to $\simeq0.06\%$. Then the PDF slowly converges to zero. The region between $20$ and $24$ hours is in green in the figure. The lower panel of Figure \ref{Fig.PDF_Occurrence} shows the cumulative distribution of occurrence. About $50\%$ of the pixels in the FoV have occurrences below $\simeq5$ hours, thus lying on the left of the main peak, while only $\simeq0.8\%$ of pixels have occurrences above $20$ hours. \begin{figure}[ht!] \centering \includegraphics[width=8cm]{PDF_Occurrence.pdf} \caption{{\it Upper panel}: PDF of occurrence. The different colours highlight different features in the distribution, corresponding to the main peak (red), two minor peaks (yellow and blue), and the most 'extreme' events (green). {\it Lower panel}: Cumulative distribution of occurrence.} \label{Fig.PDF_Occurrence} \end{figure} The occurrence map gives statistical information on the sites hosting magnetic elements with $\Phi\ge\Phi_T$, and indicates where magnetic elements are likely to be found in the FoV over the whole time range spanned in our observations. Complementary information is provided by the characteristic time over which each pixel in the FoV hosts correlated magnetic elements, i.e. the persistence of magnetic elements at any location. In the middle left panel of Figure \ref{Fig.maps} we show the map of pixel-by-pixel decorrelation times, $t_D$, for the magnetogram time series, which was computed as the time at which the ACF drops by a factor $1/e$. As we can see, $t_D$ spans the range between $\simeq30$ and $\simeq240$ minutes in the supergranular boundary. Inside the supergranule, the decorrelation time map shows dark regions where $t_D$ is a few minutes at most, together with enhanced patterns where $t_D$ is typically $\simeq30-50$ minutes, and a few peaks characterised by a $t_D\simeq80$ minutes. In the remaining part of the FoV, alternating bright and dark structures are observed, with values of $t_D$ ranging from zero up to $\sim100$ minutes, the latter occurring in correspondence with local maxima in the spatial distribution of magnetic flux (the most evident is at location [$X=26$, $Y=3$ arcsec] in the FoV). \begin{figure*}[ht!] \centering \includegraphics[width=12cm]{Regimes.pdf} \begin{picture}(0,0) \put(-300,124){\includegraphics[height=3.4cm,width=5.3cm]{LocalSlope3.pdf}} \end{picture} \caption{Scatter plot between occurrence (in percentage) and the average decorrelation time (in minutes) in bins of occurrence $\sim1\%$ wide (corresponding to $10$ frames). The different colours and the vertical dashed lines separate different regimes in the plot. The solid line corresponds to the best fit of data from a polygonal model up to an occurrence of $65\%$. In the top left inset: local slope of data points as a function of occurrence. The different regimes detected correspond to nearly constant slopes of $0.77$ (in red), $1.10$ (in orange), and $1.44$ (in blue).} \label{Fig.Regions} \end{figure*} The top right and middle left panels of Figure \ref{Fig.maps} show similar features underlining the boundary of the supergranular cell. Longer $t_D$ are necessarily associated with higher occurrences, conversely higher occurrences do not imply longer $t_D$. We investigated the relation between occurrence and persistence in the FoV by means of conditioned statistics. In Figure \ref{Fig.Regions} we show the scatter plot between occurrence (in percentage) and the average $t_D$ (in minutes) in bins of occurrence $\sim1\%$-wide (corresponding to $10$ frames). Two different guess functions were used to best fit the data, a fourth-order polynomial function, and a polygonal piecewise linear function. The most suitable number of change points of the polygonal function was evaluated via the local slope of $t_D$ as a function of the occurrence, which was computed by performing a linear fit of $t_D$ on a nine-point mobile window centred on each occurrence (top left inset in Figure \ref{Fig.Regions}). The best number of change points we identified is three, and corresponds to the number of ranges in occurrence within which the local slope changes substantially. An automated procedure based on the minimisation of $\chi^2$ over a mobile window selected the polygonal function (solid black line in Figure \ref{Fig.Regions}) as the best to fit the data. In fact, we found a reduced $\chi^2=0.19$ for the polygonal function, and $\chi^2=0.44$ for the fourth-order polynomial function, respectively. The automated procedure also provided the values of the change points at occurrences $17\%$, $43\%$, and $65\%$ (marked by vertical dashed lines in the same figure). These change points separate different regimes, which are characterised by different local slopes and highlighted with different colours in Figure \ref{Fig.Regions} for the sake of clarity. It is possible that another regime may emerge at even higher occurrences ($>65\%$), but the lack of statistics there prevented us from suitably estimating the fit parameters. For occurrences above $60\%$, the computation of the local slope is also heavily affected by statistical effects, and thus is not considered reliable. For occurrences $\lesssim60\%$, the behaviour of the local slope suggests the presence of different dynamic regimes, characterised by quasi-constant values of the derivative (at least in the occurrence ranges $\leq17\%$ and $17\%-43\%$) and separated by transition regions where the derivative is subjected to steeper variations. The different regimes correspond to quasi-constant slopes (dashed horizontal lines in the inset) of $0.77$ (in red), $1.10$ (in orange), and possibly $1.44$ (in blue) being the change points located, as expected, in the middle of the transitions and in correspondence with the vertical dashed lines. We note that if data were best modelled by a single and smoother function instead of a polygonal one, the local slope should increase monotonically and not show the piecewise linear trend visible in the inset of Figure \ref{Fig.Regions}. This supports the existence of different regimes to which magnetic elements in the quiet Sun are subjected. A completely separated population of points is shown in green in the same figure. These points, together with those belonging to the three different regimes found, may be localised in the FoV. The results are shown in the middle right panel of Figure \ref{Fig.maps}, where the colour-code used is the same as in Figure \ref{Fig.Regions}, and roughly corresponds to the different regions found in the PDF shown in the upper panel of Figure \ref{Fig.PDF_Occurrence}. In moving from the inner regions of the supergranule to the boundaries, the relation between occurrence and $t_D$ steepens. This increase is broken in the vertices of the supergranule, where a decrease in $t_D$ is observed even though the occurrence reaches its maximum values. \section{Discussion} The flux enhancements in the mean magnetogram of Figure \ref{Fig.mean_B_Frame} underline the largest and longest observed scales of organisation of magnetic elements, which obey a dynamical regime that is different in the supergranular boundary with respect to the intranetwork regions \citep{2014ApJ...788..137G}. Such enhancements may be due to recurrent and/or persistent magnetic elements, rather than magnetic elements with very high magnetic strength and short lifetime. In fact, only a small fraction of the FoV has been found to be covered by magnetic flux strengths above the equipartition value, and in any case such strong flux locations host the longest-lived magnetic elements \citep{2013ApJ...770L..36G}. Further constraints on the magnetic flux evolution up to supergranular scales may be given in terms of the statistical analysis of occurrence and persistence patterns. In particular, high occurrence values point out the presence of preferred sites hosting magnetic elements, while a high persistence points out the tendency of a site to host the {\it same} magnetic elements, or more precisely the same magnetic flux amount. As we can see from the occurrence map (top right panel of Figure \ref{Fig.maps}), the highest values of occurrence are found in the vertices of the supergranular cell where the strongest magnetic fluxes are observed in correspondence with the longest-lived magnetic elements \citep{2013ApJ...770L..36G}. On the other hand, the lowest occurrences ($\le5\%$, represented as red and green filled circles in the bottom left and right panels of Figure \ref{Fig.maps}, respectively) are found in the central region of the supergranule and of adjacent supergranules \citep{Milan, 2016ApJ...820...35G} where the horizontal velocity as computed by FLCT \citep[][]{2008ASPC..383..373F} is in the range $0.1-0.25$ kms$^{-1}$. This provides information on the evolution of magnetic flux in supergranular environments. In fact, if magnetic flux above the detection threshold $\Phi_T$ emerged preferentially in the central regions of the supergranule and then was advected to the cell's boundaries, a high occurrence at the centre should be observed. The higher the occurrence, the faster the emergence rate. Moreover, due to the slow horizontal velocity field, the central regions of the supergranule should also be characterised by longer persistence. This is not the case, thus the magnetic flux above the detection threshold should emerge in the outer regions of the supergranular cell, as also argued by e.g. \citet{2014A&A...561L...6S} and \citet{2014ApJ...788..137G}, and be quickly advected to the boundaries by the horizontal velocity field, which in these regions reaches $\simeq0.6$ kms$^{-1}$. When looking at an enhanced-contrast version of the occurrence map (not shown here), we notice the presence of quasi-radial white features inside the supergranule that resemble those observed by \citet{2014ApJ...788..137G} in the deep magnetogram shown in Figure 1d; they are separated by regions in which the occurrence is $\lesssim10\%$. These features indicate that the occurrence of magnetic elements is not uniform even inside the supergranular cell, being enhanced in preferred sites which represent paths statistically more traveled than others by magnetic elements. The PDF of occurrence, obtained by considering only the pixels in which the magnetic flux strength is $\Phi>\Phi_T$ and shown in the upper panel of Figure \ref{Fig.PDF_Occurrence}, suggests the emergence of a characteristic time scale at $\simeq3-4$ hours, and possibly at $\simeq9$ hours, where the observed peak is still significant. We also notice that the occurrence ranges identified in the upper panel of Figure \ref{Fig.PDF_Occurrence} and shown with different colours are unambiguously associated with specific magnetic environments in the FoV. In fact, when searching for the pixels of the FoV corresponding to those occurrence ranges we obtain a map similar to that shown in the middle right panel of Figure \ref{Fig.maps}. Thus, the emerging time scales may correspond to the typical occupancy time of a certain region of the supergranule by the magnetic flux. While a high occurrence indicates that a location frequently hosts magnetic features, no matter if the same or different ones, a high persistence is likely to be due to the slow evolution of magnetic elements or to their permanence in a certain region. Thus, magnetic elements staying for a long time in the same location should result in high persistence, while more dynamic magnetic elements moving to preferred sites (or along preferred paths) should result in low persistence but high occurrence. \citet{2014ApJ...788..137G} found that magnetic elements in the supergranular boundaries remain confined therein due to diffusion rates that are slower than those located inside the supergranule. According to this, the longer-correlated regions shown in the middle left panel of Figure \ref{Fig.maps} correspond to areas hosting magnetic elements with magnetic flux strong enough to oppose to photospheric advection, allowing them to evolve following a nearly random walk and to remain confined in the same regions for a longer time. This argument is supported by the bottom right panel of Figure \ref{Fig.maps}, where it is shown that the regions with $t_D>20$ min are located in correspondence with the minimum values of the horizontal velocity field. Outside the supergranule, the other regions in which $t_D$ is enhanced probably correspond to the boundaries of adjacent supergranules \citep[see, e.g., ][]{2014ApJ...797...49G, 2016ApJ...820...35G}. The drop in $t_D$ inside the supergranule is probably due to the superdiffusive motion of magnetic elements there \citep{2014ApJ...788..137G}, which are dragged along the locally stronger (up to $\simeq 0.6$ kms$^{-1}$) horizontal velocity fields (bottom panels of Figure \ref{Fig.maps}). Due to these local superdiffusive flows, magnetic elements tend not to remain in the same regions for long, quickly emptying the magnetic flux from the central regions of the supergranule. Thus, following the horizontal plasma velocity field, magnetic elements are radially expelled from the centre to the outer regions, possibly dragged by trees of fragmenting granules \citep[TFGs, ][]{2016A&A...590A.121R}. We notice two other features present in the decorrelation map. First, we see large inhomogeneities in the values of $t_D$ over the boundary of the supergranule, which is the signature of the importance of the properties of local environment. Such an asymmetry may be the result of the dynamic competition between adjacent supergranules keeping long-correlated magnetic flux frozen in the border area in the left-side network rather than in the right side. This hypothesis cannot be actually verified, as the horizontal velocity field all around the supergranule cannot be reliably computed everywhere. Another possible explanation lies in the presence of unipolar (negative) magnetic flux in the left-side network, and mixed polarity magnetic flux in the right-side network (see Figure \ref{Fig.mean_B_Frame}). The polarity mixing may result in flux reconfigurations in the right-side network, originating shorter decorrelation times than in the left-side network. Second, spotty and filamentary features are observed inside the supergranule. As these features are also present in the occurrence map, and due to the superdiffusive regime observed inside the supergranule, they may be the signature of long-correlated paths along which coherent magnetic fluxes continuously emerge and travel as bricks of the network. We investigated the relation between occurrence and persistence by plotting the mean $t_D$ within each occurrence bin (Figure \ref{Fig.Regions}). The trend monotonically increases up to an occurrence $\simeq65\%$, then features appear that are probably due to poor statistics. Moreover, the higher the occurrence, the steeper the increase in $t_D$. The best fits of points, based on the minimisation of $\chi^2$ together with the transitions observed in the derivative, provided us with three different regimes of increasing $t_D$. These different regimes are not randomly located across the FoV, but correspond to coherent regions with different physical conditions, as shown in the middle right panel of Figure \ref{Fig.maps}. This suggests the presence of different dynamic regimes in action in supergranules, depending on the local environment, which may be the manifestation of different magneto-convection regimes characterising the interaction between photospheric plasma and magnetic field in the quiet Sun \citep{2003ApJ...588.1183C}. When moving from the centre to the boundary of the supergranule the steepening of $t_D$ with the occurrence indicates a higher coherence of magnetic elements, and the locations with higher probability of hosting them also have a higher probability to host the {\it same} or similar magnetic flux density. Thus, it seems that the high occurrence in the boundary is merely due to the presence of long-lived magnetic elements piled up in relatively small regions. If this were the case everywhere in the FoV, we should find an even steeper increase in $t_D$ as a function of the occurrence in the vertices of the supergranule where the strongest downflows are observed \citep{2014ApJ...788..137G} in correspondence with the strongest magnetic fluxes. Instead, we found unequivocal signatures of a separated population of magnetic elements living in the vertices of the supergranule, and having a shorter $t_D$ (in green in Figure \ref{Fig.Regions} and in the middle right panel of Figure \ref{Fig.maps}) despite the maximum occurrence. We exclude any effect due to low statistics since such a population is well-defined, localised, and represents a spatially correlated cluster, not randomly distributed throughout the FoV, which can be very unlikely produced by a noisy distribution of magnetic elements with constrained occurrence and decorrelation time. These results suggest that different tightly packed magnetic elements in the vertices of the supegranule move in a very restricted region, thus allowing a high occurrence (near $100\%$) and $t_D\simeq40-50$ minutes. This agrees with the low-diffusion, back-and-forth trajectories of magnetic elements found in the boundary of the supergranular cell, especially close to the vertices \citep{2013ApJ...770L..36G}, and is consistent with the horizontal velocity field found there and shown in the bottom panels of Figure \ref{Fig.maps}. A key role is probably played by intense downflows acting as attractors, constraining the dynamics of close magnetic elements to a random walk restricted to small regions, and causing magnetic elements to pile up there. \section{Summary and conclusions} Due to the lack of an exhaustive physical theory, turbulent convection in the quiet Sun can be approached by i) MHD simulations, ii) tracking observed magnetic elements, or iii) studying the observed spatial and temporal correlations of both plasma and magnetic features filling the FoV. Here we followed the last approach, studying the occurrence and persistence of magnetic features in the quiet Sun. The main results found can be itemised as follows: \begin{itemize} \item The occurrence analysis shows a pattern on supergranular spatial and temporal scales with occurrences ranging from $0\%$ in the central part of the supergranular cell to almost $100\%$ near its vertices. \item The persistence analysis shows long-correlated patterns localised mainly in the supergranular boundary where decorrelation times up to $t_D\sim240$ minutes are found. \item The highest occurrences are found near the vertices of the supergranular cell, but in these regions $t_D$ lies in the middle of its observed range. This suggests that the same locations are filled by different magnetic elements, probably due to the presence of intense downflows constraining their nearly random motion and acting as attractors. \item The increase in $t_D$ as a function of the occurrence steepens moving from the centre to the boundaries of the supegranule, indicating that magnetic elements in the boundaries move, on average, slower and are correlated longer with respect to those inside the supergranule. The different slopes emerging from this behaviour may reflect the different magneto-convection regimes characterising the interaction between plasma and magnetic field in the quiet Sun. \end{itemize} The occurrence and persistence analyses proposed in this work provide additional information on the dynamic constraints of the magnetic elements on single-pixel spatial scales, which make it difficult to distinguish between different magnetic elements with other methods and algorithms. Further studies will be aimed to understand whether our findings are universal features characterising the solar quiet photosphere, or are strictly dependent on its physical conditions at the time when observations are carried out. We also will extend our analysis to dopplergrams, investigating more extensively the onset of spatial and temporal correlations in magnetic features and their relationship with the local convection, with particular interest in the effect of the strongest downflows on the dynamics of magnetic elements. It is our opinion that studies on the scales of organisation observed on the Sun performed with statistical tools like the ones employed in this work can effectively gather information about the turbulent convection dynamics and that, in general, this approach will contribute significantly to shedding light on the debated aspects of convection in stellar atmospheres. \begin{acknowledgements} This research has received funding from the Italian MIUR-PRIN grant 2012P2HRCR on ``The active Sun and its effects on Space and Earth climate''. Financial support from the Spanish Ministerio de Econom{\'i}a, Industria y Competitividad through projects ESP2014-56169-C6-1-R and ESP2016-77548-C5-1-R, including a percentage from European FEDER funds, is gratefully acknowledged. This paper is based on data acquired in the framework of the Hinode Operation Plan 151 entitled ``Flux replacement in the network and internetwork''. Hinode is a Japanese mission developed and launched by ISAS/JAXA, collaborating with NAOJ as a domestic partner, and NASA and STFC (UK) as international partners. Scientific operation of the Hinode mission is conducted by the Hinode science team organised at ISAS/JAXA. This team mainly consists of scientists from institutes in the partner countries. Support for the post-launch operation is provided by JAXA and NAOJ(Japan), STFC (U.K.), NASA, ESA, and NSC (Norway). \end{acknowledgements}
\section{Introduction} In global sensitivity analysis, we consider a variable of interest $Y$ which is a function of several variables $X_1,...,X_p$. We aim to associate a value to each input variable, that quantifies its impact on the output variable. We call these values "sensitivity indices". The first sensitivity indices for a general framework were introduced by Sobol in 1993 \cite{sobol_sensitivity_1993} and are called "Sobol indices". They are based on the output variance. Althougt they remain very popular, other sensitivity indices have been proposed in the litterature since then (see for example \cite{plischke_global_2013}, \cite{borgonovo_new_2007}, \cite{chastaing_indices_2013}, \cite{fort_new_2013}, \cite{lemaitre_density_2012}...), and we can find in \cite{borgonovo_common_2016} a general framework for defining sensitivity indices based on variances, on densities, or on distributions. These sensitivity indices are very useful in many applications, for example in physics or in the industry. However, many of them suffer from a lack of interpretation when the input variables are dependent. Recently, Owen used the notion of Shapley value in order to define new variance-based sensitivity indices in \cite{owen_sobol_2014} which are particularly well adapted for dependent input variables, and that are called "Shapley effects". The Shapley value originates from game theory in \cite{shapley_value_1953}. This quantity can be useful in very different fields (see for example \cite{moretti_combining_2008} or \cite{hubert_strategic_2003}). Hence, there is an active strand of litterature focusing on the computation of Shapley values (\cite{colini-baldeschi_variance_2016}, \cite{fatima_linear_2008}...) but they are adapted to a more general framework than sensitivity analysis. Only a few articles focus on this computation in the field of global sensitivity analysis (see \cite{owen_sobol_2014}, \cite{song_shapley_2016}, \cite{owen_shapley_2017}, \cite{iooss_shapley_2017}). In this paper, we focus on two popular variance-based sensitivity indices (Sobol indices and Shapley effects) when the input variables form independent groups and more particularly when the model is block-additive. We first prove that the sensitivity indices have much simpler expressions in this framework. In particular, we show that many Sobol indices are equal to zero and that the computation of the Shapley effects is much easier in this case than in the general framework. We provide an algorithm for evaluating these sensitivity indices in the linear Gaussian case, which is particularly efficient when the covariance matrix of the input Gaussian distribution is block diagonal. Finally, we suggest a new method to estimate the Shapley effects for general models with independent groups of variables. We show numerically that our theoretical results improve the accuracy of the estimates. The paper is organized as follows: in Section 2, we recall the definition of Sobol indices and Shapley effects and their properties. In Section 3, we present our main theoretical results about these sensitivity indices with independent groups of input variables. In Section 4, we focus on the linear Gaussian framework and give an algorithm to compute the variance-based sensitivity indices in this case. We then apply our theoretical results about the variance-based sensitivity indices to give an efficient computation when the covariance matrix is block diagonal. In Section 5, we highlight our results by comparing these algorithms with the existing algorithm suggested in \cite{song_shapley_2016} designed to compute the Shapley effects. We give in Section 6 a numerical procedure based on the results of Section 3, for the estimation of the Shapley effects for general models with independent groups of input variables. The proofs are postponed to the appendix. \section{Background and notations}\label{background} Let $(\Omega,\mathcal{A},\mathbb{P})$ be a probability space, $E=\times_{i=1}^p E_i$ be endowed with the product $\sigma$-algebra $\mathcal{E}=\otimes_{i=1}^p \mathcal{E}_i$ and $X$ be a random variable from $\Omega$ to $E$ in $L^2$. The $(X_i)_{i\in [1:p]}$ will be the input variables of the model.\\ Let $f:(E,\mathcal{E})\rightarrow (\mathbb{R},\mathcal{B}(\mathbb{R}))$ be in $L^2$ and $Y=f(X)$. We will call $Y$ the output variable. We assume that $\mathrm{Var}(Y)\neq 0$.\\ Let $[1:p]$ be the set of all integers between 1 and $p$. If $u\subseteq[1:p]$ and $x\in \mathbb{R}^p$, we will write $x_u:=(x_i)_{i\in u}$.\\ For all $u\subseteq[1:p]$, we write $V_u:=\mathrm{Var}(\mathrm{E}(Y|X_u))$. We can now define the Sobol indices (see \cite{saltelli_sensitivity_2000} and \cite{chastaing_indices_2013}) for a group of variables $X_u$ as: \begin{equation}\label{Sobol} S_u:=\frac{1}{\mathrm{Var}(Y)}\sum_{v\subseteq u}(-1)^{|u|-|v|} V_v, \end{equation} where $|u|$ is the cardinal of $u$. This quantity assesses the impact of the interaction of the inputs $(X_i)_{i\in u}$ on the model output variability. \begin{rmk}Actually, we can find two different definitions of the Sobol indices in the literature. As in \cite{iooss_shapley_2017}, we can also define the closed Sobol indices by \begin{equation}\label{closed_Sobol} S_u^{cl}:=\frac{V_u}{\mathrm{Var}(Y)}. \end{equation} The closed Sobol indice $S_u^{cl}$ assesses the total impact of the inputs $(X_i)_{i\in u}$. However, as in \cite{chastaing_indices_2013}, we choose to focus on the Sobol indices defined by Equation \eqref{Sobol}. \end{rmk} These sensitivity indices were the first ones introduced in \cite{sobol_sensitivity_1993} for non-linear models. The Sobol indices are well defined and the sum of the Sobol indices over $u\subseteq [1:p]$ is equal to one, even if the inputs are dependent. Moreover, these sensitivity indices are positive when the inputs are independent. However, this is no longer true in the general case, so that the Sobol indices are less amenable to interpretation with dependent input variables. To overcome this lack of interpretation, many methods have been proposed. The authors of \cite{jacques_sensitivity_2006} suggested to find the independent groups of variables and to consider each group as one input variable. This method quantifies the impact of these groups of variables on the output but can not quantify the impact of each input variable. Besides in \cite{mara_variance-based_2012}, the authors transformed the dependent inputs into independent inputs to calculate the Sobol indices of the new input variables. Another approach to deal with the dependece between the inputs is to consider only the first order Sobol indices $(S_i)_{i\in [1:p]}$ which always remain in $[0,1]$. \cite{xu_uncertainty_2008} decomposed each first order indice $S_i$ into a correlated contribution $S_i^C$ and an uncorrelated contribution $S_i^U$. However this method requires a linear model. Moreover, the drawback of considering the first order Sobol indices is that their sum is no longer equal to one. Mara and a.l. suggested in \cite{mara_non-parametric_2015} an alternative definition for the Sobol indices in the dependent case, allowing them to remain positive. Each previous variant of Sobol indices has advantages and disadvantages. Nevertheless, Iooss and Prieur exhibited in \cite{iooss_shapley_2017} an analysis supporting the use of Shapley effects as sensitivity indices when the inputs are dependent. We can define the Shapley effects as in \cite{owen_sobol_2014} for the input variable $X_i$ as: \begin{equation}\label{Shapley} \eta_i:=\frac{1}{p\mathrm{Var}(Y)}\sum_{u\subseteq -i} \begin{pmatrix} p-1\\ |u| \end{pmatrix} ^{-1}\left(V_{u\cup \{i\}}-V_u \right) \end{equation} where $-i$ is the set $[1:p]\setminus \{i\}$.\\ The Shapley effects have interesting properties for global sensitivity analysis. Indeed, there is only one Shapley effect for each variable (contrary to the Sobol indices). Moreover, the sum of all the Shapley effects is equal to $1$ (see \cite{owen_sobol_2014}) and all these values lie in $[0,1]$ even with dependent inputs, which is very convenient for the interpretation of these sensitivity indices.\\ \section{Variance-based sensitivity indice properties for independent groups of inputs}\label{theoretical} In this section, we give theoretical results about variance-based sensitivity indices when the inputs form independent groups of variables. \subsection{Notations for the independent groups} Let $\mathcal{C}=\{C_1,...,C_k\}$ be a partition of $[1:p]$ such that the groups of random variables $(X_{C_j})_{j\in [1:k]}$ are independent. Let $A_j:=X_{C_j}$. Let us write $$ Y=f(X_1,...,X_p)=g(A_1,...,A_k). $$ Is $w\subseteq[1:k]$, we define $$ V_w^g:=\mathrm{Var}(\mathrm{E}(Y|A_w)). $$ As the inputs $(A_1,...A_k)$ are independent, the Hoeffding decomposition (see \cite{hoeffding_class_1948} and \cite{vdv00}) of $g$ is given by: \begin{equation}\label{eq_hoeff} g(A)=\sum_{w\subseteq [1:k]}g_w(A_w). \end{equation} Similarly to \eqref{Sobol}, the Sobol indices of $g$ are given by \begin{equation} S_w^g:=\frac{\mathrm{Var}(g_w(A_w))}{\mathrm{Var}(Y)}=\frac{1}{\mathrm{Var}(Y)}\sum_{z\subseteq w}(-1)^{|w|-|z|} V_z^g. \end{equation} \begin{rmk} As the inputs $(A_1,...,A_k)$ are independent, the Sobol indice $S_w^g$ of $g$ is the variance of $g_w$ divided by $\mathrm{Var}(Y)$ and so is non-negative. Moreover, we can estimate it without trouble because the quantities $(V_z^g)_{z\subseteq w}$ are simple to estimate (using the Pick-and-Freeze estimators \cite{saltelli_sensitivity_2000}, \cite{gamboa_statistical_2016} for example). \end{rmk} We also define $$ V_u^{g,w}:=\mathrm{Var}(\mathrm{E}(g_w(A_w)|X_u)). $$ Writing $C_w:=\bigcup_{j\in w} C_j$, we have $V_u^{g,w}=V_{u\cap C_w}^{g,w}$. If $u \subseteq C_w$, let $S_u^{g,w}$ be the Sobol indice of $g_w$: $$ S_u^{g,w}:=\frac{1}{\mathrm{Var}(g_w(A_w))}\sum_{v\subseteq u}(-1)^{|u|-|v|} V_v^{g,w}. $$ Equivalently, if $i \in C_w$, let $\eta_i^{g,w}$ be the Shapley effect of $g_w$: $$ \frac{1}{|C_{w}| \mathrm{Var}(g_w(A_w)}\sum_{u\subseteq C_w\setminus \{i\}} \begin{pmatrix} |C_{w}|-1 \\ |u| \end{pmatrix}^{-1}(V_{u\cup i}^{g,w}-V_{u}^{g,w}). $$ Finally, for all $i\in [1:p]$, let $j(i)\in [1:k]$ be the index such that $i \in C_{j(i)}$. \subsection{Main results for general models} We will study the Sobol indices and the Shapley effects in the case of block-independent variables. First, we show a proposition about the $(V_u)_{u\subseteq [1:p]}$. \begin{prop}\label{propcentrale} For all $u \subseteq [1:p]$, we have: \begin{equation} V_u=\sum_{w\subseteq[1:k]} V_{u\cap C_w}^{g,w}. \end{equation} \end{prop} Dividing by the variance of $Y$, we can deduce directly an identical decomposition for the closed Sobol indices defined by Equation \eqref{closed_Sobol}.\\ We then provide a consequence of Proposition \ref{propcentrale} on Sobol indices: \begin{prop}\label{propSobol} For all $u\subseteq [1:p]$, we have: \begin{equation} S_u=\displaystyle\sum_{\substack{w\subseteq[1:k],\\ u\subseteq C_w}} S_w^g S_u^{g,w}. \end{equation} \end{prop} Proposition \ref{propSobol} improves the interpretation of the Sobol indices. It states that the Sobol indices for the output $Y$ are linear combinations of the Sobol indices when considering the outputs $g_w(A_w)$ and that the weighting coefficients are the $S_w^g$. This proposition can be beneficial for the estimation of the Sobol indices. We could estimate the coefficients $S_w^g$ by Pick-and-Freeze. If many of them are close to $0$, the corresponding Sobol indices $S_u^{g,w}$ are irrelevant for the total output $Y$, and it is unnecessary to estimate them. We also provide a consequence of Proposition \ref{propcentrale} on Shapley effects: \begin{prop}\label{propshapley} For all $i\in [1:p]$, we have \begin{equation} \eta_i=\displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}}S_w^g \eta_i^{g,w}. \end{equation} \end{prop} As for the Sobol indices, Proposition \ref{propshapley} provides the computation of the Shapley effects for the output $Y$ by summing the Shapley effects when considering the outputs $g_w(A_w)$ and multiplying them by the coefficient $S_w^g$. \subsection{Main results for block-additive models} In the following, we detail the consequences of Propositions \ref{propSobol} and \ref{propshapley} to the particular case of a block-additive model: \begin{equation}\label{forme} Y=\sum_{j=1}^kg_j(A_j), \end{equation} i.e. when the functions $(g_w)_{w\subseteq[1:k]}$ of the Hoeffding decomposition are equal to 0 except for $w$ equal to a singleton. \begin{corol}\label{coroSobol} If the model is block-additive, for all $u$ such that $u\nsubseteq C_j$ for all $j$, we have $S_u=0$. \end{corol} This corollary states that the majority of Sobol indices for block additive models a equal to zero. It remains only $\sum_{j=1}^k 2^{C_j}-1$ unknown non-zero Sobol indices instead of $2^p-1$. \begin{corol}\label{coroshapley} For block-additive models, we have \begin{equation} \eta_i=S_{j(i)}^g\eta_i^{g,j(i)}. \end{equation} \end{corol} For example, if we apply this corollary in the case where $X_i$ is the only variable in its group, then we have $\eta_i=S_i$.\\ To compute the Shapley effect $\eta_i$ in block additive models, the previous corollary reduces the sum from all the subsets of $[1:p]\setminus \{i\}$ to all the subset of $C_{j(i)} \setminus \{i\}$. Then, the computational gain is the same as in Corollary \ref{coroSobol}. \section{Explicit computation of sensitivity indices for Gaussian linear models} In general, it is a really difficult task to estimate the sensitivity indices for dependent inputs. The authors of \cite{song_shapley_2016} suggest an algorithm for the Shapley effects estimation which requires a function generating an i.i.d. sample of $X_{-u}$ conditionally to $X_u=x_u$. This requirement reduces this estimation to restricted theoretical frameworks. In the following, we show an exact computation of the sensitivity indices for Gaussian linear models. \subsection{Linear Gaussian framework} In this section, we assume that $X\sim \mathcal{N}(\mu,\Gamma)$, that $\Gamma$ is invertible and that $f:x\longmapsto \beta_0+\beta^T x$, for a fixed $\beta_0\in \mathbb{R}$ and a fixed vector $\beta$. This framework is widely used to model physical phenomena (see for example \cite{kawano_evaluation_2006}, \cite{hammer_approximate_2011}, \cite{rosti_linear_2004}). Indeed, uncertainties are often modelled as Gaussian variables and an unknown function is commonly estimated by its linear approximation. We can assume without loss of generality that $\mu=0$ and $\beta_0=0$. For now, we will not assume that there are different groups of independent variables. In this framework, the sensitivity indices can be calculated explicitly. First, we write the sensitivity indices with expectations of conditional variances: \begin{eqnarray}\label{varianceSobol} S_u:=(-1)^{|u|}\sum_{v\subseteq u} (-1)^{|v|+1} \frac{\mathrm{E}(\mathrm{Var}(Y|X_u))}{\mathrm{Var}(Y)},\;\forall u \neq \emptyset, \end{eqnarray} and \begin{eqnarray}\label{varianceShapley} \eta_i:=\frac{1}{p\mathrm{Var}(Y)}\sum_{u\subseteq -i} \begin{pmatrix} p-1\\ |u| \end{pmatrix} ^{-1}\left(\mathrm{E}(\mathrm{Var}(Y|X_u))-\mathrm{E}(\mathrm{Var}(Y|X_{u\cup \{i\}})) \right). \end{eqnarray} We will now exploit the Gaussian framework as in \cite{owen_shapley_2017}, using that for all subset $u\subseteq[1:p]$, \begin{equation}\label{eq} \mathrm{Var}(Y|X_u)=\mathrm{Var}(\beta_{-u}^T X_{-u}|X_u)=\beta_{-u}^T(\Gamma_{-u,-u}-\Gamma_{-u,u}\Gamma_{u,u}^{-1}\Gamma_{u,-u})\beta_{-u} \end{equation} where $\beta_u:=(\beta_i)_{i\in u}$ and $\Gamma_{u,v}:=(\Gamma_{i,j})_{i\in u, j\in v}$. These conditional variances are constant so they are equal to their expectation. Then, we can use these formulae to compute explicitly these sensitivity indices in the Gaussian linear case. \begin{rmk} If the matrix $\Gamma$ is not invertible, there exist subsets $u$ such that $\Gamma_{u,u}$ is not invertible. However, Equation \eqref{eq} still holds if we replace $\Gamma_{u,u}^{-1}$ by the generalized inverse (for symmetric matrices) of $\Gamma_{u,u}$. \end{rmk} \begin{rmk} One can show a similar result when $X$ follows an asymmetric Laplace distribution $AL_p(m,\Gamma)$. However, the conditional variances are not constant in this case and their expectations must be estimated, for instance by Monte-Carlo. \end{rmk} One issue remains though, namely computing numerically the sum in \eqref{varianceShapley}. Indeed, we have to sum over all the subsets of $[1:p]$ which do not contain $i$. We also have to group the subsets $u$ and $u\cup\{i\}$. For this purpose, we suggest to use the following bijective map: \begin{eqnarray*} h: \begin{array}{lll} \mathcal{P}([1:p])&\longrightarrow &[0:2^{p}-1]\\ u&\longmapsto &\sum_{i\in u} 2^{i-1}. \end{array} \end{eqnarray*} We remark that: \begin{eqnarray*} u\subseteq -i \Longleftrightarrow \left\lfloor \frac{h(u)}{2^{i-1}}\right\rfloor \equiv 0\; [mod\;2]. \end{eqnarray*} Finally, we can see that if $u\subseteq -i$, then $h(u\cup\{i\})=h(u)+h(\{i\})$. Based on this map and Equations \eqref{varianceSobol} and \eqref{varianceShapley}, we suggest an algorithm that we call "LG-Indices" (for Linear Gaussian). This algorithm computes the variance-based sensitivity indices in the linear Gaussian framework. \underline{\textbf{LG-Indices:}} \textbf{Inputs:} $\beta$, $\Gamma$. \begin{enumerate} \item Let $\mathrm{Var}(Y)=\beta^T \Gamma \beta$ and let $\mathrm{Var}(Y|X)=0$. \item (Compute the conditional variances) For $j=0,...,2^p-1$, do the following: \begin{enumerate} \item Compute $u=h^{-1}(j)$. \item Compute $V_j:=\mathrm{Var}(Y|X_u)$ using \eqref{eq}. \end{enumerate} \item Initialise $S=(0,...,0)\in \mathbb{R}^{2^p}$. \item (Compute the Sobol indices) For $j=0,...,2^p-1$, do the following: \begin{enumerate} \item Let $v=h^{-1}(j)$. \item For all $u$ such that $v\subseteq u$, let: \begin{equation} S_{h(u)}=S_{h(u)}+(-1)^{|v|+1}V_{j} \end{equation} \end{enumerate} \item Let $S_0=0$ \item For $j=1,...,2^p-1$, let $u=h^{-1}(j)$ and \begin{equation} S_j=\frac{(-1)^{|u|}}{\mathrm{Var}(Y)}S_j. \end{equation} \item (Compute the Shapley effects) For $i=1,...,p$, do the following: \begin{enumerate} \item Initialize $\eta=(0,...,0)\in \mathbb{R}^p$ . \item For $k=0,...,2^p-1$, do the following: \begin{enumerate} \item If $\left\lfloor \frac{k}{2^{i-1}}\right\rfloor \equiv 0\; [mod\;2]$, then update : \begin{equation} \eta_i=\eta_i+ \begin{pmatrix} p-1 \\ |h^{-1}(k)| \end{pmatrix}^{-1} \left(V_k-V_{k+2^{i-1}})) \right). \end{equation} \end{enumerate} \item Let $\eta_i=\eta_i\slash (p\mathrm{Var}(Y))$. \end{enumerate} \end{enumerate} \textbf{Outputs} $(S,\eta)$. \bigskip \begin{rmk} We can use the previous algorithm for any $f$ and any law of $X$ if we can estimate the expectation of conditional variances (or the variance of conditional expectations equivalently). \end{rmk} \subsection{Linear Gaussian framework with independent groups of variables} Despite the analytical formula \eqref{eq}, the computational cost remains an issue when the number of input variables $p$ is too large. Based on an implementation in the R software, LG-Indices provides almost instantaneous results for $p\leq 15$, but becomes impracticable for $p\geq 30$. Indeed, we have to store $2^p$ values, namely the $(\mathrm{Var}(Y|X_u))_{u\subseteq[1:p]}$, and this can be a significant issue. Fortunately, when $p$ is large, it can frequently be the case that there are independent groups of random variables. That is, after a permutation of the variables, the covariance matrix $\Gamma$ is a block diagonal matrix. In this case, Corollaries \ref{coroSobol} and \ref{coroshapley} show that this high dimensional computational problem boils down to a collection of lower dimensional problems. In this framework, we have seen in Corollaries \ref{coroSobol} and \ref{coroshapley} that we only have to calculate the $\sum_{j=1}^k2^{|C_j|}$ values $\{\mathrm{Var}(Y|X_u),\; u\subseteq C_j,\;j\in[1:k]\}$ instead of all the $2^p$ values $\{\mathrm{Var}(Y|X_u), \; u\subseteq[1:p]\}$. We detail this idea in the algorithm "LG-GroupsIndices". \underline{\textbf{LG-GroupsIndices:}} \textbf{Inputs:} $\beta$, $\Gamma$. \begin{enumerate} \item Let $C_1,...,C_k$ be the independent groups of variables, for example using the function "graph$\_$from$\_$adjacency$\_$matrix" of the R package "igraph" (see \cite{csardi_igraph_2006}). \item Let $\eta$ be a vector of size $p$. \item For $j=1,...,k$, do the following: \begin{enumerate} \item Let $(\tilde{S},\tilde{\eta})$ be the output of the algorithm LG-Indices with the inputs $\beta_{C_j}$ and $\Gamma_{C_j,C_j}$. \item Let \begin{equation*} S^j=\frac{\beta_{C_j}^T\Gamma_{C,j,C_j} \beta_{C_j}}{\beta_T \Gamma \beta_T}\tilde{S} \end{equation*} \item Let \begin{equation*} \eta_{C_j}=\frac{\beta_{C_j}^T\Gamma_{C,j,C_j} \beta_{C_j}}{\beta_T \Gamma \beta_T}\tilde{\eta}. \end{equation*} \end{enumerate} \end{enumerate} \textbf{Ouputs:} $(S^1,...,S^k,\eta)$. \bigskip We have used LG-GroupsIndices for computing Shapley effects on an industrial study in the field of nuclear safety. In this model, the twelve inputs were modelled by a Gaussian vector with two independent groups of six variables. Corollary \ref{coroshapley} enables us to compute the Shapley effects computing only $2^6+2^6=128$ conditional variances instead of $2^{12}=4096$. These results have been presented by Pietro Mosca in the sixteen International Symposium on Reactor Dosimetry.\\ The computational time does not really depend of the coefficients of $\beta$ and $\Gamma$, that is why we prefer to consider simulated toy examples to compare the different algorithms in the next section. \section{Numerical experiments: Shapley effects computations} To position our work with respect to the state of art, we compare in this section the algorithms "LG-Indices" and "LG-GroupsIndices" with an existing algorithm designed to compute the Shapley effects for global sensitivity analysis. \subsection{Random permutations Algorithm: Shapley effects estimation} To the best of our knowledge, the only existing algorithm designed to compute the Shapley effects for global sensitivity analysis is suggested by Song in \cite{song_shapley_2016}. This algorithm is introduced for a general function $f$ and a general distribution of $X$ and does not focus specifically on the linear Gaussian model. In this general context, the expectation of the conditional variances are estimated by a double Monte-Carlo procedure. This Shapley effect estimation suggested in \cite{song_shapley_2016} relies on the following formulation of the $\eta_i$: \begin{equation}\label{formulation} \eta_i=\frac{1}{p!\mathrm{Var}(Y)}\sum_{\sigma \in \mathcal{S}_p}(\mathrm{E}(\mathrm{Var}(Y|X_{P_i(\sigma)}))- \mathrm{E}(\mathrm{Var}(Y|X_{P_i(\sigma)\cup \{i\})}))), \end{equation} where $\mathcal{S}_p$ is the set of all permutations of $[1:p]$ and $P_i(\sigma):=\{\sigma(j),\;j\in [1:i] \}$. Then, in order to circumvent the $p!$ estimations of expectations of conditional variances, \cite{song_shapley_2016} suggests to generate $m$ ($m<p!$ for large values of $p$) permutations $\sigma_1,...,\sigma_m$ uniformly in $\mathcal{S}_p$ and to let: \begin{equation}\label{song} \widehat{\eta}_i=\frac{1}{m\mathrm{Var}(Y)}\sum_{j=1}^m(\mathrm{E}(\mathrm{Var}(Y|X_{P_i(\sigma_j)}))- \mathrm{E}(\mathrm{Var}(Y|X_{P_i(\sigma_j)\cup \{i\})}))). \end{equation} It is suggested in \cite{iooss_shapley_2017} to choose $m$ as large as possible and to choose small sample size values for the double Monte-Carlo procedure. This algorithm is already implemented in the R package {\verb sensitivity } and is called "shapleyPermRand". However, as we focus on the linear Gaussian framework, for a fair comparison, we adapt the algorithm suggested in \cite{song_shapley_2016} to this particular framework replacing the estimations of $(\mathrm{E}(\mathrm{Var}(Y|X_u)))_{u\subseteq[1:p]}$ by their theoretical values given by \eqref{eq}. We will write "random permutations Algorithm" for this algorithm. A variant of this algorithm, called "shapleyPermEx", is implemented in the R package "sensitivity". Although, this algorithm is not clearly suggested in \cite{song_shapley_2016}. "shapleyPermEx" differs from "shapleyPermRand" by computing the sum over all the permutations when the former algorithm was only estimating the sum thanks to a Monte-Carlo method. We used the linear Gaussian framework to replace the expectation of conditional variances by their theoretical values, such that the algorithm gives the exact values of the Shapley effects. We will write "exact permutations Algorithm" for this algorithm. This method still remains very costly due to the computation of $(p-1)!$ conditional variances. For example, it spends more than ten minutes computing the Shapley effects for only $p=10$. \subsection{Shapley effects in the linear Gaussian framework}\label{section_algo1} From now on, as we focus on the Shapley effects, we do not carry out the steps related to the computation of Sobol indices in the algorithms "LG-indices" and "LG-GroupsIndices".\\ Let us consider a simulated toy example. We generate $\beta$ by a $\mathcal{N}(0,I_p)$ random variable and $\Gamma$ by writing $\Gamma=AA^T$, where the coefficients of $A$ are generated independently with a standard normal distribution.\\ First, we compare "LG-Indices" with exact permutations Algorithm. Both provide the exact Shapley values but with different computational times. Table \ref{permex} provides the computation times in seconds for different values of $p$, the number of input variables. \begin{table}[ht] \caption{Computational time (in seconds) for exact permutations Algorithm and LG-Indices for different values $p$.} \centering \begin{tabular}{|l|c|c|c|c|c|}\hline & $p=6$& $p=7$& $p=8$ & $p=9$ & $p=10$ \\ \hline exact permutations & 0.11 & 0.78 & 7.31 & 77.6 & 925 \\ \hline LG-Indices & 0.004 & 0.008& 0.018 & 0.039 & 0.086 \\ \hline \end{tabular} \label{permex} \end{table} We remark that "LG-indices" is much faster than exact permutations Algorithm. \\ We can also compare "LG-Indices" with random permutations Algorithm. For the latter, we choose $m$, the number of permutations generated in Song, so that the computational time is the same as LG-Indices. Yet, while our algorithm gives the exact Shapley effects, the random permutations Algorithm provides an estimation of them. Hence, the performance of the latter algorithm is evaluated by computing the coefficients of variation in $\%$, for different values of $p$. We give in Table \ref{Song1} the average of the $p$ coefficients of variations. We recall that the coefficient of variation corresponds to the ratio of the standard deviation over the mean value. \begin{table}[ht] \caption{Mean of the coefficients of variation of Shapley effects estimated by random permutations Algorithm for the same computational time as LG-GroupsIndices.} \centering \begin{tabular}{|l|c|c|c|c|c|}\hline & $p=3$& $p=4$& $p=5$ & $p=6$ & $p=7$ \\ \hline $m$ chosen & 10 & 12& 18 &30 & 50 \\ \hline mean of coefficients of variation &$31\%$ & $26\%$& $22\%$ & $18\%$ & $13\%$ \\ \hline \end{tabular} \label{Song1} \end{table} We see that the algorithm suggested in \cite{song_shapley_2016} has quite large coefficients of variation when we choose $m$ so that the computational time is the same as our algorithm. However, this variation decreases with the number of inputs $p$. We can explain that by saying that the computational time of LG-Indices is exponential with $p$. So, we can see that the precision of random permutations Algorithm increases with $m$. \subsection{Shapley effects in the linear Gaussian framework with independent groups of variables} With independent groups of inputs, to the best of our knowledge, LG-GroupsIndices is the only algorithm which can compute the exact Shapley effects for large values of $p$ (the number of inputs). Indeed, random permutations Algorithm can handle large values of $p$ but always computes estimations of Shapley effects. On the other hand, LG-Indices computes exact Shapley effects but becomes too costly for $p\geq 20$ (the computation time is exponential in $p$).\\ First, we compare the computation time of "LG-Indices" and "LG-GroupsIndices" for low values of $p$ on a toy simulated example as in Section \ref{section_algo1}. We generate $k$ independent groups of $n$ variables. We give these results in Table \ref{algo1_2}. \begin{table}[ht] \caption{Computation time (in seconds) for LG-Indices and LG-GroupsIndices for different values of $k$ and $n$.} \centering \begin{tabular}{|l|c|c|c|c|}\hline & $k=3$& $k=4$& $k=4$ & $k=5$ \\ & $n=3$& $n=3$ & $n=4$ & $n=4$ \\ \hline LG-Indices & $0.04$ & $0.47$ & $8.45$ & $168.03$ \\ \hline LG-GroupsIndices &$0.002$ & $0.003$ & $0.004$ & $0.007$ \\ \hline \end{tabular} \label{algo1_2} \end{table} \bigskip Now, we compare LG-GroupsIndices with random permutations Algorithm as in \ref{section_algo1}: we choose $m$ so that the computational time is the same and we give the average of the $p$ coefficients of variation of random permutations Algorithm in Table \ref{algoSong_2}. \begin{table}[ht] \caption{Mean of the coefficients of variation of Shapley effects estimated by random permutations Algorithm for the same computational time as LG-GroupsIndices.} \centering \begin{tabular}{|l|c|c|c|c|c|c|}\hline & $k=3$& $k=4$& $k=5$ & $k=6$ & $k=10$ & $k=5$\\ & $n=3$ & $n=4$ & $n=5$ & $n=6$ & $n=5$ & $n=10$ \\ \hline $m$ chosen & 7 & 8& 9 &10 & 5 & 98 \\ \hline mean of coefficients of variation &$34\%$ & $38\%$& $34\%$ & $36\%$ & $40\%$ & $12\%$ \\ \hline \end{tabular} \label{algoSong_2} \end{table} Here, the mean of the coefficients of variation remains quite large (around $35\%$) when we chose $k=n$. However, when we choose $k$ larger (resp. lower) than $n$, this variation increases (resp. decreases). \section{Numerical applications: approximating general models by block-additive functions} In this section, we give a numerical application of Corollary \ref{coroshapley} to the estimation of the Shapley effects with a general model and with independent groups of input variables. We assume that: \begin{itemize} \item There is a numerical code $f:\mathbb{R}^p\rightarrow \mathbb{R}$ which is very costly; \item It is feasible to sample under the conditional distributions of the input variables (in order to use the algorithm suggested in \cite{song_shapley_2016} to estimate the Shapley effects); \item There are independent groups of input variables. \end{itemize} Since the numerical code is costly, we need to compute a meta-model $\tilde{f}$ of $f$ to estimate the Shapley effects from a sample $(X_i,f(X_i))_{i\leq N_{samp}}$. We compare two different methods: \begin{enumerate} \item We compute a total meta-model $\tilde{f}_{tot}$ without assumptions on the model. Then, we compute the Shapley effects using the R function "shapleyPermRand" from the R package {\verb sensitivity }. \item We compute a block-additive meta-model $\tilde{f}_{add}=\sum_{j=1}^k g_j$ as in Equation \eqref{forme}, where $g_j$ depends only on the group of variable $X_{C_j}$. Then, we estimate the Shapley effects for all the models $g_j$ using the R function "shapleyPermRand". From them, we deduce the Shapley effects of the block-additive model $\tilde{f}_{add}$ using Corollary \ref{coroshapley}. \end{enumerate} To compute the two models $\tilde{f}_{tot}$ and $\tilde{f}_{add}$, we suggest to use the functions "kmAdditive" and "predictAdditive" from the R package {\verb fanovaGraph }. \begin{figure} \centering \includegraphics[height=8cm,width=10cm]{boxplotX.pdf} \caption{Boxplot of 1000 estimates of the 15 Shapley effects using the two methods suggested: with a total model in red and with an additive model in black. We also represent the true values of the Shapley effects with green horizontal segments.} \label{boxplot} \end{figure} Here, we carry out a numerical study based on the following function: $$ f(x)=\cos(z)+z-100+0.2\sin(10z),\;\;z=\sum_{i=1}^{p} \left(1+\frac{i-1}{p-1}\right) x_i^2, $$ with a number of inputs $p=15$. For simplicity, we take the Gaussian input distribution $\mathcal{N}(0,\Gamma)$ where the covariance matrix $\Gamma$ is block-diagonal, with 3 blocks of size 5. In Figure \ref{boxplot}, we present the estimates of the Shapley effects achieved with the two approaches for the same computation time (140 seconds for computing the meta-model and estimating the Shapley effects of this meta-model). Each method is run 1000 times to obtain the boxplots. At each iteration, we generate a new sample $(X_i,f(X_i))_{i\leq N_{samp}}$ and we compute a new model $\tilde{f}_{tot}$ or $\tilde{f}_{add}$. We also represent the true values of the Shapley effects, computed by taking the mean of 1000 estimates given by shapleyPermRand with the true model $f$ (and the parameters $Nv=10^6$, $m = 10^4$). We remark that the estimates obtained from the additive model $\tilde{f}_{add}$ and from Corollary \ref{coroshapley} are more accurate than the estimates with the total model $\tilde{f}_{tot}$ for the same computation time. In conclusion, the use of a block-additive model, and the estimation of the Shapley effects for this meta-model using corollary \ref{coroshapley} appears to be relevant to estimate the Shapley effects of a costly numerical code with independent groups of input variables. As we have shown, this can results in an improved accuracy, even for codes that are not block-additive. \section{Conclusion} In this paper, we give new theoretical results about the variance-based sensitivity indices for independent groups of inputs. These results drastically reduce the computational cost of these indices when the model is block-additive. Then, we apply these results to the linear Gaussian framework and we suggest two algorithms: the first one for the general case and the second one for a block diagonal covariance matrix. These algorithms compute efficiently the theoretical values of the variance-based sensitivity indices. Numerical experiments on Shapley effects computations highlight this efficiency and the benefit compared to existing methods. We also suggest a method based on our results to improve the estimates of the Shapley effects when we have independent groups of variables, and a general model that is not block-additive. \section*{Acknowledgements} We are very grateful to Bertrand Iooss for his ideas and his advices. We also would like to thank Pietro Mosca and Laura Clouvel for their contribution to the implementation of the industrial application, and Arnaud Grivet Sebert for the constructive discussions that helped to improve the paper. The authors are grateful to the referees for their constructive suggestions. \section*{Appendix} \textbf{Proof of Proposition \ref{propcentrale}:}\\ We use the Hoeffding decomposition of $g$: \begin{eqnarray*} V_u&=&\mathrm{Var}(\mathrm{E}(Y|X_u))\\ &=&\mathrm{Var}\left[\sum_{w\subseteq[1:k]}\mathrm{E}(g_w(A_w)|X_{u\cap C_w})\right]\\ &=&\sum_{w\subseteq[1:k]}\mathrm{Var}\left[\mathrm{E}(g_w(A_w)|X_{u\cap C_w})\right]\\ &=&\sum_{w\subseteq[1:k]} V_{u\cap C_w}^{g,w}. \end{eqnarray*}\qed \bigskip \textbf{Proof of Proposition \ref{propSobol}:}\\ We have \begin{eqnarray*} S_u&=&\frac{1}{\mathrm{Var}(Y)}\sum_{v\subseteq u} (-1)^{|u|-|v|}V_v\\ &=&\frac{1}{\mathrm{Var}(Y)}\sum_{v\subseteq u} (-1)^{|u|-|v|}\sum_{w\subseteq[1:k]} V_{v\cap C_w}^{g,w}\\ &=&\frac{1}{\mathrm{Var}(Y)}\sum_{w\subseteq[1:k]} \sum_{v\subseteq u} (-1)^{|u|-|v|}V_{v\cap C_w}^{g,w}\\ &=&\frac{1}{\mathrm{Var}(Y)}\sum_{w\subseteq[1:k]} \sum_{v_1\subseteq u\cap C_w} V_{v_1}^{g,w} \displaystyle\sum_{\substack{v_2 \subseteq -C_w,\\ \text{s.t.} v_1 \cup v_2 \subseteq u}}(-1)^{|u|-|v_1|-|v_2|} \end{eqnarray*} One can remark that, if $u\setminus C_w\neq \emptyset$, $$ \sum_{\substack{v_2 \subseteq -C_w,\\ \text{s.t.} v_1 \cup v_2 \subseteq u}}(-1)^{|u|-|v_1|-|v_2|} =(-1)^{|u|-|v_1|}\sum_{n=0}^{|u\setminus C_w|}\begin{pmatrix} |u\setminus C_w| \end{pmatrix} (-1)^{n}=0. $$ Thus, \begin{eqnarray*} S_u&=&\frac{1}{\mathrm{Var}(Y)}\displaystyle\sum_{\substack{w\subseteq[1:k],\\ u\subseteq C_w}} \sum_{v_1\subseteq u} (-1)^{|u|-|v|} V_{v_1}^{g,w} \\ &=&\displaystyle\sum_{\substack{w\subseteq[1:k],\\ u\subseteq C_w}} \frac{\mathrm{Var}(g_w(A_w))}{\mathrm{Var}(Y)}S_u^{g,w}. \end{eqnarray*} \qed \bigskip \textbf{Proof of Proposition \ref{propshapley}:}\\ \begin{eqnarray*} \eta_i&=& \frac{1}{p\mathrm{Var}(Y)} \sum_{u\subseteq -i} \begin{pmatrix} p-1\\ |u| \end{pmatrix}^{-1} (V_{u\cup \{i\} }-V_u)\\ &=& \frac{1}{p\mathrm{Var}(Y)} \sum_{u\subseteq -i} \begin{pmatrix} p-1\\ |u| \end{pmatrix}^{-1} \sum_{w\subseteq[1:k]}(V_{(u \cup i) \cap C_w}^{g,w}-V_{u\cap C_w}^{g,w})\\ &=& \frac{1}{p\mathrm{Var}(Y)} \displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. }j(i)\in w}} \sum_{u\subseteq -i} \begin{pmatrix} p-1\\ |u| \end{pmatrix}^{-1} (V_{(u \cup i) \cap C_w}^{g,w}-V_{u\cap C_w}^{g,w})\\ &=& \frac{1}{p\mathrm{Var}(Y)} \displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}} \sum_{u\subseteq C_w\setminus \{i\}} \left[\sum_{v \subseteq -C_w} \begin{pmatrix} p-1\\ |u\cup v| \end{pmatrix}^{-1} \right](V_{u\cup i}^{g,w}-V_{u}^{g,w})\\ &=& \frac{1}{p\mathrm{Var}(Y)}\displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}} \sum_{u\subseteq C_w\setminus \{i\}} \left[\sum_{j=0}^{p-|C_{w}|}\begin{pmatrix} p-|C_{w}|\\ j \end{pmatrix}\begin{pmatrix} p-1 \\ |u|+j \end{pmatrix}^{-1}\right](V_{u\cup i}^{g,w}-V_{u}^{g,w}). \end{eqnarray*} It remains to prove the following equation: \begin{eqnarray}\label{binom} \frac{1}{p}\sum_{j=0}^{p-|C_{w}|}\begin{pmatrix} p-|C_{w}|\\ j \end{pmatrix}\begin{pmatrix} p-1 \\ |u|+j \end{pmatrix}^{-1}=\frac{1}{|C_{w}|}\begin{pmatrix} |C_{w}|-1 \\ |u| \end{pmatrix}^{-1}. \end{eqnarray} In the interest of simplifying notation, until the end of the proof, we will write $u$ (resp. $c$) instead of $|u|$ (resp. $|C_{w}|$). We can verify that the equation \eqref{binom} is equivalent to the following equations: \begin{eqnarray}\label{bino} &&\frac{1}{p}\sum_{j=0}^{p-c}\frac{(p-c)!}{j!(p-c-j)!} \frac{(u+j)!(p-1-u-j)!}{(p-1)!}=\frac{1}{c}\frac{u!(c-1-u)!}{(c-1)!} \nonumber \\ & \Longleftrightarrow & \sum_{j=0}^{p-c}\begin{pmatrix} u+j\\u \end{pmatrix} \begin{pmatrix} p-1-u-j\\c-u-1 \end{pmatrix}=\begin{pmatrix} p\\ c \end{pmatrix}. \end{eqnarray} We will show \eqref{bino}. Now, we can remark that we have: \begin{equation} \frac{x^c}{(1-x)^{c+1}}=x\frac{x^u}{(1-x)^{u+1}}\frac{x^{c-u-1}}{(1-x)^{c-u}}. \end{equation} Giving their power series, we have: \begin{equation}\label{power} x \left( \sum_{k\geq0}\begin{pmatrix}k\\ u\end{pmatrix}x^k \right) \left( \sum_{k'\geq0}\begin{pmatrix}k'\\ c- u-1 \end{pmatrix}x^{k'} \right)= \sum_{k''\geq0}\begin{pmatrix} k''\\ c\end{pmatrix}x^{k''}. \end{equation} We have the equality of the coefficient of $x^p$. Then: \begin{eqnarray*} \begin{pmatrix} p\\c \end{pmatrix} &=& \sum_{k+k'=p-1}\begin{pmatrix} k\\u \end{pmatrix}\begin{pmatrix} k'\\c-u-1 \end{pmatrix} =\sum_{k=u}^{p-1}\begin{pmatrix} k\\u \end{pmatrix}\begin{pmatrix} p-1-k\\c-u-1 \end{pmatrix} =\sum_{j=0}^{p-1-u}\begin{pmatrix} u+j\\u \end{pmatrix}\begin{pmatrix} p-1-u-j\\c-u-1 \end{pmatrix}\\ &=&\sum_{j=0}^{p-c}\begin{pmatrix} u+j\\u \end{pmatrix}\begin{pmatrix} p-1-u-j\\c-u-1 \end{pmatrix}. \end{eqnarray*} For the last equality, we remark that if $j>p-c$, then $p-1-u-j<c-u-1$ so the last terms of the sum are equal to zero. We have proven \eqref{bino}. To conclude, we have \begin{eqnarray*} \eta_i&=&\frac{1}{p\mathrm{Var}(Y)}\displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}} \sum_{u\subseteq C_w\setminus \{i\}} \left[\sum_{j=0}^{p-|C_{w}|}\begin{pmatrix} p-|C_{w}|\\ j \end{pmatrix}\begin{pmatrix} p-1 \\ |u|+j \end{pmatrix}^{-1}\right] (V_{u \cup \{i\}} -V_{u})\\ &=&\displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}}S_w^g \frac{1}{|C_{w}| \mathrm{Var}(g_w(A_w)}\sum_{u\subseteq C_w\setminus \{i\}} \begin{pmatrix} |C_{w}|-1 \\ |u| \end{pmatrix}^{-1}(V_{u\cup i}^{g,w}-V_{u}^{g,w})\\ &=& \displaystyle\sum_{\substack{w\subseteq[1:k],\\ \text{s.t. } j(i)\in w}}S_w^g \eta_i^{g,w}. \end{eqnarray*} \qed \section*{References} \bibliographystyle{alpha}
\section{Introduction} \label{sec:I} A group of \emph{``leaders''}, or broadcasting agents, aims at getting the consensus of a variety of individuals. We identify each individual's opinion with a \emph{``position''} $x$ moving in ${\mathbb{R}}^N$. It is then natural to describe the leaders through their \emph{''positions''} $P_1, P_2, \ldots, P_k$, also in ${\mathbb{R}}^N$. We are thus lead to the general system of ordinary differential equation \begin{displaymath} \left\{ \begin{array}{l} \dot x = v\left(t, x, P_1 (t), \ldots, P_k (t)\right) \\ x (0) = \bar x \end{array} \right. \end{displaymath} $t$ being time. The vector field $v$ describes the interaction among individuals and agents, which can be attractive, repulsive, or a mixture of the two. Clearly, no linearity assumption can be reasonably required on $v$, otherwise the interaction between an agent and the individuals increases as the distance between them increases. The task of the agent $P_i$, be it attractive or repulsive, is to maximize its own consensus, i.e., to drive the maximal amount of individuals (or their opinions) as near as possible to its own target region $\mathcal{T}_i$ at time $T$, for a suitable non empty region $\mathcal{T}_i \subset {\mathbb{R}}^N$. The time horizon $T$ is finite and the same for all agents. A high number of individuals, as well as uncertainties in their initial positions or specific movements, suggests to describe the dynamics underneath the present problem through the continuity equation \begin{equation} \label{eq:25} \partial_t \rho + \div_x \left(\rho \; v\left(t, x, P_1 (t), \ldots, P_k (t)\right)\right) = 0 \,, \end{equation} where the description of each individual is substituted by that of the individuals' density distribution $\rho = \rho (t,x)$, while the goal of the $i$--th leader is formalized through the minimization of the quantity \begin{equation} \label{eq:26} \mathcal{J}_i = \int_{{\mathbb{R}}^N} \rho (T,x) \; d (x, \mathcal{T}_i) \, \d{x} \end{equation} where $d (x, \mathcal{T}_i) = \inf_{y \in \mathcal{T}_i} \norma{x-y}$ is the distance between the position $x$ and the target $\mathcal{T}_i$. Aim of this paper is to formalize the above setting, to provide basic well posedness theorems and to initiate the search for controls/strategies to tackle the above problem. Note that the case $k=1$ of a single broadcasting agent leads to a control problem, while the case $k>1$ of $k$ possibly competing agents fits into game theory. As it is usual in control theory, rather than the agents' positions $P_i$, it is preferable to use as controls/strategies the agents' speeds $u_i$, with $u_i \in {\mathbb{R}}^N$, subject to a boundedness constraint of the type $\norma{u_i} \leq U$, for a positive $U$. Introducing the initial individuals' distribution $\bar \rho$ and agents' positions $\bar P_1, \ldots, \bar P_k$, the dynamics is then described by the Cauchy Problem \begin{equation} \label{eq:1} \left\{ \begin{array}{l} \partial_t \rho + \div_x \left( \rho \; v\!\left(t, x, P_1 (t) , \ldots, P_k (t)\right) \right) = 0 \\ \rho (0,x) = \bar\rho (x) \end{array} \right. \; \mbox{ where } \; \left\{ \begin{array}{l} \dot P_i = u_i (t) \\ P_i (0) = \bar P_i \end{array} \right. \quad i=1, \ldots, k \end{equation} where the cost functionals $\mathcal J_i$ are as in~\eqref{eq:26}. This structure is amenable to the introduction of several control/game theoretic concepts, from optimal controls to Nash equilibria, and to the search for their existence. Below we initiate this study providing the basic analytic framework and tackling the problem of control/strategies to minimize costs of the type~\eqref{eq:26}. Various numerical integrations illustrate the rigorous results obtained. Note that the present setting, restricted to the case $N=2$, allows also to describe the individual--continuum interactions considered, for instance, in~\cite{ColomboMercier}, see also~\cite{ColomboGaravelloLecureux2012, ColomboHertyMercier}, and~\cite{ColomboPogodaev2012} where an entirely different analytic framework is exploited. From this point of view, the present work is related to the vast literature on crowd and swarm dynamics, see the recent works~\cite{MR3110059, MR3285315, MR3431278, 4118472, PiccoliPouradierScharf, MR3432849, MR3285316} or the review~\cite{BellomoDogbe} and the references therein. Concerning our choice of the conservation law~\eqref{eq:25}, we stress that typical of equations of this kind is the finite speed both of propagation of information and of the support of the density. This is in contrast with the typical situation in standard differential games ruled by parabolic equations. In the next section we first provide the basic notation and definitions, then we provide basic well posedness results and introduce a reasonable non anticipative strategy. Section~\ref{sec:NI} is devoted to sample applications, while all analytic proofs are deferred to Section~\ref{sec:TD}. \section{Analytic Results} \label{sec:AR} Throughout, the positive time $T$ and the maximal speed $U$ are fixed. For $a,b \in {\mathbb{R}}$, denote $\langle a, b \rangle = [\min\{a, b\}, \max \{a, b\}]$. By $\mathcal{L}^N$ we mean the Lebesgue measure in ${\mathbb{R}}^N$. The open, respectively closed, ball in ${\mathbb{R}}^m$ centered at $u$ with radius $U$ is $B_{{\mathbb{R}}^m}(u,U)$, respectively $\overline{B_{{\mathbb{R}}^m}(u,U)}$; when the space is clear, we shorten to $B(u,U)$ or $\overline{B(u,U)}$. In ${\mathbb{R}}$, $\modulo{\,\cdot\,}$ is the absolute value, while $\norma{\,\cdot\,}$ is the Euclidean norm in ${\mathbb{R}}^N$. The norm in the functional space $\mathcal{F}$ is denoted $\norma{\,\cdot\,}_{\mathcal{F}}$. The space $\C0 (A; {\mathbb{R}}^n)$ of the ${\mathbb{R}}^n$-valued functions defined on the subset $A$ of ${\mathbb{R}}^m$ is equipped with the norm $\norma{f}_{\C0 (A;{\mathbb{R}}^n)} = \sup_{x \in A} \norma{f (x)}$. Throughout, $\mathop\mathrm{TV} (\,\cdot\,)$ stands for the total variation, see~\cite[Chapter~5]{EvansGariepy}. For a measurable function $\rho$ defined on ${\mathbb{R}}^N$, $\mathop\mathrm{spt} \rho$ is its support, see~\cite[Proposition~4.17]{brezis}. Introduce $P \equiv (P_1, \ldots, P_k)$, so that $P \in {\mathbb{R}}^m$ with $m = k\,N$, and rewrite~\eqref{eq:1} as \begin{equation} \label{eq:4} \left\{ \begin{array}{l} \partial_t \rho + \div_x \left( \rho \; v\!\left(t, x, P (t)\right) \right) = 0 \\ \rho (0,x) = \bar\rho (x) \end{array} \right. \quad \mbox{ where } \quad \left\{ \begin{array}{l} \dot P = u (t) \\ P (0) = \bar P \,. \end{array} \right. \end{equation} Below, recurrent assumptions on the function $v$ in~\eqref{eq:4} are the following: \begin{description} \item[\emph{(v0)}:] The vector field $v \in \C0 ([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^m; {\mathbb{R}}^N)$ is such that for all $t \in [0,T]$ and $P \in {\mathbb{R}}^m$, the map $x \to v (t, x, P)$ is in $\C{0,1} ({\mathbb{R}}^N; {\mathbb{R}}^N)$. \item[\emph{(v1)}:] \textbf{\emph{(v0)}} holds and moreover \vspace{-0.5\baselineskip} \begin{itemize} \item for all $t \in [0,T]$ and $P \in {\mathbb{R}}^m$, the map $x \to v (t, x, P)$ is in $\C{1,1} ({\mathbb{R}}^N; {\mathbb{R}}^N)$; \item for all $t \in [0,T]$ and $x \in {\mathbb{R}}^N$, the map $P \to v (t, x, P)$ is in $\C{0,1} ({\mathbb{R}}^m; {\mathbb{R}}^N)$. \end{itemize} \end{description} \noindent We now prove well posedness and basic estimates for~\eqref{eq:1} or, equivalently, (\ref{eq:4}). \begin{proposition} \label{prop:0} Fix positive $T$ and $U$. Let $v$ satisfy~\textbf{(v0)}. For any $\bar\rho \in \L1 ({\mathbb{R}}^N; {\mathbb{R}})$, $\bar P \in {\mathbb{R}}^m$ and $u \in \L\infty ([0,T]; \overline{B_{{\mathbb{R}}^m}(0,U)})$, problem~\eqref{eq:4} admits the unique solution \begin{displaymath} \rho (t,x) = \bar\rho\left(X (0;t,x)\right) \exp \left( -\int_0^t \div_x v\left(\tau, X (\tau; t,x), P (\tau)\right) \d\tau \right) \end{displaymath} where $t \to X (t; \bar t, \bar x)$ solves $\left\{ \begin{array}{l@{}} \dot x = v\left(t,x,P (t)\right) \\ x (\bar t) = \bar x \end{array} \right.$ and $\displaystyle P (t) = \bar P + \int_0^t u (\tau)\d\tau$ for $t \in [0,T]$. Moreover, if $v$ satisfies~\textbf{(v1)} and $u_1,u_2 \in \L\infty ([0,T]; \overline{B_{{\mathbb{R}}^m} (0,U)})$, then (with obvious notation) for all $t \in [0,T]$, \begin{eqnarray} \label{eq:29} \norma{X_1 (t; 0, \bar x) - X_2 (t; 0, \bar x)} & \leq & C \, t \, e^{C\, t} \; \norma{P_1 - P_2}_{\C0 ([0,t]; {\mathbb{R}}^m)} \\ \label{eq:34} \norma{\rho_1 (t) - \rho_2 (t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} & \leq & C \, \Bigl( \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \mathcal{L}^N \! \left(B(\mathop\mathrm{spt}\bar\rho, C t e^{C t})\right) \\ \nonumber & & \qquad\qquad + \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \, (1 + C\, t) \Bigr) t \, e^{2Ct} \, \norma{P_1-P_2}_{\C0 ([0,t]; {\mathbb{R}}^m)} \end{eqnarray} where $C$ is independent of the initial datum, more precisely: \begin{equation} \label{eq:21} C = \max \left\{ \begin{array}{ll} \norma{v}_{\L\infty ([0,t]\times{\mathbb{R}}^N \times {\mathbb{R}}^m; {\mathbb{R}}^N)} , & \norma{D_x v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^{N\times N})} , \\ \norma{D_P v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^{N\times m})} , & \norma{\mathinner{\mathop{\rm grad}}_x \div_x v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^N)} \end{array} \right\} \,. \end{equation} \end{proposition} \noindent The proof is deferred to Section~\ref{sec:TD}. Here, the term \emph{``solution''} means Kru\v zkov solution~\cite[Definition~1]{kruzkov}, which is also a strong solution as soon as $\bar\rho$ is smooth. A straightforward consequence of the above Lemma is the following convergence result, which we state without proof. \begin{corollary} \label{cor:weak} Fix positive $T$ and $U$. Let $v$ be bounded and satisfy~\textbf{(v1)}, $\bar\rho \in \L1 ({\mathbb{R}}^N; {\mathbb{R}})$ and $\bar P \in {\mathbb{R}}^m$. If $u_n, u_* \in \L\infty ([0,T]; \overline{B_{{\mathbb{R}}^m} (0,U)})$ are such that $u_n \mathinner{\stackrel{\star}{\rightharpoonup}} u_*$ in $\L\infty ([0,T]; {\mathbb{R}}^m)$ as $n \to +\infty$, then, up to a subsequence, \begin{displaymath} P_n \to P_* \mbox{ in } \C0 ([0,T]; {\mathbb{R}}^N) \quad \mbox{ and } \quad \begin{array}{r@{\;}c@{\;}l@{\mbox{ in }}l} \rho_n (t) & \to & \rho_* (t) & \L1 ({\mathbb{R}}^N; {\mathbb{R}}) \mbox{ for all }t \in [0,T]\,, \\ \rho_n & \to & \rho_* & \C0\left([0,T]; \L1 ({\mathbb{R}}^N; {\mathbb{R}})\right) \,. \end{array} \end{displaymath} If $\bar\rho \in \C1 ({\mathbb{R}}^N;{\mathbb{R}})$, then $\begin{array}{rcll} \mathinner{\mathop{\rm grad}}_x \rho_n (t) & \to & \mathinner{\mathop{\rm grad}}_x \rho_* (t) & \mbox{ in } \L1 ({\mathbb{R}}^N; {\mathbb{R}}) \mbox{ for all }t \in [0,T] \\ \mathinner{\mathop{\rm grad}}_x \rho_n & \to & \mathinner{\mathop{\rm grad}}_x \rho_* & \mbox{ in } \C0\left([0,T]; \L1 ({\mathbb{R}}^N; {\mathbb{R}})\right) \end{array}$. \end{corollary} The $i$-th leader $P_i$ seeks a control $u_i \in \L\infty \big([0,T]; \overline{B (0,U)}\big)$ that minimizes the cost $\mathcal{J}_i = \int_{{\mathbb{R}}^N} \rho (T,x) \, \psi (x) \, \d{x}$, which reduces to~\eqref{eq:26} in the case $\psi (x) = d (x, \mathcal{T}_i)$. Assume first that $P_i$ knows in advance the strategies $u_j$, for $j \neq i$, of the other controllers $P_j$, so that its task amounts to minimize~\eqref{eq:5}. Corollary~\ref{cor:weak} ensures that \begin{equation} \label{eq:5} \begin{array}{ccccc} \mathcal{J}_i & \colon & \L\infty\left([0,T]; \overline{B (0,U)}\right) & \to & {\mathbb{R}} \\ & & u_i & \to & \displaystyle\int_{{\mathbb{R}}^N} \rho (T,x) \, \psi (x) \, \d{x} \end{array} \end{equation} is weak$\star$ continuous. Hence, by the weak$\star$ compactness of $\L\infty([0,T]; \overline{B (0,U)})$, there exists an optimal control $u_i^*$ that minimizes $\mathcal{J}_i$. Note however that this approach can hardly be used in a game theoretic setting, since it requires that $P_i$ is aware of all other strategies $u_j$, $j \neq i$, on the whole time interval $[0,T]$, which is unreasonable whenever different agents are competing. \smallskip We now proceed towards the definition of a non anticipative strategy. To this aim, we simplify the notation setting $P = P_i$, $u = u_i$, $\mathcal{J} = \mathcal{J}_i$ and comprising within the time dependence of the function $v$ all the other strategies $u_j$, for $j \neq i$. In this setting, we define a \emph{non anticipative} strategy $u$ for the controller $P$, i.e., a strategy $u = u (t)$ that depends only on $\rho$ at times $s \in \left[0, t\right[$. For a positive (suitably small) $\Delta t$, we seek the best choice of a speed $w \in \overline{B(0,U)}$ on the interval $[t, t+\Delta t]$ such that the solution $\rho_w = \rho_w (\tau,x)$ to \begin{equation} \label{eq:7} \left\{ \begin{array}{l} \partial_\tau \rho_w + \div_x \left( \rho_w \; v\!\left(t, x, P (t) + (\tau-t)w\right) \right) = 0 \\ \rho_w (t,x) = \rho (t, x) \end{array} \right. \qquad \tau \in [t, t+\Delta t] \end{equation} is likely to best contribute to decrease the value of $\mathcal{J}$. Remark that the dependence of $v$ on $t$ in~\eqref{eq:7} is \emph{frozen} at time $t$. It is this choice that will later lead to a non anticipative strategy. We now verify that~\eqref{eq:7} is well posed. \begin{lemma} \label{lem:1} Fix positive $T$, $U$, and $\Delta t \in ]0, T[$. Let $v \in \C{0,1} ([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N)$. For any $\bar\rho \in \L1 ({\mathbb{R}}^N; {\mathbb{R}})$, $\bar P \in {\mathbb{R}}^N$, $u \in \L\infty ([0,T]; \overline{B(0,U)})$, $t \in \left[0, T - \Delta t\right[$ and $w \in {\mathbb{R}}^N$, problem~\eqref{eq:7} admits a unique solution given by \begin{equation} \label{eq:28} \rho_w (\tau, x) = \rho \left(t, X_{t,w} (t; \tau, x)\right) \; \exp \left( -\int_t^\tau \div_x v\left(t, X_{t,w}(s; \tau, x), P (t) + (s-t) \, w\right) \d{s} \right) \end{equation} where \begin{equation} \label{eq:22} \tau \to X_{t,w} (\tau;\bar t,x) \quad \mbox{ solves } \quad \left\{ \begin{array}{l} \xi' = v \left(t, \xi, P (t) + (\tau-t)w\right) \\ \xi (\bar t) = x \end{array} \right. \mbox{ for } \bar t, \tau \in [t, t+\Delta t] \,. \end{equation} Moreover, if $\bar\rho \in \C{1,1} ({\mathbb{R}}^N; {\mathbb{R}})$ and $\mathcal{L}^N (\mathop\mathrm{spt} \bar\rho) < +\infty$, for all $w_1,w_2 \in {\mathbb{R}}^N$ \begin{equation} \label{eq:3} \begin{array}{rcl} & & \norma{\rho_{w_1} (t+\Delta t) - \rho_{w_2} (t+\Delta t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \\ & \leq & \left( \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \mathcal{L}^N \left( \mathop\mathrm{spt} \bar\rho, C e^{C \Delta t} \Delta t \right) + (1+C\,\Delta t) \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \right) \\ & & \quad \times C e^{2C \Delta t} \, (\Delta t)^2 \, \norma{w_1 - w_2} \end{array} \end{equation} where \begin{equation} \label{eq:14} C = \max \left\{ \begin{array}{l} \norma{v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times B (P (t), \Delta t \, U);{\mathbb{R}}^N)}, \\ \norma{D_x v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times B (P (t), \Delta t \, U); {\mathbb{R}}^{N\times N})}, \\ \frac12 \; \norma{D_P v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})}, \\ \norma{D_P \div_x v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \end{array} \right\} \end{equation} \end{lemma} \noindent (Above and in the sequel, $\xi' = \frac{\d\xi}{\d\tau}$). The proof of Lemma~\ref{lem:1} is deferred to Section~\ref{sec:TD}. \smallskip In the case of the functional~\eqref{eq:26}, a natural choice for the agent $P$ at time $t$ is then to choose a speed $w$ on the time interval $[t, t+\Delta t]$ to minimize the quantity \begin{equation} \label{eq:8} \mathcal{J}_{t, \Delta t} (w) = \int_{{\mathbb{R}}^N} \rho_w (t+\Delta t,x) \; \psi (x) \, \d{x} \,. \end{equation} \begin{proposition} \label{prop:1} Fix positive $T, U$, $\Delta t \in ]0, T[$, and fix a boundedly supported initial datum $\bar \rho \in \L1 ({\mathbb{R}}^N; {\mathbb{R}})$, $\bar P \in {\mathbb{R}}^N$, a speed law $v \in \C{0,1} ([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N)$ and a weight $\psi \in \L\infty ({\mathbb{R}}^N; {\mathbb{R}})$. Then, with the notation in~\eqref{eq:4} and~\eqref{eq:7}, for any $t \in \left[0, T\right[$ and $\Delta t \in \left]0, T-t\right]$ the map \begin{displaymath} \begin{array}{ccccc} \mathcal{J}_{t, \Delta t} & \colon & {\mathbb{R}}^N & \to & {\mathbb{R}} \\ & & w & \to & \displaystyle \int_{{\mathbb{R}}^N} \rho_w (t+\Delta t,x) \; \psi (x) \d{x} \end{array} \end{displaymath} is well defined and Lipschitz continuous. \end{proposition} \noindent The main theorem now follows, providing explicit information on a non anticipative optimal choice of $w$. \begin{theorem} \label{thm:bo} Fix positive $T$, $U$, and $\Delta t \in ]0, T[$. Let $v \in \C2 ([0,T]\times{\mathbb{R}}^N\times{\mathbb{R}}^N; {\mathbb{R}}^N)$, $\psi \in \L\infty ({\mathbb{R}}^N; {\mathbb{R}})$ and a boundedly supported $\bar\rho \in \C1 ({\mathbb{R}}^N; {\mathbb{R}})$. Define $\rho$ as the solution to~\eqref{eq:4} and $\rho_w$ as the solution to~\eqref{eq:7}, for a $w \in {\mathbb{R}}^N$. The map \begin{equation} \label{eq:33} \begin{array}{ccccc} \mathcal{J}_{t, \Delta t} & \colon & {\mathbb{R}}^N & \to & {\mathbb{R}} \\ & & w & \to & \displaystyle \int_{{\mathbb{R}}^N} \rho_w (t+\Delta t,x) \; \psi (x) \d{x} \end{array} \end{equation} admits the expansion \begin{equation} \label{eq:18} \mathcal{J}_{t, \Delta t} (w+\delta_w) = \mathcal{J}_{t, \Delta t} (w) + \mathinner{\mathop{\rm grad}}_w\mathcal{J}_{t, \Delta t} (w) \cdot \delta_w + o (\delta_w) \qquad \mbox{ as } w \to 0 \end{equation} where, as $\Delta t \to 0$, \begin{equation} \label{eq:24} \begin{array}{@{}r@{\;}c@{\;}l@{}} \!\!\!\!\!\! \mathinner{\mathop{\rm grad}}_w\mathcal{J}_{t, \Delta t} (w)\! & = \! & \displaystyle \dfrac{(\Delta t)^2}{2} \!\!\! \int_{{\mathbb{R}}^N} \!\! \Big[ \! \mathinner{\mathop{\rm grad}}_x \rho (t,x) D_P v\! \left(t, x, P (t)\right) \!\!-\!\! \rho (t,x) \mathinner{\mathop{\rm grad}}_P \div_x v \! \left(t, x, P (t)\right) \!\! \Big] \! \psi (x) \d{x} \\[20pt] & & + o (\Delta t)^2 . \end{array} \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \end{equation} \end{theorem} \noindent The proof is deferred to Section~\ref{sec:TD}. On the basis of Theorem~\ref{thm:bo}, the definition of an effective non anticipative strategy for $P_i$ can be easily achieved as follows. Split the interval $[0,T]$ in smaller portions $\left[ t_\ell , t_{\ell+1} \right[$, where $t_\ell = \ell \, \Delta t$. On each of them, define $u_i (t) = w_\ell$, where $w_\ell$ minimizes on $\overline{B (0,U)}$ the cost $\mathcal{J}_{t_\ell, \Delta t}$ defined in~\eqref{eq:33}. The leading term in the right hand side of~\eqref{eq:24} is independent of $w$, so that for $\Delta t$ small it is reasonable to choose \begin{displaymath} w_\ell = - \dfrac{ U \displaystyle\int_{{\mathbb{R}}^N} \Big[ \mathinner{\mathop{\rm grad}}_x \rho (t_\ell,x) \; D_P v \left(t_\ell, x, P_i (t_\ell)\right) - \rho (t_\ell,x) \; \mathinner{\mathop{\rm grad}}_P div_x v \left(t_\ell, x, P_i (t_\ell)\right) \Big] \psi (x) \d{x}}{\norma{\displaystyle\int_{{\mathbb{R}}^N} \Big[ \mathinner{\mathop{\rm grad}}_x \rho (t_\ell,x) \; D_P v\! \left(t_\ell, x, P_i (t_\ell)\right) - \rho (t_\ell,x) \; \mathinner{\mathop{\rm grad}}_P \div_x v \! \left(t_\ell, x, P_i (t_\ell)\right) \Big] \psi (x) \d{x}}} \end{displaymath} as long as the denominator above does not vanish, in which case we set $w_\ell=0$. Remark that, through the term $\rho_\ell$, the right hand side above depends on all the past values $w_0, \ldots, w_{\ell-1}$ attained by $u_i$. Formally, in the limit $\Delta t \to 0$, the above relations thus leads to a delayed integrodifferential equation. \section{Examples} \label{sec:NI} This section presents a few numerical integrations of the game~\eqref{eq:1}--\eqref{eq:26} in which a strategy is chosen as described in Section~\ref{sec:AR}. As the function $v$ in~\eqref{eq:1}, we choose \begin{equation} \label{eq:velocity-simulation} v (t, x, P) = \sum_{i = 1}^k a_i \left(\norma{x - P_i}\right) \, \left(P_i - x\right)\,, \end{equation} where $P \equiv (P_1, \ldots, P_k)$ and $a_i\colon {\mathbb{R}}^+ \to {\mathbb{R}}$, $i \in \left\{1, \cdots, k\right\}$, is chosen so that~\textbf{\emph{(v1)}} holds. In other words, at time $t$, the velocity $v (t, x, P)$ of the individual at $x$ is the sum of $k$ vectors, each of them parallel to the straight line through $x$ and the agent's position $P_i$ and its strength depends on the distance between $x$ and $P_i$. Typically, the functions $a_i$ is chosen so that for all $t$ and $P$, the map $x \to v (t, x, P)$ is either compactly supported, or vanishes as $\norma{x} \to +\infty$. Note that $a_i > 0$ whenever $P_i$ is attractive, while $a_i < 0$ in the repulsive case. In the examples below, the targets are single points and, correspondingly, the cost $\psi_i$ is the distance from that point. With reference to~\eqref{eq:4}, in each of the integrations below we use the Lax--Friedrichs algorithm~\cite[Section~4.6]{LeVequeBook2002} with dimensional splitting~\cite[Section~19.5]{LeVequeBook2002} to integrate the conservation law, while the usual explicit forward Euler method is adequate for the ordinary differential equation. To ease the presentations of the results, we fix the space dimension $N = 2$. Correspondingly, in each of the rectangular domains $\Omega$ considered below, we fix a rectangular regular grid consisting of $n_x \times n_y$ points. The treatment of the boundary $\partial\Omega$ is eased whenever the vector $v$ along $\partial\Omega$ points inward. \subsection{A Single Agent} \label{sse:1-agent-non-ant} Consider~(\ref{eq:4}) in the numerical domain $\Omega = [0, 10] \times [0, 10]$, with \begin{equation} \label{eq:piff-come-back} \begin{array}{@{}r@{\;}c@{\;}l@{}} N & = & 2 \,, \\ k & = & 1 \,, \\ m & = & 2 \,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} a_1 (\xi) & = & \frac{1}{\xi} \, e^{-\xi/10}\,, \\ v (t,x,P) & = & e^{-\norma{x-P_1}/10} \, (P_1-x) \,, \\ U & = & 3/2 \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \bar \rho & = & \caratt{[6,8]\times[2,8]}, \\ \bar P_1 & \equiv & (3,2), \end{array} \qquad \mathcal{T}_1 = \left\{(1,8)\right\} . \end{equation} We now compute the solution to~\eqref{eq:1} with $u$ piecewise constant given by the strategy~\eqref{eq:24}, constant on intervals $[j\, \Delta t, (j+1) \, \Delta t]$, where $\Delta t = 1/100$. The resulting solution, obtained on a grid of $6000 \times 6000$ cells, is displayed in Figure~\ref{fig:SingleAgent}. \begin{figure}[htpb] \centering \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0000.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0015.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0030.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0045.png}\\ \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0060.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0075.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{R3_double_0091.png}% \includegraphics[width=0.25\linewidth]{R3_double_traj.png}\\ \Caption{Numerical integration of~\eqref{eq:1} with the strategy~\eqref{eq:24} and the parameters~\eqref{eq:piff-come-back}. The first 7 figures depict the contour plots of the solution $\rho$ and the position of $P$, the bottom right diagram displays the trajectory of $P_1$, whose initial position is $\left(3,2\right)$, drawn as a black circle. Here, $\Delta t = 1/100$. Note that, in spite of the myopic nature of the strategy~\eqref{eq:24}, the leader first moves to the right and then turns back to the left.} \label{fig:SingleAgent} \end{figure} Remarkably, although the strategy~\eqref{eq:24} is fully \emph{myopic}, the leader $P_1$ does not move directly towards the target $\mathcal{T}_1$. On the contrary, it first moves to the right to \emph{collect} a higher quantity of individuals and then moves back to the left; see Figure~\ref{fig:SingleAgent}. The resulting cost~\eqref{eq:26} is $29.33$. \subsection{Two Competing Attractive Agents} We now test the strategy~\eqref{eq:24} against an \emph{a priori} assigned strategy. More precisely, we let $\Omega = [0, 10] \times [0, 10]$, with \begin{equation} \label{eq:23} \begin{array}{@{}r@{\;}c@{\;}l@{}} N & = & 2 \,, \\ k & = & 2 \,, \\ m & = & 4 \,, c \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} a_1 (\xi) & = & \frac{1}{\xi} \, e^{-\xi/5}\,, \\ a_2 (\xi) & = & \frac{1}{\xi} \, e^{-\xi/5}\,, \\ v (t,x,P) & = & \mbox{as in~\eqref{eq:velocity-simulation}} \,, \\ U & = & 3/2\,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \bar \rho & = & \caratt{[7,9]\times[3,7]}, \\ \bar P_1 & = & (8,5), \\ \bar P_2 & = & (8,5), \end{array} \qquad \begin{array}{@{}r@{\;}c@{\;}l@{}} \mathcal{T}_1 & = & \left\{(1, 9)\right\}, \\ \mathcal{T}_2 & = & \left\{(1, 1)\right\}. \end{array} \end{equation} Moreover, we first assign to $P_1$ the rectilinear trajectory \begin{equation} \label{eq:20} P_1 (t) = \left[ \begin{array}{@{}c@{}} 8\\5 \end{array} \right] + \left[ \begin{array}{@{}c@{}} -7/10\\ 2/5 \end{array} \right] t\,, \quad \mbox{ corresponding to } \quad u_1 (t) = \left[ \begin{array}{@{}c@{}} -7/10\\ 2/5 \end{array} \right] \,. \end{equation} The agent $P_1$ follows a rectilinear trajectory towards the target located at the point $\left(1, 9\right)$. At the final time $T = 10$, the cost of player $P_1$, when alone, is $11.73$, see Table~\ref{tab:paper1}. \begin{figure}[htpb] \centering \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0000.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0015.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0030.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0045.png}\\ \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0060.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0075.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{paper1_0091.png}% \includegraphics[width=0.25\linewidth]{paper1_traj.png}\\ \Caption{Numerical integration of~\eqref{eq:1}--\eqref{eq:23} with two players. $P_1$ is assigned strategy~\eqref{eq:20}, while $P_2$ uses~\eqref{eq:24} with $\Delta t = 1/100$. The first 7 figures depict the contour plots of the solution $\rho$, the bottom right diagram displays the trajectories of $P_1$ and $P_2$, whose initial positions are as in~\eqref{eq:23}. $P_2$ wins.} \label{fig:paper1} \end{figure} Then, we insert also the player $P_2$, assigning its strategy $u_2$ by means of~\eqref{eq:24}. The result is shown in Figure~\ref{fig:paper1}: strategy~\eqref{eq:24} leads to the victory of $P_2$. Here, $P_2$ first moves slightly up, superimposing its attraction to that of $P_1$. Then, it bends downwards attracting more individuals than $P_1$; see Figure~\ref{fig:paper1}. The agent $P_2$ goes initially towards the target located at $\left(1, 1\right)$, but, after a small amount of time, it turns up, attracting more individuals than $P_1$. The results pertaining the costs $\mathcal{J}_1$ and $\mathcal{J}_2$ are summarized in Table~\ref{tab:paper1}. \begin{table}[htpb] \centering \begin{tabular}{ccccc} Strategy of $P_1$ & Strategy of $P_2$ & Cost $\mathcal{J}_1$ of $P_1$ & Cost $\mathcal{J}_2$ of $P_2$ \\ \eqref{eq:20} & (absent) & $11.73$ & // \\ \eqref{eq:20} & \eqref{eq:24} & $36.41$ & $32.65$ \\ \eqref{eq:24} & \eqref{eq:24} & $33.42$ & $33.42$ \end{tabular} \Caption{Values of the costs $\mathcal{J}_1$ and $\mathcal{J}_2$ resulting from~\eqref{eq:1}--\eqref{eq:23} with different strategies. On the first line, $P_1$ plays alone. The second line shows that strategy~\eqref{eq:24} wins against~\eqref{eq:20}. The third line correctly shows that, in a symmetric situation, if both players use strategy~\eqref{eq:24} the result is even.} \label{tab:paper1} \end{table} Note the sharp increase in the cost $\mathcal{J}_1$ due to $P_2$ entering the game. The last line confirms that if the two players have the same effect on the individuals, the initial configuration is symmetric and both players use strategy~\eqref{eq:24}, then the players break even. \subsection{Automatic Cooperation among Repulsive Agents} The strategy introduced in Section~\ref{sec:AR} fosters a sort of \emph{cooperation} among agents having the same goal. Consider~\eqref{eq:4} with cost~\eqref{eq:26} and parameters, where $i=1, \ldots, 6$, \begin{equation} \label{eq:35} \begin{array}{@{}r@{\;}c@{\;}l@{}} N & = & 2 \,, \\ k & = & 6 \,, \\ m & = & 12 \,, \\ T & = & 5 \,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} a_i (\xi) & = & - \frac{1}{\xi} \, e^{-\xi/5}\,, \\ v (t,x,P) & = & \mbox{as in~\eqref{eq:velocity-simulation}} \,, \\ U & = & 1\,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \bar \rho & = & \caratt{[6,8]\times[3,7]}, \\ \bar P_1 & = & (1,2), \\ \bar P_2 & = & (1,4), \\ \bar P_3 & = & (1,6), \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \bar P_4 & = & (1,8), \\ \bar P_5 & = & (9,4), \\ \bar P_6 & = & (9,6), \\ \mathcal{T}_i & = & \left\{(5, 5)\right\}. \end{array} \end{equation} Then, the application of the strategy defined in Section~\ref{sec:AR} automatically results in a team play, see Figure~\ref{fig:repulsion6}. \begin{figure}[htpb] \centering \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{repulsion6_0000.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{repulsion6_0010.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{repulsion6_0020.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{repulsion6_0030.png}% \Caption{Integration of~\eqref{eq:4} with parameters~\eqref{eq:35}. The $6$ players are assigned the same target and automatically cooperate. After time $T=5$, a portion of the individuals escapes the numerical domain, distorting the computation of the cost.} \label{fig:repulsion6} \end{figure} This integration is computed through a grid $3000 \times 3000$. The resulting final cost, common to all players, is $10.54$. \subsection{Competition/Cooperation among Attractive/Repulsive Agents} Finally, the following integrations of~\eqref{eq:4} show first that cooperation arises also between attractive and repulsive agents. Then, it emphasizes the clear difference between cooperation and competition. Consider first the case \begin{equation} \label{eq:36} \begin{array}{@{}r@{\;}c@{\;}l@{}} N & = & 2 \,, \\ k & = & 3 \,, \\ m & = & 6 \,, \\ T & = & 5 \,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} a_1 (\xi) = a_3 (\xi) & = & - \frac{1}{\xi} \, e^{-\xi/5}\,, \\ a_2 (\xi) & = & \frac{1}{\xi} \, e^{-\xi/5}\,, \\ v (t,x,P) & = & \mbox{as in~\eqref{eq:velocity-simulation}} \,, \\ U & = & 1\,, \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \bar \rho & = & \caratt{[1,2]\times[3,7]}, \\ \bar P_1 & = & (1,1), \\ \bar P_2 & = & (1,5), \\ \bar P_3 & = & (1,9), \end{array} \qquad \begin{array}{r@{\;}c@{\;}l@{}} \mathcal{T}_1 & = & \left\{(9, 5)\right\}. \end{array} \end{equation} whose solution is depicted in Figure~\ref{fig:attr-rep}, first line. \begin{figure}[htpb] \centering \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12C_0000.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12C_0015.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12C_0030.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12C_0045.png}\\ \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12NC_0000.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12NC_0015.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12NC_0030.png}% \includegraphics[width=0.245\linewidth,trim=75 30 30 10]{attrrep12NC_0045.png}% \Caption{Upper line, integration of~\eqref{eq:4} with parameters~\eqref{eq:36} and with the same cost for all players $\psi_1 (x) = \psi_2 (x) = \psi_3 (x) = d (x, \mathcal{T}_1)$. In the lower line, we set $\psi_1 = \psi_3 = -\psi_2$ as in~\eqref{eq:37}. As a result, $P_1$ and $P_3$ \emph{steal} most of the followers to $P_2$. In both cases, $P_1$ and $P_3$ are repulsive, while $P_2$ is attracting.} \label{fig:attr-rep} \end{figure} The final cost is $2.04$, the density $\rho$ being highly concentrated near to the target $\mathcal{T}_1$. Then, we keep the same parameters, but modify the costs of $P_1$ and $P_3$ setting \begin{equation} \label{eq:37} \psi_1 (x) = \psi_3 (x) = - d (x, \mathcal{T}_1) \quad \mbox{ and } \quad \psi_2 (x) = d (x, \mathcal{T}_1) \,. \end{equation} The resulting evolution is in Figure~\ref{fig:attr-rep}, second line. Note that $P_1$ and $P_3$ follow now a quite different trajectory, \emph{``cutting''} the density $\rho$ so that the final cost of $P_2$ raises to $26.68$. In both integrations, the mesh consists of $3000 \times 3000$ points. \section{Technical Details} \label{sec:TD} Throughout, the continuous dependence of $V$ and $v$ on $t$ can be easily relaxed to mere measurability. In view of the applications below, the following result on ordinary differential equations deserves being recalled. \begin{lemma}[{\cite[Chapter~3]{BressanPiccoliBook}}] \label{lem:ode} Let $V_1, V_2 \in \C{0} ([0,T] \times {\mathbb{R}}^N; {\mathbb{R}}^N)$ be such that the maps $x \to V_i (t,x)$ are in $\C{0,1} ({\mathbb{R}}^N; {\mathbb{R}}^N)$ for $i=1,2$ and for all $t \in [0,T]$. Then, for all $(\bar t, \bar x) \in [0,T] \times {\mathbb{R}}^N$ and $i \in \left\{1, 2\right\}$, the Cauchy Problem \begin{equation} \label{eq:10} \left\{ \begin{array}{l} \dot x = V_i (t,x) \\ x (\bar t) = \bar x \end{array} \right. \end{equation} admits, on the interval $[0,T]$, the unique solution $t \to X_i (t; \bar t, \bar x)$ and the following estimate holds, for all $t \in [0,T]$: \begin{equation} \label{eq:12} \begin{split} \norma{X_1 (t; \bar t, \bar x) - X_2 (t; \bar t, \bar x)} \le {} & \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \\ & \times \exp \left( \norma{D_x V_2}_{\L\infty(\langle \bar t, t\rangle \times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t} \right) \,. \end{split} \end{equation} If moreover $x \to V_i (t, x) \in \C1 ({\mathbb{R}}^N; {\mathbb{R}}^N)$ for all $t \in [0,T]$, the map $x \to X_i (t; \bar t, \bar x)$ is differentiable and its derivative $t \to D_x X_i (t; \bar t, \bar x)$ solves the linear matrix ordinary differential equation \begin{equation} \label{eq:2} \left\{ \begin{array}{l} \dot Y = D_x V_i\left(t, X_i (t; \bar t, \bar x)\right) \, Y \\ Y (\bar t) = \mathop{\mathbf{Id}} \,. \end{array} \right. \end{equation} \end{lemma} \begin{lemma} \label{lem:CL1} Let $V \in \C{0} ([0,T] \times {\mathbb{R}}^N; {\mathbb{R}}^N)$ be such that the map $x \to V (t,x)$ is in $\C{1} ({\mathbb{R}}^N; {\mathbb{R}}^N)$ for $i = 1, 2$ and for all $t \in [0,T]$. Then, for all $\bar t \in \left[0,T\right[$, $i \in \left\{1,2\right\}$, and $\bar \rho \in \L1 ({\mathbb{R}}^N; {\mathbb{R}})$, the Cauchy Problem \begin{equation} \label{eq:6} \left\{ \begin{array}{l} \partial_t \rho + \div_x \left(\rho \, V (t,x)\right) = 0 \\ \rho (\bar t, x) = \bar \rho (x) \end{array} \right. \end{equation} admits, on the interval $[\bar t,T]$, the unique {Kru\v zkov} solution \begin{equation} \label{eq:9} \rho (t,x) = \bar\rho\left(X (\bar t; t, x)\right) \; \exp \left( -\int_{\bar t }^t \div_x V\left(\tau, X (\tau;t,x)\right) \d\tau \right) \end{equation} and if $\mathop\mathrm{spt}\bar\rho$ is bounded, then \begin{equation} \label{eq:11} \mathop\mathrm{spt} \rho (t) \subseteq B \left( \mathop\mathrm{spt}\rho (\bar t), \norma{V}_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt} \bar\rho; {\mathbb{R}}^N)} \modulo{t-\bar t}\, e^{\norma{D_x V}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t}} \right) . \end{equation} \end{lemma} \begin{proof} The fact that~\eqref{eq:9} solves~\eqref{eq:6} in {Kru\v zkov} sense follows from~\cite[Lemma~5.1]{ColomboHertyMercier}. To prove~\eqref{eq:11}, compute \begin{eqnarray*} \norma{X (t; \bar t, x) - x} & \leq & \modulo{\int_{\bar t}^t \norma{V \left(\tau; X (\tau; \bar t, x)\right)} \d\tau} \\ & \leq & \modulo{ \int_{\bar t}^t \left( \norma{V (\tau, x)} + \norma{V \left(\tau; X (\tau; \bar t, x)\right) - V (\tau,x)} \right) \d\tau } \\ & \leq & \norma{V }_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt} \bar\rho; {\mathbb{R}}^N)} \modulo{t-\bar t} \\ & &\quad + \modulo{ \int_{\bar t}^t \norma{D_x V}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \norma{X (\tau;\bar t, x) - x} \d\tau } \end{eqnarray*} and by Gr\"onwall Lemma, see, e.g., \cite[Chapter~3, Lemma~3.1]{BressanPiccoliBook}, \begin{displaymath} \norma{X (t; \bar t, x) - x} \leq \norma{V }_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt} \bar\rho; {\mathbb{R}}^N)} \, \modulo{t-\bar t} \; e^{\norma{D_x V}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t}} \,, \end{displaymath} completing the proof. \end{proof} \begin{lemma} \label{lem:CL2} Let $V_1, V_2 \in \C{0} ([0,T] \times {\mathbb{R}}^N; {\mathbb{R}}^N)$ be such that both maps $x \to V_i (t,x)$, $i = 1, 2$, are in $\C{1,1} ([0,T]\times{\mathbb{R}}^N; {\mathbb{R}}^N)$. If $\bar\rho \in \C{0,1} ({\mathbb{R}}^N;{\mathbb{R}})$, then \begin{eqnarray*} \!\!\!\!\!\! & & \norma{\rho_1 (t)-\rho_2 (t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \\ \!\!\!\!\!\! & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \;\, \mathcal{L}^N \! \left( \mathop\mathrm{spt} \bar\rho, C e^{C \modulo{t-\bar t}} \modulo{t-\bar t} \right) e^{2C \modulo{t-\bar t}} \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \\ \!\!\!\!\!\! & & \!\! + \left( \norma{\div_x (V_1 - V_2)}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}})} + C \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \right) \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} e^{2C \modulo{t-\bar t}} \modulo{t-\bar t} \end{eqnarray*} where \begin{equation} \label{eq:13} C = \max_{i=1,2} \left\{ \begin{array}{l} \norma{V_i}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \\ \norma{D_x V_i}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \\ \norma{\mathinner{\mathop{\rm grad}}_x \div_x V_i}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \end{array} \right\} \,. \end{equation} \end{lemma} \begin{proof} Using~\eqref{eq:9} and the triangle inequality, we have \begin{displaymath} \norma{\rho_1 (t) - \rho_2(t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \leq (I) + (II) + (III) \end{displaymath} where \begin{eqnarray*} (I) & = & \int_{{\mathbb{R}}^N} \modulo{\bar\rho \left(X_1 (\bar t; t, x)\right) - \bar\rho \left(X_2 (\bar t; t, x)\right)} \exp\modulo{\int_{\bar t}^t \div_x V_1 \left(\tau, X_1 (\tau; t, x)\right) \d\tau} \d{x} \\ (II) & = & \int_{{\mathbb{R}}^N} \bar\rho\left(X_2 (\bar t; t, x)\right) \\ & \times & \!\!\! \modulo{ \exp\left[-\int_{\bar t}^t \div_x V_1\left(\tau, X_1 (\tau; t, x)\right) \d\tau\right] - \exp\left[-\int_{\bar t}^t \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) \d\tau\right] } \d{x} \\ (III) & = & \int_{{\mathbb{R}}^N} \bar\rho\left(X_2 (\bar t; t, x)\right) \\ & \times & \!\!\! \modulo{ \exp\left[-\int_{\bar t}^t \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) \d\tau\right] - \exp\left[-\int_{\bar t}^t \div_x V_2\left(\tau, X_2 (\tau; t, x)\right) \d\tau\right] } \d{x} \end{eqnarray*} and we now bound the three terms separately. To estimate $(I)$, observe that by~\eqref{eq:11} \begin{displaymath} \bigcup_{i=1}^2 \mathop\mathrm{spt} \rho_i (t) \subseteq B\left(\mathop\mathrm{spt} \bar\rho, \max_{i=1,2} \norma{V_i}_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt}\bar\rho; {\mathbb{R}}^N)} \exp \left( \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \modulo{t-\bar t} \right) \modulo{t-\bar t} \right) \end{displaymath} and, using~\eqref{eq:12}, \begin{eqnarray*} (I) & = & \int_{\bigcup_{i=1}^2 \mathop\mathrm{spt} \rho_i (t)} \modulo{ \bar\rho \left(X_1 (\bar t; t, x)\right) - \bar\rho \left(X_2 (\bar t; t, x)\right)} \exp\modulo{\int_{\bar t}^t \div_x V_1 \left(\tau, X_1 (\tau; t, x)\right) \d\tau} \d{x} \\ & \leq & \int_{\bigcup_{i=1}^2 \mathop\mathrm{spt} \rho_i (t)} \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \norma{X_1 (\bar t; t, x) - X_2 (\bar t; t, x)} \\ & & \qquad\qquad\times \exp \left(\norma{D_x V_1}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \modulo{t-\bar t}\right) \d{x} \\ & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \\ & & \times \mathcal{L}^N \! \left( \mathop\mathrm{spt}\bar\rho, \max_{i=1,2} \norma{V_i}_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt}\bar\rho; {\mathbb{R}}^N)} \exp \left( \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t}\right) \modulo{t-\bar t}\right)\; \\ & & \quad \times \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \\ & & \quad \times \exp \left( \left( \norma{D_x V_1}_{\L\infty ((\langle \bar t, t\rangle \times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} + \norma{D_x V_2}_{\L\infty ((\langle \bar t, t\rangle \times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})}\right) \modulo{t-\bar t} \right) \,. \end{eqnarray*} Passing to the estimate of $(II)$, using the inequality $\modulo{e^a - e^b} \leq e^{\max\{a,b\}} \modulo{a-b}$, \begin{eqnarray*} & & \modulo{ \exp\left(-\int_{\bar t}^t \div_x V_1\left(\tau, X_1 (\tau; t, x)\right) \d\tau\right) - \exp\left(-\int_{\bar t}^t \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) \d\tau\right) } \\ & \leq & \exp\left( \max_{i=1,2} \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \, \modulo{t-\bar t} \right) \\ & & \quad \times \modulo{ \int_{\bar t}^t \modulo{ \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) - \div_x V_1\left(\tau, X_1 (\tau; t, x)\right) } \d\tau } \\ & \leq & \exp\left( \max_{i=1,2} \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \, \modulo{t-\bar t} \right) \; \norma{\div_x V_1 - \div_x V_2}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}})} \; \modulo{t-\bar t} \end{eqnarray*} so that \begin{eqnarray*} (II) & \leq & \exp\left( \max_{i=1,2} \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \, \modulo{t-\bar t} \right) \; \norma{\div_x (V_1 - V_2)}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}})} \\ & &\quad \times \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; \modulo{t-\bar t} \,. \end{eqnarray*} To bound $(III)$, use~\eqref{eq:12} and proceed similarly: \begin{eqnarray*} & & \modulo{ \exp\left( -\int_{\bar t}^t \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) \d\tau \right) - \exp\left( -\int_{\bar t}^t \div_x V_2\left(\tau, X_2 (\tau; t, x)\right) \d\tau \right) } \\ & \leq & \exp\left( \norma{D_x V_2}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t}\right) \\ & & \quad \times \modulo{ \int_{\bar t}^t \modulo{ \div_x V_2\left(\tau, X_1 (\tau; t, x)\right) - \div_x V_2\left(\tau, X_2 (\tau; t, x)\right) }\d\tau } \\ & \leq & \exp\left( 2 \norma{D_x V_2}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t}\right) \; \norma{\mathinner{\mathop{\rm grad}}_x \div_x V_2}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \\ & & \qquad \times \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \; \modulo{t-\bar t} \end{eqnarray*} so that \begin{eqnarray*} (III) & \leq & \exp\left( 2\norma{D_x V_2}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t} \right) \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; \norma{\mathinner{\mathop{\rm grad}}_x \div_x V_2}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \\ & & \qquad \times \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \; \modulo{t-\bar t} \end{eqnarray*} Summing up the expressions obtained: \begin{eqnarray*} & & \norma{\rho_1 (t)-\rho_2 (t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \\ & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \\ & & \quad \times \mathcal{L}^N\left(\mathop\mathrm{spt}\bar\rho, \max_{i=1,2} \norma{V_i}_{\L\infty (\langle\bar t, t\rangle \times \mathop\mathrm{spt}\bar\rho)} \exp \left( \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N)} \modulo{t-\bar t}\right) \modulo{t-\bar t}\right) \\ & & \quad \times \exp \left( \left( \norma{D_x V_1}_{\L\infty ((\langle \bar t, t\rangle \times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} + \norma{D_x V_2}_{\L\infty ((\langle \bar t, t\rangle \times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})}\right) \modulo{t-\bar t} \right) \\ & & + \exp\left[ \max_{i=1,2} \norma{D_x V_i}_{\L\infty (\langle \bar t, t \rangle \times {\mathbb{R}}^N)} \modulo{t-\bar t} \right] \norma{\div_x (V_1 - V_2)}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}})} \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \modulo{t-\bar t} \\ & & + \exp\left( 2\norma{D_x V_2}_{\L\infty (\langle\bar t, t \rangle \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} \modulo{t-\bar t} \right) \; \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; \norma{\mathinner{\mathop{\rm grad}}_x \div_x V_2}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}}^N)} \\ & & \qquad \times \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))}\; \modulo{t-\bar t} \end{eqnarray*} Introduce $C$ as in~\eqref{eq:13}. Then, \begin{eqnarray*} & & \norma{\rho_1 (t)-\rho_2 (t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \\ & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \mathcal{L}^N \left( \mathop\mathrm{spt} \bar\rho, C e^{C \modulo{t-\bar t}} \modulo{t-\bar t} \right) e^{2C \modulo{t-\bar t}} \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} \\ & & + \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; e^{2C \modulo{t-\bar t}} \; \norma{\div_x (V_1 - V_2)}_{\L\infty (\langle\bar t, t\rangle \times {\mathbb{R}}^N; {\mathbb{R}})} \; \modulo{t-\bar t} \\ & & + \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; C\; e^{2C \modulo{t-\bar t}} \; \norma{V_1-V_2}_{\L1 (\langle \bar t, t\rangle; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))}\; \modulo{t-\bar t} \end{eqnarray*} completing the proof. \end{proof} \begin{proofof}{Proposition~\ref{prop:0}} The first statement follows from~Lemma~\ref{lem:CL1}. Define $V_i (t,x) = v \left(t, x, P_i (t)\right)$, with $P_i (t) = \bar P +\int_0^t u_i (\tau) \d\tau$, for $i=1,2$. Then, direct computations yield: \begin{eqnarray*} \norma{V_i}_{\L\infty ([0,t]\times{\mathbb{R}}^N; {\mathbb{R}}^N)} & \leq & \norma{v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times {\mathbb{R}}^m; {\mathbb{R}}^N)} \,. \\ \norma{D_x V_i}_{\L\infty ([0,t]\times{\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} & = & \norma{D_x v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^{N\times N)}} \,. \\ \norma{\mathinner{\mathop{\rm grad}}_x \div_x V_i}_{\L\infty ([0,t]\times{\mathbb{R}}^N; {\mathbb{R}}^N)} & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \div_x v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^N)} \,. \\ \norma{V_1 - V_2}_{\L1 ([0,t]; \L\infty ({\mathbb{R}}^N; {\mathbb{R}}))} & = & \int_0^t \sup_{x\in {\mathbb{R}}^N} \norma{ v\left(\tau, x, P_1 (\tau)\right) - v\left(\tau, x, P_2 (\tau)\right) } \d\tau \\ & \leq & \norma{D_P v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}}^{N\times m})} \, t \, \norma{P_1 - P_2}_{\L\infty ([0,t]; {\mathbb{R}}^m)} \,. \\ \norma{\div_x (V_1 - V_2)}_{\L\infty ([0,t]\times{\mathbb{R}}^N; {\mathbb{R}})} & \leq & \norma{\div_x v}_{\L\infty ([0,t]\times{\mathbb{R}}^N\times{\mathbb{R}}^m; {\mathbb{R}})} \, \norma{P_1 - P_2}_{\L\infty ([0,t]; {\mathbb{R}}^N)} \,. \end{eqnarray*} Now, \eqref{eq:29} directly follows from~\eqref{eq:12} in Lemma~\ref{lem:ode}. To prove~\eqref{eq:34} use Lemma~\ref{lem:CL2}. \end{proofof} We recall here, without proof, the following result about G\^ateaux and Fréchet differentiability for later use. \begin{lemma}[{\cite[Lemma~1.15]{Schwartz}}] \label{lem:A2} Let $X,Y$ be Banach spaces, $A \subseteq X$ be open, $x_o \in A$ and $J \colon A \to Y$ be a map. Assume \begin{enumerate} \item $J$ is G\^ateaux differentiable at all $x \in A$ in all directions $v \in X$; \item the map $v \to D_vJ (x)$ is linear and continuous for all $x \in A$; \item $\lim\limits_{x \to x_o} \sup\limits_{\norma{v}_X = 1} \norma{D_v J (x) - D_v J (x_o)}_Y = 0$. \end{enumerate} \noindent Then, $J$ is Fréchet differentiable at $x_o$. \end{lemma} The next result describes the Fréchet differentiability of the characteristic curves. \begin{lemma} \label{lem:DX} Fix $t \in \left[0,T\right[$, $\Delta t \in \left]0, T-t \right]$ and $x \in {\mathbb{R}}^N$. If $v \in \C2 ([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N)$, then the map \begin{displaymath} \begin{array}[b]{ccccc} \mathcal{X}_{t,x} & \colon & {\mathbb{R}}^N & \to & \C0 ([t, t+\Delta t]; {\mathbb{R}}^N) \\ & & w & \to & \mathcal{X}_{t,x} (w) \,, \end{array} \end{displaymath} defined so that $\tau \to \left(\mathcal{X}_{t,x} (w)\right) \! (\tau)$ solves the Cauchy problem \begin{equation} \label{eq:30} \left\{ \begin{array}{@{}l@{\,}} \xi' = v \left(t, \xi, P (t) + (\tau-t)w\right) \\ \xi (t) = x \,, \end{array} \right. \end{equation} is Fréchet differentiable in ${\mathbb{R}}^N$. Moreover $\mathcal{X}_{t,x}$ has the Taylor expansion \begin{displaymath} \mathcal{X}_{t,x} (w + \delta_w) = \mathcal{X}_{t,x} (w) + D\mathcal{X}_{t,x} (w) \, \delta_w + o (\delta_w) \quad \mbox{in } \C0 \mbox{ as } \delta_w \to 0 \end{displaymath} where $\tau \to \left(D\mathcal{X}_{t,x} (w)\right) (\tau)$ solves the linear first order $N \times N$ matrix differential equation \begin{equation} \label{eq:17} \left\{ \begin{array}{l} Y' = D_x v\left( t,\mathcal{X}_{t,x} (w) (\tau), P (t) + (\tau-t)w \right) Y \vspace{.2cm}\\ \qquad\qquad + (\tau - t) \, D_P v\left( t, \mathcal{X}_{t,x} (w) (\tau), P (t)+ (\tau-t) w \right) \vspace{.2cm}\\ Y (t) = 0 \end{array} \right. \end{equation} and the term $D\mathcal{X}_{t,x} (w)$ satisfies the expansion, as $\tau \to t$, \begin{equation} \label{eq:19} \left(D\mathcal{X}_{t,x} (w)\right) (\tau) = \dfrac{(\tau-t)^2}{2} \, D_P v\left(t, x, P (t)\right) + o (\tau-t)^2 \,. \end{equation} \end{lemma} \begin{proof} Since $t$ and $x$ are kept fixed throughout this proof, we write $\mathcal{X} (w)$ for $\mathcal{X}_{t,x} (w)$. Recall that, for $\tau \in [t, t + \Delta t]$, \begin{displaymath} \mathcal{X} (w) (\tau) = x + \int_t^\tau v\left( t, \mathcal{X} (w) (s), P (t) + (s-t)w \right) \d{s} \,. \end{displaymath} Fix a direction $\delta_w \in {\mathbb{R}}^N \setminus\{0\}$. First we show the boundedness of the difference quotient \begin{equation*} \frac{\norma{\mathcal{X} (w+\epsilon\delta_w) (\tau) - \mathcal{X} (w) (\tau)}}{\epsilon}. \end{equation*} For $\tau \in [t , t + \Delta t]$, we have \begin{align*} & \frac{1}{\epsilon} \norma{\mathcal{X} (w+\epsilon\delta_w) (\tau) - \mathcal{X} (w) (\tau)} \\ \le & \frac{1}{\epsilon}\int_t^\tau \norma{ v\left(t,\mathcal{X} (w+\epsilon\delta_w) (s), P (t) + (s-t) (w+\epsilon\delta_w)\right) {-} v\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) } \! \d{s} \\ \le & \frac{1}{\epsilon} \int_t^\tau \bigl\| v\left(t,\mathcal{X} (w+\epsilon\delta_w) (s), \!P (t) \!+ \! (s-t) (w+\epsilon\delta_w)\right) \!-\! v\left(t, \mathcal{X} (w) (s),\! P (t) \!+\! (s-t)(w+\epsilon\delta_w)\right) \bigr\|\! \d{s} \\ & + \frac{1}{\epsilon} \int_t^\tau \norma{ v\left(t,\mathcal{X} (w) (s), P (t) + (s-t) (w+\epsilon\delta_w)\right) - v\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) } \d{s} \\ \le & \norma{v}_{\C1\left([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N\right)} \left[ \int_t^\tau \frac{\norma{\mathcal{X} (w+\epsilon\delta_w) (s) - \mathcal{X} (w) (s)}} {\epsilon} \d{s} + \int_t^\tau (s-t) \norma{\delta_w} \d{s} \right] \\ \le & \norma{v}_{\C1\left([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N\right)} \left[ \int_t^\tau \frac{\norma{\mathcal{X} (w+\epsilon\delta_w) (s) - \mathcal{X} (w) (s)}} {\epsilon} \d{s} + \left(\Delta t\right)^2 \norma{\delta_w} \right]. \end{align*} Hence an application of Gr\"onwall Lemma, see, e.g., \cite[Chapter~3, Lemma~3.1]{BressanPiccoliBook} ensures that \begin{equation} \label{eq:bound_diff_quot} \frac{\norma{\mathcal{X} (w+\epsilon\delta_w) (\tau) - \mathcal{X} (w) (\tau)}} {\epsilon} \le K_1 \left(\Delta t\right)^3 \norma{\delta_w} \exp\left(K_1 \Delta t\right), \end{equation} where $K_1 = \norma{v}_{\C1\left([0,T] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N\right)}$. Consequently \begin{equation} \label{eq:27} \lim_{\epsilon \to 0} \sup_{\tau \in [t, t+\Delta t]} \norma{\mathcal{X} (w+\epsilon\delta_w) (\tau) - \mathcal{X} (w) (\tau)} = 0 \,. \end{equation} We now prove the existence of directional derivatives of $\mathcal{X}$ along the direction $\delta_w \in {\mathbb{R}}^N \setminus\{0\}$. Calling $\tau \to Y (\tau)$ the solution to the Cauchy problem~\eqref{eq:17}, we have \begin{eqnarray*} & & \dfrac{\mathcal{X} (w + \epsilon \delta_w) (\tau) - \mathcal{X} (w) (\tau)}{\epsilon} - Y (\tau) \; \delta_w \\ & = & \! \dfrac{1}{\epsilon} \! \int_t^\tau \!\! \left[ v \! \left( t, \mathcal{X} (w+\epsilon \delta_w) (s), P (t) + (s-t)(w+\epsilon \delta_w) \right) - v \! \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \!\right] \! \d{s} \\ & & - \int_t^\tau D_xv\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) Y (s) \d{s} \, \delta_w \\ & & - \int_t^\tau (s-t) D_P v \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \d{s} \; \delta_w \\ & = & \dfrac{1}{\epsilon} \int_t^\tau \bigl[ v \! \left( t, \mathcal{X} (w+\epsilon \delta_w) (s), P (t) + (s-t)(w+\epsilon \delta_w) \right) \\ & & \qquad\qquad\qquad - v \! \left(t, \mathcal{X} (w) (s), P (t) + (s-t)(w+\delta_w)\right) \bigr] \d{s} \\ & & - \int_t^\tau D_xv\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) Y (s) \d{s} \, \delta_w \\ & & + \dfrac{1}{\epsilon} \int_t^\tau \!\! \left[ v \! \left( t, \mathcal{X} (w) (s), P (t) + (s-t)(w+\epsilon \delta_w) \right) - v \! \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \!\right] \! \d{s} \\ & & - \int_t^\tau (s-t) D_P v \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \d{s} \; \delta_w \\ & = & \int_t^\tau \int_0^1 \Bigl( D_x v\left( t, \theta \mathcal{X} (w+\epsilon \delta_w) (s) + (1-\theta) \mathcal{X} (w) (s), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad \times \dfrac{\mathcal{X} (w+\epsilon \delta_w) (s) - \mathcal{X} (w) (s)}{\epsilon} \Bigr) \d s \\ & & - \int_t^\tau D_xv\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) Y (s) \d{s} \, \delta_w \\ & & + \int_t^\tau (s-t) \Bigl( \int_0^1 D_P v\left( t, \mathcal{X} (w) (s), P (t)+ (s-t) (w + (1-\theta)\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad\qquad - D_P v \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \Bigr) \d{s} \; \delta_w \\ & = & \int_t^\tau \int_0^1 \Bigl( D_x v\left( t, \theta \mathcal{X} (w+\epsilon \delta_w) (s) + (1-\theta) \mathcal{X} (w) (s), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad \times \dfrac{\mathcal{X} (w+\epsilon \delta_w) (s) - \mathcal{X} (w) (s)}{\epsilon} \Bigr) \d s \\ && \mp \int_t^\tau D_x v\left( t, \mathcal{X} (w) (s), P (t) + (s-t)w \right) \dfrac{\mathcal{X} (w+\epsilon \delta_w) (s) - \mathcal{X} (w) (s)}{\epsilon} \d s \\ & & - \int_t^\tau D_xv\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) Y (s) \d{s} \, \delta_w \\ & & + \int_t^\tau (s-t) \Bigl( \int_0^1 D_P v\left( t, \mathcal{X} (w) (s), P (t)+ (s-t) (w + (1-\theta)\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad\qquad - D_P v \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \Bigr) \d{s} \; \delta_w \\ & = & \int_t^\tau \int_0^1 \Bigl( D_x v\left( t, \theta \mathcal{X} (w+\epsilon \delta_w) (s) + (1-\theta) \mathcal{X} (w) (s), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad - D_x v\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \Bigr) \frac{ \mathcal{X} (w+\epsilon \delta_w) (s) - \mathcal{X} (w) (s) }{\epsilon} \d{s} \\ & & + \int_t^\tau D_xv\left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \\ & & \qquad\qquad\qquad \times \left(\dfrac{\mathcal{X} (w+\epsilon \delta_w) (s) - \mathcal{X} (w) (s)}{\epsilon} - Y (s) \delta_w \right) \d{s} \\ & & + \int_t^\tau (s-t) \Bigl( \int_0^1 D_P v\left( t, \mathcal{X} (w) (s), P (t)+ (s-t) (w + (1-\theta)\epsilon\delta_w) \right) \d\theta \\ & & \qquad\qquad\qquad\qquad - D_P v \left(t, \mathcal{X} (w) (s), P (t) + (s-t)w\right) \Bigr) \d{s} \; \delta_w \end{eqnarray*} Calling $\O$ a constant dependent on the $\C2$ norm of $v$ and on the right hand side of~(\ref{eq:bound_diff_quot}), the above equality leads to \begin{eqnarray*} & & \norma{\dfrac{\mathcal{X} (w + \epsilon \delta_w) (\tau) - \mathcal{X} (w) (\tau)}{\epsilon} - Y (\tau) \; \delta_w} \\ & \leq & \O + \int_t^\tau \O \, \norma{\dfrac{\mathcal{X} (w + \epsilon \delta_w) (\tau) - \mathcal{X} (w) (\tau)}{\epsilon} - Y(\tau) \; \delta_w} \d{s} \\ & & + \int_t^\tau \O \, (s-t) \, \epsilon \d{s} \, \delta_w \,. \end{eqnarray*} Thanks to~\eqref{eq:27}, an application of Gr\"onwall Lemma proves the directional differentiability of $w \to \mathcal{X}(w)$ in the direction $\delta_w$. To prove the differentiability of $\mathcal{X}$, we are left to verify that~2.~and~3.~in Lemma~\ref{lem:A2} hold. The linearity of $\delta_w \to D\mathcal{X} (w) (\delta_w)$ is immediate, thanks to the homogeneous initial datum in~\eqref{eq:17}. The assumed $\C2$ regularity of $v$ ensures the $\C1$ regularity of the right hand side in~\eqref{eq:17} and, hence, the boundedness of $\delta_w \to D\mathcal{X} (w) (\delta_w)$ (in the sense of linear operators), completing the proof of~2. Standard theorems on the continuous dependence of solutions to ordinary differential equations from parameters, see, e.g., \cite[Theorem~4.2]{BressanPiccoliBook}, ensure that also~3.~in Lemma~\ref{lem:A2} holds, completing the proof of the differentiability of $\mathcal{X}$. The proof of the Taylor expansion~(\ref{eq:19}) follows easily using~(\ref{eq:17}). Indeed, by~(\ref{eq:17}), we deduce that $Y(t) = Y'(t) = 0$, while $Y''(t) = D_P v \left(t, x, P (t)\right)$, so that, if $\tau \in [t, t + \Delta t]$, then \begin{equation*} Y(\tau) = \frac{\left(\tau - t\right)^2}{2} D_P v \left(t, x, P (t)\right) + o \left(\left(\tau - t\right)^2\right). \end{equation*} This completes the proof of~(\ref{eq:19}) and of the lemma. \end{proof} \begin{proofof}{Lemma~\ref{lem:1}} The first statement is a direct consequence of Lemma~\ref{lem:CL1}. To prove~\eqref{eq:3}, we apply~Lemma~\ref{lem:CL2} with $V (\tau,x) = v (t,x,P (t) + (\tau - t)\, w)$ for $\tau \in [t, t+\Delta t]$: \begin{eqnarray*} \norma{V_i}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N; {\mathbb{R}}^N)} & \leq & \norma{v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times B (P (t), \Delta t \norma{w_i}); {\mathbb{R}}^N)} \,, \\ \norma{D_x V_i}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} & \leq & \norma{D_x v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times B (P (t), \Delta t \norma{w_i}),{\mathbb{R}}^{N\times N})} \,, \\ \norma{V_1 - V_2}_{\L1 ([t. t+\Delta t], \L\infty({\mathbb{R}}^N; {\mathbb{R}}^N))} & \leq & \frac12 \; \norma{D_P v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^{N\times N})} (\Delta t)^2 \norma{w_1 - w_2} \,, \\ \norma{\div_x (V_1 - V_2)}_{\L\infty ([t. t+\Delta t] \times {\mathbb{R}}^N; {\mathbb{R}}^N)} & \leq & \norma{D_P \div_x v}_{\L\infty ([t, t+\Delta t] \times {\mathbb{R}}^N \times {\mathbb{R}}^N; {\mathbb{R}}^N)} (\Delta t) \, \norma{w_1 - w_2} \,. \end{eqnarray*} With the notation~\eqref{eq:14}, and assuming that $C\geq 1$, \begin{eqnarray*} & & \norma{\rho_1 (t+\Delta t) - \rho_2 (t+\Delta t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \\ & \leq & \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \mathcal{L}^N \left( \mathop\mathrm{spt} \bar\rho, C e^{C \Delta t} \Delta t \right) e^{2C \Delta t} C (\Delta t)^2 \norma{w_1 - w_2} \\ & & + \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; e^{2C \Delta t} \; C (\Delta t)^2 \norma{w_1 - w_2} \\ & & + \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; C^2 \, e^{2C \Delta t} \; (\Delta t)^3 \norma{w_1 - w_2} \\ & \leq & \left( \norma{\mathinner{\mathop{\rm grad}}_x \bar\rho}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}}^N)} \; \mathcal{L}^N \left( \mathop\mathrm{spt} \bar\rho, C e^{C \Delta t} \Delta t \right) + (1+C\,\Delta t) \norma{\bar\rho}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \right) \\ & & \quad \times C e^{2C \Delta t} \, (\Delta t)^2 \, \norma{w_1 - w_2} \end{eqnarray*} completing the proof. \end{proofof} \begin{proofof}{Proposition~\ref{prop:1}} The map $\mathcal{J}_{t, \Delta t}$ is well defined by Lemma~\ref{lem:1}. To prove its Lipschitz continuity, let $w_1, w_2 \in {\mathbb{R}}^N$. Denote $V_i (\tau, x) = v (t, x, P (t) + (\tau-t)w_i)$; $X_i = X_{t,w_i}$ the solution to~\eqref{eq:10} and $\rho_i = \rho_{w_i}$ the corresponding solution to~\eqref{eq:6}. Straightforward computations yield \begin{eqnarray*} \modulo{\mathcal{J}_{t, \Delta t} (w_1) - \mathcal{J}_{t, \Delta t} (w_2)} & \leq & \int_{{\mathbb{R}}^n} \modulo{\rho_1 (t + \Delta t, x) - \rho_2 (t+\Delta t, x)} \modulo{\psi (x)} \, \d{x} \\ & \leq & \norma{\rho_1 (t+\Delta t) - \rho_2 (t+\Delta t)}_{\L1 ({\mathbb{R}}^N; {\mathbb{R}})} \; \norma{\psi}_{\L\infty ({\mathbb{R}}^N; {\mathbb{R}})} \,. \end{eqnarray*} and the proof is completed thanks to~\eqref{eq:3}. \end{proofof} \begin{proofof}{Theorem~\ref{thm:bo}} Recall~\eqref{eq:7}--\eqref{eq:28}. Fix $t$ and $t+\Delta t$ in $[0,T]$. The solution $\tau \to \mathcal{X}_w (\tau;t+\Delta t, x)$ to \begin{equation} \label{eq:31} \left\{ \begin{array}{@{}l@{\,}} \xi' = v \left(t, \xi, P (t) + (\tau-t)w\right) \\ \xi (t+\Delta t) = x \end{array} \right. \qquad \tau \in [t, t+\Delta t] \end{equation} will be shortened to $\tau \to \mathcal{X}_w (\tau;x)$. By Lemma~\ref{lem:DX}, we have the expansion \begin{equation} \label{eq:16} \mathcal{X}_{w+\epsilon\delta_w} (\tau;x) = \mathcal{X}_w (\tau;x) + \epsilon \, D_w \mathcal{X}_w (\tau;x) \, \delta_w + o (\epsilon) \quad \mbox{ in } \C0 \mbox{ as } \epsilon \to 0 \,, \end{equation} where $\tau \to D_w \mathcal{X}_w (\tau;t+\Delta t, x)$, or $\tau \to D_w \mathcal{X}_w (\tau;x)$ for short, solves the Cauchy Problem \begin{equation} \label{eq:32} \!\!\!\!\!\!\! \left\{ \begin{array}{@{}l@{\!}} Y' = D_x v \! \left( t, \mathcal{X}_w (\tau;x), P (t) + (\tau-t)w \right) Y + (\tau - t) D_P v \! \left( t, \mathcal{X}_w (\tau;x), P (t)+ (\tau-t) w \right) \\ Y (t+\Delta t) = 0 \end{array} \right. \end{equation} for $\tau \in [t, t+\Delta t]$. With reference to~\eqref{eq:33}, denote for simplicity $\mathcal{J} = \mathcal{J}_{t, \Delta t}$, $\psi = \psi$ and compute: \begin{eqnarray*} & & \dfrac{1}{\epsilon} \left(\mathcal{J} (w+\epsilon\delta_w) - \mathcal{J} (w)\right) \\ & = & \dfrac{1}{\epsilon} \int_{{\mathbb{R}}^N} \left( \rho_{w+\epsilon\delta_w} (t+\Delta t, x) - \rho_w (t+\Delta t, x) \right) \psi (x) \d{x} \\ & = & \dfrac{1}{\epsilon} \int_{{\mathbb{R}}^N} \Big[ \rho \left(t, \mathcal{X}_{w+\epsilon\delta_w} (t;x)\right) \\ & & \qquad \qquad \times \exp \left( -\int_t^{t+\Delta t} \div_x v \left( s, \mathcal{X}_{w+\epsilon\delta_w}(s;x), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d{s} \right) \\ & & \qquad - \rho \left(t, \mathcal{X}_w (t;x)\right) \\ & & \qquad \qquad \times \exp \left( -\int_t^{t+\Delta t} \div_x v\left(s, \mathcal{X}_w(s;x), P (t) + (s-t)w\right) \d{s} \right) \Big] \psi (x) \d{x} \\ & = & (I) + (II) + (III) \end{eqnarray*} where \begin{eqnarray*} (I) & = & \dfrac{1}{\epsilon} \int_{{\mathbb{R}}^N} \left[ \rho \left(t, \mathcal{X}_{w+\epsilon\delta_w} (t;x)\right) - \rho \left(t, \mathcal{X}_w (t;x)\right) \right] \\ & & \qquad \times \exp \! \left( \! -\int_t^{t+\Delta t} \div_x v \left( s, \mathcal{X}_{w+\epsilon\delta_w}(s;x), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d{s} \right) \! \psi (x) \d{x} \\ (II) & = & \dfrac{1}{\epsilon} \int_{{\mathbb{R}}^N} \rho \left(t, \mathcal{X}_w (t;x)\right) \\ & & \qquad \times \Big[ \exp \left( -\int_t^{t+\Delta t} \div_x v \left( s, \mathcal{X}_{w+\epsilon\delta_w}(s;x), P (t) + (s-t)(w+\epsilon\delta_w) \right) \d{s} \right) \\ & & \qquad\qquad- \exp \left( -\int_t^{t+\Delta t} \div_x v\left(s, \mathcal{X}_{w+\epsilon\delta_w}(s;x), P (t) + (s-t)w\right) \d{s} \right) \Big] \psi (x) \d{x} \\ (III) & = & \dfrac{1}{\epsilon} \int_{{\mathbb{R}}^N} \rho \left(t, \mathcal{X}_w (t;x)\right) \\ & & \qquad \times \Big[ \exp \left( -\int_t^{t+\Delta t} \div_x v \left( s, \mathcal{X}_{w+\epsilon\delta_w}(s;x), P (t) + (s-t) w \right) \d{s} \right) \\ & & \qquad\qquad- \exp \left( -\int_t^{t+\Delta t} \div_x v\left(s, \mathcal{X}_w(s;x), P (t) + (s-t)w\right) \d{s} \right) \Big] \psi (x) \d{x} \end{eqnarray*} The following estimate uses $D_w\mathcal{X}_w$ as defined in~\eqref{eq:32} and is of use to compute~$(I)$: \begin{eqnarray*} & & \dfrac{1}{\epsilon} \left( \rho \left(t, \mathcal{X}_{w+\epsilon\delta_w} (t;x)\right) - \rho \left(t, \mathcal{X}_w (t;x)\right) \right) \\ & = & \int_0^1 \mathinner{\mathop{\rm grad}}_x \rho \left( t, \theta \mathcal{X}_{w+\epsilon\delta_w} (t;x) + (1-\theta) \mathcal{X}_w (t;x) \right) \d\theta \; \dfrac{ \mathcal{X}_{w+\epsilon\delta_w} (t;x) - \mathcal{X}_w (t;x)}{\epsilon} \\ & \stackrel{\epsilon\to 0}{\to} & \mathinner{\mathop{\rm grad}}_x \rho \left(t, \mathcal{X}_w (t;x) \right)\; D_w \mathcal{X}_w (t;x) \; \delta_w \,, \end{eqnarray*} so that, \begin{eqnarray*} (I) & \stackrel{\epsilon\to 0}{\to} & \int_{{\mathbb{R}}^N} \mathinner{\mathop{\rm grad}}_x \rho \left(t, \mathcal{X}_w (t;x)\right)\; D_w \mathcal{X}_w (t;x) \, \delta_w \\ & & \qquad\qquad \times \exp \left( -\int_t^{t+\Delta t} \div_x v\left(s, \mathcal{X}_w(s;x), P (t) + (s-t)w\right) \d{s} \right) \psi (x) \d{x} \end{eqnarray*} while \begin{eqnarray*} (II) & \stackrel{\epsilon\to 0}{\to} & - \int_{{\mathbb{R}}^N} \rho\left(t, \mathcal{X}_w (t;x)\right) \, \exp\left( -\int_t^{t+\Delta t} \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t)w \right) \d{s} \right) \\ & & \qquad \times \int_t^{t+\Delta t} \mathinner{\mathop{\rm grad}}_P \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t) w \right) (s-t) \d{s} \delta_w \psi (x) \d{x} \end{eqnarray*} and similarly, using $D_w \mathcal{X}_w$ defined as solution to~\eqref{eq:32}, \begin{eqnarray*} (III) & \stackrel{\epsilon\to 0}{\to} & -\int_{{\mathbb{R}}^n} \rho\left(t, \mathcal{X}_w (s;x)\right) \, \exp\left( -\int_t^{t+\Delta t} \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t)w \right) \d{s} \right) \\ & & \quad \times \int_t^{t+\Delta t} \mathinner{\mathop{\rm grad}}_x \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t) w \right) D_w \mathcal{X}_w(s;x) \d{s} \psi (x) \d{x} \, \delta_w \end{eqnarray*} Adding the three terms we get: \begin{eqnarray*} & & \lim_{\epsilon \to 0} \dfrac{1}{\epsilon} \, \left(\mathcal{J} (w+\epsilon\delta_w) - \mathcal{J} (w)\right) \\ & = & \int_{{\mathbb{R}}^N} \Big[ \mathinner{\mathop{\rm grad}}_x \rho \left(t, \mathcal{X}_w (t;x)\right)\; D_w \mathcal{X}_w(t;x) \\ & & \qquad \quad- \rho\left(t, \mathcal{X}_w (t;x)\right) \int_t^{t+\Delta t} \Big( \mathinner{\mathop{\rm grad}}_P \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t) w \right) (s-t) \\ & & \qquad\qquad\qquad + \mathinner{\mathop{\rm grad}}_x \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t) w \right) D_w \mathcal{X}_w (s;x) \Big) \d{s} \Big] \\ & & \quad\times \exp\left( -\int_t^{t+\Delta t} \div_x v\left( s, \mathcal{X}_w (s;x), P (t) + (s-t)w \right) \d{s} \right) \psi (x) \d{x} \, \delta_w \,. \end{eqnarray*} To compute the limit as $\Delta t \to 0$ of the expression above, recall that as $\Delta t \to 0$, \begin{displaymath} \begin{array}{rcl@{\qquad}l} \mathcal{X}_w (t; t+\Delta t, x) & = & x - v\left(t,x,P (t)\right) \, \Delta t + o (\Delta t) & [\mbox{by~\eqref{eq:31}}] \\ D_w \mathcal{X}_w (t; t+\Delta t, x) & = & \frac12 \, D_P v \left(t, x, P (t)\right) \, (\Delta t)^2 + o (\Delta t)^2 & [\mbox{by~\eqref{eq:19}]} \end{array} \end{displaymath} so that \begin{eqnarray*} & & \lim_{\epsilon \to 0} \dfrac{1}{\epsilon} \, \left(\mathcal{J} (w+\epsilon\delta_w) - \mathcal{J} (w)\right) \\ & = & \dfrac{(\Delta t)^2}{2} \int_{{\mathbb{R}}^N} \left( \mathinner{\mathop{\rm grad}}_x \rho (t, x)\, D_P v \left(t,x, P (t)\right) - \rho (t, x) \, \mathinner{\mathop{\rm grad}}_P \div_x v \left(s, x, P (t)\right) \right) \psi (x) \, \d{x} \, \delta_w \\ & & + o (\Delta t)^2 \end{eqnarray*} completing the proof. \end{proofof} \smallskip \noindent\textbf{Acknowledgments:} Part of this work was supported by the PRIN~2015 project \emph{Hyperbolic Systems of Conservation Laws and Fluid Dynamics: Analysis and Applications} and by the GNAMPA~2017 project \emph{Conservation Laws: from Theory to Technology}. The \emph{IBM Power Systems Academic Initiative} substantially contributed to the the numerical integrations. {\small \bibliographystyle{abbrv}
\section{Conclusion} \label{sec:Conclusion} \section{Appendix} \label{sec:Appendix} \begin{comment} \begin{equation} \max \sum_{t=0}^{T} \gamma^{t} \rewardFunction{\sstate_{t}, u_{t}, \sstate_{t+1}} \end{equation} where the action used at each $t$ comes from the policy $u_{t} \leftarrow \policy{\sstate_{t}| \modelParametersStocasticPolicy}$. The probability of transitioning to a new state with observation $\sstate_{t+1}$ and reward $r$ is $p(\sstate_{t+1}, r | \sstate, u)$. \begin{equation} \max \sum_{t=0}^{T} \gamma^{t} \sum_{u} \policy{u|\sstate} \rewardFunction{\sstate_{t}, u_{t}, \sstate_{t+1}} \end{equation} \todo{I think this is the RL/planning function to optimize...} \begin{equation} \max_{u_{0}, \ldots, u_{T}} \sum_{t=0}^{T} \gamma^{t} \sum_{u_{t}} \policy{u_{t},\sstate_{t}} \sum_{r_{t}, \sstate_{t}} \rewardFunction{\sstate_{t+1}, u_{t}, \sstate_{t}} \end{equation} More formally \begin{equation} \max_{u_{0}, \ldots, u_{T}} \sum_{t=0}^{T} \gamma^{t} \sum_{u_{t}} \transitionFunction{u_{t}|\sstate_{t}} \sum_{r_{t}, \sstate_{t}} \modelFunction{\sstate_{t+1}, r_{t} | u_{t}, \sstate_{t}} \end{equation} The state value function $V_{\pi(\sstate|\modelParametersStocasticPolicy)}(\sstate)$ estimates the future discounted reward for the given policy $\pi(\sstate|\modelParametersStocasticPolicy)$. \begin{equation} \label{eqn:state-value-function} V_{\pi(\sstate|\modelParametersStocasticPolicy)}(\sstate) = \sum_{u}\policy{u|\sstate} \sum_{r,\sstate}^{} p(\sstate_{t+1}, r | u, \sstate)[r + \gamma V_{\pi(\sstate_{t+1})}] \end{equation} The action value function is an estimate of the future discounted reward if the action $u$ is taken given observation $\sstate$. \begin{equation} \label{eqn:action-value-function} Q_{\pi(\sstate|\modelParametersStocasticPolicy)}(\sstate, u) = \sum_{r,\sstate}^{} p(\sstate_{t+1}, r | u, \sstate)[r + \gamma \max_{u'} Q_{\pi(\sstate_{t+1})}(\sstate_{t+1}, u')] \end{equation} \end{comment} \begin{comment} \subsection{Likelihood} The likelihood function for a Gaussian distribution is \begin{equation} L(\mu, \sigma^{2}, x_{1}, \ldots, x_{n}) = (2\pi\sigma^{2})^{n/2} exp\left( - \frac{1}{2\sigma^{2}} \sum\limits_{j=1}^{n} (x_{j} - \mu)^{2} \right) \end{equation} The log of this is \begin{equation} l(\mu, \sigma^{2}, x_{1}, \ldots, x_{n}) = -\frac{n}{2}(2\pi) - \frac{n}{2}(\sigma^{2}) - \left(\frac{1}{2\sigma^{2}} \sum\limits_{j=1}^{n} (x_{j} - \mu)^{2} \right) \end{equation} A loss function can be used to learn both $\mu$ and $\sigma^{2}$ given data $x$. \end{comment} \subsection{Max Over All Actions, Value Iteration} By using \ac{MBAE}\xspace in an iterative manner, for a single state ($x_{t}$), it is possible to compute the max over all actions. This is a form of value iteration over the space of possible actions. It has been shown that embedding value iteration in the model design can be very beneficial~\citep{DBLP:journals/corr/TamarLA16} The algorithm to perform this computation is given in~\refAlgorithm{alg:Advantage-optimization}. \begin{comment} \todo{Give the optimization function to compute an action with the highest advantage.} \begin{equation} \begin{split} & u_{t} \leftarrow \policy{\sstate_{t}| \modelParametersPolicy} \\ & u_{i} \leftarrow u_{i} + \alpha_{u}\grad_{u} \left( \valueFunction{\forwardDynamics{\cdot | \sstate, u_{i}, \modelParametersForwardDynamics} | \modelParametersValueFunction}\right) \\ \end{split} \label{eqn:advantage-optimization} \end{equation} \end{comment} \begin{algorithm}[ht!] \caption{Action optimization} \label{alg:Advantage-optimization} \begin{algorithmic}[1] \State{$\hat{u}_{t} \leftarrow \policy{\sstate_{t}| \modelParametersPolicy}$} \While{not done} \State{ $\hat{u}_{t} \leftarrow \hat{u}_{t} + \function{GetActionDelta}(\hat{u}_{t})$} \EndWhile \end{algorithmic} \end{algorithm} \subsection{More Results} We perform additional evaluation on \ac{MBAE}\xspace. First we use \ac{MBAE}\xspace with the \ac{PPO}\xspace~\cite{2017arXiv170706347S} algorithm in~\refFigure{fig:ppo-results-particleGame} to show that the method works with other learning algorithms. We also created a modified version of \ac{CACLA}\xspace that is on-policy to further study the advantage of using \ac{MBAE}\xspace in this setting~\refFigure{fig:cacla-on-policy-results-particleGame}. \begin{figure}[h!] \begin{centering} \subcaptionbox{\label{fig:ppo-results-particleGame} \ac{PPO}\xspace game}{\includegraphics[width=0.48\columnwidth]{images/10d_particle/PPO/train_forward_dynamics_MBAE_Training_curves.pdf}} \subcaptionbox{\label{fig:cacla-on-policy-results-particleGame} on-policy \ac{CACLA}\xspace game}{\includegraphics[width=0.48\columnwidth]{images/10d_particle/CACLA/on_policy/train_forward_dynamics_MBAE_Training_curves.pdf}} \\ \caption{ (a) Result of Applying \ac{MBAE}\xspace to \ac{PPO}\xspace. In (b) we show that an on-policy version of \ac{CACLA}\xspace + \ac{MBAE}\xspace can learn faster than \ac{CACLA}\xspace alone. } \label{fig:ppo-results} \end{centering} \end{figure} \section{Framework} \label{sec:framework} In this section we outline the \ac{MDP}\xspace based framework used to describe the \ac{RL}\xspace problem. \subsection{Markov Dynamic Process} An \ac{MDP}\xspace is a tuple consisting of $\{S, A, \rewardFunction{\cdot}, \transitionFunction{\cdot}, \gamma\}$. Here $S$ is the space of all possible state configurations and $A$ is the set of available actions. The reward function $\rewardFunction{u, x}$ determines the reward for taking action $u \in A$ in state $x \in S$. The probability of ending up in state $\sstate_{t+1} \in S$ after taking action $u$ in state $x$ is described by the transition dynamics function $\transitionFunction{\sstate_{t+1} | x, u }$. Lastly, the discount factor $\gamma \in (0,1]$ controls the \emph{planning horizon} and gives preference to more immediate rewards. A stochastic policy $\policy{u|x}$ models the probability of choosing action $u$ given state $x$. The quality of the policy can be computed as the expectation over future discounted rewards for the given policy starting in state $x_{0}$ and taking action $u_{0}$. \begin{equation} \label{eqn:policyQualityFunction} \begin{split} J_{\pi}(x_{0}, u_{0}) & = \mathop{\mathbb{E}_{\pi}}[ \rewardFunction{u_{0}, x_{0}} + \gamma \rewardFunction{u_{1}, x_{1}} + \ldots + \gamma^{T} \rewardFunction{u_{T}, x_{T}}] \\ J_{\pi}(x_{0}, u_{0}) & = \mathop{\mathbb{E}_{\pi}}[\sum_{t=0}^{T} \gamma^{t} \rewardFunction{u_{t}, x_{t}}] \end{split} \end{equation} The actions $u_{t}$ over the trajectory $(u_{0}, x_{0}, \ldots , u_{T}, x_{T})$ are determined by the policy $\policy{u_{t}, x_{t}}$. The successor state $\sstate_{t+1}$ is determined by the transition function $\transitionFunction{\sstate_{t+1} | x_{t}, u_{t} }$. \subsection{Policy Learning} \begin{comment} \begin{equation} \label{eqn:statevalueFunction} \begin{split} \valueFunction{x_{0}} & = \mathop{\mathbb{E}_{u \sim \policy{x}}}[\sum_{t=0}^{T} \gamma^{t} \rewardFunction{u_{t}, x_{t}} ] \\ & = \mathop{\mathbb{E}_{u \sim \policy{x}}}[J(x_{0}, u)] \end{split} \end{equation} \end{comment} \begin{comment} \begin{equation} \label{eqn:actionvalueFunction} \begin{split} \actionvalueFunction{x_{0}, u_{0}} & = \mathop{\mathbb{E}}_{u \sim \policy{x}}[J(x_{0}, u_{0} )] \\ & = \rewardFunction{u_{0}, x_{0}} + \gamma \mathop{\mathbb{E}_{u \sim \policy{x}}}[\sum_{t=1}^{T} \gamma^{t} \rewardFunction{u_{t}, x_{t}} ] \\ \end{split} \end{equation} \end{comment} The state-value function $\valueFunction{x}$ estimates \refequation{eqn:policyQualityFunction} starting from state $x_{0}$ for the policy $\policy{\cdot}$. The action-valued function $\actionvalueFunction{x, u}$ models the future discounted reward for taking action $u$ in state $x$ and following policy $\policy{\cdot}$ thereafter. The advantage function is a measure of the benefit of taking action $u$ in state $x$ with respect to the current policy performance. \begin{equation} \label{eqn:advantageFunction} \advantageFunction{x, u} = \actionvalueFunction{x, u} - \valueFunction{x} \end{equation} The advantage function is then used as a metric for improving the policy. \begin{equation} \label{eqn:policyImprovement} u^* = \arg\max \log \policy{u | x} \advantageFunction{x, u} \end{equation} \subsection{Deep Reinforcement Learning} During each episode of interaction with the environment, data is collected for each action taken, as an \emph{experience} tuple $\tau_{i}= (\sstate_{i}, u_{i}, r_{i}, \sstate'_i)$. \subsubsection{Exploration} In continuous spaces the stochastic policy $\policy{u | x}$ is often modeled by a Gaussian distribution with mean $\policyMean{x | \modelParametersPolicy}$. The standard deviation can be modeled by a state-dependent neural network model, $\policySTD{x | \modelParametersPolicySTD}$, or can be state independent and sampled from $\normalDistribution{0}{\policyVariance}$. \subsubsection{Exploitation} We train a neural network to model the value function on data collected from the policy. The loss function used to train the value function ($\valueFunction{x| \modelParametersValueFunction}$) is the temporal difference error: \begin{equation} \label{eqn:temporalDifference} L(\modelParametersValueFunction) = E [r + \gamma \valueFunction{\sstate_{t+1} | \modelParametersValueFunction}] - \valueFunction{x | \modelParametersValueFunction}]. \end{equation} Using the learned value function as a baseline, the advantage function can be estimated from data. \begin{comment} \begin{equation} \label{eqn:advantageEstimation} \advantageFunction{x_{t}, u_{t}} = \gamma^{k} \valueFunction{x_{t+k}| \modelParametersValueFunction} - \valueFunction{x_{t}| \modelParametersValueFunction} + \sum\limits_{i=0}^{k-1} \gamma^{i}r_{t+i} \end{equation} \end{comment} With an estimate of the policy gradient, via the advantage, policy updates can be performed to increase the policy's likelihood of selecting actions with higher advantage: \begin{equation} \label{eqn:policyImprovement2} \modelParametersStocasticPolicy \leftarrow \modelParametersStocasticPolicy + \alpha \grad_{\modelParametersStocasticPolicy}\log \policy{u | x, \modelParametersStocasticPolicy} \advantageFunction{x, u, \modelParametersValueFunction} \end{equation} \section{Model-Based Action Exploration\xspace} \label{sec:ModelBasedActionExploration} In model-based \ac{RL}\xspace we are trying to solve the same policy parameter optimization as in \refequation{eqn:policyImprovement}. To model the dynamics, we train one model to estimate the reward function and another to estimate the successor state. The former is modeled as a direct prediction, while the latter is modeled as a distribution from which samples can be drawn via a GAN (generative adversarial network). \begin{comment} \subsection{Learning The Transition Probability} \label{subsection:forward-dynamics} While training the policy, the transition probability transition probability\xspace $\forwardDynamics{\sstate_{t+1} | \sstate, u, \modelParametersForwardDynamics}$ modeled with a deep neural network with parameters $\modelParametersForwardDynamics$ is learned. This model is trained using supervised learning, with a log likelihood loss. \begin{equation} \lossFunction{\modelParametersForwardDynamics} = \log(\forwardDynamics{\sstate_{t+1} |\sstate_{t}, u_{t}, \modelParametersForwardDynamics}) \end{equation} In \refFigure{fig:forward-dynamics-gradients} an example of learning $\forwardDynamics{\sstate_{t+1} |\sstate_{t}, u_{t}, \modelParametersForwardDynamics}$ for a simple 1D line generated from a mixture of sines and cosines (yellow) is shown. In this example $u = x$ and $ \sstate_{t} = x$ and $\sstate_{t+1} = y$. In this figure the input action gradient with respect to the mean is computed as well and visualized as gray arrows on the model prediction (green). These arrows show a rather good approximation of the line and the direction to move along the predicted line to increase function value. The gray arrows also show the derivative magnitude of the gradient compared to the line slope. \end{comment} \begin{comment} \begin{figure}[htb!] \centering \subcaptionbox{\label{fig:forward-dynamics-gradients-model}}{\includegraphics[width=0.45\linewidth]{images/gradients/modelFit.pdf}} \subcaptionbox{\label{fig:forward-dynamics-gradients-error}}{\includegraphics[width=0.45\linewidth]{images/gradients/modelFit_error.pdf}} \caption{The left graph shows a function (yellow line) and a deep neural network model's approximation of that function (green line). The gray arrows are the derivatives calculated at the points on the green line with respect to the model using symbolic differentiation. The plot on the right is the learning curve for fitting the model to the true function. The model used in this case was a network with two hidden layers $128$x$64$ and \ac{ReLU}\xspace activations.} \label{fig:forward-dynamics-gradients} \end{figure} \end{comment} \begin{comment} \section{Model-Based Action Exploration\xspace} \begin{enumerate} \item The probability of randomly selecting an action better than the current policy is small \item $p( ( R(\policyMean{\sstate} + \lambda \mathcal{N}(0, \policyVariance), \sstate) + \valueFunction{\nextState_i | \modelParametersValueFunction}) &gt; \valueFunction{\sstate_{i} | \modelParametersValueFunction} ) \sim 0$ \item As the number of action dimensions $N$ increase this probability goes to $0$ ($u^{N}$) \item \[\lim_{x\to\infty} p( ( R(\policyMean{\sstate} + \lambda \mathcal{N}(0, \policyVariance), \sstate) + \valueFunction{\nextState_i | \modelParametersValueFunction}) &gt; \valueFunction{\sstate_{i} | \modelParametersValueFunction} ) \rightarrow 0\] \item It has been a long challenge in RL to mitigate this issue. It makes exploration intractable in more complex examples. \item To combat this issue we learn function approximators that we can compute derivatives and gradients through to find better action exploration suggestions. \end{enumerate} Now by combining the value function with the forward dynamics model we can compute a gradient that tells us in which direction we should change the current action in order to increase the value of the future discounted reward. \begin{equation} \begin{split} & u_{i} = \policyMean{\sstate} \\ & u = \policyMean{\sstate} + \alpha_{u}\grad_{u} \left( \valueFunction{\forwardDynamics{\sstate, u_{i}}}\right) \\ \end{split} \label{eqn:md-update} \end{equation} Where $\policyMean{\sstate}$ is the current policy, $\forwardDynamics{\sstate, u_{i}}$ is the forward dynamics model from \refsection{subsection:forward-dynamics} and $\alpha_{u}$ is a learning rate for how far the action should be shifted in the direction of the gradient. \end{comment} \subsection{Stochastic Model-Based Action Exploration\xspace} A diagram of the \ac{MBAE}\xspace method is shown in \refFigure{fig:mbae-model}. With the combination of the transition probability\xspace model and a value function, an action-valued function is constructed. Using \ac{MBAE}\xspace, action gradients can be computed and used for exploration. \begin{figure}[htb] \includegraphics[width=0.95\linewidth]{images/mbae_model_IROS.pdf} \caption{Schematic of the Model-Based Action Exploration\xspace design. States $\sstate$ are generated from the simulator, the policy produces an action $u$, $\sstate$ and $u$ are used to predict the next state $\sstate_{t+1}$. The gradient is computed back through the value function to give the gradient of the state $\grad\sstate_{t+1}$ that is then used to compute a gradient that changes the action by $\Deltau$ to produce a predicted state with higher value. } \label{fig:mbae-model} \end{figure} By using a stochastic transition function the gradients computed by \ac{MBAE}\xspace are non-deterministic. \refAlgorithm{alg:compute-action_delta} shows the method used to compute action gradients when predicted future states are sampled from a distribution. We use a \ac{GAN}\xspace~\citep{NIPS2014_5423} to model the stochastic distribution. Our implementation closely follows~\citep{DBLP:journals/corr/IsolaZZE16} that uses a \ac{cGAN}\xspace and combines a \ac{MSE}\xspace loss with the normal \ac{GAN}\xspace loss. We expect the simulation dynamics to have correlated terms, which the \ac{GAN}\xspace can learn. \begin{comment} \begin{equation} \hat{u}_{t} \leftarrow \hat{u}_{t} + \alpha_{u} \grad_{\hat{u}_{t}} \forwardDynamicsMEAN{\grad\hat{x}_{t+1} | \sstate_{t}, \hat{u}_{t}, \modelParametersForwardDynamicsMEAN} \end{equation} \end{comment} \begin{algorithm}[ht!] \caption{Compute Action Gradient} \label{alg:compute-action_delta} \begin{algorithmic}[1] \Function{getActionDelta}{$x_{t}$} \State{$\hat{u}_{t} \leftarrow \policy{u | \sstate_{t}, \modelParametersStocasticPolicy}$} \State{$\eta \leftarrow \normalDistribution{0}{1.0}$} \State{$\hat{x}_{t+1} \leftarrow \forwardDynamics{\sstate_{t+1} |\sstate_{t}, \hat{u}_{t}, \eta, \modelParametersForwardDynamics}$} \State{$\grad\hat{x}_{t+1} \leftarrow \grad_{x_{t+1}} \valueFunction{\hat{x}_{t+1} | \modelParametersValueFunction}$} \State{$\hat{u}_{t} \leftarrow \hat{u}_{t} + \alpha_{u} \grad_{\hat{u}_{t}} \forwardDynamicsMEAN{\grad\hat{x}_{t+1} | \sstate_{t}, \hat{u}_{t}, \eta, \modelParametersForwardDynamicsMEAN}$} \State \Return $\hat{u}_{t}$ \EndFunction \end{algorithmic} \end{algorithm} \begin{comment} \begin{equation} \begin{split} & u_{t} \leftarrow \policy{\sstate_{t}| \modelParametersPolicy} \\ & \hat{x}_{t+1} \leftarrow \normalDistribution{\forwardDynamicsMEAN{\cdot | \sstate_{t}, u_{t}, \modelParametersForwardDynamicsMEAN}}{ \forwardDynamicsSTD{\cdot | \sstate_{t}, u_{t}, \modelParametersForwardDynamicsSTD}}\\ & \grad\hat{x}_{t+1} \leftarrow \grad_{x_{t+1}} \valueFunction{\hat{x}_{t+1} | \modelParametersValueFunction} \\ & \hat{u}_{t} \leftarrow u_{t} + \alpha_{u} \grad_{u_{t}} \forwardDynamicsMEAN{\grad\hat{x}_{t+1} | \sstate_{t}, u_{t}, \modelParametersForwardDynamicsMEAN} \\ \end{split} \label{eqn:smbae-update} \end{equation} \end{comment} $\alpha_{u}$ is a learning rate specific to \ac{MBAE}\xspace and $\eta$ is the random noise sample used by the \ac{cGAN}\xspace. This exploration method can be easily incorporated into RL algorithms. The pseudo code for using \ac{MBAE}\xspace is given in \refAlgorithm{alg:SMBAE}. \begin{algorithm}[h!] \caption{\ac{MBAE}\xspace algorithm} \label{alg:SMBAE} \begin{algorithmic}[1] \State{Randomly initialize model parameters} \While{not done} \While{Simulate episode} \If{generate exploratory action} \State{$u_{t} \leftarrow \policy{u | \sstate_{t}, \modelParametersStocasticPolicy}$} \If {$ \function{Uniform}(0,1) < p$} \State { $u_{t} \leftarrow u_{t} + $ $\function{GetActionDelta}(\sstate_{t})$} \EndIf \Else \State{$u_t \leftarrow \policyMean{\sstate_{t} | \modelParametersPolicy}$} \EndIf \EndWhile \State{Sample batch $\{\tau_j = (\sstate_j, u_j, r_j, \sstate'_j)\}$ from $D$} \State{Update value function, policy and transition probability\xspace given $\{\tau_j\}$} \EndWhile \end{algorithmic} \end{algorithm} \subsection{DYNA} In practise the successor state distribution produced from \ac{MBAE}\xspace will differ from the environment's true distribution. To compensate for this difference we perform additional training updates on the value function, replacing the successive states in the batch with ones produced from $\forwardDynamics{\cdot | \sstate_{t}, u_{t}, \eta, \modelParametersForwardDynamics}$. This helps the value function better estimate future discounted reward for states produced by \ac{MBAE}\xspace. This method is similar to \ac{DYNA}\xspace~\citep{Sutton90integratedarchitectures,sutton1991dyna}, but here we are performing these updates for the purposes of conditioning the value function on the transition dynamics model. \begin{comment} Why Dyna??~\citep{Sutton90integratedarchitectures,sutton1991dyna} \begin{enumerate} \item \ac{DYNA}\xspace learns a model of the environment \item The environment model is used to \emph{generate} data the policy can learn from \item This generated data supplements the learning process so less simulated actions are needed. \end{enumerate} \end{comment} \section{Connections to Policy Gradient Methods} Action-valued functions can be preferred because they model the effect of taking specific actions and can also implicitly encode the policy. However, performing a value iteration update over the all actions is intractable in continuous action spaces. \begin{equation} \label{eqn:action-value-function} L(\theta) = \mathbb{E}[r + \gamma \max_{u' \in A} Q_{\pi(\sstate_{t+1})}(\sstate_{t+1}, u', \theta) - Q_{\pi(\sstate|\modelParametersStocasticPolicy)}(\sstate, u, \theta)] \end{equation} \ac{DPG}\xspace~\citep{silver2014deterministic} compensates for this issue by linking the value and policy functions together allowing for gradients to be passed from the value function through to the policy. The policy parameters are then updated to increase the action-value function returns. This method has been successful~\citep{DBLP:journals/corr/HPHETS15} but has stability challenges~\citep{DBLP:journals/corr/HausknechtS15a}. More recently \ac{SVG}\xspace~\cite{NIPS2015_5796} has been proposed as a method to unify model-free and model-based methods for learning continuous action control policies. The method learns a stochastic policy, value function and stochastic model of the dynamics that are used to estimate policy gradients. While \ac{SVG}\xspace uses a similar model to compute gradients to optimize a policy, here we use this model to generate more informed exploratory actions. \begin{comment} \subsection{Discussion} The learning process can be further improved by performing an initial training of the forward dynamics model offline. One last challenge introduced by this method is an additional \emph{step size} for the action gradient magnitude to apply to the policy action, and it may not be trivial to select this \emph{step size}. However, we found that with proper normalization of the gradient direction, $\alpha \in [0.1,1]$ work well. \end{comment} \section{Discussion} \label{sec:discussion} \paragraph{Exploration Action Randomization and Scaling} Initially, when learning begins, the estimated policy gradient is flat, making \ac{MBAE}\xspace actions $ \sim 0$. As learning progresses the estimated policy gradient gets sharper leading to actions produced from \ac{MBAE}\xspace with magnitude $>> 1$. By using a normalized version of the action gradient, we maintain a reasonably sized explorative action, this is similar to the many methods used to normalize gradients between layers for deep learning~\citep{2016arXiv160706450L,DBLP:journals/corr/IoffeS15}. However, with normalized actions, we run the risk of being overly deterministic in action exploration. The addition of positive Gaussian noise to the normalized action length helps compensate for this. Modeling the transition dynamics stochasticity allows us to generate future states from a distribution, further increasing the stochastic nature of the action exploration. \begin{comment} \paragraph{Similarity To Expected Policy Gradients} Concurrently with our work a new policy gradient framework called \ac{EPG}\xspace~\citep{2017arXiv170605374C} has been developed. Part of our method might be equivalent to \ac{EPG}\xspace however, in our case, instead of estimating the transition dynamics via numerical integration we instead learn a model for the transition dynamics. The learned model is used to calculate gradients in the action space without having to directly use \ac{DPG}\xspace. A more thorough exploration of these connections is left for future work. \end{comment} \paragraph{transition probability\xspace Model Accuracy} Initially, the models do not need to be significantly accurate. They only have to perform better than random (Gaussian) sampling. We found it important to train the transition probability\xspace model while learning. This allows the model to adjust and be most accurate for the changing state distribution observed during training. This makes it more accurate as the policy converges. \paragraph{\ac{MBAE}\xspace Hyper Parameters} To estimate the policy gradient well and to maintain reasonably accurate value estimates, Gaussian exploration should still be performed. This helps the value function get a better estimate of the current policy performance. From empirical analysis, we have found that sampling actions from \ac{MBAE}\xspace with a probability of $0.25$ has worked well across multiple environments. The learning progress can be more sensitive to the action learning rate $\alpha_{u}$. We found that annealing values between $1.0$ and $0.1$ \ac{MBAE}\xspace assisted learning. The form of normalization that worked the best for \ac{MBAE}\xspace was a form of batchnorm, were we normalize the action standard deviation to be similar to the policy distribution. One concern could be that \ac{MBAE}\xspace is benefiting mostly from the extra training that is being seen for the value function. We performed an evaluation of this effect by training \ac{MBAE}\xspace without the use of exploratory actions from \ac{MBAE}\xspace. We found no noticeable impact on the learning speed or final policy quality. \subsection{Future Work} It might still be possible to further improve \ac{MBAE}\xspace by pre-training the transition probability\xspace model offline. As well, learning a more complex transition probability\xspace model similar to what has been done in~\citep{DBLP:journals/corr/MishraAM17} could improve the accuracy of the \ac{MBAE}\xspace generated actions. It might also be helpful to learn a better model of the reward function using a method similar to~\citep{Silver2016}. One challenge is the addition of another \emph{step size} $\alpha$ for how much action gradient should be applied to the policy action, and it can be non-trivial to select this step size. While we believe that the \ac{MBAE}\xspace is promising, the learning method can suffer from stability issues when the value function is inaccurate, leading to poor gradients. We are currently investigating methods to limit the KL divergence of the policy between updates. These constraints are gaining popularity in recent RL methods~\citep{TRPO}. This should reduce the amount the policy shifts from parameter updates, further increasing the stability of learning. The \emph{Membrane}\xspace related tasks are particularly difficult to do well on; even after significant training the policies could still be improved. Lastly, while our focus has been on evaluating the method on many environments, we would also like to evaluate \ac{MBAE}\xspace in the context of additional \ac{RL}\xspace algorithms, such as PPO or Q-Prop, to further assess its benefit. \section{Results} \label{sec:results} \ac{MBAE}\xspace is evaluated on a number of tasks, including: \emph{Membrane}\xspace robot simulation of move-to-target and stacking, \emph{Membrane}\xspace robot hardware move-to-target, OpenAIGym HalfCheetah\xspace, OpenAIGym 2D Reacher\xspace, 2D Biped\xspace simulation and N-dimensional particle navigation. The supplementary video provides a short overview of these systems and tasks. The method is evaluated using the \ac{CACLA}\xspace stochastic policy \ac{RL}\xspace learning algorithm~\citep{vanHasselt2012}. \ac{CACLA}\xspace updates the policy mean using \ac{MSE}\xspace for actions that have positive advantage. \subsection{N-Dimensional Particle} This environment is similar to a continuous action space version of the common grid world problem. In the grid world problem the \emph{agent} (blue dot) is trying to reach a \emph{target location} (red dot), shown in the left of \refFigure{fig:particle-world-2d-agent}. In this version the agent receives reward for moving closer to its goal ($ r = || agent_{pos} - target_{pos}||_{2}$). This problem is chosen because it can be extended to an N-dimensional world very easily, which is helpful as a simple evaluation of scalability as the action-space dimensionality increases. We use a 10D version here \citep{DBLP:journals/corr/TamarLA16,DBLP:journals/corr/FinnYFAL16}. \begin{figure}[h!] \begin{centering} \subcaptionbox{\label{fig:particle-world-2d-agent} Nav environment and current policy}{\includegraphics[width=0.92\columnwidth]{images/gridworld/navAgent.pdf}} \\ \subcaptionbox{\label{fig:particle-world-2d-fdError} transition probability\xspace error}{\includegraphics[width=0.48\columnwidth]{images/gridworld/navAgent_FD_error.pdf}} \subcaptionbox{\label{fig:particle-world-2d-mbae} \ac{MBAE}\xspace direction}{\includegraphics[width=0.48\columnwidth]{images/gridworld/navAgent_MBAE.pdf}} \\ \caption{The figure (a) left is the current layout of the continuous grid world. The agent is blue and target location for the agent is the red dot and the green boxes are obstacles. In (a) right, the current policy is shown as if the agent was located at each arrow action to give the unit direction of the action. The current value at each state is visualized by the colour of the arrows, red being the highest. In (b) the error of the forward dynamics model is visualized as the distance between the successive state predicted and the actual successive states ($(\sstate + u) - \forwardDynamics{\sstate, u}$). (c) is the unit length action gradient from \ac{MBAE}\xspace. Only the first two dimensions of the state and action are visualized here. } \label{fig:grid-world-2d} \end{centering} \end{figure} \refFigure{fig:grid-world-2d} shows a visualization of a number of components used in \ac{MBAE}\xspace. In \refFigure{fig:mbae-compare-cacla} we compare the learning curves of using a standard \ac{CACLA}\xspace learning algorithm and one augmented with \ac{MBAE}\xspace for additional action exploration. The learning curves show a significant improvement in learning speed and policy quality over the standard \ac{CACLA}\xspace algorithm. We also evaluated the impact of pre-training the deterministic transition probability\xspace model for \ac{MBAE}\xspace. This pre-training did not provide noticeable improvements. \begin{comment} \begin{figure}[h!] \centering \subcaptionbox{\label{fig:mbae-compare-cacla}}{\includegraphics[width=0.49\linewidth]{images/10d_particle/CACLA/Training_curves_CACLA_Particle.pdf}} \subcaptionbox{\label{fig:mbae-compare-ppo}}{\includegraphics[width=0.49\linewidth]{images/10d_particle/PPO/Training_curves_PPO_Particle.pdf}} \caption{Comparison of RL learning methods with and without \ac{MBAE}\xspace. Both baseline methods use the standard algorithms. In (a) comparisons are shown between standard \ac{CACLA}\xspace and \ac{CACLA}\xspace with versions of \ac{MBAE}\xspace added. \MBAE2 uses \ac{CACLA}\xspace and \ac{MBAE}\xspace however the action gradients have been normalized. In (b) \ac{PPO}\xspace is used with many versions of \ac{MBAE}\xspace. The most successful version uses the full stochastic version of \ac{MBAE}\xspace. } \label{fig:MBAE-ablation} \end{figure} \end{comment} \glen{This method scales well with the size of the action space...} \subsection{2D Biped Imitation} In this environment the agent\xspace is rewarded for developing a 2D walking gait. Reward is given for matching an overall desired velocity and for matching a given reference motion. This environment is similar to~\citep{Peng:2017:LLS:3099564.3099567}. The 2D Biped\xspace used in the simulation is shown in~\refFigure{fig:envs-biped}. \begin{figure}[h!] \centering \begin{minipage}{.45\linewidth} \subcaptionbox{\label{fig:envs-biped} 2D Biped\xspace }{\includegraphics[width=0.95\linewidth]{images/2DLLC/biped.png}} \end{minipage} \begin{minipage}{.45\linewidth} \subcaptionbox{\label{fig:envs-reacher} 2D Reacher\xspace}{\includegraphics[width=0.95\linewidth]{images/Reacher/Reacher.png}} \\ \subcaptionbox{\label{fig:envs-halfcheetah} HalfCheetah\xspace}{\includegraphics[width=0.95\linewidth]{images/HalfCheetah/HalfCHeetah.png}} \end{minipage} \caption{Additional environments \ac{MBAE}\xspace is evaluated on.} \label{fig:envs} \end{figure} \begin{comment} \begin{figure}[h!] \centering \subcaptionbox{\label{fig:LLC2D-MBAE-compare}}{\includegraphics[width=0.49\linewidth]{images/2DLLC/CACLA/Training_curves_CACLA_2DLLC.pdf}} \subcaptionbox{\label{fig:LLC2D-MBAE-compare-PPO}}{\includegraphics[width=0.49\linewidth]{images/2DLLC/PPO/MBAE_Training_curves.pdf}} \caption{Comparisons of using the \ac{CACLA}\xspace learning method with and without \ac{MBAE}\xspace. On the right the training error for the transition probability\xspace model is shown.} \label{fig:LLC2D-MBAE} \end{figure} \end{comment} In \refFigure{fig:LLC2D-MBAE-compare}, five evaluations are used for the 2D Biped\xspace and the mean learning curves are shown. In this case \ac{MBAE}\xspace consistently learns $5$ times faster than the standard \ac{CACLA}\xspace algorithm. We further find that the use of \ac{MBAE}\xspace also leads to improved learning stability and more optimal policies. \begin{comment} \subsection{2.5D Finite State Machine} A controller based on the SIMBICON~\citep{Yin07} controller. This controller is learned from scratch without any initial seed discrete action parameters. \begin{figure}[h!] \includegraphics[width=0.95\linewidth]{images/simbicon2.5D/Biped2D_Training_curves.pdf} \caption{} \label{fig:simbicon2.5D-MBAE} \end{figure} \subsection{2D LLC with Terrain} A controller based on the SIMBICON~\citep{Yin07} controller. This controller is learned from scratch without any initial seed discrete action parameters. \subsection{2D Hopper} A controller based on the SIMBICON~\citep{Yin07} controller. This controller is learned from scratch without any initial seed discrete action parameters. \subsection{3D LLC} A controller based on the SIMBICON~\citep{Yin07} controller. This controller is learned from scratch without any initial seed discrete action parameters. \subsection{3D bipedal Walker} A controller based on the SIMBICON~\citep{Yin07} controller. This controller is learned from scratch without any initial seed discrete action parameters. \subsection{Examples with PPO} \end{comment} \subsection{Gym and Membrane Robot Examples} We evaluate \ac{MBAE}\xspace on two environments from openAIGym, 2D Reacher\xspace~\refFigure{fig:envs-reacher} and HalfCheetah\xspace~\refFigure{fig:envs-halfcheetah}. \ac{MBAE}\xspace does not significantly improve the learning speed for the 2D Reacher\xspace. However, it results in a higher value policy~\refFigure{fig:robot-examples-reacher}. For the HalfCheetah\xspace \ac{MBAE}\xspace provides a significant learning improvement~\refFigure{fig:robot-examples-half-cheetah}, resulting in a final policy with more than $3$ times the average reward. Finally, we evaluate \ac{MBAE}\xspace on a simulation of the \textit{juggling} \emph{Membrane}\xspace robot shown in~\refFigure{fig:Membrane-hardware}. The under-actuated system with complex dynamics and regular discontinuities due to contacts make this a challenging problem. The results for two tasks that include attempting to stack one box on top of another and a second task to move a ball to a target location are shown in~\refFigure{fig:robot-examples-membrane-stack} and ~\refFigure{fig:robot-examples-membrane-movetotarget}. For both these environments the addition of \ac{MBAE}\xspace provides only slight improvements. We believe that due to the complexity of this learning task, it is difficult to learn a good policy for this problem in general. The simulated version of the \textit{membrane-stack} task is shown in~\refFigure{fig:robot-examples-membrane-software-stack}. \begin{figure*}[h!] \centering \subcaptionbox{\label{fig:mbae-compare-cacla} Particle 10D}{\includegraphics[width=0.32\linewidth]{images/10d_particle/CACLA/Training_curves_CACLA_Particle.pdf}} \subcaptionbox{\label{fig:LLC2D-MBAE-compare} 2D PD Biped}{\includegraphics[width=0.32\linewidth]{images/2DLLC/CACLA/Training_curves_CACLA_2DLLC.pdf}} \subcaptionbox{\label{fig:robot-examples-reacher} Reacher 2D}{\includegraphics[width=0.32\linewidth]{images/Reacher/MBAE_Training_curves.pdf}} \\ \subcaptionbox{\label{fig:robot-examples-half-cheetah} Half-Cheetah}{\includegraphics[width=0.32\linewidth]{images/HalfCheetah/MBAE_Training_curves.pdf}} \subcaptionbox{\label{fig:robot-examples-membrane-movetotarget}Membrane Target}{\includegraphics[width=0.32\linewidth]{images/Membrane/MoveToTarget/MBAE_Training_curves.pdf}} \subcaptionbox{\label{fig:robot-examples-membrane-stack}Membrane Stack}{\includegraphics[width=0.32\linewidth]{images/Membrane/Stack/MBAE_Training_curves.pdf}} \caption{Comparisons of using the \ac{CACLA}\xspace learning method with and without \ac{MBAE}\xspace. These performance curves are the average of $5$ separate simulation with different random seeds.} \label{fig:robot-examples} \end{figure*} We also asses \ac{MBAE}\xspace on the \emph{Membrane}\xspace robot shown in~\refFigure{fig:Membrane-hardware}. OpenCV is used to track the location of a ball that is affected by the actuation of $5$ servos that cause $5$ pins to move linearly, shown in~\refFigure{fig:robot-examples-membrane-hardware-normal}. The $5$ pins are connected by passive prismatic joints that form the \textit{membrane}. The robot begins each new episode by resetting itself which involves tossing the ball up and randomly repositioning the membrane. Please see the accompanying video for details. We transfer the \textit{movetotarget} policy trained in simulation for use with the \emph{Membrane}\xspace robot. We show the results of training on the robot with and without \ac{MBAE}\xspace for $\sim3$ hours each in~\refFigure{fig:robot-examples-membrane-hardware-mbae}. Our main objective here is to demonstrate the feasibility of learning on the robot hardware; our current results are only from a single training run for each case. With this caveat in mind, \ac{MBAE}\xspace appears to support improved learning. We believe that this is related to the transition probability\xspace model adjusting to the new state distribution of the robot quickly. \begin{figure}[h!] \centering \subcaptionbox{\label{fig:robot-examples-membrane-hardware-mbae}Membrane Target}{\includegraphics[width=0.82\linewidth]{images/Membrane/Hardware/MBAE_Training_curves.pdf}} \subcaptionbox{\label{fig:robot-examples-membrane-hardware-normal}Membrane Camera}{\includegraphics[width=0.42\linewidth]{images/Membrane/MembraneHardware_video_small.png}} \subcaptionbox{\label{fig:robot-examples-membrane-software-stack}Membrane Stack}{\includegraphics[width=0.42\linewidth]{images/Membrane/Membrane_stack_trim.png}} \caption{(a) Comparison of using the \ac{MBAE}\xspace on the physical robot task. (b) is the camera view the robot uses to track its state and (c) is a still frame from the simulated box \textit{stacking} tasks.} \label{fig:robot-examples-membrane-hardware} \end{figure} \subsection{Transition Probability Network Design} We have experimented with many network designs for the transition probability\xspace model. We have found that using a DenseNet~\citep{Huang_2017_CVPR} works well and increases the models accuracy. We use dropout on the input and output layers, as well as the inner layers, to reduce overfitting. This makes the gradients passed through the transition probability\xspace model less biased. \begin{comment} \begin{enumerate} \item plots of things learning faster with model-based action exploration. \item ablation study \begin{enumerate} \item Without $|| \theta_{u} - \theta_{u old} ||$ \item Without training value function on outputs from fd. \item without positive advantage \todo{Won't have time for this} \end{enumerate} \end{enumerate} \subsection{Controller Performance} \begin{enumerate} \item push tests \item slope tests \item How much are things trained? Time and number of actions. \item plots of gradients on input parameters, i.e. which state parameters are significant? \item Pictures of the biped responding to parameters \end{enumerate} As can be seen in the bottom plot in Figure~\ref{fig:biped-walking} the learning curve follow the pattern of the annealing exploration noise of the training. \end{comment} \section{Introduction} \label{sec:Intro} Efficient action exploration remains a challenge for \ac{RL}\xspace, especially in continuous action domains. Gaussian distributions are commonly used to model the stochastic component of control policies in continuous action spaces. However, as the number of action dimensions increase the probability of randomly generating an action that is better than the current policy decreases exponentially with the action dimension. Recent work has indicated that methods that add local noise might not be enough to explore environments well~\citep{2017arXiv170307608O}. Other methods model the action distribution better by learning a noise distribution~\citep{2017arXiv170610295F} or processing random Gaussian noise through the policy~\citep{2017arXiv170601905P}. However, these methods may not scale well with respect to the number of action dimensions. In practise, we expect that there likely exists better distributions that will focus the sampled actions to areas of the action space that appear more promising. This is of particular importance to problems where data collection is expensive, like robotics. We want to generate exploratory actions that have a greater probability of leading the policy to higher value states. We do this in a model-based way, using a learned model of the environment's transition probability $\forwardDynamics{\sstate_{t+1} | \sstate_{t}, u_{t}, \modelParametersForwardDynamics }$. The model is used to predict outcomes of taking actions in particular states. Predicted states are rated, via the value function, for how well it is believed the policy will perform from that state onward. This method is similar to how a person might use an internal understanding of the result of taking an action and modifying that action to increase the utility (or cumulative reward) of their future. We call this method \ac{MBAE}\xspace. This work is a step towards mixing model-based and model-free learning. We use a model-based method to assist action exploration and model-free methods for training. We note that \ac{MBAE}\xspace should be used in conjunction with off-policy algorithms. Our work is motivated by the desire to solve more complex simulated and robotic tasks. The mathematical framework is inspired by \ac{DPG}\xspace~\citep{DBLP:journals/corr/LillicrapHPHETS15} where action gradients can be computed for the policy given an action-value (Q) function However, in practise these gradients are noisy and can vary greatly in their magnitude. This can make it challenging to create a stable learning framework. In a sense, in \ac{MBAE}\xspace we are passing these gradients through the environment as an extra means of validation, thereby decreasing the bias and increasing the stability of learning. This work is also motivated by the idea that the significant body of data collected while training an \ac{RL}\xspace policy should be leveraged for additional purposes. \begin{figure}% \centering \setlength{\fboxsep}{1pt}% \subcaptionbox{\label{fig:Membrane-hardware}Membrane Hardware}{\includegraphics[width=0.45\linewidth]{images/Membrane/Membrane_hardware_small.png}} \subcaptionbox{\label{fig:Membrane-software}Membrane Simulation}{\includegraphics[width=0.45\linewidth]{images/Membrane/Membrane_simulator.png}} \caption{(a) The \emph{Membrane}\xspace robot. The blue points between the parallel links are actuated up and down via the servos on the bottom. Each point is connected together with a passive slider, together they form a \emph{Membrane}\xspace-like system. Right: Simulated model of \emph{Membrane}\xspace robot.} \label{fig:cassie} \end{figure} \begin{comment} \begin{enumerate} \item Majority of RL methods focus on better exploitation strategies. Very little on better exploration strategies. \item We want these RL methods to be more data efficient. \item It would be great if the method was scalable as well. \item Right now as the number of action dimensions increase the number of samples needed to learning a good policy increase exponentially. \item Want can be done to suggest better candidate actions? \item Model-based Learning \begin{enumerate} \item In model-based RL there are functions that model the transition probability and action probability \item When these are known the best action can be computed by maximizing over all the states (wrt to transition model) and actions (wrt policy) \item We can learning these two models with deep neural nets \item The neural network architecture allow us to compute gradients wrt input parameters and loss functions. \end{enumerate} \item If we learn a model of the forward dynamics we can use it to suggest changes in the action. We can back propagate the loss function all the way to the input parameters to see how the input parameters could be changed to increase the value of executing the suggested action. \item This forms a Q function \item The beauty is that initially the models to not need to be significantly accurate. They only have to do better than random sampling. \item Contributions \begin{enumerate} \item A method to parameterize the control of different behaviours of physics based character, via reward functions \item A new model-based action exploration method that reduces training by increasing the probability that exploration actions are better than the current policy. \item An adjustment to the CACLA algorithm to weight the positive temporal difference updates on the policy wrt the advantage of the action. \item Learning smooth and robust dynamic motion control without the need for mocap data. \item \end{enumerate} \end{enumerate} \end{comment} \section{Related Work} \label{sec:related_work} \begin{comment} \paragraph{Physics-Based Control} Recent work in motion control for simulated characters has shown great success at planning control fragment ordering~\citep{Liu:2017:LSC:3087678.3083723} and simulating control by embedding motion in a Neural network~\citep{Holden:2017:PNN:3072959.3073663}. Controllers with little prior structure can be created with a combination of high frequency muscle control and footstep-based control~\citep{HeessWTLRS16, Peng:2017:DDL:3072959.3073602}. \end{comment} \paragraph{Reinforcement Learning} The \emph{environment} in a RL problem is often modelled as an \ac{MDP}\xspace with a discrete set of states and actions~\citep{sutton1998reinforcement}. In this work we are focusing on problems with infinite/continuous state and action spaces. These include complex motor control tasks that have become a popular benchmark in the machine learning literature~\citep{2017arXiv170702286H}. Many recent \ac{RL}\xspace approaches are based on policy gradient methods~\citep{policygradient} where the gradient of the policy with respect to future discounted reward is approximated and used to update the policy. Recent advances in combining policy gradient methods and deep learning have led to impressive results for numerous problems, including Atari games and bipedal motion control~\citep{DBLP:journals/corr/SchulmanMLJA15,A3C,mnih2015human,vanHasselt2012,HeessWTLRS16, Peng:2017:DDL:3072959.3073602}. \paragraph{Sample Efficient RL} While policy gradient methods provide a general framework for how to update a policy given data, it is still a challenge to generate good data. Sample efficient RL methods are an important area of research as learning complex policies for motion control can take days and physically simulating on robots is time-consuming. Learning can be made more sample efficient by further parameterizing the policy and passing noise through the network as an alternative to adding vanilla Gaussian noise~\citep{2017arXiv170601905P,2017arXiv170610295F}. Other work encourages exploration of the state space that has not yet been seen by the agent~\citep{DBLP:journals/corr/HouthooftCDSTA16}. There has been success in incorporating model-based methods to generate synthetic data or locally approximate the dynamics~\citep{Gu:2016:CDQ:3045390.3045688,DBLP:journals/corr/MishraAM17,sutton1991dyna}. Two methods are similar to the \ac{MBAE}\xspace work that we propose. Deep Deterministic Policy Gradient (\ac{DDPG}\xspace) is a method that directly links the policy and value function, propagating gradients into the policy from the value function~\citep{DBLP:journals/corr/LillicrapHPHETS15}. Another is \ac{SVG}\xspace, a framework for blending between model-based and model-free learning~\citep{NIPS2015_5796}. However, these methods do not use the gradients as a method for action exploration. \paragraph{Model-Based \ac{RL}\xspace} generally refers to methods that use the structure of the problem to assist learning. Typically any method that uses more than a policy and value function is considered to fall into this category. Significant improvements have been made recently by including some model-based knowledge into the \ac{RL}\xspace problem. By first learning a policy using model-based RL and then training a model-free method to act like the model-based method~\citep{2017arXiv170802596N} significant improvements are achieved. There is also interest in learning and using models of the transition dynamics to improve learning~\citep{2017arXiv170903153B}. The work in~\citep{DBLP:journals/corr/MishraAM17} uses model-based policy optimization methods along with very accurate dynamics models to learn good policies. In this work, we learn a model of the dynamics to compute gradients to maximize future discounted reward for action exploration. The dynamics model used in this work does not need to be particularly accurate as the underlying model-free RL algorithm can cope with a noisy action distribution.
\section{Introduction} \label{Sec:Intro} Low-density parity-check (LDPC) codes and their low-complexity iterative decoding algorithm \cite{Gala62} are a powerful method to achieve reliable communication and storage with rates that approach Shannon's theoretical limit (see \cite{OsShok02} and \cite{Shok99}). Due to their efficient encoding and decoding algorithms, communication applications such as WiFi, DVB, and Ethernet had adopted this family of linear block codes. When used in data-storage applications, unlike in communications, retransmissions are not possible, and any decoding failure implies data loss; hence strong LDPC codes need to be provisioned for extreme data reliability. Another key feature of modern storage devices is fast access, i.e., low-latency and high-throughput read operations. However, high data reliability forces very large block sizes and high complexity, and thus degrades the device's latency and throughput. This inherent conflict motivates a coding scheme that enables fast read access to small (sub) blocks with modest data protection and low complexity, while in case of failure providing a high data-protection "safety net" in the form of decoding a stronger code over a larger block. Our objective in this paper is to design LDPC codes to operate in such a {\em multi-block coding scheme}, where error-correction performance (vs. rate) is maximized in both the sub-block and full-block modes. Formally, in a multi-block coding scheme a code block of length $N$ is divided into $M$ sub-blocks of length $n$ (i.e., $N=Mn$). Each sub-block is a codeword of one code, and the concatenation of the $M$ sub-blocks forms a codeword of another (stronger) code. This paper is the first to design LDPC codes for the multi-block scheme. Earlier work, such as~\cite{CassHemo17} recently and~\cite{Hass01,HanMont07,BlauHetz16} before, addressed the design of Reed-Solomon and related algebraic codes in multi-block schemes. While that prior work attests to the importance of the multi-block scheme, designing LDPC codes for it requires all-new tools and methods. Toward that, we define a new type of LDPC codes we call {\em LDPCL codes}, where the suffix 'L' points to the code's {\em local} access to its sub-blocks. The LDPCL code is designed in such a way that each of the sub-blocks (of length $n$) can be decoded independently of the other sub-blocks (local decoding), and in addition the full block of length $Mn$ can be decoded (global decoding) when local decoding fails. In order to fulfil this requirement, an LDPCL code must have at least one parity-check matrix $H$ in the form of \begin{align}\label{Loc PC Matrix 1} H= \begin{pmatrix} H_1 & 0 & \cdots & 0 & 0 \\ 0 & H_2 & \cdots & 0 & 0 \\ \vdots & & \ddots & & \vdots \\ 0 & 0 & \cdots & & H_M \\ & & H_{0} \end{pmatrix}, \end{align} where \begin{subequations} \begin{align*} &H_i \in \mathbb{F}_2^{m_i \times n}, \quad 1 \leq i \leq M,\\ &H_{0} \in \mathbb{F}_2^{m_0 \times Mn}. \end{align*} \end{subequations} Our theoretical results on analysis and construction of LDPCL codes lie upon the definition of the code through two distinct degree-distribution pairs. The {\em local degree distribution} specifies the connections between sub-block variable nodes and their local check nodes, while the {\em joint degree distribution} governs the connection of the global check nodes to variable nodes in the full block. The key challenge is to design the local and joint distributions such that both the local and the global (=local+joint composition) codes perform well. In particular, this requires the generalization of the binary erasure channel (BEC)'s density-evolution analysis~\cite{RichUrb08} to two dimensions (2D), where the local and joint dimensions are shown to have inherent asymmetries that need to be addressed to make the analysis work. We note two prior works related to our results: \cite{Li17} proposed global coupling as a similar structure for LDPC codes, but were not interested in local-decoding performance and focused on algebraic structured codes over non-binary alphabets; \cite{RazaYu07} studied a two-layer LDPC framework for a different application, but defined the codes through one big product degree distribution that is not amenable to asymptotic analysis and capacity-achieving constructions. The paper is structured as follows. Section~\ref{Sec:Pre} reviews known results on LDPC codes that are essential to fully understand this paper, and presents the two-sided Tanner graph. Section~\ref{Sec:Ensembles} introduces the LDPCL ensembles, and Section~\ref{Sec:2D DE} details the asymptotic analysis of the belief-propagation (BP) decoding algorithm on these ensembles. In Section~\ref{Sec:C1} we define a new notion of capacity-achieving sequences with both global and local decoding thresholds, prove that they exist, and provide a general construction for them. Section~\ref{Sec:N_JI} discusses a trade-off between the gap to capacity of an LDPCL ensemble to the number of decoding iterations that access the full block; minimizing access to full-block bits while decoding saves time and communication costs when the sub-blocks are distributed. In Section~\ref{Sec:Finite}, we perform a finite-length analysis for ML decoding of (regular) LDPCL codes, and finally, Section~\ref{Sec:sum} summarizes the results and insights given in the paper. \section{Preliminaries} \label{Sec:Pre} \subsection{LDPC Codes: Review from \cite{RichUrb08}} \label{sub:LDPC} A linear block code is an LDPC code if it has at least one parity-check matrix that is sparse, i.e., the number of 1's in $H$ is linear in the block length. This sparsity enables the low-complexity (linear in block length) decoding algorithm. Every parity-check matrix $H$ can be represented by a bipartite graph, called a Tanner graph, with nodes partitioned to variable nodes and check nodes; there exists an edge between check node $i$ and variable node $j$, if and only if $H_{ij}=1$ (this paper focuses on binary linear codes, but this representation can be generalized). The fraction of variable (resp. check) nodes in a Tanner graph with degree $i$ is denoted by $\Lambda_i$ (resp. $\Omega_i$), and the fraction of edges connected to variable (resp. check) nodes of degree $i$ is denoted by $\lambda_i$ (resp. $\rho_i$); $\Lambda_i$ and $\Omega_i$ are called node-perspective degree distributions, and $\lambda_i$ and $\rho_i$ are called edge-perspective degree distributions. The degree-distribution polynomials associated to a Tanner graph are given by \begin{subequations} \begin{align} \label{eq:dd poly1} &\Lambda(x)=\sum_{i}\Lambda_{i} x^i, \qquad \hspace*{0.35cm} \lambda(x)=\sum_{i}\lambda_{i} x^{i-1},\quad \hspace*{0.2cm} x \in [0,1],\\ \label{eq:dd poly2} & \Omega(x)=\sum_{i}\Omega_{i}x^i ,\qquad \rho(x) = \sum_{i}\rho_{i} x^{i-1},\quad x \in [0,1]. \end{align} \end{subequations} The node-perspective and edge-perspective polynomials are related through \begin{subequations} \begin{align} \label{eq:node-edge} &\Lambda(x)= \tfrac{\int_0^x \lambda(t)\mathrm{d}t}{\int_0^1 \lambda(t)\mathrm{d}t}, \hspace*{0.8cm} \Omega(x) = \tfrac{\int_0^x \rho(t)\mathrm{d}t}{\int_0^1 \rho(t)\mathrm{d}t},\quad x\in [0,1], \\ \label{eq:edge-node} &\lambda(x)= \tfrac{\Lambda'(x)}{\Lambda'(1)}, \hspace*{1.4cm} \rho(x) = \tfrac{\Omega'(x)}{\Omega'(1)},\quad \hspace*{0.65cm} x\in [0,1], \end{align} \end{subequations} where the operator $'$ stands for the function's derivative. The rate of an LDPC code defined by a tanner graph whose degree-distribution polynomials are given by \eqref{eq:dd poly1}--\eqref{eq:dd poly2} is lower bounded by the design rate, which is $1-\frac{\Lambda'(1)}{\Omega'(1)}=1-\frac{\int_0^1 \rho(t)\mathrm{d}t}{\int_0^1 \lambda(t)\mathrm{d}t}$. \subsection{The Two-Sided Tanner Graph} \label{sub:Tanner} We define an LDPCL code of length $N=Mn$ through a two-sided Tanner graph. The main difference between the two-sided Tanner graph and the one-sided Tanner graph (i.e., the Tanner graph representing an ordinary LDPC code) is that in the former, the variable nodes are divided to $M$ disjoint sets of size $n$ each, and the check nodes are divided into two disjoint sets: {\em local check nodes} and {\em joint check nodes}. To distinguish between local and joint check nodes, the former are drawn to the right of the variable nodes and the latter are drawn to the left (hence its name: two-sided Tanner graph). The graph construction is constrained such that each local check node is connected only to variable nodes that are in the same sub-block of length $n$; the joint check-node connections have no constraints. The parity-check matrix corresponding to a two-sided Tanner graph is in the form of \eqref{Loc PC Matrix 1}. The check nodes representing parity constraints in rows $1$ to $\sum_{i=1}^M m_i$ are local check nodes, and the check nodes representing parity constraints in the last $m_0$ rows are joint check nodes. The set of edges in the graph is partitioned into two sets as well: edges connecting variable nodes to local check nodes (i.e., the right side of the graph) are called {\em local edges} and edges connecting variable nodes to joint check nodes are called {\em joint edges}. Finally, the local (resp. joint) degree of a variable node is the number of local (resp. joint) edges emanating from it. \begin{example} \label{ex:Tanner} A two-sided Tanner graph and its corresponding parity-check matrix are given in Figure~\ref{Fig:2sideTanner} and Figure~\ref{Fig:TannerH}, respectively: the parity check matrix is of size $12 \times 18$, $n=6$, $M=3$, and $m_0=m_1=m_2=m_3=3$. \end{example} \begin{figure}[h!] \begin{minipage}{0.45\textwidth} \centering \includegraphics[scale=0.2]{Tanner.pdf} \caption{\label{Fig:2sideTanner} A two-sided Tanner graph with $n=6,M=3$ and $m_0=m_1=m_2=m_3=3$.} \end{minipage}\hfill \begin {minipage}{0.48\textwidth} \centering \includegraphics[scale=0.26]{TannerH.jpg} \caption{\label{Fig:TannerH} The parity check matrix of the two-sided Tanner graph in Figure~\ref{Fig:2sideTanner}.} \end{minipage} \end{figure} We denote by $\Lambda_{L,i}$ the fraction of variable nodes with local degree $i$, and by $\Omega_{L,i}$ the fraction of local check nodes with degree $i$. Similarly, $\lambda_{L,i}$ designates the fraction of local edges connected to a variable node with local degree $i$, and $\rho_{L,i}$ designates the fraction of local edges connected to a local check node of degree $i$. We call $\left(\Lambda_{L,i},\Omega_{L,i},\lambda_{L,i},\rho_{L,i} \right)$ local degree distributions. Note that we do not distinguish between local degree distributions of different sub-blocks, and we assume that they are the same in all sub-blocks (but the instances drawn from the distributions are in general different between the sub-blocks). The joint degree distributions $\left(\Lambda_{J,i},\Omega_{J,i},\lambda_{J,i},\rho_{J,i}\right)$ are defined similarly with an important difference. In contrast to Tanner graphs associated to ordinary LDPC codes where the minimal variable-node degree is usually $2$ (i.e., $\Lambda_{L,0}=\Lambda_{L,1}=0$), in the two-sided Tanner graph we allow some variable nodes to have joint degree $0$ or $1$. The reason for removing this restriction is related to the iterative decoding algorithm, and will become clearer in Sections~\ref{Sec:2D DE}~and~\ref{Sec:C1}. In the rest of the paper we will use $P_0$ to denote the coefficient $\Lambda_{J,0}$, due to its importance. The local and joint degree-distribution polynomials $\Lambda_L(\cdot),\lambda_L(\cdot),\Omega_L(\cdot),\rho_L(\cdot)$ and $\Lambda_J(\cdot),\lambda_J(\cdot),\Omega_J(\cdot),\rho_J(\cdot)$ are defined similarly to the degree-distribution polynomials for ordinary $LDPC$ codes \eqref{eq:dd poly1}-\eqref{eq:dd poly2}. Known relations between node-perspective and edge-perspective polynomials hold for the local polynomials. However, since some variable nodes may have a joint degree of zero, the equation that describes $\Lambda_J$ in terms of $\lambda_J$ changes to \begin{align} \label{eq:joint edge2node} \Lambda_J(x)= P_0+(1-P_0)\tfrac{\int_0^x \lambda_J(t)\mathrm{d}t}{\int_0^1 \lambda_J(t)\mathrm{d}t}, \quad x \in [0,1]. \end{align} \section{LDPCL Ensembles} \label{Sec:Ensembles} In this section we define the ensembles of two-sided Tanner graphs: the LDPCL ensembles. These ensembles have six parameters: $M,n,\Lambda_L(\cdot),\Lambda_J(\cdot),\Omega_L(\cdot),$ and $\Omega_J(\cdot)$. $M$ is the locality parameter that sets the number of sub-blocks in a code block, $n$ is the sub-block length, and $\Lambda_L(\cdot),\Lambda_J(\cdot),\Omega_L(\cdot),\Omega_J(\cdot)$ are the node-perspective degree-distribution polynomials; this ensemble is denoted by $LDPCL(M,n,\Lambda_L,\Omega_L,\Lambda_J,\Omega_J)$. We can refer to an LDPCL ensemble through its edge-perspective degree-distribution polynomials, and then it is denoted by $LDPCL(M,n,\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)$ (when using the edge-perspective notation, one must specify $P_0$ as well). \subsection{Regular LDPCL Ensembles} \label{sub:Regular} An LDPCL ensemble is called $(l_L,r_L,l_J,r_J)$-regular if in every two-sided Tanner graph in it, all of the variable nodes have fixed local and joint degrees of $l_L$ and $l_J$ (thus $P_0=0$), respectively, and all of the local and joint check nodes have fixed degrees of $r_L$ and $r_J$, respectively. The number of local and joint check nodes is therefore $Mn\tfrac{l_L}{r_L}$ and $Mn\tfrac{l_J}{r_J}$, respectively; hence, the design rate is \begin{align} \label{eq:reg rate} R = 1-\frac{l_L}{r_L}-\frac{l_J}{r_J}. \end{align} In what follows, we describe the sampling process from the $(l_L,r_L,l_J,r_J)$-regular ensemble. First, $M$ ordinary (not two-sided) Tanner graphs are independently sampled from the $(l_L,r_L)$-regular LDPC ensemble with block length $n$. These Tanner graphs are concatenated vertically with no inter-connections; call them local graphs. Another ordinary Tanner graph is then sampled from the ordinary $(l_J,r_J)$-regular LDPC ensemble with block length $N=Mn$. The latter graph is called the joint graph and it is flipped such that the check nodes are on the left side. Finally, the $Mn$ variable nodes of the joint graph are merged with the $Mn$ variable nodes of the $M$ local graphs to create a two-sided Tanner graph. \subsection{Irregular LDPCL Ensembles} \label{sub:Iregular} An obvious generalization of the construction of regular LDPCL ensembles is the construction of irregular LDPCL ensembles in which the degrees of the nodes vary. As in ordinary LDPC codes, this generalization enables better iterative decoding performance. The sampling process from the irregular $LDPCL(M,n,\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ ensemble is a as follows. First, $M$ Tanner graphs are sampled independently from the $LDPC(n,\Lambda_L,\Omega_L)$ ensemble. These local graphs are concatenated vertically without inter-connections. Another Tanner graph is then sampled from the $LDPC(Mn,\Lambda_J,\Omega_J)$ ensemble. The latter joint graph is flipped, its $Mn$ variable nodes are randomly permuted, and merged with the $Mn$ variable nodes of the $M$ local graphs to create a two-sided Tanner graph. Note that the regular ensemble construction in Section~\ref{sub:Regular} did not include the variable nodes random permutation step described above; we add it here to force statistical independence between the local and joint degrees of the variable nodes. The design rate of an $LDPCL(M,n,\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ ensemble is given by \begin{align} R(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J) &= 1 - \frac{\Lambda_L'(1)}{\Omega_L'(1)} - \frac{\Lambda_J'(1)}{\Omega_J'(1)} \notag \\ \label{eq:design rate2} &= 1 - \frac{\int_0^1\rho_L(x)\mathrm{d}x}{\int_0^1\lambda_L(x)\mathrm{d}x} - \frac{\int_0^1\rho_J(x)\mathrm{d}x}{\int_0^1\lambda_J(x)\mathrm{d}x}\left( 1-P_0\right). \end{align} We can see in \eqref{eq:design rate2}, that setting $P_0>0$ allows increasing the code rate, which we later indeed do in our constructions. \section{Iterative Decoding Asymptotic Analysis} \label{Sec:2D DE} A standard decoding algorithm for ordinary LDPC codes over the BEC is a message-passing algorithm known as the belief-propagation (BP) algorithm; its decoding complexity is linear in the block length and despite being sub-optimal, there are LDPC ensembles that approach the BEC capacity with BP. To take advantage of the locality structure of the Tanner graphs described above, the suggested decoding algorithm will operate in two modes: local mode and global mode. In the local mode, the decoder tries to decode a sub-block of length $n$ using BP on the local Tanner graph corresponding to the desired sub-block. If the decoder meets a failure criterion (e.g., maximum number of iterations or stable non-zero fraction of erased variable nodes), then it enters the global mode where it tries to decode the entire code block (of length $N=Mn$) using BP on the complete two-sided Tanner graph. If the decoder succeeds, it extracts the wanted sub-block, and if it fails, it declares a decoding failure. The message scheduling in the global mode is a flooding schedule: in the first step of a global decoding iteration, the variable nodes send messages to the local and joint check nodes in parallel, and in the second step the local and global check nodes send their messages back to the variable nodes. As in the case of ordinary LDPC codes, the messages passed are either erasures or decoded 0/1 bits (later in Section~\ref{Sec:N_JI} we change the schedule from flooding to be more locality aware). \begin{example}\label{ex:decoder} Figure~\ref{Fig:DecodeExample} exemplifies the decoding algorithm for an LDPCL code with locality $M=2$ and sub-block length of $n=12$; the desired sub-block is the upper one. First, the decoder tries to locally decode the upper sub-block using only its local parity checks (a). It fails and enters the global mode (b), where it runs BP on the complete graph. In every iteration, messages are sent in parallel to the local and joint side (c)-(d), until the decoder resolves all of the variable nodes, and in particular, the desired sub-block. \end{example} \begin{figure}[h!] \includegraphics[scale=0.27]{DecodeExample.jpg} \caption{\label{Fig:DecodeExample} An example for local and global decoding where the desired sub-block is the upper one: (a) a complete two-sided Tanner graph with erased (black) variable nodes before decoding; (b) the decoder fails to locally decode the desired sub-block and gets stuck, then it enters the global mode; (c) after one iteration in global mode; (d) after two iterations in global mode; (e) the decoder resolves the desired sub-block.} \end{figure} In the local mode, the asymptotic (as $n \to \infty$) analysis of decoding algorithm is identical to the asymptotic analysis of ordinary LDPC codes. Specifically, in the limit where $n\to \infty$, there exists a local decoding threshold denoted by $\epsilon^*_L$ that depends on the degree distributions, such that if the fraction of erasures $\epsilon$ is less than $\epsilon^*_L$, the decoder will resolve the desired sub-block in the local mode with probability converging to $1$, and if $\epsilon>\epsilon^*_L$, the decoder will fail in the local mode with probability converging to $1$. Moreover, $\epsilon^{*}_L$ can be calculated numerically via \begin{align} \label{eq:1D th numeric} \epsilon^{*}_L = \inf_{(0,1]} \frac{x}{\lambda_L(1-\rho_L(1-x))}. \end{align} In contrast to the local mode, in the global mode there is a major difference in the asymptotic analysis of the BP algorithm between LDPC and LDPCL codes. Due to the built-in structure of the LDPCL ensemble, i.e., the constraints on edge connections (see Section~\ref{Sec:Ensembles}), one cannot calculate the global degree-distribution polynomials (i.e., considering an "effective" one-sided Tanner graph ensemble), and use them to find the global BP decoding threshold with an equation similar to \eqref{eq:1D th numeric} (except for some special cases detailed below). \subsection{Decoding in Global Mode} \label{sub:decode global} In this sub-section, we analyze the asymptotic performance (as $n \to \infty$) of the BP decoding algorithm over the BEC in the global mode, and derive density-evolution equations for the LDPCL. Two important theorems about ordinary LDPC codes hold for LDPCL codes as well, namely, the \emph{concentration theorem} and the \emph{convergence to tree channel theorem} (see \cite[Theorem~3.30, Theorem~3.50]{RichUrb08}). The former theorem allows us to analyze the performance of a particular LDPCL code via the analysis of the (expectation of the) ensemble as $n \to \infty$, and the latter theorem enables us to consider the tree ensembles \cite[Chapter 3.7.2]{RichUrb08} corresponding to the general-graph ensembles of Section~\ref{Sec:Ensembles}, as $n \to \infty$. We adopt the notations from \cite{RichUrb08} in the following derivation. \begin{definition}[LDPCL Tree Ensemble] \label{Def:tree} Let $l \in \mathbb{N}$ and $\Lambda_L,\Omega_L,\Lambda_J,\Omega_J$ be degree-distribution polynomials. The tree ensemble $\mathcal{T}_l(\Lambda_L,\Omega_L,\Lambda_J,\Omega_J) $ is constructed in the following way. Let $V(i,j)$ be a variable-node-rooted tree of depth $1$, with $i$ local check nodes and $j$ joint check nodes as children. Let $C(i)$ be a check-node-rooted tree of depth $1$ with $i$ variable-node children. $\mathcal{T}_0(\Lambda_L,\Omega_L,\Lambda_J,\Omega_J)$ is the ensemble consisting of a single element which is a variable node. To sample from $\mathcal{T}_l(\Lambda_L,\Omega_L,\Lambda_J,\Omega_J),\;l \geq 1$, start by sampling from $\mathcal{T}_{l-1}(\Lambda_L,\Omega_L,\Lambda_J,\Omega_J)$, and for each leaf variable node $v$, if $v$ is the root (i.e., $l=1$) or $v$'s father is a local check node, replace it with $V(i,j)$ with probability $\lambda_{L,i+1}\cdot\Lambda_{J,j}$, and if $v$'s father is a joint check node replace it with $V(i,j)$ with probability $\Lambda_{L,i}\cdot\lambda_{J,j+1}$. Subsequently, replace each local check-node leaf with $C(i)$ with probability $\rho_{L,i+1}$ and each joint check-node leaf with $C(i)$ with probability $\rho_{J,i+1}$. \end{definition} \begin{figure}[h!] \begin{center} \includegraphics[scale=0.25]{RegTree.pdf} \caption{\label{Fig:RegTree} The single element of the $\mathcal{T}_2(\Lambda_L(x)=x^2,\Omega_L(x)=x^4,\Lambda_J(x)=x,\Omega_J(x)=x^3)$ (regular) ensemble. The local (resp. joint) check nodes are marked with 'L' (resp. 'J')}. \end{center} \end{figure} \begin{figure}[h!] \begin{center} \includegraphics[scale=0.4]{RegTree3.jpg} \caption{\label{Fig:RegTree3} The 8 elements of the $\mathcal{T}_2(\Lambda_L(x)=x^2,\Omega_L(x)=x^3,\Lambda_J(x)=\tfrac34+\tfrac14 x,\Omega_J(x)=x^2)$ (irregular) ensemble. The probability of each element is given above it. The local (joint) check nodes are marked with 'L' ('J').} \end{center} \end{figure} Figures~\ref{Fig:RegTree}~and~\ref{Fig:RegTree3} illustrate the $(l_L,r_L,l_J,r_J)=(2,4,1,3)$-regular and the $(\Lambda_L(x)=x^2,\Omega_L(x)=x^3,\Lambda_J(x)=\tfrac34+\tfrac14 x,\Omega_J(x)=x^2)$-irregular tree ensembles of depth 2, respectively. In the regular ensemble there is only one element, and in the irregular ensemble there are 8 elements; the graphs are illustrated with their corresponding sampling probabilities. In both figures, the local check nodes are tagged with 'L' and the joint check nodes are tagged with 'J'. \begin{theorem}[Two-dimensional density evolution] \label{th:2D DE} Consider a random element from the \\$LDPCL(M,n,\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ ensemble. Let $x_l(\epsilon)$ and $y_l(\epsilon)$ denote the probability that a local and joint edge, respectively, carries a variable-to-check erasure message after $l$ BP iterations over the $BEC(\epsilon)$ as $n \to \infty$. Then, \begin{subequations} \begin{align} \label{eq:2D DE1} &x_l(\epsilon) = \epsilon \cdot \lambda_L\left(1- \rho_L\left(1-x_{l-1}(\epsilon) \right)\right)\cdot \Lambda_J\left(1- \rho_J\left(1-y_{l-1}(\epsilon) \right)\right), \quad l \geq 0,\\ \label{eq:2D DE2} &y_l(\epsilon) = \epsilon \cdot \Lambda_L\left(1- \rho_L\left(1-x_{l-1}(\epsilon) \right)\right) \cdot \lambda_J\left(1- \rho_J\left(1-y_{l-1} (\epsilon) \right)\right),\quad l \geq 0,\\ \label{eq:2D DE3} &x_{-1}(\epsilon)=y_{-1}(\epsilon)=1. \end{align} \end{subequations} \end{theorem} \begin{proof} The \emph{convergence to tree channel theorem} implies that as $n \to \infty$, we can consider tree ensembles (see Definition~\ref{Def:tree}) instead of the ensembles in Section~\ref{Sec:Ensembles} for finding the bit-error probability of the BP decoding algorithm. Consider first an $(l_L,l_J,r_L,r_J)$-regular tree ensemble. The degree-distribution polynomials are $\Lambda_L(x)=x^{l_L},\lambda_L(x)=x^{l_L-1},\rho_L(x)=x^{r_L-1},\Lambda_J(x)=x^{l_J},\lambda_J(x)=x^{l_J-1},\rho_J(x)=x^{r_J-1}$. For every $l \geq 0$, the tree ensemble of a $(l_L,l_J,r_L,r_J)$-regular LDPCL ensemble consists of only one element which is a bipartite tree of depth $2l$ rooted in a variable node, such that every local (resp. joint) check node has $r_L-1$ (resp. $r_J-1$) children, every variable node which has a local check node as a father, including the root, has $l_L-1$ local check-node children and $l_J$ joint check-node children, and every variable node which has a joint check node as a father, has $l_J-1$ joint check-node children and $l_L$ local check-node children (see Figure~\ref{Fig:RegTree}). We use mathematical induction on the number of iterations $l$. For $l=0$ the probability that a local or joint edge carries an erasure as a variable-to-check message is $\epsilon$. Since $x_{-1}(\epsilon)=y_{-1}(\epsilon)=1$, then \eqref{eq:2D DE1}-\eqref{eq:2D DE2} with $l=0$ leads to \begin{align*} \begin{split} &x_0(\epsilon) = \epsilon \cdot \left(1- \left(1-1\right)^{r_L-1} \right)^{l_L-1} \cdot \left(1- \left(1-1\right)^{r_J-1} \right)^{l_J}= \epsilon,\\ &y_0(\epsilon) = \epsilon \cdot \left(1- \left(1-1\right)^{r_L-1} \right)^{l_L} \cdot \left(1- \left(1-1\right)^{r_J-1} \right)^{l_J-1} = \epsilon, \end{split} \end{align*} hence, \eqref{eq:2D DE1}-\eqref{eq:2D DE2} hold for regular ensembles and $l=0$. Assume correctness of \eqref{eq:2D DE1}-\eqref{eq:2D DE2} for some $l\geq0$, and consider iteration $l+1$. Each local (resp. joint) check node has $r_L-1$ (resp. $r_J-1$) children variable nodes. Recall that in the BP decoding algorithm for the BEC, a check node will not send an erasure message to its father if and only if all of its incoming messages from its children are not erasures. Let $u_{l}(\epsilon)$ and $w_{l}(\epsilon)$ designate the probability that an outgoing message from a local and joint check node, respectively, is an erasure. Then, \begin{align} \label{eq:2D DE proof u_l} \begin{split} u_{l+1}(\epsilon) = 1-\left(1-x_l(\epsilon)\right)^{r_L-1},\\ w_{l+1}(\epsilon) = 1-\left(1-y_l(\epsilon)\right)^{r_J-1}. \end{split} \end{align} In addition, a variable-to-check message will be an erasure if and only if all of its incoming messages (including the one from the channel) are erasures. Since every variable node which has a local (resp. joint) check node as a father, has $l_L-1$ (resp. $l_L$) local check-node children and $l_J$ (resp. $l_J-1$) joint check-node children, \begin{align} \label{eq:2D DE proof x_l} \begin{split} x_{l+1}(\epsilon) = \epsilon \cdot \left(u_{l+1}(\epsilon) \right)^{l_L-1}\cdot\left(w_{l+1}(\epsilon) \right)^{l_J},\\ y_{l+1}(\epsilon) = \epsilon \cdot \left(u_{l+1}(\epsilon) \right)^{l_L}\cdot\left(w_{l+1}(\epsilon) \right)^{l_J-1}. \end{split} \end{align} Combining \eqref{eq:2D DE proof u_l} and \eqref{eq:2D DE proof x_l} yields that \eqref{eq:2D DE1}-\eqref{eq:2D DE2} hold in the regular case for $l+1$, thus by mathematical induction it holds for every $l\geq 0$. The irregular case follows by invoking the \emph{convergence theorem} and taking the expected value in the induction step (i.e., in \eqref{eq:2D DE proof u_l} and \eqref{eq:2D DE proof x_l}) w.r.t. the tree ensemble construction in Definition~\ref{Def:tree}. Since the probability that a local (resp. joint) edge is connected to a local (resp. joint) check node of degree $i$ is given by $\rho_{L,i}$ (resp. $\rho_{J,i}$), and the probability that a local (resp. joint) edge is connected to a variable node of local degree $i$ and joint degree $j$ is given by $\lambda_{L,i}\Lambda_{J,j}$ (resp. $\Lambda_{L,i}\lambda_{J,j}$), then \begin{align*} \begin{split} &u_{l+1}(\epsilon) = 1-\rho_L\left(1-x_l(\epsilon) \right),\\ &w_{l+1}(\epsilon) = 1-\rho_J\left(1-y_l(\epsilon) \right),\\ &x_{l+1}(\epsilon) =\epsilon \cdot \lambda_L\left(u_{l+1}(\epsilon) \right)\cdot \Lambda_J\left(w_{l+1}(\epsilon) \right),\\ &y_{l+1}(\epsilon) = \epsilon \cdot \Lambda_L\left(u_{l+1}(\epsilon) \right)\cdot\lambda_J\left(w_{l+1}(\epsilon) \right). \end{split} \end{align*} \end{proof} We call \eqref{eq:2D DE1}-\eqref{eq:2D DE2} the 2D density-evolution (2D-DE) equations of LDPCL codes over the $BEC(\epsilon)$. These equations prove that the analysis of the BP decoding algorithm in the global mode differs from the analysis of the standard BP decoding LDPC codes over the $BEC(\epsilon)$. Although for some special cases the 2D-DE equations can be reduced to the well-known 1D-DE equations (Corollary 1 to follow), for the more interesting cases we will need the 2D-DE equations in \eqref{eq:2D DE1}-\eqref{eq:2D DE2}. To simplify notations, $\epsilon$ will be omitted from now on from $x_l(\epsilon)$ and $y_l(\epsilon)$ if it is clear from the context. \begin{remark} \label{remark:asymmetry} Although $x_l$ and $y_l$ in \eqref{eq:2D DE1}-\eqref{eq:2D DE2} seem symmetric to each other, it is not necessarily true since we allow variable nodes to have joint degrees $0$ ($P_0>0$) or $1$ ($\lambda_J(0)>0$), while their local degrees are forced to be greater then $1$. This asymmetry has a crucial effect on the global decoding process which is explained and detailed in Section~\ref{sub:Threshold}. \end{remark} \begin{corollary}\label{claim:2D to 1D} If for every $x \in [0,1]$, $\rho_L(x)=\rho_J(x)$, and the variable local and joint degrees are regular, i.e., $\lambda_L(x)=x^{l_L-1},\lambda_J(x)=x^{l_J-1}$, then \begin{align}\label{eq:2D to 1D1} x_l =y_l,\quad \forall l\geq 0, \end{align} and \begin{align}\label{eq:2D to 1D2} x_l = \epsilon \lambda(1-\rho(1-x_{l-1})), \quad \forall l\geq 0, \end{align} where, $\rho(x)\triangleq\rho_L(x)$, $\lambda(x)\triangleq x^{l_L+l_J-1}$. \end{corollary} \begin{proof} Since in the regular case we have \begin{align*} \Lambda_L(x)=x\lambda_L(x),\quad x \in [0,1], \\ \Lambda_J(x)=x\lambda_J(x),\quad x \in [0,1] , \end{align*} \eqref{eq:2D to 1D1} and \eqref{eq:2D to 1D2} follow immediately from \eqref{eq:2D DE1}-\eqref{eq:2D DE3}. \end{proof} Corollary~\ref{claim:2D to 1D} asserts that if we use identical degree-distributions for local and joint check nodes and we force all variable nodes to have a local and joint regular degree, then the 2D-DE equations in \eqref{eq:2D DE1}-\eqref{eq:2D DE2} degenerate to the already known 1D-DE equation; hence, in this case we can use the analysis of BP decoding in ordinary LDPC codes for the LDPCL codes as well. \begin{example} \label{example:regullar} Consider the $(l_L,l_J,r_L,r_J)$-regular ensemble with $l_L=2,\;l_J=1,\;r_L=r_J=6$. In view of \eqref{eq:reg rate}, the corresponding design rate is \begin{align*} R=\frac12. \end{align*} In addition, \begin{align*} &\lambda(x)=x^{l_L+l_J-1}=x^2,\\ &\rho(x)=\rho_L(x)=x^5, \end{align*} and due to Corollary~\ref{claim:2D to 1D}, we have \begin{align*} x_l &= \epsilon \lambda(1-\rho(1-x_{l-1})) \notag \\ &= \epsilon (1-(1-x_{l-1})^5)^2 \end{align*} which is the 1D-DE equation for the $(3,6)$-regular LDPC ensemble; in other words, in the local mode a $(2,6)$-regular LDPC code is decoded, and in the global mode a $(3,6)$-regular LDPC code is decoded. The local and global thresholds are therefore, \begin{align*} \epsilon^*_L= 0.2 , \quad \epsilon^*_G = 0.4294, \end{align*} respectively. \end{example} \subsection{Threshold} \label{sub:Threshold} In this sub-section, the asymptotic global threshold of the BP decoding algorithm on LDPCL ensembles is studied. We prove that for any given $LDPCL(M,n,\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)$ ensemble, there exists a threshold denoted by $\epsilon^*_G$ such that when $n \to \infty$, the BP algorithm will successfully globally decode (for sufficiently large number of iterations) a code block transmitted on the $BEC(\epsilon)$ if and only if $\epsilon < \epsilon^*_G$. A method to calculate this threshold is provided as well. Define \begin{subequations} \begin{align} \label{eq:f} f(\epsilon,x,y)=\epsilon\,\lambda_L\left(1- \rho_L\left(1-x \right)\right) \Lambda_J\left(1- \rho_J\left(1-y\right)\right),\quad x,y,\epsilon \in [0,1] \\ \label{eq:g} g(\epsilon,x,y)=\epsilon\,\Lambda_L\left(1- \rho_L\left(1-x \right)\right) \lambda_J\left(1- \rho_J\left(1-y\right)\right) ,\quad x,y,\epsilon \in [0,1] \end{align} \end{subequations} such that \eqref{eq:2D DE1}-\eqref{eq:2D DE3} can be re-written as \begin{align} \label{eq:2D DE with f,g} \begin{split} &x_l = f\left(\epsilon,x_{l-1},y_{l-1}\right) ,\quad l \geq 0\\ &y_l = g\left(\epsilon,x_{l-1},y_{l-1}\right) ,\quad l \geq 0\\ &x_{-1} =y_{-1} =1. \end{split} \end{align} \begin{lemma} \label{lemma:monotonicity} The functions $f$ and $g$ are monotonically non-decreasing in all of their variables. \end{lemma} \begin{proof} Since the images of $\lambda_L(\cdot),\Lambda_L(\cdot),\lambda_J(\cdot),\Lambda_J(\cdot),\rho_L(\cdot)$ and $\rho_J(\cdot)$ lie in $[0,1]$, then $f$ and $g$ are monotonically non-decreasing in $\epsilon \in [0,1]$. The rest of the proof is similar and is left as an exercise. \end{proof} \begin{definition} Let $\epsilon \in (0,1)$. We say that $(x,y) \in [0,1]^2$ is an $(f,g)$-fixed point if \begin{align} \label{eq:f,g fixed} \begin{pmatrix} x\\y \end{pmatrix} = \begin{pmatrix} f(\epsilon,x,y)\\ g(\epsilon,x,y) \end{pmatrix}. \end{align} \end{definition} Clearly, for every $\epsilon \in (0,1)$, $(x,y)=(0,0)$ is a trivial $(f,g)$-fixed point. However, it is not clear yet if there exists a non-trivial $(f,g)$-fixed point. In particular, we ask: for which choices of $\epsilon \in (0,1)$, $\lambda_L,\rho_L,\lambda_J,\rho_J$ and $P_0$ there exists a non-trivial $(f,g)$-fixed point? The following lemmas will help answering this question. \begin{lemma} \label{lemma:fix pt} Let $\epsilon \in (0,1)$, and let $(x,y) \in [0,1]^2$ be an $(f,g)$-fixed point. Then, \begin{enumerate} \item \label{item: fix pt lemma0} $x=0$ implies $y =0$, and if $P_0=0$ or $\lambda_J(0)>0$, then $y=0$ implies $x =0$. \item \label{item: fix pt lemma1} $(x,y) \in [0,\epsilon)^2$. \item \label{item: fix pt lemma2} If $\{x_{l}\}_{l=0}^\infty$ and $\{y_{l}\}_{l=0}^\infty$ are defined by \eqref{eq:2D DE with f,g}, then \begin{align} \label{eq:no jumps} x_{l} \geq x , \quad y_{l} \geq y,\quad \forall l\geq 0. \end{align} \end{enumerate} \end{lemma} \begin{proof} See Appendix~\ref{App:fix pt} \end{proof} \begin{remark} \label{remark: noting asymmetry} Item 1) in Lemma~\ref{lemma:fix pt} expresses the asymmetry between the local and joint sides during the decoding algorithm discussed in Remark~\ref{remark:asymmetry}. \end{remark} \begin{lemma} \label{lemma:mono of DE} Let $x_{l} $ and $y_{l}$ be defined by \eqref{eq:2D DE with f,g} and let $0<\epsilon \leq \epsilon' < 1$. Then, \begin{align} \label{eq:mono of DE1} \begin{split} &x_{l+1}(\epsilon) \leq x_{l}(\epsilon) , \quad \forall l \geq 0\\ &y_{l+1}(\epsilon) \leq y_{l}(\epsilon) , \quad \forall l \geq 0, \end{split} \end{align} and \begin{align} \label{eq:mono of DE2} \begin{split} &x_{l}(\epsilon) \leq x_{l}(\epsilon') , \quad \forall l \geq 0\\ &y_{l}(\epsilon) \leq y_{l}(\epsilon') , \quad \forall l \geq 0. \end{split} \end{align} \end{lemma} \begin{proof} By mathematical induction on $l$ and by Lemma~\ref{lemma:monotonicity}. The details are left as an exercise. \end{proof} In view of \eqref{eq:2D DE with f,g}, it can be verified that \begin{align} \label{eq:x_l(0)} \begin{split} &x_l(0) = 0 ,\quad x_l(1) = 1 ,\forall l \geq 0\\ &y_l(0) = 0 ,\quad y_l(1) = 1 ,\forall l \geq 0. \end{split} \end{align} Since $x_l$ and $y_l$ are bounded from below by $0$, then Lemma~\ref{lemma:mono of DE} implies that the limits $\lim\limits_{l \to \infty}x_l(\epsilon)$ and $\lim\limits_{l \to \infty}y_l(\epsilon)$ exist. In view of \eqref{eq:x_l(0)} we can define a BP global decoding asymptotic threshold by \begin{align} \label{eq:th op def A} \epsilon^*_G = \sup \left\{\epsilon \in [0,1] \colon \lim\limits_{l \to \infty}y_l(\epsilon)=\lim\limits_{l \to \infty}x_l(\epsilon)=0 \right\}. \end{align} Note that from continuity of $g$ in \eqref{eq:g}, Item~\ref{item: fix pt lemma0}) in Lemma~\ref{lemma:fix pt} implies that if $\lim\limits_{l \to \infty}x_l(\epsilon)=0 $, then $\lim\limits_{l \to \infty}y_l(\epsilon)=0 $. Thus, \eqref{eq:th op def A} can be re-written as \begin{align} \label{eq:th op def} \epsilon^*_G = \sup \left\{\epsilon \in [0,1] \colon \lim\limits_{l \to \infty}x_l(\epsilon)=0 \right\}. \end{align} \begin{theorem}[Fixed-point characterization] \label{theorem:fix pt char} Let \begin{align}\label{eq:fix pt char} \hat{\epsilon} = \sup \left\{ \epsilon \in [0,1]\colon \eqref{eq:f,g fixed}\text{ has no solution with }(x,y) \in (0,1]\times[0,1]\right\}. \end{align} Then, $\epsilon^*_G=\hat{\epsilon}$. \end{theorem} \begin{proof} Let $\epsilon<\hat{\epsilon}$, and let $x(\epsilon)=\lim\limits_{l \to \infty}x_l(\epsilon),\;y(\epsilon)=\lim\limits_{l \to \infty}y_l(\epsilon)$. Taking the limit $l \to \infty$ in \eqref{eq:2D DE with f,g} yields that $(x(\epsilon),y(\epsilon))$ is an $(f,g)$-fixed point. In view of \eqref{eq:fix pt char}, since $\epsilon<\hat{\epsilon}$, it follows that $x(\epsilon)=0$. From \eqref{eq:th op def} we have $\epsilon < \epsilon^*_G$, for every $\epsilon<\hat{\epsilon}$; this implies that $\hat{\epsilon} \leq \epsilon^*_G$. For the other direction let $\epsilon>\hat{\epsilon}$ and let $(z_1,z_2)$ be an $(f,g)$-fixed point such that $z_1>0$. Lemma~\ref{lemma:fix pt}-Item~\ref{item: fix pt lemma2}) implies that \begin{align*} x_l(\epsilon) \geq z_1 >0,\quad \forall l \geq 0,\\ \end{align*} thus $\lim\limits_{l \to \infty}x_l(\epsilon) >0$, where the existence of this limit is assured due to Lemma~\ref{lemma:mono of DE}; hence, $\epsilon > \epsilon^*_G$. Since this is true for all $\epsilon>\hat{\epsilon}$, then we deduce that $\hat{\epsilon} \geq \epsilon^*_G$ and complete the proof. \end{proof} We proceed by providing a numerical way to calculate the threshold of a given choice of $\Lambda_L,\Lambda_J,\Omega_L$ and $\Omega_J$. Define \begin{align} \label{eq:q_L q_J} \begin{split} &q_L(x)\triangleq x\cdot \frac{\Lambda_L\left( 1- \rho_L\left(1-x \right)\right)}{\lambda_L\left( 1- \rho_L\left(1-x \right)\right)},\quad x \in (0,1]\\ &q_J(x)\triangleq x\cdot \frac{\Lambda_J\left( 1- \rho_J\left(1-x \right)\right)}{\lambda_J\left( 1- \rho_J\left(1-x \right)\right)},\quad x \in (0,1]\\ \end{split} \end{align} \begin{lemma} \label{lemma:q_L(0)} $\lim_{x \to 0}q_L(x)=0$. \end{lemma} \begin{proof} See Appendix~\ref{App:q_L(0)}. \end{proof} Since $q_L(1)=1$, Lemma~\ref{lemma:q_L(0)} and the intermediate-value theorem imply that for every $w \in (0,1]$ there exists $x\in (0,1]$ such that $q_L(x)=w$; it is not true in general that $\lim_{x \to 0}q_J(x)=0$, and this limit may be infinite (check for example the case $P_0>0$, $\rho_J(x)=x^3$ and $\lambda_J(x)=x^2$). \begin{definition} \label{def:q} For every $y>0$ such that $q_J(y) \leq 1$ define \begin{align} \label{eq:q def} q(y)\triangleq\max \{ x \colon q_L(x)=q_J(y)\}. \end{align} \end{definition} \begin{lemma} \label{lemma: fixed curve} If $(x,y)$ is an $(f,g)$-fixed point with $y>0$, then \begin{align}\label{eq:y=q(x)} x \leq q(y). \end{align} \end{lemma} \begin{proof} See Appendix~\ref{App:fixed curve}. \end{proof} \begin{remark} \label{remark:q inj} If $q_L(\cdot)$ is injective, then \eqref{eq:q def} and \eqref{eq:y=q(x)} can be restated as \begin{align*} x=q(y)=q_L^{-1}(q_J(y)). \end{align*} \end{remark} \begin{theorem}[Threshold numerical calculation] \label{th:numerical th} Let $\lambda_L,\rho_L,\lambda_J,\rho_J$ be degree-distribution polynomials, let $P_0 \in [0,1]$, and let $\epsilon^*_G=\epsilon^*_G(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ be the BP global decoding threshold of the $LDPCL(M,n,\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ ensemble on the $BEC$ when $n \to \infty$. \\ If $P_0=0$ or $\lambda_J(0) >0$ , then \begin{align} \label{eq:numerical th1} \epsilon^*_G = \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)}. \end{align} Else, \begin{align} \label{eq:numerical th2} \epsilon^*_G = \min\left\{ \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)},\;\;\frac1{P_0}\cdot \inf_{(0,1]}\frac{x}{\lambda_L\left(1- \rho_L\left(1-x \right)\right)}\right\}. \end{align} \end{theorem} \begin{proof} See Appendix~\ref{App:numerical th}. \end{proof} \begin{remark} In the special case where $\rho_J(\cdot)=\rho_L(\cdot)$, and the variable local and joint degrees are regular (i.e. $\lambda_L(x)=x^{l_L-1},\,\lambda_J(x)=x^{l_J-1}$), \eqref{eq:q_L q_J} implies that $q_L(\cdot)$ is injective, and that $q_L(x)=q_J(x)$, for every $x \in (0,1]$. Therefore, in view of Remark~\ref{remark:q inj}, every $(f,g)$-fixed point lies on the line $y=x$. Further, since $P_0=0$, Theorem~\ref{th:numerical th} yields \begin{align*} \epsilon^*_G &= \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} \\ &= \inf\limits_{y \in (0,1]} \frac{y}{g(1,y,y)} \\ &= \inf\limits_{y \in (0,1]} \frac{y}{\lambda(1-\rho(1-y))} , \end{align*} where for every $y \in [0,1]$, $\rho(y)=\rho_L(y)$, and $\lambda(y)=y^{l_L+l_J-1}$. This is consistent with Corollary~\ref{claim:2D to 1D}. \end{remark} \begin{example} \label{ex:threshold} Consider an LDPCL ensemble characterized by \begin{align*} &\lambda_L(x)=x, \quad \rho_L(x)=x^9 \\ &\lambda_J(x)=0.3396x+0.6604x^4,\quad P_0=0.2667, \quad \rho_J(x)=x^9 . \end{align*} Using \eqref{eq:design rate2}, \eqref{eq:1D th numeric} and \eqref{eq:numerical th2}, the design rate is $R=0.5571$, the local decoding threshold is $\epsilon_L^*=0.1112$, and the global decoding threshold is $\epsilon_G^*=0.35$. Figure~\ref{Fig:DE} illustrates the 2D-DE equations in \eqref{eq:2D DE1}-\eqref{eq:2D DE3} for three different bit erasure probabilities: $0.33,0.35,0.37$, from left to right, respectively. When the channel's erasure probability is $\epsilon=0.33$, there are no $(f,g)$-fixed points -- the decoding process ends successfully, and when $\epsilon=0.37$, there are two $(f,g)$-fixed points, $(0.335,0.3202)$ and $(0.2266,0.1795)$ -- the decoding process gets stuck at $(0.335,0.3202)$. When $\epsilon=0.35=\epsilon_G^*$, there is exactly one $(f,g)$-fixed point at $(0.27,0.237)$, and the dashed and dotted lines osculate. \end{example} \begin{figure}[h!] \centering \includegraphics[width=15cm,height=6cm]{DEcrop.jpg} \caption{\label{Fig:DE} Illustration of the density-evolution equations in \eqref{eq:2D DE1}-\eqref{eq:2D DE3} for the LDPCL ensemble in Example~\ref{ex:threshold} which induce a global decoding threshold of $\epsilon^*=0.35$. The evolved channel erasure probabilities, from left to right, are $\epsilon=0.33,0.35,0.37$.} \end{figure} \section{An LDPCL Construction and Achieving Capacity} \label{Sec:C1} In this section, we present an LDPCL ensemble construction. First we assume that the local ensemble (i.e., $\lambda_L,\rho_L$) is given (Sub-section~\ref{sub:C1}), and then we optimize the local ensemble according to the proposed construction (Sub-sections~\ref{sub:LP}~and~\ref{sub:Low Loc}). Finally, we use capacity-achieving sequences of LDPC ensembles to construct a LDPCL capacity-achieving sequence that in addition can be sub-block decoded up to the local threshold permitted by the local degree distributions. In general, inputs for the construction are the desired local and global decoding thresholds, $\epsilon_L$ and $\epsilon_G$, respectively, and the outputs are degree-distributions $\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0 \right)$ such that \begin{align*} &\epsilon_L^*\left(\lambda_L,\rho_L \right)=\epsilon_L \\ &\epsilon^*_G\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0 \right)=\epsilon. \end{align*} Note that setting $P_0=0$, and picking any two LDPC ensembles $\left(\lambda_L,\rho_L\right)$ and $\left(\lambda_J,\rho_J\right)$ that induce thresholds $\epsilon^*\left(\lambda_L,\rho_L\right)=\epsilon_L$ and $\epsilon^*\left(\lambda_J,\rho_J\right)=\epsilon_G$ would suffice, but this choice yields poor rates (intuitively, with that choice the local and joint codes do not "cooperate"). Another solution is not using a joint ensemble at all, i.e., choosing $\left(\lambda_L,\rho_L\right)$ such that $\epsilon^*\left(\lambda_L,\rho_L\right)=\epsilon_G > \epsilon_L$, and setting $P_0=1$. However, this solution is an undesired overkill since it would miss the opportunity to have a low-complexity local decoder for the majority of decoding instances where the erasure probabilities are below $\epsilon_L$. \subsection{The Construction} \label{sub:C1} In this sub-section, we assume that the local ensemble $(\lambda_L,\rho_L)$ and the global decoding threshold $\epsilon_G$ are given, and we give a simple way to determine the joint ensemble $(\lambda_J,\rho_J,P_0)$ such that $\epsilon_G^*(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)=\epsilon_G$. \begin{definition} \label{def:h_eps} Let $\left(\lambda_L,\rho_L \right)$ be local degree-distribution polynomials, and let $\epsilon^*\left(\lambda_L,\rho_L\right)=\epsilon_L$ be their BP decoding threshold. For $\epsilon \in (\epsilon_L,1)$, let \begin{enumerate} \item $h_{\epsilon}(x)=\epsilon\lambda_L(1-\rho_L(1-x))-x,\quad x \in [0,1]$ \item \label{def:x_s}$x_s(\epsilon)=\max\{x \in [0,1] \colon h_\epsilon(x)\geq 0\}$ \item $a_s(\epsilon)=\Lambda_L\left(1- \rho_L\left(1-x_s(\epsilon) \right)\right)$ \end{enumerate} \end{definition} For every $x \in [0,1]$, $h_\epsilon(x)$ is the erasure-probability change in one iteration of the BP algorithm on the local graph, if the current erasure probability is $x$. By definition, since $\epsilon>\epsilon_L$, $h_\epsilon(x)>0$ for some $x \in [0,1]$. In addition, for every $x>\epsilon$, $h_\epsilon(x) < 0$, so $x_s(\epsilon)$ is well defined. Operationally, $x_s(\epsilon)$ is the local-edge erasure probabilty when the local decoder gets stuck. Definitions similar to items 1) and 2) have appeared in \cite{KudRichUrb11}; we add $a_s(\epsilon)$ as the variable-node erasure probability corresponding to $x_s(\epsilon)$. \begin{theorem}\label{th:C1} let $(\lambda_L,\rho_L)$ be a local ensemble inducing a local threshold $\epsilon_L$, and let $\epsilon_G \in (\epsilon_L,1)$. If $P_0=\frac{\epsilon_L}{\epsilon_G}$, and $(\lambda_J,\rho_J)$ is an ensemble having a decoding threshold $\epsilon_J=\epsilon_G \cdot a_s(\epsilon_G)$, then $\epsilon^*_G(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)=\epsilon_G$. \end{theorem} \begin{proof} Let $\bar{\epsilon}<\epsilon_G$. In view of \eqref{eq:f}, for every $ x \in (0,1]$, \begin{align} \label{eq:f<x y=0} f(\bar{\epsilon},x,0) &= \bar{\epsilon} \lambda_L(1-\rho_L(1-x))P_0 \notag \\ &< P_0 \epsilon_G \lambda_L(1-\rho_L(1-x)) \notag \\ &= \epsilon_L \lambda_L(1-\rho_L(1-x)) \notag \\ &\leq x . \end{align} Furthermore, Definition~\ref{def:h_eps} implies that for every $(x,y) \in (x_s(\bar{\epsilon}), 1)\times[0,1]$, \begin{align}\label{eq:f<x} f(\bar{\epsilon},x,y) &= \bar{\epsilon} \lambda_L(1-\rho_L(1-x)) \Lambda_J\left(1- \rho_J\left(1-y\right)\right) \notag \\ &< x\Lambda_J\left(1- \rho_J\left(1-y\right)\right) \notag \\ &\leq x, \end{align} and from Lemma~\ref{lemma:monotonicity}, if $(x,y) \in (0,x_s(\bar{\epsilon})]\times(0,1]$, \begin{align} \label{eq:<a_eps} g(\bar{\epsilon},x,y) &\leq g(\bar{\epsilon},x_s(\bar{\epsilon}),y) \notag \\ &= \bar{\epsilon} \lambda_J(1-\rho_J(1-y)) \Lambda_L\left(1- \rho_L\left(1-x_s(\bar{\epsilon})\right)\right) \notag \\ &= \bar{\epsilon} \lambda_J(1-\rho_J(1-y)) a_s(\bar{\epsilon}). \end{align} Since $\bar{\epsilon}<\epsilon_G$, then $\epsilon_J=\epsilon_G \cdot a_s(\epsilon_G) > \bar{\epsilon}\cdot a_s(\bar{\epsilon})$, where $\epsilon_J$ is the BP decoding threshold of $(\lambda_J,\rho_J)$; thus \eqref{eq:<a_eps} yields \begin{align} \label{eq:g<y} g(\bar{\epsilon},x,y)< \epsilon_J \lambda_J(1-\rho_J(1-y)) \leq y ,\quad \forall (x,y) \in (0,x_s(\bar{\epsilon})]\times(0,1]. \end{align} Combining \eqref{eq:f<x y=0}, \eqref{eq:f<x}, and \eqref{eq:g<y} implies that \eqref{eq:f,g fixed} has no solution in $(0,1]\times [0,1]$. This in turns implies, due to Theorem~\ref{theorem:fix pt char}, that $\epsilon^*_G \geq \bar{\epsilon}$. Since this is true for any $\bar{\epsilon}<\epsilon_G$, we conclude that \begin{align}\label{eq:main th converse} \epsilon^*_G \geq \epsilon_G. \end{align} Finally, from Theorem~\ref{th:numerical th} and \eqref{eq:1D th numeric}, since $P_0=\frac{\epsilon_L}{\epsilon_G}>0$, we have \begin{align}\label{eq:th C1 <} \epsilon^*_G \leq \frac1{P_0}\cdot \inf_{(0,1]}\frac{x}{\lambda_L\left(1- \rho_L\left(1-x \right)\right)} = \frac{\epsilon_L}{P_0} = \epsilon_G. \end{align} \end{proof} \subsection{LP Optimized Degree-Distributions} \label{sub:LP} From the capacity bound, the design rate of an ensemble constructed by Theorem~\ref{th:C1} is upper bounded by \begin{align} \label{eq:cap bound} R(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0) < 1-\frac{\int_0^1\rho_L}{\int_0^1\lambda_L}-\epsilon_J\cdot (1-P_0). \end{align} In view of item 3) in Definition~\ref{def:h_eps}, for a fixed $\epsilon_G \in (0,1)$, $\epsilon_J=\epsilon_G \cdot a_s(\epsilon_G)$ is monotonically increasing w.r.t. $x_s(\epsilon_G)$, hence the design rate could increase if $x_s(\epsilon_G)$ decreases. On the other hand, lowering $x_s(\epsilon_G)$ adds constraints on the local ensemble, and it may degrade the design rate $\left(\text{i.e., if }\tfrac{\int_0^1\rho_L}{\int_0^1\lambda_L}\text{ increases}\right)$. In this sub-section we use linear programming to find a local ensemble that maximizes the bound on the design rate of the construction proposed in Theorem~\ref{th:C1}. In other words, we assume that the local and global thresholds $(\epsilon_L,\epsilon_G)$ are given and we ask: under a constraint on the maximum local degrees ($l_{max},r_{max}$), what are the local degree-distributions that bring the bound in \eqref{eq:cap bound} to maximum. This maximum-degree constraint is motivated by the low-complexity requirement of the local code. Note that the joint ensemble is not limited (as long as its decoding threshold satisfies the hypothesis of Theorem~\ref{th:C1}), and one can think of it as an ensemble that almost achieves capacity. As usual, we iterate between optimizing the variables degree-distribution, $\left(\lambda_{L,1},\ldots,\lambda_{L,l_{max}}\right)$, and checks degree-distribution, $\left(\rho_{L,1},\ldots,\rho_{L,r_{max}}\right)$. Let $x_s \in (0,1)$, fix $\rho_L(x)=x^{r_{max}-1}$, and solve \begin{align} \label{optimize lambda} \begin{array}{ll} \text{maximize} & \sum\limits_{i=2}^{l_{max}} \frac{\lambda_{L,i}}{i} \\ \text{subject to} & \lambda_{L,i} \geq 0 , \quad i \in \{2, \ldots, l_{max}\}, \\ & \sum\limits_{i=2}^{l_{max}} \lambda_{L,i}=1, \\ & \epsilon_L \lambda_L(1-\rho_L(1-x))-x \leq 0, \quad x \in (0,1]\\ & \epsilon \lambda_L(1-\rho_L(1-x))-x \leq 0, \quad x \in (x_s,1]. \end{array} \end{align} With the resulting $\lambda_L$ in hand, solve \begin{align} \label{optimize rho} \begin{array}{ll} \text{minimize} & \sum\limits_{i=2}^{r_{max}} \frac{\rho_{L,i}}{i} \\ \text{subject to} & \rho_{L,i} \geq 0 , \quad i \in \{2, \ldots, r_{max}\}, \\ & \sum\limits_{i=2}^{r_{max}} \rho_{L,i}=1, \\ & 1-z-\rho_L(1-\epsilon_L\lambda_L(z)) \leq 0, \quad z \in (0,1]\\ & 1-z-\rho_L(1-\epsilon\lambda_L(z)), \quad z \in \left(\lambda_L^{-1}(\tfrac{x_s}{\epsilon}),1\right]. \end{array} \end{align} By iterating between \eqref{optimize lambda} and \eqref{optimize rho} for different values of $x_s \in (0,1)$, the design rate of the ensemble constructed in Theorem~\ref{th:C1} is maximized. \subsection{Low Degree Local Ensembles} \label{sub:Low Loc} In most cases, it is hard to produce an analytical expression for $x_s(\epsilon)$, but if we limit the local degrees of the ensemble to be small, then a closed-form expression could be derived for $x_s(\epsilon),a_s(\epsilon)$, and $\epsilon_J$. In particular, we consider local ensembles taking the form: \begin{align} \label{eq:low local} \lambda_L(x)=x,\, \rho_L(x) = \rho_2x+\rho_3x^2+\rho_4x^3, \quad \rho_i\geq 0,\,\rho_2+\rho_2+\rho_4=1. \end{align} This restriction to very low local degrees yields a very low-complexity local BP decoding algorithm. \begin{lemma} \label{lemma:th low loc} For the family of ensembles given in \eqref{eq:low local}, \begin{align} \label{eq:th low loc} \epsilon_L=\frac1{1+\rho_3+2\rho_4}. \end{align} In addition, for every $\epsilon \in (\epsilon_L,1)$, if $\rho_4=0$, then \begin{align}\label{eq:x_s rho4=0} x_s(\epsilon)=1-\tfrac1{\rho_3}\left(\tfrac1\epsilon-1 \right), \end{align} and if $\rho_4>0$, then \begin{align}\label{eq:x_s rho4>0} x_s(\epsilon)=\tfrac{\rho_3+3\rho_4-\sqrt{\left( \rho_3+\rho_4\right)^2+4\rho_4\left(\tfrac1\epsilon-1 \right)}}{2\rho_4}. \end{align} Furthermore, \begin{align}\label{eq:a_s low loc} a_s(\epsilon)=\left(\frac{x_s(\epsilon)}{\epsilon}\right)^2. \end{align} \end{lemma} \begin{proof} See Appendix~\ref{App:low loc}. \end{proof} \begin{remark} To emphasize the fact the $x_s(\epsilon)$ depends on $\rho_3,\rho_4$, we use the notation $x_s(\rho_3,\rho_4,\epsilon)$ for the rest of this sub-section. \end{remark} In view of Lemma~\ref{lemma:th low loc}, in the special case where the the local ensemble is in the form of \eqref{eq:low local}, the procedure of finding the optimal $x_s(\rho_3,\rho_4,\epsilon)$ described in Section~\ref{sub:LP} boils down to solving a closed-form optimization problem. Let $0<\epsilon_L <\epsilon_G<1$. If $(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)$ is an ensemble such that $(\lambda_L,\rho_L)$ is in the form of \eqref{eq:low local}, and $(\lambda_J,\rho_J,P_0)$ satisfies the hypotheses of Theorem~\ref{th:C1}, then from \eqref{eq:cap bound} and \eqref{eq:a_s low loc} \begin{align}\label{eq:rate C1 low loc} R &< \frac13 \rho_3+\frac12 \rho_4 - \epsilon_G \cdot a_s(\epsilon_G)\cdot\left(1-\frac{\epsilon_L}{\epsilon_G}\right) \notag \\ &= \frac13 \rho_3+\frac12 \rho_4 - \frac{x^2_s(\rho_3,\rho_4,\epsilon_G)}{\epsilon_G}\cdot\left(1-\frac{\epsilon_L}{\epsilon_G}\right) \notag \\ &\triangleq \hat{R}(\rho_3,\rho_4), \end{align} Moreover, in order to induce a local decoding threshold at least $\epsilon_L$, Lemma~\ref{lemma:th low loc} implies that $\rho_3+2\rho_4\leq \tfrac1{\epsilon_L}-1$; hence, \eqref{eq:rate C1 low loc} yields the following two-variables optimization problem \begin{align} \label{optimize R hat} \begin{array}{ll} \underset{\rho_3,\rho_4}{\text{maximize}} & \hat{R}(\rho_3,\rho_4) \\ \text{subject to} & \rho_3,\rho_4 \geq 0 \\ & \rho_3+\rho_4 \leq 1\\ &\rho_3+2\rho_4\leq \tfrac1{\epsilon_L}-1, \end{array} \end{align} that can be solved with some standard optimization techniques. \subsection{Achieving Capacity} \label{sub:c.a. seq} In this sub-section, we define the LDPCL notion of capacity-achieving sequences, and prove that such sequences exist. During the derivation, we will refer to $\delta(\lambda,\rho)$ as the additive gap to capacity of the $LDPC(\lambda,\rho)$ ensemble, i.e., $\delta(\lambda,\rho)=1-\epsilon^*(\lambda,\rho)-R(\lambda,\rho)$. Similarly, we define $\delta\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right)=1-\epsilon^*_G(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)-R(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)$ as the global additive gap to capacity. \begin{definition} \label{def:c.a. seq} Let $ 0 < \epsilon_L < \epsilon_G<1$. A sequence $\left\{ \lambda^{(k)}_L,\rho^{(k)}_L,\lambda^{(k)}_J,\rho^{(k)}_J,P^{(k)}_0\right\}_{k \geq 1}$ is said to achieve capacity on a $BEC(\epsilon_G)$, with local decoding capability $\epsilon_L$ if: \begin{enumerate} \item $\lim\limits_{k \to \infty}\epsilon^*_L\left(\lambda^{(k)}_L,\rho^{(k)}_L\right)=\epsilon_L$ \item $\lim\limits_{k \to \infty}\epsilon^*_G\left(\lambda^{(k)}_L,\rho^{(k)}_L,\lambda^{(k)}_J,\rho^{(k)}_J,P^{(k)}_0\right)=\epsilon_G$ \item $\lim\limits_{k \to \infty}R\left(\lambda^{(k)}_L,\rho^{(k)}_L,\lambda^{(k)}_J,\rho^{(k)}_J,P^{(k)}_0\right)=1-\epsilon_G$ \end{enumerate} \end{definition} Note that Items~2) and~3) imply that $\lim\limits_{k \to \infty}\delta\left(\lambda^{(k)}_L,\rho^{(k)}_L,\lambda^{(k)}_J,\rho^{(k)}_J,P^{(k)}_0\right)=0$. \begin{lemma} \label{lemma:gap2cap} Let $\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right)$ be degree-distribution polynomials constructed according to Theorem~\ref{th:C1}, and let $\delta_L \triangleq \delta(\lambda_L,\rho_L)$ and $\delta_J\triangleq\delta(\lambda_J,\rho_J)$. Then, \begin{align} \label{eq:delta} \delta\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right) \leq \delta_L+\delta_J\cdot \left( 1-P_0\right). \end{align} \end{lemma} \begin{proof} Let $\epsilon_G=\epsilon^*_G\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right)$ be the BP global decoding threshold of of the $LDPCL(M,n,\lambda_L,\rho_L,\lambda_J,\rho_J,P_0)$ ensemble as $ n \to \infty$. In view of Theorem~\ref{th:C1}, $P_0=\tfrac{\epsilon_L}{\epsilon_G}$, and \begin{align} \label{eq:epsJ<eps} \epsilon_J \triangleq \epsilon^*\left( \lambda_J,\rho_J\right)= \epsilon_G \cdot a_s(\epsilon_G) \leq \epsilon_G. \end{align} In addition, by definition we have, \begin{align} \label{eq:deltaL deltaJ} \begin{split} \frac{\int_0^1 \rho_L(x)\mathrm{d}x}{\int_0^1 \lambda_L(x)\mathrm{d}x} = \epsilon_L+\delta_L \\ \frac{\int_0^1 \rho_J(x)\mathrm{d}x}{\int_0^1 \lambda_J(x)\mathrm{d}x} = \epsilon_J+\delta_J, \end{split} \end{align} hence \eqref{eq:design rate2}, \eqref{eq:epsJ<eps} and \eqref{eq:deltaL deltaJ} imply, \begin{align}\label{eq:gap2cap proof} \delta\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right) &= 1-R\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right)-\epsilon^*_G\left(\lambda_L,\rho_L,\lambda_J,\rho_J,P_0\right) \notag \\ &=\epsilon_L+\delta_L+\left(\epsilon_J+\delta_J\right)\left( 1-\frac{\epsilon_L}{\epsilon_G}\right) -\epsilon_G \notag \\ &=\frac1{\epsilon_G}\overbrace{(\epsilon_J-\epsilon_G)}^{\leq 0}\overbrace{(\epsilon_G-\epsilon_L)}^{\geq 0}+\delta_L+\delta_J\left( 1-\frac{\epsilon_L}{\epsilon_G}\right) \notag \\ &\leq \delta_L+\delta_J\left(1-\frac{\epsilon_L}{\epsilon_G}\right) \\ &= \delta_L+\delta_J\left(1-P_0\right). \end{align} \end{proof} At this point, it is clear how to construct a capacity-achieving sequence of LDPCL ensembles on a $BEC(\epsilon_G)$, with a local decoding capability $\epsilon_L$. Choose any two sequences of (ordinary) LDPC ensembles $\left\{ \lambda^{(k)}_L,\rho^{(k)}_L,\right\}_{k \geq 1}$ and $\left\{ \lambda^{(k)}_J,\rho^{(k)}_J,\right\}_{k \geq 1}$ that achieve capacity on the $BEC(\epsilon_L)$ and $BEC(\epsilon_G)$, respectively, and set $P_0^{(k)}=\left(1-\frac{\epsilon_L}{\epsilon_G}\right)$, for all $k \geq 1$. Item 1) in Definition~\ref{def:c.a. seq} clearly holds for this sequence, and in view of Theorem~\ref{th:C1}, Item 2) in Definition~\ref{def:c.a. seq} holds as well. Finally, Lemma~\ref{lemma:gap2cap} implies that \begin{align*} \lim\limits_{k \to \infty}\delta\left(\lambda^{(k)}_L,\rho^{(k)}_L,\lambda^{(k)}_J,\rho^{(k)}_J,P_0\right) &\leq \lim\limits_{k \to \infty}\delta\left(\lambda^{(k)}_L,\rho^{(k)}_L\right) + \lim\limits_{k \to \infty}\delta\left(\lambda^{(k)}_J,\rho^{(k)}_J\right)\left(1-\frac{\epsilon_L}{\epsilon}\right) =0. \end{align*} \begin{example} \label{ex:c.a.} We construct an LDPCL capacity-achieving sequence with local and global threshold $\epsilon_L=0.05$ and $\epsilon_G=0.2$, respectively. We set $P_0=\tfrac{\epsilon_L}{\epsilon_G}=0.25$ and we use the Tornado capacity-achieving sequence \cite{Luby01}, \begin{align} \label{eq:Tornado} \begin{split} & \lambda_L^{(D_L)}(x)=\frac1{H(D_L)}\sum_{i=1}^{D_L} \frac{x^i}{i}, \qquad \lambda_J^{(D_J)}(x)=\frac1{H(D_J)}\sum_{i=1}^{D_J} \frac{x^i}{i}, \\ & \rho_L^{(D_L)}(x)=e^{-\alpha_L}\sum_{i=0}^{\infty} \frac{(\alpha_L x)^i}{i!}, \qquad \rho_J^{(D_J)}(x)=e^{-\alpha_J}\sum_{i=0}^{\infty} \frac{(\alpha_J x)^i}{i!}, \end{split} \end{align} where $H(\cdot)$ is the harmonic sum, $\alpha_L=\tfrac{H(D_L)}{\epsilon_L}$, and $\lambda_J^{(D_J)}(x),\rho_J^{(D_J)}(x)$ are defined similarly (the check degree-distribution series are truncated to get degree-distribution polynomials with finite degrees). $D_L$ (resp. $D_J$) controls the local (resp. joint) gap to capacity $\delta_L$ (resp. $\delta_J$); the bigger it is, the smaller the gap is. Table~\ref{tbl:tornado} exemplifies how the LDPCL sequence $\left\{\lambda_L^{(D_L)},\rho_L^{(D_L)},\lambda_J^{(D_J)},\rho_J^{(D_J)},P_0 \right\}$ approaches capacity as $D_L\to \infty,\;D_J\to \infty$: Theorem~\ref{th:C1} implies that for every value of $D_L$ and $D_J$, the global decoding threshold is $\epsilon^*_G\geq0.2$; the local additive gap to capacity $\delta_L$ and joint additive gap to capacity $\delta_J$ both vanish as $D_L\to \infty$ and $D_J\to \infty$, which in view of \eqref{eq:delta}, implies that the global additive gap to capacity $\delta$ vanishes as well. \begin{table} \caption{\label{tbl:tornado} Local gap to capacity $\delta_L$, joint gap to capacity $\delta_J$, and rate of the LDPCL capacity-achieving sequence given by \eqref{eq:Tornado} with $\epsilon_L=0.05$, $\epsilon_G=0.2$, and $P_0=0.25$.} \begin{center} \begin{tabular}{ c|c|c|c|c} \hline $D_L$&$\delta_L$&$D_J$&$\delta_J$&Rate \\ \hline \hline 1 & 0.05 & 1 & 0.2 & 0.6 \\ 1 & 0.05 & 2 & 0.1 & 0.67 \\ 1 & 0.05 & 10 & 0.02 & 0.735 \\ 1 & 0.05 & 100& 0.002 & 0.745 \\ 2 & 0.025 & 100& 0.002 & 0.775 \\ 5 & 0.01 & 100& 0.002 & 0.79 \\ $\infty$& 0 &$\infty$& 0 & 0.8 \end{tabular} \end{center} \end{table} Table~\ref{tbl:tornado} shows the advantage of the multi-block scheme: one can achieve the local threshold with significantly simpler ensembles (use only few terms in \eqref{eq:Tornado}). Such simpler codes allow to approach the theoretical threshold with shorter blocks and with lower complexity. \end{example} \section{Reducing The Number of Joint Iterations} \label{Sec:N_JI} It has not been emphasized earlier in the paper, but in practical settings the local and joint decoding iterations are very different in terms of cost. Joint iterations access a much larger (factor M) data unit, which may involve a high cost of transferring the bits to the check-node logic. In distributed-storage applications the sub-blocks may even reside in remote sites, increasing the communication cost even further. Therefore, we would like to reduce the number of joint iterations (call it $N_{JI}$) performed by the decoder (i.e., rounds of variable-to-joint-check messages and joint-check-to-variable messages). Ideally, the decoder successfully decodes the desired sub-block (of length $n$) on the local graph (see Section~\ref{sub:Tanner}), does not enter the global mode, and no joint iterations are needed ($N_{JI}=0$); this happens when the fraction of erased bits is equal or less than the local threshold, i.e., $\epsilon \leq \epsilon_L$. However, if $\epsilon>\epsilon_L$, then the decoder fails to decode in the local mode and it enters the global mode where at least one joint iteration is necessary ($N_{JI}\geq 1$). In this section, we suggest a scheduling scheme for updating the joint side of the two-sided Tanner graph during the global mode decoding, and we prove that it is optimal in the sense of minimizing $N_{JI}$. In addition, we study how the parameters of the local and joint ensembles affect $N_{JI}$. \subsection{An $N_{JI}$-optimal scheduling scheme} \label{sub:opt schedule} Recall the density-evolution equations for the BP decoding algorithm over the $BEC$ with erasure probability $\epsilon$, of the $LDPCL(M,n,\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ ensemble when $n \to \infty$ : \begin{subequations} \begin{align} \label{eq:2D-DE1} &x_l = f\left(\epsilon,x_{l-1},y_{l-1}\right), \quad l \geq 0,\\ \label{eq:2D-DE2} &y_l = g\left(\epsilon,x_{l-1},y_{l-1}\right),\quad l \geq 0,\\ \label{eq:2D-DE3} &x_{-1}=y_{-1}=1, \end{align} \end{subequations} where $f$ and $g$ are given in \eqref{eq:f} and \eqref{eq:g}, respectively; note that \eqref{eq:2D-DE1} and \eqref{eq:2D-DE2} express a local and a joint iteration, respectively. A scheduling scheme prescribes decoder access to the joint check nodes in only part of the iterations, and thus replaces \eqref{eq:2D-DE2} with \begin{align}\label{eq:schedule} y_l = \left\{ \begin{array}{ll} g\left(\epsilon,x_{l-1},y_{l-1}\right) & l \in A \\ y_{l-1} & l \notin A \end{array} \right. \end{align} for some $A \subseteq \mathbb{N}$ representing the iteration numbers where joint checks are accessed; in this case we have \begin{align*} N_{JI}=\left| A \right|. \end{align*} Note that when the check-node update is skipped in the joint side there is no need to access the variable nodes outside the sub-block. Since Lemma~\ref{lemma:mono of DE} still holds when \eqref{eq:2D-DE2} is replaced with \eqref{eq:schedule}, the limits $\lim\limits_{l \to \infty}x_l$ and $\lim\limits_{l \to \infty}y_l$ exist for every scheduling scheme. Given local and joint degree-distributions, a scheduling scheme is called valid if for every $\epsilon< \epsilon_G=\epsilon^*_G(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$, $\lim\limits_{l \to \infty}x_l(\epsilon)=0$ (successful decoding). Our goal is to find an optimal scheduling scheme: a valid scheduling scheme that minimizes $N_{JI}$. For example, if $A=\emptyset$ (no joint updates), then $N_{JI}=0$ but $\lim\limits_{l \to \infty}x_l(\epsilon)>0$ if $\epsilon \in (\epsilon_L, \epsilon_G)$; thus, the scheduling scheme is not valid. If, on the other hand, $A=\mathbb{N}$ (joint checks are accessed in every iteration), then the scheduling scheme is valid, but $N_{JI}$ equals the total number of iterations, which is the worst case. We do not require the scheduling scheme to be pre-determined, and it can use ``on-line" information about the decoding process, for example, the current fraction of erasure messages or the change in this fraction between two consecutive iterations. In what follows, we present an optimal scheduling scheme that minimizes $N_{JI}$ while assuring that $\lim\limits_{l \to \infty}x_l=0$. \begin{definition} \label{def:eff epsilon} Let $(\Lambda_J,\rho_J)$ be joint degree-distribution polynomials, let $\epsilon\in (0,1)$ be the erasure probability of a $BEC$, and let $y \in [0,1]$ be an instantaneous erasure probability from the joint perspective. We define the effective erasure probability from the local perspective as \begin{align} \label{eq:eff loc eps} \epsilon_{loc}(y) = \epsilon \cdot \Lambda_J\left(1-\rho_J(1-y)\right). \end{align} \end{definition} In view of \eqref{eq:f} and \eqref{eq:eff loc eps}, we have \begin{align} \label{eq:f with eff} x_l = f(\epsilon,x_{l-1},y_{l-1})=\epsilon_{loc}(y_{l-1}) \lambda_L(1-&\rho_L(1-x_{l-1})). \end{align} $\epsilon_{loc}(y_{l-1}) $ takes the role of $\epsilon$ when the local code is viewed as a standard LDPC code, hence the term "effective erasure probability from the local perspective". Our scheduling scheme is parametrized by $\eta>0$, and is given by \begin{align}\label{eq:opt schedule} \begin{split} &x_l=f(\epsilon,x_{l-1},y_{l-1}) \\ &y_l = \left\{ \begin{array}{ll} g\left(\epsilon,x_{l-1},y_{l-1}\right) & \left| x_{l-2}-x_{l-1}\right|\leq \eta \text{ and } \epsilon_{loc}(y_{l-1})\geq \epsilon_L \\ y_{l-1} & \text{else} \end{array} \right. . \end{split} \end{align} \begin{lemma} \label{lemma:valid opt schedule} For every $\eta>0$, the scheduling scheme described in \eqref{eq:opt schedule} is valid. \end{lemma} \begin{proof} See Appendix~\ref{App:valid opt schedule}. \end{proof} Note that if $\eta=0$, the scheduling scheme described in \eqref{eq:opt schedule} is not valid. However, since local iterations have zero cost in our model, we can assume that we can apply arbitrarily many local iterations to get arbitrarily close to $\eta=0$. Simulations show that $\eta=10^{-4}$ suffices for achieving minimal $N_{JI}$. Thus, for the following analysis we will assume that $\eta=0$, and that the scheduling scheme is still valid. In this scheduling scheme, the decoder tries to decode the sub-block on the local graph until it gets ``stuck", which refers to not being able to reduce the erasure probability while still strictly greater than zero. This happens first when $x_{l_1}=x_s(\epsilon)$, for some iteration $l_1$, where $x_s(\epsilon)$ is given in Definition~\ref{def:h_eps}. So, in the first joint update we have \begin{align*} \begin{split} x_{l_1} &= x_s(\epsilon) ,\quad y_{l_1} =1 \\ x_{l_1+1} &= x_s(\epsilon) ,\quad y_{l_1+1} =g(\epsilon,x_s(\epsilon),1). \end{split} \end{align*} In view of \eqref{eq:f with eff}, the local graph now "sees" $\epsilon_2 \triangleq \epsilon_{loc}(y_{l_1+1})<\epsilon$ as an effective erasure probability, and it will proceed the decoding algorithm locally. It may get ``stuck" again and another joint update will be invoked; this procedure continues until $\epsilon_{loc}(y_{l_p+1}) < \epsilon_L$ in the $p$'th (and last) update, which enables successful local decoding (i.e., $N_{JI}=p$). In general, let $\{l_k\}_{k=1}^{N_{JI}}$ be the joint update iterations of the scheduling scheme described above and let $\epsilon_k$ be the effective erasure probability from the local perspective between joint updates $i-1$ and $i$. Then, \begin{subequations} \begin{align} \label{eq:y_1} &y_{l_1}=1,\;\epsilon_1=\epsilon,\;x_{l_1}=x_s(\epsilon), \\ \label{eq:y_l_k} &y_{l_k}=g(\epsilon,x_{l_{k-1}},y_{l_{k-1}}),\quad 2\leq k \leq N_{JI}, \\ \label{eq:eps_k} &\epsilon_k=\epsilon_{loc}(y_{l_k}),\quad 2\leq k \leq N_{JI}, \\ \label{eq:x_l_k} &x_{l_k}=x_s(\epsilon_k),\quad 2\leq k \leq N_{JI}, \end{align} \end{subequations} where \begin{align} \label{eq:eps_k mono} \begin{split} \epsilon=\epsilon_1 > \epsilon_2 > \ldots > \epsilon_{N_{JI}-1} \geq \epsilon_L > \epsilon_{N_{JI}}. \end{split} \end{align} Note that \eqref{eq:y_l_k} holds for every scheduling scheme, but \eqref{eq:x_l_k} holds only for the suggested scheduling scheme; in view of Definition~\ref{def:h_eps}~Item~\ref{def:x_s}, for any other scheme \begin{align} \label{eq:x_k diff} x_{l_k}\geq x_s(\epsilon_k),\quad 1\leq k \leq N_{JI}. \end{align} \begin{lemma} \label{lemma:opt schedule} The scheduling scheme in \eqref{eq:y_1}-\eqref{eq:x_l_k} is optimal. \end{lemma} \begin{proof} See Appendix~\ref{App:opt schedule}. \end{proof} We assume from now on that the decoder applies the optimal scheduling scheme in \eqref{eq:y_1}-\eqref{eq:x_l_k}. \subsection{The Rate vs. $N_{JI}$ Trade-Off} As shown in Section~\ref{sub:c.a. seq}, for every $0<\epsilon_L<\epsilon<1$, there exist capacity-achieving LDPCL sequences for the $BEC(\epsilon)$ with a local decoding threshold of $\epsilon_L$. Moreover, Theorem~\ref{th:C1} and Lemma~\ref{lemma:gap2cap} provide a construction of such a sequence. However, the closer an LDPCL ensemble is to capacity, the higher the $N_{JI}$ is; therefore, to decrease $N_{JI}$ we have to pay with rate, and there are several ways to do so. In this section we study how the parameters of the local and joint degree-distributions, $\lambda_L,\rho_L,\lambda_J,\rho_J,P_0$, affect $N_{JI}$. In particular, we focus on how the local and joint additive gaps to capacity $\delta_L$ and $\delta_J$, receptively, affect $N_{JI}$. It is well known that if $\left\{ \lambda^{(k)},\rho^{(k)}\right\}^{\infty}_{k=1}$ is a (ordinary) capacity-achieving sequence for the $BEC(\epsilon)$, then \begin{align}\label{eq:c.a. known} \lim_{k \to \infty} \epsilon\lambda^{(k)}(1-\rho^{(k)}(1-x))=x,\quad x \in [0,\epsilon]. \end{align} This leads to the following lemma. \begin{lemma} \label{lemma:x_s c.a.} Let $0<\epsilon_L<\epsilon<1$, and let $\left\{ \lambda_L^{(k)},\rho_L^{(k)}\right\}^{\infty}_{k=1}$ be a capacity-achieving sequence for the $BEC(\epsilon_L)$. Then, \begin{align*} x_s(\epsilon)\triangleq\lim_{k \to \infty}x^{(k)}_s(\epsilon)=\epsilon, \end{align*} where $x^{(k)}_s(\epsilon)$ corresponds to Definition~\ref{def:h_eps} with $\left(\lambda_L^{(k)},\rho_L^{(k)}\right)$. \end{lemma} \begin{proof} See Appendix~\ref{App:x_s c.a.}. \end{proof} Lemma~\ref{lemma:x_s c.a.} asserts that if the \emph{local} degree-distribution polynomials imply a local threshold $\epsilon_L$ and a design rate that is very close to capacity ($1-\epsilon_L$), and the channel erasure probability is $\epsilon>\epsilon_L$, then the BP decoding algorithm on the local graph gets ``stuck" immediately after solving only a small fraction of the erasures. This leads, in view of \eqref{eq:y_l_k}, to a small change in the erasure-message probability on the joint update, which in turn yields a minor progress on the local side. Therefore, choosing close to capacity \emph{local} degree-distribution polynomials implies high $N_{JI}$. Another consequence of \eqref{eq:c.a. known} is that the change in the erasure-message probability in one iteration of the BP decoding algorithm is small. Thus, close to capacity \emph{joint} degree-distribution polynomials yield high $N_{JI}$, regardless of the \emph{local} degree-distribution polynomials. \begin{example} \label{ex:N_JI} Let $\epsilon_L=0.05$ and $\epsilon_G=0.2$. We use the capacity-achieving LDPCL sequence for the $BEC(\epsilon_G)$ with a local decoding threshold of $\epsilon_L$ given in Example~\ref{ex:c.a.} A computer program simulated \eqref{eq:y_1}-\eqref{eq:x_l_k} with \eqref{eq:Tornado} for different values of $D_L$ and $D_J$, and the results are presented in Figure~\ref{Fig:EL05P1EG2}. The plot exemplifies the trade-off between rate and $N_{JI}$: when the ensemble is close to capacity with $\delta_L=10^{-2},\delta_J=2.5\cdot10^{-4}$ ($R=0.79$), we get $N_{JI}=570$, and to reduce $N_{JI}$ we have to pay with rate. However, there are several ways to do so. For example, changing in the above the local gap to $\delta_L=5\cdot10^{-2}$ while the joint gap stays $\delta_J=2.5\cdot10^{-4}$ yields $R=0.75$ and $N_{JI}=26$, and changing the local and joint gap to $\delta_L=2.5\cdot10^{-2}$ and $\delta_J=4\cdot10^{-2}$, respectively, yields the same $R=0.75$ but a smaller $N_{JI}=11$. \begin{figure}[h!] \begin{center} \includegraphics[scale=0.4]{EL05P1EG2_BW} \caption{\label{Fig:EL05P1EG2} Plot of $N_{JI}$ ($\circ$ marks) and the design rate ($+$ marks) as a function of the joint additive gap to capacity $\delta_J$ for different value of the local additive gap to capacity $\delta_L$.} \end{center} \end{figure} \end{example} \section{Finite-Length Analysis For ML Decoding} \label{Sec:Finite} In this section, we extend to LDPCL codes the finite block-length analysis of \cite[Lemma~B.2]{Di02}. We derive upper bounds on the expected block erasure probability under ML decoding of regular LDPCL ensembles (see Section~\ref{sub:Regular}). As shown in \cite{Di02}, the union bound is fairly tight for not too small block lengths, and the performance loss of iterative decoding compared to ML decoding is not too high. This motivates a bounding approach that simplifies the expressions by employing the union bound and the ML decoding analysis For a two-sided Tanner graph $\mathcal{G}$ picked from the $\left(M,n,l_L,r_L,l_J,r_J\right)$-regular ensemble, let $\mathbb{P}_B^{ML}\left(\mathcal{G},\epsilon\right)$ designate the expected block decoding failure probability of the code $\mathcal{G}$ over the $BEC(\epsilon)$ when decoded by the ML decoder. In what follows, for a power series $f(x)=\sum_if_ix^i$, let $\mathrm{coef}\left( f(x),x^i\right)$ designate the $i$-th coefficient of $f(x)$, i.e., $\mathrm{coef}\left( f(x),x^i\right)=f_i$. \begin{definition} For every $l,r,n,w \in \mathbb{N}$ such that $n\tfrac{l}{r}\in \mathbb{N}$, $l,r,n \geq 1$ and $w \leq n$, let \begin{align}\label{eq:A(l,r,n,w)} A(l,r,n,w)=\frac{\mathrm{coef}\left( \left( \frac{\left(1+x \right)^r+\left(1-x \right)^r}{2} \right)^{n\tfrac{l}{r}},x^{wl} \right)}{\binom{nl}{wl}}. \end{align} \end{definition} \begin{theorem}[Union Bound - ML Decoding of regular LDPCL Codes] ~\begin{enumerate} \item For $\epsilon \in (0,1)$, let $\bar{\epsilon}=1-\epsilon$. \item For $n\in \mathbb{N}^+$, let $[n]=\{1,2,\ldots,n\}$, and ${[n]}_0=\{0\} \cup [n]$. \item For $m \in \mathbb{N}$, let $e_1^m=\left( e_1,e_2,\ldots,e_m\right)$, where for every $i \in \{1,2,\ldots,m\}$, $e_i\in \mathbb{N}^+$, and let ${[e_1^m]}_0={[e_1]}_0 \times {[e_2]}_0\times\ldots\times {[e_m]}_0$. \end{enumerate} Then, \begin{align}\label{eq:MLUB} \begin{split} {E}\left[ \mathbb{P}_B^{ML}\left(\mathcal{G},\epsilon\right)\right] \leq &\sum_{m=1}^M \binom{M}{m}\bar{\epsilon}^{(M-m)n} \sum_{e_1^m \in {[n]}^m} \prod_{i=1}^m \binom{n}{e_i} \epsilon^{e_i} \bar{\epsilon}^{(n-e_i)} \\ & \hspace*{0.2cm} \cdot\min\left\{ 1,-1+\sum_{w_1^m \in {[e_1^m]}_0 } A(l_J,r_J,Mn,w_1+w_2+\ldots+w_m)\prod_{i=1}^m A(l_L,r_L,n,w_i) \right\} \end{split} \end{align} where the expectation is w.r.t. the $\left(M,n,l_L,r_L,l_J,r_J\right)$-regular ensemble. \end{theorem} \begin{proof} Let $\mathcal{E} \subseteq \{1,2,\ldots,Mn\}$ be an erasure pattern specifying the indices of the erased code bits, and for every $i \in \{1,2,\ldots,M\}$, let $\mathcal{E}_i=\mathcal{E} \cap \{ 1+(i-1)n,2+(i-1)n,\ldots,n+(i-1)n\}$ be the erasure pattern in the $i$-th sub-block. Consider the case that there are erasures only in the first $m$ sub-blocks, i.e., \begin{align} \label{eq:E_i>0} \begin{split} &|\mathcal{E}_i| >0 , \quad 1\leq i \leq m \\ &| \mathcal{E}_i| =0 , \quad l< m \leq M. \end{split} \end{align} It is well known that the ML decoder fails if and only if $\mathrm{rank}\left( H_{\mathcal{E}}\right) < |\mathcal{E}|$, where $H$ is the parity-check matrix corresponding to a random member of the $(l_L,r_L,l_J,r_J)$-regular LDPCL ensemble, and $H_\mathcal{E}$ is the sub-matrix comprised from the columns of $H$ indexed by $\mathcal{E}$. In view of \eqref{Loc PC Matrix 1}, since the sub-matrices $\{H_i\}_{i=0}^M$ are picked independent of each other, then applying the union bound yields \begin{subequations} \begin{align} \label{eq:UB1} \Pr\left\{ \mathrm{rank}\left( H_{\mathcal{E}}\right) < |\mathcal{E}| \right\} &= \Pr\left\{ \exists x \in \mathbb{F}_2^{|\mathcal{E}|}\setminus \{0\},H_{\mathcal{E}}x^T=0\right\} \\ \label{eq:UB2} &\leq \sum_{x \in \mathbb{F}_2^{|\mathcal{E}|}\setminus \{0\}}\Pr\left\{ H_{\mathcal{E}}x^T=0 \right\} \\ \label{eq:UB3} &= -1+\sum_{x \in \mathbb{F}_2^{|\mathcal{E}|}}\Pr\left\{ H_{\mathcal{E}}x^T=0 \right\} \\ \begin{split}\label{eq:UB4} &= -1+\sum_{x_1 \in \mathbb{F}_2^{|\mathcal{E}_1|}}\ldots\sum_{x_m \in \mathbb{F}_2^{|\mathcal{E}_m|}}\Pr\left\{ {H_0}_{\mathcal{E}}(x_1,\ldots,x_l)^T=0 \right\} \\ & \hspace*{4.5cm}\cdot\prod_{i=1}^m\Pr\left\{ {H_i}_{\mathcal{E}_i}x_i^T=0 \right\} \end{split} \end{align} \end{subequations} The steps until getting to \eqref{eq:UB3} are the standard ones from \cite{Di02}, while \eqref{eq:UB4} follows from the sub-block structure introduced in LDPCL codes. By marking $w_i=w(x_i)$ for every $i\in \{1,2,\ldots,m\}$, as the Hamming weight of the sub-word $x_i\in \mathbb{F}_2^{|\mathcal{E}_i|}$ we get (see \cite[Lemma B.2.]{Di02}) \begin{align} \label{eq:using A} \begin{split} &\Pr\left\{ {H_0}_{\mathcal{E}}(x_1,x_2,\ldots,x_l)^T=0 \right\} = A(l_J,r_J,Mn,w_i+w_2+\ldots +w_l). \\ &\Pr\left\{ {H_i}_{\mathcal{E}_i}x_i^T=0 \right\} = A(l_L,r_L,n,w_i). \end{split} \end{align} Combining \eqref{eq:UB4} and \eqref{eq:using A} implies that if \eqref{eq:E_i>0} holds, then \begin{align} \label{eq:UB+A} \begin{split} \Pr&\left\{ \mathrm{rank}\left( H_{\mathcal{E}}\right) < |\mathcal{E}| \right\} \leq \\ &-1+\sum_{w_1 =0}^{|\mathcal{E}_1|}\sum_{w_2 =0}^{|\mathcal{E}_2|}\ldots\sum_{w_m =0}^{|\mathcal{E}_l|}A(l_J,r_J,Mn,w_i+w_2+\ldots +w_l) \prod_{i=1}^mA(l_L,r_L,n,w_i). \end{split} \end{align} Since the $BEC$ is memoryless, then \begin{align}\label{eq:prob EPS} \Pr\left\{ \mathcal{E}\right\}=\bar{\epsilon}^{(M-m)n} \prod_{i=1}^m \epsilon^{|\mathcal{E}_i|} \bar{\epsilon}^{( n-|\mathcal{E}_i|)}. \end{align} From symmetry, \eqref{eq:UB+A} holds for every error pattern $\mathcal{E}$ that lies in exactly $m$ sub-blocks (i.e., not only the first $m$ sub-blocks). Finally, summing over $m \in \{1,2,\ldots,M\}$ and counting every error pattern imply \begin{align} \label{fin proof} \begin{split} {E}\left[ \mathbb{P}_B^{ML}\left(\mathcal{G},\epsilon\right)\right] &=\sum_\mathcal{E}\Pr\left\{\mathcal{E}\right\}\Pr\left\{ \mathrm{rank}\left( H_{\mathcal{E}}\right) < |\mathcal{E}| \right\} \\ &\leq\sum_{m=1}^M \binom{M}{m}\bar{\epsilon}^{(M-m)n} \sum_{e_1^m \in {[n]}^m} \prod_{i=1}^m \binom{n}{e_i} \epsilon^{e_i} \bar{\epsilon}^{(n-e_i)} \\ & \hspace*{0.2cm} \cdot\min\left\{ 1,-1+\sum_{w_1^m \in {[e_1^m]}_0 } A(l_J,r_J,Mn,w_1+w_2+\ldots+w_l)\prod_{i=1}^m A(l_l,r_L,n,w_i) \right\}. \end{split} \end{align} \end{proof} Figure~\ref{Fig:n120} plots the upper bound in \eqref{eq:MLUB} for the $(2,6,1,6)$-regular LDPCL ensemble, with locality $M=2,3$ and sub-block length $n=180,120$, respectively. Also shown is the upper bound in \cite[Lemma B.2]{Di02} for the standard $(3,6)$-regular LDPC ensemble. The ensembles in Figure~\ref{Fig:n120} have the same total block length of $360$ (in view of Corollary~\ref{claim:2D to 1D}, the iterative decoding performance of the $(2,6,1,6)$-regular LDPCL ensemble and the $(3,6)$-regular LDPC ensemble coincide as $n \to \infty$). Figure~\ref{Fig:n120} exemplifies the trade-off between the sub-block local-access capability ($M$) and the error correcting capability over the global block; for every $\epsilon \in [0.05,0.5]$ the block decoding failure probability increases as $M$ increases. While Figure~\ref{Fig:n120} is just an example with not very realistic parameters\footnote{Due to the combinatorial nature of the expression in (59), it is computationally difficult to evaluate the bounds for longer codes.}, we expect the same trade-off to apply in more generality: finer sub-block access with efficient local decoding has a cost in terms of the global-decoding performance (for the same rate and global code length). \begin{figure}[h!] \begin{center} \includegraphics[scale=0.27]{n120} \caption{\label{Fig:n120} Comparison of the bound in \eqref{eq:MLUB} ((2,6,1,6)-LDPCL code) with $M=2,3$ and $n=180,120$, respectively, and in \cite[Lemma B.2]{Di02} ((3,6)-LDPC code) with $n=360$.} \end{center} \end{figure} \section{Summary} \label{Sec:sum} This paper lays out the theoretical foundation for multi-block LDPC codes. This coding scheme enables fast read access to small blocks, and provides high data-protection on large blocks in case of more severe error events. The decoding algorithm suggested is the belief-propagation algorithm ,and by analyzing the asymptotic (as the sub-block length $n$ tends to infinity) performance of this decoding algorithm on LDPCL codes, we provided a simple way to construct capacity-achieving sequences that enjoy a locality property (Theorem~\ref{th:C1} and Lemma~\ref{lemma:gap2cap}). We found that the fraction of jointly-unconnected variable nodes, $P_0$, plays an important role in determining the asymptotic decoding threshold and in achieving capacity. It is known \cite{Shok99} that there is an inherent trade-off between the gap to capacity and the encoding and decoding complexity of irregular LDPC codes over the $BEC$. Since it is of interest that the decoding algorithm will avoid joint updates as much as possible, we studied another trade-off regarding the number of joint iterations and the gap to capacity (see Example~\ref{ex:N_JI}). By deriving an upper bound on the block-erasure probability of finite-length LDPCL codes under ML decoding, we showed how the loss in performance is affected by the locality structure. Future work cis needed toward generalizing the results of this paper to other codes defined on graphs, such as Repeat-Accumulate (RA) \cite{Divs98,Jin00} codes or Accumulate-Repeat-Accumulate (ARA) codes \cite{PfitSason07}, which achieve capacity on the $BEC$ with bounded complexity per information bit. Future studies can also be on considering memoryless binary-input output-symmetric (MBIOS) channels other than the $BEC$. \appendices \section{Proof of Lemma~\ref{lemma:fix pt}} \label{App:fix pt} \begin{enumerate} \item Assume that $x=0$. Since $\Lambda_L(0)=0$, \eqref{eq:g} implies that $y=g(\epsilon,0,y)=0$. Moreover, if $y=0$ and $P_0=0$, then \eqref{eq:f} yields $x=f(\epsilon,x,0)=0$. Finally, if $y=0$ and $\lambda_J(0)>0$, then \eqref{eq:g} implies that $0=\Lambda_L(1-\rho_L(1-x))$, hence $\rho_L(1-x)=1$ and $x=0$. \item Follows immediately from \eqref{eq:f}, \eqref{eq:g} and \eqref{eq:f,g fixed}. \item We prove \eqref{eq:no jumps} by a mathematical induction. For $l=0$, \eqref{eq:no jumps} holds due to Item~\ref{item: fix pt lemma1} and the fact that $x_{0} =y_{0}=\epsilon $. Assume correctness of \eqref{eq:no jumps} for some $l \geq 0$ and consider iteration $l+1$. In view of Lemma~\ref{lemma:monotonicity}, eq.~\eqref{eq:2D DE with f,g} and the induction assumption, it follows that \begin{align} \label{eq:proof fix pt lemma} \begin{split} x_{l+1} = f \left(\epsilon,x_{l},y_{l}\right) \geq f(\epsilon,x,y)= x , \\ y_{l+1} = g\left(\epsilon,x_{l},y_{l}\right) \geq g(\epsilon,x,y)= y. \end{split} \end{align} This prove correctness of \eqref{eq:no jumps} for $l+1$ and by mathematical induction proves \eqref{eq:no jumps} for all $l \geq 0$. \end{enumerate} \section{Proof of Lemma~\ref{lemma:q_L(0)}} \label{App:q_L(0)} Let $I=\min \{i \colon \Lambda_{L,i}>0\}$. Since $\Lambda_L(0)=0$, then $I \geq 1$. The connection between $\lambda_L(\cdot)$ and $\Lambda_L(\cdot)$ in \eqref{eq:node-edge} yields \begin{align} \lim\limits_{u \to 0}\frac{\Lambda_L(u)}{\lambda_L(u)} &=\lim\limits_{u \to 0}\frac{\Lambda_L(u)}{\Lambda_L'(u)}\cdot\Lambda'(1)\notag\\ &=\Lambda'(1)\lim\limits_{u \to 0}\frac{\sum_{i\geq I}\Lambda_{L,i} u^i}{\sum_{i\geq I}i\Lambda_{L,i} u^{i-1}} \notag\\ &=\Lambda'(1)\lim\limits_{u \to 0}\frac{u^I\sum_{i\geq I}\Lambda_{L,i} u^{i-I}}{u^{I-1}\sum_{i\geq I}i\Lambda_{L,i} u^{i-I}} \notag\\ &=\Lambda'(1)\frac{\Lambda_{L,I} }{I\Lambda_{L,I} }\lim\limits_{u \to 0}u \notag\\ &=0. \end{align} Further, let $u(x)=1-\rho_L(1-x)$ and note that $\lim_{x\to 0} u(x)=0$. Thus, \begin{align*} \lim_{x \to 0} x \cdot \frac{\Lambda_L\left( 1- \rho_L\left(1-x \right)\right)}{\lambda_L\left( 1- \rho_L\left(1-x \right) \right)} =\lim_{x \to 0}x \cdot \lim_{x \to 0}\frac{\Lambda_L(u(x))}{\lambda_L(u(x))}=\lim_{x \to 0}x \cdot \lim_{u \to 0}\frac{\Lambda_L(u)}{\lambda_L(u)} = 0. \end{align*} \section{Proof of Lemma~\ref{lemma: fixed curve}} \label{App:fixed curve} Let $\epsilon \in (0,1)$ and let $(x,y)$ be a solution to \eqref{eq:f,g fixed} with $y>0$. In view of \eqref{eq:f} and \eqref{eq:g}, dividing the first equation of \eqref{eq:f,g fixed} with the second one yields \begin{align}\label{eq:divide f,g fixed} \frac{x}{y} = \frac{\lambda_L\left(1- \rho_L\left(1-x \right)\right) \cdot \Lambda_J\left(1- \rho_J\left(1-y\right)\right)}{\lambda_J\left(1- \rho_J\left(1-y \right)\right) \cdot \Lambda_L\left(1- \rho_L\left(1-x\right)\right)} \end{align} which after some rearrangements implies \begin{align}\label{eq:q_L(x)=q_J(y)} q_J(y)=q_L(x), \end{align}\ where $q_J(\cdot)$ and $q_L(\cdot)$ are defined in \eqref{eq:q_L q_J}. In view of \eqref{eq:q_L q_J}, since $(x,y)$ is an $(f,g)$-fixed point, then \begin{align}\label{eq:q_J leq 1} q_J(y)&=y\cdot \frac{\Lambda_J\left( 1- \rho_J\left(1-y \right)\right)}{\lambda_J\left( 1- \rho_J\left(1-y \right)\right)} \notag \\ &=g(\epsilon,x,y)\cdot \frac{\Lambda_J\left( 1- \rho_J\left(1-y \right)\right)}{\lambda_J\left( 1- \rho_J\left(1-y \right)\right)} \notag \\ &=\overbrace{\epsilon}^{\leq 1}\cdot \overbrace{\Lambda_J\left( 1- \rho_J\left(1-y \right)\right)}^{\leq 1} \cdot \overbrace{\Lambda_L\left( 1- \rho_L\left(1-x \right)\right)}^{\leq 1}\notag \\ &\leq 1, \end{align} which together with Definition~\ref{def:q} and \eqref{eq:q_L(x)=q_J(y)} completes the proof. \section{Proof of Theorem~\ref{th:numerical th}} \label{App:numerical th} Let \begin{align} \label{eq:converse 01} \epsilon > \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)}. \end{align} There exists $y_0 \in (0,1]$ such that $q_J(y_0) \leq 1$ and \begin{align}\label{eq:y_0} y_0=\epsilon\cdot g(1,q(y_0),y_0)= \epsilon \cdot \lambda_J(1-\rho_J(1-y_0))\cdot\Lambda_L(1-\rho_L(1-q(y_0))). \end{align} In view of \eqref{eq:q def}, \begin{align} q_L(q(y_0))=q_J(y_0), \end{align} which combined with \eqref{eq:f} and \eqref{eq:q_L q_J} yields \begin{align} \label{eq:using q} q(y_0) &= \frac{\lambda_L(1-\rho_L(1-q(y_0)))}{\Lambda_L(1-\rho_L(1-q(y_0)))} \cdot y_0 \cdot \frac{\Lambda_J(1-\rho_J(1-y_0))}{\lambda_J(1-\rho_J(1-y_0))} \notag \\ &=\epsilon \cdot \lambda_L(1-\rho_L(1-q(y_0)))\cdot \Lambda_J(1-\rho_J(1-y_0)) \notag \\ &= f(\epsilon,q(y_0),y_0). \end{align} Thus, $(q(y_0),y_0)$ is a non zero $(f,g)$-fixed point, which in view of Theorem~\ref{theorem:fix pt char} implies that $\epsilon > \epsilon^*_G$. Hence, \begin{align} \label{eq:th 1st part} \epsilon^*_G \leq \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)}. \end{align} Next, let \begin{align} \label{eq:direct} \epsilon < \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} \end{align} and let $(x,y)$ be a solution to \eqref{eq:f,g fixed}. In what follows, we prove that $y=0$. Assume to the contrary that $y>0$. From Lemma~\ref{lemma: fixed curve} it follows that $x \leq q(y)$, which in view Lemma~\ref{lemma:monotonicity}, \eqref{eq:q_J leq 1} and \eqref{eq:direct} implies \begin{align}\label{eq:numerical proof1} y=g(\epsilon,x,y)\leq g(\epsilon,q(y),y) < y, \end{align} in contradiction; thus, $y=0$. Next, consider two cases: \begin{enumerate} \item If $P_0=0$ or $\lambda_J(0) >0$, then Item~\ref{item: fix pt lemma0} of Lemma~\ref{lemma:fix pt} implies that $x=0$. Hence, every $(f,g)$-fixed point satisfies $y=x=0$. In view of Theorem~\ref{theorem:fix pt char}, it follows that if \eqref{eq:direct} holds, then $\epsilon < \epsilon^*_G$, so \begin{align} \epsilon^*_G \geq \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} \end{align} which with \eqref{eq:th 1st part} completes the proof when $P_0=0$ or $\lambda_J(0) >0$. \item If $P_0>0$ and $\lambda_J(0) =0$, it is not true in general that for every fixed point $(x,y)$, $y=0$ implies $x=0$. However, if in addition to \eqref{eq:direct}, \begin{align} \label{eq:direct2} \epsilon < \frac1{P_0}\cdot \inf_{(0,1]}\frac{x}{\lambda_L\left(1- \rho_L\left(1-x \right)\right)}, \end{align} and $y=0$ for some fixed point $(x,y)$, then $x=0$. To see this, assume to the contrary that $x>0$. In view of \eqref{eq:f} and \eqref{eq:direct2} it follows that \begin{align} \label{eq:x fixed} x= f(\epsilon,x,0) = \epsilon \cdot P_0 \cdot \lambda_L\left(1- \rho_L\left(1-x \right)\right) < x \end{align} in contradiction; hence, if \eqref{eq:direct} and \eqref{eq:direct2} hold, $x=0$ thus $\epsilon < \epsilon^*_G$. This means that \begin{align}\label{eq:direct proof} \epsilon^*_G \geq \min\left\{ \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \tfrac{y}{g(1,q(y),y)},\;\;\tfrac1{P_0}\cdot \inf_{(0,1]}\tfrac{x}{\lambda_L\left(1- \rho_L\left(1-x \right)\right)}\right\}. \end{align} To complete the proof, we must show that when $P_0>0$ and $\lambda_J(0) =0$, then \begin{align}\label{eq:converse proof} \epsilon^*_G \leq \min\left\{ \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \tfrac{y}{g(1,q(y),y)},\;\;\tfrac1{P_0}\cdot \inf_{(0,1]}\tfrac{x}{\lambda_L\left(1- \rho_L\left(1-x \right)\right)}\right\}. \end{align} If \begin{align*} \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} \leq \frac1{P_0}\inf_{(0,1]}\frac{y}{\lambda_L\left(1- \rho_L\left(1-y \right)\right)}, \end{align*} then \eqref{eq:converse proof} follows immediately from \eqref{eq:th 1st part}; hence we can assume that \begin{align} \label{eq:converse1} \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} > \frac1{P_0}\inf_{(0,1]}\frac{y}{\lambda_L\left(1- \rho_L\left(1-y \right)\right)}. \end{align} Let \begin{align} \label{eq:converse12} \inf\limits_{\substack{y \in (0,1] \\ q_J(y)\leq 1}} \frac{y}{g(1,q(y),y)} >\epsilon> \frac1{P_0}\inf_{(0,1]}\frac{y}{\lambda_L\left(1- \rho_L\left(1-y \right)\right)}, \end{align} and let $x_0 \in (0,1]$, such that $x_0=\epsilon \cdot P_0 \cdot \lambda_L\left(1- \rho_L\left(1-x_0 \right)\right)$. Since $\lambda_J(0)=0$, it follows that $(x_0,0)$ is a fixed point with $x_0>0$, thus $\epsilon > \epsilon^*_G$. Since this is true for every $\epsilon> \tfrac1{P_0}\inf_{(0,1]}\frac{y}{\lambda_L\left(1- \rho_L\left(1-y \right)\right)}$, then $\epsilon^*_G \leq \tfrac1{P_0}\inf_{(0,1]}\frac{y}{\lambda_L\left(1- \rho_L\left(1-y \right)\right)}$. In view of \eqref{eq:converse1}, it follows that \eqref{eq:converse proof} holds. This completes the proof for the $P_0>0$ and $\lambda_J(0) =0$ case. \end{enumerate} \section{Proof of Lemma~\ref{lemma:th low loc}} \label{App:low loc} In view of \eqref{eq:1D th numeric}, \begin{align*} \epsilon_L &=\inf_{(0,1]} \frac{x}{\lambda_L(1-\rho_L(1-x))} \notag \\ &=\inf_{(0,1]} \frac{x}{1-\sum_{i=2}^4\rho_i(1-x)^{i-1}} . \end{align*} Since $\rho_2=1-\rho_3-\rho_4$, we get \begin{align*} \epsilon_L &=\inf_{(0,1]} \frac{x}{(1+\rho_3+2\rho_4)x-(\rho_3+3\rho_4)x^2+\rho_4x^3} \notag \\ &= \frac{1}{\sup_{(0,1]}\,[(1+\rho_3+2\rho_4)-(\rho_3+3\rho_4)x+\rho_4x^2]}\notag \\ &= \frac{1}{1+\rho_3+2\rho_4}. \end{align*} In view of Definition~\ref{def:h_eps}, we have \begin{align} \label{eq:h_eps low loc} h_\epsilon(x) &=\epsilon \left[ (1+\rho_3+2\rho_4)x-(\rho_3+3\rho_4)x^2+\rho_4x^3\right]-x \notag \\ &=x\left( \epsilon \left[ (1+\rho_3+2\rho_4)-(\rho_3+3\rho_4)x+\rho_4x^2\right]-1\right), \end{align} thus $x_s(\epsilon)$ is a root of $\rho_4x^2-(\rho_3+3\rho_4)x+(1+\rho_3+2\rho_4)-\tfrac1\epsilon$ in $(0,1)$. If $\rho_4=0$, then \eqref{eq:th low loc} implies $\rho_3=\tfrac1{\epsilon_L}-1 > \tfrac1{\epsilon}-1$, so the solution given by \eqref{eq:x_s rho4=0} is in $(0,1)$. If $\rho_4>0$, then the quadratic formula implies \begin{align} \label{eq:quad formula} x_s(\epsilon)=\tfrac{\rho_3+3\rho_4\pm\sqrt{\left( \rho_3+\rho_4\right)^2+4\rho_4\left(\tfrac1\epsilon-1 \right)}}{2\rho_4}. \end{align} Note that $`+`$ option violates the constraint $x_s(\epsilon)\leq 1$. Moreover, since $\epsilon>\epsilon_L=\tfrac1{1+\rho_3+2\rho_4}$, then $\sqrt{\left( \rho_3+\rho_4\right)^2+4\rho_4\left(\tfrac1\epsilon-1 \right)} \leq \sqrt{\rho_3^2+6\rho_3\rho_4+9\rho_4^2}=\rho_3+3\rho_4$; hence $x_s(\epsilon)$ as given in \eqref{eq:x_s rho4>0} is strictly positive. Furthermore, we have $\sqrt{\left( \rho_3+\rho_4\right)^2+4\rho_4\left(\tfrac1\epsilon-1 \right)} \geq \rho_3+\rho_4$, so $x_s(\epsilon) \leq 1$. Finally, since $\lambda_L(x)=x$, then by definition $\tfrac{x_s(\epsilon)}{\epsilon} = 1-\rho_L(1-x_s(\epsilon))$, which yields $a_s(\epsilon)=\left(\tfrac{x_s(\epsilon)}{\epsilon}\right)^2$, and completes the proof. \section{Proof of Lemma~\ref{lemma:valid opt schedule}} \label{App:valid opt schedule} To prove Lemma~\ref{lemma:valid opt schedule} we need the following lemma. \begin{lemma}\label{lemma:valid schedule} A scheduling scheme is valid if and only if, $\epsilon_{loc}(y_l)<\epsilon_L$, for some iteration $l$. \end{lemma} \begin{proof} Recall the definition of the local threshold, \begin{align} \label{eq:loc th def} \epsilon_L = \sup \{ \epsilon \colon x=\epsilon\lambda_L(1-\rho_L(1-x)) \text{ has no solution in } (0,1]\}, \end{align} and let $x=\lim\limits_{l \to \infty}x_l$ and $y=\lim\limits_{l \to \infty}y_l$. Since under every scheduling scheme $y_l$ is monotonically non-increasing in $l$, then in view of \eqref{eq:f with eff}, \begin{align*} \exists l \in \mathbb{N}, \quad&\epsilon_{loc}(y_l)<\epsilon_L \\ &\Updownarrow \\ \epsilon_{loc}(y)& < \epsilon_L \\ &\Updownarrow \\ x=\epsilon_{loc}(y) \lambda_L(1-&\rho_L(1-x)) \text{ has no solution for }x \in (0,1] \\ &\Updownarrow \\ \lim\limits_{l \to \infty}x_l&=0. \end{align*} \end{proof} Let $(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$ be degree-distribution polynomials, and let $\epsilon\leq \epsilon^*_G(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$. Let $(x,y)=\lim\limits_{l \to \infty}(x_l,y_l)$. Assume in contradiction that $\epsilon_{loc}(y) \geq \epsilon_L$. Since $\eta>0$, letting $l \to \infty$ in \eqref{eq:opt schedule} implies that $(x,y)$ is a non-trivial $(f,g)$-fixed point. However, in view of Theorem~\ref{theorem:fix pt char}, if $\epsilon\leq \epsilon^*_G(\Lambda_L,\Lambda_J,\Omega_L,\Omega_J)$, every $(f,g)$-fixed point is the trivial point, in contradiction. Thus, $\epsilon_{loc}(y) < \epsilon_L$ which, due to Lemma~\ref{lemma:valid schedule}, completes the proof. \section{Proof of Lemma~\ref{lemma:opt schedule}} \label{App:opt schedule} Let $\left\{l^{(1)}_k\right\}_{k=1}^{N^{(1)}_{JI}}$ and $\left\{l^{(2)}_k\right\}_{k=1}^{N^{(2)}_{JI}}$ be the joint-update iterations of the scheduling scheme described in \eqref{eq:x_l_k} and in some arbitrary valid scheduling scheme, receptively. We need to show that $N_{JI}^{(1)} \leq N_{JI}^{(2)}$. To proceed we need the next lemma: \begin{lemma} \label{lemma:opt schdule y_k} \begin{align} \label{eq:opt schdule y_k} y_{l^{(1)}_k} \leq y_{l^{(2)}_k} , \quad 1 \leq k \leq \min\left(N^{(1)}_{JI},N^{(2)}_{JI} \right). \end{align} \end{lemma} \begin{proof} By induction on $1 \leq k \leq \min\left(N^{(1)}_{JI},N^{(2)}_{JI} \right)$. In the first joint update, we have $y_{l^{(1)}_1}=1=y_{l^{(2)}_1}$, so \eqref{eq:opt schdule y_k} holds for $k=1$. Assume correctness for some joint update $k<\min\left(N^{(1)}_{JI},N^{(2)}_{JI} \right)$, and consider update $k+1$. In view of Lemma~\ref{lemma:monotonicity}, \eqref{eq:y_l_k}-\eqref{eq:x_l_k}, \eqref{eq:x_k diff} and the induction assumption, \begin{align*} y_{l^{(1)}_{k+1}} &= g\left(\epsilon,x_{l^{(1)}_{k+1}},y_{l^{(1)}_{k+1}}\right) \\ &= g\left(\epsilon,x_s\left(\epsilon^{(1)}_k\right),y_{l^{(1)}_{k}}\right) \\ &\leq g\left(\epsilon,x_{l^{(2)}_{k}},y_{l^{(2)}_{k}}\right) \\ &=y_{l^{(2)}_{k+1}} , \end{align*} which by induction, completes the proof. \end{proof} Assume, on the contrary, that $N_{JI}^{(1)} > N_{JI}^{(2)}$. Let \begin{align}\label{eq:eps_k 1 and 2} \begin{split} \epsilon^{(1)}_k=\epsilon_{loc}\left(y_{l^{(1)}_k}\right),\quad 1\leq k \leq N^{(1)}_{JI}, \\ \epsilon^{(2)}_k=\epsilon_{loc}\left(y_{l^{(2)}_k}\right),\quad 1\leq k \leq N^{(2)}_{JI}.\\ \end{split} \end{align} Lemma~\ref{lemma:opt schdule y_k} implies that $y_{l^{(1)}_k} \leq y_{l^{(2)}_k} $, for every $ k \in \{1,\ldots,N^{(2)}_{JI} \}$. Hence, \begin{align} \label{eq:eps^1 < eps^2} \epsilon^{(1)}_k \leq \epsilon^{(2)}_k ,\quad \forall k \in \{1,\ldots,N^{(2)}_{JI} \}. \end{align} Since $N_{JI}^{(1)} > N_{JI}^{(2)}$, \eqref{eq:eps_k mono} and \eqref{eq:eps^1 < eps^2} imply \begin{align} \label{eq:eps^1 > eps_L} \epsilon^{(2)}_{N_{JI}^{(2)}} \geq \epsilon^{(1)}_{N_{JI}^{(2)}} \geq \epsilon^{(1)}_{N_{JI}^{(1)}-1} \geq \epsilon_L, \end{align} which, in view of Lemma~\ref{lemma:valid schedule} yields that the scheduling scheme indexed by $\left\{l^{(2)}_k\right\}_{k=1}^{N^{(2)}_{JI}}$ is not valid, in contradiction. Thus, $N_{JI}^{(1)} \leq N_{JI}^{(2)}$. \section{Proof of Lemma~\ref{lemma:x_s c.a.}} \label{App:x_s c.a.} In view of Definition~\ref{def:h_eps}, let $h^{(k)}_\epsilon(x)=\epsilon\lambda^{(k)}(1-\rho^{(k)}(1-x))-x$. Eq. \eqref{eq:c.a. known} yields \begin{align}\label{eq:c.a. h_eps} h_\epsilon(x)=\lim_{k \to \infty}h^{(k)}_\epsilon(x)= \left\{ \begin{array}{ll} \left( \frac{\epsilon}{\epsilon_L}-1\right) x & 0 \leq x \leq \epsilon_L \\ \epsilon- x & \epsilon_L \leq x \leq \epsilon \end{array} \right. \end{align} For every $k \in \mathbb{N}$, and $x\in (\epsilon,1]$, \begin{align*} h_\epsilon^{(k)}(x) &= \epsilon\lambda^{(k)}(1-\rho^{(k)}(1-x))-x \\ \notag &\leq \epsilon-x \\ \notag &<0, \end{align*} Thus \begin{align}\label{eq:x_s^k <eps} x_s^{(k)}(\epsilon) \leq \epsilon ,\quad \forall k \in \mathbb{N}. \end{align} In addition, for every $0<a<\epsilon$ there exists $K_0$ such that \begin{align*} h_\epsilon^{(k)}(\epsilon-a)>0 ,\quad \forall k \geq K_0, \end{align*} so $x_s^{(k)}(\epsilon) \geq \epsilon-a$, for every $ k \geq K_0$; hence, \begin{align} \label{eq:x_s liminf} \liminf_{k \to \infty} x_s^{(k)}(\epsilon) \geq \epsilon. \end{align} Combining \eqref{eq:x_s^k <eps} and \eqref{eq:x_s liminf} implies that $\lim\limits_{k \to \infty}x^{(k)}_s(\epsilon)$ exists, and completes the proof.
\section{Introduction} \label{sec:introduction} The need for accelerating gradient order of magnitudes larger than existing ones drives the research in particle accelerators to plasma-based accelerators \cite{faure}, \cite{leemans2014multi}, \cite{muggli2009review}. These machines can sustain field greater than tens of GV/m paving the way to the realization of tabletop accelerators, that can successfully used for several applications, like medicine, material inspection, cultural heritage studies, radiation sources, basic research. Two main schemes are under consideration: Laser Wakefield Plasma Acceleration (LWPA) \cite{leemans2006gev}, without the need of any RF (Radio Frequency) conventional accelerator, or Plasma Wakefield Accelerators (PWFA) \cite{litos2014high} - \cite{clayton1996generation} where both a high intensity laser and high brightness electron beam are foreseen. In both schemes, a PW class laser is used. Likely, these lasers will not be considered uniquely to drive the main accelerator but they will also be devoted to other several activities. The interaction of such a laser with the matter produces a large number of electrons, ions, positrons, protons via several different mechanisms depending on the laser intensity and the target material compositions and dimensions \cite{ledingham2010laser}. While a lot of effort is dedicated nowadays to improve the quality of these charged or neutral beams of particles to use them, so far there is not yet a user facility using them. There are many studies concerning neutron production via laser-matter interaction (for instance among the others \cite{roth2013bright}, \cite{kar2016beamed}). The purpose of this paper is to consider if the laser interested for these future accelerators, and for the EUPRAXIA case for instance, can be used to drive a user-oriented compact neutron source. With the words user-oriented, we mean a facility where neutron flux and spectrum are enough to be competitive with existing facilities \cite{anderson2016research}, or in any case with neutron portable devices. One of the main application that we can foresee for such kind of source is non destructive inspections for industry, research and cultural heritage. Usually many techniques are used to study the objects in this field, like THz, IR and X-ray radiation. All of these sources are foreseen, sooner or later, in Eupraxia project. Adding also, within the same instrumentation, a neutron source could be very interesting, giving the possibility of having on the same site all these techniques together, in views of an integrated suite of light and particle beams for materials and cultural heritage sciences. This would provide the complementary high penetration, isotope selectivity, and non destructive character of neutron based techniques within the suite of light and particle probes available within the proposed project. This neutron source could be fast (multi MeV) or, through the application of a dedicated compact moderator, thermal. The following analysis refers, as an exemplificative target, to the thermal neutron radiography. This application requires, in addition to a neutron source, a moderator. Further equipment as collimators and imaging systems are also required. In addition, a Prompt Gamma Activation Analysis (PGAA) system may be easily incorporated in the design, for expanded capability towards isotopic and elemental sensitivity. \section{Methodological analysis} A very compact neutron moderator is required to produce a small sized radiography facility. While a custom design for such kind of source should be considered, we use here as an example the scheme HOTNES (Homogeneous Thermal NEutron Source) \cite{bedogni2017experimental}, implemented already in a thermal neutron irradiation facility with extended and very uniform irradiation area (HOTNES at ENEA-INFN, Frascati). Starting from a cm-sized fast neutron source ($^{241}$Am-B), this new type of moderator produces a highly thermalized and very uniform neutron field across a large irradiation area (30 cm in diameter). The moderating efficiency (thermal fluence per primary neutron) slightly depends on the fast neutron spectrum and is in the order of 2 10$^{4}$ cm$^{-2}$. For the purposes of the current project idea, fast neutrons from the laser compact source would be fed into the moderator, instead of the radionuclide neutron source. \section{Possible sources} Several possibilities can be explored, relying on primary electron, protons, or ions. These particles can be produced with the conventional RF linac or with a laser based machine. \subsection{RF linac based source} We consider the electron beam of 1 GeV energy, with bunch charge 100 pC, a repetition rate of 10 Hz and an average current of 1 nA. We use the production of neutron via bremsstrahlung, using a tungsten target of 5x5x9 cm$^{3}$, being 9 cm the thickness that maximize the yield. We can obtain about 0.4 neutrons for primary electron. With the Eupraxia design values it reflects in about 2.5 10$^{9}$ neutrons/s, which is similar to the yield of high-performance industrial neutron generators. A HOTNES-like moderator \cite{bedogni2017experimental} would convert them into thermal neutrons with efficiency 2.3 10$^{-4}$ cm$^{-2}$, producing a final non-collimated thermal fluence of about 6 10$^{5}$. Collimating devices would then reduce it of about one order of magnitude. In terms of overall efficiency, the non collimated thermal fluence per primary electron on the W target would be in the order of 9 10$^{-5}$ cm$^{-2}$. \subsection{Protons/ions from laser acceleration} When a high intensity laser (10$^{19}$ W/cm$^{2}$ or better) is focused on a solid target several effects can be triggered, like for instance Target Normal Sheath Acceleration (TNSA) \cite{hatchett2000electron}, Radiation Pressure Acceleration (RPA) \cite{esirkepov2004highly}, collisionless shock acceleration \cite{haberberger2012collisionless} and Break Out Afterburner (BOA) (\cite{henig2009enhanced}-\cite{yin2006gev}), depending on target material, thickness and surface contaminations for instance. Let us focus on TNSA. Fast electrons are accelerated through the material by the laser. These electrons penetrate the target ionizing other particles and escaping from the other side. In this moment, they build up a very strong electric field, in the order of TV/m. This field extracts protons and ions from the rear surface, producing an intense beam of particles. While there are scaling laws of the process, being exhaustively reported in \cite{fuchs2006laser}-\cite{zeil2010scaling}, it is very difficult to define the energy spectrum, the flux intensity, and the particles geometrical distribution in a general case, being the emission strongly linked to target material, surface contamination, laser energy and intensity, laser contrast. The increasing of the laser energy increases both protons number and average energy. The great varieties of results can be appreciated in Fig.\ref{fig1}. \begin{figure}[htb] \centering \includegraphics*[width=80mm]{Image1.eps} \caption{Comparison of proton spectrum emerging in different experiments. For the symbol caption see the Table 1} \label{fig1} \end{figure} \begin{table}[!htbp] \begin{center} \begin{tabular}{|c|c|c|c|} \hline Label & Intensity (W/cm$^{2}$) & Energy(J) & Reference \\ \hline a) & 2.0e20 & 200 & \cite{yang2004neutron} \\ \hline b) & 1.5e20 & 80 & \cite{gaillard2011increased} \\ \hline c) & 1.0e20 & 3 & \cite{kar2016guided} \\ \hline d) & 1.0e20 & 42 & \cite{clark2002measurements} \\ \hline e) & 1.0e21 & 10 & \cite{green2014high} \\ \hline \end{tabular} \caption{\label{tab:III}. Symbol caption for spectrum in Fig.\ref{fig1}.} \end{center} \end{table} We can see that the laser energies are quite different, while the intensities are much more similar. However, this dependence is not followed very strict, mainly due to some particular experimental arrangement of the target, in order to increase and to guide better the protons, as wells as the use of different kind of targets triggering mechanisms different from TNSA for instance. What is important is the number of the proton in an energy range below 10- 20 MeV, because even laser with energy around or below 40 J can already produce a protons number in the order of 10$^{11}$ in such energy range. We will see in the following that the neutron yield does not change so dramatically when we consider protons of energy in this energy range with respect to higher energy values. Once that the primary beam is produced, the protons/ions hit a materials like for instance LiF or Be, in order to produce a neutron flux. This scheme is usually called pitcher-catcher scheme, as shown in Fig.\ref{fig2}. \begin{figure}[htb] \centering \includegraphics*[width=80mm]{Image2.eps} \caption{Sketch of the Pitcher-Catcher system} \label{fig2} \end{figure} We focus on a typical target of Lithium fluoride with the reaction $^{7}$Li + p $\rightarrow$ $^{7}$Be + n - 1.644 MeV. Different yields are found in literature for the same reaction. For this simulation and for the following, the neutron production yield was generated using a custom Labview$^{TM}$ based software based on a continuous projectile slowing down in the target. The stopping power data were generated from PSTAR (NIST) \cite{pstarurl} for protons and SRIM 2011 \cite{srim} for deuterons. Cross sections data were taken from ENDFB VII \cite{chadwicknucl} and EXFOR \cite{exfor} (protons) or TENDL2009 (deuterons) \cite{koning2009tendl}. The differences in the yield in the range of the tens-few tens of MeV are only about a factor 2-4, much less than an order of magnitude, making appealing also proton of lower energy that can be produced by smaller laser with higher repetition rate. The thickness of the target was also optimized in order to maximize the neutron flux. With 0.2 cm of LiF target the typical moderation yields in thermal neutron flux per primary fast neutron is 1.55 10$^{-4}$ n/p per proton of 5 MeV. We also considered the case of a Beryllium target with a deuteron beam because usually the targets are hydrogenated on the surface to increase the deuterons number. Considering 7 MeV deuteron we can have a moderation yields in thermal neutron flux per primary fast neutron of about 1.24 10$^{-4}$ n/d. We are neglecting here the slightly different moderator efficiency of 7 MeV deuteron. Also in this case a custom and more refined designed should be implemented. However, we are considering just orders of magnitude to have a better understanding of the several possibilities offered by the actual technology. \subsection{Electrons from laser acceleration} There is another possibility, not yet fully explored, to produce neutron by a laser source: using electrons from self-injection \cite{pomerantz}. A TW class laser is focused in a tight spot (few $\mu$m) on a supersonics gas jet. The laser ionizes the plasma and the ponderomotive force remove the plasma electron generating an intense electric field. Inside this bubble structure, the electrons are self- injected from the rear of the bubble experiencing a strong accelerating field. If we consider having electron of about 250 MeV on tungsten, we can have about 0.08 neutron per primary particle, and about 0.4 at 1 GeV electron energy. Regarding the charge there are scaling laws, as reported in \cite{lu2007generating}, being the total number roughly proportional to the square of the laser power. With 1 PW laser about 1.2 nC of electrons can be produced. However, gas mixture can increase the number as recently proved in \cite{schramm2017first}, where they obtained with a 200 TW laser about 0.5 nC at 250 MeV, with 20 $\%$ energy spread, using several mixtures of helium and nitrogen. Such kind of laser, similar to FLAME already existing in Frascati, can have a repetition rate of 10 Hz. Being it an experimental result we can use with baseline for our evaluation, obtaining about 2.5 10$^{9}$ n/s before the moderation. The increase of the energy is also a possibility. In \cite{leemans2014multi} a beam of 4.2 GeV has been produced, even at low charge. The main difficulty in increasing the bunch energy is the dephasing between laser and electrons. It cannot be really addressed in a gas jet and more complex structures, like a capillary with modulated density profile, are needed. \begin{table*}[t] \begin{center} \begin{tabular}{|c|c|c|c|c|c|c|} \hline Source & Primary & Energy (MeV) & Y(n/prim) & m(moderation efficiency) & Yxm & Neutrons/s/cm$^{2}$\\ \hline RF & Electrons & 1000 & 4.0e-1 & 2.3e-4 & 9.3e-5 & 5.8e5 \\ \hline Laser & Electrons & 250 & 8.0e-2 & 2.0e-4 & 1.6e-5 & 5.0e5 \\ \hline Laser & Electrons & 1000 & 4.0e-1 & 2-0e-4 & 8.0e-5 & 3.0e6 \\ \hline Laser & Protons & 5 & 8.7e-4 & 2.2e-4 & 1.9e-7 & 2.0e5 \\ \hline Deuterons & Protons & 7 & 7.6e-4 & 1.2e-4 & 9.4e-8 & 9.4e4 \\ \hline \end{tabular} \caption{\label{tab:I}Uncollimated thermal neutron fluence rate expected from different fast neutron sources. For Proton and Deuterons we assume 10$^{11}$ particles per shot at 10 Hz, for laser electron 0.5 nC at 10 Hz for the 250 MeV case, while 1.2 nC at 5 Hz for 1 GeV case.} \end{center} \end{table*} In Table 2 we collected the results of the simulation from different possible sources. For protons and deuterons, we estimated 10$^{11}$ particles per shot and at 10 Hz, a result that today it is the borderline of what it is possible to obtain. For electron, we assumed the case of \cite{schramm2017first} being already obtained. Laser and RF source (with the EUPRAXIA parameters) are giving roughly the same amount of neutrons. However, an improvement of the laser system to the PW scale or to the self-injection mechanics can really increase this number of a consistent factor. There are also two considerations about this number. First, the number from RF conventional source is the maximum achievable, today and likely in the future if the accelerating charge or the repetition rate will not increase, while the laser-based techniques are quite young and we expect to have an increase in these numbers in the following years. Second: even today, all of these solutions can drive easily a compact neutron source. \section{Conclusion} With modern neutron imaging systems, neutron radiography can be performed with a parallel beam of low energy neutrons with fluence rate 10$^{4}$ - 10$^{6}$ cm$^{-2}$s$^{-1}$. PGAA (Prompt Gamma Activation Analysis) are less demanding considering that even conventional portable sources are used for this end, giving flux on the sample in the order of 10$^{3}$ n/cm$^{2}$/s. These kind of numbers are in the same order of several CANS \cite{anderson2016research}. Investigations related to cultural heritage may represent a strong asset of the potential as a user-oriented facility. These can benefit from a large and easily accessible inventory of cultural heritage artefacts in the regional area where EUPRAXIA will be implemented, fostering the access to such an infrastructure of users from museums, cultural heritage research centers, conservation and restoration centers. It is expected that these activities will in turn attract users from the industrial and research based community. Both of these techniques are widely used in cultural heritage studies and can successfully implemented in EUPRAXIA using the existing infrastructure. Laser based source have the great advantage to be very compact, to do not require the beam of the main machine, and in prospective they will allow to deliver brighter flux of neutrons. However, electrons from self-injection are a great candidate to drive this research, requiring a modest laser energy, a simple setup, and they can produce enough neutrons for cultural heritage applications, that can benefit also from the presence of the radiation sources in the entire spectrum in the EUPRAXIA facility. \section{ACKNOWLEDGEMENTS} This work was supported by the European Union‘s Horizon 2020 research and innovation programme under grant agreement No. 653782. \bibliographystyle{elsarticle-num}
\section{Introduction}\label{sec:introduction} As Deep Learning(DL) continues its dominance in a multitude of disciplines such as Image Classification, Speech Recognition and Natural Language Processing, the need for DL systems of scale to reduce training times gains utmost importance. With scientists exploring newer and scalable algorithms, innovation in DL infrastructure and frameworks is critical to realize their potential on massively large supercomputers. For example, clusters of GPUs interconnected by high performance networks are being deployed and a major emphasis is on cloud to lower costs~\cite{aws,azure,google-cloud,ibm-cloud}. Also, future generation machines such as Sierra and Summit\cite{coral} would deploy thousands of nodes featuring IBM Power9 processors with multiple NVIDIA Volta GPUs per node interconnected by fast InfiniBand networks. Almost all of the existing DL frameworks adopt either a Parameter Server (PS) approach or use MPI parallelism to scale DL algorithms. MXNET~\cite{mxnet}, TensorFlow~\cite{abadi2016tensorflow} use PS. CNTK~\cite{CNTK}, Caffee~\cite{caffeMPIindiana,s-caffe,dl-cots} use MPI parallelism. The core computation done in these algorithms is a parallel Stochastic Gradient Descent or SGD. In the loosely coupled task model of PS approach, parallel SGD faces issues such as network hot-spots and slow convergence due to parameter staleness at scale. However, it is ubiquitous in cloud computing as it is inherently fault tolerant and elastic. On the other hand, MPI has been proven to deliver performance at scale but lacks a good fault-tolerant support, though ULFM~\cite{ulfm} and its implementations~\cite{mpich-ulfm,openmpi-ulfm,ulfm-issues},are promising steps in this direction. Also, dynamic sizing of MPI jobs poses several constraints~\cite{mpi-dynamic-issues}. Both represent opposite ends of the programming space and considerable efficiencies can be achieved by using both at the same time. Further, as number of workers doing parallel SGD increase, the algorithm and the system imposes a restriction on how much scaling is permissible without degrading the performance of the algorithm. For example, one of the important parameter of the SGD is the mini-batch size which cannot be indefinitely increased due to drop in the accuracy~\cite{largebatch-degrades,bengio2012practical} and reduced parallel efficiencies due to increasing communication costs~\cite{dl-intel}. Hence, a very important and pertinent question to ask is are the existing DL frameworks suitable for cluster wide scaling? A crucial step for performance in SGD is the aggregation of gradient or parameter vectors of the model from each GPU and across the nodes. With the architectures offering new CPU, GPU topologies interconnected by high bandwidth networks such as NVLINK\cite{coral} can the existing collective algorithms operating on one vector per worker still apply? In this paper, we focus on these issues. In particular, 1) We design, implement, evaluate a MXNET based framework supporting both PS and MPI parallelism at the same time by embedding MPI based collective primitives in the computation graph. The central idea is to make an independent MPI\_COMM\_WORLD job client to the PS. The number of clients is tunable, offering knobs for a smooth transition from PS on one end to pure MPI on the other end. This generic design offers flexibility to work with a variety of algorithms across traditional HPC and cloud based infrastructures. 2) Using large scale ImageNet 1K~\cite{imagenet} we demonstrate the key benefits of our approach, namely better scaling by reducing network contention and alleviating parameter staleness. The new model allows this by reducing number of clients and instead scaling each client. Compared to the default PS approach, our method improves the time per epoch by six times and also improves the rate of convergence at the same time. 3) We design a new MPI Elastic SGD algorithm allowing synchronous SGD methods within a MPI communicator and asynchronous lazy update of parameters outside. This allows new opportunities for scaling DL algorithms cluster wide. On the ImageNet we show more than 2X improvement in rate of convergence compared to all the major approaches of parallel SGD. 4) We demonstrate a new class of multi-node tensor collectives. The central idea used in these primitives is to design collective operations around a GPU tensor per worker instead of a single vector per GPU. Using our optimizations, we arrive at validation accuracies over 0.72 for the complete ImageNet 1K training on a IBM Minsky cluster~\cite{ibm-minsky} We now describe the SGD optimization method, the fundamental numerical gradient optimization used in almost all the popular frameworks. \section{SGD}\label{sec:sgd} In this section, we explain the major issues in parallel and distributed SGD. This motivates the need for appropriate MPI adaptations of these algorithms for scaling. \subsection{Mini-Batch SGD}\label{sec:mini-batch-stoch} In a mini-batch SGD, the entire data is divided into several mini-batches, collectively known as the ``epoch". The computation iterates over the epoch, one mini-batch at a time. The model parameters at iteration t, $w_{t}$ are updated by an increment $\Delta w$ to get the parameters for the next iteration. \begin{equation}\label{eq:param-update} w_{t + 1} = w_{t} + \Delta w \end{equation} $\Delta w$ is computed as $\Delta w = - \eta g$, where $g$ is the gradient, $\eta$ is a hyper parameter called as the learning rate. For the deep learning models, the model parameters and gradients are associated with the different network links across the layers. The gradients are obtained after doing a forward pass and then an auto-differentiation in the backward step. The final gradient, $g$ is the average of all the gradients obtained from the data samples in a mini-batch. Also, since the gradients are obtained as soon as a backward step for a layer is computed, these can be aggregated in parallel with the backward phase of the previous layer for parallel SGD described below. \subsection{Parallel SGD}\label{sec:parallel-sgd} In parallel SGD\cite{ruder2016overview,lian2015asynchronous,recht2011hogwild}, each worker processes an independent portion of the data set. The many versions of the parallel SGDs differ in the manner gradients and parameters are computed and how the mini-batches are constructed. In parallel synchronous SGD, the mini-batch is divided across all the workers and all workers wait for global average of locally computed gradients, $g$ before computing the next set of parameters, $w_{t+1}$, equation~\ref{eq:param-update}. In asynchronous form, each worker gets a separate mini-batch and doesn't aggregate gradients from other workers. After every iteration, it interacts with a PS only to push the locally computed averaged gradient, $g$ and pull the latest parameters,$w_{t + 1}$ for their next mini-batch~\cite{google-DNN}. Please note that we use PS interchangeably to mean the model and also refer to the parameter servers of the framework.\\ New algorithms such as Elastic Averaging\cite{zhang2015deep}, Federated Averaging~\cite{federated-averaging} allow further decoupling with the PS. In stead of interacting with PS after every iteration, they compute the weights locally and use PS to lazily compute the average of weights $w_{t}$ rather than gradients for the next mini-batch. For elastic averaging, the PS stores an additional set of model weights called as center variables, $\tilde{w}$. The update~\ref{elastic1} is done on the server and ~\ref{elastic2} is done on the client. $\alpha$ is another hyper parameter, like the learning rate of SGD, passed to the algorithm. \begin{equation}\label{elastic1} \tilde{w}_{\text{t+1}} = \tilde{w}_{\text{t}} + \alpha*\left(w_{\text{t}} - {\tilde{w}}_{\text{t}} \right) \end{equation} \begin{equation}\label{elastic2} w_{\text{t+1}} = w_{\text{t}} - \alpha*\left(w_{\text{t}} - {\tilde{w}}_{\text{t}}\right) \end{equation} \subsection{Issues with Parallel SGD}\label{sec:issues} We now explain the different issues with parallel SGDs.\\ \textbf{Network Contention:} One of the major issues faced with Synchronous SGD is the network hot spot as a single incoming link to a server is shared across multiple workers~\cite{ps-hotspot}. As the PS model scales, using multiple servers alleviates the contention at the server side. However, the number of workers still poses a challenge. In Fire-Caffe~\cite{firecaffe}, a hierarchical tree approach is used to aggregate the gradients from the workers. However, these approaches do not utilize all the underlying communication links and are heavily dependent on the network topology of the machine. Instead, MPI solves the problem by deploying state-of-the-art parallel algorithms which can adapt to any underlying topology. Thus, grouping workers into logical MPI cliques as shown in figure~\ref{fig:ps-mpi-model} significantly resolves contention on PS. \textbf{Parameter Staleness:} As the number of workers increases, asynchronous forms of SGD face the issue of staleness~\cite{suyog-staleness,petuum}, which inhibit a fast rate of convergence. Grouping workers into MPI clients potentially offers two immediate advantages: a) It reduces the variance of the gradient updates by effectively increasing the mini\_batch\_size~\cite{leon-variance}. In~\cite{google-sgd}, the number of iterations to converge is halved as the mini\_batch\_size is doubled. b) reduces total number of workers. Depending on the algorithm and the distribution of data, one or both the factors improve the rate. For example, the MPI elastic averaging algorithms studied in this paper benefit from both. Such models offer potential to scale to a full scale machine comprising of thousands of GPUs. \textbf{Memory Pressure and Batch Size:} One of the main issues in the implementation of DL systems is memory pressure~\cite{DNN-memory,gpu-ps}, which keeps growing as the number of levels of the network increase. This restricts the choice of batch size of a DL worker to smaller values as the total memory per worker is dictated by the hardware. There are inefficiencies using smaller batch sizes. Grouping workers to larger batches should improve performance as long as the batch sizes falls within algorithmic stipulated limits. Moreover, the new framework also allows the flexibility to decouple dependency between the model mini batch size and memory limits per worker, allowing for a possibility of porting models across different hardware architectures. \begin{figure*}[h] \includegraphics[width=\textwidth]{figures/ps-mpi-model.eps} \vspace{-1mm} \caption{MPI + Parameter server} \label{fig:ps-mpi-model} \end{figure*}% We come up with a general framework using MPI and PS that addresses these challenges. The existing approaches have either dealt with one or another but to the best of our knowledge, there is no architecture that addresses all of these in a holistic fashion. We use MXNET to demonstrate the new model but the design proposed is flexible and can be adapted to different architectures. MXNET\cite{mxnet} framework, deployed by Amazon in the cloud, is actively developed providing convenient abstractions at many higher level languages \cite{chen2015mxnet,li2014communication}. \section{DL using MXNET}\label{sec:deep-learning-using} MXNET uses a declarative computation graph to express the different computations of the DL network and an imperative KVStore to allow for parallelization of deep learning models. \subsection{Computation Graph and Execution Model} A declarative model expresses the neural network computation as a graph with all the data flow dependencies. The computation is not immediately executed but rather optimized for efficiency in memory usage and runtime. Internally, a dependency engine tracks all the operations that can be executed in parallel using the data flow graph. The MXNET dependency engine is generic and can schedule any operation, provided it is tagged with explicit read and write dependencies, shown below. An operation like $a=b+1$ can be performed by constructing the following lamda function and pushing to the engine: \texttt{Engine.push(lambda:a.data=b.data+1, read=[b.tag], mutate=[a.tag])}.\\ As we describe in the next section, these lamda functions become key constructs to offload MPI communications and integrate into the data flow graph. \subsection{KVStore based Aggregation}\label{sec:kvstore-api} The network parameter and the gradients are expressed as multi-dimensional tensors, implemented as $ndarrays$ in MXNET. Being a data parallel model, the data for a worker is further split across all local GPUs. Hence, there are N such tensors per worker, one per GPU and N GPUs per worker. As described in \ref{sec:sgd}, parallel SGD needs to aggregate gradients across all the GPUs before taking the next step. A similar global aggregation needs to be done across all the workers for solving a synchronous SGD. \begin{figure}[h] \begin{lstlisting} keys=[1,3,9] kvstore.init(keys, [mxnet.ndarray.ones(shape)]*len(keys)) tensorlist=[mxnet.ndarray.ones(shape,gpu) for gpu in gpus]*len(keys) kvstore.push(keys,tensorlist) kvstore.pull(keys,tensorlist) kvstore.set_optimizer(algorithm) \end{lstlisting} \caption{} \label{fig:code-snippet-1} \end{figure}% \vspace{-1mm} The KVStore API provides access to a distributed \emph{\textless{}key, value\textgreater{}} at the PS. For every mini-batch, the worker computes relevant local updates about the model and uses the KVStore Push and Pull API to synchronize them to a globally visible set of model variables at PS. Both primitives take a list of keys and list of values. The python snippet in figure \ref{fig:code-snippet-1} illustrates the semantics of the operation. As shown in the figure, three keys are initialized in the KVStore to tensors of a default shape and value (line 2). In the DL algorithm, these keys would correspond to the model weights and initialized to random values using a given distribution. A tensor list is a succinct representation of the tensors across each level, identified by the key and also one from each GPU of the worker(line4). The push operation (line 6) first locally aggregates all the tensors of the same key before pushing to the distributed KVStore. The pull fetches the tensor from the KVStore server corresponding to the given key and copies it to all relevant tensors in tensorlist (line 7). \\ The KVStore API also permits remotely configuring the server to use different SGD optimizations like momentum SGD, AdaGrad(line 8). We use this to design the elastic averaging technique in MXNET-MPI, described in section ~\ref{sec:kvstore-mpi-algo}. \begin{figure*}[h] \includegraphics[width=\textwidth]{figures/push-pull.eps} \caption{Primitives: push and pull} \label{fig:push-pull} \end{figure*}% \section{KVStore-MPI Framework}\label{sec:problem} The basic idea to make the MPI and PS model co-exist is to design a hybrid KVStore-MPI framework extending the existing set of KVStore APIs discussed earlier. In this section we discuss the various design issues to realize the model shown in Figure~\ref{fig:ps-mpi-model} using this new framework. \subsection{MPI+PS System Architecture} \subsubsection{Namespaces} Each worker in the integrated model has identities in two independent namespaces: PS and MPI. In order to do aggregation operations across the workers belonging to the same client, the worker invokes the MPI call usings its MPI rank. For PS updates, it uses its unique name and rank in the PS namespace. In MXNET, each task is either a scheduler, server or a worker as shown in the figure. In the PS namespace, the scheduler is connected to all the workers and the servers. And each worker is connected to all the servers. MPI Communicators on the other hand are created only among the workers belonging to the same client. We explain how a client is constructed below. \subsubsection{Job Launch} We use IBM's LSF~\cite{lsf} administered cluster as our underlying core infrastructure. A launcher is executed on the front end node of the cluster and specified the following parameters: \#workers, \#servers and \#clients. The launcher computes the number of workers in each client using this information. It always launches a MXNET scheduler task first as it listens for all the incoming connections from workers and servers. The address of the scheduler and port information is broad casted to all tasks via the launcher when it spawns them so that connections between the workers and servers can be established. The launcher uses LSF's bsub command to launch each client as a separate job. In our case, each of these jobs start using mpirun. LSF transparently manages what hosts to pick the job. Further, \#servers can be tunable, with \#servers equal to zero for pure MPI jobs. \subsection{Embedding MPI in the Computation Graph} Except for creation of KVStore, all the other API calls use C++11 lambda functions to "offload" MPI communication to the dependency engine thread in a manner similar to as shown in section ~\ref{sec:deep-learning-using}. The operations are enqueued in order to avoid deadlocks. \subsubsection{KVStore.create("type")} MPI version of KVStore is constructed by passing appropriate type to the function. Apart from the existing synchronous and asynchronous version supported by MXNET, the additional types would be Synchronous-MPI and Asynchronous-MPI. We provide more details in the following section on how these are used. For MPI, all the workers call MPI\_Init() to create their own MPI\_COMM\_WORLD and become a single MPI client. When there are servers, the rank 0 in PS name space, initializes the values of all the keys on the servers which are subsequently pulled by the rest of the workers. When there are no servers, we use MPI\_Bcast to initialize the weights across all the workers. \subsubsection{KVStore.push(key, src\_tensor\_list)}In this call, all the workers with rank 0 act as the masters that communicate with the server. In the Push API, tensor allreduce is first used to aggregate the gradients across the workers in its communicator. The master then uses the native MXNET C++11 call, ZPush to push the result to the server. The entire operation is coded as a lambda function and pushed to the engine, along with the necessary read dependencies shown in Figure~\ref{fig:code-push}. In ~\cite{s-caffe}, the authors also use threaded progress to overlap computation and communication. Their approach is specific to the implementation and doesn't use dependency tracking. \begin{figure}[h] \begin{lstlisting} auto push_to_servers = [this, key, vals]() { allreduce(vals.data, vals.len, vals.type, comm); if(mpi_rank == 0)ZPush(key, vals.data, vals.len, NULL); } Engine.Push(push_to_servers, read_deps(vals.tag), mutate(none)); \end{lstlisting} \caption{} \label{fig:code-push} \end{figure}% \subsubsection{KVStore.pull(key, dst\_tensor\_list)}In the Pull API, the master worker calls broadcast after pulling the value from the KVStore, as shown in figure~\ref{fig:code-pull}. This is coded as another nested C++11 lambda function passed into the ZPull API for master whose mpi\_rank is zero. Meanwhile, all the others call broadcast. \begin{figure}[h] \begin{lstlisting} auto pull_from_servers = [this, key, vals]() { if(mpi_rank == 0) ZPull(key, vals.data, vals.len, [vals, comm](){bcast(vals.data, vals.len, vals.type,0, comm)}); else bcast(vals.data, vals.len, vals.type, 0, comm)); }; Engine.Push(pull_from_servers, read_deps(none), mutate(vals.tag)); \end{lstlisting} \caption{} \label{fig:code-pull} \end{figure}% \subsubsection{KVStore.pushpull(key, src\_tensor\_list, dst\_tensor\_list)}This is a new API added into MXNET with help from MXNET team, that fuses the Push and Pull into one call. This offers a convenient interface amenable to MPI acceleration. Instead of calling the ZPush, ZPull APIs we directly call tensor allreduce, described in section~\ref{sec:tensor-allreduce}. \section{KVStore-MPI distributed algorithms}\label{sec:kvstore-mpi-algo} In this section, we show python pseudo codes that each worker in a mpi client executes in the new framework for the three main algorithms discussed in section~\ref{sec:sgd}.\\ \textbf{Synchronous SGD(SGD):} In MXNET, each worker is assigned a set of data batches, each with a fixed $batch\_size$ which it iterates on. The $batch\_size$ is a scheduling unit of MXNET and is different from the $mini\_batch\_size$ of the algorithm. As shown in figure~\ref{fig:code-snippet-2}, the executor offloads the declarative computation graph to the engines on line 4. The Push and Pull integrate into this engine by explicitly mentioning the dependencies for scheduling as shown in the previous section. In the default PS, the servers aggregate all the gradients issued by the worker. However, using MPI the gradients are first aggregated in the respective clients before being pushed to the servers. The $mini\_batch\_size$ for synchronous SGD, is $num\_workers * batch\_size$ (line 10). \begin{figure}[h] \begin{lstlisting} Kvstore.Create("Synchronous-MPI") for epoch in range(num_epochs): for batch in train_data: Executor. Forward_backward(net.symbol, net.params, net.grads, batch) for key in range(num_tensors): Kvstore.Push(key, net.grads[key]) Kvstore.Pull(key, net.grads[key]) SGD.Update(net.params, net.grads, rescale=1/mini_batch_size) Executor.ValidationAccuracy(test_batch) \end{lstlisting} \caption{} \label{fig:code-snippet-2} \end{figure}% For the pure MPI mode, without servers, the Push and Pull calls are replaced by the new PushPull API and optimized using tensor allreduce. \textbf{Asynchronous SGD(ASGD):} In this method, the MPI Client executes the asynchronous SGD algorithm and updates the parameter values as shown in Figure \ref{fig:code-snippet-3}. The specific optimization function is shipped to the server on line 2 along with the scaling associated with the $mini\_batch\_size$. In the MPI version, this is equal to $num\_workers\_per\_client*batch\_size$. The client pushes the locally computed gradients within the communicator and pulls back the new parameter values after the server has finished updating them. \begin{figure}[h] \begin{lstlisting} Kvstore.Create("Asynchronous-MPI") Kvstore.set_optimizer(SGD, rescale=1/mini_batch_size) for epoch in range(num_epochs): for batch in train_data: Executor.Forward_backward(net.symbol, net.params, net.grads, batch) for key in range(num_tensors): Kvstore.Push(key, net.grads[key]) Kvstore.Pull(key, net.params[key]) Executor.ValidationAccuracy(test_batch) \end{lstlisting} \caption{} \label{fig:code-snippet-3} \end{figure}% \begin{figure}[h] \begin{lstlisting} Kvstore.Create("Asynchronous-MPI") Kvstore.set_optimizer(Elastic1, rescale=alpha) iter = 0 for epoch in range(num_epochs): for batch in train_data: Executor.Forward_backward(net.symbol, net.params, net.grads, batch) for key in range(num_tensors): if (ite Kvstore.Push(key, net.params[key]) Kvstore.Pull(key, net.centers[key]) Elastic2.(net.params[key], net.centers[key],rescale=alpha) SGD.Update(net.params, net.grads, rescale=1/mini_batch_size)) iter = iter + 1 Executor.ValidationAccuracy(test_batch) \end{lstlisting} \caption{} \label{fig:code-snippet-4} \end{figure}% \textbf{Asynchronous Elastic SGD(ESGD):} As shown in Figure \ref{fig:code-snippet-4}, the MPI client computes SGD within its communicator. The model parameters are pushed/pulled from the server after a certain number of iterations using elastic averaging discussed in section~\ref{sec:parallel-sgd}. Elastic1 is done by the server based on equation ~\ref{elastic1} and it updates the center variables. The second equation~\ref{elastic2} is done by the MPI client using Elastic2 updating its local model parameters. It is shown in the steps 2 and 12 respectively in the figure. In our experiments, the INTERVAL is set to 64. The $mini\_batch\_size$ is equal to $num\_workers\_per\_client*batch\_size$. \section{TENSOR COLLECTIVES}\label{sec:tensor-allreduce} In this section, we describe the design of tensor allreduce that is exclusively used to aggregate gradients from the GPUs across the cluster. \subsection{Tensor Operations}We define a tensor to be a grouping of vectors, one from each GPU such that communication operations within a tensor are extremely fast and are expected to scale well as more vectors are added. This is possible because of the growing bandwidths of NVLINK interconnecting the GPUs and launching cuda kernels directly on the GPUs for doing the operation. For example, the widely used NCCL exclusively uses special kernels to do all the different kinds of operations within the tensor, important being reduce, allreduce, bcast and reduce-scatter. Moreover, for multi-node collectives, thinking about group of vectors as a single unit allows applying several well known collective algorithms that have been used only on one vector at a time. This is especially true on the IBM Minsky machines. Figure~\ref{fig:tensor-allreduce-ring} shows the architecture of a Minsky node. Each node consists of two sockets and is directly connected to two NVIDIA P100 Pascal GPUs with independent NVLINK links. The two GPUs are also directly connected to each other using another NVLINK. Essentially, the CPU and the two GPUs in a socket form a 3-clique. Future machines would also allow for a 4-clique configuration where all the compute elements are directly connected to each other using NVLINK. We exploit this property to simultaneously operate on vectors from each GPU, collectively a tensor. \subsection{Bucket Algorithms} One of the popular choice for designing bandwidth optimized large message collectives is to use bucket algorithms. These algorithms use a logical ring which is well known to work in a wide variety of cluster topologies ~\cite{Jain-bucket,allreduce-yuan}. In these algorithms, an allreduce is implemented by a reduce-scatter followed by allgather. It has been proven that these algorithms reach the lower bound for bandwidths. The total cost of the operation is $ \left(p-1\right))\dot{\alpha}+2\frac{p-1}{p}\dot{n\beta}+\frac{p-1}{p}\dot{n\gamma}$. $\alpha$ is the latency term, $\beta$ is the bandwidth cost per byte and $\gamma$ is the compute cost per byte. $n$ is the total number of bytes used in the operation. For reduce-scatter, the buffer from each process is partitioned into nearly equal parts and after the operation, each process holds a piece of the final reduced sum in its partition. \subsection{Bucket Algorithms on IBM Minsky GPU tensors} On Minsky nodes, the ring connecting every GPU is not optimal. As shown in the figure, data has to be explicitly copied into the GPU from the host memory as network cannot reach the GPU memory via NVLINK. This would add two extra hops and double the time per ring step. Instead, all our rings use only the host memories. As we show in section~\ref{sec:evaluation}, we obtain very high bandwidths for the tensor reduction and broadcast operations from host memories. Further, the number of hops of the ring is halved as we group the two GPUs from each socket to form a tensor under one worker. \subsubsection{Tensor Allgather} To design this operation, we re-write the ring algorithm used in OpenMPI~\cite{openmpi} to handle CPU and GPU memories. A pair of buffers is used, one for receiving data from the left neighbor and the other to send data to the right neighbor. In addition to sending the data to its neighbor, we also invoke the broadcast operation from the host buffer to the tensor to overlap the two. Our implementation is organized as a generic GPU tensor library of routines on top of MPI. The tensor library can either use NCCL~\cite{nccl} or custom implementations tailored to IBM's node architecture. For example, to broadcast the tensor on Minsky from host, we invoke two simultaneous cudaMemcpyAsync()~\cite{cuda} calls as the topology allows two different links to the GPUs. \subsubsection{Tensor Reduce-Scatter} This operation uses the standard bucket algorithm used for buffers in the host memory with one main difference. Instead of reducing a partition of the buffer with the incoming data, a partition of the tensor is used as shown in the figure~\ref{fig:tensor-allreduce-ring}. However, the compute cost now becomes $\frac{\frac{p}{2}-1}{\frac{p}{2}}\dot{n\gamma_{\text{NV}}}$ where $\gamma_{\text{NV}}$ is the reduction cost over NVLINK. We further optimize the operation by overlapping this compute cost with the network transfer. Overlapping this operation within a single ring is not possible as the next communication step of the ring depends on the result of the previous reduction. Thus, we design a multi-ring algorithm where the reduction of the next ring is overlapped with the network transfer of the current ring. The complete tensor\_allreduce operation is described in figure~\ref{fig:allreduce}. The buffer is split equally among the rings and allreduce[ring] operates on the portion of the buffer assigned to it. It uses non blocking GpuStart() routines to launch the CUDA kernels simultaneously with network transfers. \begin{figure}[h] \begin{lstlisting} uint64_t ring = 0; allreduce[ring].GpuStart(buffer[ring], step[ring]); while(step[NUM_RINGS-2] <= size){ nextbuf = buffer[(ring+1 nextstep = step[(ring+1 nextring = (ring+1 allreduce[nextring].GpuStart(nextbuf,nextstep); buffer[ring] = allreduce[ring].GpuWait(); if (step[ring] != size){ buffer[ring] = allreduce[ring].SendRecv(buffer[ring],step[ring]); } step[ring]++; ring=(ring+1 } buffer[ring] = allreduce[ring].GpuWait(); for (unsigned ring = 0; ring < NUM_RINGS; ring++) { allreduce[ring].allgather(buffer[ring]); } \end{lstlisting} \caption{} \label{fig:allreduce} \end{figure}% \vspace{-2mm} \begin{figure*}[h] \centering \includegraphics[width=\textwidth]{figures/ibm-minsky.eps} \caption{Tensor Allreduce: ring} \label{fig:tensor-allreduce-ring} \end{figure*}% \section{EVALUATION}\label{sec:evaluation} In this section, we explain the training efficiencies obtained using the new model of MPI + PS on ImageNet 1K. ImageNet 1K contains about 1.2M images with 1000 classes. The total size of the training data used is 336GB and test data is 13GB. We use the latest network, Residual networks(resnet)~\cite{ResNet} using 50 layers for image classification. We ran our tests on two experimental testbeds. Each worker is a process running on a socket and connected to two GPUs. \textbf{testbed1}: We use a total of 8 dual-socket power8 nodes with 2 Kepler GPUs attached to each socket.The nodes are connected using InfiniBand ConnectX-4 adapters. Using this testbed, we demonstrate the utility of combining MPI and PS models. The batch size used is 128 per worker, capped by GPU memory constraints. The following modes of parallelization of model are compared:\\ 1)dist-SGD: Uses default PS tasks, all executing synchronous SGD\\ 2)dist-ASGD: Uses default PS tasks, all executing asynchronous SGD\\ 3)dist-ESGD: Uses default PS tasks, all executing asynchronous ESGD\\ 4)mpi-SGD: Uses MPI+PS where gradients are synchronously aggregated first at the MPI clients and next at the PS. \\ 5)mpi-ASGD: Uses MPI+PS with gradients synchronously aggregated at the MPI Clients but pushed asynchronously to the PS\\ 6)mpi-ESGD: Uses MPI+PS with asynchronous elastic averaging, where the model is computed at the MPI Clients but elastically averaged asynchronously at the PS.\\ \textbf{testbed2}: Comprises of 32 IBM Minsky Power8 nodes with 4 NVIDIA Pascal GPUs on each node connected with InfiniBand CX5 adapters. On this testbed, we demonstrate the tensor collectives and also show the scaling behavior of ImageNet training using the optimizations proposed. The following metrics are used to measure the performance of our approaches: \begin{enumerate} \def\alph{enumi}){\alph{enumi})} \item Epoch Time: It's time taken by the workers to train the model over the mini-batches of the epoch assigned to it. For multiple workers, we take the average time over all the workers. \item Validation Accuracy: The accuracy obtained by using the model on the the separate test samples, done after every epoch. \end{enumerate} \subsection{KVStore-MPI SGD \& ASGD}\label{mpi-sgd-asgdK} Figure~\ref{fig:sync-accuracy-epoch} shows the ImageNet validation results vs time. On testbed1, we run 12 DL workers two per node using 6 nodes. The two servers are run on the two remaining nodes. From the figure, mpi-SGD trains significantly faster than dist-SGD and mpi-ASGD faster than dist-ASGD. As observed from the figure~\ref{fig:avg-epoch-time-resnet}, using mpi removes the contention, which reduces the time taken for an epoch by the mpi clients vis-a-vis their counterparts. We use two mpi clients with 6 DL workers each interacting with the same two servers. The hot spot is transferred to the mpi client which is better equipped to solve the problem. Also, though the mpi-ASGD is the fastest in the epoch time, it converges slower than mpi-SGD. This is attributed to staleness~\cite{suyog-staleness} where the worker uses parameters from older time steps to compute the gradients. Another factor attributing to the fast convergence of mpi-SGD is the increase in mini\_batch\_size as effectively gradients from 12 workers are averaged which reduces the variance in updates~\cite{leon-variance,google-sgd}. Thus, MPI can be used effectively with PS models and the design used in the paper can be replicated in data centers considerably lowering the barrier of adoption of MPI into cloud. \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/dist-SGD_vs_dist-ASGD_vs_mpi-SGD_vs_mpi-ASGD_timeplot.eps} \caption{dist-vs-MPI SGD optimizations} \label{fig:sync-accuracy-epoch} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/resnet-average-epoch-time_barplot.eps} \caption{Imagenet Avg Epoch time (seconds)} \label{fig:avg-epoch-time-resnet} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/mpi-SGD_vs_mpi-ASGD_vs_mpi-ESGD_vs_dist-ESGD_timeplot.eps} \caption{KVStore-MPI based SGD optimizations} \label{fig:mpi-sync-vs_mpi-async_vs_mpi-esgd_vs_dist-esgd} \end{figure}% \subsection{KVStore-MPI ESGD}\label{sec:mpi-esgd} From the previous section, we saw that mpi-SGD is outperforming the rest. However, the scaling of mpi-SGD is dependent upon the communication bandwidth available for each worker. Even if the problem is weak scaled across nodes keeping batch size the same, the communication cost is expected to increase as the total communication bytes remains the same. After a while, adding extra nodes would offer no benefit~\cite{google-sgd}, as we also see in section~\ref{sec:evaluation}. The problem is further exacerbated due to the rapid increase in flop count of modern day GPUs~\cite{gpu-computing}. Thus, having communication avoiding algorithms is extremely helpful if we were to scale cluster wide. ESGD meets this objective. Figure~\ref{fig:mpi-sync-vs_mpi-async_vs_mpi-esgd_vs_dist-esgd} shows the comparison of two ESGD approaches compared to mpi-SGD, mpi-ASGD. The mpi-ESGD approach performs the best compared to the rest. Here, we use two MPI clients doing independent SGD within the communicators but loosely synchronizing with the PS. Using mpi-ESGD family of protocols provides a path to scale to a full machine. This is seen clearly from figure~\ref{fig:mpi-sync_vs_mpi-esgd-time} with mpi-ESGD out performing mpi-SGD, reaching 0.67 validation accuracy for a multiple epoch run. It can also be seen that dist-ESGD, with 12 workers is doing the worst of all, in spite of having the same average epoch time as mpi-ESGD with two clients. This is because using the mpi-ESGD model allows us to restrict the number of workers and yet allow the scaling of each worker so that staleness is minimized and the optimization algorithm can take advantage of larger mini batch sizes. However, not all application domains and data sets favor increasing the batch size~\cite{largebatch-degrades}, where dist-ESGD would help. This motivates the need for a generic framework as done in this study. \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/mpi-SGD_vs_mpi-ESGD_timeplot.eps} \caption{Impact of MPI ESGD} \label{fig:mpi-sync_vs_mpi-esgd-time} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/resnet-50-original-strong-weak-number_of_nodes-2-4-8_barplot.eps} \caption{Resnet-50 Scaling behavior} \label{fig:resnet-50-scaling} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/resnet-50-bs-2048-np-32_vs_resnet-50-bs-1024-np-32_vs_resnet-50-bs-4096-np-64_timeplot.eps} \caption{Resnet-50 Learning curves} \label{fig:resnet-50-learning-curves} \end{figure}% \subsection{Tensor Allreduce}\label{sec:tensor-allreduce} For doing reductions into host memory, we use either NCCL or IBMGpu, the direct implementation using cuda kernels for doing math. In this approach, the two vectors of the tensor, one on each GPU are split into half and two kernels are launched on the two GPUs to add each in parallel as shown in the figure~\ref{fig:tensor-allreduce-ring}. This allows us to achieve a reduction bandwidth of 30 GB/sec with the final result put back in the host memory. The upper bound would be the write b/w of memory which is 38.4 GB/sec/socket. With NCCL, we achieve 12 GB/sec with one set of communicators and 15 GB/sec with two sets of communicators. NCCL uses only one thread block where as IBMGpu uses all 112 thread blocks with 1024 threads to keep multiple read/write requests in flight. For broadcast, both IBMGpu and NCCL achieve a b/w of 28 GB/sec. We use the GPU reduction and broadcast routines as a building block to evaluate the different design options of doing tensor allreduce and pick the best among them. The different approaches studied are: a) ring-IBMGpu design discussed in section~\ref{sec:tensor-allreduce} using two rings,b)ring-NCCL using NCCL with one ring as NCCL operations are blocking in nature, c) omp\_ring-IBMGpu, where the design is similar to the first two, except that the entire buffer is reduced into the host memory and then the host based bucket algorithm is applied with the final results copied back into the GPU. We use 8 OMP threads for data reductions and d) reg-IBMGpu, where the data is reduced into host memory and then the default MPI\_Allreduce is used, followed by a broadcast, with pipelining across the three stages. As shown in figures~\ref{fig:4MB},~\ref{fig:16MB},~\ref{fig:64MB} the IBMGpu ring is doing the best. Apart from using one thread block, another reason for lower NCCL bandwidth is the use of only one NVLINK while doing reduce. For very large messages, the performance gap diminishes across the three as the memory bandwidth becomes the bottleneck. We also see that on Minsky machines we out perform Baidu's ring implementation connecting every GPU, figure~\ref{fig:ibm-vs-baidu} by a factor of six, for the same number of GPUs. We also run large scale ImageNet runs using resnet-50 on testbed2 with \#servers=0, and using mpi-SGD. Our optimizations are nearly twice as fast than using the default, reg-IBMGpu approach, with weak scaling doing the best of all, figure~\ref{fig:resnet-50-scaling}. For strong scaling, the batch size is recursively halved where as it remains constant for weak scaling. Figure~\ref{fig:resnet-50-learning-curves} shows the model convergence with our optimized MPI implementation over MXNET and we observe over 0.72 model accuracy, which is the current state-of-the-art. We use an initial learning rate of 0.5 instead of the default 0.1 because of using a larger batch size. \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/4MB-collectives_barplot.eps} \caption{4MB(Message Size)} \label{fig:4MB} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/16MB-collectives_barplot.eps} \caption{16MB(Message Size)} \label{fig:16MB} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/64MB-collectives_barplot.eps} \caption{64MB(Message Size)} \label{fig:64MB} \end{figure}% \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{figures/IBM-Baidu.eps} \caption{IBMRing-vs-BaiduRing} \label{fig:ibm-vs-baidu} \end{figure}% \section{CONCLUSION}\label{conclusion} In this paper, we described a hybrid MPI + PS model with a flexibility to allow scaling different DL optimization methods. Though the existing framework supports data parallelism, it can be readily extended to model parallelism. For example, in MPI-ESGD, the parameters can be computed using model parallel optimizations. Also, the framework enables a path for MPI to be useful in cloud based scenarios as it inherits all the task based model attributes needed for fault-tolerance and elasticity. LSF also allows for automatic restart of mpi jobs~\cite{lsfrestart} thus permitting fault recovery. Importantly, by embedding MPI into the python modules, the framework allows the user to focus on the algorithms and not deal with explicit MPI parallelization. In this aspect, it is similar to the existing popular frameworks such as Spark~\cite{kim2016deepspark, spark}, Hadoop~\cite{hadoop}. Moreover, using MPI as the communication glue offers portability and performance for distributed DL optimizations across system and hardware architectures. Finally, the tensor collectives applied to the Minsky architecture are generic and can be readily applied to other GPU based systems. \bibliographystyle{ACM-Reference-Format}
\subsection{Deep Neural Networks (DNNs)} \label{sub:DNN} Whilst \citet{tamayo:2016} predicted the orbital stability of planets in compact multi-planet systems using the {\tt XGBoost v0.6} algorithm \citep{xgboost:2016}, we elected instead to employ deep neural networks (DNNs), which are comprised of layers through which data is propagated in order to make classifications and predictions. DNNs have been demonstrated to be powerful tools in predictive applications, including already within the field of exoplanetary science (for example see \citealt{transit:2017}, which also includes a brief pedagogical explanation of neural networks). In this work, we used the {\tt keras}\ neural network {\tt Python}\ library rather than construct our own implementation, largely because the DNN required was deeper and more intricate than that used in our earlier work of \citet{transit:2017}. \subsection{Network architecture} \label{sub:architecture} DNNs make predictions by taking a set of $N$-dimensional inputs and passing the data through ``hidden'' layers of neurons, in which nonlinear activation functions transform the data. Hidden layers are linked by synapse-like weights that transform the data linearly. The output of the network - here, a binary classification of stable or unstable - is compared with the true results, and the error calculated by some loss function. Our learning algorithm employs back-propagation, which is the chain rule applied to the loss function with respect to the parameter weights. In this manner, the learning algorithm optimizes the loss function by gradient descent. This DNN implementation is typically referred to as a multi-layer perceptron (MLP). Several key decisions factored into the neural net's architecture. These include the number of hidden layers, the number of neurons in these hidden layers, the activation functions, the loss function, and dropout. We used a fairly standard design, comprised of six layers of 48 hidden neurons each, using relu (rectifier linear unit) and sigmoid activation functions, {\tt keras}'s {\tt binary\_crossentropy} loss function, and the {\tt rmsprop} optimizer. The relu activation function, which lives in the hidden layers, is defined as \begin{align} f(x) \equiv \mathrm{max}(0,x) . \end{align} The sigmoid activation function, which lives in the single-neuron output layer, outputs a probability from which classes can be produced and is defined as \begin{align} f(x) = \frac{1}{1+e^{-x}}. \end{align} The {\tt rmsprop} optimizer normalizes a moving average of the root mean squared gradients (described in detail within the package documentation at \href{http://climin.readthedocs.io/en/latest/rmsprop.html}{this URL}). Dropout is a technique to avoid overfitting, an issue endemic to models as complex as DNNs. By setting the dropout rate of a hidden layer, one can adjust the probability at which any hidden neuron and its associated weights drop out of the training set for any particular pass through the neural net. Over many passes, different thinned versions of the DNN are trained on the data, resulting in neurons that depend less on each other for learning, which is also known as a decrease in ``co-adapting''. Compared to the classic L2 and L1 regularization methods, dropout has been shown to guard against overfitting better for neural networks (\citealt{dropout:2014}). \subsection{Feature selection} \label{sub:features} Since we sought to compare our model against the previous literature, namely the \citet{holman:1999} criterion, we initially only trained our DNN on the same three variables of that work: $e_{\mathrm{bin}}$, $\mu$ and $(a_P/a_{\mathrm{bin}})$. However, we found that even after experimenting with the network architecture, training sets and learning algorithms, the DNN was unable to reliably recover the islands of instability. The inability of our initial DNNs to capture the islands motivated us to add an additional fourth training feature. Specifically, since the islands are located at mean motion resonances, we decided to add a new feature describing how far away from one of these resonances a trial semi-major axis is. We refer to this term as the ``resonance proxy'', $\epsilon$, in what follows and define it mathematically as \newcommand\floor[1]{\lfloor#1\rfloor} \begin{align} \epsilon \equiv \frac{\zeta - \floor{\zeta}}{2}, \end{align} where $\floor{\zeta}$ is the floor of the ratio of semi-major axes converted to orbital period space via Newton's version of Kepler's Third Law, such that \begin{align} \zeta(a_p,a_{\mathrm{bin}}) = (a_p/a_{\mathrm{bin}})^{3/2} \end{align} After introducing this fourth feature, we found dramatically improved performance of the DNN in terms of capturing the islands of instability, and thus adopted the feature in what follows. \subsection{Iterative learning} When training a DNN, one generally aims to pass the training data through the network iteratively until the weights of the neural net are satisfactorily tuned. To achieve this, we increased the number of training rounds, measured in ``epochs'', until the loss on the validation set stopped significantly decreasing. An ``epoch'' is simply a forward pass through the network and the subsequent back-propagation for all training examples. The number of epochs, then, is the amount of training done before validating the model. We trained the DNN over several different choices for the maximum number of epochs, ranging from 10 to 250. In general, we found that even after 10 rounds the weights were well-tuned, which we assessed by comparing the cross-validation precision-recall curves resulting from each and described later in Section~\ref{sub:PreRec}. The learning was relatively fast, taking under 12 seconds per epoch on a MacBook Air. In our final implementation, we elected to use the 100 epoch trained network, whose performance is described quantitatively in Section~\ref{sec:performance}. \section{Introduction} \label{sec:intro} \input{introduction.tex} \section{Training Data} \label{sec:training} \input{training.tex} \section{Supervised Learning} \label{sec:learning} \input{learning.tex} \section{Network Performance} \label{sec:performance} \input{performance.tex} \section{Discussion} \label{sec:discussion} \input{discussion.tex} \section*{Acknowledgments} This work has been supported by the Columbia University Center for Career Education's Work Exemption Program and made use of Columbia's Habanero shared research computing facility. Simulations in this paper made use of the {\tt REBOUND}\ code which can be downloaded freely at \href{http://github.com/hannorein/rebound}{this URL}. This research has made use of the NASA Exoplanet Archive, which is operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program. We thank Daniel Tamayo, Hanno Rein, Gongjie Li, and the Cool Worlds Lab team for helpful comments and conversations in preparing this manuscript. \subsection{Capturing the islands of instability} We find that our DNN, as desired, is able to accurately re-produce the islands of instability first noticed by \citet{holman:1999}, but not captured by their second-order polynomial function. This can be seen in Figure~\ref{fig:performance} where we show a slice through parameter space for a fixed $\mu$ set to 0.1. Here, we generate $10^5$ random new samples in $\{e_{\mathrm{bin}},(a_P/a_{\mathrm{bin}})\}$ parameter space within the $\pm33$\% envelope used earlier but hold $\mu$ constant at $0.1$ each time, thereby generating a new validation set across a 2D slice. This presentation enables us to easily visualize the islands of instability (left panel) yet also see that in our re-parameterized domain, we are able to accurately predict these islands using our DNN (right panel). \begin{figure*} \begin{center} \includegraphics[width=17.0cm]{figure3.pdf} \caption{ \textit{Left panel:} $10^5$ randomly generated, initially circular, coplanar circumbinary planets, where the binary's eccentricity is varied ($x$-axis) and the planet's relative semi-major axis is varied ($y$-axis). Islands of dynamical instability, as first noted by \citet{holman:1999} [HW99], appear at mean motion resonances yet are not captured by the HW99 polynomial (blue dashed). \textit{Right panel:} Stability predictions from our neural net for the same $10^5$ points versus {\tt REBOUND}\ simulations. The net was trained on different data, yet is able to capture the islands of instability with a low rate of false-positives (FPs) and false-negatives (FNs). To better visualize the islands of instability, we re-parameterize, treating the Holman-Wiegert criterion as a baseline by dividing the semi-major axis ratio by the criterion and subtracting by one. } \label{fig:performance} \end{center} \end{figure*} \subsection{Execution time} With the learning finished and weights pre-set in the network, any DNN is generally expected to be very fast in making forward predictions. Indeed, on a MacBook Air, the call time for making predictions on $10^5$ validation examples is approximately 29 seconds, or about 3 ten-thousandths of a second per validation example. Such a computation time is on the same order of magnitude as typical forward models for describing exoplanet transit observations - for example, the popular transit package {\tt batman}\ requires around 0.4\,milli-seconds per call with non-linear limb darkening\footnote{Although {\tt batman}\ does not natively handle circumbinary planets, which would likely increase this computation time.} \citep{kreidberg:2015}. Accordingly, our DNN is fast enough to be practical for on-the-fly Bayesian samplers that potentially need to call the routine many millions of times. Such an approach allows for the computing of a posterior probability that accounts for dynamical stability, where the simplest implementation truncates unstable samples to a zero density. \subsection{Accuracy, Precision, and Recall} \label{sub:PreRec} When computing statistics by which to evaluate our model, it was important that we not simply apply our DNN directly on the trained data but rather apply it to a previously unseen set, known as a validation set. Accordingly, we generated a new random batch of $10^5$ {\tt REBOUND}\ simulations within the same bounding region as that originally trained on. We then applied our DNN and tallied the true positive (TP), false positive (FP), true negative (TN), and false negative (FN) rates to generate the accuracy, precision, and recall plots shown in Figure~\ref{fig:accprerec}. As evident from the figure, our DNN indeed out-performs the \citet{holman:1999} criterion, which supports our earlier comparison in Figure~\ref{fig:performance}. This is to be expected given that our DNN has a far larger number of weights than the coefficients describing the \citet{holman:1999} polynomial, allowing it to better express phenomena as complex as the islands of instability. We compared our DNN with the \citet{holman:1999} criterion using three statistics based on TP, FP, TN, and FN. One basic and useful way to quantify the performance of a binary classifier is accuracy, which is the number of correct classifications as a fraction of total cases. It is defined as \begin{align} \mathrm{accuracy} \equiv \frac{ \mathrm{TP} + \mathrm{TN} }{ \mathrm{TP} + \mathrm{TN} + \mathrm{FP} + \mathrm{FN} }. \end{align} Taking the entire suite of validation samples, we find that the accuracy of the \citet{holman:1999} criterion is 93.7\%, whereas the DNN achieves 97.1\% accuracy over the same region. However, the outer edges of this region are deep into stable and unstable territories, where both approaches have a relatively easy job of picking out the correct answers. To more rigorously evaluate the models, we filter our validation set down to a sub-sample closely surrounding the \citet{holman:1999} boundary. We vary the envelope sequentially in small steps, starting from a very tight envelope and gradually expanding out to the far regions, and in each case compute the accuracy of the two approaches. The results are shown in the left panel of Figure~\ref{fig:accprerec}, where one can see that the DNN out-performs the \citet{holman:1999} criterion across the entire range of parameter space considered. As expected, one can see the two functions converge as the envelope grows towards infinity, where the border-line cases become an increasingly negligible fraction of the overall sample. We find that the \citet{holman:1999} criterion approaches a pure random Bernoulli process for very tight envelopes, which is generally to be expected. In contrast, the DNN performs well even at the boundary and reaches its lowest accuracy of 86.5\% close to the boundary. These results allow us to predict that our DNN will be able to deliver $\geq86.5$\% accuracy for predicting the stability of circumbinary planets on initially circular, coplanar orbits. Two other statistics that are common in classifier evaluation are precision, which is defined as the fraction of positive predictions that are actually true, and recall, which is the fraction of true examples that were predicted to be positive. Mathematically, they can be defined as follows: \begin{align} \mathrm{precision} \equiv \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FP}} \end{align} \begin{align} \mathrm{recall} \equiv \frac{\mathrm{TP}}{\mathrm{TP} + \mathrm{FN}} \end{align} \citet{tamayo:2016} evaluated the performance of their network using the classic precision-recall framework, which is typically well-suited for comparing classifiers whose output probabilities can be thresholded. Whereas the thresholds of the Lissauer-family models they evaluated against are varying Hill-sphere separations, the \citet{holman:1999} criterion only predicts stability based on a single threshold: whether or not a planet's semi-major axis is above or below the curve of the polynomial. Instead of plotting precision against recall, we consequently plotted each against incrementally smaller envelope sizes, as we did with accuracy. While our DNN marginally outperforms the \citet{holman:1999} criterion for the full envelope, with 97.5\% versus 96.5\% precision and 96.8\% versus 91.4\% recall, it demonstrates a slower drop in precision and recall as the envelope shrinks. In the smaller-envelope regions of the islands of instability, the performance difference widens to greater than 20\% for precision and 35\% for recall. \begin{figure*} \begin{center} \includegraphics[width=17.0cm]{figure4.pdf} \caption{ \textit{Left panel:} accuracy \textit{Middle panel:} precision \textit{Right panel:} recall \hspace{\textwidth} Defining the full envelope as the set of all samples where the absolute value of the planet's semi-major axis is less than 33\%, we observe that our DNN only marginally outperforms Holman-Wiegert on accuracy, precision, and recall. We express the envelopes by re-parameterizing the semi-major axis ratio of planet to binary, dividing it by the polynomial from \citet{holman:1999} to normalize, and subtracting by one to center the islands of instability at zero. Moving left along the x-axis, we shrink the envelope, increasing the dominance of the islands - which are the most difficult to capture - in the validation set. Overall, while Holman-Wiegert converges towards a random Bernoulli process, our DNN persists near 90\% for accuracy, precision, and recall. } \label{fig:accprerec} \end{center} \end{figure*} \subsection{Numerical simulations with {\tt REBOUND}} \label{sub:rebound} In order to obtain the training data for our deep network, we decided to use the {\tt REBOUND}\ N-body integrator first developed by \citet{rebound}. Since first publication, {\tt REBOUND}\ has evolved to include IAS15, a non-symplectic integrator with adaptive time-stepping \citep{ias15}. We use IAS15 as our integrator of choice. Within the {\tt REBOUND}\ environment, we set up a circumbinary planet system with two stars orbiting each other with a semi-major axis of $a_{\mathrm{bin}}$ and orbital eccentricity $e_{\mathrm{bin}}$. The planet is chosen to orbit the binary on an initially circular, coplanar orbit with semi-major axis $a_P$. We ran $10^6$ {\tt REBOUND}\ experiments each comprising of ten simulations, with each simulation lasting ten thousand binary periods. Experiments were aborted if the planet met our ejection criterion described later in Section~\ref{sub:stabcheck}. For each simulation, we uniformly sampled the mass ratio, $\mu$, from values between 0 and 0.5, where \begin{align} \mu \equiv \frac{m_a}{m_a+m_b}, \end{align} where $m_a \leq m_b$, and the binary eccentricity, $e_{\mathrm{bin}}$, from values between 0 and 0.99. We then sampled the initial semi-major axis of the planet uniformly from an envelope of $\pm33\%$ surrounding the empirically derived \citet{holman:1999} stability criterion for a circumbinary planet\footnote{We initially experimented with 10\% to 50\% envelopes, but found the 33\% envelope was sufficient to encompass the islands of instability, yet compact enough to focus on the areas of interest.}, which is given by \begin{align} a_{\mathrm{HW99}} &= (1.60\pm0.04) + (5.10\pm0.05) e \nonumber\\ & \qquad + (-2.22\pm0.11) e^2 + (4.12\pm0.09) \mu \nonumber\\ & \qquad + (-4.27\pm0.17) e \mu + (-5.09\pm0.11) \mu^2 \nonumber\\ & \qquad + (4.61\pm0.36) e^2 \mu^2 . \label{eq1} \end{align} Here, $a_{\mathrm{HW99}}$ is the critical semi-major axis given in units of binary separation, since gravity's lack of scale allows us to use dimensionless units. Orbital elements are Jacobi elements, so positions, velocities, and other orbital elements are centered about the binary center of mass. To take phase into account, for every sample, ten initial binary phases were drawn uniformly from [0,2$\pi$), while keeping the planet phase at zero. If any one of these ten simulations led to an unstable orbit, the grid point was labelled as ``unstable''; otherwise, it was ``stable''. In total, this meant that ten million unique {\tt REBOUND}\ simulations were executed. The stability label of each of the $10^6$ grid points was saved and used for training our machine learning algorithm later. \subsection{Stability criterion} \label{sub:stabcheck} Systems can become unstable by the planet being either ejected from the system, or colliding with one of the stars. The former instance can be tested by evaluating whether the radial component of the planet's velocity, $v_r$, exceeds the escape velocity of the binary pair, $v_{\mathrm{esc}}$, indicating that the planet will escape to infinity. Rather than formally test for collisions, which requires setting physical radii, we label cases where the planet's orbit passes interior to that of the binary orbit as being ``unstable''. In Figures~\ref{fig:stable} \& \ref{fig:unstable}, we show two typical examples of a random system which was labelled as ``stable'' and ``unstable''. \begin{figure} \begin{center} \includegraphics[width=8.4cm]{figure1.pdf} \caption{ Example of a stable system after ten thousand binary periods. Initial parameters were $e_{\mathrm{bin}}$ of 0.4, $\mu$ of 0.5, and $a_P$ of 20\% greater than the \citet{holman:1999} criterion for the given \{$e_{\mathrm{bin}}$, $\mu$\}. } \label{fig:stable} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=8.4cm]{figure2.pdf} \caption{ Example of an unstable system after a few dozen binary periods. Initial parameters are $e_{\mathrm{bin}}$ of 0.4, $\mu$ of 0.5, and $a_P$ of 20\% smaller than the \citet{holman:1999} criterion for the given \{$e_{\mathrm{bin}}$, $\mu$\}. } \label{fig:unstable} \end{center} \end{figure} \subsection{Islands of instability} \label{sub:islands} As can be seen later in Figure~\ref{fig:performance}, the loci of stable points in $\{e_{\mathrm{bin}},a_P/a_{\mathrm{bin}}\}$ parameter space is described not just by a broad curve, which represents the \citet{holman:1999} critical radius, but also numerous ``islands of instability'', to quote the original authors. A machine learning algorithm capable of capturing these islands would lead to a significant improvement in the accuracy of predicting long-term stability versus the simple polynomial form of \citet{holman:1999}. These islands are driven by mean motion resonances, and occur at regular intervals in period ratios going as 2:1, 3:1, 4:1, etc. Due to these resonances, naively using the \citet{holman:1999} stability criterion sometimes misclassifies stability up to a certain distance from $a_{HW99}$. We conducted a quick check for the minimum-sized envelope containing all such misclassifications, finding that it was sufficient to automatically classify areas further than $120\%$ of the $a_{HW99}$ as stable and those interior to $80\%$ of $a_{HW99}$ as unstable. The network was therefore trained on the 600826 samples that fell within the $20\%$ envelope. To accomodate calls to our algorithm which exceed the 20\% region, we simply use an if-statement to assign ``stable'' if above and ``unstable'' if below.
\section{Introduction} Recently high-dimensional array data are intensively studied in connection with data analysis. In these areas of research, high-dimensional data are called tensors. More precisely, a $d$-dimensional datum aligned in an $N_1\times\cdots\times N_d$ high-dimensional box form is called an $N_1\times \cdots\times N_d$ tensor or a $d$-tensor of format $N_1\times\cdots\times N_d$. Let $S$ be a set. The set of $N_1\times\cdots\times N_d$ tensors with entries in $S$ is denoted $S^{N_1\times\cdots\times N_d}$. An element $T\in S^{N_1\times\cdots\times N_d}$ is denoted by $T=(t_{i_1\cdots i_d})_{1\leq j\leq N_j}$ or simply $T=(t_{i_1\cdots i_d})$. The case where $d=2$, $S^{N_1\times N_2}$ is nothing but the set of $N_1\times N_2$ matrices with entries in $S$. If $S$ is a field, the rank of an element $M\in S^{N_1\times N_2}$ is defined in linear algebra. The rank of $M$ is identical with the minimum number $r$ such that $M$ can be expressed as a sum of $r$ rank 1 matrices, where we set empty sum to be zero. Further, a nonzero matrix is rank 1 if and only if it can be expressed as a product of a nonzero column vector and a nonzero row vector. We generalize the notion of rank to the general case by using this characterization of ranks of matrices. Suppose $S$ is a subset of a commutative ring with identity which is closed under addition and multiplication and contains 0 and 1. A nonzero element $T=(t_{i_1\cdots i_d})\in S^{N_1\times\cdots\times N_d}$ is defined to be $S$-rank 1 if there are $\vvv_j=(v_{j1}, \ldots, v_{jN_j})\transpose\in S^{N_j}$ for $1\leq j\leq d$ such that $ t_{i_1\cdots i_d}=\prod_{j=1}^d v_{ji_j} $ for any $(i_1,\ldots, i_d)$. For a general element $T\in S^{N_1\times\cdots\times N_d}$, we define the $S$-rank of $T$ as the minimum number $r$ such that $T$ can be expressed as a sum of $r$ $S$-rank 1 tensors. The $S$-rank of $T$ is denoted $\ranks T$. We attach the prefix ``$S$-'' since the rank depends on $S$. In fact, there is an element of $\RRR^{2\times 2\times 2}$ such that $\rankr T=3$ and $\rankc T=2$. In this paper, we consider the case where $S=\RRRplus\define\{x\in\RRR\mid x\geq0\}$. Since it is important to work in the set of nonnegative real numbers in the statistical point of view, $\RRRplus$-rank is studied by several researchers \cite{all etal,qcl}. They called an element $\RRRplus^{N_1\times\cdots\times N_d}$ a nonnegative tensor and called the $\RRRplus$-rank nonnegative rank. Allman et al. \cite{all etal} showed that under mild condition, nonnegative rank of a nonnegative tensor is identical with its $\RRR$-rank if its $\RRR$-rank is less than or equals to 2. We consider in this paper typical nonnegative ranks of $\RRRplus^{N_1\times \cdots\times N_d}$ (see section \ref{sec:pre} for definition). Suppose that $N_1\leq \cdots\leq N_d$ and set $N=N_1\cdots N_{d-1}$. We show that $r$ is a typical nonnegative rank of nonnegative $N_1\times\cdots\times N_d$ tensors if and only if $r\leq N$ and $r$ is greater than or equals to the minimal typical $\RRR$-rank. In the way of proving this fact, we also show that $N$ is the maximal nonnegative rank of $N_1\times\cdots\times N_d$ nonnegative tensors. \section{Preliminaries} \label{sec:pre} In this section, we fix notation, state definitions and recall some basic facts in order to prepare for the main argument. Let $\FFF$ be the real number field $\RRR$ or the complex number field $\CCC$ and let $n$ be a positive integer. We denote by $\FFF^n$ the vector space of $n$-dimensional column vectors with entries in $\FFF$ and by $\eee_i$ the element of $\FFF^n$ whose $i$-th entry is 1 and other entries are 0. By abuse of notation, we use the same symbol $\eee_i$ to express an element of $\FFF^n$ and $\FFF^m$ even if $n\neq m$. The meaning will be clear from the context. Let $N_1, \ldots, N_d$ be positive integers. Since an element $\FFF^{N_1}\otimes_\FFF\cdots\otimes_\FFF\FFF^{N_d}$ is expressed uniquely as $$ \sum_{i_1=1}^{N_1}\cdots \sum_{i_d=1}^{N_d} t_{i_1\cdots i_d}\eee_{i_1}\otimes\cdots\otimes\eee_{i_d}, $$ we identify $\FFF^{N_1\times\cdots\times N_d}$ and $\FFF^{N_1}\otimes_\FFF\cdots\otimes_\FFF\FFF^{N_d}$ by the correspondence $$ (t_{i_1\cdots i_d})\leftrightarrow \sum_{i_1=1}^{N_1}\cdots \sum_{i_d=1}^{N_d} t_{i_1\cdots i_d}\eee_{i_1}\otimes\cdots\otimes\eee_{i_d}. $$ We introduce the Euclidean topology to $\FFF^{N_1\times\cdots\times N_d}$ by identifying $\FFF^{N_1\times\cdots\times N_d}$ with $\FFF^{N_1\cdots N_d}$. Let $S$ be $\RRRplus\define\{x\in\RRR\mid x>0\}$, $\RRR$ or $\CCC$. We interpret $\FFF=\RRR$ if $S=\RRRplus$ or $S=\RRR$ and $\FFF=\CCC$ if $S=\CCC$ in the rest of this section. We define $$ \Phi_1^S\colon S^{N_1}\times\cdots\times S^{N_d}\to S^{N_1\times\cdots\times N_d} $$ by $\Phi_1^S((v_{11},\ldots,v_{1N_1})\transpose,\ldots, (v_{d1},\ldots,v_{dN_d})\transpose)=(v_{1i_1}\cdots v_{di_d})_{1\leq i_j\leq N_j}$. Further, we define for $r\geq 2$, $\Phi_r^S\colon (S^{N_1}\times\cdots\times S^{N_d})^r\to S^{N_1\times\cdots\times N_d}$ by $\Phi_r^S(a_1,\ldots, a_r)=\Phi_1^S(a_1)+\cdots+\Phi_1^S(a_r)$. We define the $S$-rank of a nonzero element $T$ of $S^{N_1\times\cdots\times N_d}$ is $r$ if $T\in\image \Phi_r^S\setminus\image\Phi_{r-1}^S$, where we interpret $\image\Phi_0^S$ to be the set consists of zero element only, and we define the $S$-rank of the zero element of $S^{N_1\times\cdots\times N_d}$ to be 0. If the set of elements $S^{N_1\times\cdots\times N_d}$ whose $S$-rank is $r$ contains a nonempty Euclidean open subset of $\FFF^{N_1\times\cdots\times N_d}$, we say that $r$ is a typical $S$-rank of $N_1\times\cdots\times N_d$ tensors. It is known that there exists a unique typical $\CCC$-rank of $N_1\times\cdots\times N_d$ tensors over $\CCC$ which is called the generic rank of $N_1\times\cdots\times N_d$ tensors over $\CCC$ and is denoted $\grank_\CCC(N_1,\ldots,N_d)$. Further, it is known that the generic rank of $N_1\times\cdots\times N_d$ tensors over $\CCC$ is identical with the minimal typical $\RRR$-rank of $N_1\times\cdots\times N_d$ tensors. See \cite[Theorem 2]{bt} or \cite[Chapter 6]{book}. In this paper, we consider the case where $S=\RRRplus$. In this case an element of $S^{N_1\times\cdots\times N_d}$ is called a nonnegative tensor of format $N_1\times\cdots\times N_d$ or an $N_1\times\cdots\times N_d$ nonnegative tensor, an $S$-rank is called a nonnegative rank and a typical $S$-rank is called a typical nonnegative rank. In the case where $d=2$, i.e. the matrix case is studied extensively as a nonnegative matrix factorization. \begin{example}\rm The matrix $ \begin{pmatrix}1&0&1&0\\ 0&1&0&1\\ 1&0&0&1\\ 0&1&1&0 \end{pmatrix} $ has $\RRR$-rank 3 and nonnegative rank 4. In fact, the column vectors of this matrix span the convex polyhedral cone $\{(x_1,x_2,x_3,x_4)\transpose\in\RRRplus\mid x_1+x_2-x_3-x_4=0\}$. See \cite[Example 3.6]{sta}. \end{example} \section{Main result} In this section, we study maximal and typical nonnegative ranks of $N_1\times\cdots\times N_d$ nonnegative tensors with $N_1\leq\cdots\leq N_d$. Set $N=N_1\cdots N_{d-1}$. First we state the following upper bound of nonnegative ranks of nonnegative tensors of format $N_1\times\cdots\times N_d$. \begin{lemma} \label{lem:u bound} Let $T$ be a nonnegative tensor of format $N_1\times\cdots\times N_d$. Then $\nnrank T\leq N$. \end{lemma} \begin{proof} Set $T=(t_{i_1\cdots i_d})$. Then $$ T=\sum_{i_1=1}^{N_1}\cdots\sum_{i_{d-1}=1}^{N_{d-1}}\eee_{i_1}\otimes\cdots\otimes\eee_{i_{d-1}} \otimes(t_{i_1\cdots i_{d-1}1}, \ldots, t_{i_1\cdots i_{d-1} N_d})\transpose. $$ Thus, $\nnrank T\leq N$. \end{proof} Next we show the following. \begin{lemma} \label{lem:max trank} $N$ is a typical nonnegative rank of nonnegative tensors of format $N_1\times\cdots\times N_d$. \end{lemma} \begin{proof} Set $I=\{(i_1,\ldots, i_d)\mid 1\leq i_j\leq N_j$ for $1\leq j\leq d$ and $i_1+\cdots+i_d\equiv 0\pmod {N_d}\}$. Then $\#I=N$. Set also $ T_0=\sum_{(i_1,\ldots,i_d)\in I}\eee_{i_1}\otimes\cdots\otimes \eee_{i_d} $ and $\epsilon=\frac{1}{3N}$. We show that if $T\in\RRRplus^{N_1\times\cdots\times N_d}$ and $||T-T_0||<\epsilon$, then $\nnrank T=N$, where $||T-T_0||$ denotes the Euclidean norm. Assume the contrary and set $r=\nnrank T$. Then by Lemma \ref{lem:u bound}, we see that $r<N$. Further set $ T=\sum_{k=1}^r \aaa_{1k}\otimes\cdots\otimes\aaa_{dk} $, where $\aaa_{jk}\in\RRRplus^{N_j}$ for any $1\leq j\leq d$ and $1\leq k\leq r$. Set $\aaa_{jk}=(a_{jk1}, \ldots, a_{jkN_j})\transpose$ and for $(i_1,\ldots, i_d)\in I$, we set $$ K_{(i_1,\ldots, i_d)}\define\{k\mid 1\leq k\leq r,\ a_{jkl}<a_{jk i_j} \mbox{ for any $1\leq j\leq d$ and $l\neq i_j$.}\} $$ It is clear that if $(i_1,\ldots, i_d)\neq(\imath'_1,\ldots,\imath'_d)$, then $K_{(i_1,\ldots, i_d)}\cap K_{(\imath'_1,\ldots,\imath'_d)}=\emptyset$. Suppose that $(i_1,\ldots, i_d)\in I$ and $k_0\not\in K_{(i_1,\ldots,i_d)}$. Then there are $j$ and $l$ with $i_j\neq l$ and $a_{jk_0 l}\geq a_{jk_0i_j}$. Since $(i_1,\ldots, i_{j-1},l,i_{j+1},\ldots,i_d)\not\in I$ by the definition of $I$, we see that $(i_1,\ldots,i_{j-1}, l,i_{j+1},\ldots i_d)$ entry of $T_0$ is 0. Thus, $(i_1,\ldots,i_{j-1}, l,i_{j+1},\ldots i_d)$ entry of $T$ is less than $\epsilon$. Therefore, $$ a_{1k_0i_1}\cdots a_{jk_0i_j}\cdots a_{dk_0i_d}\leq a_{1k_0i_1}\cdots a_{jk_0 l}\cdots a_{dk_0i_d}<\epsilon, $$ since $a_{jki}\geq 0$ for any $j$, $k$ and $i$. Set $T'=\sum_{k\not\in K_{(i_1,\ldots, i_d)}}\aaa_{1k}\otimes\cdots\otimes \aaa_{dk}$. Then, by the above argument, we see that the $(i_1,\ldots, i_d)$ entry of $T'$ is less than $\epsilon(r-\#K_{(i_1,\ldots, i_d)})<\epsilon N$. On the other hand, since $(i_1, \ldots, i_d)$ entry of $T_0$ is 1, and $||T-T_0||<\epsilon$, we see that $(i_1, \ldots, i_d)$ entry of $T$ is greater than $1-\epsilon$. Since $\epsilon=\frac{1}{3N}$, we see that $1-\epsilon>\epsilon N$ and therefore, $T\neq T'$, i.e. $K_{(i_1,\ldots, i_d)}\neq\emptyset$. Thus, we see that $N=\#I\leq r$ since $K_{(i_1,\ldots, i_d)}\cap K_{(\imath'_1,\ldots,\imath'_d)}=\emptyset$ if $(i_1,\ldots, i_d)\neq(\imath'_1,\ldots,\imath'_d)$. This contradicts to the assumption that $r<N$. \end{proof} By Lemmas \ref{lem:u bound} and \ref{lem:max trank}, we see the following fact. \begin{thm} \label{thm:max nn rank} The maximal nonnegative rank of nonnegative tensors of format $N_1\times\cdots\times N_d$ is $N$. \end{thm} Next we consider the set of typical nonnegative ranks of nonnegative tensors of format $N_1\times\cdots\times N_d$. First we recall the following fact. \begin{lemma}[{see e.g. \cite[Chapter 6]{book}}] \label{lem:g than grank} An integer $r$ is greater than or equals to $\grank_\CCC(N_1,\ldots,N_d)$ if and only if the Jacobian of $\Phi_r^\CCC$ is row full rank for some $(a_1,\ldots,a_r)\in(\CCC^{N_1}\times\cdots\times\CCC^{N_d})^r$. In particular, if $r\geq\grank_\CCC(N_1,\ldots,N_d)$, then there is a nonzero maximal minor of Jacobian of $\Phi_r^\CCC$ as a polynomial. \end{lemma} Note that every Jacobian of $\Phi_r^\CCC$ as a polynomial is a polynomial with coefficients in $\ZZZ$. We also note the following basic fact. \begin{lemma} \label{lem:inf domain} Let $R$ be an integral domain, $X_1$, \ldots, $X_n$ indeterminates and $A_1$, \ldots, $A_n$ infinite subsets of $R$. Then for any nonzero polynomial $f\in R[X_1,\ldots, X_n]$, there are $a_1$, \ldots, $a_n$ with $a_j\in A_j$ for $1\leq j\leq n$ such that $f(a_1,\ldots, a_n)\neq 0$. \end{lemma} The following fact is easily verified. \begin{lemma} \label{lem:sum rank} Let $T$ be a nonnegative tensor with nonnegative rank $s$. Suppose $ T=T_1+\cdots+T_s $ with $\nnrank T_j=1$ for $1\leq j\leq s$, then $$ \nnrank (T_1+\cdots+T_r)=r $$ for any $1\leq r\leq s$. \end{lemma} We also note the following fact. \begin{lemma} \label{lem:g than min} Let $r$ be a typical nonnegative rank of nonnegative tensors of format $N_1\times\cdots\times N_d$. Then $r\geq\min(\trank_\RRR(N_1,\ldots,N_d))$. \end{lemma} \begin{proof} By the definition of typical nonnegative rank, there is a nonempty Euclidean open subset $U$ of $\RRRplus^{N_1\times\cdots\times N_d}$ such that $\nnrank T=r$ for any $T\in U$. Since $\rankr T\leq\nnrank T$, $U$ consists of tensors whose $\RRR$-rank is less than or equals to $r$. Therefore, $r\geq\min(\trank_\RRR(N_1,\ldots,N_d))$. \end{proof} Now we state the following. \begin{thm} \label{thm:t rank range} The set of typical nonnegative ranks of nonnegative tensors of format $N_1\times\cdots\times N_d$ is $ \{r\mid r\in\ZZZ, \grank_\CCC(N_1,\ldots, N_d)\leq r\leq N\}$. \end{thm} \begin{proof} Let $r$ be a typical nonnegative rank of nonnegative tensors of format $N_1\times\cdots\times N_d$. By Lemma \ref{lem:u bound}, we see that $r\leq N$. Further, by Lemma \ref{lem:g than min}, $r\geq\min(\trank_\RRR(N_1,\ldots, N_d))=\grank_\CCC(N_1,\ldots, N_d)$. Conversely assume that $\grank_\CCC(N_1,\ldots, N_d)\leq r \leq N$. By Lemma \ref{lem:g than grank}, we see that there is a maximal minor $f$ of the Jacobian of $\Phi_r^\CCC$ which is nonzero as a polynomial. Since $N$ is a typical nonnegative rank of nonnegative tensors of format $N_1\times\cdots\times N_d$, we see that there is a Euclidean open subset $\msOOO$ of $\RRRplus^{N_1\times\cdots\times N_d}$ such that $\nnrank T=N$ for any $T\in\msOOO$. Since $$ \Phi_N^\RRRplusb\colon(\RRRplus^{N_1}\times\cdots\times\RRRplus^{N_d})^N \to \RRRplus^{N_1\times\cdots\times N_d} $$ is continuous and identical with $$ (\RRRplus^{N_1}\times\cdots\times\RRRplus^{N_d})^r \times (\RRRplus^{N_1}\times\cdots\times\RRRplus^{N_d})^{N-r} \to \RRRplus^{N_1\times\cdots\times N_d}, $$ $(A_1,A_2)\mapsto \Phi_r^\RRRplusb(A_1)+\Phi_{N-r}^\RRRplusb(A_2)$, we see that there are open subsets $U_1$ of $(\RRRplus^{N_1}\times\cdots\times\RRRplus^{N_d})^r$ and $U_2$ of $(\RRRplus^{N_1}\times\cdots\times\RRRplus^{N_d})^{N-r}$ such that $\Phi_r^\RRRplusb(U_1)+\Phi_{N-r}^\RRRplusb(U_2)\subset\msOOO$. By Lemma \ref{lem:inf domain}, we see that there exists $A_1\in U_1$ such that $f(A_1)\neq 0$. Therefore, by the inverse function theorem, we see that $\image \Phi_r^\RRRplusb(U_1)$ contains an open neighborhood $\msOOO'$ of $\Phi_r^\RRRplusb(A_1)$. On the other hand, by Lemma \ref{lem:sum rank}, we see that every element of $\image \Phi_r^\RRRplusb(U_1)$ has nonnegative rank $r$. Thus, we see that every element of $\msOOO'$ has nonnegative rank $r$. Therefore, $r$ is a typical nonnegative rank. \end{proof} \begin{remark} \rm The fact that the set of typical nonnegative ranks form a consecutive integers can also be proved along the same line with \cite[Theorem 2.2]{bbo}. \end{remark}
\subsection*{Acknowledgements} Synthesis, characterization, and analysis were supported with funding from the Department of Energy Office of Basic Energy Sciences under award number DE-FG02-06ER46327. The theoretical input of A.L. was supported by NSF CAREER Grant No. DMR-1653661. We thank Art Hebard for helpful discussions and Jim Langyel for assistance with x-ray diffraction. \subsection*{Supplementary Information: Materials and Methods} \textit{Target preparation}. Targets of Ba(Pb$_{1-x}$Bi$_x$)$_y$O$_3$ were prepared from starting powders of Ba(NO$_3$)$_2$, PbO, and Bi$_2$O$_3$, with excess Pb and Bi in order to compensate for the relatively high vapor pressures of lead and bismuth oxides during sintering and growth. The starting powders were mixed in a planetary mill with zirconia media and isopropyl alcohol then dried overnight. Calcination was performed at 725$^\circ$ C for 24 hours in air followed by another planetary milling step. The resulting powder appeared to be single-phase perovskite within the limits of laboratory XRD. 2'' sputtering targets were formed in a uniaxial press. The green targets were covered top and bottom with excess BPBO powder to limit Pb and Bi volatility then sintered at 850$^\circ$ C for 1 hour in air. Excess Bi/Pb, $y$, was varied from 1 to 1.25, with films $y=1.08$ and below exhibiting poor stability and Bi/Pb deficiency as measured by RBS. Films with $y=1.20$ and above showed depressed superconducting transition temperatures. We therefore selected $y=1.13$. \begin{figure} \centering \includegraphics[width=16cm]{Fig6.pdf} \caption{Reciprocal space maps of BaBiO$_3$. Reciprocal space maps around the 103$_{pc}$ reflection for (a) a fully coherent 4.6 nm thick film on LLO, as well bilayer relaxed films on LLO that are (b) 6.1 nm thick and (c) 12.1 nm thick. A (d) fully relaxed 18.3 nm thick film on STO. }\label{Fig6} \end{figure} \textit{Film growth}. STO substrates (CrysTec GmbH) with single termination were prepared using buffered-HF etches and oxygen anneals. LLO (CrysTec GmbH) substrates were cleaned with acetone, methanol, and isopropyl alcohol, then annealed at 900$^\circ$ C in flowing oxygen for 2 hours, revealing a smooth step-terrace structure with step heights of $\sim$4.2 \AA (see Fig. \ref{Fig4}(b)). Longer and/or higher temperature annealing resulted in the formation of large surface particles, likely resulting from a small fraction of Lu occupying the A-site creating a slightly off-stoichiometric crystal. Films were grown using 90$^\circ$ off-axis RF-magnetron sputtering at substrate temperatures of 525$^\circ$ C in a 200 mTorr, 38:2 Ar:O$_2$ atmosphere with a $\sim$2.4 nm/min growth rate and subsequently cooled to room temperature in 450 Torr oxygen. Higher oxygen partial pressure during growth suppressed the transition temperature. \begin{figure} \centering \includegraphics[width=16cm]{Fig7.pdf} \caption{Extracted structural data from x-ray diffraction. (a) Lattice parameter vs. thickness for films on LLO and STO. The dashed line indicates the bulk $Ibmm$ value. (b) Relative intensity of coherent and relaxed phases on LLO.}\label{Fig7} \end{figure} \textit{Film characterization}. X-ray diffraction was carried out on a Bruker D-8 in order to assess the crystalline quality. Out-of-plane scans used a scintillator point detector while reciprocal space maps were performed in asymmetric, grazing incidence mode with a line detector. Film thickness was measured using x-ray reflectivity. Surface topography was performed with a Bruker AFM. Electrical contacts were made using silver electrodes sputtered through a metal shadow mask in a square Van der Pauw configuration at the corners of the 5 mm $\times$ 5 mm sample. Magnetotransport measurements were performed in a Quantum Design Physical Properties Measurement System helium cryostat from 1.8 K to 300 K with fields up to 1.8 T. \textit{Finkel'stein model for homogeneously disordered films}. For thin homogeneously disordered films, Finkel'stein developed a renormalization-group treatment for the critical temperature $T_c$ suppression from Coulomb interactions (hereafter $k_B=\hbar=1$)~\cite{Finkelstein} \begin{equation}\label{F-Tc} \frac{T_c}{T_{c0}}=\exp(-1/\gamma)\left[\left(1+\frac{\sqrt{t/2}}{\gamma-t/4}\right)\left(1-\frac{\sqrt{t/2}}{\gamma-t/4}\right)^{-1}\right]^{1/\sqrt{2t}} \end{equation} where $\gamma=1/\ln(T_{c0}\tau)$ is a disorder related fitting parameter that depends on the elastic scattering time $\tau$ and unrenormalized bulk transition temperature $T_{c0}$, while $t=e^2R_S/2\pi^2$. The dashed lines in Fig. \ref{Fig3}(c) represent fits to the initial low $R_S$ films and yield an increase in the scattering time $\tau$ by a factor of 3 for films on LLO compared to STO. As alluded in the main text, Eq. \eqref{F-Tc} does not accurately describe our data over the entire range of accessible parameters. This is not entirely surprising as the only parameter in Finkel'stein's model that controls the flow of $T_c$ is dimensionless conductance $t^{-1}$. There are various factors that can affect Eq. \eqref{F-Tc}. The importance of the exchange interaction was explored in a series of studies, most recently in Ref. ~\cite{Burmistrov}. It was shown that the inclusion of a triplet channel coupling constant in the renormalization scheme can have a sizable effect on $T_c$. Furthermore, it was also emphasized that the effect of the Coulomb interaction on $T_c$ is sensitive to the cases of long-range versus short-range interaction models. In particular, in the latter case $T_c$ can be actually boosted to a higher value. More importantly for our experiments, Eq. \eqref{F-Tc} is expected to break down once film thickness $d$ becomes comparable to or greater than the mean free path $d>l$. Indeed, the initial gradual shift of $T_c$ is given by \begin{equation}\label{Tc-ln3} \frac{T_c-T_{c0}}{T_{c0}}=-\frac{t}{6}\ln^3\left(\frac{1}{T_{c0}\tau}\right) \end{equation} which follows from Eq. \eqref{F-Tc} upon expansion over $\sqrt{t}|\gamma^{-1}|\ll1$. However, as pointed out by Finkel'stein~\cite{Finkelstein} for films with $d>l$ the cutoff of renormalization-group flow will become the Thouless energy $E_T=D/d^2$ instead of $\tau^{-1}$. As a result, for thicker films one expects the initial shift of $T_c$ to be given by \begin{equation}\label{Tc-ln3-2} \frac{T_c-T_{c0}}{T_{c0}}=-\frac{1}{4(k_Fd)(k_Fl)}\ln^3\left(\frac{E_T}{T_{c0}}\right) \end{equation} instead of Eq. \eqref{Tc-ln3}, where we also used proper expression for the dimensionless conductance of a 3D film $t^{-1}=(2/3)(k_Fd)(k_Fl)$. As compared to Eq. \eqref{Tc-ln3} this result yields much weaker $T_c$ suppression as the logarithm contains an extra smallness in a parameter $l/d\ll1$ as $\ln\frac{E_T}{T_{c0}}=\ln\frac{(l/d)^2}{T_{c0}\tau}$, which practically reduces the effect by an order of magnitude because of its cubic dependence in Eq. \eqref{Tc-ln3-2}. In this regime one may be interested in considering other possible corrections to $T_c$ which are beyond the renormalization group treatment. In particular, electron-electron scattering with large momentum transfer, $\sim k_F$, may be important as renormalization group analysis that gives Eq. \eqref{F-Tc} captures only processes with typical momentum transfer of order $l^{-1}$. We are unaware of a detailed theory in this regime, but an estimate of these localizing corrections to $T_c$ gives $[T_c-T_{c0}]/T_{c0}\propto-1/(k_Fl)$ which is independent of $k_Fd\gg1$ (still assumes $k_Fl>1$) and thus can dominate over Eq. \eqref{Tc-ln3-2} for thick films. \begin{figure} \centering \includegraphics[width=16cm]{Fig8.pdf} \caption{Fluctuation-induced and weak-localization fits to the 8.2 nm BPBO on STO sample shown in Fig. \ref{Fig5}(b). Field sweeps at (a) 10 K with fit parameters of $\tau_i =3.4\cdot10^{-12}$ s and $\tau_{WL} =1.6\cdot10^{-12}$ s; (b) 12 K with fit parameters of $\tau_i =2.8\cdot 10^{-12}$ s and $\tau_{WL} =1.5\cdot10^{-12}$ s; (c) 15 K with fit parameters of $\tau_i =1.0\cdot10^{-14}$ s and $\tau_{WL} =5.5\cdot10^{-13}$ s; and (d) 20 K with fit parameters of $\tau_i =1.0\cdot10^{-15}$ s and $\tau_{WL} =6.3\cdot10^{-13}$ s.}\label{Fig8} \end{figure} \textit{Fluctuations and magnetoresistance}. Gaussian fluctuations of Cooper pairs above $T_c$ are described by Aslamazov-Larkin (AL) and lead to a decrease in the resistance due to fluctuating short-circuits. The density-of-state (DOS) term arises from the reduction in the one-particle DOS when pairing occurs and increases the normal electron resistivity. The coherent scattering of pairs leads to the Maki-Thompson (MT) interference contribution. Finally, weak localization (WL) can contribute to the observed magnetoresistance (MR) and takes a similar form as the MT contributions. The total MR is then the sum of these terms. For thin disordered superconductors the fluctuation magnetoresistance contributions away from $T_c$ and at relatively weak fields are as follows \cite{Larkin-Book,Bergmann,Gordon,Shinozaki,Giannouri,Varlamov,Schwiete,AL,Rosenbaum}: \begin{align} &\frac{\delta R^{AL}_S(H,T)}{R^2_S}=-\frac{\pi G_Q}{\ln(T/T_c)}\left[\left(\frac{H_T}{H}\right)^2\left[\psi\left(\frac{1}{2}+\frac{H_T}{H}\right)-\psi\left(1+\frac{H_T}{H}\right)+\frac{H}{2H_T}\right]-\frac{1}{8}\right], \\ &\frac{\delta R^{MR}_S(H,T)}{R^2_S}=G_QA_{a}\left[\ln\left(\frac{H}{H_a}\right)+\psi\left(\frac{1}{2}+\frac{H_a}{H}\right)\right], \quad a=\{\mathrm{MT,DOS,WL}\} \end{align} where $G_Q=e^2/(2\pi)$, $H_T=(2T/\pi eD)\ln(T/T_c)$, and $\psi(x)$ is the digamma function. In the case of MR from MT, DOS, and WL contributions they all have the same functional form as governed by the function $\ln(x)+\psi(1/2+1/x)$ albeit with different amplitude factor $A_a$, and are sensitive to a different crossover field $H_a$. For the MT and WL cases the crossover field is determined by the dephasing processes, $H_{\mathrm{MT,WL}}=(4eD\tau_\phi)^{-1}$, where $\tau_\phi$ is the electron phase-breaking time, which is in general different for WL and MT contributions, see discussion in Ref.~[\onlinecite{Larkin-Book}] and references therein. For WL the Coulomb interaction leads to $\tau^{-1}_{\phi}\simeq T(R_SG_Q)\ln(1/R_SG_Q)$, however, interactions in the Cooper channel are also important. Very close to $T_c$ the Cooper channel gives a similar contribution to $\tau_\phi$, without a logarithmic factor, but with the bigger numerical pre-factor, while further away from $T_c$ dephasing from electron-fluctuation interactions is suppressed $\tau^{-1}_\phi\simeq T(R_SG_Q)\ln(1/T\tau)/\ln^2(T/T_c)$. Regularization of MT contribution is a subtler problem, which is dominated by the interactions in the Cooper channel and can be roughly estimated by $\tau^{-1}_\phi\simeq T\sqrt{R_SG_Q}$, which is parametrically distinct from the dephasing time of the WL term. Finally, in the case of the DOS term, the crossover field is $H_{\mathrm{DOS}}=H_T$. The amplitude factors are as follows: $A_{\mathrm{MT}}=\frac{1}{\pi}\beta(T/T_c)$, where $\beta$ is the Larkin's electron-electron interaction strength parameter in the Cooper channel. This function is tabulated and has following limiting behavior: $\beta=\pi^2/(6\ln^2(T/T_c))$ for $\ln(T/T_c)\gg1$ and $\beta=\pi^2/(4\ln(T/T_c))$ for $\ln(T/T_c)\ll1$. The WL and DOS terms in MR have an opposite sign, namely $A_{\mathrm{WL}}=-\alpha_{\mathrm{SO}}/\pi$, where $\alpha_{\mathrm{SO}}$ is the dimensionless parameter of the strength of spin-orbit interaction, and $A_{\mathrm{DOS}}=-28\zeta(3)/\pi^3$. The diffusion coefficient $D$ is calculated from the slope of the upper critical field $D=-(4/\pi e)(dH_{c2}/dT)^{-1}_{T_c}$ and the transition temperature $T_c$ is taken to be the 50\% of the normal state value in resistivity measurements. This leaves the scattering times, $\tau_\phi$, and spin-orbit interaction constant, $\alpha_{\mathrm{SO}}$, as the fitting parameters. For all films $\alpha_{\mathrm{SO}}$ fits to the limiting case of $\alpha_{\mathrm{SO}}=1$, consistent with weak localization and small spin-orbit interaction with scattering impurities. Fig. \ref{Fig8} shows example fits for an 8.2 nm BPBO film on STO.
\section{Introduction} Analytical modeling and approximated fast simulation are essential to explore the large parameter space and complicated history of reionization. As the large scale ionization field is closely correlated with the underlying density fluctuations (\cite[Battaglia et al. 2013]{2013ApJ...776...81B}), the excursion set theory(\cite[Bond et al. 1991]{1991ApJ...379..440B}; \cite[Lacey \& Cole 1993]{1993MNRAS.262..627L}) which give an intuitive description of the structure formation process are therefore also applied to the modeling of reionization process. In the ``bubble model'' (\cite[Furlanetto et al. 2004]{2004ApJ...613....1F}) the criterion of a region being ionized is translated to a density barrier, and the mass distribution of large ionized regions (``bubbles'') is obtained by computing the first up-crossing distribution of random trajectories with respect to this bubble barrier. Semi-numerical simulations of the reionization process were also developed, which is much faster than radiative transfer simulations(e.g. \cite[Zahn et al. 2007]{2007ApJ...654...12Z}; \cite[Mesinger \& Furlanetto 2007]{2007ApJ...669..663M}; \cite[Mesinger et al. 2011]{2011MNRAS.411..955M}). In the bubble model, the ionized regions during the early stage of EoR are assumed to be isolated and spherical. After the percolation of the HII regions, however, these basic assumptions are no longer valid, and the non-local source of ionizing photons must be accounted. In order to give a better description of the late stage of EoR, we proposed to consider the evolution of large-scale neutral regions (``islands'') which become isolated after percolation of ionized regions (\cite[Xu et al. 2014]{2014ApJ...781...97X}). The island model accounts for the ionizing background that is inevitable after percolation, and identifies neutral islands in the excursion set framework with first down-crossings of the island density barrier. Based on the island model, a semi-numerical code, {\tt islandFAST}, is developed to make fast simulation of the evolution of the three-dimensional ionization field during the late EoR (\cite[Xu et al. 2017]{2017ApJ...844..117X}). It predicts the evolution of the ionization field as well as the ionizing background during the late stage of EoR. Here we present the basic idea and main results of the analytical and semi-numerical models. \section{The Island Model} In the island model, a region remains neutral if the available number of ionizing photons, either produced inside or outside, is not enough to ionize all hydrogen atoms in the region. The condition for island formation consists of two terms: \begin{equation}\label{Eq.IslandCondition} \xi f_{\rm coll}(\delta_{\rm M}; M,z)+ \frac{\Omega_m}{\Omega_b} \frac{N_{\rm back} m_{\rm H} } {M X_{\rm H} (1+\bar{n}_{\rm rec})} < 1, \end{equation} where the first term on the L.H.S. accounts for the ionizing photons produced by collapsed objects inside, and the second term accounts for the contribution by the ionizing background around it. $\zeta$ is the ionizing efficiency parameter, $f_{\rm coll}$ is the collapsed fraction, and $N_{\rm back}$ is the number of consumed background ionizing photons. Assuming Gaussian density fluctuations, this condition can be written as a constraint on the density contrast of the region, i.e. the {\it island barrier}. Assuming spherical islands, and that the consumption rate of background ionizing photons is proportional to their surface area, we derive the basic island barrier shown with green curves in the left panel of Fig.\,\ref{fig1}. Different from the bubble barrier, the island barrier bends down at small scales because of the ionizing background. One can derive the mass distribution and the volume fraction of neutral regions by solving for the first-{\it down}-crossing distribution of random trajectories with respect to the island barrier. Note that there is a ``bubbles-in-island'' effect, as there might be self-ionized regions inside a host island. The distribution of bubbles inside islands are obtained by computing the conditional probability distribution of the trajectories. The average bubbles-in-island fraction can be derived by integrating over all possible bubble sizes for a given island, and this fraction is limited by a percolation threshold $p_c$ in order to define the bona fide islands, in the sense that an island is not percolated through by bubbles inside. This percolation criterion of $q_{\rm B} < p_c$ acts as an additional barrier for finding islands (plotted with the red curves in the left panel of Fig.\,\ref{fig1}), which combines with the basic island barrier to define the host islands. The percolation threshold also demarcates the scope of application of both bubble model and island model. The bubble model can be reliably applied before bubble filling factor becomes larger than $p_c$, while the island model should be used below the redshift at which the island filling factor equals to $p_c$. With the combined island barrier, the island model predicts the size distribution and evolution of islands after the islands become isolated. As the redshift decreases, small islands disappear rapidly while the large ones shrinks. Eventually, all these under-dense islands are ionized, only compact neutral regions such as galaxies or minihalos remain. \begin{figure*}[t] \vspace*{-0.4 cm} \hspace*{-1.0 cm} \centering{\includegraphics[scale=0.24]{BarriervS_pc.pdf} \hspace*{-0.5 cm} \includegraphics[scale=0.24]{F3_SAM_neutral_LLS_eff30_eff15_512_143_xth050_20.pdf} \hspace*{-0.5 cm} \includegraphics[scale=0.24]{F8_mean_free_path.pdf} \vspace*{-0.4 cm} \hspace*{-1.0 cm} \caption{{\it Left panel:} The basic island barriers (green curves), the percolation threshold induced barriers (red curves), and the effective barriers (black curves). The solid, dashed and dot-dashed curves are for $z=6.9, 6.7$ and 6.5 respectively. {\it Central panel:} The size distribution of neutral islands in the {\tt islandFAST} simulation, with SAM neutral fraction threshold $f_{\rm HI}^c = 0.5$. The thick and thin lines are for $\zeta = 30$ and 15 respectively. The solid, dashed, and dot-dashed curves correspond to mean neutral fractions $x_{\rm HI}$ as indicated in the legend. {\it Right panel:} The evolution of the MFP of ionizing photons ({\it solid lines}). The dashed lines show the MFP due to neutral islands, while the dot-dashed line is the MFP due to small absorbers only. The thick lines are from the simulation with $\zeta = 20$, and the thin lines are for $\zeta = 15$.} \label{fig1} } \end{figure*} \section{The IslandFAST Model} The semi-numerical simulation {\tt islandFAST} is developed from the {\tt 21cmFAST} (\cite[Mesinger et al. 2011]{2011MNRAS.411..955M}), but extended to treat the late EoR by the island model (see \cite[Xu et al. (2017)]{2017ApJ...844..117X} for details). Compared with the {\tt 21cmFAST}, the major differences of the {\tt islandFAST} are the two-step filtering algorithm in generating the ionization field in order to take bubbles-in-island effect into account, and the self-consistent treatment for the ionizing background accounting for various absorption systems. The mean free path of ionizing photons and the corresponding intensity of the ionizing background is obtained by an iterative procedure. Adaptive redshift steps are applied in order to achieve convergence in the ionization field and the intensity of the ionizing background. \begin{figure}[t] \vspace*{-0.4 cm} \hspace*{-1.5 cm} \centering{\includegraphics[scale=0.37]{box512_286Mpc_3z.pdf} \vspace*{-1.5 cm} \hspace*{-1.0 cm} \caption{The 3-dimensional visualization of the ionization fields from the {\tt islandFAST} with a box size of $200\, {\rm h}^{-1} {\rm Mpc}$, $512^3$ resolution, and $\zeta = 20$. The neutral islands are shown as black patches, and the ionized regions are left white. The three boxes have the mean neutral fractions of 0.16, 0.10, and 0.014, from left to right respectively.} \label{fig2} } \end{figure} We find that the late reionization proceeds very fast, and the bubbles-in-island effect is quite obvious, showing complex morphology of the ionization field (Fig.~\ref{fig2}). In the central panel of Fig.~\ref{fig1} we show the comoving size distributions of neutral islands for various global neutral fraction. We find a characteristic scale of $\sim 10$ Mpc for the neutral islands at each redshift. This scale decreases very slowly as the islands being ionized. Judging from the simulation box, this is perhaps because the neutral islands have very complex shape, and using the spherical average method (SAM) to identify islands tend to divide a large island into pieces. As the reionization proceeds, the larger islands gradually break into smaller ones that would be identified as similar sizes by the SAM. Also, the large islands shrink gradually, and partially compensates for the disappearance of the smaller islands. While generating the ionization field, the {\tt islandFAST} simultaneously predicts the level of the ionizing background. We find that a higher ionizing efficiency would lead to earlier growth and higher intensity of the ionizing background. The intensity of the ionizing background is boosted by an order of magnitude if we neglect small absorbers, resulting in a much faster completion of reionization. Similar trends are seen in the evolution of the mean free path (MFP) of the ionizing photons as shown in the right panel of Fig.~\ref{fig1}. The MFP due to the under-dense islands alone, $\lambda_{\rm I}$, and that limited by over-dense absorbers, $\lambda_{\rm abs}$, are also shown. We find that the MFP are mainly limited by the small-scale absorbers, and the shading effect of the large-scale islands only reduce the MFP moderately during the late EoR. Therefore, the level of the ionizing background is primarily regulated by small-scale absorbers, and they significantly delay and prolong the reionization process. \section{Summary} We have developed the island model--an analytical model of reionization using the excursion set approach, and the corresponding semi-numerical simulation, {\tt islandFAST}, for the evolution of isolated neutral regions after the percolation of ionized bubbles, complementary to the bubble model for the early reionization epoch. As the case of bubble model, although the excursion set model uses spherical window function for computing the mean density at different scales, the model can and does produce complicated reionization topology. Our model incorporated the effect of ionizing background photons and accounted for the bubbles-in-island effect. A percolation threshold is introduced to demarcate the scope of application for the island model and the bubble model, and also to define the bona fide islands. Given a model for the small-scale absorbers, the {\tt islandFAST} generates the ionization field after percolation, and simultaneously predicts the intensity of the ionizing background. The late reionization proceeds quite fast. As the large islands shrink with time, the small ones are swamped by the ionizing photons. If characterized by the SAM with a high neutral fraction threshold, the islands exhibits a relatively robust characteristic scale of $\sim 10$ Mpc throughout the late EoR. We find that the large-scale islands dominate the morphology of the ionization field, while the small scale absorbers dominate the opacity of the IGM, and play a major rule in determining the level of the ionizing background and the speed of reionization process. With the advent of next generation EoR experiment, reionization models will be put to rigorous tests, and the late state is of particular interest as it might be observationally more accessible. We expect these models would be helpful for interpreting such observations. {\bf Acknowledgements} YX is supported by the NSFC grant 11303034, and the Young Researcher Grant of National Astronomical Observatories, CAS. BY is supported by the NSFC grant 11653003 and CAS Pioneer Hundred Talents (Young Talents) Program. XC is supported by the MoST grant 2016YFE0100300 and 2012AA121701, the NSFC key project grant 11633004 and grant 11373030, the CAS Frontier Science Key Project QYZDJ-SSW-SLH017, and Strategic Priority Research Program XDB09020301. We thank our collaborators Meng Su and Zuhui Fan with whom the first part of the work was done. We thank the organizers of the IAUS 333 for a successful and productive conference.
\section{Introduction} Supersymmetry (SUSY)~\cite{Ramond:1971gb,Golfand:1971iw,Neveu:1971rx,Volkov:1972jx,Wess:1973kz,Wess:1974tw,Fayet:1974pd,Nilles:1983ge} is an extension of the standard model (SM) of particle physics. It posits a new symmetry such that for each boson (fermion) in the SM, there exists a fermionic (bosonic) superpartner. Supersymmetry can potentially address several of the open questions in particle physics, including the hierarchy problem~\cite{Dimopoulos:1995mi,Barbieri:2009ev,Papucci:2011wy} and the unification of the gauge couplings at high energy scales~\cite{Buras:1977yy,Haber:1984rc}. If $R$-parity~\cite{Farrar:1978xj} is conserved, the lightest SUSY particle (LSP) is stable and could be a potential dark matter candidate~\cite{Goldberg:1983nd,Ellis:1983ew}. This paper focuses on searches for electroweak production of SUSY particles, under the assumption that the strongly-coupled SUSY particles are too massive to be directly produced. The superpartners of the bosons from the SM SU(2) and U(1) gauge fields before electroweak symmetry breaking are denoted as the winos and bino, respectively. We consider SUSY models assuming two complex Higgs doublets, and the superpartners of the Higgs bosons are denoted as higgsinos. The bino, winos, and higgsinos form mass eigenstates of two charginos (\PSGcpm) and four neutralinos (\PSGcz) and in general can mix among one another. In this paper, we focus on the lightest neutralino (\PSGczDo), the next-to-lightest neutralino (\PSGczDt), and the lightest chargino (\PSGcpmDo). If the superpartners of the SM leptons, the sleptons, are much heavier than the charginos and neutralinos, decays of the charginos and neutralinos proceed through the \PW, \PZ, and Higgs bosons. The branching fractions of neutralinos to the \PZ{} and Higgs bosons depend on the mixing among the bino, winos, and higgsinos to form mass eigenstates. Searches performed at LEP exclude promptly-decaying charginos below a mass of 103.5\GeV~\cite{lepsusy}. At the LHC, several searches have been performed by the ATLAS~\cite{atlassos,Aad:2015eda,Aad:2015hea,Aad:2015qfa,Aad:2015jqa,ATLAS:2014fka,Aad:2014gfa,Aad:2014yka,Aad:2014iza,Aad:2014vma,Aad:2014nua,Aad:2013yna} and CMS~\cite{Khachatryan:2014qwa,Khachatryan:2014mma,Khachatryan:2016hns,Khachatryan:2015pot,CMS:2015loa,Khachatryan:2016trj,Chatrchyan2013,Chatrchyan2015,ewkino2016,sos,razorhgg,hh4b,onz,wh1l} Collaborations looking for direct production of charginos and neutralinos. Given the various possible decay modes, a SUSY signal could simultaneously populate multiple final states. This paper implements a statistical combination of the searches performed by CMS in Refs.~\cite{ewkino2016,sos,razorhgg,hh4b,onz,wh1l} covering several final states to improve upon the sensitivity of the individual analyses, particularly in models where the neutralino has a nonzero branching fraction to both \PZ{} and Higgs bosons. In addition, we present an extension of a search selecting events with three or more charged leptons~\cite{ewkino2016}. It targets the difficult region of phase space where the difference in mass between the \PSGczDt and \PSGczDo is approximately equal to the \PZ{} boson mass, and the signal has similar kinematic properties to the dominant background of SM \ensuremath{\PW\PZ}\xspace production. All searches use a data sample of LHC proton-proton collisions at $\sqrt{s} = 13\TeV$ collected by the CMS experiment in 2016, corresponding to an integrated luminosity of 35.9\fbinv. \section{Signal models} \label{sec:sigs} Simplified models of SUSY~\cite{bib-sms-2,bib-sms-3,bib-sms-4,Chatrchyan:2013sza} are used to interpret the combined search results presented below. In this paper, ``\PH'' refers to the 125\GeV scalar boson~\cite{Khachatryan:2016vau}, interpreted as the lightest CP-even state of an extended Higgs sector. The \PH{} boson is expected to have SM-like properties if all of the other Higgs bosons are much heavier~\cite{Martin:1997ns}. All signal models considered involve the production of two bosons (\PW, \PZ, or \PH) through SUSY decays, and we denote each model by the specific bosons produced. The \PW, \PZ, and \PH{} bosons are always assumed to decay according to their SM branching fractions. The sleptons are always assumed to have much higher masses than the charginos and neutralinos such that they do not contribute to the interactions. The first class of models assumes $\PSGcpmDo\PSGczDt$ production. The \PSGczDo is assumed to be the LSP. The \PSGcpmDo always decays to the \PW{} boson and the \PSGczDo, while the \PSGczDt can decay to either of the \PZ{} or \PH{} bosons plus the \PSGczDo. We consider three choices for the \PSGczDt\ decay: a branching fraction of 100\% to $\PZ\PSGczDo$ (\ensuremath{\PW\PZ}\xspace topology), of 100\% to $\PH\PSGczDo$ (\ensuremath{\PW\PH}\xspace topology), and of 50\% to each of these two decays (mixed topology). This model is depicted in Fig.~\ref{fig:c1n2}, showing the two possible decays. The production cross sections are computed in the limit of mass-degenerate winos \PSGcpmDo and \PSGczDt, and light bino \PSGczDo, with all other sparticles assumed to be heavy and decoupled. \begin{figure}[htbp] \centering \includegraphics[width=0.4\textwidth]{Figure_001-a.pdf} \includegraphics[width=0.4\textwidth]{Figure_001-b.pdf} \caption{Production of $\PSGcpmDo\PSGczDt$ with the \PSGcpmDo decaying to a \PW{} boson and the LSP, \PSGczDo, and the \PSGczDt decaying to either (left) a \PZ{} boson and the \PSGczDo or (right) a \PH{} boson and the \PSGczDo. } \label{fig:c1n2} \end{figure} The second class of models assumes $\PSGczDo\firstchi$ production. For bino- or wino-like neutralinos, the neutralino pair production cross section is very small, and thus we consider a specific gauge-mediated SUSY breaking (GMSB) model with quasidegenerate higgsinos as next-to-lightest SUSY particles and an effectively massless gravitino (\PXXSG) as the LSP~\cite{Matchev:1999ft,Meade:2009qv,Ruderman}. In the production of any two of these, \PSGcpmDo or \PSGczDt decays immediately to \PSGczDo and low-momentum particles that do not impact the analysis, effectively yielding pair production of $\PSGczDo\firstchi$. The \PSGczDo then decays to a \PXXSG and either a \PZ{} or \PH{} boson, and we consider varying branching fractions from 100\% decay into the \PZ{} boson to 100\% decay into the \PH{} boson including intermediate values. The possible decays in this model are shown in Fig.~\ref{fig:n1n1}. The production cross sections for the GMSB scenario are computed in a limit of mass-degenerate higgsino states \PSGcpmDo, \PSGczDt, and \PSGczDo, with all the other sparticles assumed to be heavy and decoupled. Following the convention of real mixing matrices and signed neutralino masses~\cite{Skands:2003cj}, we set the sign of the mass of \PSGczDo\ (\PSGczDt) to $+1$ ($-1$). The lightest two neutralino states are defined as symmetric (antisymmetric) combinations of higgsino states by setting the product of the elements $N_{i3}$ and $N_{i4}$ of the neutralino mixing matrix $N$ to $+0.5$ ($-0.5$) for $i = 1$ (2). The elements $U_{12}$ and $V_{12}$ of the chargino mixing matrices $U$ and $V$ are set to 1. \begin{figure}[htbp] \centering \includegraphics[width=0.3\textwidth]{Figure_002-a.pdf} \includegraphics[width=0.3\textwidth]{Figure_002-b.pdf} \includegraphics[width=0.3\textwidth]{Figure_002-c.pdf} \caption{A GMSB model with $\PSGczDo\firstchi$ pair production. The two \PSGczDo particles decay into the \PXXSG LSP and (left) both to \PZ{} bosons, (center) a \PZ{} and a \PH{} boson, or (right) both to \PH{} bosons.} \label{fig:n1n1} \end{figure} Cross section calculations to next-to-leading order (NLO) plus next-to-leading-logarithmic (NLL) accuracy~\cite{Beenakker:1999xh,Fuks:2012qx,Fuks:2013vua,Bozzi:2007tea,Bozzi:2007qr,Bozzi:2006fw} in perturbative quantum chromodynamics (QCD) are used to normalize the signal samples for the results presented in Sections~\ref{sec:newmultilep} and~\ref{sec:interp}. In this section, we present cross sections calculated to NLO accuracy~\cite{Fuks:2013vua} to demonstrate the dependence of the cross section values on assumptions made in decoupling other SUSY particles. The same qualitative conclusions also hold for the NLO+NLL calculations used in the final results. Figure~\ref{fig:xsecs_strongmasses} shows the NLO cross section for $\PSGcpmDo\PSGczDt$ production at $\sqrt{s} = 13\TeV$ assuming mass-degenerate winos \PSGcpmDo and \PSGczDt. The various curves show different assumptions on the masses of squarks (\PSQ) and gluinos (\PSg), as described in the legend. The cross section depends significantly on the masses of the strongly coupled particles until they reach masses of at least 10\TeV. For the range of \PSGcpmDo and \PSGczDt masses considered here, the reduction can make up to 90\% in the cross section value. This is due to large destructive interference effects from $t$-channel diagrams involving squark exchange. The cross section calculation used in the interpretations of the analysis results assumes a mass of 100\TeV for the squarks and gluinos to have them fully decoupled. The obtained results would be less stringent if lower masses were assumed for the squarks and gluinos. We performed the same study for $\PSGcpmDo\PSGczDt$, $\PSGcpmDo\PSGczDo$, \ensuremath{\firstcharg\widetilde{\chi}^{\mp}_{1}}\xspace, and $\PSGczDt\PSGczDo$ production with the assumption of mass-degenerate higgsinos \PSGcpmDo, \PSGczDt, and \PSGczDo. The dependence of the production cross section on the decoupling mass assumption was found to be much smaller in the higgsino case, at most a few percent, and it is small compared to the uncertainty in the cross section calculation. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth]{Figure_003.pdf} \caption{Cross section for $\PSGcpmDo\PSGczDt$ production at $\sqrt{s} = 13\TeV$ versus the wino mass, calculated to NLO accuracy in QCD with \textsc{Resummino}~\cite{Fuks:2013vua}. The \PSGcpmDo and \PSGczDt are assumed to be mass-degenerate winos. The various curves show different assumptions on the masses of the squarks and gluinos, as described in the legend. The green band shows the theoretical uncertainty in the cross section calculation, from the variation of renormalization and factorization scales as well as parton density functions, for the 100\TeV squark and gluino mass assumption. } \label{fig:xsecs_strongmasses} \end{figure} \section{The CMS detector} \label{sec:cmsdetector} The central feature of the CMS apparatus is a superconducting solenoid, 13\unit{m} in length and 6\unit{m} in diameter, that provides an axial magnetic field of 3.8\unit{T}. The bore of the solenoid is outfitted with various particle detection systems. Charged-particle trajectories are measured by silicon pixel and strip trackers, covering $0 < \phi < 2\pi$ in azimuth and $\abs{\eta} < 2.5$, where the pseudorapidity $\eta$ is defined as $-\log [\tan(\theta/2)]$, with $\theta$ being the polar angle of the trajectory of the particle with respect to the clockwise beam direction. A crystal electromagnetic calorimeter (ECAL) and a brass and scintillator hadron calorimeter (HCAL) surround the tracking volume. The calorimeters provide energy and direction measurements of electrons, photons, and hadronic jets. Muons are measured in gas-ionization detectors embedded in the steel flux-return yoke outside the solenoid. The detector is nearly hermetic, allowing for energy balance measurements in the plane transverse to the clockwise beam direction. A two-tier trigger system selects the most interesting $\Pp\Pp$ collision events for use in physics analysis. A more detailed description of the CMS detector, together with a definition of the coordinate system used and the relevant kinematic variables, can be found in Ref.~\cite{Chatrchyan:2008zzk}. \section{Event reconstruction and Monte Carlo simulation} \label{sec:recosamples} Event reconstruction is based on the particle-flow (PF) algorithm~\cite{Sirunyan:2017ulk}, which optimally combines information from the tracker, calorimeters, and muon systems to reconstruct and identify PF candidates, \ie, charged and neutral hadrons, photons, electrons, and muons. To select collision events, we require at least one reconstructed vertex. The reconstructed vertex with the largest value of summed physics-object $\pt^2$ is taken to be the primary $\Pp\Pp$ interaction vertex, where \pt is the transverse momentum with respect to the beam axis. The physics objects are the objects returned by a jet finding algorithm~\cite{antikt,FastJet} applied to all charged tracks associated with the vertex, plus the corresponding associated missing transverse momentum. The missing transverse momentum vector, \ptvecmiss, is defined as the negative vector sum of the momenta of all reconstructed PF candidates projected onto the plane perpendicular to the proton beams. Its magnitude is referred to as \ptmiss. Events with possible contributions from beam halo processes or anomalous noise in the calorimeters can have large values of \ptmiss and are rejected using dedicated filters~\cite{Khachatryan:2014gga}. Electron candidates are reconstructed starting from a cluster of energy deposits in the ECAL. The cluster is then matched to a reconstructed track. The electron selection is based on the shower shape, the ratio of energy measured in the HCAL to that measured in the ECAL, track-cluster matching, and consistency between the cluster energy and the track momentum~\cite{Khachatryan:2015hwa}. Muon candidates are reconstructed by performing a global fit that requires consistent hit patterns in the tracker and the muon system~\cite{MUOART}. Photon candidates are reconstructed from a cluster of energy deposits in the ECAL, and they are required to pass criteria based on the shower shape and the ratio of energy measured in the HCAL to that measured in the ECAL~\cite{Khachatryan:2015hwa}. Hadronically decaying tau lepton candidates (\tauh) are reconstructed from PF candidates with the ``hadron-plus-strips'' algorithm~\cite{Khachatryan:2015dfa}. Electron, muon, photon, and \tauh candidates are required to be isolated from other particles, and electron, muon, and \tauh candidates must satisfy requirements on the transverse and longitudinal impact parameters relative to the primary vertex. PF candidates are clustered to form jets using the anti-\kt clustering algorithm~\cite{antikt} with a distance parameter of 0.4, as implemented in the {\FASTJET} package~\cite{FastJet}. Identification of jets originating from b quarks (b jets) is performed with either the combined secondary vertex (CSVv2) algorithm~\cite{BTV-16-002} or the DeepCSV algorithm~\cite{Guest:2016iqz}. Data events are selected using a variety of triggers requiring the presence of electrons, muons, photons, jets, or \ptmiss, depending on the final state targeted in each analysis. Monte Carlo (MC) simulated samples are used in the various searches to estimate the background from some SM processes, to assess systematic uncertainties in prediction methods that rely on data, and to calculate the selection efficiency for signal models. Most SM background samples are produced with the \MGvATNLO~v2.2.2 or~v2.3.3 generator~\cite{Alwall:2014hca} at leading order (LO) or NLO accuracy in perturbative QCD, including up to four additional partons in the matrix element calculations, depending on the process and calculation order. Other samples are produced with the \POWHEG~v2~\cite{Melia:2011tj,Nason:2013ydw} generator without additional partons in the matrix element calculations. Standard model \ensuremath{\PW\PZ}\xspace production in particular is modeled with \MGvATNLO~v2.2.2 at NLO precision for the search described in Section~\ref{sec:newmultilep}, which requires a precise description of initial-state radiation (ISR). In other cases, \POWHEG~v2 is used. The NNPDF3.0 LO or NLO~\cite{Ball:2014uwa} parton distribution functions (PDFs) are used in the event generation. Parton showering and fragmentation in all of these samples are performed using the \PYTHIA\ v8.212~\cite{Sjostrand:2007gs} generator and the CUETP8M1 tune~\cite{Khachatryan:2015pea}. A double counting of the partons generated with \MGvATNLO\ and those with \PYTHIA\ is removed using the MLM~\cite{Alwall:2007fs} and the \textsc{FxFx}~\cite{Frederix:2012ps} matching schemes, in the LO and NLO samples, respectively. Cross section calculations at NLO or next-to-NLO~\cite{Alwall:2014hca,Alioli:2009jeNew,Re:2010bp,Gavin:2010az,Gavin:2012sy,Czakon:2011xx} are used to normalize the simulated background samples. Signal samples are generated with \MGvATNLO\ at LO precision, including up to two additional partons in the matrix element calculations. Cross section calculations to NLO plus NLL accuracy~\cite{Borschensky:2014cia,Fuks:2012qx,Fuks:2013vua} are used to normalize the signal samples. For these samples we improve on the modeling of ISR, which affects the total transverse momentum of the system of SUSY particles ($\pt^\mathrm{ISR}$), by reweighting the $\pt^\mathrm{ISR}$ distribution in these events. This reweighting procedure is based on experimental studies of the \pt of \PZ{} bosons~\cite{Chatrchyan:2013xna}. The reweighting factors range between 1.18 (at $\pt^\mathrm{ISR} = 125\GeV$) and 0.78 (for $\pt^\mathrm{ISR} > 600\GeV$). We take the deviation from 1.0 as the systematic uncertainty in the reweighting procedure. For both signal and background events, additional simultaneous proton-proton interactions (pileup) are generated with \PYTHIA and superimposed on the hard collisions. The response of the CMS detector for SM background samples is simulated using a \GEANTfour-based model~\cite{Geant}, while that for new physics signals is performed using the CMS fast simulation package~\cite{fastsim}. All simulated events are processed with the same chain of reconstruction programs as used for collision data. Corrections are applied to simulated samples to account for differences between the trigger, b tagging, and lepton and photon selection efficiencies measured in data and the \GEANTfour simulation. Additional differences arising from the fast simulation modeling of selection efficiencies, as well as from the modeling of \ptmiss, are corrected in the fast simulation and included in the systematic uncertainties considered. \section{Individual searches} \label{sec:searches} The experimental searches included in the combination are briefly described here. Table~\ref{tab:searches_models} lists which searches are used to place exclusion limits for each of the topologies introduced in Section~\ref{sec:sigs}. The selections for all searches were checked to be mutually exclusive, such that no events fulfill the signal region requirements for more than one search. No significant deviations from the SM predictions were observed in any of these searches. \begin{table}[htb] \centering \topcaption{\label{tab:searches_models} Summary of all experimental searches considered in the combination (rows), and the signal topologies for which each search is used in the combined results (columns). The searches are described in Sections~\ref{sec:lepbb} through~\ref{sec:hgg} and Section~\ref{sec:newmultilep}. The ${\geq}3\ell$ search described in Section~\ref{sec:oldmultilep} is used for all signal topologies except for \ensuremath{\PW\PZ}\xspace, where the reoptimized search strategy from Section~\ref{sec:newmultilep} is employed instead. } \begin{tabular}{l|ccccc} & \multicolumn{5}{c}{Signal topology} \\ Search & \ensuremath{\PW\PZ}\xspace & \ensuremath{\PW\PH}\xspace & \ensuremath{\PZ\PZ}\xspace & \ensuremath{\PZ\PH}\xspace & \ensuremath{\PH\PH}\xspace \\ \hline $1\ell$ 2\PQb & & \checkmark & & & \\ 4\PQb & & & & & \checkmark \\ $2\ell$ on-\PZ & \checkmark & & \checkmark & \checkmark & \\ $2\ell$ soft & \checkmark & & & & \\ ${\geq}3\ell$ & \checkmark & \checkmark & \checkmark & \checkmark & \checkmark \\ \ensuremath{\PH(\cPgg\cPgg)}\xspace & & \checkmark & & \checkmark & \checkmark \\ \end{tabular} \end{table} \subsection{Search for one lepton, two b jets, and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:lepbb} The ``$1\ell$ 2\PQb'' search~\cite{wh1l}, targeting the \ensuremath{\PW\PH}\xspace\ topology, selects events with exactly one charged lepton (\Pe{} or \Pgm), exactly two b jets, and large \ptmiss. The invariant mass of the two b jets is required to be consistent with the mass of the \PH{} boson. Kinematic variables are used to suppress backgrounds, which predominantly come from dileptonic decays in \ttbar production. Two exclusive signal regions are defined based on \ptmiss: $125 \leq \ptmiss < 200\GeV$ and $\ptmiss \geq 200\GeV$. The SM backgrounds are predicted using MC simulation, with the predictions validated in data control regions distinct from the signal region. \subsection{Search for four b jets and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:fourb} The ``4\PQb'' search~\cite{hh4b}, targeting the \ensuremath{\PH\PH}\xspace\ topology, selects events with exactly four or five jets, with at least two of them identified as b jets, large \ptmiss, and no charged leptons. In each event, the four jets with the highest b tagging discriminator scores are considered to form dijet \PH{} candidates. There are three possible groupings to make two pairs of jets. The grouping is selected to minimize the difference between the invariant masses of the two dijet pairs, and the difference in masses is required to be less than 40\GeV. The average invariant mass of the two pairs is then required to be consistent with the mass of the \PH{} boson. Exclusive signal regions are defined based on the number of b jets (three or at least four) and multiple bins in \ptmiss. The primary background to this search comes from semileptonic decays in \ttbar production, with smaller contributions from \PW{} or \PZ{} production in association with jets and from QCD multijet production. The backgrounds are predicted using data control samples that require either exactly two b jets or an average dijet invariant mass inconsistent with the \PH{} boson. \subsection{Search for two leptons consistent with a \PZ{} boson, jets, and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:onz} The ``$2\ell$ on-\PZ'' search~\cite{onz}, targeting the \ensuremath{\PW\PZ}\xspace, \ensuremath{\PZ\PZ}\xspace, and \ensuremath{\PZ\PH}\xspace topologies, selects events with exactly two opposite-sign, same-flavor (OSSF) leptons (\ensuremath{\Pep\Pem}\xspace or \ensuremath{\Pgmp\Pgmm}\xspace) consistent with the \PZ boson mass, at least two jets, and large \ptmiss. In the signal region targeting the \ensuremath{\PW\PZ}\xspace and \ensuremath{\PZ\PZ}\xspace topologies, two jets are required to have an invariant mass less than 110\GeV to be compatible with the \PW\ and \PZ\ boson masses, and events with b jets are rejected. To target the \ensuremath{\PZ\PH}\xspace topology, events are required to have two b jets with an invariant mass less than 150\GeV to be compatible with the \PH{} boson mass. Signal regions are defined with multiple exclusive bins in \ptmiss. The backgrounds fall into three categories. First, flavor symmetric backgrounds, such as \ttbar production, yield \ensuremath{\Pe^\pm\Pgm^\mp}\xspace events at the same rate as \ensuremath{\Pep\Pem}\xspace and \ensuremath{\Pgmp\Pgmm}\xspace events combined, and they are predicted from a data control sample of \ensuremath{\Pe^\pm\Pgm^\mp}\xspace events. Second, events with a \PZ{} boson and mismeasured jets give instrumental \ptmiss, and they are predicted from a data control sample of \cPgg+jets events. Third, events with a \PZ{} boson and at least one prompt neutrino, arising from processes such as \ensuremath{\PW\PZ}\xspace, \ensuremath{\PZ\PZ}\xspace, and \ensuremath{\ttbar\PZ}\xspace\ production, are estimated using simulation. \subsection{Search for two soft leptons and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:sos} The ``$2\ell$ soft'' search~\cite{sos} selects events with exactly two low-\pt\ leptons (\ensuremath{\Pep\Pem}\xspace or \ensuremath{\Pgmp\Pgmm}\xspace in the relevant selections), jets, and large \ptmiss. It targets the \ensuremath{\PW\PZ}\xspace topology where the mass difference between \PSGczDt and \PSGczDo is small such that the \PW{} and \PZ{} bosons are off-shell, and the observable decay products have low momentum. The leptons are required to satisfy $5 < \pt < 30\GeV$ and have an invariant mass in the range $4 < \ensuremath{m_{\ell\ell}}\xspace < 50\GeV$, strongly suppressing SM backgrounds while retaining good acceptance for compressed signal scenarios. Additional kinematic requirements are applied to further reduce backgrounds, and the relevant signal regions are binned in \ensuremath{m_{\ell\ell}}\xspace\ and \ptmiss. The largest backgrounds arise from $\PZ/\gamma^{*}$ and \ttbar production, as well as misidentification of nonprompt leptons. The first two are predicted from simulation with constraints from data control regions, while the latter is predicted entirely using data. \subsection{Search for three or more leptons, and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:oldmultilep} The ``${\geq}3\ell$'' search~\cite{ewkino2016} selects events with three or more leptons (\Pe, \Pgm, and up to two \tauh) and large \ptmiss. Several exclusive categories are defined based on the number of leptons, lepton flavor and charge, the presence of an OSSF pair, and kinematic variables such as the invariant mass of the OSSF pair and \ptmiss. Events with a b jet are rejected to reduce the background from \ttbar production. The various categories are designed to give this search sensitivity for a wide range of new physics models, including all of the topologies introduced in Section~\ref{sec:sigs}. The best performance is seen in the \ensuremath{\PW\PZ}\xspace and \ensuremath{\PZ\PZ}\xspace models, while the lower branching fraction of the \PH{} boson to leptons reduces the sensitivity to other models. The SM backgrounds in this search vary across the categories, and the most important for the relevant regions in these interpretations are SM \ensuremath{\PW\PZ}\xspace and \ensuremath{\PZ\PZ}\xspace production, and events with misidentified nonprompt leptons. The former are predicted using simulation, which in case of \ensuremath{\PW\PZ}\xspace is validated in a set of dedicated control regions, while the latter are predicted entirely from data. A further optimization of this analysis has been performed for the \ensuremath{\PW\PZ}\xspace topology in the case where the difference in the masses of \PSGczDt and \PSGczDo is equal to the \PZ{} boson mass, focusing on a category selecting events with three light-flavor leptons (\Pe, \Pgm). This update is presented in Section~\ref{sec:newmultilep}. \subsection{Search for a \PH{} boson decaying to diphotons and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:hgg} The ``\ensuremath{\PH(\cPgg\cPgg)}\xspace'' search~\cite{razorhgg} selects events with two photons consistent with the \PH{} boson mass, along with jets and large \ptmiss. Events are categorized based on the \pt\ of the diphoton system, the expected resolution on the diphoton mass, the presence of two b jets compatible with the \PH{} or \PZ{} boson masses, and the razor kinematic variables~\cite{Chatrchyan:2012uea,Chatrchyan:2014goa}. It exhibits sensitivity to the \ensuremath{\PW\PH}\xspace, \ensuremath{\PZ\PH}\xspace, and \ensuremath{\PH\PH}\xspace topologies. The background arises either from $\gamma$+jets or SM \PH{} boson production. The former is estimated using a fit to the diphoton mass spectrum in a wider range than the signal window, while the latter is predicted using simulation. \section{Search for three light leptons consistent with \ensuremath{\PW\PZ}\xspace production and \texorpdfstring{\ptmiss}{missing transverse momentum}} \label{sec:newmultilep} The multilepton search described in Section~\ref{sec:oldmultilep} contains a category selecting events with three light-flavor leptons (\Pe, \Pgm), two of which must form an OSSF pair. This final state aims to provide sensitivity for a variety of SUSY models, including the \ensuremath{\PW\PZ}\xspace topology depicted in Fig.~\ref{fig:c1n2} (left). The dominant background in this search category is SM \ensuremath{\PW\PZ}\xspace production. Exclusion limits on the \ensuremath{\PW\PZ}\xspace topology were placed in Ref.~\cite{ewkino2016}, and the sensitivity was found to be significantly reduced for $\ensuremath{m_{\PSGczDt}}\xspace - \ensuremath{m_{\PSGczDo}}\xspace \approx m_{\PZ}$, referred to here as the ``\ensuremath{\PW\PZ}\xspace corridor.'' In this case, SUSY signal is kinematically similar to the SM background. We present here a further optimization of the search for the \ensuremath{\PW\PZ}\xspace topology designed to target this challenging region of phase space. The search methodology remains the same as in Ref.~\cite{ewkino2016}, but the event categorization has been updated as described below. We require events to have three light-flavor leptons with two forming an OSSF pair. Events are categorized using the following kinematic variables: \ptmiss, the invariant mass \ensuremath{m_{\ell\ell}}\xspace\ of the OSSF pair, and the transverse mass \ensuremath{M_\text{T}}\xspace\ of the third lepton computed with respect to \ptmiss. Three bins in \ensuremath{m_{\ell\ell}}\xspace are defined to separate contributions from on- and off-shell \PZ{} boson decays, and three bins are defined in \ensuremath{M_\text{T}}\xspace to separate the SM \PW{} boson contribution. To improve the separation between signal and background in the \ensuremath{\PW\PZ}\xspace corridor, we exploit ISR by further categorizing the events in \HT, the scalar \pt sum of the jets with $\pt > 30\GeV$. Due to the presence of the \PSGczDo LSPs, signal model points in the \ensuremath{\PW\PZ}\xspace corridor will tend to have more events at high values of \ptmiss and \ensuremath{M_\text{T}}\xspace than the SM background for the same value of \HT, with the effect becoming relevant at $\ensuremath{m_{\PSGczDo}}\xspace \approx m_{\PZ}$ and more pronounced at higher \HT. This is demonstrated in Fig.~\ref{fig:newmultilep:expkin}, which shows the expected distributions of \ptmiss for background and two signal model points after requiring (left) $\HT < 100\GeV$ and (right) $\geq 200\GeV$. The \HT categorization is applied in the regions $\ensuremath{m_{\ell\ell}}\xspace < 75\GeV$ and $75 \leq \ensuremath{m_{\ell\ell}}\xspace < 105\GeV$. The full set of search regions is summarized in Table~\ref{tab:newmultilep:categories}. \begin{figure}[!hbtp] \centering \includegraphics[width=0.45\textwidth]{Figure_004-a.pdf} \includegraphics[width=0.45\textwidth]{Figure_004-b.pdf} \caption{Distributions of \ptmiss for two representative signal points in the \ensuremath{\PW\PZ}\xspace corridor as well as the expected SM background for $\HT < 100$ (left) and $\geq 200\GeV$ (right). The mass values for the signal points are given as $(\ensuremath{m_{\PSGczDt}}\xspace / \ensuremath{m_{\PSGczDo}}\xspace)$ in \GeV. For larger values of \HT, the shape difference between signal and background becomes more pronounced due to the presence of \PSGczDo\ LSPs with large Lorentz boost.} \label{fig:newmultilep:expkin} \end{figure} \begin{table}[tbh] \centering \topcaption{Definition of the search regions (SRs) optimized for the \ensuremath{\PW\PZ}\xspace corridor in the \ensuremath{\PW\PZ}\xspace signal topology. Events must have three leptons (\Pe, \Pgm) forming at least one OSSF pair and they are categorized in \ensuremath{m_{\ell\ell}}\xspace, \ensuremath{M_\text{T}}\xspace, \ptmiss and \HT. Where ranges of values are given, the lower bound is inclusive while the upper bound is exclusive, \eg, $75 \leq \ensuremath{m_{\ell\ell}}\xspace < 105\GeV$. } \label{tab:newmultilep:categories} \resizebox{0.8\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|} \hline $\ensuremath{m_{\ell\ell}}\xspace$ (\GeVns{}) & $\ensuremath{M_\text{T}}\xspace$ (\GeVns{}) & $\ptmiss$ (\GeVns{}) & $\HT < 100\GeV$ & $100 \leq \HT < 200\GeV $ & $\HT\geq200\GeV $\\ \hline\hline \multirow{11}{*}{0--75 } & \multirow{4}{*}{0--100} & 50--100 & \multicolumn{2}{c|}{SR 01} & \multirow{4}{*}{SR 12} \\ \cline{3-5} & & 100--150 & \multicolumn{2}{c|}{SR 02} & \\ \cline{3-5} & & 150--200 & \multicolumn{2}{c|}{SR 03} & \\ \cline{3-5} & & $\geq$200 & \multicolumn{2}{c|}{SR 04} & \\ \cline{2-6} & \multirow{3}{*}{100--160} & 50--100 & \multicolumn{2}{c|}{SR 05} & \multirow{3}{*}{SR 13} \\ \cline{3-5} & & 100--150 & \multicolumn{2}{c|}{SR 06} & \\ \cline{3-5} & & $\geq$150 & \multicolumn{2}{c|}{SR 07} & \\ \cline{2-6} & \multirow{4}{*}{$\geq$160} & 50--100 & \multicolumn{2}{c|}{SR 08} & \multirow{4}{*}{SR 14} \\ \cline{3-5} & & 100--150 & \multicolumn{2}{c|}{SR 09} & \\ \cline{3-5} & & 150--200 & \multicolumn{2}{c|}{SR 10} & \\ \cline{3-5} & & $\geq$200 & \multicolumn{2}{c|}{SR 11} & \\ \hline \multirow{18}{*}{75--105} & \multirow{6}{*}{0--100} & 50--100 & (WZ CR) & SR 27 & \multirow{2}{*}{SR 40} \\ \cline{3-5} & & 100--150 & SR 15 & SR 28 & \\ \cline{3-6} & & 150--200 & SR 16 & SR 29 & \multirow{2}{*}{SR 41} \\ \cline{3-5} & & 200--250 & SR 17 & SR 30 & \\ \cline{3-6} & & 250--350 & \multirow{2}{*}{SR 18} & \multirow{2}{*}{SR 31} & SR 42 \\ \cline{3-3}\cline{6-6} & & $\geq$350 & & & SR 43 \\ \cline{2-6} & \multirow{6}{*}{100--160} & 50--100 & SR 19 & SR 32 & SR 44 \\ \cline{3-6} & & 100--150 & SR 20 & SR 33 & SR 45 \\ \cline{3-6} & & 150--200 & SR 21 & SR 34 & SR 46 \\ \cline{3-6} & & 200--250 & \multirow{3}{*}{SR 22} & \multirow{3}{*}{SR 35} & SR 47 \\ \cline{3-3}\cline{6-6} & & 250--300 & & & SR 48 \\ \cline{3-3}\cline{6-6} & & $\geq$300 & & & SR 49 \\ \cline{2-6} & \multirow{6}{*}{$\geq$160} & 50--100 & SR 23 & SR 36 & SR 50 \\ \cline{3-6} & & 100--150 & SR 24 & SR 37 & SR 51 \\ \cline{3-6} & & 150--200 & SR 25 & SR 38 & SR 52 \\ \cline{3-6} & & 200--250 & \multirow{3}{*}{SR 26} & \multirow{3}{*}{SR 39} & SR 53 \\ \cline{3-3}\cline{6-6} & & 250--300 & & & SR 54 \\ \cline{3-3}\cline{6-6} & & $\geq$300 & & & SR 55 \\ \hline \multirow{ 3}{*}{$\geq$105} & 0--100 & $\geq$50 & \multicolumn{3}{c|}{SR 56} \\ \cline{2-6} & 100--160 & $\geq$50 & \multicolumn{3}{c|}{SR 57} \\ \cline{2-6} & $\geq$160 & $\geq$50 & \multicolumn{3}{c|}{SR 58} \\ \hline \end{tabular}} \end{table} The dominant background in this search is SM \ensuremath{\PW\PZ}\xspace production, which provides a signature very similar to the signal process in the form of three isolated leptons and substantial \ptmiss due to the neutrino from the \PW{} boson decay. This background is estimated from simulation, while two control regions are used to assess the overall normalization and to validate the modeling of events at large values of \ptmiss, \ensuremath{M_\text{T}}\xspace, or both. Further backgrounds arise from misidentification of nonprompt leptons from processes like \ttbar production, external and internal photon conversions, and rare SM processes such as triboson production, \ensuremath{\ttbar\PW}\xspace, and \ensuremath{\ttbar\PZ}\xspace. The contribution of the nonprompt lepton background is predicted using the ``tight-to-loose'' ratio method~\cite{Khachatryan:2016kod}, which relies entirely on data. External and internal photon conversions as well as rare SM processes are predicted from simulation, and a dedicated data control region is used to constrain the normalization of the conversion background. The SM \ensuremath{\PW\PZ}\xspace background normalization is constrained in a data control region requiring $75 \leq \ensuremath{m_{\ell\ell}}\xspace < 105\GeV$, $\ensuremath{M_\text{T}}\xspace < 100\GeV$, $35 < \ptmiss < 100\GeV$, and $\HT < 100\GeV$. The fraction of selected background events arising from SM \ensuremath{\PW\PZ}\xspace production in this region is approximately 86\%. The validation of the \ptmiss and \ensuremath{M_\text{T}}\xspace\ shape modeling is done using a data control sample enriched in $\PW\gamma$ events, with the remainder of events coming mainly from $\ensuremath{\PW\mathrm{+jets}}\xspace$ production. A photon with $\pt > 40\GeV$ is required together with a lepton and $\ptmiss \geq 50\GeV$, corresponding to a leptonic \PW{} boson decay. The minimum photon \pt\ threshold ensures that the photon does not arise from final-state radiation. The motivation behind this selection is that the \PW{} boson \ensuremath{M_\text{T}}\xspace\ distribution in both $\PW\gamma$ and $\ensuremath{\PW\mathrm{+jets}}\xspace$ events is found to be consistent with that of SM \ensuremath{\PW\PZ}\xspace production. A systematic uncertainty is assigned to the signal region bins with high \ensuremath{M_\text{T}}\xspace\ and \ptmiss based on the statistical precision of this control region. Distributions of key kinematic observables for the events entering the search regions are shown in Fig.~\ref{fig:newmultilep:results:kin} with two representative signal mass points included. The data agree with the prediction within systematic uncertainties, which are dominated at high \ensuremath{M_\text{T}}\xspace\ and \ptmiss by the \ensuremath{\PW\PZ}\xspace control region statistical precision as described above. This uncertainty is taken as correlated across signal region bins. The comparison between expected and observed yields in the search regions is shown in Fig.~\ref{fig:newmultilep:yields} and Table~\ref{tab:newmultilep:yields}. No significant deviations from the SM expectations are observed. The predicted background yields and uncertainties presented in this section are used as inputs to the likelihood fit for interpretation, described in Section~\ref{sec:interp}. The interpretation of the results in the \ensuremath{\PW\PZ}\xspace topology at 95\% confidence level (CL) is presented in Fig.~\ref{fig:newmultilep:interpretation}. Compared to Ref.~\cite{ewkino2016}, the expected lower mass limit in the \ensuremath{\PW\PZ}\xspace corridor has improved from around $(\ensuremath{m_{\PSGczDt}}\xspace,\ensuremath{m_{\PSGczDo}}\xspace) = (200,100)$ to around $(225,125)\GeV$, while the observed limit has improved by around 60\GeV in both mass values. The expected limit contour for signal points with $\ensuremath{m_{\PSGczDt}}\xspace - \ensuremath{m_{\PSGczDo}}\xspace > m_{\PZ}$ has also improved by as much as 25\GeV due to the new selections. The upper limit on the \ensuremath{\firstcharg\secondchi}\xspace\ production cross section has improved by a factor of 2. The event selections listed in Table~\ref{tab:newmultilep:categories} are used to replace the selections for category~A in Ref.~\cite{ewkino2016} in the combination below with other analyses, when interpreting results in the models with either 100\% or 50\% branching fraction to the SUSY \ensuremath{\PW\PZ}\xspace topology. In this case, the systematic uncertainties in the background prediction are treated as being fully correlated with the other categories from Ref.~\cite{ewkino2016}. \begin{figure}[!hbtp] \centering \includegraphics[width=0.45\textwidth]{Figure_005-a.pdf} \includegraphics[width=0.45\textwidth]{Figure_005-b.pdf} \\ \includegraphics[width=0.45\textwidth]{Figure_005-c.pdf} \includegraphics[width=0.45\textwidth]{Figure_005-d.pdf} \caption{Distributions of the transverse mass of the third lepton with respect to \ptmiss (upper left), the \ptmiss (upper right), the \ensuremath{m_{\ell\ell}}\xspace\ of the OSSF pair (lower left), and the \HT\ (lower right). Distributions for two signal mass points in the \ensuremath{\PW\PZ}\xspace corridor are overlaid for illustration. The mass values for the signal points are given as $(\ensuremath{m_{\PSGczDt}}\xspace / \ensuremath{m_{\PSGczDo}}\xspace)$ in \GeV. The bottom panel shows the ratio of observed data to predicted yields. The dark purple band shows the statistical uncertainty in the background prediction, while the light blue band shows the total uncertainty.} \label{fig:newmultilep:results:kin} \end{figure} \begin{figure}[!hbtp] \centering \includegraphics[width=0.95\textwidth]{Figure_006.pdf} \caption{Expected and observed yield comparison in the search regions. Two example signal mass points along the \ensuremath{\PW\PZ}\xspace corridor are overlaid for illustration. The mass values for the signal points are given as $(\ensuremath{m_{\PSGczDt}}\xspace / \ensuremath{m_{\PSGczDo}}\xspace)$ in \GeV. The bottom panel shows the ratio of observed data to predicted yields. The dark purple band shows the statistical uncertainty in the background prediction, while the light blue band shows the total uncertainty.} \label{fig:newmultilep:yields} \end{figure} \begin{table}[tbh] \centering \topcaption{Expected and observed event yields in the search regions. For each bin, the first number corresponds to the expected yield and its total uncertainty while the second number gives the observation. Where ranges of values are given for the selections, the lower bound is inclusive while the upper bound is exclusive, \eg, $75 \leq \ensuremath{m_{\ell\ell}}\xspace < 105\GeV$. } \label{tab:newmultilep:yields} \resizebox{0.8\textwidth}{!}{ \begin{tabular}{|c|c|c|cc|cc|cc|} \hline \ensuremath{m_{\ell\ell}}\xspace\ (\GeVns{}) & \ensuremath{M_\text{T}}\xspace\ (\GeVns{}) & \ptmiss (\GeVns{}) & \multicolumn{2}{c|}{$\HT< 100\GeV$} & \multicolumn{2}{c|}{$100 \leq \HT<200\GeV$} & \multicolumn{2}{c|}{$\HT\geq 200\GeV$} \\ \hline\hline \multirow{11}{*}{0--75 } & \multirow{4}{*}{0--100} & 50--100 & \multicolumn{2}{c}{ 175 $\pm$ 20} & \multicolumn{2}{c|}{166} & \multirow{4}{*}{ 39 $\pm$ 6} & \multirow{4}{*}{41} \\ \cline{3-7} & & 100--150 & \multicolumn{2}{c}{ 27 $\pm$ 4} & \multicolumn{2}{c|}{23} & & \\ \cline{3-7} & & 150--200 & \multicolumn{2}{c}{ 5 $\pm$ 1} & \multicolumn{2}{c|}{6} & & \\ \cline{3-7} & & $\geq$200 & \multicolumn{2}{c}{ 2.5 $\pm$ 0.8} & \multicolumn{2}{c|}{1} & & \\ \cline{2-9} & \multirow{3}{*}{100--160} & 50--100 & \multicolumn{2}{c}{ 50 $\pm$ 8} & \multicolumn{2}{c|}{56} & \multirow{3}{*}{ 10 $\pm$ 3} & \multirow{3}{*}{13} \\ \cline{3-7} & & 100--150 & \multicolumn{2}{c}{ 12 $\pm$ 3} & \multicolumn{2}{c|}{13} & & \\ \cline{3-7} & & $\geq$150 & \multicolumn{2}{c}{ 1.2 $\pm$ 0.4} & \multicolumn{2}{c|}{1} & & \\ \cline{2-9} & \multirow{4}{*}{$\geq$160} & 50--100 & \multicolumn{2}{c}{ 12 $\pm$ 2} & \multicolumn{2}{c|}{13} & \multirow{4}{*}{ 6 $\pm$ 2} & \multirow{4}{*}{11} \\ \cline{3-7} & & 100--150 & \multicolumn{2}{c}{ 11 $\pm$ 3} & \multicolumn{2}{c|}{14} & & \\ \cline{3-7} & & 150--200 & \multicolumn{2}{c}{ 2.6 $\pm$ 0.9} & \multicolumn{2}{c|}{2} & & \\ \cline{3-7} & & $\geq$200 & \multicolumn{2}{c}{ 1.2 $\pm$ 0.5} & \multicolumn{2}{c|}{1} & & \\ \hline \multirow{18}{*}{75--105} & \multirow{6}{*}{0--100} & 50--100 & \multicolumn{2}{c|}{(WZ CR)} & 279 $\pm$ 34 & 250 & \multirow{2}{*}{ 310 $\pm$ 40} & \multirow{2}{*}{292} \\ \cline{3-7} & & 100--150 & 286 $\pm$ 44 & 260 & 87 $\pm$ 13 & 81 & & \\ \cline{3-9} & & 150--200 & 62 $\pm$ 14 & 51 & 26 $\pm$ 6 & 20 & \multirow{2}{*}{ 81 $\pm$ 18} & \multirow{2}{*}{69} \\ \cline{3-7} & & 200--250 & 20 $\pm$ 5 & 10 & 8 $\pm$ 2 & 10 & & \\ \cline{3-9} & & 250--350 & \multirow{2}{*}{ 16 $\pm$ 4} & \multirow{2}{*}{9} & \multirow{2}{*}{ 6 $\pm$ 1} & \multirow{2}{*}{5}& 25 $\pm$ 6 & 23 \\ \cline{3-3}\cline{8-9} & & $\geq$350 & & & & & 13 $\pm$ 3 & 8 \\ \cline{2-9} & \multirow{6}{*}{100--160} & 50--100 & 321 $\pm$ 42 & 297 & 54 $\pm$ 8 & 49 & 45 $\pm$ 6 & 45 \\ \cline{3-9} & & 100--150 & 50 $\pm$ 14 & 38 & 11 $\pm$ 3 & 11 & 14 $\pm$ 3 & 12 \\ \cline{3-9} & & 150--200 & 5 $\pm$ 2 & 2 & 2.2 $\pm$ 0.9 & 2 & 4 $\pm$ 2 & 5 \\ \cline{3-9} & & 200--250 & \multirow{3}{*}{ 1.1 $\pm$ 0.5} & \multirow{3}{*}{2}& \multirow{3}{*}{ 0.5 $\pm$ 0.4} & \multirow{3}{*}{2} & 1.9 $\pm$ 0.8 & 1 \\ \cline{3-3}\cline{8-9} & & 250--300 & & & & & 1.8 $\pm$ 0.8 & 2 \\ \cline{3-3}\cline{8-9} & & $\geq$300 & & & & & 1.0 $\pm$ 0.5 & 1 \\ \cline{2-9} & \multirow{6}{*}{$\geq$160} & 50--100 & 25 $\pm$ 6 & 18 & 6 $\pm$ 2 & 5 & 9 $\pm$ 3 & 12 \\ \cline{3-9} & & 100--150 & 12 $\pm$ 5 & 13 & 3.0 $\pm$ 1.3 & 2 & 4 $\pm$ 2 & 2 \\ \cline{3-9} & & 150--200 & 5 $\pm$ 2 & 5 & 1.1 $\pm$ 0.4 & 0 & 2.0 $\pm$ 0.7 & 2 \\ \cline{3-9} & & 200--250 & \multirow{3}{*}{ 4 $\pm$ 2} & \multirow{3}{*}{2} & \multirow{3}{*}{ 0.9 $\pm$ 0.4} & \multirow{3}{*}{3} & 1.5 $\pm$ 0.7 & 2 \\ \cline{3-3}\cline{8-9} & & 250--300 & & & & & 0.6 $\pm$ 0.3 & 1 \\ \cline{3-3}\cline{8-9} & & $\geq$300 & & & & & 1.1 $\pm$ 0.5 & 1 \\ \hline \multirow{ 3}{*}{$\geq$105 } & 0--100 & $\geq$50 & \multicolumn{3}{c}{ 173 $\pm$ 21} & \multicolumn{3}{c|}{170} \\ \cline{2-9} & 100--160 & $\geq$50 & \multicolumn{3}{c}{ 44 $\pm$ 7} & \multicolumn{3}{c|}{28} \\ \cline{2-9} & $\geq$160 & $\geq$50 & \multicolumn{3}{c}{ 23 $\pm$ 6} & \multicolumn{3}{c|}{12} \\ \hline \end{tabular} } \end{table} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{Figure_007.pdf} \caption{ The 95\% confidence level upper limit on the production cross section in the plane of \ensuremath{m_{\PSGcpmDo}}\xspace and \ensuremath{m_{\PSGczDo}}\xspace for the model of \ensuremath{\firstcharg\secondchi}\xspace production with the \ensuremath{\PW\PZ}\xspace topology, using only the search requiring three or more leptons as described in Section~\ref{sec:newmultilep}. The thick solid black (dashed red) curve represents the observed (expected) exclusion contour assuming the theory cross sections. The area below each curve is the excluded region. The thin dashed red lines indicate the $\pm1\sigma_{\text{experiment}}$ uncertainty. The thin black lines show the effect of the theoretical uncertainties (${\pm}1\sigma_{\text{theory}}$) on the signal cross section. The color scale shows the observed limit at 95\% CL on the signal production cross section. } \label{fig:newmultilep:interpretation} \end{figure} \section{Interpretation} \label{sec:interp} The results of the searches described in Sections~\ref{sec:searches} and~\ref{sec:newmultilep} are interpreted using the simplified models introduced in Section~\ref{sec:sigs}. Cross section limits as a function of the SUSY particle masses are set using a modified frequentist approach, employing the CL$_{\text{s}}$ criterion and an asymptotic formulation~\cite{Junk:1999kv,Read:2002hq,Cowan:2010js, ATL-PHYS-PUB-2011-011}. The uncertainties in the signal efficiency and acceptance and in the background predictions are incorporated as nuisance parameters. The observed data yields in control regions are typically incorporated either by a simultaneous maximum likelihood fit of the signal and control regions or through parameterization using the gamma function. Other nuisance parameters are implemented using lognormal functions, whose widths reflect the size of the systematic uncertainty, or as alternate shapes of the relevant distributions. Within each signal model, the experimental and theoretical uncertainties affecting the signal prediction are treated as fully correlated for all analyses. The dominant uncertainties in the background predictions are not correlated among analyses as they tend to be either statistical in nature, arising from independent control regions, or uncertainties in the prediction methods, which are unique to each analysis. For each signal topology, the analyses with a check mark in Table~\ref{tab:searches_models} are combined to place exclusion limits. The following sources of uncertainty in the signal acceptance and efficiency are assumed to be fully correlated among analyses: determination of the integrated luminosity, lepton identification and isolation efficiency, lepton efficiency modeling in fast simulation, b tagging efficiency, jet energy scale, modeling of \ptmiss in fast simulation, modeling of ISR, simulation of pileup, and variations of the generator factorization and renormalization scales. Variations in the PDF set used are found to primarily affect the signal acceptance by changing the \pt\ distribution of the initially-produced sparticle pair, $\PSGcpmDo\PSGczDt$ or $\PSGczDo\firstchi$. This is already incorporated in the empirical uncertainty in the modeling of ISR as described in Section~\ref{sec:recosamples}, and we therefore do not apply a dedicated uncertainty in signal acceptance from PDF variations. All analyses also include the statistical uncertainty of the simulated signal samples, which is taken as being uncorrelated in every bin, and the uncertainty in the modeling of the trigger efficiency, which is also taken as uncorrelated given the different trigger requirements applied in each analysis. Some analyses have additional uncertainties beyond these, such as the uncertainty in the modeling of the diphoton mass resolution for the \ensuremath{\PH(\cPgg\cPgg)}\xspace\ analysis, which are analysis-specific and treated as being uncorrelated. For the models of \ensuremath{\firstcharg\secondchi}\xspace production, 95\% confidence level exclusion limits are presented in the plane of \ensuremath{m_{\PSGcpmDo}}\xspace and \ensuremath{m_{\PSGczDo}}\xspace. Figure~\ref{fig:limits_c1n2} shows the exclusion limits for the combination of analyses for the \ensuremath{\PW\PZ}\xspace topology, the \ensuremath{\PW\PH}\xspace topology, and the mixed topology with 50\% branching fraction to each of the \ensuremath{\PW\PZ}\xspace and \ensuremath{\PW\PH}\xspace channels. Figure~\ref{fig:analyses_c1n2_2d} shows the analysis with the best expected limit for each point in the plane for the same topologies. The on-\PZ dilepton analysis generally gives the best sensitivity for large values of $\Delta m = \ensuremath{m_{\PSGczDt}}\xspace - \ensuremath{m_{\PSGczDo}}\xspace$. The search for three light-flavor leptons provides the best sensitivity at intermediate values of $\Delta m$, including the region where $\Delta m \approx m_{\PZ}$, while the soft-dilepton analysis provides unique sensitivity to the smallest values of $\Delta m$. Figure~\ref{fig:limits_c1n2_summary} (left) shows the observed and expected limit contours for each of the individual analyses considered in the combination, and Fig.~\ref{fig:limits_c1n2_summary} (right) shows the results from the combination for all three topologies considered. For a massless LSP \PSGczDo, the combined result gives an observed (expected) limit in \ensuremath{m_{\PSGcpmDo}}\xspace\ of about 650\,(570)\GeV for the \ensuremath{\PW\PZ}\xspace topology, 480\,(455)\GeV for the \ensuremath{\PW\PH}\xspace topology, and 535\,(440)\GeV for the mixed topology. The combination also excludes intermediate mass values that were not excluded by individual analyses, including \ensuremath{m_{\PSGcpmDo}}\xspace values between 180 and 240\GeV for a massless LSP in the \ensuremath{\PW\PH}\xspace topology. \begin{figure}[htbp] \centering \includegraphics[width=0.6\textwidth]{Figure_008-a.pdf} \includegraphics[width=0.6\textwidth]{Figure_008-b.pdf} \includegraphics[width=0.6\textwidth]{Figure_008-c.pdf} \caption{The 95\% CL upper limits on the production cross sections in the plane of \ensuremath{m_{\PSGcpmDo}}\xspace and \ensuremath{m_{\PSGczDo}}\xspace for the models of \ensuremath{\firstcharg\secondchi}\xspace production with (upper) the \ensuremath{\PW\PZ}\xspace topology, (middle) the \ensuremath{\PW\PH}\xspace topology, or (lower) the mixed topology with 50\% branching fraction to each of \ensuremath{\PW\PZ}\xspace and \ensuremath{\PW\PH}\xspace. The thick solid black (dashed red) curve represents the observed (expected) exclusion contour assuming the theory cross sections. The area below each curve is the excluded region. The thin dashed red lines indicate the $\pm1\sigma_{\text{experiment}}$ uncertainty. The thin black lines show the effect of the theoretical uncertainties ($\pm1\sigma_{\text{theory}}$) on the signal cross section. The color scale shows the observed limit at 95\% CL on the signal production cross section. } \label{fig:limits_c1n2} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.6\textwidth]{Figure_009-a.pdf} \includegraphics[width=0.6\textwidth]{Figure_009-b.pdf} \includegraphics[width=0.6\textwidth]{Figure_009-c.pdf} \caption{The analysis with the best expected exclusion limit at each point in the plane of \ensuremath{m_{\PSGcpmDo}}\xspace and \ensuremath{m_{\PSGczDo}}\xspace for the models of \ensuremath{\firstcharg\secondchi}\xspace production with (upper) the \ensuremath{\PW\PZ}\xspace topology, (middle) the \ensuremath{\PW\PH}\xspace topology, and (lower) the mixed topology 50\% branching fraction to each of \ensuremath{\PW\PZ}\xspace and \ensuremath{\PW\PH}\xspace. } \label{fig:analyses_c1n2_2d} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.45\textwidth]{Figure_010-a.pdf} \includegraphics[width=0.45\textwidth]{Figure_010-b.pdf} \caption{Exclusion contours at 95\% CL in the plane of \ensuremath{m_{\PSGcpmDo}}\xspace and \ensuremath{m_{\PSGczDo}}\xspace for the models of \ensuremath{\firstcharg\secondchi}\xspace production (left) for the individual analyses and (right) for the combination of analyses. The decay modes assumed for each contour are given in the legends. } \label{fig:limits_c1n2_summary} \end{figure} For the models of \ensuremath{\firstchi\firstchi}\xspace production, the exclusion limits are presented in the plane of \ensuremath{m_{\PSGczDo}}\xspace and the branching fraction \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace. The decay $\PSGczDo \to \PZ\PXXSG$ is assumed to make up the remainder of the branching fraction. Figure~\ref{fig:limits_n1n1_2d} shows the observed and expected limits from the combination in this plane. The expected mass exclusion limit varies between about 550 and 750\GeV, being least stringent around $\ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace = 0.4$. The observed limit ranges between about 650 and 750\GeV, allowing us to exclude masses below 650\GeV independent of this branching fraction. Figure~\ref{fig:indiv_limits_n1n1_2d} shows the observed limits from each analysis separately compared with the combined result. Figure~\ref{fig:analyses_n1n1_2d} shows the analysis with the best expected exclusion limit for each point in the same plane. At higher values of \ensuremath{m_{\PSGczDo}}\xspace, the searches for at least one hadronically decaying boson provide the best sensitivity, the 4\PQb\ search when \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace is large and the on-\PZ dilepton search when it is smaller. At lower values of \ensuremath{m_{\PSGczDo}}\xspace, below around 200\GeV, the \ensuremath{\PH(\cPgg\cPgg)}\xspace analysis is most sensitive when \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace is large, while the three or more lepton search is dominant when it is small. Figure~\ref{fig:limits_n1n1_1d} then shows the exclusion limits as a function of \ensuremath{m_{\PSGczDo}}\xspace for three choices of \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace: 0\%, yielding the \ensuremath{\PZ\PZ}\xspace topology; 100\%, yielding the \ensuremath{\PH\PH}\xspace topology; and 50\%, yielding a mix of events from the \ensuremath{\PZ\PZ}\xspace, \ensuremath{\PH\PH}\xspace, and \ensuremath{\PZ\PH}\xspace topologies. \begin{figure}[htbp] \centering \includegraphics[width=0.65\textwidth]{Figure_011.pdf} \caption{Combined exclusion contours at the 95\% CL in the plane of \ensuremath{m_{\PSGczDo}}\xspace\ and \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace\ for the model of \ensuremath{\firstchi\firstchi}\xspace\ production. The area to the left of or below the solid (dashed) black curve represents the observed (expected) exclusion region. The green and yellow bands indicate the $\pm$1 and 2$\sigma$ uncertainties in the expected limit. The thin black lines show the effect of the theoretical uncertainties (${\pm}1\sigma_{\text{theory}}$) on the signal cross section. } \label{fig:limits_n1n1_2d} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.65\textwidth]{Figure_012.pdf} \caption{Observed exclusion contours at the 95\% CL in the plane of \ensuremath{m_{\PSGczDo}}\xspace\ and \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace\ for the model of \ensuremath{\firstchi\firstchi}\xspace\ production for each individual analysis compared with the combination. For the 4\PQb\ contour, the region above is excluded, while for all others, the region to the left is excluded. The 4\PQb\ search drives the exclusion at large values of \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace while the on-\PZ dilepton and multilepton searches are competing at lower values of \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace. } \label{fig:indiv_limits_n1n1_2d} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.6\textwidth]{Figure_013.pdf} \caption{The analysis with the best expected exclusion limit at each point in the plane of \ensuremath{m_{\PSGczDo}}\xspace and \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace\ for the model of \ensuremath{\firstchi\firstchi}\xspace production. } \label{fig:analyses_n1n1_2d} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=0.6\textwidth]{Figure_014-a.pdf} \includegraphics[width=0.6\textwidth]{Figure_014-b.pdf} \includegraphics[width=0.6\textwidth]{Figure_014-c.pdf} \caption{The 95\% CL upper limits on the production cross sections as a function of \ensuremath{m_{\PSGczDo}}\xspace\ for the model of \ensuremath{\firstchi\firstchi}\xspace\ production with three choices of \ensuremath{\mathcal{B}(\firstchi\to\PH\gravitino)}\xspace: (upper) 0\%, yielding the \ensuremath{\PZ\PZ}\xspace topology, (middle) 100\%, yielding the \ensuremath{\PH\PH}\xspace topology, and (lower) 50\%, yielding the \ensuremath{\PZ\PH}\xspace mixed topology. The solid black line represents the observed exclusion. The dashed black line represents the expected exclusion, while the green and yellow bands indicate the $\pm$1 and 2$\sigma$ uncertainties in the expected limit. The red line shows the theoretical cross section with its uncertainty. The other lines in each plot show the observed exclusion for individual analyses. } \label{fig:limits_n1n1_1d} \end{figure} \section{Summary} A number of searches for the electroweak production of charginos and neutralinos predicted in supersymmetry (SUSY) have been performed in different final states. All searches considered here use proton-proton collision data at $\sqrt{s}=13\TeV$, recorded with the CMS detector at the LHC and corresponding to an integrated luminosity of $35.9\fbinv$. No significant deviations from the standard model expectations have been observed. A targeted search requiring three or more charged leptons (electrons or muons) has been presented, focusing on chargino-neutralino production where the difference in mass between \PSGczDt\ and \PSGczDo\ is approximately equal to the mass of the \PZ{} boson, and no significant deviations from the standard model predictions are observed. This search is interpreted in a simplified model scenario of SUSY chargino-neutralino ($\PSGcpmDo\PSGczDt$) production with decays $\PSGcpmDo\to\PW^{\pm}\PSGczDo$ and $\PSGczDt\to\PZ\PSGczDo$, where \PSGczDo\ is the lightest SUSY particle (LSP). In the targeted phase space, the expected and observed 95\% confidence level exclusion limits extend to 225\GeV in the mass of \PSGczDt and 125\GeV in the mass of \PSGczDo, improving the observed limits from the previous publication by up to 60\GeV~\cite{ewkino2016}. A statistical combination of several searches is performed and interpreted in the context of simplified models of either chargino-neutralino production, or neutralino pair production in a gauge-mediated SUSY breaking (GMSB) scenario. For a massless LSP \PSGczDo in the chargino-neutralino model, the combined result gives an observed (expected) limit in the \PSGcpmDo mass of about 650\,(570)\GeV for the \ensuremath{\PW\PZ}\xspace topology, 480\,(455)\GeV for the \ensuremath{\PW\PH}\xspace topology, and 535\,(440)\GeV for the mixed topology. Compared to the results of individual analyses, the combination improves the observed exclusion limit by up to 40\GeV in the masses of \PSGcpmDo and \PSGczDt in the chargino-neutralino model. The combination also excludes intermediate mass values that were not excluded by individual analyses, including \PSGcpmDo masses between 180 and 240\GeV in the \ensuremath{\PW\PH}\xspace topology. In the GMSB neutralino pair model, the combined result gives an observed (expected) limit in the \PSGczDo mass of 650--750 (550--750)\GeV. The combined result improves the observed limit by up to 200\GeV in the mass of \PSGczDo in the GMSB neutralino pair model, depending on the branching fractions for the SUSY particle decays. These results represent the most stringent constraints to date for all models considered. \begin{acknowledgments} We congratulate our colleagues in the CERN accelerator departments for the excellent performance of the LHC and thank the technical and administrative staffs at CERN and at other CMS institutes for their contributions to the success of the CMS effort. In addition, we gratefully acknowledge the computing centers and personnel of the Worldwide LHC Computing Grid for delivering so effectively the computing infrastructure essential to our analyses. Finally, we acknowledge the enduring support for the construction and operation of the LHC and the CMS detector provided by the following funding agencies: BMWFW and FWF (Austria); FNRS and FWO (Belgium); CNPq, CAPES, FAPERJ, and FAPESP (Brazil); MES (Bulgaria); CERN; CAS, MoST, and NSFC (China); COLCIENCIAS (Colombia); MSES and CSF (Croatia); RPF (Cyprus); SENESCYT (Ecuador); MoER, ERC IUT, and ERDF (Estonia); Academy of Finland, MEC, and HIP (Finland); CEA and CNRS/IN2P3 (France); BMBF, DFG, and HGF (Germany); GSRT (Greece); OTKA and NIH (Hungary); DAE and DST (India); IPM (Iran); SFI (Ireland); INFN (Italy); MSIP and NRF (Republic of Korea); LAS (Lithuania); MOE and UM (Malaysia); BUAP, CINVESTAV, CONACYT, LNS, SEP, and UASLP-FAI (Mexico); MBIE (New Zealand); PAEC (Pakistan); MSHE and NSC (Poland); FCT (Portugal); JINR (Dubna); MON, RosAtom, RAS, RFBR and RAEP (Russia); MESTD (Serbia); SEIDI, CPAN, PCTI and FEDER (Spain); Swiss Funding Agencies (Switzerland); MST (Taipei); ThEPCenter, IPST, STAR, and NSTDA (Thailand); TUBITAK and TAEK (Turkey); NASU and SFFR (Ukraine); STFC (United Kingdom); DOE and NSF (USA). \hyphenation{Rachada-pisek} Individuals have received support from the Marie-Curie program and the European Research Council and Horizon 2020 Grant, contract No. 675440 (European Union); the Leventis Foundation; the A. P. Sloan Foundation; the Alexander von Humboldt Foundation; the Belgian Federal Science Policy Office; the Fonds pour la Formation \`a la Recherche dans l'Industrie et dans l'Agriculture (FRIA-Belgium); the Agentschap voor Innovatie door Wetenschap en Technologie (IWT-Belgium); the Ministry of Education, Youth and Sports (MEYS) of the Czech Republic; the Council of Science and Industrial Research, India; the HOMING PLUS program of the Foundation for Polish Science, cofinanced from European Union, Regional Development Fund, the Mobility Plus program of the Ministry of Science and Higher Education, the National Science Center (Poland), contracts Harmonia 2014/14/M/ST2/00428, Opus 2014/13/B/ST2/02543, 2014/15/B/ST2/03998, and 2015/19/B/ST2/02861, Sonata-bis 2012/07/E/ST2/01406; the National Priorities Research Program by Qatar National Research Fund; the Programa Severo Ochoa del Principado de Asturias; the Thalis and Aristeia programs cofinanced by EU-ESF and the Greek NSRF; the Rachadapisek Sompot Fund for Postdoctoral Fellowship, Chulalongkorn University and the Chulalongkorn Academic into Its 2nd Century Project Advancement Project (Thailand); the Welch Foundation, contract C-1845; and the Weston Havens Foundation (USA). \end{acknowledgments}
\section*{Introduction} The non self-adjoint operators are more difficult to study than the self-adjoint ones: no spectral theorem in general, wild resolvent growth... The related theory is studied by different authors: L. N. Trefethen \cite{Tr} for non symmetric matrices, W. D. Evans, R. T. Lewis, A. Zettl \cite{Ev} and R. T. Lewis \cite{Lws} for non self-adjoint operators in a Hilbert space. Recently, the interest in spectral properties of non self-adjoint operators has already led to a variety of new results, both in the continuous and discrete settings, e.g, bounds on complex eigenvalues \cite{R.F} and Lieb-Thirring type inequalities \cite{Han}, \cite{DHK}. This can be explained by the complicated structure of the resolvent of such an operator seen as an analytic function. In this paper we focus on directed graphs to study a non symmetric Laplacian. We develop a general approximation theory for the eigenvalues on directed graphs with non symmetric edge weights assuming only a condition of "total conductivity of the vertices" presented as the Assumption $(\beta)$. We investigate the spectrum of our discrete non self-adjoint Laplacian. We collect some basic properties of the Laplacian and we seek to show the emptiness of its essential spectrum by using isoperimetric inequalities. We explain how isoperimetric inequalities can be linked to the numerical range of non symmetric operators. In fact, for the self-adjoint Laplace-Beltrami operator, Jeff Cheeger proved an inequality that links the first nontrivial eigenvalue on a compact Riemannian manifold to a geometric constant $h$. This inspired an analogous theory for graphs (see \cite{Fuji}, \cite{A.G}). In this work, we introduce a kind of Cheeger constant on a filtration of a directed graph $G$ and we estimate the associated Laplacian $\Delta$. We give an estimation for the numerical range of $\Delta$ in terms of the Cheeger constant. We use this estimation and propose a condition on the weights for the absence of essential spectrum of \textit{heavy end} directed graphs. There is an analogous result of H. Donnelly and P. Li \cite{Don} for a self-adjoint operator on complete negatively curved manifolds. They show that the Laplacian on a rapidly curving manifold has a compact resolvent.\\ Section \ref{In} is devoted to some definitions and notions on a directed graph with non symmetric edge weights and the associate non symmetric differential Laplacian. We describe some basic results: Green's formula and the spectral properties of $\Delta$ and of its formal adjoint.\\ In Section \ref{2}, we study spectral properties of the bounded operator $\tilde{\Delta}$ by relying on known results for the symmetric case. \\ In Section \ref{ch}, we establish the Cheeger inequality for the non symmetric Dirichlet Laplacian on any subset of the set of vertices $V$ to give a lower bound for the bottom of the real part of the numerical range. We control the real part of the numerical range of $\Delta$ and relate it with the spectrum of the its closure $\overline{\Delta}$. We characterize the absence of essential spectrum of $\overline{\Delta}$. Fujiwara \cite{Fuji} and Keller \cite{Klr} introduced a criterion for the absence of essential spectrum of the symmetric Laplacian on a rapidly branching graph. In fact, our criterion is: positivity of the Cheeger constant at infinity on \textit{heavy end} graphs. \section{Preliminaries}\label{In} We review in this section some basic definitions on infinite weighted graphs and introduce the notation used in the article. They are introduced in \cite{Ma} for finite non symmetric graphs (see \cite{AT} and \cite{N.T} for the symmetric case). \subsection{Notion of Graphs} A directed weighted graph is a triplet $G :=(V,\vec{E},b)$, where $V$ is a countable set (the vertices), $\vec{E}$ is the set of directed edges and $b : V \times V\to\left[0,\infty\right) $ is a weight function satisfying the following conditions: \begin{itemize} \item $b(x,x)=0$ for all $x\in V$ \item $b(x,y)>0$ iff $(x,y)\in \vec{E}$ \end{itemize} In addition, we consider a measure on V given by a positive function $$m:V\to (0,\infty) .$$ The weighted graph is \textit{symmetric} if for all $x,y\in V$, $b(x,y)=b(y,x)$, as a consequence $(x,y)\in \vec{E}\Leftrightarrow (y,x)\in\vec{E}$.\\ The graph is called \textit{simple} if the weights $m$ and $b$ are constant and equal to $1$ on $V$ and $\vec{E}$ respectively.\\ The set $E$ of undirected edges is given by $$E=\left\{\{x,y\},~(x,y)\in\vec{E}\text{ or } (y,x)\in\vec{E}\right\}.$ \begin{defi} Define for a subset $\Omega$ of $V$, the vertex boundary and the edge boundary of $\Omega$ respectively by: $$\partial_V\Omega=\big\{ y\in\Omega:~\{x,y\}\in E~\text{ for some } x\in \Omega^c\big\} $$ $$\partial_E \Omega=\Big\{(x,y)\in \vec{E}:~ (x\in \Omega,~y\in \Omega^{c} )~~or ~~(x\in \Omega^{c},~y\in \Omega)\Big\}.$$ \end{defi} On a non symmetric graph we have two notions of connectedness. \begin{defi} \begin{itemize} \item A path between two vertices $x$ and $y$ in $V$ is a finite set of directed edges $(x_1,y_1);~(x_2,y_2);..;(x_n,y_n),~n\geq 2$ such that $$x_1=x,~y_n=y \text{ and } x_i=y_{i-1}~~\forall~2\leq i\leq n$$ \item $G$ is called connected if two vertices are always related by a path. \item $G$ is called strongly connected if for all vertices $x,y$ there is a path from $x$ to $y$ and one from $y$ to $x$. \end{itemize} \end{defi} \subsection{Functional spaces} Let us introduce the following spaces associated to the graph $G$:\\ \begin{itemize} \item the space of functions on the graph $G$ is considered as the space of complex functions on V and is denoted by $$\mathcal{C}(V)=\{f:V\to \mathbb{C} \}$$ \item $\mathcal{C}_c(V)$ is its subset of finite supported functions; \\ \item we consider for a measure $m$, the space $$\ell^2(V,m)=\{f\in \mathcal{C}(V), ~~\sum_{x\in V}m(x)|f(x)|^2<\infty\}.$$ It is a Hilbert space when equipped by the scalar product given by $$(f,g)_m=\sum_{x\in V}m(x)f(x)\overline{g(x)}.$$ The associated norm is given by: $$\|f\|_m=\sqrt{(f,f)_m}.$$ \end{itemize} \subsection{Laplacian on a directed graph} In this work, we assume that the graph under consideration is connected, locally finite, without loops and satisfies for all $x\in V$ the following conditions: $$\sum_{y\in V}b(x,y)>0 \text{ and }\sum_{y\in V}b(y,x)>0.$$ We introduce the combinatorial Laplacian $\Delta$ defined on $\mathcal{C}_c(V)$ by: $$\Delta f(x)=\frac{1}{m(x)}\sum_{y\in V}b(x,y)\left( f(x)-f(y)\right) .$$ For all $x\in V$ we note by $\beta^{+}(x)=\displaystyle{\sum_{y\in V}b(x,y)}$, in particular if $m(x)=\beta^+(x)$ then the Laplacian is said to be the normalized Laplacian and it is defined by: $$\tilde{\Delta}f(x)=\frac{1}{\beta^+(x)}\sum_{y\in V}b(x,y)\big(f(x)-f(y)\big).$$ \textbf{ Dirichlet operator}: Let $U $ be a subset of $ V$, $f\in \mathcal{C}_c(U)$ and $g:V\to \mathbb{C}$ the extension of $f$ to $V$ by setting $g = 0$ outside $U$. For any operator $A$ on $\mathcal{C}_c(V)$, the Dirichlet operator $A^{D}_U$ is defined by $$ A^{D}_U(f)=A(g)\vert_ U .$$ The operator $\Delta$ may be non symmetric if the edge weight is not symmetric. \begin{prop} The formal adjoint $\Delta'$ of the operator $\Delta$ is defined on $\mathcal{C}_c(V)$ by: $$\Delta' f(x)=\frac{1}{m(x)}\left( \sum_{y\in V}b(x,y)f(x)-\sum_{y\in V}b(y,x)f(y)\right) .$$ \end{prop} \begin{demo} For all $f,g \in \mathcal{C}_c(V)$, we have \begin{align*} (\Delta f,g)_m=&\sum_{(x,y)\in \vec{E}}b(x,y)\big( f(x)-f(y)\big) \overline{g(x)}\\ =&\sum_{x\in V}f(x)\sum_{y\in V}b(x,y)\overline{g(x)}-\sum_{(y,x)\in \vec{E}}b(y,x) \overline{g(y)}f(x)\\ =&\sum_{x\in V}f(x) \left( \sum_{y\in V}b(x,y)\overline{g(x)}-\sum_{(y,x)\in \vec{E}}b(y,x) \overline{g(y)}\right). \end{align*} As $(\Delta f,g)_m=(f,\Delta'g)_m$, so we get $$\Delta' f(x)=\frac{1}{m(x)}\left( \sum_{y\in V}b(x,y)f(x)-\sum_{y\in V}b(y,x)f(y)\right) .$$ \end{demo} \begin{rem} The operator $\Delta'$ can be expressed as a Schr\"odinger operator with the potential $q(x)=\displaystyle{\frac{1}{m(x)}\sum_{ y\in V} \big(b(x, y)-b(y, x)\big),~ x\in V}$: $$\Delta' f(x)=\frac{1}{m(x)}\sum_{y\in V}b(y,x)\big(f(x)-f(y)\big)+q(x)f(x).$$ \end{rem} We introduce here the \textbf{Assumption} $(\beta)$ and we assume that it is satisfied by the considered weighted graph, throughout the rest.\\ \textbf{Assumption $(\beta)$}: for all $x\in V$,~ $\beta^+(x)=\beta^-(x)$\\ where $$\beta^+(x)=\sum_{y\in V }b(x,y)\text{ and }\beta^-(x)=\sum_{y\in V}b(y,x).$$ \begin{rem} The Assumption $(\beta)$ is natural. Indeed, it looks like the Kirchhoff's law in the electrical networks. \end{rem} \begin{coro}\label{comm} We suppose that the Assumption $(\beta)$ is satisfied, the operator $\Delta'$ is simply a Laplacian, given by $$\Delta' f(x)=\frac{1}{m(x)}\sum_{y\in V}b(y,x)\big(f(x)-f(y)\big).$$ \end{coro} In the sequel, for the sake of simplicity we introduce the symmetric Laplacian $H$ associated to the graph with the symmetric edge weight function $a(x,y) = b(x,y)+b(y,x)$. It acts on $\mathcal{C}_c(V)$ by, $$Hf(x)=(\Delta+\Delta')f(x)=\frac{1}{m(x)}\sum_{y\in V}a(x,y)\big(f(x)-f(y)\big).$$ The quadratic form $Q_\Delta$ of $H$ is given by $$Q_\Delta(f)=(\Delta f,f)+\overline{(\Delta f,f)},~f\in \mathcal{C}_c(V).$$ \begin{comm} Let $f\in \mathcal{C}_c(V)$, we have $Q_\Delta(f)=2\mathcal{R}e(\Delta f,f)$. Then \begin{equation}\label{symm} \inf_{\|f\|_m=1}Q_\Delta(f)=\inf_{\|f\|_m=1}2\mathcal{R}e(\Delta f,f). \end{equation} \end{comm} We establish an explicit Green's formula associated to the non self-adjoint Laplacian $\Delta$ from which any estimates on the symmetric quadratic form $Q_\Delta$ can be directly cited from the literature. \begin{lemm}(Green's Formula)\label{grn} Let $f$ and $g$ be two functions of $\mathcal{C}_c(V)$. Then under the Assumption $(\beta)$ we have $$(\Delta f,g)_m+\overline{(\Delta g,f)}_m=\sum_{(x,y)\in \vec{E}}b(x,y)\big( f(x)-f(y)\big) \big( \overline{g(x)-g(y)}\big).$$ \end{lemm} \begin{demo} The proof is given by a simple calculation. From Corollary \ref{comm}, we have \begin{align*} (\Delta f,g)_m+\overline{(\Delta g,f)}_m=&(H f,g)_m\\ =&\sum_{(x,y)\in \vec{E}} b(x,y)\big(f(x)-f(y)\big)\overline{g(x)}\\ +&\sum_{(y,x)\in \vec{E}} b(y,x)\big(f(x)-f(y)\big)\overline{g(x)}\\ =&\sum_{(x,y)\in \vec{E}} b(x,y)\Big(f(x)\overline{g(x)}+f(x)\overline{g(x)}-f(y)\overline{g(x)} -f(x)\overline{g(y)}\Big)\\ =&\sum_{(x,y)\in \vec{E}} b(x,y)\big( f(x)-f(y)\big) \big(\overline{g(x)-g(y)}\big). \end{align*} \end{demo} We refer to \cite{Kts} page 243 for the definitions of the spectrum and the essential spectrum of a closed operator $A$ in a Hilbert space $\mathcal{H}$, with domain $D(A)$. \begin{defi}\label{deff} \begin{itemize} \item The spectrum $\sigma(A)$ of $A$ is the set of all complex numbers $\lambda$ such that $(A-\lambda)$ has no bounded inverse. \item The essential spectrum $\sigma_{ess}(A)$ of $A$ is the set of all complex numbers $\lambda$ for which the range $R(A-\lambda)$ is not closed or $\dim\ker(A-\lambda)=\infty$. \end{itemize} \end{defi} \section{Spectral analysis of the bounded case}\label{2} This part concerns some basic properties of the bounded non self-adjoint Laplacian $\tilde{\Delta}$. We introduce the concept of the numerical range. It has been extensively studied the last few decades. This is because it is very useful in studying and understanding the spectra of operators (see \cite{Ber}, \cite{JY}, \cite{Arl}).\\ \begin{defi} The numerical range of an operator $T$ with domain $D(T)$, denoted by $W(T)$ is the non-empty set $$W(T)=\{(T f,f),~~f\in D(T),~\parallel f\parallel=1 \}.$$ \end{defi} The following Theorem in \cite{JY} shows that the spectrum behave nicely with respect to the closure of the numerical range. \begin{theo} Let $\mathcal{H}$ be a reflexive Banach space and $T$ a bounded operator on $\mathcal{H}$. Then: $$\sigma(T)\subset \overline{W(T)}.$$ \end{theo} The following Proposition is one of the main tools when working with the normalized Laplacian. \begin{prop} Suppose that the Assumption $(\beta)$ is satisfied. Then $\tilde{\Delta}$ is bounded by 2. \end{prop} \begin{demo} \begin{align}\label{C.S} \mid(\tilde{\Delta} f,g)_{\beta^+}\mid=&\mid \sum_{x\in V}\overline{g(x)}\sum_{y\in V} b(x,y)\big(f(x)-f(y)\big)\mid\notag\\ \leq& \sum_{x\in V}\beta^+(x) |f(x)\overline{g(x)}|+\sum_{x\in V}\mid\overline{g(x)}\mid\sum_{y\in V} b(x,y)\mid f(y)\mid\notag\\ \end{align} by the Assumption $(\beta)$ and the Cauchy-Schwarz inequality we prove the result: \begin{align*} \mid(\tilde{\Delta} f,g)_{\beta^+}\mid\leq& \big(f,f\big)_{\beta^+}^{\frac{1}{2}}\big(g,g\big)_{\beta^+}^{\frac{1}{2}}+\sum_{x\in V}\mid\overline{g(x)}\mid\Big(\sum_{y\in V} b(x,y)\Big)^{\frac{1}{2}}\Big(\sum_{y\in V} b(x,y)\mid f(y)\mid^2\Big)^{\frac{1}{2}}\\ \leq& \big(f,f\big)_{\beta^+}^{\frac{1}{2}}(g,g)_{\beta^+}^{\frac{1}{2}}+\Big(\sum_{x\in V}\beta^+(x)\mid g(x)\mid^2\Big)^{\frac{1}{2}}\Big(\sum_{x\in V}\sum_{y\in V} b(x,y)\mid f(y)\mid^2\Big)^{\frac{1}{2}}\\ \leq& (f,f)_{\beta^+}^{\frac{1}{2}}(g,g)_{\beta^+}^{\frac{1}{2}}+(g,g)_{\beta^+}^{\frac{1}{2}}\Big(\sum_{y\in V}\mid f(y)\mid^2\sum_{x\in V} b(x,y)\Big)^{\frac{1}{2}}\notag\\ \leq& \big(f,f\big)_{\beta^+}^{\frac{1}{2}}\big(g,g\big)_{\beta^+}^{\frac{1}{2}}+\big(g,g\big)_{\beta^+}^{\frac{1}{2}}\Big(\sum_{y\in V}\mid f(y)\mid^2\beta^-(y)\Big)^{\frac{1}{2}}\notag\\ \leq& 2\big(f,f\big)_{\beta^+}^{\frac{1}{2}}\big(g,g\big)_{\beta^+}^{\frac{1}{2}}\notag. \end{align*} Then $$\|\tilde{\Delta}\|_{\beta^+}=\sup_{\|f\|_{\beta^+}\leq 1\atop \|g\|_{\beta^+}\leq 1}\mid(\tilde{\Delta} f,g)_{\beta^+}\mid\leq 2.$$ \end{demo} It is useful to develop some basic properties of the numerical range to make the computations of the spectrum of the Laplacian. \begin{prop} \begin{enumerate} Let $G$ be a connected graph, satisfying the Assumption $(\beta)$. Then \item $\sigma(\tilde{\Delta})\subset D(1,1)$, the closed disc with center $(1,0)$ and radius $1$. \item If $\beta^+(V)< \infty $, then $0$ is a simple eigenvalue of $\tilde{\Delta}$. \end{enumerate} \end{prop} \begin{demo} \begin{enumerate} \item By Cauchy-Schwarz inequality as in \eqref{C.S}, for $f\in D(\Delta)$ we have \begin{align*} \mid(\tilde{\Delta} f,f)_{\beta^+}-(f,f)_{\beta^+}\mid&=\mid\sum_{x\in V}\sum_{y\in V}b(x,y)f(x)\overline{f(y)}\mid\\ &\leq\sum_{x\in V}\sum_{y\in V}b(x,y)\mid f(x)\overline{f(y)}\mid\\ &\leq(f,f)_{\beta^+} \end{align*} which implies that $W(\tilde{\Delta})\subset D(1,1)$. \item If $\displaystyle{\sum_{x\in V}\beta^{+}(x)}=\displaystyle{\sum_{x\in V}\beta^+(x)<\infty}$, the constant function is an eigenfunction of $\tilde{\Delta}$ associated to $0$. Then $0$ is an eigenvalue of $\tilde{\Delta}$. Now, we suppose that $f$ is an eigenfunction of $\tilde{\Delta}$ associated to $0$, therefore $\big((\tilde{\Delta}+\tilde{\Delta}')f,f\big)=0$. Thus by connectedness of $G$, $f$ is constant. \end{enumerate} \end{demo} It is obvious that $\mathcal{R}e(A)=\dfrac{1}{2}\big(A+A^{*}\big)$ if $A$ is a bounded operator, but this is not true in general. The result below establishes a link between the real part of a matrix and its eigenvalues considered as the roots of the characteristic polynomial, see \cite{L.G} page 8. The adjoint of a square matrix is the transpose of its conjugate. \begin{lemm}\label{lema} Let $A$ be a square matrix of size $n$, $\lambda_k(A)$ and $\lambda_k(\mathcal{R}e(A))$, $k=1,..,n$ the eigenvalues of $A$ and $\mathcal{R}e(A)$ respectively. Suppose that the eigenvalues of $\mathcal{R}e(A)$ are labelled in the increasing order, so that, $\lambda_1(\mathcal{R}e(A))\leq\lambda_2(\mathcal{R}e(A))..\leq\lambda_n(\mathcal{R}e(A))$. Then $$\sum^{n}_{k=n-q+1}\mathcal{R}e(\lambda_k(A))\leq \sum^{n}_{k=n-q+1}\lambda_k(\mathcal{R}e(A)),~~\forall q=1,..,n$$ and the equality prevails for $q=n$. \end{lemm} \begin{rem} It should be noted that for a matrix $A$, $\lambda_k(\mathcal{R}e(A))$ and $\mathcal{R}e(\lambda_k(A))$ are not equal in general. We can see \cite{Ma} for a counter-example. \end{rem} In the following we study some generalities of eigenvalues of $\tilde{\Delta}^{D}_\Omega$, where $\Omega$ is a finite subset of $V$. We assume that they are ordered as follows: $$\mathcal{R}e(\lambda_1(\tilde{\Delta}^{D}_\Omega))\leq\mathcal{R}e(\lambda_2(\tilde{\Delta}^{D}_\Omega))..\leq\mathcal{R}e(\lambda_n(\tilde{\Delta}^{D}_\Omega)).$$ \begin{lemm}\label{ag} Let $\Omega$ be a finite non-empty subset of $V$, we have $$\lambda_1(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))\leq\mathcal{R}e(\lambda_1(\tilde{\Delta}^{D}_\Omega)).$$ \end{lemm} \begin{demo} Let $f$ be an eigenfunction associated to $\lambda_1(\tilde{\Delta}^D_\Omega)$. By the variational principle of $\lambda_1(\tilde{H}^D_\Omega)$, we have \begin{align*} \lambda_1(\tilde{H}^D_\Omega)&\leq\dfrac{(\tilde{H}^D_\Omega f,f)_m}{(f,f)_m}\\ &=\dfrac{(\tilde{\Delta}^D_\Omega f,f)_m}{(f,f)_m}+\dfrac{\overline{(\tilde{\Delta}^D_\Omega f,f)}_m}{(f,f)_m}\\ &=\lambda_1(\tilde{\Delta}^D_\Omega)+\overline{\lambda_1(\tilde{\Delta}^D_\Omega)}. \end{align*} \end{demo} The next statement contains an additional information about the eigenvalues of $\tilde{\Delta}^D_\Omega$. \begin{prop}\label{finit} Let $\Omega$ be a finite non-empty subset of $V$ $(\#\Omega=n)$ such that $\partial_V\Omega\neq\emptyset$. Then the following assertions are true \begin{enumerate} \item $0<\mathcal{R}e(\lambda_1(\tilde{\Delta}^{D}_\Omega))\leq 1$. \item $\lambda_1(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))+\lambda_n(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))\leq 2$. \end{enumerate} \end{prop} \begin{demo} \begin{enumerate} \item From Theorem 4.3 of \cite{A.G}, we have $\lambda_1(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))>0$ and by Lemma \ref{ag} we conclude the left inequalty. Next, by Lemma \ref{lema} we have for $q=n$: $$\sum^{n}_{k=1}\mathcal{R}e(\lambda_k(\tilde{\Delta}^{D}_\Omega))= \sum^{n}_{k=1}\lambda_k(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega)$$ then $$n\mathcal{R}e(\lambda_1(\tilde{\Delta}^{D}_\Omega))\leq\sum^{n}_{k=1}\lambda_k(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega)=Tr\big(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega)\big)=n$$ which proves that $$\mathcal{R}e(\lambda_1(\tilde{\Delta}^{D}_\Omega))\leq 1.$$ \item It is deduced from the result of the symmetric case, see Theorem 4.3 \cite{A.G}. \end{enumerate} \end{demo} \begin{coro} Let $\Omega$ be a finite non-empty subset of $V$, then $$\mathcal{R}e(\lambda_n(\tilde{\Delta}^{D}_\Omega))<2.$$ \end{coro} \begin{demo} Applying the Lemma \ref{lema} for $q=1$, we get $$\mathcal{R}e(\lambda_n(\tilde{\Delta}^{D}_\Omega))\leq\lambda_n(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega)).$$ But by (2) of Proposition \ref{finit}, we have : $$\lambda_n(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))\leq 2- \lambda_1(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega)).$$ Then from the general property $\lambda_1(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))>0$, we conclude that $\lambda_n(\mathcal{R}e(\tilde{\Delta}^{D}_\Omega))< 2$. \end{demo} \section{Spectral study of the unbounded case}\label{ch} This part includes the study of the bounds on the numerical range and the essential spectrum of a closed Laplacian. Both issues can be approached via isoperimetric inequalities.\\ \subsection{Closable operator} The purpose of the theory of unbounded operators is essentially to construct closed extensions of a given operator and to study their properties. \begin{defi} \textbf{Closable operators}: A linear operator $T : D(T) \to \mathcal{H}$ is closable if it has closed extensions. \end{defi} An interesting property for the Laplacian $\Delta$ is its closability. \begin{prop} Let $G$ be a graph satisfying the Assumption $(\beta)$. Then $\Delta$ is a closable operator. \end{prop} \begin{demo} We shall use the Theorem of T. Kato which says that an operator densely defined is closable if its numerical range is not the whole complex plane, see \cite{Kts}, page 268. Let $\lambda\in W(\Delta)$, there is $f\in \mathcal{C}_c(V)$ such that $\parallel f \parallel_m=1$ and $\lambda=(\Delta f,f)_m$. From the Green's formula we have, $$2 \mathcal{R}e(\lambda)=\sum_{(x,y)\in \vec{E}} b(x,y)\mid f(x)-f(y)\mid^{2}\geq 0.$$ It follows that $W(\Delta)\subset \big\{\lambda\in \mathbb{C},~~\mathcal{R}e(\lambda)\geq 0\big\}\subsetneq \mathbb{C}$. \end{demo} For such operators, another property of interest is the property of being closed. \begin{defi} The closure of $\Delta$ is the operator $\overline{\Delta}$, defined by \begin{itemize} \item $D(\overline{\Delta})=\big\{f\in \ell^{2}(V,m),~~\exists~ (f_n)_{n\in\mathbb{N}}\in \mathcal{C}_c(V),~f_n\to f \text{ and } ~\Delta f_n \text{ converge } \big\}$ \item $\overline{\Delta}f:=\displaystyle{\lim_{n\to \infty}}\Delta f_n ,~~ f\in D(\overline{\Delta})$ and $(f_n)_n\in \mathcal{C}_c(V)$ such that $f_n\to f$. \end{itemize} \end{defi} For an unbounded operator the relation between the spectrum and the numerical range is more complicated. But for a closed operator we have the following inclusion, see \cite{Kts} and \cite{Arl}. \begin{prop}\label{spn} Let $T$ be a closed operator. Then $ \sigma_{ess}(T)\subset \overline{W(T)}$. \end{prop} More precisely, let us define the following numbers: \begin{equation*} \eta(T)=\inf\{\mathcal{R}e \lambda:~~\lambda \in \sigma(T)\}. \end{equation*} \begin{equation*} \nu(T)=\inf\{\mathcal{R}e \lambda:~~\lambda\in W(T)\}. \end{equation*} \begin{equation*} \eta^{ess}(T)=\inf\{\mathcal{R}e \lambda:~~\lambda \in \sigma_{ess}(T)\}. \end{equation*} The Proposition \ref{spn} induces this Corollary. \begin{coro} \begin{equation}\label{rang} \eta^{ess}(\overline{\Delta})\geq \nu(\overline{\Delta}). \end{equation} \end{coro} \begin{rem} If $\Delta$ is self-adjoint, then $\eta(\Delta)=\nu(\Delta)$. But this is not the case in general. \end{rem} \subsection{Cheeger inequalities} For a non symmetric graph $G$, we prove bound estimates on the real part of the numerical range of $\Delta$ in terms of the Cheeger constant. We use this estimation to characterize the absence of the essential spectrum of $\overline{\Delta}$.\\ First, we recall the definitions of the Cheeger constants on $\Omega\subset V$: \begin{equation*} h(\Omega)~ = \inf_{U\subset \Omega\atop finite}\frac{b(\partial_E U )}{m(U)} \end{equation*} and \begin{equation*} \tilde{h}(\Omega)~ = \inf_{U\subset \Omega\atop finite}\frac{b(\partial_E U )}{\beta^+(U)} \end{equation*} where for a subset $U$ of $V$, $$b(\partial_E U)=\sum_{(x,y)\in \partial_E U}b(x,y)$$ $$\beta^+(U)=\sum_{x\in U}\beta^+(x) \text{ and }m(U)=\sum_{x\in U}m(x).$$ We define in addition: $$m_{\Omega}=\inf \left\{\frac{\beta^+(x)}{m(x)},~~x\in \Omega\right\}$$ $$M_{\Omega}=\sup \left\{\frac{\beta^+(x)}{m(x)},~~x\in \Omega\right\}.$$ Cheeger's Theorems had appeared in many works on symmetric graphs. They give estimations of the bottom of the spectrum of the Laplacian in terms of the Cheeger constant. The inequality \eqref{coi} controls the lower bound of the real part of $\lambda \in W(\Delta^{D}_\Omega)$. \begin{theo}\label{chee} Let $\Omega\subset V$, the bottom of the real part of $W(\Delta^{D}_\Omega)$ satisfies the following inequalities: \begin{equation}\label{coi} \frac{{h}^{2}(\Omega)}{8}~\leq~M_\Omega\nu(\Delta^{D}_\Omega)~\leq ~\frac{1}{2}M_\Omega h(\Omega). \end{equation} \end{theo} \begin{demo} From the works of J. Dodziuk \cite{Dod} and A. Grigoryan \cite{A.G}, we can deduce the following bounds of the symmetric quadratic form $Q_{\Delta^{D}_\Omega}$ on $\mathcal{C}_c(\Omega)$, $$\frac{{h}^{2}(\Omega)}{8}~\leq~M_\Omega\inf_{\|f\|_m=1}Q_{\Delta^{D}_\Omega}(f)~\leq ~\frac{1}{2} M_\Omega h(\Omega).$$ Then using the equality \eqref{symm} we conclude our estimation. \end{demo} We deduce in particular the following inequalities. \begin{coro} Let $\Omega\subset V$, we have \begin{equation*}\label{c} \frac{{\tilde{h}}^{2}(\Omega)}{8}~\leq~\nu(\tilde{\Delta}^{D}_\Omega)~\leq ~\frac{1}{2}\tilde{h}(\Omega). \end{equation*} \end{coro} \begin{prop} Let $\Omega\subset V$ and $g\in\mathcal{C}_c(\Omega),~\|g\|_m=1 $. Let $\lambda=(\Delta^{D}_\Omega g,g)_m\in W(\Delta^{D}_\Omega)$. Then \begin{equation}\label{hhh} m_{\Omega}\frac{\mathcal{R}e(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}}{( g,g)_{\beta^+}}\leq2\mathcal{R}e(\lambda)\leq M_{\Omega}\frac{\mathcal{R}e(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}}{( g,g)_{\beta^+}}. \end{equation} \end{prop} \begin{demo} We have for all $x\in \Omega$ $$m_{\Omega}m(x)\leq \beta^+(x) \leq M_{\Omega}m(x)$$ therefore $$m_{\Omega}(g,g)_m\leq ( g,g)_{\beta^+} \leq M_{\Omega}(g,g)_m$$ which implies that: \begin{equation*}\label{Dir} m_{\Omega}\frac{\mathcal{R}e(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}}{( g,g)_{\beta^+}}\leq \frac{Q_{\Delta^{D}_\Omega}(g)}{2(g,g)_m}\leq M_{\Omega}\frac{\mathcal{R}e(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}}{( g,g)_{\beta^+}} \end{equation*} because $(\Delta^{D}_\Omega g,g)_m=(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}$, for all $g\in\mathcal{C}_c(\Omega).$ \end{demo} \begin{coro} Let $\Omega\subset V$, we have \begin{equation}\label{10} m_\Omega\frac{\tilde{h}^{2}(\Omega)}{8}~\leq~\nu(\Delta^{D}_\Omega). \end{equation} \end{coro} We can also estimate the real part of any element of the numerical range of $\Delta^{D}_\Omega$ in terms of the isoperimetric constant $\tilde{h}$. \begin{coro} \label{spe} For all $\Omega\subset V$ and $\lambda\in W(\Delta^{D}_\Omega)$ we have \begin{equation} m_{\Omega}\big(2-\sqrt{4-\tilde{h}^2(\Omega)}\big)\leq 2 \mathcal{R}e(\lambda)\leq M_{\Omega}\big(2+\sqrt{4-{\tilde{h}^2(\Omega)}}\big). \end{equation} \end{coro} \begin{demo} We follow the same approach as Fujiwara in Proposition 1 \cite{Fuji}, and we apply it to the symmetric Laplacian $\tilde{H}^D_\Omega=\tilde{\Delta}^D_\Omega+\tilde{\Delta'}^D_\Omega$, we obtain, for all $g\in \mathcal{C}_c(\Omega)$ $$2-\sqrt{4-\tilde{h}^2(\Omega)}\leq\frac{2\mathcal{R}e(\tilde{\Delta}^{D}_\Omega g,g)_{\beta^+}}{( g,g)_{\beta^+}}\leq 2+\sqrt{4-{\tilde{h}^2(\Omega)}}.$$ Hence we obtain the result by a direct corollary of the inequality \eqref{hhh}. \end{demo} \subsection{Absence of essential spectrum from Cheeger constant }\label{s ess} This subsection is devoted to the study of the essential spectrum relative to the geometry of the weighted graph. We evaluate the interest of the study of the numerical range of non self-adjoint operators. Indeed, the knowledge of the numerical range of the Laplacian brings an essential information on its essential spectrum. \\ We provide the Cheeger inequality at infinity on a filtration of graph $G$. \begin{defi} A graph $H=(V_H,\vec{E}_H)$ is called a subgraph of $G=(V_G,\vec{E}_G)$ if $V_H\subset V_G$ and $\vec{E}_H=\big\{(x,y) ;~x,y \in V_H~~\big\}\cap \vec{E}_G $. \end{defi} \begin{defi A filtration of $G=(V,\vec{E})$ is a sequence of finite connected subgraphs $\{G_n=(V_n,\vec{E}_n),~~n\in \mathbb{N} \}$ such that $G_n\subset G_{n+1}$ and: $$\displaystyle\bigcup_{n\geq 1} V_n=V.$$ \end{defi} Let $G$ be an infinite connected graph and $\{G_n,~n\in \mathbb{N}\}$ a filtration of $G$. Let us denote $$m_\infty=\lim_{n\rightarrow \infty}~ m_{V_n^c}$$ $$M_\infty=\lim_{n\rightarrow \infty}~ M_{V_n^c}$$ The Cheeger constant at infinity is defined by: $$h_\infty=\lim_{n\rightarrow \infty}h(V^{c}_n).$$ \begin{rem} These limits exist in $\mathbb{R}^+\cup \{\infty\}$ because $m_{V_n^c}$, $M_{V_n^c}$ and $h(V_n^c)$ are monotone sequences. \end{rem} \begin{rem} The Cheeger constant at infinity $h_\infty$ is independent of the filtration. Indeed it can be defined, as in \cite{Fuji} and \cite{Klr}, by $h_\infty =\displaystyle{\lim_{K\to G}h(K^c)}$, where $K$ runs over all finite subsets because the graph is locally finite. \end{rem} \begin{defi}\label{ends} $G$ is called with \textit{heavy ends} if $m_\infty=\infty$. \end{defi} \begin{lemm}\label{cc} For any subset $\Omega$ of $V$ such that $\Omega^c$ is finite, we have $$\nu (\overline{\Delta}^D_\Omega)=\nu(\Delta^D_\Omega).$$ \end{lemm} \begin{demo} It is easy to see that $$b=\inf_{\lambda\in W(\overline{\Delta}^D_\Omega)}\mathcal{R}e(\lambda)\leq\inf_{\lambda\in W(\Delta^D_\Omega)}\mathcal{R}e(\lambda)=a.$$ Let $f\in D(\overline{\Delta}^D_\Omega)=\{f\in D(\overline{\Delta}),~f(x)=0,~\forall ~x\in \Omega^{c}\} $ such that $\parallel f\parallel_m=1$. Hence there is a sequence $(f_n)\in \mathcal{C}_c(V)=D(\Delta)$ which converges to $f$ and $(\Delta f_n)$ converges to $\overline{\Delta}f$. It follows that $g_n=\mathbf{1}_\Omega f_n=0$ on $\Omega^c$ and $(\Delta^{D}_\Omega g_n)$ converges to $\overline{\Delta}^D_\Omega f$. So $$a\leq \nu(\Delta^D_U)\leq \mathcal{R}e(\Delta^D_U g_n,g_n)_m \underset{n\to\infty}{\longrightarrow } \mathcal{R}e(\overline{\Delta}^D_U f,f)_m$$ then $$a\leq b.$$ \end{demo} \begin{theo}\label{spee} The essential spectrum of $\overline{\Delta}$ satisfies: \begin{equation*} \frac{h^{2}_\infty }{8}~\leq~M_\infty\eta^{ess}(\overline{\Delta}) \end{equation*} and \begin{equation}\label{Ses} m_\infty\frac{\tilde{h}^{2}_\infty }{8}~\leq~\eta^{ess}(\overline{\Delta}). \end{equation} \end{theo} \begin{demo} Let $\{G_n,~n\in \mathbb{N}\}$ be a filtration of $G$, from the inequality \eqref{rang} we get, $$\nu(\overline{\Delta}^D_{V^c_n}) \leq\eta^{ess}(\overline{\Delta}^D_{V^c_n}) .$$ From Theorem 5.35 of T. Kato page 244 \cite{Kts}, the essential spectrum is stable by a compact perturbation, we obtain $$\sigma_{ess}(\overline{\Delta})=\sigma_{ess}(\overline{\Delta}^D_{V^c_n}).$$ Therefore $$\nu(\Delta^D_{V^c_n})\leq \eta^{ess}(\overline{\Delta}),$$ we use Theorem \ref{chee} and the equality \eqref{10}, then we find the result by taking the limit at $\infty$. \end{demo} The following Corollary follows from Theorem \ref{spee}. It gives an important characterization for the absence of the essential spectrum especially it includes the case of rapidly branching graphs. \begin{coro} The essential spectrum of $\overline{\Delta}$ on a heavy end graph $G$ with $\tilde{h}_\infty>0$ is empty. \end{coro} \begin{demo} The emptiness of the essential spectrum for $\overline{\Delta}$ on a graph with \textit{heavy ends} is an immediate Corollary of the inequality \eqref{Ses}, then if $m_\infty=\infty$ where $\tilde{h}_\infty> 0$, we have $\sigma_{ess}(\overline{\Delta})=\emptyset.$ \end{demo} \thanks{ \textbf{Acknowledgments}: I take this opportunity to express my gratitude to my thesis directors Colette Ann\'e and Nabila Torki-Hamza for all the fruitful discussions, helpful suggestions and their guidance during this work. This work was financially supported by the "PHC Utique" program of the French Ministry of Foreign Affairs and Ministry of higher education and research and the Tunisian Ministry of higher education and scientific research in the CMCU project number 13G1501 "Graphes, G\'eom\'etrie et th\'eorie Spectrale". Also I like to thank the Laboratory of Mathematics Jean Leray of Nantes (LMJL) and the research unity (UR/13ES47) of Faculty of Sciences of Bizerta (University of Carthage) for their financial and their continuous support.} I would like to thank the anonymous referee for the careful reading of my paper and the valuable comments and suggestions.
\section{Introduction}\label{sec:introduction} Preference learning has become a major branch of AI, with applications in decision support systems in general and in e-commerce in particular~\cite{Fuernkranz2011}. For instance, recommender systems based on collaborative filtering make predictions on a single user's preferences by exploiting information about large groups of users. Another example are intelligent tutoring systems, which learn a student's preferences in order to deliver personalized content to the student. To design and analyze algorithms for learning preferences of a single user, one needs an abstract model for representing user preferences. Some approaches model preferences quantitatively, thus allowing for expressing the relative magnitude of preferences between object pairs, while others are purely qualitative, expressing partial orders or rankings over objects~\cite{keeney1993decisions,DOMSHLAK20111037}. Most application domains are of multi-attribute form, meaning that the set of possible alternatives (i.e., objects, or outcomes) is defined on a set of attributes and every alternative corresponds to an assignment of values to the attributes. Such combinatorial domains require compact models to capture the preference information in a structured manner. In recent years, various models have been suggested, such as Generalized Additive Decomposable (GAI-net) utility functions~\cite{AllenSG17}, Lexicographic Preference Trees~\cite{Booth:2010:LCL:1860967.1861021}, and Conditional Preference Networks (CP-nets)~\cite{1-DBLP:journals/jair/BoutilierBDHP04}. CP-nets provide a compact qualitative preference representation for multi-attribute domains where the preference of one attribute may depend on the values of other attributes. The study of their learnability \cite{Koriche2010685,DBLP:conf/ijcai/DimopoulosMA09,Lang:2009:CLS:1661445.1661580,10.1109/TKDE.2012.231,www,AllenSG17} is an ongoing topic in research on preference elicitation. For example, Koriche and Zanuttini \cite{Koriche2010685} investigated query learning of $k$-bounded acyclic CP-nets (i.e., with a bound $k$ on the number of attributes on which the preferences for any attribute may depend). Their successful algorithms used both membership and equivalence queries, cf.\ \cite{Angluin:1988:QCL:639961.639995}, while they proved that equivalence queries alone are not sufficient for efficient learnability. CP-nets have also been studied in models of passive learning from examples, both for batch learning \cite{DBLP:conf/ijcai/DimopoulosMA09,Lang:2009:CLS:1661445.1661580,10.1109/TKDE.2012.231,AllenSG17} and for online learning \cite{www,LaberniaZMYA17}. The focus of our work is on the design of methods for learning CP-nets though interaction with the user, and on an analysis of the complexity of such learning problems. In particular, we study the model of learning from membership queries, in which users are asked for information on their preference between two objects. To the best of our knowledge, algorithms for learning CP-nets from membership queries only have not been studied in the literature yet. We argue below (in Section~\ref{sec:perfect}) why algorithms using membership queries alone are of importance to research on preference learning. In a nutshell, membership queries seem to be more easily deployable in preference learning than equivalence queries and, from a theoretical point of view, it is interesting to see how powerful they are in comparison to equivalence queries. The latter alone are known to be insufficient for efficient learning of acyclic CP-nets~\cite{Koriche2010685}. Therefore, one major part of this article deals with learning CP-nets from membership queries only. A potential application of our approach is in recommender systems. Many recommender systems request item ratings from users, i.e., they pose queries to the user in the form of an item, and the user is expected to rate the item on a fixed scale. It has been shown though that replacing such queries with queries in which users are asked to express a preference between two items may be a more useful approach in recommender systems~\cite{JonesBB11}. In every formal model of learning, a fundamental question in assessing learning algorithms is how many queries or examples would be needed by the best possible learning algorithm in the given model. For several models, lower bounds can be derived from the Vapnik Chervonenkis dimension ($\mathrm{VCD}$, \cite{VC71}). This central parameter is one of several that, in addition to yielding bounds on the performance of learning algorithms, provide deep insights into the combinatorial structure of the studied concept class. Such insights can in turn help to design new learning algorithms. A classical result states that $\log_2(4/3)d$ is a lower bound on the number of equivalence and membership queries required for learning a concept class whose $\mathrm{VCD}$ equals $d$~\cite{AuerL99}. Likewise, it is known that a parameter called the teaching dimension~\cite{GK95} is a lower bound on the number of membership queries required for learning~\cite{queriesRevisited}. Therefore, another major part of this article deals with calculating exact values or non-trivial bounds on a number of learning-theoretic complexity parameters, such as the $\mathrm{VCD}$ and the teaching dimension. All these complexity parameters are calculated under the assumption that information about user preferences is provided for so-called swaps, exclusively. A swap is a pair of objects that differ in the value of only a single attribute. Learning CP-nets over swap examples is an often studied scenario~\cite{Koriche2010685,DBLP:conf/ijcai/DimopoulosMA09,labernia2016query,LaberniaYMA18,LaberniaZMYA17}, which we adopt here for various reasons detailed in Section~\ref{sec:representation}. Our main contributions are the following: (a) We provide the first study that exactly calculates the $\mathrm{VCD}$ for the class of unbounded acyclic CP-nets, and give a lower bound for any bound $k$. So far, the only existing studies present a lower bound \cite{Koriche2010685}, which we prove incorrect for large values of $k$, and asymptotic complexities \cite{qqq}. The latter show that $\mathrm{VCD}\in\Theta(2^n)$ for $k=n-1$ and $\mathrm{VCD}\in\tilde{\Theta}(n2^k)$ when $k\in o(n)$, in agreement with our result that $\mathrm{VCD}=2^n-1$ for $k=n-1$, and is at least $\mathrm{VCD}\ge 2^k-1+(n-k)2^k$ for general values of $k$. It should be noted that both previous studies assume that CP-nets can be incomplete, i.e., for some attributes, preference relations may not be fully specified. In our study, we first investigate the (not uncommon) assumption that CP-nets are complete, but then we extend each of our results to the more general case that includes incomplete CP-nets, as well. Further, some of our results are more general than existing ones in that they cover also the case of CP-nets with multi-valued attributes (as opposed to binary attributes.) As a byproduct of our study, we obtain that the $\mathrm{VCD}$ of the class of \emph{all}\/ consistent CP-nets (whether acyclic or cyclic)\footnote{A consistent CP-net is one that does not prefer an outcome $o$ over another outcome $o'$ while at the same time preferring $o'$ over $o$. Acyclic CP-nets are always consistent, but cyclic ones are not necessarily so.} equals that of the class of all acyclic CP-nets. Hence, the class of acyclic CP-nets is less expressive than that of all consistent CP-nets, but may (at least in some models) be as hard to learn. (b) We further provide exact values (or, in some cases, non-trivial bounds) for two other important information complexity parameters, namely the teaching dimension \cite{GK95}, and the recursive teaching dimension \cite{ZLHZ11} (c) Appendix\ref{sec:struct} gives an in-depth study of structural properties of the class of all complete acyclic CP-nets that are of importance to learning-theoretic studies. (d) We present a new algorithm that learns tree-structured CP-nets (i.e., the case $k=1$) from membership queries only and use our results on the teaching dimension to show that our algorithm is close to optimal. We further extend our algorithm to deal with the general case of $k$-bounded acyclic CP-nets with bound $k\ge 1$. (e) In most real-world scenarios, one would expect some degree of noise in the responses to membership queries, or that sometimes no response at all is obtained. To address this issue, we demonstrate how, under certain assumptions on the noise and the missing responses, our algorithm for learning tree CP-nets can be adapted to handle incomplete or incorrect answers to membership queries. (f) We re-assess the degree of optimality of Koriche and Zanuttini's algorithm for learning bounded acyclic CP-nets, using our result on the $\mathrm{VCD}$. This article extends a previous conference paper~\cite{AMZ16}. Theorem 4 in this conference paper included an incorrect claim about the so-called self-directed learning complexity of classes of acyclic CP-nets; the incorrect statement has been removed in this extended version. \section{Related Work}\label{sec:related} This section sets the problems studied in the present paper into the context of the existing literature, both in terms of methods for learning CP-nets and in terms of studies of learning-theoretic complexity parameters in general. \subsection{Learning CP-Nets} The problem of learning CP-nets has recently gained a substantial amount of attention \cite{DBLP:conf/ijcai/DimopoulosMA09,DBLP:conf/ijcai/KoricheZ09,Lang:2009:CLS:1661445.1661580,Koriche2010685,qqq,10.1109/TKDE.2012.231,www,Liu20137,DBLP:conf/ijcai/MichaelP13,DBLP:conf/stairs/BigotMZ14,AllenSG17}. Both in active and in passive learning, a sub-problem to be solved by many natural learning algorithms is the so-called \emph{consistency problem}. This decision problem is defined as follows. A problem instance consists of a CP-net $N$ and a set $S$ of user preferences between objects, in the form of ``object $o$ is preferred over object $o'$'' or ``object $o$ is not preferred over object $o'$''. The question to be answered is whether or not $N$ is consistent with $S$, i.e., whether the partial order $\succ$ over objects that is induced by $N$ satisfies $o\succ o'$ if $S$ states that $o$ is preferred over $o'$, and satisfies $o\not\succ o'$ if $S$ states that $o$ is not preferred over $o'$. The consistency problem was shown to be NP-hard even if $N$ is restricted to be an acyclic $k$-bounded CP-net for some fixed $k\geq 2$ and even when, for any object pair $(o,o')$ under consideration, the outcomes $o$ and $o'$ differ in the values of at most two attributes \cite{DBLP:conf/ijcai/DimopoulosMA09}. Based on this result, Dimopoulos et al.~\cite{DBLP:conf/ijcai/DimopoulosMA09} showed that complete acyclic CP-nets with bounded indegree are not efficiently PAC-learnable, i.e., learnable in polynomial time in the PAC model. The authors, however, then showed that such CP-nets are efficiently PAC-learnable from examples that are drawn exclusively from the set of so-called transparent entailments. Specifically, this implied that complete acyclic $k$-bounded CP-nets are efficiently PAC-learnable from swap examples. Michael and Papageorgiou \cite{DBLP:conf/ijcai/MichaelP13} then provided a comprehensive experimental view on the performance of the algorithm proposed in \cite{DBLP:conf/ijcai/DimopoulosMA09}. Their work also proposed an efficient method for checking whether a given entailment is transparent or not. These studies focus on learning approximations of target CP-nets passively and from randomly chosen data. By comparison, all algorithms we propose below learn target CP-nets exactly and they actively pose queries in order to collect training data, following Angluin's model of learning from membership queries~\cite{Angluin:1988:QCL:639961.639995}. Lang and Mengin \cite{Lang:2009:CLS:1661445.1661580} considered the complexity of learning binary separable CP-nets, in various learning settings.\footnote{A CP-net is separable if it is $0$-bounded, i.e., the preferences over the domain of any attribute are not conditioned on the values of other attributes.} The literature also includes results on learning CP-nets from noisy examples, namely, via statistical hypothesis testing \cite{Liu20137}, using evolutionary algorithms and metaheuristics~\cite{HaqqaniL17,AllenSG17}, or by learning the induced graph directly, which takes time exponential in the number of attributes~\cite{10.1109/TKDE.2012.231}. These results cannot be compared to the ones presented in the present paper, as (i) they focus on approximating instead of exactly learning the target CP-net, and (ii) the noise models on which they build differ substantially from the settings we consider. In our first setting, there is no noise in the data whatsoever. The second setting we study is one in which the membership oracle may corrupt a certain number of query responses, but there is no randomness to the process. Instead, one analyzes learning under an adversarial assumption on the oracle's choice of which answers to corrupt, and then investigates whether exact learning is still possible~\cite{Angluin1997,DBLP:journals/tcs/BennetB07,DBLP:journals/jcss/BishtBK08}. To the best of our knowledge, this setting has not been studied in the context of CP-nets so far. As for active learning, Guerin et al.~\cite{www} proposed a heuristic online algorithm that is not limited to swap comparisons. The algorithm assumes the user to provide explicit answers of the form ``object $o$ is preferred over object $o'$'', ``object $o'$ is preferred over object $o$'', or ``neither of the two objects is preferred over the other'' to any query $(o,o')$. Labernia et al.~\cite{LaberniaZMYA17} proposed another online learning algorithm based on swap observations where the latter can be noisy. It is assumed that the target CP-net represents the global preference for a group of users and the noise is due to variations of a user's preference compared to the global one. The authors formally proved that their algorithm produces a close approximation to the target CP-net and analyzed the algorithm empirically under random noise. Again, as in all the related literature discussed above, the most striking difference to our setting is that these works focus on approximating the target CP-net rather than learning it exactly To the best of our knowledge, the only studies of learning CP-nets in Angluin's query model, where the target concept is identified exactly, are one by Koriche and Zanuttini \cite{Koriche2010685} and one by Labernia et al.~\cite{labernia2016query}. Koriche and Zanuttini assumed perfect oracles and investigated the problem of learning complete and incomplete bounded CP-nets from membership and equivalence queries over the swap instance space. They showed that complete acyclic CP-nets are not learnable from equivalence queries alone but are \emph{attribute-efficiently} learnable from membership and equivalence queries. Attribute-efficiency means that the number of queries required is upper-bounded by a function that is polynomial in the size of the input, but only logarithmic in the number of attributes. In the case of tree CP-nets, their results hold true even when the equivalence queries may return non-swap examples. The setting considered in their work is more general than ours and exhibits the power of membership queries when it comes to learning CP-nets. Labernia et al.~\cite{labernia2016query} investigated the problem of learning an average CP-net from multiple users using equivalence queries alone. However, neither study addresses the problem of learning complete acyclic CP-nets from membership queries alone, whether corrupted or uncorrupted. We provide a detailed comparison of our methods to those by Koriche and Zanuttini in Section~\ref{sec:perfect}. In a nutshell, our algorithm improves on theirs in that it does not require equivalence queries, but has the downside of not being attribute-efficient. The latter is not an artefact of our algorithm---we argue in Section~\ref{sec:perfect} why attribute-efficient learning of CP-nets with membership queries alone is not possible. \subsection{Complexity Parameters in Computational Learning Theory} The Vapnik Chervonenkis Dimension, also called VC dimension~\cite{VC71}, is one of the best studied complexity parameters in the computational learning theory literature. Upper and/or lower sample complexity bounds that are linear in the VC dimension are known for various popular models of concept learning, namely for PAC learning, which is a basic model of learning from randomly chosen examples~\cite{Hanneke16}, for exact learning from equivalence and membership queries, which is a model of learning from active queries~\cite{AuerL99}, and, in some special cases even for learning from teachers~\cite{DFSZ14,SimonZ15}. Because of these bounds, knowledge of the VC dimension value of a concept class $\mathcal{C}$ can help in assessing learning algorithms for $\mathcal{C}$. For example, if the number of queries consumed by an algorithm learning $\mathcal{C}$ exceeds a known lower bound on the query complexity by a constant factor, we know that the algorithm is within a constant factor of optimal. For this reason, the VC dimension of classes of CP-nets have been studied in the literature. Koriche and Zanuttini \cite{Koriche2010685}, for the purpose of analyzing their algorithms for learning from equivalence and membership queries, established a lower bound on the VC dimension of the class of complete and incomplete $k$-bounded binary CP-nets. Chevaleyre et al.~\cite{qqq} gave asymptotic estimates on the VC dimension of classes of CP-nets. They showed that the VC dimension of acyclic binary CP-nets is $\Theta(2^n)$ for arbitrary CP-nets and $\tilde{\Theta}(n2^k)$ for $k$-bounded CP-nets. Here $n$ is the number of attributes in a CP-net. The results by Chevaleyre et al.\ are in agreement with our results, stating that $\mathrm{VCD}$ is $2^n-1$ for arbitrary acyclic CP-nets and at least $(n-k)2^k+2^k-1$ for $k$-bounded ones. Our work improves on both of these contributions. Firstly, we correct a mistake in the lower bound published by Koriche and Zanuttini. Secondly, compared to asymptotic studies by Chevaleyre et al., we calculate exact values or explicit lower bounds on the VC dimension. Thirdly, we calculate the VC dimension also for the case that the attributes in a CP-net have more than two values. To the best of our knowledge, there are no other studies that address learning-theoretic complexity parameters of CP-nets. The present paper computes two more parameters, namely the teaching dimension~\cite{GK95} and the recursive teaching dimension~\cite{ZLHZ11}, both of which address the complexity of machine teaching. Recently, models of machine teaching have received increased attention in the machine learning community~\cite{Zhu15,ZhuSZR18}, since they try to capture the idea of helpfully selected training data as would be expected in many human-centric applications. In our study, teaching complexity parameters are of relevance for two reasons. First, the teaching dimension is a lower bound on the number of membership queries required for learning~\cite{GK95}, und thus a tool for evaluating the efficiency of our learning algorithms relative to the theoretic optimum. Second, due to the increased interest in machine teaching, the machine learning community is looking for bounds on the efficiency of teaching, in terms of other well-studied parameters. The recursive teaching dimension is the first teaching complexity parameter that was shown to be closely related to the VC dimension. It is known to be at most quadratic in the VC dimension~\cite{HuWLW17}, and under certain structural properties even equal to the VC dimension~\cite{DFSZ14}. However, it remains open whether or not it is upper-bounded by a function linear in the VC dimension~\cite{SimonZ15}. With the class of all unbounded acyclic CP-nets, we provide the first example of an ``interesting'' concept class for which the VC dimension and the recursive teaching dimension are equal, provably without satisfying any of the known structural properties that would imply such equality. Thus, our study of the recursive teaching dimension of classes of CP-nets may be of help to ongoing learning-theoretic studies of teaching complexity in general. \section{Background} \label{sec:background} This section introduces the terminology and notation used subsequently, and motivates the formal settings studied in the rest of the paper. \subsection{Conditional Preference Networks (CP-nets)} We largely follow the notation introduced by Boutilier et al.~\cite{1-DBLP:journals/jair/BoutilierBDHP04} in their seminal work on CP-nets; the reader is referred to Table~\ref{table:notation} for a list of the most important notation used throughout our manuscript. \begin{table} \centering \begin{small} \begin{tabular}{|l|l|} \hline notation&meaning\\\hline\hline $n$&number of variables\\\hline $m$ &size of the domain of each variable\\\hline $k$&upper bound on the number of parents of a variable in a CP-net\\\hline $V$&set of $n$ distinct variables, $V=\{v_1,v_2,\dots,v_n\}$\\\hline $v_i$&variable in $V$, for $1\le i\le n$\\\hline $D_{v_i}$&domain $\{v^i_1,v^i_2,\dots,v^i_m\}$ of variable $v_i\in V$\\\hline $\mathcal{O}_{X}$ for $X\subseteq V$&set of vectors (outcomes over $X$) that assign each $v_i\in X$ a value in $D_{v_i}$\\\hline $\mathcal{O}$&set of all outcomes over the full variable set $V$; equal to $\mathcal{O}_V$\\\hline $o$&outcome over the full variable set $V$, i.e., an element of $\mathcal{O}$\\\hline $o\succ o'$&outcome $o\in\mathcal{O}$ is strictly preferred over outcome $o'\in\mathcal{O}$\\\hline $o[X]$&projection of outcome $o\in\mathcal{O}$ onto a set $X\subseteq V$; $o[v_i]$ is short for $o[\{v_i\}]$\\\hline $x (=(o,o'))$&swap pair of outcomes\\\hline $V(x)$&swapped variable of $x$\\\hline $x.1$ and $x.2$&$o$ and $o'$ respectively, where $x=(o,o')$ is a swap\\\hline $x[\Gamma]$&projection of $x.1$ (and also of $x.2$) onto a set $\Gamma\subseteq V\setminus\{V(x)\}$\\\hline $Pa(v_i)$&set of the parent variables of $v_i$; note that $Pa(v_i)\subseteq V\backslash\{v_i\}$\\\hline $\succ^{v_i}_{u}$&conditional preference relation of ${v_i}$ in the context of $u$, where $u\in \mathcal{O}_{Pa(v_i)}$\\\hline $\mathrm{CPT}(v_i)$&conditional preference table of $v_i$\\\hline $size(\mathrm{CPT}(v_i))$&size (number of preference statements) of $\mathrm{CPT}(v_i)$; note $size(\mathrm{CPT}(v_i)) \le m^{|Pa(v_i)|}$\\\hline $E$&set of edges in a CP-net, where $(v_i,v_j)\in E$ iff $v_i\in Pa(v_j)$\\\hline $\mathcal{C}$&a concept class\\\hline $c$&a concept in a concept class\\\hline $\mathcal{X}$&instance space over which a concept class is defined\\\hline $\mathcal{X}_{swap}$&instance space of swap examples (without redundancies)\\\hline $\overline{\mathcal{X}}_{swap}$&instance space of swap examples (with redundancies)\\\hline $c(x)$&label that concept $c$ assigns to instance $x$\\\hline $\mathrm{VCD}(\mathcal{C})$&VC dimension of concept class $\mathcal{C}$\\\hline $\mathrm{TD}(\mathcal{C})$&teaching dimension of concept class $\mathcal{C}$\\\hline $\mathrm{TD}(c,\mathcal{C})$&teaching dimension of concept $c$ with respect to concept class $\mathcal{C}$\\\hline $\mathrm{RTD}(\mathcal{C})$&recursive teaching dimension of concept class $\mathcal{C}$\\\hline $\mathcal{C}^k_{ac}$&class of all complete acyclic $k$-bounded CP-nets, over $\mathcal{X}_{swap}$\\\hline $\overline{\mathcal{C}}^k_{ac}$&class of all complete or incomplete acyclic $k$-bounded CP-nets, over $\overline{\mathcal{X}}_{swap}$\\\hline $e_{max}$&$(n-k)k+\binom{k}{2}\ (\le nk)$; maximum number of edges in a CP-net in $\mathcal{C}^k_{ac}$ or $\overline{\mathcal{C}}^k_{ac}$\\\hline $\mathcal{M}_k$&$(n-k)m^k+\frac{m^k-1}{m-1}$; maximum number of statements in a CP-net in $\mathcal{C}^k_{ac}$ or $\overline{\mathcal{C}}^k_{ac}$\\\hline $\mathcal{U}_k$&smallest possible size of an $(m,n-1,k)$-universal set\\\hline LIM&strategy to combat a limited oracle\\\hline MAL&strategy to combat a malicious oracle\\\hline $F^1(x)$&set of all swap instances differing from $x$ in exactly one non-swapped variable\\\hline \end{tabular} \end{small} \caption{Summary of notation.}\label{table:notation} \end{table} Let $V=\{v_1,v_2,\dots,v_n\}$ be a set of attributes or variables. Each variable $v_i\in V$ has a set of possible values (its domain) $D_{v_i}=\{v^i_1,v^i_2,\dots,v^i_m\}$. We assume that every domain $D_{v_i}$ is of a fixed size $m\geq 2$, independent of $i$. An assignment $x$ to a set of variables $X\subseteq V$ is a mapping for every variable $v_i\in X$ to a value from $D_{v_i}$. We denote the set of all assignments of $X\subseteq V$ by $\mathcal{O}_{X}$ and remove the subscript when $X=V$. A preference is an irreflexive, transitive binary relation $\succ$. For any $o,o'\in \mathcal{O}$, we write $o\succ o'$ (resp. $o\nsucc o'$) to denote the fact that $o$ is strictly preferred (resp. not preferred) to $o'$, where $o$ and $o'$ are incomparable w.r.t.~$\succ$ if both $o\nsucc o'$ and $o'\nsucc o$ holds. We use $o[X]$ to denote the projection of $o$ onto $X\subset V$ and write $o[v_i]$ instead of $o[\{v_i\}]$. The CP-net model captures complex qualitative preference statements in a graphical way. Informally, a CP-net is a set of statements of the form $\gamma:v^i_{\sigma(1)}\succ\ldots\succ v^i_{\sigma(m)}$ which states that the preference over $v_i$ with $D_{v_i}=\{v^i_1,v^i_2,\dots,v^i_m\}$ is conditioned upon the assignment of $\Gamma\subseteq V\backslash\{v_i\}$, where $\sigma$ is some permutation over $\{1,\ldots,m\}$. In particular, when $\Gamma$ has the value $\gamma\in \mathcal{O}_\Gamma$ and $s<t$, $v^i_{\sigma(s)}$ is preferred to $v^i_{\sigma(t)}$ as a value of $v_i$ \emph{ceteris paribus} (all other things being equal). That is, for any two outcomes $o,o'\in \mathcal{O}$ where $o[v_i]=v^i_{\sigma(s)}$ and $o'[v_i]=v^i_{\sigma(t)}$ the preference holds when i) $o[\Gamma]=o'[\Gamma]=\gamma$ and ii) $o[Z]=o'[Z]$ for $Z=V\backslash (\Gamma\cup\{v_i\})$. In such case, we say $o$ is preferred to $o'$ ceteris paribus. Clearly, there could be exponentially many pairs of outcomes ($o$,$o'$) that are affected by one such statement. CP-nets provide a compact representation of preferences over $\mathcal{O}$ by providing such statements for every variable. For every $v_i\in V$, the decision maker\footnote{This can be any entity in charge of constructing the preference network, i.e., a computer agent, a person, a group of people, etc.} chooses a set $Pa(v_i)\subseteq V\backslash\{v_i\}$ of parent variables that influence the preference order of ${v_i}$. For any $\gamma\in \mathcal{O}_{Pa(v_i)}$, the decision maker may choose to specify a total order $\succ^{v_i}_{\gamma}$ over $D_{v_i}$. We refer to $\succ^{v_i}_{\gamma}$ as the conditional preference statement of ${v_i}$ in the context of $\gamma$. A Conditional Preference Table for $v_i$, $\mathrm{CPT}(v_i)$, is a set of conditional preference statements $\{\succ^{v_i}_{\gamma_1},\ldots,\succ^{v_i}_{\gamma_z}\}$. \begin{definition}[CP-net \cite{1-DBLP:journals/jair/BoutilierBDHP04}] Given, $V$, $Pa(v)$, and $\mathrm{CPT}(v)$ for $v\in V$, a CP-net is a directed graph $(V,E)$, where, for any $v_i,v_j\in V$, $(v_i,v_j)\in E$ iff $v_i\in Pa(v_j)$. \label{def:cpnets} \end{definition} A CP-net is acyclic if it contains no cycles. We call a CP-net $k$-bounded, for some $k\le n-1$, if each vertex has indegree at most $k$, i.e., each variable has a parent set of size at most $k$. CP-nets that are $0$-bounded are also called separable; those that are $1$-bounded are called tree CP-nets. When speaking about the class of ``unbounded'' acyclic CP-nets, we refer to the case when no upper bound is given on the indegree of nodes in a CP-net, other than the trivial bound $k=n-1$. \begin{definition}\label{def:complete} $\mathrm{CPT}(v_i)$ is said to be complete, if, for every element $\gamma\in\mathcal{O}_{Pa(v_i)}$, the preference relation $\succ^{v_i}_\gamma$ is defined, i.e., $\mathrm{CPT}(v_i)$ contains a statement that imposes a total order on $D_{v_i}$ for every context $\gamma$ over the parent variables. By contrast, $\mathrm{CPT}(v_i)$ is incomplete, if there exists some $\gamma\in\mathcal{O}_{Pa(v_i)}$ for which the preference relation $\succ^{v_i}_\gamma$ is empty. Analogously, a CP-net $N$ is said to be complete if every $\mathrm{CPT}$ it poses is complete; otherwise it is incomplete. \end{definition} Note that we do not allow strictly partial orders as preference statements; a preference relation in a $\mathrm{CPT}$ must either be empty or impose a total order. In the case of binary CP-nets, which is the focus of the majority of the literature on CP-nets, this restriction is irrelevant, since every order on a domain of two elements is either empty or total. In the non-binary case though, the requirement that every $\mathrm{CPT}$ statement be either empty or a total order is a proper restriction. It would be possible to also study non-binary CP-nets that are incomplete in the sense that some $\mathrm{CPT}$ statements impose proper partial orders, but this extension is not discussed below. Lastly, we assume CP-nets are defined in their minimal form, i.e., there is no \emph{dummy} parent in any $\mathrm{CPT}$ that actually does not affect the preference relation. \begin{example} Figure \ref{fig:example1network} shows a complete acyclic CP-net over $V=\{A,B,C\}$ with $D_A=\{a,\bar{a}\}$, $D_B=\{b,\bar{b}\}$, $D_C=\{c,\bar{c}\}$. Each variable is annotated with its $\mathrm{CPT}$. For variable $A$, the user prefers $a$ to $\bar{a}$ unconditionally. For $C$, the preference depends on the values of $A$ and $B$, i.e., $Pa(C)=\{A,B\}$. For instance, in the context of $a\bar{b}$, $\bar{c}$ is preferred over $c$. Removing any of the four statements in $\mathrm{CPT}(C)$ would result in an incomplete CP-net. \label{example1} \end{example} Two outcomes $o,\hat{o}\in \mathcal{O}$ are swap outcomes (`swaps' for short) if they differ in the value of exactly one variable $v_i$; then $v_i$ is called the swapped variable \cite{1-DBLP:journals/jair/BoutilierBDHP04}. The size of a preference table for a variable $v_i$, denoted by $size(\mathrm{CPT}(v_i))$, is the number of preference statements it holds which is $m^{|Pa(v_i)|}$ if $\mathrm{CPT}(v_i)$ is complete. The size of a CP-net $N$ is defined as the sum of its tables' sizes.\footnote{It might seem more adequate to define the size of a $\mathrm{CPT}$ to be $(m-1)$ times the number of its preference statements, as each preference statement consists of $m-1$ pairwise preferences. In the binary case, i.e., when $m=2$, this makes no difference. As this technical detail does not affect our results, we ignore it and define the size of a $\mathrm{CPT}$ and of a CP-net simply by the overall number of its statements.} \begin{example} In Figure \ref{fig:example1}, $abc,\bar{a}bc$ are swaps over the swapped variable $A$. The size of the CP-net is $1+2+4=7$. \end{example} We will frequently use the notation $\mathcal{M}_k=\max\{size(N)\mid N\mbox{ is a }k\mbox{-bounded acyclic CP-net}\}$, which refers to the maximum number of statements in any $k$-bounded acyclic CP-net over $n$ variables, each of domain size $m$. Note that a CP-net has to be complete in order to attain this maximum size. It can be verified that $\mathcal{M}_k=(n-k)m^k+\frac{m^k-1}{m-1}$. \begin{lemma}\label{lem:Mk} The maximum possible size $\mathcal{M}_k$ of a $k$-bounded acyclic CP-net over $n$ variables of domain size $m$ is given by $\mathcal{M}_k=(n-k)m^k+\frac{m^k-1}{m-1}$. \end{lemma} \begin{proof} We first make the following claim: any $k$-bounded acyclic CP-net of largest possible size has (i) exactly $1$ variable of indegree $r$, for any $r\in\{0,\ldots,k-1\}$ and (ii)~exactly $n-k$ variables of indegree $k$. For $k=0$, i.e., for separable CP-nets, there is no $r\in\{0,\ldots,k-1\}$, so the claim states the existence of exactly $n$ vertices of indegree $0$, which is obviously correct. Consider any $k$-bounded acyclic CP-net $N$ of largest possible size, where $k\ge 1$. Since $N$ is acyclic, it has a topological sort. W.l.o.g., suppose $(v_1,\ldots,v_n)$ is the sequence of variables in $N$ as they occur in a topological sort. Clearly, $v_1$ must have indegree $0$. If $v_2$ were also of indegree $0$, then $N$ would not be of maximal size since one could add $v_1$ as a parent of $v_2$ without violating the indegree bound $k$. The resulting CP-net would be of larger size than $N$, since the size of $\mathrm{CPT}(v_2)$ would grow by a factor of $m$ without changing the sizes of other CPTs. Hence $v_2$ has indegree $1$ in $N$. With the same argument, one can prove that $v_i$ has indegree $i-1$ in $N$, for $1\le i\le k+1$. For the variables $v_{k+2},\ldots,v_n$, one can apply the same argument but has to cap their indegrees at $k$ because $N$ is $k$-bounded. Hence $v_{k+1},\ldots,v_n$ all have indegree $k$. This establishes the claim. It remains to count the maximal number of statements in a CP-net $N$ of this specific structure. The maximal number of statements for a given CP-net graph is obviously obtained when the CP-net is complete, i.e., when the CPT for any variable $v$ has $m^{|Pa(v)|}$ rules. Summing up, we obtain $\sum_{i=0}^{k-1}m^i=\frac{m^k-1}{m-1}$ statements for the first $k$ variables in the topological sort, plus $(n-k)m^k$ statements for the remaining $n-k$ variables. \end{proof} From this lemma, we also know that the maximum possible number of edges in a $k$-bounded acyclic CP-net is $(n-k)k+\sum_{i=0}^{k-1}i=(n-k)k+\binom{k}{2}$. We will use the notation $e_{max}$ to refer to this quantity. \begin{definition}\label{def:emax} For given $n\ge 1$ and $k\in\{0,\ldots,n-1\}$, let $e_{max}=(n-k)k+\binom{k}{2}$ denote the maximum possible number of edges in a $k$-bounded acyclic CP-net over $n$ variables. \end{definition} Note that $e_{max}\le nk$. \begin{figure} \centering \begin{subfigure}[b]{0.35\textwidth} \centering \resizebox{.9\textwidth}{!}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick,scale=1] \node[state,] (A){A}; \node[state,] (B)[right of=A]{B}; \node[state] (C) at (1.5,-2.5){C}; \node (bCPT) at(1.7,1.2){\makecell[l]{$a:b\succ \bar{b}$\\$\bar{a}:\bar{b}\succ b$}}; \node (aCPT) at(-0.3,.9){$a\succ \bar{a}$}; \node (cCPT) at(3.0,-1.6){\makecell[l]{$ ab: c\succ \bar{c}$\\$a\bar{b}: \bar{c}\succ c$\\ $\bar{a}b: \bar{c}\succ c$\\ $\bar{a}\bar{b}: c\succ \bar{c}$\\}}; \path (A) edge[->] (C); \path (A) edge[->] (B); \path (B) edge[->] (C); \end{tikzpicture} } \caption{The CP-net.} \label{fig:example1network} \end{subfigure} \begin{subfigure}[b]{.35\textwidth} \centering \resizebox{.7\textwidth}{!}{ \begin{tikzpicture}[->,>=stealth',auto,node distance=1.2cm] \node (2) {$a\bar{b}\bar{c}$}; \node (3) [right of=2]{$\bar{a}b\bar{c}$}; \node (4) [right of=3] {$\bar{a}\bar{b}c$}; \node (5) [below of=2] {$ab\bar{c}$}; \node (6) [right of=5]{$a\bar{b}c$}; \node (7) [right of=6]{$\bar{a}bc$}; \node (8) [below of=6]{$abc$}; \node (1) [above of=3]{$\bar{a}\bar{b}\bar{c}$}; \path (1) edge (2) edge (4) (2) edge (5) (3) edge (5) edge (1) (4) edge (6) (5) edge (8) (6) edge (2) edge (8) (7) edge (3) edge (4) edge (8); \end{tikzpicture} } \caption{The induced preference graph.} \label{fig:graph} \end{subfigure} \caption{An acyclic CP-net (cf.~Def. \ref{def:cpnets}) and its induced preference graph (cf.~Def. \ref{def:inducedGraph}).} \label{fig:example1} \end{figure} The semantics of CP-nets is described in terms of improving flips. Let $\gamma\in \mathcal{O}_{Pa(v_i)}$ be an assignment of the parents for a variable $v_i\in V$. Let $\succ^{v_i}_\gamma=v^i_1\succ \ldots\succ v^i_m$ be the preference order of $v_i$ in the context of $\gamma$. Then, all else being equal, going from $v^i_j$ to $v^i_k$ is an improving flip over $v_i$ whenever $k<j\leq m$. \begin{example} In Figure \ref{fig:example1network}, $(a\bar{b}c,abc)$ is an improving flip with respect to the variable $B$. \end{example} For complete CP-nets, the improving flip notion makes every pair $(o,\hat{o})$ of swap outcomes comparable, i.e., either $o\succ \hat{o}$ or $\hat{o}\succ o$ holds \cite{1-DBLP:journals/jair/BoutilierBDHP04}. The question \quotes{is $o\succ \hat{o}$?} is then a special case of a so-called dominance query and can be answered directly from the preference table of the swapped variable. Let $v_i$ be the swapped variable of a swap $(o,\hat{o})$. Let $\gamma$ be the context of $Pa(v_i)$ in both $o$ and $\hat{o}$. Then, $o\succ \hat{o}$ iff $o[v_i]\succ^{v_i}_\gamma \hat{o}[v_i]$. A general dominance query is of the form: given two outcomes $o,\hat{o}\in \mathcal{O}$, is $o\succ \hat{o}$? The answer is yes, iff $o$ is preferred to $\hat{o}$, i.e., there is a sequence $(\lambda_1,\ldots,\lambda_n)$ of improving flips from $\hat{o}$ to $o$, where $\hat{o}=\lambda_1$, $o=\lambda_n$, and $(\lambda_i,\lambda_{i+1})$ is an improving flip for all $i\in\{1,\dots,n-1\}$ \cite{1-DBLP:journals/jair/BoutilierBDHP04}. \begin{example} In Figure \ref{fig:graph}, $abc\succ \bar{a}\bar{b}c$, as witnessed by the sequence $\bar{a}\bar{b}c\rightarrow a\bar{b}c\rightarrow abc$ of improving flips. \end{example} \begin{definition}[Induced Preference Graph~\cite{1-DBLP:journals/jair/BoutilierBDHP04}] The induced preference graph of a CP-net $N$ is a directed graph $G$ where each vertex represents an outcome $o\in \mathcal{O}$. An edge from $\hat{o}$ to ${o}$ exists iff $(o,\hat{o})\in\mathcal{O}\times \mathcal{O}$ is a swap w.r.t.\ some $v_i\in V$ and ${o}[v_i]$ precedes $\hat{o}[v_i]$ in $\succ^{v_i}_{o[Pa(v_i)]}$. \label{def:inducedGraph} \end{definition} Therefore, a CP-net $N$ defines a partial order $\succ$ over $\mathcal{O}$ that is given by the transitive closure of its induced preference graph. If $o\succ \hat{o}$ we say $N$ entails $(o,\hat{o})$. $N$ is consistent if there is no $o\in \mathcal{O}$ with $o\succ o$, i.e., if its induced preference graph is acyclic. Acyclic CP-nets are guaranteed to be consistent while such guarantee does not exist for cyclic CP-nets; the consistency of the latter depends on the actual values of the $\mathrm{CPT}$s \cite{1-DBLP:journals/jair/BoutilierBDHP04}. Lastly, the complexity of finding the best outcome in an acyclic CP-net has been shown to be linear \cite{1-DBLP:journals/jair/BoutilierBDHP04} while the complexity of answering dominance queries depends on the structure of CP-nets: PSPACE-complete for arbitrary (cyclic and acyclic) consistent CP-nets \cite{3-DBLP:journals/jair/GoldsmithLTW08} and linear in case of trees \cite{DBLP:conf/uai/BigotZFM13}. \begin{example} Figure \ref{fig:cyclicConsistent} shows an example of a cyclic CP-net that is consistent while Figure \ref{fig:cyclicInconsistent} shows an inconsistent one. Note that both share the same $\mathrm{CPT}$s except for $\mathrm{CPT}(C)$. The dotted edges in the induced preference graph of Figure \ref{fig:cyclicInconsistent} represent a cycle. \end{example} \begin{figure} \centering \begin{subfigure}[b]{.34\textwidth} \centering \resizebox{\textwidth}{!}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick,scale=1] \node[state,] (A){A}; \node[state,] (B)at (-1,-2.5){B}; \node[state] (C) at (1,-2.5){C}; \node (aCPT) at(0,.8){$a\succ \bar{a}$}; \node (bCPT) at(-2.5,-1.5){\makecell[l]{$a c: b\succ \bar{b}$\\ $a \bar{c}: b\succ \bar{b}$\\$\bar{a} c: \bar{b}\succ b$\\$\bar{a} \bar{c}: b\succ \bar{b}$}}; \node (cCPT) at(2.5,-1.5){\makecell[l]{$a b: c\succ \bar{c}$\\ $a \bar{b}: \bar{c}\succ c$\\$\bar{a} b: \bar{c}\succ c$\\$\bar{a} \bar{b}: \bar{c}\succ c$}}; \path (A) edge[->] (C) (A) edge[->] (B) (B) edge[bend right,->] (C) (C) edge[bend right,->] (B); \end{tikzpicture} } \caption{The network.} \label{fig:ccnetwork} \end{subfigure}\quad \begin{subfigure}[b]{.34\textwidth} \centering \resizebox{.55\textwidth}{!}{ \begin{tikzpicture} [->,>=stealth',auto,node distance=1cm] \node (2) {$a\bar{b}\bar{c}$}; \node (3) [right of=2]{$\bar{a}b\bar{c}$}; \node (4) [right of=3] {$\bar{a}\bar{b}c$}; \node (5) [below of=2] {$ab\bar{c}$}; \node (6) [right of=5]{$a\bar{b}c$}; \node (7) [right of=6]{$\bar{a}bc$}; \node (8) [below of=6]{$abc$}; \node (1) [above of=3]{$\bar{a}\bar{b}\bar{c}$}; \path (1) edge (2) edge (3) (2) edge (5) (3) edge (5) (4) edge (1) edge (6) (5) edge (8) (6) edge (2) edge (8) (7) edge (3) edge (4) edge (8); \end{tikzpicture} } \caption{The induced preference graph.} \label{fig:cyclicConsistentGraph} \end{subfigure} \caption{An example of a \emph{consistent} cyclic CP-net.} \label{fig:cyclicConsistent} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{.34\textwidth} \centering \resizebox{\textwidth}{!}{ \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm,semithick,scale=1] \node[state,] (A){A}; \node[state,] (B)at (-1,-2.5){B}; \node[state] (C) at (1,-2.5){C}; \node (aCPT) at(0,.8){$a\succ \bar{a}$}; \node (bCPT) at(-2.5,-1.5){\makecell[l]{$a c: b\succ \bar{b}$\\ $a \bar{c}: b\succ \bar{b}$\\$\bar{a} c: \bar{b}\succ b$\\$\bar{a} \bar{c}: b\succ \bar{b}$}}; \node (cCPT) at(2.3,-1.5){\makecell[l]{$b: c\succ \bar{c}$\\ $\bar{b}: \bar{c}\succ c$}}; \path (A) edge[->] (B) (B) edge[bend right,->] (C) (C) edge[bend right,->] (B); \end{tikzpicture} } \caption{The network.} \end{subfigure}\quad \begin{subfigure}[b]{.34\textwidth} \centering \resizebox{.55\textwidth}{!}{ \begin{tikzpicture} [->,>=stealth',auto,node distance=1cm] \node (2) {$a\bar{b}\bar{c}$}; \node (3) [right of=2]{$\bar{a}b\bar{c}$}; \node (4) [right of=3] {$\bar{a}\bar{b}c$}; \node (5) [below of=2] {$ab\bar{c}$}; \node (6) [right of=5]{$a\bar{b}c$}; \node (7) [right of=6]{$\bar{a}bc$}; \node (8) [below of=6]{$abc$}; \node (1) [above of=3]{$\bar{a}\bar{b}\bar{c}$}; \path (1) edge (2) edge[blue!50!black,dotted] (3) (2) edge (5) (3) edge (5) edge[blue!50!black,dotted] (7) (4) edge[blue!50!black,dotted] (1) edge (6) (5) edge (8) (6) edge (2) edge (8) (7) edge[blue!50!black,dotted] (4) edge (8); \end{tikzpicture} } \caption{The induced preference graph.} \label{fig:cyclicInconsistentGraph} \end{subfigure} \caption{An example of an \emph{inconsistent} cyclic CP-net.} \label{fig:cyclicInconsistent} \end{figure} \subsection{Concept Learning} The first part of our study is concerned with determining---for the case of acyclic CP-nets---the values of information complexity parameters that are typically studied in computational learning theory. By information complexity, we mean the complexity in terms of the amount of information a learning algorithm needs to identify a CP-net. Examples of such complexity notions will be introduced below. A specific complexity notion corresponds to a specific formal model of machine learning. Each such learning model assumes that there is an information source that supplies the learning algorithm with information about a hidden target concept $c^*$. The latter is a member of a concept class, which is simply the class of potential target concepts, and, in the context of this paper, also the class of hypotheses that the learning algorithm can formulate in the attempt to identify the target concept $c^*$. Formally, one fixes a finite set $\mathcal{X}$, called instance space, which contains all possible instances (i.e., elements of) an underlying domain. A concept $c$ is then defined as a mapping from $\mathcal{X}$ to $\{0,1\}$. Equivalently, $c$ can be seen as the set $c=\{x\in \mathcal{X} \mid c(x)=1\}$, i.e., a subset of the instance space. A \emph{concept class} $\mathcal{C}$ is a set of concepts. Within the scope of our study, the information source (sometimes called oracle), supplies the learning algorithm in some way or another with a set of \emph{labeled examples}\/ for the target concept $c^*\in C$. A labeled example for $c^*$ is a pair $(x,b)\in \mathcal{X}\times \{0,1\}$ where $x\in \mathcal{X}$ and $b=c(x)$. Under the set interpretation of concepts, this means that $b=1$ if and only if the instance $x$ belongs to the concept $c^*$. A concept $c$ is consistent with a set $S\subseteq X\times\{0,1\}$ of labeled examples, if and only if $c(x)=b$ for all $(x,b)\in S$, i.e., if every element of $S$ is an example for $c$. In practice, a concept is usually \emph{encoded} by a representation $\sigma(c)$ defined based on a representation class $\mathcal{R}$ \cite{Kearns:1994:ICL:200548}. Thus, one usually has some fixed representation class $\mathcal{R}$ in mind, with a one-to-one correspondence between the concept class $C$ and its representation class $R$. We will assume in what follows that the representation class is chosen in a way that minimizes the worst case size of the representation of any concept in $C$. Generally, there may be various interpretations of the term ``size;'' since we will focus on learning CP-nets, we use CP-nets as representations for concepts, and the size of a representation is simply the size of the corresponding CP-net as defined above. At the onset of a learning process, both the oracle and the learning algorithm (often called \emph{learner}\/ for short) agree on the representation class $\mathcal{R}$ (and thus also on the concept class $C$), but only the oracle knows the target concept $c^*$. After some period of communication with the oracle, the learner is required to identify the target concept $c^*$ either exactly or approximately. Many learning models have been proposed to deal with different learning settings \cite{Kearns:1994:ICL:200548,Angluin:1988:QCL:639961.639995,Littlestone88,V84}. These models typically differ in the constraints they impose on the oracle and the learning goal. One also distinguishes between learners that actively query the oracle for specific information content and learners that passively receive a set of examples chosen solely by the information source. One of the best known passive learning models is the \emph{Probably Approximately Correct } (PAC) model \cite{V84}. The PAC model is concerned with finding, with high probability, a close approximation to the target concept $c^*$ from randomly chosen examples. The examples are assumed to be sampled independently from an unknown distribution. On the other end of the spectrum, a model that requires exact identification of $c^*$ is Angluin's model for learning from queries \cite{Angluin:1988:QCL:639961.639995}. In this model, the learner actively poses queries of a certain type to the oracle. In this paper, we consider specifically two types of queries introduced by Angluin~\cite{Angluin:1988:QCL:639961.639995}, namely membership queries and equivalence queries. A membership query is specified by an element $x\in\mathcal{X}$ of the instance space, and it represents the question whether or not $c^*$ contains $x$. The oracle supplies the learner with the correct answer, i.e., it provides the label $c^*(x)$ in response to the membership query for $x$. In an equivalence query, the learner specifies a hypothesis $c$. If $c=c^*$, the learning process is completed as the learner has then identified the target concept. If $c\ne c^*$, the learner is provided with a labeled example $(x,c^*(x))$ that witnesses $c\ne c^*$. That means, $c^*(x)\ne c(x)$. Note that $x$ in this case can be any element in the symmetric difference of the sets associated with $c$ and $c^*$. A class $\mathcal{C}\subseteq 2^\mathcal{X}$ over some instance space $\mathcal{X}$ is learnable from membership and/or equivalence queries via a representation class $\mathcal{R}$ for $\mathcal{C}$, if there is an algorithm $\mathcal{A}$ such that for every concept $c^*\in \mathcal{C}$, $\mathcal{A}$ asks polynomially many adaptive membership and/or equivalence queries and then outputs a hypothesis $h$ that is equivalent to $c^*$. By adaptivity, we here mean that learning proceeds in rounds; in every round the learner asks a single query and receives an answer from the oracle before deciding on its subsequent query. The number of queries to be polynomial means that it is upper-bounded by a polynomial in $size(c^*)$ where $size(c^*)$ is the size of the minimal representation of $c^*$ w.r.t.~$\mathcal{R}$. The above definition is concerned only with the information or query complexity, i.e., the number of queries required to exactly identify any target concept. Moreover, $\mathcal{C}$ is said to be efficiently learnable from membership and/or equivalence queries if there exists an algorithm $\mathcal{A}$ that exactly learns $\mathcal{C}$, in the above sense, and runs in time polynomial in $size(c^*)$. Every one of the query strategies we describe in Section \ref{sec:perfect} gives an obvious polynomial time algorithm in this regard, and thus we will not explicitly mention run-time efficiency of learning algorithms henceforth. The combinatorial structure of a concept class $\mathcal{C}$ has implications on the complexity of learning $\mathcal{C}$, in particular on the sample complexity (sometimes called information complexity), which refers to the number of labeled examples the learner needs in order to identify any target concept in the class under the constraints of a given learning model. One of the most important complexity parameters studied in machine learning is the Vapnik-Chervonenkis dimension (VCD). In what follows, let $\mathcal{C}$ be a concept class over the (finite) instance space $\mathcal{X}$. \begin{definition}\cite{VC71} A subset $Y\subseteq\mathcal{X}$ is shattered by $\mathcal{C}$ if the projection of $\mathcal{C}$ onto $Y$ has $2^{|Y|}$ concepts. The VC dimension of $\mathcal{C}$, denoted by $\mathrm{VCD}(\mathcal{C})$, is the size of the largest subset of $\mathcal{X}$ that is shattered by $\mathcal{C}$. \end{definition} For example, if $\mathcal{X}$ contains 5 elements and $\mathcal{C}^5_3$ is the class of all subsets of $X$ that have size at most 3, then the VC dimension of $\mathcal{C}^5_3$ is 3. Clearly, no subset $Y$ of $\mathcal{X}$ of size 4 can be shattered by $\mathcal{C}^5_3$, since no concept in $\mathcal{C}^5_3$ would contains all 4 elements of $Y$. That means, one obtains only 15, not the full 16 possible concepts over $Y$ when projecting $\mathcal{C}^5_3$ onto $Y$. However, any subset $Y'\subset X$ of size 3 is indeed shattered by $\mathcal{C}^5_3$, as every subset of $Y'$ is also a concept in $\mathcal{C}^5_3$. The number of randomly chosen examples needed to identify concepts from $\mathcal{C}$ in the PAC-learning model is linear in $\mathrm{VCD}(\mathcal{C})$~\cite{BEHW89,Hanneke16}. By contrast to learning from random examples, in teaching models, the learner is provided with well-chosen labeled examples. \begin{definition}\cite{GK95,SM91} A teaching set for a concept $c^*\in\mathcal{C}$ with respect to $\mathcal{C}$ is a set $S=\{(x_1,\ell_1),\ldots,(x_z,\ell_z)\}$ of labeled examples such that $c^*$ is the only concept $c\in\mathcal{C}$ that satisfies $c(x_i)=\ell_i$ for all $i\in\{1,\ldots,z\}$. The teaching dimension of $c$ with respect to $\mathcal{C}$, denoted by $\mathrm{TD}(c,\mathcal{C})$, is the size of the smallest teaching set for $c$ with respect to $\mathcal{C}$. The teaching dimension of $\mathcal{C}$, denoted by $\mathrm{TD}(\mathcal{C})$, is given by $\mathrm{TD}(\mathcal{C})=\max\{\mathrm{TD}(c,\mathcal{C})\mid c\in\mathcal{C}\}$. \end{definition} Consider again the class $\mathcal{C}^5_3$ of all subsets of size at most 3 over a 5-element instance space. Any concept $c$ containing 3 instances has a teaching set of size 3 in this class: the three positively labeled examples referring to the elements contained in $c$ uniquely determine $c$. However, concepts with fewer than 3 elements do not have teaching sets smaller than 5, since any set consisting of 2 positive and 2 negative examples agrees with at least two different concepts in $\mathcal{C}^5_3$, and so does every set of 1 positive and 3 negative examples and every set of 4 negative examples. $\mathrm{TD}_{min}(\mathcal{C})=\min\{\mathrm{TD}(c,\mathcal{C})\mid c\in\mathcal{C}\}$ denotes the smallest TD of any $c\in\mathcal{C}$. In the class $\mathcal{C}^5_3$, the value for $\mathrm{TD}$ is 5, while the value for $\mathrm{TD}_{min}$ is 3. A well-studied variation of teaching is called recursive teaching. Its complexity parameter, the recursive teaching dimension, is defined by recursively removing from $\mathcal{C}$ all the concepts with the smallest TD and then taking the maximum over the smallest TDs encountered in that process. For the corresponding definition of teachers, see~\cite{ZLHZ11}. \begin{definition}\cite{ZLHZ11} Let $\mathcal{C}_0=\mathcal{C}$ and, for all $i$ such that $\mathcal{C}_i\ne\emptyset$, define $\mathcal{C}_{i+1}=\mathcal{C}_i\setminus\{c\in\mathcal{C}_i\mid\mathrm{TD}(c,\mathcal{C}_i)=\mathrm{TD}_{min}(\mathcal{C}_i)\}$. The recursive teaching dimension of $\mathcal{C}$, denoted by $\mathrm{RTD}(\mathcal{C})$, is defined by $\mathrm{RTD}(\mathcal{C})=\max\{\mathrm{TD}_{min}(\mathcal{C}_i)\mid i\ge 0\}$. \label{def:RTD} \end{definition} As an example, consider $\mathcal{C}'=\{c_1,c_2,\dots,c_t\}$ to be the class of singletons defined over the instance space $\mathcal{X}=\{x_1,x_2,\dots,x_t\}$ where $c_i=\{x_i\}$ and let $\mathcal{C}=\mathcal{C}'\cup\{c_0\}$, where $c_0$ is the empty concept, i.e., $c_0(x)=0$ for all $x\in \mathcal{X}$. Table \ref{table:singletonsClass} displays this class along with $\mathrm{TD}(c,\mathcal{C})$ for every $c\in \mathcal{C}$. Since distinguishing the concept $c_0$ from all other concepts in $\mathcal{C}$ requires $t$ labeled examples, one obtains $\mathrm{TD}(\mathcal{C})=t$. However, $\mathrm{RTD}(\mathcal{C})=1$ as witnessed by $\mathcal{C}_0=\mathcal{C}'$ (each concept in $\mathcal{C}'$ can be taught with a single example) and $\mathcal{C}_1=\{c_0\}$ (the remaining concept $c_0$ has a teaching dimension of $0$ with respect to the class containing only $c_0$). Note that also $\mathrm{VCD}(\mathcal{C})=1$, since there is no set of two examples that is shattered by $\mathcal{C}$. Similarly, one can verify that $\mathrm{RTD}(\mathcal{C}^5_3)=3$. \begin{table} \centering \caption{The class $\mathcal{C}$ of all singletons and the empty concept over a set of $t$ instances, along with the teaching dimension value of each individual concept.} \begin{tabular}{|c||c|c|c|c|c|c||c|} \hline $\mathcal{C}$& $x_1$ & $x_2$ & $x_3$ & $x_4$ &$\dots$ & $x_t$ & $\mathrm{TD}$\\\hline \hline $c_0$ & 0 & 0 & 0 & 0 & $\dots$ & 0 & $t$ \\ \hline $c_1$ & 1 & 0 & 0 & 0 &$\dots$ & 0 & 1\\ \hline $c_2$ & 0 & 1 & 0 & 0 &$\dots$ & 0 & 1\\ \hline $c_3$ & 0 & 0 & 1 & 0 &$\dots$ & 0 & 1\\ \hline $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$& $\vdots$ & $\vdots$ & $\vdots$ & $\vdots$ \\ \hline $c_t$ & 0 & 0 & 0 & 0& $\dots$ & 1 & 1 \\ \hline \end{tabular} \label{table:singletonsClass} \end{table} As opposed to the TD, the RTD exhibits interesting relationships to the VCD. For example, if $\mathcal{C}$ is a maximum class, i.e., its size $|\mathcal{C}|$ meets Sauer's upper bound $\binom{|\mathcal{X}|}{0}+\binom{|\mathcal{X}|}{1}+\ldots+\binom{|\mathcal{X}|}{\mathrm{VCD}(\mathcal{C})}$ \cite{Sau72}, and in addition $\mathcal{C}$ can be ``corner-peeled''\footnote{Corner peeling is a sample compression procedure introduced by Rubinstein and Rubinstein~\cite{RR12}; the actual algorithm or its purpose are not of immediate relevance to our paper.}, then $\mathcal{C}$ fulfills $\mathrm{RTD}(\mathcal{C})=\mathrm{VCD}(\mathcal{C})$~\cite{DFSZ14}. The same equality holds if $\mathcal{C}$ is intersection-closed or has VCD 1~\cite{DFSZ14}. In general, the RTD is upper-bounded by a function quadratic in the VCD~\cite{HuWLW17}. \section{Representing CP-Nets as Concepts} \label{sec:representation} Assuming a user's preferences are captured in a target CP-net $N^*$, an interesting learning problem is to identify $N^*$ from a set of observations representing the user's preferences, i.e., labeled examples, of the form $o\succ o'$ or $o \nsucc o'$ where $\succ$ is the relation induced by $N^*$~\cite{DBLP:conf/ijcai/DimopoulosMA09,Koriche2010685}. In order to study the complexity of learning CP-nets, we model a class of CP-nets as a concept class over a fixed instance space. The first issue to address is how to define the instance space. A natural approach would be to consider any pair $(o,o')$ of outcomes as an instance. Such instance would be contained in the concept corresponding to $N^*$ if and only if $N^*$ entails $o\succ o'$. In our study however, we restrict the instance space to the set of all swaps. On the one hand, note that our results, due to the restriction to swaps, do not apply to scenarios in which preferences are elicited over arbitrary outcome pairs, as is likely the case in many real-world applications. On the other hand, for various reasons, the restriction to swaps is still of both theoretical and practical interest and therefore justified. First, CP-net semantics are completely determined by the preference relation over swaps, so that no information on the preference order is lost by restricting to swaps. In particular, the set of all swaps is the most compact instance space for representing the class of all CP-nets or the class of all acyclic CP-nets. Second, many studies in the literature address learning CP-nets from information on swaps, see~\cite{Koriche2010685,DBLP:conf/ijcai/DimopoulosMA09,labernia2016query,LaberniaYMA18,LaberniaZMYA17}, so that our results can be compared to existing ones on the swap instance space. Third, in the learning models that we consider (teaching and learning from membership queries) learning becomes harder when restricting the instance space. For example, a learning algorithm may potentially succeed faster when it is allowed to enquire about preferences over any pair of outcomes rather than just swaps. Since our study restricts the information presented to the learner to preferences over swaps, our complexity results thus serve as upper bounds on the complexity of learning in more relaxed settings. Fourth, for the design of learning methods, it is often desirable that the learner can check whether its hypothesis (in our case a CP-net) is consistent with the labeled examples obtained. It is known that the time complexity of checking whether a CP-net is consistent with an example is linear in the case of swap examples but NP-hard for non-swap examples \cite{1-DBLP:journals/jair/BoutilierBDHP04}. Fifth, there are indeed potential application scenarios in which the information presented to a learner may be in the form of preferences over swaps. This is due to the intuition that in many cases preferences over swaps would be much easier to elicit than preferences over two arbitrary outcomes. For example, a user may be overwhelmed with the question whether to prefer one laptop over another if each of them has a nice feature that the other does not have. It is likely much easier for the user to express a preference over two laptops that are identical except in a single feature like their color. One may argue that one of the parameters that we study, namely the VC dimension, should be computed over arbitrary instances rather than just swap instances, since the VC dimension captures how difficult a concept class is to learn when the choice of instances is out of the learner's (or teacher's) control. However, for the following two reasons, computing the VC dimension over swap instances is of importance to our study: \begin{itemize} \item We use our calculations on the VC dimension in order to assess the optimality of one of Koriche and Zanuttini's algorithms \cite{Koriche2010685} for learning acyclic CP-nets with nodes of bounded indegree from equivalence and membership queries. It is well-known that $\log_2(4/3)\mathrm{VCD}(\mathcal{C})$ is a lower bound on the number of membership and equivalence queries required for learning a concept class $\mathcal{C}$~\cite{AuerL99}. Since Koriche and Zanuttini's algorithm that we assess is designed over the swap instance space, an optimality assessment using the VC dimension necessarily requires that the VC dimension be computed over the swap instance space as well. \item Although the VC dimension is best known for characterizing the sample complexity of learning from randomly chosen examples, namely in the model of PAC learning, existing results exhibit a broader scope of applicability of the VC dimension. Recently it was shown that the number of examples needed for learning from benevolent teachers can be upper-bounded by a function quadratic in the VC dimension~\cite{HuWLW17}. When studying the number of swap examples required for teaching CP-nets, thus again also the VC dimension over swap examples becomes interesting. \end{itemize} We therefore consider the set $\{(o,o')\in\mathcal{O}\times\mathcal{O}\mid (o,o')$ is a swap$\}$ as an instance space. The size of this instance space is $nm^n(m-1)$: every variable has $m^{n-1}$ different assignments of the other variables and fixing each assignment of these we have $m(m-1)$ instances. For complete acyclic CP-nets, however, half of these instances are redundant as if $c((o,o'))=0$ then we know for certain that $c((o',o))=1$, and vice versa. By contrast, in the case of incomplete CP-nets, $c((o,o'))=0$ does not necessarily mean $c((o',o))=1$ as there could be no relation between the two outcomes, i.e., $o$ and $o'$ are incomparable, corresponding to both $c((o,o'))=0$ and $c((o',o))=0$. Consequently, the choice of instance space in our study will be as follows: \begin{itemize} \item Whenever we study classes of CP-nets that contain incomplete CP-nets, we use the instance space $\overline{\mathcal{X}}_{swap}=\{(o,o')\in\mathcal{O}\times\mathcal{O}\mid (o,o')$ is a swap$\}$. \item Whenever we study classes of only complete CP-nets, we use an instance space $\mathcal{X}_{swap}\subset \overline{\mathcal{X}}_{swap}$ that includes, for any two swap outcomes $o,o'$, exactly one of the two pairs $(o,o'),(o',o)$.\footnote{All our results are independent on the mechanism choosing which of two pairs $(o,o'),(o',o)$ to include in $\mathcal{X}_{swap}$. We assume that the selection is prescribed in some arbitrary fashion.} Note that $|\mathcal{X}_{swap}|=nm^{n-1}\binom{m}{2}=\frac{m^nn(m-1)}{2}$. When we say that a learning algorithm, either passively or through active queries, is given information on the label of a swap $(o,o')$ under the target concept, we implicitly refer to information on either $(o,o')$ or $(o',o)$, depending on which of the two is actually contained in $\mathcal{X}_{swap}$. \end{itemize} We sometimes refer to $\mathcal{X}_{swap}$ as the set of all swaps without ``redundancies'', since for the case of complete CP-nets half the instances in $\overline{\mathcal{X}}_{swap}$ are redundant. Of course, for incomplete CP-nets they are not redundant. For $x=(o,o')\in \overline{\mathcal{X}}_{swap}$, let $V(x)$ denote the swapped variable of $x$. We refer to the first and second outcomes of an example $x$ as $x.1$ and $x.2$, respectively. We use $x[\Gamma]$ to denote the assignments (in both $x.1$ and $x.2$) of $\Gamma\subseteq V\backslash\{V(x)\}$. Note that $x[\Gamma]$ is guaranteed to be the same in $x.1$ and $x.2$, otherwise $x$ will not form a swap instance Now if $N$ is any CP-net and induces the (partial) order $\succ$ over outcomes, then $N$ corresponds to a concept $c_N$ over $\overline{\mathcal{X}}_{swap}$ (over $\mathcal{X}_{swap}$, respectively), where $c_N$ is defined as follows, for any $x\in \overline{\mathcal{X}}_{swap}$ (any $x\in \mathcal{X}_{swap}$, respectively.) \begin{equation*} c(x)= \begin{cases} 1 & \text{if}\ x.1\succ x.2 \\ 0 & \text{otherwise} \end{cases} \end{equation*} In such case, we say that $c$ is represented by $N$. Since no two distinct CP-nets induce exactly the same set of swap entailments, a concept over the instance space $\overline{\mathcal{X}}_{swap}$ cannot be represented by more than one CP-net, and a concept over the instance space $\mathcal{X}_{swap}$ cannot be represented by more than one complete CP-net. Therefore, in the context of a specific instance space, we identify a CP-net $N$ with the concept $c_N$ it represents and use these two notions interchangeably. Consequently, we say that a concept $c$ contains a swap pair $x$ iff the CP-net representing $c$ entails $(x.1,x.2)$. By $size(c)$, we refer to the size of the CP-net that represents $c$. Table \ref{tab:swapInstanceExample} shows two concepts $c_1$ and $c_2$ that correspond to the complete CP-nets shown in Figures \ref{fig:example1} and \ref{fig:cyclicConsistent}, respectively, along with one choice of $\mathcal{X}_{swap}$. It is important to restate the fact that $c(x)$ is actually a dominance relation between $x.1$ and $x.2$, i.e., $c(x)$ is mapped to $1$ (resp. to $0$) if $x.1\succ x.2$ (resp. $x.2\succ x.1$) holds. Thus, we sometimes talk about the value of $c(x)$ in terms of the relation between $x.1$ and $x.2$ ($x.1\succ x.2$ or $x.2\succ x.1$). \begin{table} \begin{adjustbox}{max width=\textwidth} \begin{tabular}{ l || c | c | c | c || c | c | c | c || c | c | c | c |} $\mathcal{X}_{swap}$& $(abc,\bar{a}bc)$ & $(ab\bar{c},\bar{a}b\bar{c})$ & $(a\bar{b}c,\bar{a}\bar{b}c)$ & $(a\bar{b}\bar{c},\bar{a}\bar{b}\bar{c})$ & $(abc,a\bar{b}c)$ & $(ab\bar{c},a\bar{b}\bar{c})$ & $(\bar{a}bc,\bar{a}\bar{b}c)$ & $(\bar{a}b\bar{c},\bar{a}\bar{b}\bar{c})$ & $(abc,ab\bar{c})$ & $(a\bar{b}c,a\bar{b}\bar{c})$ & $(\bar{a}bc,\bar{a}b\bar{c})$ & $(\bar{a}\bar{b}c,\bar{a}\bar{b}\bar{c})$\\ \hline $c_1$ & 1& 1 & 1 & 1 & 1 & 1 & 0 & 0 & 1 & 0 & 0 & 1 \\ \hline $c_2$ & 1& 1 & 1 & 1 & 1 & 1 & 0 & 1 & 1 & 0 & 0 & 0 \\ \hline \end{tabular} \end{adjustbox} \caption{ The concepts $c_1$ and $c_2$ represent the CP-nets in Figures \ref{fig:example1} and \ref{fig:cyclicConsistent}, respectively, over $\mathcal{X}_{swap}$.} \label{tab:swapInstanceExample} \end{table} In the remainder of this article, we fix $n\ge 1$, $m\ge 2$, $k\in\{0,\ldots,n-1\}$, and consider the following two concept classes: \begin{itemize} \item The class $\mathcal{C}_{ac}^k$ of all \emph{complete\/} acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. This class is represented over the instance space $\mathcal{X}_{swap}$. \item The class $\overline{\mathcal{C}}_{ac}^k$ of \emph{all complete and all incomplete\/} acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. This class is represented over the instance space $\overline{\mathcal{X}}_{swap}$. \end{itemize} \section{The Complexity of Learning Complete Acyclic CP-Nets}\label{sec:complete} In this section, we will study the information complexity parameters introduced above, for the class $\mathcal{C}^k_{ac}$ of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. In Section~\ref{sec:incomplete}, we will extend our results on the VC dimension and the teaching dimension also to the class $\overline{\mathcal{C}}^k_{ac}$ of all \emph{complete and incomplete}\/ acyclic $k$-bounded CP-nets. It turns out though that studying the complete case first is easier. Table~\ref{resultsSummary} summarizes our complexity results for complete acyclic $k$-bounded CP-nets. The two extreme cases are unbounded acyclic CP-nets ($k=n-1$) and separable CP-nets ($k=0$). To define the value $\mathcal{U}_k$ used in this table, we will first introduce the notion of $(z,k)$-universal set, which is typically used in combinatorics, cf.~\cite{adaptiveLearning,Jukna:2010:ECA:1965203}. \begin{definition}\label{def:universal2} Let $S\subseteq\{0,1\}^z$ be a set of binary vectors of length $z$ and let $k\le z$. The set $S$ is called $(z,k)$-universal if, for every set $Z=\{i_1,\ldots,i_k\}\subseteq\{1,\ldots z\}$ with $|Z|=k$, the projection \[\{(s_{i_1},\ldots,s_{i_k})\mid (s_1,\ldots,s_z)\in S\}\] of $S$ to the components in $Z$ is of size $2^k$, i.e., it contains all binary vectors of length $k$. \end{definition} In other words, a $(z,k)$-universal set $S$ is a set of concepts over an instance space $\mathcal{X}$ of size $z$, such that every subset of $\mathcal{X}$ of size $k$ is shattered by $S$. \begin{example} Consider $z=10$ and $k=3$, and let $S$ be the set of all binary vectors of length 10 that contain no more than 3 components equal to 1. This set is $(10,3)$-universal, since projecting it to any set of three components yields all eight binary vectors of length 3. It is not $(10,4)$-universal since projections onto four components do not exhibit the binary vector consisting of four 1s. \end{example} The role of $(z,k)$-universal sets in our study will become evident later on when we investigate the teaching dimension of classes of CP-nets. Here we present a generalization of $(z,k)$-universal sets to the non-binary case in order to define the quantity $\mathcal{U}_k$ used in Table~\ref{resultsSummary}. \begin{definition}\label{def:universal} Let $S\subseteq\{1,\ldots, m\}^z$ be a set of vectors of length $z$ with components in $\{1,\ldots,m\}$. Let $k\le z$. The set $S$ is called $(m,z,k)$-universal if, for every set $Z=\{i_1,\ldots,i_k\}\subseteq\{1,\ldots z\}$ with $|Z|=k$, the projection \[\{(s_{i_1},\ldots,s_{i_k})\mid (s_1,\ldots,s_z)\in S\}\] of $S$ to the components in $Z$ is of size $m^k$, i.e., it contains all vectors of length $k$ with components in $\{1,\ldots,m\}$. \end{definition} Thus the classical $(z,k)$-universal sets correspond to $(2,z,k)$-universal sets in our notation. To date, no formula is known that expresses the exact size of a \emph{smallest possible\/} $(z,k)$-universal set (or of a smallest possible $(m,z,k)$-universal set, respectively) in dependence of $z$ and $k$ (in dependence of $m$, $z$, and $k$, respectively,) though some useful bounds on this quantity have been established~\cite{Jukna:2010:ECA:1965203}. The quantity is of importance for our results on the teaching dimension. \begin{definition}\label{def:Uk} Let $n\ge 1$, $m\ge 2$, $k\le n-1$. When studying CP-nets over $n$ variables, each of which has a domain of size $m$, we denote by $\mathcal{U}_k$ the smallest possible size of an $(m,n-1,k)$-universal set. \end{definition} The following simple observations on universal sets will be useful for our studies. \begin{lemma}\label{lem:universal} The smallest sizes for $(m,n-1,k)$-universal sets, for $k\in\{0,1,n\}$ are as follows. \begin{enumerate} \item $\mathcal{U}_0=1$. \item $\mathcal{U}_1=m$. \item $\mathcal{U}_{n-1}=m^{n-1}$. \end{enumerate} \end{lemma} \begin{proof} The equality $\mathcal{U}_0=1$ is immediate by definition. $\mathcal{U}_1=m$ is obvious since, independently of $n$, the $m$ distinct vectors $(1,\ldots,1)$, $(2,\ldots,2)$, \dots, $(m,\ldots,m)$ form an $(m,n-1,1)$-universal set, and no smaller $(m,n-1,1)$-universal set can exist. Finally, to realize all possible assignments to the full universe of size $n-1$, exactly $m^{n-1}$ vectors are required, yielding $\mathcal{U}_{n-1}=m^{n-1}$. \end{proof} A striking observation from Table~\ref{resultsSummary} is that $\mathrm{VCD}$ and $\mathrm{RTD}$ are equal for all values of $m$ in $\mathcal{C}_{ac}^{n-1}$. Further, when $m=2$ (the best-studied case in the literature), we have that $\mathrm{TD}(\mathcal{C}_{ac}^{n-1})$ equals the instance space size $n2^{n-1}$. A close inspection of the case $m=2$, as discussed in Appendix\ref{sec:struct}, shows that $\mathcal{X}_{swap}$ has only $n$ instances that are relevant for $\mathcal{C}_{ac}^0$, and $\mathcal{C}_{ac}^0$ corresponds to the class of all concepts over these $n$ instances. Thus the values of $\mathrm{VCD}$, $\mathrm{TD}$, and $\mathrm{RTD}$ are trivially equal to $n$ in this special case. The remainder of this section is dedicated to proving the statements from Table~\ref{resultsSummary}. \iffalse \begin{table*} \centering \caption{Summary of complexity results. $\mathcal{M}_k=(n-k)m^k+\frac{m^k-1}{m-1}$ as detailed in Lemma~\ref{lem:Mk}; the value $\mathcal{U}_k$ is defined after Theorem~\ref{thm:RTDac}.} \begin{footnotesize} \begin{tabular}{|c|c|c|c|c|c|} \hline class & VCD & TD & RTD& SDC & OPT\\ \hline $\mathcal{C}_{ac}^k$& $\geq (m-1)\mathcal{M}_k$& $n(m-1)\mathcal{U}_k$ & $(m-1)\mathcal{M}_k$&$(m-1)\mathcal{M}_k$&$\geq\lceil \log_2(m!) \rceil \mathcal{M}_k$\\ &&&&&(with equality if $m\le 11$)\\ \hline $\mathcal{C}_{ac}^{n-1}$& $m^n-1$& $n(m-1)m^{n-1}$ & $m^{n}-1$&$m^n-1$&$\geq\lceil \log_2(m!) \rceil \frac{m^n-1}{m-1}$\\ &&&&&(with equality if $m\le 11$)\\ \hline $\mathcal{C}_{ac}^{0}$&$(m-1)n$ &$(m-1)n$ &$(m-1)n$&$(m-1)n$&$\geq \lceil \log_2(m!) \rceil n$\\ &&&&&(with equality if $m\le 11$)\\ \hline \end{tabular} \end{footnotesize} \label{resultsSummary} \end{table*} \fi \begin{table*} \centering \caption{Summary of complexity results for classes of complete CP-nets. $\mathcal{M}_k=(n-k)m^k+\frac{m^k-1}{m-1}$, as detailed in Lemma~\ref{lem:Mk}; $e_{max}=(n-k)k+\binom{k}{2}\le nk$; the value $\mathcal{U}_k$ is defined in Definition~\ref{def:Uk}.} \begin{footnotesize} \begin{tabular}{|c|c|c|c|} \hline class & VCD & TD & RTD \\ \hline $\mathcal{C}_{ac}^k$& $\geq (m-1)\mathcal{M}_k$& $n(m-1)\mathcal{U}_k\le \mathrm{TD} \le e_{max}+n(m-1)\mathcal{U}_k$ & $(m-1)\mathcal{M}_k$\\ \hline $\mathcal{C}_{ac}^{n-1}$& $m^n-1$& $n(m-1)m^{n-1}$ & $m^{n}-1$\\ \hline $\mathcal{C}_{ac}^{0}$&$(m-1)n$ &$(m-1)n$ &$(m-1)n$\\ \hline \end{tabular} \end{footnotesize} \label{resultsSummary} \end{table*} \subsection{VC Dimension} We begin by studying the VC dimension, with the following main result \begin{restatable}{theorem}{thmVCDac} For fixed $n\ge 1$, $m\ge 2$, and any given $k\le n-1$, the following statements hold for the VC dimension of the class $\mathcal{C}_{ac}^k$ of all complete acyclic $k$-bounded CP-nets over $n$ variables with $m$ values each, over the instance space $\mathcal{X}_{swap}$. \begin{enumerate} \item $\mathrm{VCD}(\mathcal{C}_{ac}^{n-1})=m^n-1$. \item $\mathrm{VCD}(\mathcal{C}_{ac}^0)=(m-1)n$. \item $\mathrm{VCD}(\mathcal{C}_{ac}^k)\geq(m-1)\mathcal{M}_k = (m-1)(n-k)m^k+m^k-1$. \end{enumerate} \label{thm:VCDac} \end{restatable} The proof of Theorem~\ref{thm:VCDac} relies on decomposing $\mathcal{C}_{ac}^k$ as a product of concept classes over subsets of $\mathcal{X}_{swap}$.\footnote{This kind of decomposition is a standard technique; the reader may look at \cite[Lemma 16]{DFSZ14} for an example of its usage in the computational learning theory literature.} \begin{definition} Let $\mathcal{C}_i\subseteq 2^{\mathcal{X}_i}$ and $\mathcal{C}_j\subseteq 2^{\mathcal{X}_j}$ be concept classes with $\mathcal{X}_i\cap \mathcal{X}_j=\emptyset$. The concept class $\mathcal{C}_{i}\times \mathcal{C}_j\subseteq 2^{\mathcal{X}_i\cup \mathcal{X}_j}$ is defined by $\mathcal{C}_{i}\times \mathcal{C}_j=\{c_i\cup c_j\mid c_i\in \mathcal{C}_i \mbox{ and } c_j\in \mathcal{C}_j\}$. For concept classes $\mathcal{C}_1$, \dots, $\mathcal{C}_r$, we define $\prod_{i=1}^r \mathcal{C}_i = \mathcal{C}_1 \times \cdots \times \mathcal{C}_r = (\cdots((\mathcal{C}_1\times \mathcal{C}_2)\times \mathcal{C}_3)\times\cdots\times \mathcal{C}_r)$. \end{definition} It is a well-known and obvious fact that $\mathrm{VCD}(\prod\limits_{i=1}^{t}\mathcal{C}_i)=\sum\limits_{i=1}^{t}\mathrm{VCD}(\mathcal{C}_i)$, see for example \cite[Lemma 16]{DFSZ14}. For any $v_i\in V$ and any $\Gamma\subseteq V\setminus\{v_i\}$, we define $\mathcal{C}^\Gamma_{\mathrm{CPT}(v_i)}$ to be the concept class consisting of all preference relations corresponding to some $\mathrm{CPT}(v_i)$ where $Pa(v_i)=\Gamma$ and $|\Gamma|\leq k$; here the instance space $\mathcal{X}$ is the set of all swap pairs $x\in\mathcal{X}_{swap}$ with $V(x)=v_i$. Now, if we fix the context of $v_i$ by fixing an assignment $\gamma\in \mathcal{O}_\Gamma$ of all variables in $\Gamma$, we obtain a concept class $\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$, which corresponds to the set of all preference statements concerning the variable $v_i$ conditioned on the context $\gamma$. Its instance space is the set of all swaps $x$ with $V(x)=v_i$ and $x[\Gamma]=\gamma$. Recall that $V=\{v_1,\ldots,v_n\}$. By $S_n$ we denote the class of all permutations of $\{1,\ldots,n\}$. Using this notation, we first establish two lemmas before proving Theorem~\ref{thm:VCDac}. \begin{lemma}\label{lem:decompositionac} Under the same premises as in Theorem~\ref{thm:VCDac}, we obtain \[\mathcal{C}_{ac}^k=\bigcup\limits_{\sigma\in S_n}\prod\limits_{i=1}^{n}\bigcup\limits_{\Gamma\subseteq \{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\}, |\Gamma|\le k}\prod\limits_{\gamma\in\mathcal{O}_\Gamma}\mathcal{C}^\Gamma_{\succ^{v_{\sigma(i)}}_\gamma}\,.\] \end{lemma} \begin{proof} By definition, for $v\in V$ and $\Gamma\subseteq V\setminus\{v\}$, the class $\mathcal{C}^\Gamma_{\mathrm{CPT}(v)}$ equals $\prod_{\gamma\in\mathcal{O}_\Gamma}\mathcal{C}^\Gamma_{\succ^{v}_\gamma}$.\footnote{Any concept representing a preference table for $v$ with $Pa(v)=\Gamma$ corresponds to a union of concepts each of which represents a preference statement over $D_{v}$ conditioned on some context $\gamma\in\mathcal{O}_\Gamma$.} Any concept corresponds to choosing a set $\Gamma_v$ of parent variables of size at most $k$ for each variable $v$, which means $\mathcal{C}_{ac}^k\subseteq\prod_{i=1}^{n}\bigcup_{\Gamma\subseteq V\setminus\{v_i\}, |\Gamma|\le k}\mathcal{C}^\Gamma_{\mathrm{CPT}(v_i)}$. By acyclicity, $v_j\in Pa(v_i)$ implies $v_i\notin Pa(v_j)$, so that for each concept $c\in\mathcal{C}_{ac}^k$ some $\sigma\in S_n$ fulfills $$c\in\prod_{i=1}^{n}\bigcup_{\Gamma\subseteq \{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\}, |\Gamma|\le k}\mathcal{C}^\Gamma_{\mathrm{CPT}(v_{\sigma(i)})}\,.$$ \noindent Thus, $\mathcal{C}_{ac}^k\subseteq\bigcup_{\sigma\in S_n}\prod_{i=1}^{n}\bigcup_{\Gamma\subseteq \{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\}, |\Gamma|\le k}\prod_{\gamma\in\mathcal{O}_\Gamma}\mathcal{C}^\Gamma_{\succ^{v_{\sigma(i)}}_\gamma}$. Similarly, one can argue that every concept in the class on the right hand side represents an acyclic CP-net with parent sets of size at most $k$. With $\mathcal{C}^\Gamma_{\mathrm{CPT}(v_i)}=\prod_{\gamma\in\mathcal{O}_\Gamma}\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$, the statement of the lemma follows. \end{proof} \begin{lemma}\label{lem:VCDfixedcontext} Using the notation introduced before Lemma~\ref{lem:decompositionac}, we obtain $\mathrm{VCD}(\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}) =m-1$ for any $v_i\in V$, $\Gamma\subseteq V\setminus\{v_i\}$, and $\gamma\in\mathcal{O}_\Gamma$. \end{lemma} \begin{proof} Let $v_i\in V$, $\Gamma\subseteq V\setminus\{v_i\}$, and $\gamma\in\mathcal{O}_\Gamma$. We show that $\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$ shatters some set of size $m-1$, but no set of size $m$. Note first that, by definition, $\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$ is simply the class of all total orders over the domain $D_{v_i}$ of $v_i$. To show $\mathrm{VCD}(\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}) \ge m-1$, choose any set of $m-1$ swaps over $\Gamma\cup\{v_i\}$ with fixed context $\gamma$, in which the pairs of swapped values in $v_i$ are $(v^i_1,v^i_2)$,\dots, $(v^i_{m-1},v^i_m)$. Fix any set $S\subseteq\mathcal{X}_{swap}$ of $m$ swaps over $\Gamma\cup\{v_i\}$ with fixed context $\gamma$. To show that $S$ is not shattered, consider the undirected graph $G$ with vertex set $D_{v_i}$ in which an edge between $v^i_r$ and $v^i_s$ exists iff $S$ contains a swap pair flipping $v^i_r$ to $v^i_s$ or vice versa. $G$ has $m$ vertices and $m$ edges and thus contains a cycle. The directed versions of $G$ correspond to the labelings of $S$; therefore some labeling $\ell$ of $S$ corresponds to a cyclic directed version of $G$, which does not induce a total order over $D_{v_i}$. Hence the labeling $\ell$ is not realized by $\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$, so that $S$ is not shattered by $\mathcal{C}^\Gamma_{\succ^{v_i}_\gamma}$. \end{proof} These technical observations will help to establish a lower bound on the VC dimension of classes of bounded acyclic CP-nets. For our upper bound, we need one more lemma. The lemma is a straightforward generalization of an observation made by Booth et al.~\cite{Booth:2010:LCL:1860967.1861021} (their Proposition 3), which states that any concept class corresponding to a set of transitive and irreflexive relations (such as a class of acyclic CP-nets) over $\{0,1\}^n$ has a VC dimension no larger than $2^n-1$. We generalize this statement to relations over $\{0,\ldots,m\}^n$ and, for our purpose, formulate it in CP-net terminology. Note that our statement applies to any class of consistent CP-nets, whether containing incomplete CP-nets or not, and whether acyclic or not. \begin{lemma}[based on \cite{Booth:2010:LCL:1860967.1861021}]\label{lem:booth} Let $n\ge 1$, $m\ge 2$. Let $X\subseteq\mathcal{X}_{swap}$ with $|X|=m^n$ be any set of $m^n$ swaps over $n$ variables of domain size $m$. Let $\mathcal{C}$ be \emph{any}\/ class of consistent CP-nets over the same domain $\mathcal{X}_{swap}$. Then $\mathcal{C}$ does not shatter $X$. In particular, $\mathrm{VCD}(\mathcal{C})\le m^n-1$. \end{lemma} \begin{proof} Suppose $\mathcal{C}$ shatters $X$. Then each labeling of the swaps in $X$ is consistent with some CP-net in $\mathcal{C}$. Observe first that the induced preference graph of any CP-net in $\mathcal{C}$ has exactly $m^n$ vertices. Each labeling of a swap corresponds to a directed edge in the induced preference graph of a CP-net.\footnote{For example, in Figure~\ref{fig:cyclicConsistent}, the edge from $a\bar{b}\bar{c}$ to $ab\bar{c}$ corresponds to the labeling $0$ for the swap $(a\bar{b}\bar{c},ab\bar{c})$, and, likewise, to the labeling $1$ for the swap $(ab\bar{c},a\bar{b}\bar{c})$.} Therefore, each labeling of all elements in $X$ corresponds to a set of $m^n$ directed edges in the induced preference graph. When ignoring the direction of the edges, the edge sets resulting from these labelings are all identical, and we obtain a set of $m^n$ undirected edges over a set of exactly $m^n$ vertices. Consequently, these edges form at least one cycle. Obviously, there exists a labeling $\ell$ of the elements in $X$ that will turn this undirected cycle into a directed cycle. Since $\mathcal{C}$ shatters $X$, it contains a concept $c$ that is consistent with the labeling $\ell$, i.e., whose induced preference graph contains the directed edges corresponding to the labeling $\ell$. In particular, this concept $c$ has a cycle in its induced preference graph. This contradicts the fact that $c$ is a consistent CP-net. Therefore, $\mathcal{C}$ does not shatter $X$. Since $X$ was chosen arbitrarily, $\mathcal{C}$ shatters no set of size $m^n$, so that $\mathrm{VCD}(\mathcal{C})\le m^n-1$. \end{proof} We are now ready to give a proof of Theorem~\ref{thm:VCDac}, which we restate here for convenience. \thmVCDac* \begin{proof} Lemma~\ref{lem:decompositionac} states that $$ \mathcal{C}_{ac}^k=\bigcup\limits_{\sigma\in S_n}\prod\limits_{i=1}^{n}\bigcup\limits_{\Gamma\subseteq \{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\}, |\Gamma|\le k}\prod\limits_{\gamma\in\mathcal{O}_\Gamma}\mathcal{C}^\Gamma_{\succ^{v_{\sigma(i)}}_\gamma}\,, $$ which yields the bound $$\mathrm{VCD}(\mathcal{C}_{ac}^k)\ge\max\limits_{\sigma\in S_n}\sum\limits_{i=1}^{n}\max\limits_{\Gamma\subseteq \{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\},|\Gamma|\le k}\sum\limits_{\gamma\in\mathcal{O}_\Gamma}\mathrm{VCD}(\mathcal{C}^\Gamma_{\succ^{v_{\sigma(i)}}_\gamma})\,.$$ By Lemma~\ref{lem:VCDfixedcontext}, we have $\mathrm{VCD}(\mathcal{C}^\Gamma_{\succ^{v_{\sigma(i)}}_\gamma}) =m-1$, independent of $\Gamma$ and $\gamma$, so that one obtains, for any $\sigma\in S_n$, \begin{eqnarray*} \mathrm{VCD}(\mathcal{C}_{ac}^k)&\ge& (m-1)\sum_{i=1}^n\max_{\Gamma\subseteq\{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\}, |\Gamma|\le k}|\mathcal{O}_\Gamma|\\ &=&(m-1)\sum_{i=1}^n\max_{\Gamma\subseteq\{v_{\sigma(1)},\ldots,v_{\sigma(i-1)}\},|\Gamma|\le k}m^{|\Gamma|}\\ &=&(m-1)\mathcal{M}_k\,. \end{eqnarray*} It remains to verify $\mathrm{VCD}(\mathcal{C}_{ac}^k)\le (m-1)\mathcal{M}_k$ for $k\in\{0,n-1\}$. For $k=0$, we have $\mathcal{M}_k=n$, so let us consider any set $Y$ of size greater than $(m-1)n$ and argue why $Y$ cannot be shattered by $\mathcal{C}_{ac}^0$. Clearly, there exists a variable $v_i$ that is swapped in at least $m$ instances in $Y$. In order to shatter these $\ge m$ instances with the same swapped variable, a concept class of CP-nets would need to contain CP-nets in which some variables have non-empty parent sets, which is not the case for $\mathcal{C}_{ac}^0$. Thus $Y$ is not shattered, i.e., $\mathrm{VCD}(\mathcal{C}_{ac}^k)\le (m-1)\mathcal{M}_k$. For $k=n-1$, the upper bound $\mathrm{VCD}(\mathcal{C}_{ac}^k)\le m^n-1 = (m-1)\mathcal{M}_{n-1}$ follows immediately from Lemma~\ref{lem:booth}. \end{proof} \iffalse Theorem~\ref{thm:VCDac} provides matching upper and lower bounds on $\mathrm{VCD}(\mathcal{C}_{ac}^k)$ when $k=0$ and when $k=n-1$, but it does not provide an upper bound for other values of $k$. Here we briefly sketch how to obtain upper bounds for the binary case, i.e., when $m=2$. To this end, we make use of the trivial fact that $\mathrm{VCD}(\mathcal{C})\leq \log_2(|\mathcal{C}|)$ for any finite concept class $\mathcal{C}$. In our case, this means $\mathrm{VCD}(\mathcal{C}_{ac}^k)\leq \sum_{i=1}^n \log_2(|\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma_i}|)$. To upper-bound the size of the concept class $\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma_i}$, note that there are $\binom{n-1}{k}$ such parent sets $\Gamma_i$ and for every such set, we have $2^k$ statements each of which can show one of two orders, namely, $y_1\succ y_2$ or $y_2\succ y_1$ for $D_{v_i}=\{y_1,y_2\}$. Therefore, in the worst case scenario there are $\binom{n-1}{k} 2^{2^k}$ tables and $\log_2(|\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma_i}|)=\log_2(\binom{n-1}{k} 2^{2^k})$. Using Stirling's approximation for $\log_2(n!)\approx nlogn$ we obtain $2^k + O(k \log_2(n-1))$. As a result, one can bound $\mathrm{VCD}(\mathcal{C}_{ac}^k)$ from above by $n2^k + O(kn\log_2(n-1))$. Similarly, for the case of binary trees, we can say something more precise following the same argument. From Theorem \ref{thm:VCDac} we know that $\mathrm{VCD}(\mathcal{C}_{ac}^1)\geq 2n-1$. We show that this can be at most $\Omega(n\log_2 n)$ away from the actual value. In particular, $\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma}$, where $|\Gamma|=1$, can be computed exactly. For any $v_i$, $\mathrm{CPT}(v_i)$ can be either unconditional in which case we have 2 concepts or conditional in which case we have $\binom{n-1}{1}\times 2$ concepts which yields $|\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma}|=2n$ and $\log_2(|\mathcal{C}_{\mathrm{CPT}(v_i)}^{\Gamma}|)$ is $1+\log_2(n)$. Therefore, we obtain that $\mathrm{VCD}(\mathcal{C}_{ac}^1)\leq n+n\log_2 (n)$. \begin{corollary} In the case of binary CP-nets, we have $(n-k)2^k +2^k-1 \leq \mathrm{VCD}(\mathcal{C}_{ac}^k)\leq \min\{2^n-1, n2^k + O(kn\log_2(n-1))\}$ and $2n-1 \leq \mathrm{VCD}(\mathcal{C}_{ac}^1)\leq n+n\log_2 n$. \end{corollary} \begin{table*} \centering \caption{Summary of the VC dimension value for different classes of binary CP-nets.} \begin{tabular}{| l | c | c |} \hline class & lower bound & upper bound \\ \hline $\mathcal{C}_{ac}^0$ & $n$ & $n$ \\ \hline $\mathcal{C}_{ac}^1$ & $2n-1$ & $n+n\log_2(n)$ \\ \hline $\mathcal{C}_{ac}^{n-1}$ & $2^n-1$ & $2^n-1$ \\ \hline $\mathcal{C}_{ac}^k$ & $(n-k)2^k+2^k-1$ & $\min\{2^n-1, n2^k + O(kn\log_2(n-1))\}$ \\ \hline \end{tabular} \label{tbl:VCDresults} \end{table*} \fi \subsection{Recursive Teaching Dimension} For studying teaching complexity, it is useful to identify concepts that are ``easy to teach.'' To this end, we use the notion of subsumption~\cite{Koriche2010685}: given CP-nets $N,N'$, we say $N$ subsumes $N'$ if for all $v_i\in V$ the following holds: If $y_1\succ y_2$ is specified in $\mathrm{CPT}(v_i)$ in $N'$ for some context $\gamma'$, then $y_1\succ y_2$ is specified in $\mathrm{CPT}(v_i)$ in $N$ for some context containing $\gamma'$. If in addition $N\ne N'$, we say that $N$ strictly subsumes $N'$. Now let $\mathcal{C}\subseteq\mathcal{C}_{ac}^k$. A concept $c\in \mathcal{C}$ is maximal in $\mathcal{C}$ if no $c'\in\mathcal{C}$ strictly subsumes $c$. The size of maximal concepts in $\mathcal{C}_{ac}^k$ equals $\mathcal{M}_k$, by definition. \begin{figure} \begin{adjustbox}{max width=\textwidth} \begin{tikzpicture}[thick,every node/.style={scale=0.7}] \begin{scope} \node[state](A){A}; \node[state](B)[below right=of A]{B}; \node[state](C)[below left=of A]{C}; \node (aCPT)[above=of A,yshift=-1.3cm]{$a\succ\bar{a}$}; \node(bCPT)[above=of B,yshift=-1cm]{\makecell[l]{$a:b\succ \bar{b}$\\$\bar{a}:\bar{b}\succ b$}}; \node(cCPT)[above=of C,xshift=-1cm,yshift=-.7cm]{\makecell[l]{$\bar{a}\bar{b}\qquad :\bar{c}\succ c$\\otherwise: $c\succ \bar{c}$}}; \node(text)[below of=A,yshift=-2.5cm]{$N_1$}; \path (A) edge[->] (B) edge[->] (C) (B) edge[->] (C); \end{scope} \begin{scope}[xshift=5cm] \node[state](A){A}; \node[state](B)[below right=of A]{B}; \node[state](C)[below left=of A]{C}; \node (aCPT)[above=of A,yshift=-1.3cm]{$a\succ\bar{a}$}; \node(bCPT)[above=of B,yshift=-1cm]{\makecell[l]{$a:b\succ \bar{b}$\\$\bar{a}:\bar{b}\succ b$}}; \node(cCPT)[above=of C,yshift=-.6cm]{\makecell[l]{$a:c\succ \bar{c}$\\ $\bar{a}:\bar{c}\succ \bar{c}$}}; \path (A) edge[->] (B) edge[->] (C); \node(text)[below of=A,yshift=-2.5cm]{$N_2$}; \end{scope} \begin{scope}[xshift=9cm] \node[state](A){A}; \node[state](B)[below right=of A]{B}; \node[state](C)[below left=of A,xshift=.6cm]{C}; \node (aCPT)[above=of A,yshift=-1.3cm]{$a\succ\bar{a}$}; \node(bCPT)[above=of B,yshift=-1cm]{\makecell[l]{$a:b\succ \bar{b}$\\$\bar{a}:\bar{b}\succ b$}}; \node(cCPT)[above=of C,yshift=-1.3cm]{$c\succ \bar{c}$}; \node(text)[below of=A,yshift=-2.5cm]{$N_3$}; \path (A) edge[->] (B) ; \end{scope} \end{tikzpicture} \end{adjustbox} \caption{Three networks each of which is subsumed by the ones to its left.} \label{fig:subsumeExample} \end{figure} \begin{example} Let $\mathcal{C}_{ac}^2$ be the class of all unbounded complete acyclic CP-nets over three variables $V=\{A,B,C\}$. Consider the three CP-nets in Figure \ref{fig:subsumeExample}. Clearly, $N_3$ is subsumed by $N_2$ and $N_1$, and $N_2$ is subsumed by $N_1$. Further, $N_1$ is maximal with respect to $\mathcal{C}_{ac}^2$ and thus also maximal with respect to $\overline{\mathcal{C}}_{ac}^2$. Each of the three CP-nets also strictly subsumes any CP-net resulting from removal of some of its statements. Since subsumption is transitive, the CP-net $N_1$ strictly subsumes any CP-net resulting from $N_2$ after removal of statements. \end{example} The following two lemmas formalize the intuition that maximal concepts are ``easy to teach.'' Lemma~\ref{lem:RTDupperBound} gives an upper bound on the size of a smallest teaching set of any maximal concept, while Lemma~\ref{lem:nonmaximal} implies that a maximal concept is never harder to teach than any concept it subsumes. \begin{lemma}\label{lem:RTDupperBound} Let $n\ge 1$, $m\ge 2$, and $k\le n-1$. Let $\mathcal{C}\subseteq\mathcal{C}_{ac}^k$ be a subclass of the class of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. For any maximal concept $c$ in $\mathcal{C}$, we have $\mathrm{TD}(c,\mathcal{C})\leq (m-1)size(c)$, i.e., $(m-1)size(c)$ swap examples suffice to distinguish $c$ from any other concept in $\mathcal{C}$. \end{lemma} \begin{proof} Every statement in the CP-net $N$ represented by $c$ corresponds to an order of $m$ values for some variable $v_i$ under a fixed context $\gamma$. For every such order $y_1\succ_\gamma^{v_i}\ldots\succ_\gamma^{v_i}y_m$, we include $m-1$ positively labeled swap examples in a set $T$. For $1\le j\le m-1$, the $j$th such example labels a pair $x=(x.1,x.2)$ of swap outcomes with $V(x)=v_i$, the projection of $x$ onto $\{v_i\}$ is $(y_j,y_{j+1})$, and the projection of $x$ onto the remaining variables contains $\gamma$. The set $T$ then has cardinality $(m-1)size(c)$ and is obviously consistent with $N$. It remains to show that no other CP-net in $\mathcal{C}$ is consistent with $T$. Suppose some CP-net $c'\in\mathcal{C}$ is consistent with $T$. Note that, for each $i$ and each context $\gamma$ occurring in $\mathrm{CPT}(v_i)$ in $c$, the information in $T$ determines a strict total order on $D_{v_i}$. The corresponding preferences are all entailed by $c'$ as well, since $c'$ is consistent with $T$. Therefore, $c'$ subsumes $c$. Since $c$ is a maximal concept, this implies that $c'$ does not strictly subsume $c$. Hence, $c'=c$, i.e., $c$ is the only concept in $\mathcal{C}$ that is consistent with $T$. \end{proof} Next, we determine the teaching dimension of maximal concepts in the class $\mathcal{C}^k_{ac}$. \begin{lemma}\label{lem:maximal} Let $n\ge 1$, $m\ge 2$, and $k\le n-1$. Further, let $c$ be a maximal concept in the class $\mathcal{C}_{ac}^k$ of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. Then $\mathrm{TD}(c,\mathcal{C}_{ac}^k) = (m-1) \mathcal{M}_k=(m-1)(n-k)m^k+m^k-1$. \end{lemma} \begin{proof} A teaching set for a maximal concept must contain $m-1$ examples for each statement in its $\mathrm{CPT}$s, so as to determine the preferences for each context. The number of statements in a maximal concept equals $\mathcal{M}_k$, which yields $\mathrm{TD}(c,\overline{\mathcal{C}}_{ac}^k)=\mathrm{TD}(c,\mathcal{C}_{ac}^k) \ge (m-1) \mathcal{M}_k$. Lemma~\ref{lem:RTDupperBound} then completes the proof. \end{proof} The following lemma then shows that no concept $c'$ in $\mathcal{C}^k_{ac}$ has a smaller teaching dimension than any maximal concept in $\mathcal{C}^k_{ac}$ that subsumes $c'$. \begin{lemma}\label{lem:nonmaximal} Let $n\ge 1$, $m\ge 2$, and $k\le n-1$, and consider the class $\mathcal{C}_{ac}^k$ of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$. Then each non-maximal $c'\in\mathcal{C}_{ac}^k$ is strictly subsumed by some $c\in\mathcal{C}_{ac}^k$ such that $\mathrm{TD}(c',\mathcal{C}_{ac}^k)\!\geq\! \mathrm{TD}(c,\mathcal{C}_{ac}^k)$. In particular, if $c$ is any maximal concept in $\mathcal{C}_{ac}^k$, then $\mathrm{TD}(c'',\mathcal{C}_{ac}^k)\!\geq\! \mathrm{TD}(c,\mathcal{C}_{ac}^k)$ for each $c''\in \mathcal{C}_{ac}^k$ subsumed by $c$. \label{lem:subsumeTD} \end{lemma} \begin{proof} From the graph $G'$ for $c'$, we build a graph $G$ by adding the maximum possible number of edges to a single variable $v$. As $c'$ is not maximal, it is possible to add at least one edge without violating the indegree bound $k$. The CP-nets corresponding to $G$ and $G'$ differ only in $\mathrm{CPT}(v)$. Let $c$ be the concept representing $G$ and $z$ be the size of its $\mathrm{CPT}$ for $v$. A smallest teaching set $T'$ for $c'$ can be modified to a teaching set for $c$ by replacing only those examples that refer to the swapped variable $v$; $(m-1)z$ examples suffice. To distinguish $c'$ from $c$, $T'$ must contain at least $(m-1)z$ examples referring to the swapped variable $v$ ($m-1$ for each context in $\mathrm{CPT}(v)$ in $c$). Hence $\mathrm{TD}(c',\overline{\mathcal{C}}_{ac}^k)\geq$ $\mathrm{TD}(c,\overline{\mathcal{C}}_{ac}^k)$. \end{proof} As a consequence, the easiest to teach concepts in $\mathcal{C}_{ac}^k$ are the maximal ones. Using these lemmas, one can determine the recursive teaching dimension of the concept classes $\mathcal{C}_{ac}^k$, for any $k$. \begin{theorem}\label{thm:RTDac} Let $n\ge 1$, $m\ge 2$, and $k\le n-1$. For the recursive teaching dimension of the class $\mathcal{C}_{ac}^k$ of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$, we obtain: \[\mathrm{RTD}(\mathcal{C}_{ac}^k)=(m-1)\mathcal{M}_k=(m-1)(n-k)m^k+m^k-1\,.\] As before, here $\mathcal{C}_{ac}^k$ is defined over the instance space $\mathcal{X}_{swap}$. \end{theorem} \begin{proof} The upper bound on the recursive teaching dimension follows from Lemma~\ref{lem:maximal} and then repeated application of Lemma~\ref{lem:RTDupperBound}. The lower bound follows from Lemma~\ref{lem:nonmaximal} in combination with Lemma~\ref{lem:maximal}---these two lemmas state that the smallest teaching dimension of any concept in $\mathcal{C}_{ac}^k$ is that of any maximal concept, and that this teaching dimension value equals $(m-1)\mathcal{M}_k$. \end{proof} \iffalse \begin{proof} Obviously, $\mathrm{RTD}(\mathcal{C}_{ac}^k)\ge\mathrm{TD}_{min}(\mathcal{C}_{ac}^k)$. To obtain $\mathrm{RTD}(\mathcal{C}_{ac}^k)\ge (m-1)\mathcal{M}_k$, we show that $\mathrm{TD}_{min}(\mathcal{C}_{ac}^k)\ge (m-1)\mathcal{M}_k$. By Lemma~\ref{lem:subsumeTD}, $\mathrm{TD}_{min}(\mathcal{C}_{ac}^k)$ is realized by some maximal concept $c\in \mathcal{C}_{ac}^k$. Teaching $c$ requires at least $(m-1)$ examples per statement in $c$ and thus $\mathrm{TD}_{min}(\mathcal{C}_{ac}^k)\ge (m-1)\mathcal{M}_k$. To see that $\mathrm{RTD}(\mathcal{C}_{ac}^k)\le (m-1)\mathcal{M}_k$, consider the subclasses $\mathcal{C}_i$ from Definition~\ref{def:RTD}. If $c$ is maximal in $\mathcal{C}_i$, then, by Lemma~\ref{lem:RTDupperBound}, $\mathrm{TD}(c,\mathcal{C}_i)\leq (m-1)size(c)$. Since $c$ is acyclic, the size of $c$ is upper-bounded by $\mathcal{M}_k$ and thus $\mathrm{RTD}(\mathcal{C}_{ac}^k)=\max \{\mathrm{TD}_{min}(\mathcal{C}_i)\mid i\ge 0\}\le (m-1)\mathcal{M}_k$. \end{proof} \fi \subsubsection{An Example Illustrating Teaching Sets} For the case of complete CP-nets, we will now illustrate our results on teaching sets through examples. Let us consider the case where $V=\{A,B,C\}$, $D_A=\{a,\bar{a}\}$, $D_B=\{b,\bar{b}\}$, and $D_C=\{c,\bar{c}\}$. We consider the class $\mathcal{C}_{ac}^{n-1}$ of all complete acyclic CP-nets defined over $V$. Figure \ref{fig:subsumeExample} shows three concepts, $N_1$, $N_2$, and $N_3$, from this class. In order to illustrate Lemma \ref{lem:RTDupperBound}, let us first compute an upper bound on the teaching dimension of the maximal concept $N_1$. The claim is that $\mathrm{TD}(N_1,\mathcal{C}_{ac}^{n-1})$ is less than or equal to the size of $N_1$, which is 7. Consider a set of entailments $\mathcal{E}$ corresponding to the teaching set $T$ as described in the proof of Lemma \ref{lem:RTDupperBound}. One possibility for $\mathcal{E}$ is the set consisting of the entailments $abc\succ \bar{a}bc$, $abc\succ a\bar{b}c$, $\bar{a}\bar{b}\bar{c}\succ\bar{a}b\bar{c}$, $abc\succ ab\bar{c}$, $a\bar{b}c\succ a\bar{b}\bar{c}$, $\bar{a}bc\succ \bar{a}b\bar{c}$, and $\bar{a}\bar{b}\bar{c}\succ \bar{a}\bar{b}c$. $\mathcal{E}$ is obviously consistent with $N_1$. A closer look shows that it is also a teaching set for $N_1$ with respect to $\mathcal{C}_{ac}^{n-1}$. To see why, consider the partition $\mathcal{E}= \mathcal{E}_A\cup\mathcal{E}_B\cup\mathcal{E}_C$, where \begin{itemize} \item $\mathcal{E}_A=\{abc\succ \bar{a}bc\}$, \item $\mathcal{E}_B=\{abc\succ a\bar{b}c, \bar{a}\bar{b}\bar{c}\succ \bar{a}b\bar{c}\}$, and \item $\mathcal{E}_C=\{abc\succ ab\bar{c}, a\bar{b}c\succ a\bar{b}\bar{c}, \bar{a}bc\succ \bar{a}b\bar{c}, \bar{a}\bar{b}\bar{c}\succ\bar{a}\bar{b}c\}$. \end{itemize} The set $\mathcal{E}_C$ shows that $C$ has at least two parents, which, in our case, have to be $A$ and $B$. As a result, $Pa(C)=\{A,B\}$ and $\mathrm{CPT}(C)$ is defined precisely: it is the $\mathrm{CPT}$ with the maximum possible parent set $\{A,B\}$ and $\mathcal{E}_C$ contains a statement for every context over this parent set. Similarly, $\mathcal{E}_{B}$ shows that there must be at least one parent for $B$. Given the fact that $B\in Pa(C)$ we conclude that $Pa(B)=\{A\}$ as there is no other way to explain $\mathcal{E}_C$ and $\mathcal{E}_B$ together. Therefore, we have identified $\mathrm{CPT}(B)$ precisely. In an acyclic CP-net, thus $\mathrm{CPT}(A)$ must be unconditional (which is consistent with $\mathcal{E}_A$ having one entailment only). Thus, $\mathcal{E}$ is a teaching set for $N_1$ and $\mathrm{TD}(N_1,\mathcal{C}_{ac}^{n-1})\leq size(N_1)=7$. Now, let us illustrate Lemma \ref{lem:subsumeTD}. For this purpose, consider the teaching dimension of $N_3$ which is not maximal w.r.t.~$\mathcal{C}_{ac}^{n-1}$. According to Lemma \ref{lem:subsumeTD}, there exists a concept $N$ that subsumes $N_3$ and for which $\mathrm{TD}(N_3,\mathcal{C}_{ac}^{n-1})\geq \mathrm{TD}(N,\mathcal{C}_{ac}^{n-1})$. We follow the proof of Lemma~\ref{lem:subsumeTD}. If $G'$ is the graph of $N_3$, we construct a new graph $G$ as follows: $G$ results from $G'$ by selecting the variable $C$ and adding two incoming edges (i.e., the maximum possible number of edges) to the node labeled by this variable. A concept with such graph is $N_1$. Let $\mathcal{E}$ be a set of entailments corresponding to a teaching set for $N_3$ with size equal to $\mathrm{TD}(N_3,\mathcal{C}_{ac}^{n-1})$. We claim that the number of entailments in $\mathcal{E}$ whose swapped variable is $C$ has to be greater than or equal $4$. To see this, consider the CP-net $N$ with graph $G$ where $\mathrm{CPT}(A)$ and $\mathrm{CPT}(B)$ are identical to the corresponding conditional preference tables in $N_3$. Moreover, for $\mathrm{CPT}(C)$ in $N$, for every entailment in $e\in \mathcal{E}$ whose swapped variable is $C$, a statement $u:c\succ \bar{c}$ or $u:\bar{c}\succ c$ is created in agreement with $e$, where $u$ provides the values of $A$ and $B$ in $e$. For instance if the subset of $\mathcal{E}$ referring to swapped variable $C$ is $\{abc\succ ab\bar{c} , \bar{a}bc\succ \bar{a}b\bar{c}\}$, then one possible table for $\mathrm{CPT}(C)$ in $N$ is $\{b:c\succ \bar{c}, \bar{b}:\bar{c}\succ c\}$.\footnote{Alternatively, the $\mathrm{CPT}$ for $C$ in $N_1$ can also be used.} Note that $\mathrm{TD}(N_3,\mathcal{C}_{ac}^{n-1})\le \mathrm{TD}(\mathcal{C}_{ac}^{n-1})$. By Table~\ref{resultsSummary}, $\mathrm{TD}(\mathcal{C}_{ac}^{n-1})$ equals $(m-1)nm^{n-1}$ which, for $m=2$ and $n=3$ evaluates to 12. In the sum, we discussed why $\mathrm{TD}(N_1,\mathcal{C}_{ac}^{n-1})\le 7$ and $\mathrm{TD}(N_1,\mathcal{C}_{ac}^{n-1})\le \mathrm{TD}(N_3,\mathcal{C}_{ac}^{n-1})\le 12$. It is actually the case that $\mathrm{TD}(N_1,\mathcal{C}_{ac}^{n-1})=7$, $\mathrm{TD}(N_2,\mathcal{C}_{ac}^{n-1})=9$ and $\mathrm{TD}(N_3,\mathcal{C}_{ac}^{n-1})=10$. Figure \ref{fig:teachingSets} shows one possible example of minimum teaching sets for the three networks. In the displayed choice of teaching sets, we selected 10 instances for teaching $N_3$, use all but one of them (some with flipped labels) to teach $N_2$ and use seven of them (some with flipped labels) to teach $N_1$. While this is not the only choice of smallest possible teaching sets for these concepts, it illustrates that some subset of the instances that are used to teach some concept, with appropriate labeling, can also be used to teach a concept that subsumes it. In Figure~\ref{fig:teachingSets}, we show which instances are removed from the teaching set of $N_3$ by crossing them out. For instance, the entailment $ab\bar{c}\succ \bar{a}b\bar{c}$ is not needed in the teaching set of $N_2$ as the remaining examples provide enough evidence to conclude that $A\in Pa(B)$ and $A\in Pa(C)$; thus one entailment for $\mathrm{CPT}(A)$ suffices for teaching $\mathrm{CPT}(A)$. \begin{figure} \centering \begin{tikzpicture} \node(text1)[xshift=-4cm]{$N_1$}; \node(text2)[right=of text1,xshift=1cm]{$N_2$}; \node(text3)[right=of text2,xshift=1cm]{$N_3$}; \node(N1)[above=of text1]{\makecell[c]{ $abc\succ \bar{a}bc$\\ $\xcancel{ab\bar{c}\succ \bar{a}b\bar{c}}$\\ $abc\succ a\bar{b}c$\\ $\xcancel{ab\bar{c}\succ a\bar{b}\bar{c}}$\\ $\bar{a}\bar{b}\bar{c}\succ \bar{a}b\bar{c}$\\ $\xcancel{\bar{a}\bar{b}c \succ \bar{a}bc}$\\ $abc\succ ab\bar{c}$\\ $a\bar{b}c\succ a\bar{b}\bar{c}$\\ $\bar{a}\bar{b}\bar{c}\succ \bar{a}\bar{b}c$ \\ $\bar{a}bc\succ \bar{a}b\bar{c}$ }}; \node(N2)[above=of text2]{\makecell[c]{ $abc\succ \bar{a}bc$\\ $\xcancel{ab\bar{c}\succ \bar{a}b\bar{c}}$\\ $abc\succ a\bar{b}c$\\ $ab\bar{c}\succ a\bar{b}\bar{c}$\\ $\bar{a}\bar{b}\bar{c} \succ \bar{a}b\bar{c}$\\ $\bar{a}\bar{b}c\succ \bar{a}bc$\\ $abc\succ ab\bar{c}$\\ $a\bar{b}c\succ a\bar{b}\bar{c}$\\ $\bar{a}\bar{b}\bar{c}\succ \bar{a}\bar{b}c $ \\ \begin{boldmath}$\bar{a}b\bar{c}\succ\bar{a}bc$\end{boldmath} }}; \node(N3)[above=of text3]{\makecell[c]{ $abc\succ \bar{a}bc$\\ $ab\bar{c}\succ \bar{a}b\bar{c}$\\ $abc\succ a\bar{b}c$\\ $ab\bar{c}\succ a\bar{b}\bar{c}$\\ $\bar{a}\bar{b}\bar{c}\succ \bar{a}b\bar{c}$\\ $\bar{a}\bar{b}c\succ\bar{a}bc$\\ $abc\succ ab\bar{c}$\\ $a\bar{b}c\succ a\bar{b}\bar{c}$\\ \begin{boldmath}$\bar{a}\bar{b}c\succ\bar{a}\bar{b}\bar{c}$\end{boldmath} \\ $\bar{a}bc\succ \bar{a}b\bar{c}$ }}; \end{tikzpicture} \caption{Teaching sets for the three networks in Figure \ref{fig:subsumeExample} w.r.t.~the class $\mathcal{C}_{ac}^{n-1}$. } \label{fig:teachingSets} \end{figure} \subsubsection{Structural Properties of Interest to Learning-Theoretic Studies} The class $\mathcal{C}_{ac}^{n-1}$ is interesting from a structural point of view, as its VC dimension equals its recursive teaching dimension, see Table~\ref{resultsSummary}. In general, the VC dimension can exceed the recursive teaching dimension by an arbitrary amount, and it can also be smaller than the recursive teaching dimension~\cite{DFSZ14}. Simon and Zilles~\cite{SimonZ15} posed the question whether the recursive teaching dimension can be upper-bounded by a function that is linear in the VC dimension. So far, the best known upper bound on the recursive teaching dimension is quadratic in the VC dimension~\cite{HuWLW17}. The computational learning theory literature knows of a number of structural properties under which the VC dimension and the recursive teaching dimension coincide. In Appendix\ref{sec:struct}, we study these structural properties and show that they do not apply to the class of complete unbounded acyclic CP-nets. \subsection{Teaching Dimension} Computing the teaching dimension is somewhat more involved. We will introduce some terminology first. In a teaching set, the purpose of a \emph{conflict pair}\/ for a variable $v_i$ given a variable $v_j$ is to demonstrate that $v_j$ is a parent of $v_i$. \begin{definition}\label{def:conflict} Let $n\ge 1$, $m\ge 2$. Let $N$ be a CP-net over $n$ variables of domain size $m$, and let $v_i,v_j$ be variables in $N$. A conflict pair for $v_i$ given $v_j$ is a pair $(x,x')$ of swaps such that (i) $V(x)=V(x')=v_i$, (ii) $x.1$ and $x'.1$ differ only in $v_j$, (iii) $x.2$ and $x'.2$ differ only in $v_j$, and (iv) $N$ entails $x$ but not $x'$. \end{definition} Obviously, the variable $v_j$ is a parent of the variable $v_i$ if and only if a conflict pair for $v_i$ given $v_j$ exists. For instance, in the CP-net $N_1$ in Figure~\ref{fig:subsumeExample}, the variable $C$ has a conflict pair given $A$, since $A$ is a parent of $C$. An example of a conflict pair here would be $((\bar{a}\bar{b}\bar{c},\bar{a}\bar{b}c)\,,(a\bar{b}\bar{c},a\bar{b}c))$. The CP-net $N_1$ entails $(\bar{a}\bar{b}\bar{c},\bar{a}\bar{b}c)$, but it does not entail $(a\bar{b}\bar{c},a\bar{b}c)$. In the same figure, in the CP-net $N_3$, the variable $C$ has no parents, so that each context over $A$ and $B$ results in the same preference for $C$. In other words, $C$ has no conflict pair given $A$ and no conflict pair given $B$. The variable $B$ in $N_3$ has a conflict pair given $A$ but none given $C$. When a variable $v_i$ in a CP-net $c$ has the largest possible number of parents, conflict pairs for each parent are an efficient way of determining the parent set of $v_i$. However, to teach the learner the absence of parents, e.g., when the parent set of $v_i$ is empty, the previously introduced notion of universal set becomes relevant. The idea is to use swaps over $v_i$ in which the contexts form an $(m,n-1,k)$-universal set in order to show that $v_i$ has no parents at all. If however $v_i$ does have parents, then such sets of swaps can help determine the preference relations for those parents. \begin{definition} Let $n\ge 1$, $m\ge 2$, and $0\le k\le n-1$. Let $V=\{v_1,\ldots,v_n\}$ be a set of $n$ distinct variables, where each $v_i\in V$ has the domain $\{v^i_1,\ldots,v^i_m\}$ of size $m$. Fix any $(m,n-1,k)$-universal set $U$, and let $v_i\in V$. Then define the set $U_{v_i}$ of contexts over $V\setminus\{v_i\}$ as follows. \[ U_{v_i}=\{(v^1_{j_1},\ldots,v^{i-1}_{j_{i-1}},v^{i+1}_{j_{i+1}},\ldots,v^n_{j_n})\mid (j_1,\ldots,j_{i-1},j_{i+1},\ldots,j_n)\in U\}\,. \] We call $U_{v_i}$ the context set imposed by $U$ and $v_i$. A set $\mathcal{F}\subseteq \mathcal{X}_{swap}$ of swaps is called a swap expression of $U_{v_i}$, if $|\mathcal{F}|=(m-1)|U_{v_i}|$ and, for each $(v^1_{j_1},\ldots,v^{i-1}_{j_{i-1}},v^{i+1}_{j_{i+1}},\ldots,v^n_{j_n})\in U_{v_i}$ there is an order $a_1\succ a_2\succ\ldots\succ a_m$ over the domain $D_{v_i}=\{a_1,\ldots,a_m\}$ such that \[((v^1_{j_1},\ldots,v^{i-1}_{j_{i-1}},a_t,v^{i+1}_{j_{i+1}},\ldots,v^n_{j_n}),\,(v^1_{j_1},\ldots,v^{i-1}_{j_{i-1}},a_{t+1},v^{i+1}_{j_{i+1}},\ldots,v^n_{j_n}))\in \mathcal{F}\] for all $t$ with $1\le t\le m-1$. \end{definition} For example, consider $n=4$, $m=2$, and $k=2$, and consider four variables $A$, $B$, $C$, and $D$ with domains $\{a,\bar{a}\}$, $\{b,\bar{b}\}$, $\{c,\bar{c}\}$, and $\{d,\bar{d}\}$, respectively. A $(2,3,2)$-universal set of vectors is, for instance \[ U=\{ (0,0,0)\,,(1,0,1)\,,(0,1,1)\,,(1,1,0) \}\,, \] since any projection of these vectors onto two of their three components yields all four binary vectors of length 2. The context set $U_A$ imposed by $U$ and $A$ is then \[ U_A=\{bcd, \bar{b}c\bar{d}, b\bar{c}\bar{d}, \bar{b}\bar{c}d\}\,. \] Finally, a swap expression of $U_A$ is given as follows. \[ \mathcal{F}=\{(abcd,\bar{a}bcd),(a\bar{b}c\bar{d},\bar{a}\bar{b}c\bar{d}),(ab\bar{c}\bar{d},\bar{a}b\bar{c}\bar{d}),(a\bar{b}\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] If $A$ had a third value $\bar{\bar{a}}$ in its domain, then $\mathcal{F}$ would be twice as large; for each swap $(ab^*c^*d^*,\bar{a}b^*c^*d^*)$ in $\mathcal{F}$, one would also include, for instance, $(\bar{a}b^*c^*d^*,\bar{\bar{a}}b^*c^*d^*)$. \begin{lemma}\label{lem:TDuniversal} Let $n\ge 1$, $m\ge 2$, and $0\le k\le n-1$. Let $N$ be any $k$-bounded CP-net over $n$ variables of domain size $m$. Let $v_i\in V$ be any variable in $N$. The variable $v_i$ has at least one parent in $N$ if and only if, for every $(m,n-1,k)$-universal set $U$, the imposed context set $U_{v_i}$ contains two distinct contexts $\gamma,\gamma'\in\mathcal{O}_{V\setminus\{v_i\}}$ such that $N$ entails $\gamma:a\succ\bar{a}$ but not $\gamma':\bar{a}\succ a$, for some values $a,\bar{a}\in D_{v_i}$. \end{lemma} \begin{proof} First, suppose $Pa(v_i)\ne\emptyset$ in $N$ and let $U$ be any $(m,n-1,k)$-universal set. Then there are $a,\bar{a}\in D_{v_i}$ and two distinct contexts $\alpha,\alpha'\in\mathcal{O}_{Pa(v_i)}$ such that $N$ entails $\alpha:a\succ\bar{a}$ but not $\alpha':\bar{a}\succ a$.\footnote{Recall that variables do not have dummy parents, i.e., every parent listed in the parent set of $v_i$ must affect the preference over $D_{v_i}$.} Since $U$ is an $(m,n-1,k)$-universal set and the length of $\alpha$ and $\alpha'$ is at most $k$, there are some contexts $\beta,\beta'\in\mathcal{O}_{V\setminus(Pa(v_i)\cup\{v_i\})}$, such that the contexts $\gamma,\gamma'\in\mathcal{O}_{V\setminus\{v_i\}}$ belong to $U_{v_i}$, where $\gamma,\gamma'$ result from $\alpha,\alpha'$ by extension with $\beta$ and $\beta'$, respectively. Clearly, $N$ entails $\gamma:a\succ\bar{a}$ but not $\gamma':\bar{a}\succ a$, since no variable over which $\beta$ and $\beta'$ are defined has an influence on the preference over $v_i$. Second, suppose that there are two distinct contexts $\gamma,\gamma'\in\mathcal{O}_{V\setminus\{v_i\}}$ such that $N$ entails $\gamma:a\succ\bar{a}$ but not $\gamma':\bar{a}\succ a$. This means that the preference over $D_{v_i}$ is conditional, i.e., $v_i$ has a parent in $N$. \end{proof} The following lemma gives upper and lower bounds on the teaching dimension of any single concept in the class of complete acyclic $k$-bounded CP-nets. \begin{lemma}\label{lem:TDbound} Let $n\ge 1$, $m\ge 2$, and $0\le k\le n-1$. Let $\mathcal{C}_{ac}^k$ be the class of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$, over the instance space $\mathcal{X}_{swap}$. Fix $c\in \mathcal{C}_{ac}^k$ and let $e_c$ denote the number of edges in $c$. The teaching dimension of the concept $c$ with respect to the class $\mathcal{C}_{ac}^k$ is bounded as follows. \[(m-1)\mathcal{M}_k\le \mathrm{TD}(c,\mathcal{C}_{ac}^k)\le e_c+n(m-1)\mathcal{U}_k\,.\] \end{lemma} \begin{proof} The lower bound follows from Lemma~\ref{lem:nonmaximal} in combination with Lemma~\ref{lem:maximal}---these two lemmas state that the smallest teaching dimension of any concept in $\mathcal{C}_{ac}^k$ is that of any maximal concept, and that this teaching dimension value equals $(m-1)\mathcal{M}_k$. For the upper bound, it suffices to show that $c$ has a teaching set of size $e_c+n(m-1)\mathcal{U}_k$. Consider a set $T$ of labeled examples defined in the following way. Fix any smallest $(m,n-1,k)$-universal set $U$. For each variable $v_i$ and each context $\gamma\in U_{v_i}$, the set $T$ includes $m-1$ examples determining the preference order over $D_{v_i}$ under the context $\gamma$. Note that these examples form a swap expression of $U_{v_i}$. In addition to these $n(m-1)\mathcal{U}_k$ examples, for each variable $v_i$ with $Pa(v_i)\ne\emptyset$ and for each $v\in Pa(v_i)$, the set $T$ contains two swaps $x,x'$ over the swapped variable $v_i$ that form a conflict pair for $v_i$ given $v$. By Definition~\ref{def:conflict}, the contexts in these two swaps are identical except for the variable $v$, which is assigned in a way that the two swaps display a difference in the preference over $D_{v_i}$. Any conflict pair $(x,x')$ for $v_i$ given $v$ will be sufficient for this purpose. In particular, we can choose $x$ and $x'$ in a way such that $x$ is already contained in the swap expression of $U_{v_i}$ included in $T$. Thus, in total, we add one labeled swap for each edge in $c$ on top of the $n(m-1)\mathcal{U}_k$ examples from the swap expressions. Clearly, the size of $T$ is $e_c+n(m-1)\mathcal{U}_k$. To show that $T$ is a teaching set for $c$, let $c'$ be any concept in $\mathcal{C}_{ac}^k$ that is consistent with $T$, and let $v_i$ be any variable. Let $P$ be the parent set of $v_i$ in $c$, and $P'$ the parent set of $v_i$ in $c'$. The conflict pairs in $T$ imply that $P\subseteq P'$. Now, for every context $\alpha$ over $P$, the swap expression of $U_{v_i}$ contained in $T$ shows that all context extensions of $\alpha$ to contexts of length up to $k$ give rise to the same preference order over $v_i$ in $c'$. Therefore, $P'$ cannot be a strict superset of $P$---otherwise all elements of $P'\setminus P$ would be dummy parents. So $P=P'$. As just stated, the swap expression of $U_{v_i}$ contained in $T$ determines the preference order over $v_i$ for each context $\alpha$ over $P$ and each extension of such $\alpha$ to contexts over $k$ variables. Since every parent set in $c'$ has size at most $k$, the $\mathrm{CPT}$ of $v_i$ in $c'$ is thus fully determined. Consequently, $c=c'$, i.e., $T$ is a teaching set for $c$. This concludes the proof. \end{proof} We illustrate the teaching set construction in the proof of Lemma~\ref{lem:TDbound} with an example. \begin{figure} \centering{ \begin{tikzpicture}[thick,every node/.style={scale=0.7}] \begin{scope} \node[state](A){$A$}; \node[state](D)[below=of A,yshift=-0.9cm]{$D$}; \node[state](B)[below right=of A]{$B$}; \node[state](C)[below left=of A]{$C$}; \node (aCPT)[above=of A,yshift=-1.3cm]{$a\succ\bar{a}$}; \node (dCPT)[below=of D,yshift=1.3cm]{$d\succ\bar{d}$}; \node(bCPT)[above=of B,yshift=-1cm]{\makecell[l]{$a:b\succ \bar{b}$\\$\bar{a}:\bar{b}\succ b$}}; \node(cCPT)[above=of C,xshift=-1cm,yshift=-.7cm]{\makecell[l]{$\bar{a}\bar{b}\qquad :\bar{c}\succ c$\\otherwise: $c\succ \bar{c}$}}; \path (A) edge[->] (B) edge[->] (C) (B) edge[->] (C); \end{scope} \end{tikzpicture} } \caption{Target CP-net for illustration of Lemma~\ref{lem:TDbound} and Algorithm 2.}\label{fig:alg2} \end{figure} \begin{example} Consider the case $n=4$, $m=2$, and $k=2$, and suppose the CP-net from Figure~\ref{fig:alg2} is the target CP-net. Note that a smallest $(3,2)$-universal set has exactly four elements, which will be the cardinality of each set $\mathcal{F}$ considered for each variable. To construct a teaching set, each variable will be treated separately. For variable $A$, one selects a set of contexts for $A$ that are imposed by a smallest $(2,3,2)$-universal set. One such choice is $\{bcd, \bar{b}c\bar{d}, b\bar{c}\bar{d}, \bar{b}\bar{c}d\}$. This leads to the following swap expression $\mathcal{F}$. \[ \mathcal{F}=\{(abcd,\bar{a}bcd),(a\bar{b}c\bar{d},\bar{a}\bar{b}c\bar{d}),(ab\bar{c}\bar{d},\bar{a}b\bar{c}\bar{d}),(a\bar{b}\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] The set $T$ will contain all the examples in $\mathcal{F}$, together with their correct labels, which will show that the target CP-net entails $a\gamma\succ\bar{a}\gamma$ for all $\gamma\in\mathcal{O}_{V\setminus\{A\}}$. This part of the teaching set $T$ hence determines that $A$ has no parents and that $a\succ\bar{a}$ is the only statement in $\mathrm{CPT}(A)$. For variable $B$, the same construction would yield a swap expression \[ \mathcal{F}=\{(abcd,a\bar{b}cd),(\bar{a}bc\bar{d},\bar{a}\bar{b}c\bar{d}),(ab\bar{c}\bar{d},a\bar{b}\bar{c}\bar{d}),(\bar{a}b\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] Including these swaps with their correct labels in $T$ reveals that $abcd\succ a\bar{b}cd$, $\bar{a}\bar{b}c\bar{d}\succ\bar{a}bc\bar{d}$, $ab\bar{c}\bar{d}\succ a\bar{b}\bar{c}\bar{d}$, $\bar{a}\bar{b}\bar{c}d\succ \bar{a}b\bar{c}d$. It is clear from these examples already that $B$ must have at least one parent, but the parent set itself is not yet determined. In order to show that $A$ is a parent of $B$, we select the swap $x=(abcd,a\bar{b}cd)$ from $T$ and pick an appropriate swap $x'$ so that $(x,x')$ forms a conflict pair for $B$ given $A$; in this case $x'=(\bar{a}bcd,\bar{a}\bar{b}cd)$. We add $x'$ with its label to $T$. Now we claim that $T$ fully determines $\mathrm{CPT}(B)$. To see this, partition $\mathcal{F}$ according to the values in $A$: \[ \mathcal{F}_{A=a}=\{(abcd,a\bar{b}cd),(ab\bar{c}\bar{d},a\bar{b}\bar{c}\bar{d})\}\mbox{ and }\mathcal{F}_{A=\bar{a}}=\{ (\bar{a}bc\bar{d},\bar{a}\bar{b}c\bar{d}),(\bar{a}b\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] Each set displays a single preference order over $D_B$, so that $B$ has no further parents. The set $T$ thus reveals that $Pa(B)=\{A\}$ and that $\mathrm{CPT}(B)$ contains the two statements $a:b\succ\bar{b}$ and $\bar{a}:\bar{b}\succ b$. For variable $C$, the construction from the proof of Lemma~\ref{lem:TDbound} works similarly as for $B$. Two conflict pairs reveal that $A$ and $B$ are parents of $C$, and partitioning the initial swap expression set into four subsets (according to the four possible assignments to the variables $A$ and $B$) will show the same preference order over $D_C$ in each of the four parts, which will fully determine $\mathrm{CPT}(C)$. Finally, variable $D$ can be treated by analogy to the case of variable $A$. \end{example} Our main result on the teaching dimension can be stated as follows. \begin{theorem} Let $n\ge 1$, $m=2$, and $0\le k\le n-1$. The teaching dimension of the class of all complete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$, over the instance space $\mathcal{X}_{swap}$, is bounded as follows. \[n(m-1)m^k\le n(m-1)\mathcal{U}_k\le\mathrm{TD}(\mathcal{C}_{ac}^k)\le e_{max}+n(m-1)\mathcal{U}_k\le nk+n(m-1)\binom{n-1}{k}m^k\,.\] For the values $k=0$, $k=1$, and $k=n-1$, the following holds: \begin{enumerate} \item $\mathrm{TD}(\mathcal{C}_{ac}^0)=(m-1)n$. \item $\mathrm{TD}(\mathcal{C}_{ac}^1)=(m-1)mn$. \item $\mathrm{TD}(\mathcal{C}_{ac}^{n-1})=(m-1)nm^{n-1}$. \end{enumerate} \label{thm:TD} \end{theorem} \begin{proof} To obtain a lower bound of $n(m-1)\mathcal{U}_k$ on the teaching dimension, let us first determine the teaching dimension of any complete separable CP-net with respect to the class $\mathcal{C}_{ac}^k$. Consider any unconditional $\mathrm{CPT}$, i.e., a $\mathrm{CPT}$ of the form $\mathrm{CPT}(v_i)=\{a_1\succ \dots \succ a_m\}$. To distinguish a complete separable CP-net $c$ with this $\mathrm{CPT}$ from all other concepts in $\mathcal{C}_{ac}^k$, examples are needed that show that $v_i$ has no parent. Since for CP-nets in $\mathcal{C}_{ac}^k$, the variable $v_i$ can have up to $k$ parents, a teaching set for $c$ has to demonstrate the following: For each set $R$ of $k$ variables in $V\setminus\{v_i\}$, and for each of the $m^k$ possible contexts over $R$, the target CP-net $c$ entails the same order $a_1\succ \dots \succ a_m$. That means, a teaching set of swap pairs for $c$ must ``cover'' each such context over $R$, and for each such context provide at least $m-1$ examples so that the total order over the $m$ domain values of $v_i$ can be determined. In other words, the swap pairs with swapped variable $v_i$ that occur in the teaching set for $c$ must be partitioned into parts of size $m-1$, where each part forms an $(m,n-1,k)$-universal set. The same applies to each of the $n$ variables in $V$, since knowledge of the $\mathrm{CPT}$ for any subset of $V$ still leaves open the possibility of up to $k$ parents for each of the remaining variables. Consequently, to teach $c$, at least $n(m-1)\mathcal{U}_k$ examples are needed. Thus, $\mathrm{TD}(\mathcal{C}_{ac}^k)\ge n(m-1)\mathcal{U}_k$. The upper bound of $e_{max}+n(m-1)\mathcal{U}_k$ on the teaching dimension is immediate from Lemma~\ref{lem:TDbound}. The upper and lower bounds on $\mathcal{U}_k$ are not hard to obtain. First, $m^k\le \mathcal{U}_k$ because an $(m,n-1,k)$-universal set must yield $m^k$ distinct projections onto any set of at least $k$ components. Second, $\mathcal{U}_k\le\binom{n-1}{k}m^k$ because an $(m,n-1,k)$-universal set can always be obtained as follows: for each $k$-element subset of the $n-1$-element universe, include $m^k$ vectors, namely one for each possible assignment of values in $\{1,\ldots,m\}$ to each of the $k$ elements in the subset. Concerning the values for $k=0$, $k=1$, and $k=n-1$, note that $\mathcal{U}_0=1$, $\mathcal{U}_1=m$, and $\mathcal{U}_{n-1}=m^{n-1}$ by Lemma~\ref{lem:universal}, which yields the desired lower bounds on the teaching dimension values for $\mathcal{C}_{ac}^0$, $\mathcal{C}_{ac}^1$, and $\mathcal{C}_{ac}^{n-1}$, respectively. For $k=0$, we have $e_{max}=0$, so that the upper and lower bounds on the teaching dimension coincide, yielding $n(m-1)$. For $k=1$, we will show an upper bound of $(m-1)mn$, matching the lower bound. Consider any variable $v_i$ in the target CP-net. If it has no parents, then its $\mathrm{CPT}$ can be taught with $(m-1)\mathcal{U}_1=(m-1)m$ examples. If it has a parent, then $(m-1)m$ suitably chosen examples suffice to teach the target preference relation over $D_{v_i}$ for every possible value of the parent variable. Since $k=1$, it is then clear that $v_i$ has no other variable, so that $\mathrm{CPT}(v_i)$ is fully determined. Applying the same reasoning to every variable, we obtain a teaching set of size $n(m-1)m$. For $k=n-1$, a teaching set that specifies a preference order over $m$ values using $m-1$ suitably chosen swaps over $v$, for each variable $v$ and for each of the $m^{n-1}$ contexts over the remaining variables, uniquely determines the target concept, so that the lower bound of $(m-1)nm^{n-1}$ is attained. \end{proof} Theorem~\ref{thm:TD} implies that, for $\mathcal{C}_{ac}^{n-1}$, the ratio of $\mathrm{TD}$ over instance space size $|\mathcal{X}_{swap}|$ is $\frac{2}{m}$. In particular, in the case of binary CP-nets (i.e., when $m=2$), which is the focus of most of the literature on learning CP-nets, the teaching dimension equals the instance space size. However, maximal concepts have a teaching dimension far below the worst-case teaching dimension. \section{The Complexity of Learning Potentially Incomplete Acyclic CP-Nets}\label{sec:incomplete} In this section, we revisit our results on the VC dimension and the teaching dimension for the case that CP-nets are potentially incomplete. This extension is useful for several reasons. \begin{itemize} \item In practice, it is likely that users will sometimes be indifferent for some attributes (under certain contexts) or that not enough information is available to completely determine user preferences. This makes the restriction to complete CP-nets unrealistic. \item We will introduce algorithms that learn both complete and incomplete CP-nets from membership queries. In order to be able to assess the optimality of these algorithms in terms of the number of queries required, we will use the value of the teaching dimension of the corresponding concept class. Likewise, we will reassess an algorithm by Koriche and Zanuttini~\cite{Koriche2010685} that uses equivalence and membership queries for learning potentially incomplete CP-nets; for this purpose we need to calculate the VC dimension of the corresponding concept class. \item Our extension of Theorem~\ref{thm:VCDac} to the case of potentially incomplete CP-nets substantially improves on (and corrects) a result by Koriche and Zanuttini~\cite{Koriche2010685}, who present a lower bound on $\mathrm{VCD}(\mathcal{C}_{ac}^k)$; their bound is in fact incorrect unless $k\ll n$. \end{itemize} The main results of this section are summarized in Table~\ref{tab:resultsIncomplete}. \begin{table*} \centering \caption{Summary of complexity results for classes of potentially incomplete CP-nets. $\mathcal{M}_k=(n-k)m^k+\frac{m^k-1}{m-1}$, as detailed in Lemma~\ref{lem:Mk}; $e_{max}=(n-k)k+\binom{k}{2}\le nk$; the value $\mathcal{U}_k$ is defined in Definition~\ref{def:Uk}.} \begin{footnotesize} \begin{tabular}{|c|c|c|} \hline class & VCD & TD \\ \hline $\overline{\mathcal{C}}_{ac}^k$& $\geq (m-1)\mathcal{M}_k$& $2n(m-1)\mathcal{U}_k\le \mathrm{TD} \le e_{max}+2n(m-1)\mathcal{U}_k$ \\ \hline $\overline{\mathcal{C}}_{ac}^{n-1}$& $m^n-1$& $2n(m-1)m^{n-1}$ \\ \hline $\overline{\mathcal{C}}_{ac}^{0}$&$(m-1)n$&$2(m-1)n$ \\ \hline \end{tabular} \end{footnotesize} \label{tab:resultsIncomplete} \end{table*} \subsection{VC Dimension} We will first establish that Theorem~\ref{thm:VCDac} remains true when we allow incomplete CP-nets and use the larger instance space $\overline{\mathcal{X}}_{swap}$. In particular, the VC dimension of the class of all complete acyclic $k$-bounded CP-nets (over $\mathcal{X}_{swap}$) equals the VC dimension of the class of all complete and incomplete acyclic $k$-bounded CP-nets (over $\overline{\mathcal{X}}_{swap}$.) \begin{theorem}\label{thm:VCD} For fixed $n\ge 1$, $m\ge 2$, and any given $k\le n-1$, the following VC dimension values are equal: \begin{enumerate} \item $\mathrm{VCD}(\mathcal{C}_{ac}^k)$, i.e., the VC dimension of the class of all complete acyclic $k$-bounded CP-nets over $n$ variables with $m$ values each, over the instance space $\mathcal{X}_{swap}$, \item $\mathrm{VCD}(\overline{\mathcal{C}}_{ac}^k)$, i.e., the VC dimension of the class of all complete and incomplete acyclic $k$-bounded CP-nets over $n$ variables with $m$ values each, over the instance space $\overline{\mathcal{X}}_{swap}$. \end{enumerate} \end{theorem} \begin{proof} Since $\mathrm{VCD}(\overline{\mathcal{C}}_{ac}^k)\ge \mathrm{VCD}(\mathcal{C}_{ac}^k)$ is immediate from the definitions, it suffices to show that $\mathrm{VCD}(\mathcal{C}_{ac}^k)\ge \mathrm{VCD}(\overline{\mathcal{C}}^k_{ac})$. Suppose $X\subseteq \overline{\mathcal{X}}_{swap}$ is a set of swap instances that is shattered by $\overline{\mathcal{C}}^k_{ac}$. We need to show that there is a set $X' \subseteq \mathcal{X}_{swap}$ such that $|X'|=|X|$ and $X'$ is shattered by $\mathcal{C}_{ac}^k$. Since $X$ is shattered by $\overline{\mathcal{C}}^k_{ac}$, there is no $(o,o')$ such that both $(o,o')$ and $(o',o)$ belong to $X$. Otherwise there would be a $c\in \overline{\mathcal{C}}^k_{ac}$ such that $c(o,o')= c(o',o)=1$, which is an impossible inconsistency. The fact that there is no $(o,o')$ such that both $(o,o')$ and $(o',o)$ belong to $X$ has two implications: (i) Either $X\subseteq \mathcal{X}_{swap}$ or swapping the order of some pairs in $X$ results in a set $X'$ such that $X'$ is a subset of $\mathcal{X}_{swap}$. (ii) Every incomplete CP-net $c\in \overline{\mathcal{C}}^k_{ac}$ can be turned into a complete CP-net in $\mathcal{C}^k_{ac}$ by adding statements to some of its $\mathrm{CPT}$s without changing the value of $c(x)$ for any $x\in X$. (This is because every incomplete CP-net results from a complete one by removing some $\mathrm{CPT}$ statement(s).) This holds in particular for the set of $2^{|X|}$ CP-nets in $\overline{\mathcal{C}}^k_{ac}$ that witness the shattering of $X$: each of them can be completed in a way so that the $2^{|X|}$ completions still shatter $X$. Combining (i) and (ii), we obtain that there is a set $X' \subseteq \mathcal{X}_{swap}$ such that $|X'|=|X|$ and $X'$ is shattered by $\mathcal{C}_{ac}^k$. \end{proof} From Theorems~\ref{thm:VCDac} and \ref{thm:VCD}, we immediately obtain the following corollary. \begin{corollary} For fixed $n\ge 1$, $m\ge 2$, and any given $k\le n-1$, the following statements hold for the VC dimension of the class $\overline{\mathcal{C}}_{ac}^k$ of all complete and all incomplete acyclic $k$-bounded CP-nets over $n$ variables with $m$ values each, over the instance space $\overline{\mathcal{X}}_{swap}$. \begin{enumerate} \item $\mathrm{VCD}(\overline{\mathcal{C}}_{ac}^{n-1})=m^n-1$. \item $\mathrm{VCD}(\overline{\mathcal{C}}_{ac}^0)=(m-1)n$. \item $\mathrm{VCD}(\overline{\mathcal{C}}_{ac}^k)\geq(m-1)\mathcal{M}_k = (m-1)(n-k)m^k+m^k-1$. \end{enumerate} \end{corollary} It is worth observing that, for the case $k=n-1$, we can generalize our result on the VC dimension to the class of \emph{all consistent}\/ (acyclic or cyclic) CP-nets. Lemma~\ref{lem:booth} immediately implies that the VC dimension of the class of all consistent CP-nets is at most $m^n-1$. Our Theorem~\ref{thm:VCDac} shows that a subclass of this class already has a VC dimension of $m^n-1$, so that we obtain the following corollary. \begin{corollary}\label{cor:VCDcons} Over the instance space $\overline{\mathcal{X}}_{swap}$, the VC dimension of the class $\mathcal{C}^{cons}$ of complete and incomplete consistent unbounded CP-nets over $n$ variables of domain size $m$ is $m^n-1$. \end{corollary} Sauer's Lemma~\cite{Sau72} then bounds the number of consistent CP-nets from above by \[ \sum_{i=0}^{m^n-1}\binom{|\mathcal{X}_{swap}|}{i}\,. \] One possible interpretation of Theorem~\ref{thm:VCDac} and Corollary~\ref{cor:VCDcons} is that acyclic CP-nets, while less expressive, are in some sense as hard to learn as all consistent CP-nets. To conclude our discussion of the VC dimension, we would like to remark that our results contradict a lower bound on the VC dimension of the class of all complete and incomplete acyclic CP-nets with bounded indegree that was presented in~\cite{Koriche2010685}. In Appendix\ref{sec:app}, we argue why the latter bound is incorrect. \subsection{Teaching Dimension} It is not difficult to adapt our previous teaching dimension results to the case of learning both complete and incomplete acyclic CP-nets, for various indegree bounds $k$. \begin{theorem} Let $n\ge 1$, $m=2$, and $0\le k\le n-1$. The teaching dimension of the class of all complete and incomplete acyclic $k$-bounded CP-nets over $n$ variables of domain size $m$, over the instance space $\overline{\mathcal{X}}_{swap}$, is bounded as follows. \[2n(m-1)m^k\le 2n(m-1)\mathcal{U}_k\le\mathrm{TD}(\overline{\mathcal{C}}_{ac}^k)\le e_{max}+2n(m-1)\mathcal{U}_k\le nk+2n(m-1)\binom{n-1}{k}m^k\,.\] For the values $k=0$, $k=1$, and $k=n-1$, the following holds: \begin{enumerate} \item $\mathrm{TD}(\overline{\mathcal{C}}_{ac}^0)=2(m-1)n$. \item $\mathrm{TD}(\overline{\mathcal{C}}_{ac}^1)=2(m-1)mn$. \item $\mathrm{TD}(\overline{\mathcal{C}}_{ac}^{n-1})=2(m-1)nm^{n-1}$. \end{enumerate} \label{thm:TDincomplete} \end{theorem} \begin{proof} For the lower bound, consider the empty CP-net, i.e., a separable CP-net without any statements in any of its $\mathrm{CPT}$s. We use the same argument as in the proof of Theorem~\ref{thm:TD} to show that one needs at least $n$ swap expressions of contexts imposed by universal sets to teach this CP-net. Note however, that every swap $(o,o')$ in the resulting teaching set will be labeled 0, as the target CP-net entails no preferences. This would leave open the option that the reverse swap $(o',o)$ could be labeled 1 by the target CP-net. To exclude this option, the teaching set must contain the reverse swap $(o',o)$ as well, with the correct label 0. Therefore, the lower bound is exactly twice as large as the lower bound in Theorem~\ref{thm:TD}. For the upper bound, our argument is similar to that in the proof of Lemma~\ref{lem:TDbound}. The construction of the teaching sets remains essentially the same: one includes (i) a swap expression of a context set imposed by a universal set, in order to teach preferences once the parents are known, as well as to determine when a variable has no parents (on top of the already found ones), and (ii) a conflict pair $(x,x')$ for each edge in the target CP-net, where $x$ is chosen from the swap expression set. The only difference is that we make the swap expression set twice as large by including the reverse swap $(x.2,x.1)$ to every $(x.1,x.2)$ already included. This will make sure that, in the case of a swap $(o,o')$ labeled 0, one can find out whether the reverse swap $(o',o)$ is also labeled 0 (which would mean that the target CP-net entails no preference between $o$ and $o'$) or whether the reverse swap is labeled 1 (which would mean that the target CP-net entails the preference $o'\succ o$). The trivial upper and lower bounds on the value $\mathcal{U}_k$, namely $\binom{n-1}{k}m^k$ and $m^k$, respectively, were already established in Theorem~\ref{thm:TD}. For the special cases of $k=0$, $k=1$, and $k=n-1$, one only needs to adapt the argument in the proof of Theorem~\ref{thm:TD} by forming the symmetric closure of the set of swaps used in the teaching sets, i.e., always adding the reverse swaps. \end{proof} \section{Learning from Perfect Membership Queries} \label{sec:perfect} In this section, we investigate the problem of learning complete CP-nets from membership queries alone, in contrast to the setting considered by Koriche and Zanuttini, where the learner asks both membership and equivalence queries \cite{Koriche2010685}. A membership query, represented by a pair $(o,o')$ of objects, corresponds to asking the user directly whether they prefer $o$ over $o'$ or not. In an idealized model, it is expected that the user will always answer truthfully. An equivalence query, represented by a CP-net $N$, corresponds to asking the user whether $N$ correctly captures their preferences. The user is expected to answer correctly, where a negative response is accompanied by a witness, i.e., a pair $(o,o')$ of objects for which $N$ entails a preference opposite to the user's. While in computational learning theory, beginning with Angluin's seminal work on learning regular languages~\cite{Angluin87}, the combination of equivalence and membership queries has been the most commonly investigated query scenario, we have several reasons for investigating learning from membership queries only. Firstly, from the cognitive perspective, answering membership queries of the form \quotes{\emph{is $o$ better than $o'$?}} is more intuitive and poses less burden upon the user than comparing a proposed CP-net to the true one (which is the case when answering equivalence queries). Considering that membership queries can at times be perceived as too intrusive by the user, equivalence queries do not seem reasonable at all. To the best of our knowledge, the only ``real-world'' implementation of equivalence queries is in the area of formal methods, where an equivalence query corresponds to a guess on the semantics of a program in a given class of target programs, and a formal verification procedure (comparable to a model checker) can be run in order to verify the correctness of the guess. This works well for fully automated reasoning about finite-state systems, where such verification procedures can be implemented, but it is unreasonable to assume that users of an e-commerce system (or of some similar kind of application) can verify equivalence queries about their preferences.\footnote{Note that equivalence queries, from a learning-theoretic point of view, can be considered as a prediction system ``in action''~\cite{Angluin:1988:QCL:639961.639995}: a system corresponding to an equivalence query for $N$ would keep predicting the user's preferences according to the entailments of $N$. As long as all predictions by the system are correct, the hypothesis $N$ will be maintained. When a prediction mistake is made, the system will update its hypothesis using the mistake as a counterexample, which then results in a new equivalence query. In the end, the overall number of mistakes made by the system equals the number of equivalence queries asked. To the best of our knowledge, there is no reasonable application scenario in preference elicitation where such system would make sense. In practice, a system may want to offer products to a user, and the system's success lies in being able to identify the best product according to the user's preferences. However, the scenario of an equivalence query for a CP-net does not correspond to making guesses about the best product, but rather to making guesses about preferences between any two arbitrary products, for which no obvious counterpart (other than making membership queries) is seen in practice.} Secondly, Koriche and Zanuttini showed that membership queries are powerful in the sense that CP-nets are not efficiently learnable from equivalence queries alone but they are from equivalence and membership queries \cite{Koriche2010685}. Thus, an immediate question is whether membership queries alone are powerful enough to efficiently learn CP-nets. In particular, we can consider learning from membership queries as an extreme case of limiting the allowable number of equivalence queries in order to investigate how much information can be obtained from the (intuitively less costly) membership queries. Thirdly, direct queries to users, asking them to express preferences between two objects, were shown to be useful for information gathering in recommender systems, possibly more so than the typical queries asking users to rate items on a fixed scale~\cite{JonesBB11}. Thus, recommender systems are a potential application of our studies on learning CP-nets from membership queries. The complexity results presented in Sections \ref{sec:complete} and \ref{sec:incomplete} have interesting consequences on learning CP-nets from membership queries alone. In particular, it is known that the query complexity of the optimal membership query algorithm is lower-bounded by the teaching dimension of the class \cite{queriesRevisited}. Therefore, in this section, we propose strategies to learn CP-nets and use the $\mathrm{TD}$ results to assess their optimality. In what follows, we show near-optimal query strategies for tree CP-nets and generally for classes of bounded acyclic CP-nets. \subsection{Tree CP-Nets} \label{sec:treeMQ} Koriche and Zanuttini~\cite{Koriche2010685} present an algorithm for learning a binary tree-structured CP-net $N^*$ that may be incomplete (i.e., it learns the superclass $\overline{\mathcal{C}}_{ac}^1$ of $\mathcal{C}_{ac}^1$ for $m=2$.) Their learner uses at most $n_{N^*}+1$ equivalence queries and $4n_{N^*}+e_{N^*}\log_2(n)$ membership queries, where $n_{N^*}$ is the number of relevant variables and $e_{N^*}$ the number of edges in $N^*$. We present a method for learning any CP-net in $\mathcal{C}_{ac}^1$ (i.e., \emph{complete\/} tree CP-nets) for any $m$, using only membership queries. Later, we will extend that method to cover also the case of incomplete CP-nets. Recall that, for a CP-net $N$, a conflict pair w.r.t.\ $v_i$ is a pair $(x,x')$ of swaps such that (i) $V(x)=V(x')=v_i$, (ii) $x.1$ and $x'.1$ agree on $v_i$, (iii) $x.2$ and $x'.2$ agree on $v_i$, and (iv) $N$ entails one of the swaps $x,x'$, but not the other, cf.\ Definition~\ref{def:conflict}. If $v_i$ has a conflict pair $(x,x')$, then $v_i$ has a parent variable $v_j$ whose values in $x$ and $x'$ are different. Such a variable $v_j$ can be found with $\log_2(n)$ membership queries by binary search (each query halves the number of candidate variables with different values in $x$ and $x'$) \cite{adaptiveLearning}. We use this binary search to learn tree-structured CP-nets from membership queries, by exploiting the following fact: if a variable $v_i$ in a tree CP-net has a parent, then a conflict pair w.r.t.\ $v_i$ exists and can be detected by asking membership queries to sort $m$ ``test sets'' for $v_i$. Let $(v^i_ 1,\ldots,v^i_m)$ be an arbitrary but fixed permutation of $D_{v_i}$. Then, for all $j\in\{1,\ldots,m\}$, a test set $I_{i,j}$ for $v_i$ is defined by $I_{i,j}=\{(v^1_j,\ldots,v^{i-1}_j,v^i_r,v^{i+1}_j,\ldots,v^n_j)\mid 1\le r\le m\}$. Since $v_i$ has no more than one parent, determining preference orders over $m$ such test sets of size $m$ is sufficient for revealing conflict pairs, rather than having to test all possible contexts in $\mathcal{O}_{V\setminus\{v_i\}}$. \begin{example} Consider the set of variables $V=\{A,B,C\}$ where $D_{A}=\{a,a',a'',a'''\}$, $D_{B}=\{b,b',b'',b'''\}$, and $D_{C}=\{c,c',c'',c'''\}$. The following is one possible collection of test sets for the variable $A$: \begin{align*} \vspace*{-\baselineskip} &I_{A,1}=\{abc, a'bc, a''bc, a'''bc\}\\ &I_{A,2}=\{ab'c', a'b'c', a''b'c', a'''b'c'\}\\ &I_{A,3}=\{ab''c'',a'b''c'',a''b''c'',a'''b''c''\}\\ &I_{A,4}=\{ab'''c''',a'b'''c''',a''b'''c''',a'''b'''c'''\} \end{align*} \end{example} Clearly, a complete target CP-net imposes a total order on every $I_{i,j}$, which can be revealed by posing enough membership queries selected from the $\binom{m}{2}$ swaps over $I_{i,j}$; a total of $O(m\log_2(m))$ comparisons suffice to determine the order over $I_{i,j}$. This yields a simple algorithm for learning tree CP-nets with membership queries: \medskip \noindent\textbf{Algorithm 1.} For every variable $v_i$, determine $Pa(v_i)$ and $\mathrm{CPT}(v_i)$ as follows: \begin{enumerate} \item For every value $j\in\{1,\ldots,m\}$, ask $O(m\log_2(m))$ membership queries from the $\binom{m}{2}$ swaps over $I_{i,j}$ to obtain an order over $I_{i,j}$. Note that, for $m=2$, a single query is enough to obtain an order over $I_{i,j}$. \item If for all $j_1,j_2\in\{1,\ldots,m\}$ the obtained order over $I_{i,j_1}$ imposes the same order on $D_{v_i}$ as the obtained order over $I_{i,j_2}$ does, i.e., there is no conflict pair for $v_i$, then $Pa(v_i)=\emptyset$. In this case, $\mathrm{CPT}(v_i)$ is fully determined by the queries in Step 1, following the order over $D_{v_i}$ that is imposed by the order over any of the $I_{i,j}$. \item If there are some $j_1,j_2\in\{1,\ldots,m\}$ such that the obtained order over $I_{i,j_1}$ imposes a different order on $D_{v_i}$ than the obtained order over $I_{i,j_2}$ does, i.e., there is a conflict pair $(x,x')$ for $v_i$, then find the only parent of $v_i$ by $\log_2(n)$ further queries, as described by Damaschke \cite{adaptiveLearning}. From these queries, together with the ones posed in Step 1, $\mathrm{CPT}(v_i)$ is fully determined. \end{enumerate} The procedure described by Damaschke \cite{adaptiveLearning} is a binary search on the set of candidates for the parent variable. Let $(x,x')$ be the conflict pair over variable $v_i$, as found in Step 3, where \begin{eqnarray*} x&=(a_1\ldots a_{i-1}a_ia_{i+1}\ldots a_n,\ a_1\ldots a_{i-1}\overline{a_i}a_{i+1}\ldots a_n)\,,\\ x'&=(a'_1\ldots a'_{i-1}a_ia'_{i+1}\ldots a'_n,\ a'_1\ldots a'_{i-1}\overline{a_i}a'_{i+1}\ldots a'_n)\,. \end{eqnarray*} Initially, each variable other than $v_i$ is a potential parent. The set of potential parents is halved recursively by asking membership queries for swaps $(o,o')$ over $v_i$, with $o(v_i)=a_i$, $o'(v_i)=\bar{a_i}$, and half of the potential parent variables in $o$ and $o'$ having the same values as in $x$, while the other half of the potential parent variables has values identical to those in $x'$. (The variables that have been eliminated from the set of potential parent variables will all be assigned the same values as in $x$.) \begin{example} Suppose the queries on the test sets revealed a conflict pair $(x,x')$ for the variable $v_5$, where \begin{eqnarray*} x&=(a_1a_2a_3a_4a,\ a_1a_2a_3a_4\overline{a})\,,\\ x'&=(a'_1a'_2a'_3a'_4a,\ a'_1a'_2a'_3a'_4\overline{a})\,, \end{eqnarray*} and \[ a_1a_2a_3a_4a\succ a_1a_2a_3a_4\overline{a}\,, \] while \[ a'_1a'_2a'_3a'_4\overline{a}\succ a'_1a'_2a'_3a'_4a\,. \] To find the only parent of $v_5$, Damaschke's procedure will check whether \[ a_1a_2a'_3a'_4a\succ a_1a_2a'_3a'_4\overline{a}\,. \] If yes, then either $v_1$ or $v_2$ must be the parent of $v_5$, and one will next check whether \[ a_1a'_2a_3a_4a\succ a_1a'_2a_3a_4\overline{a}\,. \] If yes, then $v_1$ is the parent of $v_5$, else $v_2$ is the parent of $v_5$. If, however, $a_1a_2a'_3a'_4\overline{a}\succ a_1a_2a'_3a'_4a$, then the second query would have been to test whether $a_1a_2a'_3a_4a\succ a_1a_2a'_3a_4\overline{a}$, in order to determine whether the parent of $v_5$ is $v_3$ or $v_4$. \end{example} \iffalse Algorithm \ref{alg:MQtree} describes these steps in a detailed manner. The symbol $\overrightarrow{x}$ refers to the entailment of a queried instance $x$ where $\textbf{MQ}$ denote the query oracle. Given the test sets as described above for every variable $v_i$, we query the oracle to reveal the total order over each $I_{i,j}$ (line 5). In case there is a conflict pair, i.e., one $I_{i,j}$ shows $y\succ y'$ while another shows $y'\succ y$, we find the only parent variable of $v_i$ by binary search (lines 21-43) as described by Damaschke \cite{adaptiveLearning}. If there exists no conflict pair, then we are certain that all the test sets showed an identical total order and any learned order would suffice as an unconditional statement for $\mathrm{CPT}(v_i)$ (lines 7-9). \begin{algorithm} \footnotesize \caption{\textsc{LearnMQ}$_{tree}$} \label{alg:MQtree} \begin{algorithmic}[1] \Require $I_i$ the test sets for every variable $v_i\in V$ \Ensure A hypothesis $N$ equivalent to the target in $\mathcal{C}_{ac}^1$ \State $N\gets \emptyset$ \For{\textbf{each} variable $v_i$} \State Let $I_{i,1}, I_{i,2},\dots,I_{i,m}$ be the test cases of $v_i$ \State $\mathrm{CPT}(v_i)\gets \emptyset$ \For{$j\gets1$ \textbf{to} $m$} \State $r_j\gets$ sort($I_{i,j}$) \Comment{reveal the total order by membership queries} \EndFor \If{$r_1,\dots,r_m$ do not show conflict pairs} \State $Pa(v_i)\gets \emptyset$ \State $\mathrm{CPT}(v_i)\gets r_1$ \Else \State Let $x$ and $x'$ to be a conflict pair \State $P\gets \{v\in V\backslash \{v_i\} \mid x[v]\neq x'[v] \}$ \State $v\gets$ \textsc{FindParent}($P,x,x'$) \State $Pa(v_i)\gets v$ \State Let $y_j$ be the value of $v$ in $I_{i,j}$ \State $\mathrm{CPT}(v_i)\gets \mathrm{CPT}(v_i)\cup y_j:r_j$ for every $j\in \{1,\dots,m\}$ \EndIf \State $N\gets N\cup \mathrm{CPT}(v_i)$ \EndFor \State \Return $N$ \Function{findParent}{$P$,$x,x'$} \State Let $v$ be the swapped variable of $x$ and $x'$ \State Let $\{y,y'\}\in D_{v}$ be the values of $v$ in $x$ and $x'$ \If{$|P|=1$} \State return $P$ \Else \State Let $X$ and $X'$ be a partition over $P$ with equal size \State $o\gets \emptyset$ \For{\textbf{each} variable $v_i\in V\backslash \{v\}$} \If{$v_i\in X$} \State $o[v_i]\gets x[v_i]$ \Else \State $o[v_i]\gets x'[v_i]$ \EndIf \EndFor \State $\overrightarrow{q} \gets \mathbf{MQ}(q)$ where $q\in \mathcal{X}_{swap}$ and $q[V\backslash v]=o$ \If{$\overrightarrow{q}$ and $\overrightarrow{x}$ form a conflict pair} \State \textsc{findParent}($X'$,$q,x$) \Else \State \textsc{findParent}($X$,$q,x'$) \EndIf \EndIf \EndFunction \end{algorithmic} \end{algorithm} \fi We formulate a result on learning complete tree CP-nets. \begin{theorem}\label{thm:treePerfect} Let $n\ge 1$, $m\ge 2$. Algorithm 1 learns every complete tree CP-net $N^*\in\mathcal{C}_{ac}^1$ over $n$ variables of domain size $m$ with \[ O(nm^2\log_2(m)+e_{N^*}\log_2(n)) \] membership queries over swap examples in $\mathcal{X}_{swap}$, where $e_{N^*}$ is the number of edges in $N^*$. In particular, for $m=2$, Algorithm 1 requires at most $2n+e_{N^*}\log_2(n)$ queries. \end{theorem} \begin{proof} Step 1 consumes $O(m^2\log_2(m))$ queries and is run $n$ times, and Step 3 consumes an additional $\log_2(n)$ for every variable $v_i$ that has a parent. In total, this sums up to $O(nm^2\log_2(m)+e_{N^*}\log_2(n))$ queries. When $m=2$, Step 1 requires only $m$ queries for each variable $v_i$, namely a single query per test set, for 2 test sets. This results in a total of $2n+e_{N^*}\log_2(n)$ queries. The correctness of Algorithm 1 follows from the properties of conflict pairs and tests sets. The existence of a conflict pair is equivalent to the existence of a parent, and the orders over the test sets correspond to $\mathrm{CPT}$ statements for all relevant contexts. The $m$ test sets as specified above are sufficient since each variable has at most one parent. Thus, the responses to the queries asked by Algorithm 1 uniquely determine the target tree CP-net. \end{proof} As Theorem~\ref{thm:treePerfect} states, for the binary case, Algorithm 1 requires $2n+e_{N^*}\log_2(n)$ queries at most, i.e., compared to Koriche and Zanuttini's method, when focusing only on tree CP-nets with non-empty $\mathrm{CPT}$s, our method reduces the number of membership queries by a factor of 2, while at the same time dropping equivalence queries altogether. It is a well-known fact that the teaching dimension of a concept class $\mathcal{C}$ is a lower bound on the worst-case number of membership queries required for learning concepts in $\mathcal{C}$~\cite{GK95}. We have proven above that $\mathrm{TD}(\mathcal{C}^1_{ac})=n(m-1)\mathcal{U}_1=nm(m-1)$. That means that our method uses no more than on the order of $\log_2(m)+e_{N^*}\log_2(n)$ queries more than an optimal one, which means, asymptotically, it uses at most an extra $e_{N^*}\log_2(n)$ queries when $m=2$. \iffalse Moreover, $\log_2(|\mathcal{C}|)$ is known to be a lower bound on the number of membership queries for a class $\mathcal{C}$. Thus, estimating $\log_2(|\mathcal{C}^1_{ac}|)$ for $m\ge 2$ may result in a better analysis on the optimality of the proposed strategy. \fi For $m=2$, i.e., when CP-nets are binary, it is not hard to extend our result to the case of potentially incomplete CP-nets, at the cost of just doubling the number of queries. Perhaps not coincidentally, the teaching dimension also essentially doubles when switching from complete CP-nets to both complete and incomplete CP-nets, cf.\ Theorems~\ref{thm:TD} and \ref{thm:TDincomplete}. \begin{theorem}\label{thm:treePerfectIncomplete} Let $n\ge 1$, $m=2$. There exists an algorithm that learns every (complete or incomplete) tree CP-net $N^*\in\overline{\mathcal{C}}_{ac}^1$ over $n$ binary variables with at most $4n+2e_{N^*}\log_2(n)$ membership queries over swap examples in $\overline{\mathcal{X}}_{swap}$, where $e_{N^*}$ is the number of edges in $N^*$. \end{theorem} \begin{proof} The desired algorithm is a simple modification of Algorithm 1; whenever Algorithm 1 asks a query for a swap $x=(x.1,x.2)$, the new algorithm will ask two queries, namely one for $x=(x.1,x.2)$ and one for $x'=(x.2,x.1)$ (since it is no longer guaranteed that $c(x')=1$ whenever $c(x)=0$.) Other than that, the algorithm proceeds the same way as Algorithm 1. If both queries $x$ and $x'$ are answered with 0, then the target CP-net does not specify a preference between $x.1$ and $x.2$. Determining orders over test sets then works with at most twice the number of queries as before, even if those orders are empty. Conflict pairs still imply the existence of a parent, and still every variable has at most one parent, which can still be found with binary search. The claim then follows from Theorem~\ref{thm:treePerfect}. \end{proof} Let us compare the algorithm provided by Koriche and Zanuttini~\cite{Koriche2010685} to ours. While our algorithm does not require equivalence queries, uses the same number of queries in total when learning both complete and incomplete CP-nets, and is described for not necessarily binary CP-nets, Koriche and Zanuttini's has two desirable properties that our method does not have: \begin{itemize} \item It learns CP-nets with nodes of arbitrary bounded indegree $k$, not just for $k=1$. \item It is attribute-efficient, i.e., the number of queries it poses is polynomial in the size of the target CP-net, but only logarithmic in the number $n$ of variables. \end{itemize} The attribute-efficiency of their algorithm is possible only because equivalence queries are allowed. In particular, consider the incomplete CP-net without edges in which every $\mathrm{CPT}$ is empty. This CP-net has size 0, but to learn it only with membership queries over swap examples requires to ask queries regarding every one of its $n$ $\mathrm{CPT}$s. As for allowing arbitrary values of $k$, we will refine Algorithm 1 and present a new procedure in Section~\ref{sec:boundedPerfect}, which will efficiently learn any $k$-bounded acyclic CP-net when $m=2$, i.e., in the binary case. \subsection{Re-assessment of Koriche and Zanuttini's algorithm} To evaluate their algorithm, Koriche and Zanuttini compare its query consumption to the value $\log_2(4/3)\mathrm{VCD}(\mathcal{C})$, which is a lower bound on the required number of membership and equivalence queries, known from fundamental learning-theoretic studies~\cite{AuerL99}. In lieu of an exact value for $\mathrm{VCD}(\mathcal{C})$, Koriche and Zanuttini plug in a lower bound on $\mathrm{VCD}(\mathcal{C})$, cf.\ their Theorem~6. We show in Appendix\ref{sec:app} that this lower bound is not quite correct; consequently, here we re-assess the query consumption of Koriche and Zanuttini's algorithm. For any $k$, their algorithm uses at most $s_{N^*}+e_{N^*}\log_2(n)+e_{N^*}+1$ queries in total, for a target CP-net $N^*$ with $s_{N^*}$ statements and $e_{N^*}$ edges. In the worst case $s_{N^*}=\mathcal{M}_k\leq \mathrm{VCD}(\mathcal{C})$ and $e_{N^*}=\binom{k}{2}+(n-k)k$ (i.e., $N^*$ is maximal w.r.t.\ $\mathcal{C}$). This yields $\mathcal{M}_k+e_{N^*}(\log_2(n)+1)$ queries for their algorithm, which exceeds the lower bound $\log_2(4/3)\mathrm{VCD}(\mathcal{C})$ by at most $\log_2(3/2)\mathrm{VCD}(\mathcal{C})+e_{N^*}\log_2(n)$. This is a more refined assessment compared to the term $e_{N^*}\log_2(n)$ that they report, and it holds for \emph{any}\/ value of $k$. \subsection{Bounded Binary Acyclic CP-nets}\label{sec:boundedPerfect} So far, our arguments for bounded acyclic CP-nets in general have been information-theoretic with no investigation of their query complexity. In this section, we show that the teaching dimension results for $\mathcal{C}_{ac}^k$ (cf.\ Theorem \ref{thm:TD}) immediately yield a general strategy for learning complete acyclic CP-nets from membership queries alone, when $m=2$. Recall that, in the binary case, $n\mathcal{U}_k\le \mathrm{TD}(\mathcal{C}_{ac}^k)\le e_{max}+n\mathcal{U}_k$, where $\mathcal{U}_k$ is the size of an $(n-1,k)$-universal set $U$ of minimum size. For $k\geq 2$, the quantity $\mathcal{U}_k$ is known to be $\Omega(2^k \log_2(n-1))$ and $O(k2^k \log_2(n-1))$ \cite{DBLP:journals/tit/SeroussiB88}. Thus, using $e_{max}\le nk$, we obtain \[ \Omega(n2^k \log_2(n-1))\ni \mathrm{TD}(\mathcal{C}_{ac}^k)\in O(nk2^k \log_2(n-1))\,. \] Our proposed method for learning $\mathcal{C}_{ac}^k$ from membership queries reuses the idea of universal sets in teaching sets. For each variable $v_i$, one selects a swap expression $\mathcal{F}$ of the context set $U_{v_i}$ imposed by $U$. Then, for every variable $v_i$, one queries the elements of such set $\mathcal{F}$. The rest of the method we propose is an adaptation of Algorithm 1. For simplicity, in the description of the algorithm, we assume all variables have the same domain $\{0,1\}$. \medskip \noindent\textbf{Algorithm 2.} For every variable $v_i$, determine $Pa(v_i)$ and $\mathrm{CPT}(v_i)$ as follows: \begin{enumerate} \item Ask membership queries for all the elements of $\mathcal{F}$. \emph{This step amounts to $\mathcal{U}_k$ membership queries.} \item Initialize $P=\emptyset$; the set $P$ will always contain all the parents of $v_i$ found so far. If $|P|=k$, $Pa(v_i)$ must equal $P$, since no variable has more than $k$ parents. In this case, go to Step 7, else go to Step 3. \item If all of the queried instances for $\mathcal{F}$ show the same preference over the values of $v_i$, then $v_i$ has no further parents, i.e., $Pa(v_i)=P$. (This is because there are at most $k$ parents for $v_i$ and the same statement appears in every context of all potential parent sets of size $k$, cf.\ Lemma~\ref{lem:TDuniversal}.) In this case, go to Step 7. Otherwise, there exist two contexts $\gamma,\gamma'\in\mathcal{O}_{V\setminus (P\cup \{v_i\})}$ for which $\gamma:v^i_1\succ v^i_2$ and $\gamma':v^i_2\succ v^i_1$ are answers obtained from the queries in Step 1. Clearly, $Pa(v_i)$ contains an element of $V\setminus (P\cup \{v_i\})$. \item Apply Damaschke's binary search procedure \cite{adaptiveLearning} to determine one new variable $v\in Pa(v_i)$, by analogy to the procedure used in Algorithm 1. Add $v$ to the set $P$. \emph{This step amounts to at most $\log_2(n-1)$ membership queries.} \item Partition $\mathcal{F}$ into two sets $\mathcal{F}_{v=0}$ and $\mathcal{F}_{v=1}$. Here $\mathcal{F}_{v=z}$ is the set of all swaps in $\mathcal{F}$ in which the value of $v$ is $z$. Note that these swaps have all been queried in Step 1 already. \item If all of the queried instances for $\mathcal{F}_{v=0}$ show a single preference over the values of $v_i$, and likewise all of the queried instances for $\mathcal{F}_{v=1}$ show a single preference over the values of $v_i$, then $Pa(v_i)=P$; go to Step 7. Otherwise, recursively add parents to $P$ by calling Step 3 once with $\mathcal{F}_{v=0}$ in place of $\mathcal{F}$ and once with $\mathcal{F}_{v=1}$ in place of $\mathcal{F}$, both times excluding the elements of $P$ from the binary search in Step 4. \item From the queries posed above, $\mathrm{CPT}(v_i)$ is fully determined. \end{enumerate} \begin{example} To illustrate Algorithm 2, consider the case $n=4$, $m=2$, and $k=2$, and suppose the CP-net from Figure~\ref{fig:alg2} is the target CP-net. Note that a smallest $(3,2)$-universal set has exactly four elements, which will be the cardinality of each set $\mathcal{F}$ considered for each variable. Algorithm 2 will consider each variable in turn. For variable $A$, it will first ask four queries, one for each swap pair in, say, the following set \[ \mathcal{F}=\{(abcd,\bar{a}bcd),(a\bar{b}c\bar{d},\bar{a}\bar{b}c\bar{d}),(ab\bar{c}\bar{d},\bar{a}b\bar{c}\bar{d}),(a\bar{b}\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] (Here the $(3,2)$-universal set realizing all possible 2-dimensional context sub-vectors within 3-dimensional context vectors would be $\{bcd, \bar{b}c\bar{d}, b\bar{c}\bar{d}, \bar{b}\bar{c}d\}$.) The responses show that $a\gamma\succ\bar{a}\gamma$ for all $\gamma\in\mathcal{O}_{V\setminus\{A\}}$. The algorithm hence detects that $A$ has no parents and that $a\succ\bar{a}$ is the only statement in $\mathrm{CPT}(A)$. For variable $B$, the same procedure applied to \[ \mathcal{F}=\{(abcd,a\bar{b}cd),(\bar{a}bc\bar{d},\bar{a}\bar{b}c\bar{d}),(ab\bar{c}\bar{d},a\bar{b}\bar{c}\bar{d}),(\bar{a}b\bar{c}d,\bar{a}\bar{b}\bar{c}d)\} \] reveals that $abcd\succ a\bar{b}cd$, $\bar{a}\bar{b}c\bar{d}\succ\bar{a}bc\bar{d}$, $ab\bar{c}\bar{d}\succ a\bar{b}\bar{c}\bar{d}$, $\bar{a}\bar{b}\bar{c}d\succ \bar{a}b\bar{c}d$. Two contexts $\gamma$ and $\gamma'$ for which the preference over $D_B$ differs are, for example, $\gamma=acd$, $\gamma'=\bar{a}c\bar{d}$. Hence $B$ must have at least one parent among $A,C,D$, and applying Damaschke's binary search to the context $\gamma$ yields that the preference given $acd$ differs from the preference given $\bar{a}cd$. So $A$ must be a parent of $B$. Partitioning $\mathcal{F}$ yields \[ \mathcal{F}_{A=a}=\{(abcd,a\bar{b}cd),(ab\bar{c}\bar{d},a\bar{b}\bar{c}\bar{d})\}\mbox{ and }\mathcal{F}_{A=\bar{a}}=\{ (\bar{a}bc\bar{d},\bar{a}\bar{b}c\bar{d}),(\bar{a}b\bar{c}d,\bar{a}\bar{b}\bar{c}d)\}\,. \] Each set displays a single preference order over $D_B$ in the queries originally asked, so that $B$ has no further parents. The algorithm has determined that $Pa(B)=\{A\}$ and that $\mathrm{CPT}(B)$ contains the two statements $a:b\succ\bar{b}$ and $\bar{a}:\bar{b}\succ b$. For variable $C$, queries for pairs in the set \[ \mathcal{F}=\{(abcd,ab\bar{c}d),(\bar{a}bc\bar{d},\bar{a}b\bar{c}\bar{d}),(a\bar{b}c\bar{d},a\bar{b}\bar{c}\bar{d}),(\bar{a}\bar{b}cd,\bar{a}\bar{b}\bar{c}d)\} \] reveal that $abcd\succ ab\bar{c}d$, $\bar{a}bc\bar{d}\succ\bar{a}b\bar{c}\bar{d}$, and $a\bar{b}c\bar{d}\succ a\bar{b}\bar{c}\bar{d}$, while $\bar{a}\bar{b}\bar{c}d\succ\bar{a}\bar{b}cd$. In the same way as illustrated above for variable $B$, the algorithm finds a first parent of $C$, say $A$. This time, partitioning $\mathcal{F}$ into two sets $\mathcal{F}_{A=a}$ and $\mathcal{F}_{A=\bar{a}}$ will show that $C$ must have another parent, since the two contexts $\bar{a}b\bar{d}$ and $\bar{a}\bar{b}d$ in $\mathcal{F}_{A=\bar{a}}$ give rise to two different preference orders over $D_C$. Another binary search is started, so that the parent $B$ is found. Since $k=2$, the variable $C$ has no further parents. Consequently, the algorithm correctly infers that $Pa(C)=\{A,B\}$ and that $\mathrm{CPT}(C)$ contains four statements showing that $\bar{c}\succ c$ under any context containing $\bar{a}\bar{b}$, while $c\succ\bar{c}$ under the other contexts possible for $C$. Finally, for variable $D$, Algorithm 2 would, similarly to the case of variable $A$, use four queries to learn that $D$ has no parents and that $d$ is unconditionally preferred over $\bar{d}$ in the target CP-net. \end{example} \begin{theorem}\label{thm:boundedPerfect} Let $n\ge 1$, $m=2$, $0\le k\le n-1$. Algorithm 2 learns every complete binary $k$-bounded CP-net $N^*\in\mathcal{C}_{ac}^k$ over $n$ variables with \[ O(n\mathcal{U}_k+e_{N^*}\log_2(n)) \] membership queries over swap examples in $\mathcal{X}_{swap}$, where $e_{N^*}$ is the number of edges in $N^*$. \end{theorem} \begin{proof} The number of queries made by Algorithm 2 can be upper-bounded as follows. The only steps in which queries are made are Steps 1 and 3. Step 1 is run once for each of the $n$ variables, each time costing $\mathcal{U}_k$ queries, for a total of $n\mathcal{U}_k$ queries. Step 3 is run once for each edge in the target CP-net, each time costing at most $\log_2(n)$ queries, for a total of $O(e_{N^*}\log_2(n))$ queries. In the sum, the query consumption of Algorithm 2 is in $O(n\mathcal{U}_k+e_{N^*}\log_2(n))$. We will next prove the correctness of Algorithm 2. Note that the set $\mathcal{F}$ in Step 1 of the algorithm is a swap expression of a context set imposed by a $(2,n-1,k)$-universal set. By Lemma~\ref{lem:TDuniversal}, Algorithm 2 decides correctly in Step 2 whether or not $v_i$ has a parent. The same lemma can be applied to any part of the set $\mathcal{F}$ as defined in Step 5. Hence, Algorithm 2 correctly determines the parent set of each variable. Since $\mathcal{F}$ is a swap expression of a context set imposed by a $(2,n-1,k)$-universal set, and the domain is of size 2, the responses to queries in $\mathcal{F}$ determine a preference order for each of the relevant contexts. Consequently, Algorithm 2 is able to infer all $\mathrm{CPT}$ statements from those responses. \end{proof} Thus, one can identify any concept $c\in \mathcal{C}_{ac}^k$ with $n\mathcal{U}_k+e_c\log_2(n)$ membership queries, where $\mathcal{U}_k\in O(nk2^k\log_2(n-1))$. A universal set of such size was proven to exist by a probabilistic argument with no explicit construction of the set \cite{Jukna:2010:ECA:1965203}. However, a construction of an $(n-1,k)$-universal set of size $2^k \log_2(n-1) k^{O(\log_2 (k))}$ is reported in the literature \cite{DBLP:journals/tit/SeroussiB88}. Therefore, one can effectively learn any concept in $\mathcal{C}_{ac}^k$ with a number of queries bounded by $n2^k \log_2(n-1) k^{O(\log_2 (k))}+e\log_2(n)$, which is at most a factor of $k^{O(\log_2 k)}$ away from the teaching dimension, and thus at most a factor of $k^{O(\log_2 k)}$ away from optimal. Moreover, when $k2^k<\sqrt{n}$, there is an explicit construction of a $(n,k)$-universal set of size $n$~\cite{Jukna:2010:ECA:1965203}, e.g., for $n=800$ this construction is guaranteed to work with an indegree up to $3$ and for $n=1500$ with an indegree up to $4$. This can be utilized if one is interested in learning sparse CP-nets over a large number of variables. Finally, a simple adaptation of Algorithm 2 allows for efficient learning of all $k$-bounded acyclic CP-nets, whether complete or incomplete. As in the proof of Theorem~\ref{thm:treePerfectIncomplete}, this comes at a cost of a factor of 2 in the number of queries. \begin{theorem}\label{thm:boundedPerfectIncomplete} Let $n\ge 1$, $m=2$, $0\le k\le n-1$. There exists an algorithm that learns every (complete or incomplete) binary $k$-bounded CP-net $N^*\in\overline{\mathcal{C}}_{ac}^k$ over $n$ variables with \[ O(n\mathcal{U}_k+e_{N^*}\log_2(n)) \] membership queries over swap examples in $\overline{\mathcal{X}}_{swap}$, where $e_{N^*}$ is the number of edges in $N^*$. \end{theorem} \begin{proof} The desired algorithm simulates Algorithm 2; whenever Algorithm 2 asks a query for a swap $x=(x.1,x.2)$, the new algorithm will ask two queries, namely one for $x=(x.1,x.2)$ and one for $x'=(x.2,x.1)$ (since it is no longer guaranteed that $c(x')=1$ whenever $c(x)=0$.) Other than that, the algorithm proceeds the same way as Algorithm 2. If both queries $x$ and $x'$ are answered with 0, then the target CP-net does not specify a preference between $x.1$ and $x.2$. The rest of the proof is identical to that of Theorem~\ref{thm:boundedPerfect}. \end{proof} \iffalse \begin{table} \centering \caption{Summary over different $\mathrm{TD}$ values and query complexities for learning binary CP-nets with membership queries alone. } \begin{tabular}{| l || c | c |} \hline class & $\mathrm{TD}$ & {\footnotesize Query Complexity} \\ \hline $\mathcal{C}_{ac}^0$ & $n$ & $n$ \\ \hline $\mathcal{C}_{ac}^1$ & $2n$ & $2n+e \log_2(n)$\\ \hline $\mathcal{C}_{ac}^k$ & $O(nk2^k\log_2(n-1))$ & $O(nk2^k \log_2(n-1))$ \\ \hline \end{tabular} \label{tble:MQresults} \end{table} \fi \iffalse \begin{algorithm} \footnotesize \caption{\textsc{LearnMQ}$_{ac}$} \label{alg:acMQ} \begin{algorithmic}[1] \Require a set of binary variables $V=\{v_1,v_2,\dots,v_n\}$ where $D_v=\{0,1\}$ for every $v\in V$, an upper bound on the number of parents $k$, an $(n-1,k)-$universal set of minimum size $\mathcal{F}$ \Ensure A hypothesis $N$ equivalent to the hidden target in $\mathcal{C}_{ac}^k$ \State $N\gets \emptyset$ \For{\textbf{each} variable $v_i$} \State $\mathcal{Q}_i\gets \emptyset$ \State $\mathrm{CPT}(v_i)\gets \emptyset$ \For{\textbf{each} $\gamma\in \mathcal{F}$} \State consider the instance $q\in \mathcal{X}_{swap}$ where $q[V\backslash v_i]=\gamma \State let $\overrightarrow{q}$ to be the entailment of $q$, i.e., either $q.1\succ q.2$ or $q.2\succ q.1$ \State $\overrightarrow{q}\gets \textbf{MQ}(q)$ \State $\mathcal{Q}_i\gets \mathcal{Q}_i \cup \overrightarrow{q}$ \EndFor \If{ $\mathcal{Q}_i$ shows only one statement $\overrightarrow{q}$} \State $Pa(v_i)\gets \emptyset$ \State $\mathrm{CPT}(v_i)\gets \overrightarrow{q}$ \Else \State $P\gets \{v\in V\backslash v_i \mid\exists$ a conflict pair $(x,x')$ in $\mathcal{Q}_i$ where $v$ is the only non-swapped variable with different values$\}$ \State $Pa(v_i)\gets P$ \For{\textbf{each} $u\in \mathcal{O}_{Pa(v_i)}$} \State $\mathrm{CPT}(v_i)\gets \mathrm{CPT}(v_i)\cup \{u:\overrightarrow{q}\}$ for any $\overrightarrow{q}\in \mathcal{Q}_i$ where $q[Pa(v_i)]=u$ \EndFor \EndIf \State $N\gets N\cup \mathrm{CPT}(v_i)$ \EndFor \State \Return $N$ \end{algorithmic} \end{algorithm} \fi \iffalse \subsection{Non-adaptive Queries} An important distinction studied in learning with membership queries is whether a class of concepts is learnable in an adaptive or a non-adaptive way \cite{adaptiveLearning}. A class $\mathcal{C}$ is non-adaptively learnable by membership queries if there is an algorithm that exactly identifies any concept in $\mathcal{C}$ using a polynomial number of queries that are fixed in advance. That is, all queries are specified before receiving any answer from the oracle; no query depends on answers to other queries, so that parallel execution of the learning algorithm is possible. It is also reasonable to study learning in rounds such that, in round $r$, the learner chooses a set of queries that may depend only on the answers given to the queries in the previous rounds \cite{adaptiveLearning}. The tree CP-net strategy discussed above is an adaptive one as the queries during the binary search process depend on the previous answers. Otherwise, all the queries are actually \quotes{test set} queries that are fixed in advance. Therefore, it is easy to see that we can learn binary tree CP-nets non-adaptively with the same query complexity $2n+e_{N^*}\log_2(n)$ by at most $\log_2(n)$ rounds. In particular, in the first round we query the test set for every variable at the expense of $2n$ queries. Assume after the first round, we have $d<n$ variables that have conflict pairs. In the subsequent rounds, we find the only parent non-adaptively and after $\log_2(n)$ rounds at most we know the preference table for every variable. For the binary acyclic case, the in-advance constructed universal set can directly be applied to learning the concepts non-adaptively with the same query complexity as when learning adaptively. \begin{corollary} In the binary case, the non-adaptive query complexity of $\mathcal{C}_{ac}^k$ is $n2^k \log_2(n-1) k^{O(\log_2 k)}$ and the non-adaptive query complexity of $\mathcal{C}_{ac}^1$, using $\log_2(n)$ rounds, is $2n+e\log_2(n)$. In both cases, this equals the adaptive query complexity. \end{corollary} \fi \section{Learning from Corrupted Membership Queries} \label{sec:corrupted} So far, we have assumed that all membership queries are answered correctly. This assumption is unrealistic in many settings, especially when it comes to dealing with human experts that may have incomplete knowledge of the target function. For instance, when eliciting CP-nets from users, it could be the case that the user actually does not know which of two given outcomes is to be preferred or does not want to respond to a query. When recommender systems explicitly request information from users, be it in the form of item ratings or in the form of preference queries, not all queries will be answered and some will be answered incorrectly. In this section, we consider two models of learning from membership queries in which the oracle does not always provide a correct answer. In particular, we consider the situation in which there is a fixed set $L$ of instances $x$ for which the oracle does not provide the true classification $c^*(x)$. The set $L$ is assumed to be chosen in advance by an adversary. There are two ways in which the oracle could deal with queries to elements in $L$: \begin{itemize} \item A \emph{limited oracle}\/ returns \quotes{I don't know} (denoted by $\perp$) when queried for any $x\in L$, and returns the true label $c^*(x)$ for any $x\not\in L$ \cite{Angluin1997,DBLP:journals/jcss/BishtBK08}. \item A \emph{malicious oracle}\/ returns the wrong label $1-c^*(x)$ when queried for any $x\in L$, and returns the true label $c^*(x)$ for any $x\not\in L$ \cite{Angluin1997,DBLP:journals/tcs/BennetB07}. \end{itemize} In either case, the oracle is persistent in the sense that it will return the same answer every time the same instance is queried. A concept class $\mathcal{C}$ is learnable with membership queries to a limited (malicious, resp.)\ oracle if there is an algorithm that exactly identifies any target concept $c^*\in\mathcal{C}$ by asking a limited (malicious, resp.)\ oracle a number of membership queries that is polynomial in $n$, the size of $c^*$, and $|L|$ \cite{Angluin1997,DBLP:journals/jcss/BishtBK08}\footnote{This corresponds to the strict learning model discussed in \cite{Angluin1997,DBLP:journals/jcss/BishtBK08}.}. Consider for instance the application scenario of a recommender system that explicitly asks users for preferences over pairs of items. The limited oracle then corresponds to a user who chooses to ignore some queries or who does not know which of the two presented items to prefer (perhaps since the user doesn't know the items well enough to express a preference.) The malicious oracle is a simplified model of a user who misunderstands some queries and answers them incorrectly, or who gets annoyed with queries and answers some of them on purpose incorrectly. At first, the assumption that the oracle is persistent may seem unrealistic. However, in practice, this assumption translates into never asking the same query twice, since the system cannot possibly gain information from repeating queries to a persistent user. Repeating queries to the user is often undesirable, as it bears a high risk of annoying the user. For practical applications, one might prefer models of probabilistic noise and learning algorithms that infer approximations to the true target based on randomness in the noise. Instead, we pursue the idealized goal of exactly identifying the target concept in the face of partial or incorrect information, which is useful for studying strict limitations of learning. It is obvious that exact learning is not possible unless some restrictions are made on the set $L$. Note though that we assume that the learner has no prior information on the size or content of $L$. Instead, we will study under which conditions on $L$ learning complete acyclic CP-nets from limited or malicious oracles is possible even if the learner has no information on these conditions. We will restrict our analysis to the case of binary CP-nets. Further, we will make use of the trivial observation that exact learnability with membership queries to a malicious oracle implies exact learnability with membership queries to a limited oracle. \subsection{Limitations on the Corrupted Set} We first establish that learning the class $\mathcal{C}_{ac}^k$ of all complete acyclic binary $k$-bounded CP-nets over $n$ variables is impossible, both from malicious and from limited oracles, when $|L|\ge 2^{n-1-k}$. \begin{proposition} Let $m=2$ and $1\le k\le n-1$. If $|L|\geq 2^{n-1-k}$, then the class $\mathcal{C}_{ac}^k$ is not learnable with membership queries to a limited oracle and not learnable with membership queries to a malicious oracle. \end{proposition} \begin{proof} It suffices to prove non-learnability from limited oracles. Consider a CP-net $N$ in which all the variables are unconditional, except for one variable $v_i$, which has exactly $k$ parents. Furthermore, let $\mathrm{CPT}(v_i)$ impose the same order on the domain of $v_i$ for all contexts over $Pa(v_i)$, except for one context $\gamma$ over $Pa(v_i)$ for which $\mathrm{CPT}(v_i)$ imposes the reverse order over the domain of $v_i$. Figure \ref{fig:corruptionLimitExample} shows an example of such a CP-net. Consider the set $X=\{x=(x_1,x_2)\in \mathcal{X}_{swap}\mid V(x)=v_i$ and $x_1[Pa(v_i)]=x_2[Pa(v_i)]=\gamma\}$. Each swap instance $x$ in $X$ has the same values in the $k$ parent variables of $v_i$, and there are no choices for its values in the binary swap variable $v_i$ either. For each of the remaining $n-1-k$ variables, there are $m=2$ choices. Hence, the cardinality of $X$ is $2^{n-1-k}$. Since $|L|\geq 2^{n-1-k}$, the adversary can choose $L$ so that $X\subseteq L$. Then, in communication with a limited membership oracle, the learner will not be able to distinguish $N$ from the CP-net $N'$ that is equivalent to $N$ except for having the orders over the domain of $v_i$ swapped in $\mathrm{CPT}(v_i)$. \end{proof} In essence, this negative result is due to the fact that the number of instances supporting a statement in a CPT with $k$ parents is $2^{n-1-k}$---having all these corrupted makes learning hopeless. In particular, when $k=n-1$, i.e., for unbounded CP-nets, even a single corrupted query will make learning impossible. This is because a $\mathrm{CPT}$ of a variable with $n-1$ parents may have statements that are witnessed by only a single context, and thus by only a single swap pair $x$. The adversary can choose $L=\{x\}$ and not respond to the query $x$, so that the learner cannot figure out the correct preference for the swap pair $x$. In the remainder of this section, we will study assumptions on the structure of $L$ that will allow a learning algorithm to overcome the corrupted answers from limited or malicious oracles at the expense of a bounded number of additional queries. That means, we will constrain the adversary in its options for selecting $L$, without directly limiting the size of $L$. Roughly speaking, we no longer look at the worst possible choice of the set $L$, but at a case where the corrupted responses are ``reasonably spread out.'' The goal is to be able to obtain the correct answer for any query $x$ made by our algorithms that learn from perfect oracles, simply by taking majority votes over a bounded number of additional ``verification queries.'' If we know that the corrupted oracle will affect only a small subset of these verification queries (small enough so that the majority vote over them is guaranteed to yield the correct label for $x$,) we can use the same learning procedures as in the perfect oracle case, supplemented by a bounded number of verification queries. \begin{figure} \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=1.5cm and .4cm,semithick,scale=1] \node[state] (a) {}; \node[right= of a] (dots) {$\dots\dots\dots$}; \node[state,right= of dots](end) {}; \node[state,fill=black!20,below=of dots](vi){$v_i$}; \node[right =of vi](viCPT){\makecell[l] { $\gamma:v^i_1\succ v^i_2$\\ otherwise$: v^i_2\succ v^i_1$ } }; \path (a) edge[dashed] (vi) (dots) edge[dashed] (vi) (end) edge[dashed] (vi); \end{tikzpicture} \caption{A CP-net $N\in \mathcal{C}_{ac}^k$ that, for $|L|\ge2^{n-1-k}$, cannot be distinguished from any CP-net $N'$ that differs from $N$ only in $\mathrm{CPT}(v_i)$.} \label{fig:corruptionLimitExample} \end{figure} Suppose that, for each $x\in\mathcal{X}_{swap}$, we could effectively compute a small set $\mathrm{VQ}(x)\subseteq\mathcal{X}_{swap}$ such that the limited/malicious oracle would be guaranteed to return the correct label for $x$ on more than half of the queries for elements in $\mathrm{VQ}(x)$. In the case of membership queries to a limited oracle, we could then simulate Algorithms 1 or 2 with the following modification: \begin{itemize} \item[LIM] If a query for $x\in\mathcal{X}_{swap}$ made by Algorithm 1 (or 2) is answered with $\perp$, replace this response by the majority vote of the limited oracle's responses to all queries over the set $\mathrm{VQ}(x)$. \end{itemize} In the case of learning from malicious oracles, \emph{every}\/ query made by Algorithms 1 or 2 would have to be supplemented by verification queries: \begin{itemize} \item[MAL] If a query for $x\in\mathcal{X}_{swap}$ is made by Algorithm 1 (or 2), respond to that query by taking the majority vote over the malicious oracle's responses to all queries over the set $\mathrm{VQ}(x)$. \end{itemize} If $q$ is an upper bound on the size of the set $\mathrm{VQ}(x)$, for any $x\in\mathcal{X}_{swap}$, the modified algorithms then would need to ask at most $qz$ membership queries, where $z$ is the number of queries asked by Algorithms 1 or 2. It remains to find a suitable set $\mathrm{VQ}(x)$ of verification queries for any swap pair $x$, so that, intuitively, \begin{itemize} \item the size of $\mathrm{VQ}(x)$ is not too large, and \item it is not too unreasonable an assumption that the corrupted oracle will return the true label for $x$ on the majority of the swap pairs in $\mathrm{VQ}(x)$. \end{itemize} To this end, we introduce some notation. \begin{definition} Let $x=(x_1,x_2)\in\mathcal{X}_{swap}$ and $1\le t\le n-1$. Then we denote by $F^t(x)$ the set of all swap instances $x'=(x'_1,x'_2)$ with the swapped variable $V(x')=V(x)$ and with a Hamming distance\footnote{The Hamming distance \cite{Hamming50} between two vectors is the number of components in which they disagree.} of exactly $t$ between $x_i$ and $x'_i$ when restricted to $V\setminus\{V(x)\}$, i.e. \[ F^t(x)=\{x'\in \mathcal{X}_{swap}\mid V(x)=V(x')=v_s\mbox{ and }|\{v\in V\setminus\{v_s\}\mid x[\{v\}]\ne x'[\{v\}]\}|= t\}\,. \] \end{definition} For example, if $x=(abcd,a\bar{b}cd)$ where $D_{v_1}=\{a,\bar{a}\}$, $D_{v_2}=\{b,\bar{b}\}$, $D_{v_3}=\{c,\bar{c}\}$, $D_{v_4}=\{d,\bar{d}\}$, then for $t=1$ we get \[ F^1(x)=\{(\bar{a}bcd,\bar{a}\bar{b}cd),(ab\bar{c}d,a\bar{b}\bar{c}d),(abc\bar{d},a\bar{b}c\bar{d})\}\,. \] Each swap in that set has the same swapped variable as $x$ (namely $v_2$) and has a context that differs from that in $x$ in exactly one variable. There is a relationship between the entailment of an instance $x$ and the entailments of the elements of $F^t(x)$ for any $t$: Given a preference table $\mathrm{CPT}(v_i)$, where $v_i$ has $k$ parents, and given $t$, it is not hard to see that \begin{itemize} \item $|F^t(x)|=\binom{n-1}{t}$, and \item the set $F^t(x)$ contains $\binom{n-1-k}{t}$ elements with the same entailment w.r.t.\ $V(x)$ as in $x$ itself. These are the instances that share the same values in the parent variables of $V(x)$ and, hence, their entailments have to be identical. \end{itemize} If most of the elements in $F^t(x)$ share the same entailment, they could be used to compensate the oracle corruption. However, queries to elements of $F^t(x)$ again might receive corrupted answers. We will therefore impose a restriction on the overlap between the set $L$ of instances with corrupted responses and any set $F^t(x)$, specifically for $t=1$. We would like to constrain $L$ so that querying the elements of $F^1(x)$, and then picking the most frequent answer, yields the true classification of instance $x$. Figure \ref{fig:f1example} shows an example of an instance $x$ with $V(x)=v_5$, its entailment and the entailments of the elements of $F^1(x)$ assuming $k=1$ and $Pa(v_5)=\{v_1\}$. \begin{figure} \centering \begin{adjustbox}{max width=\textwidth} \begin{tikzpicture}[thick,dotted, node distance=.5cm] \node(query){$abcde\succ abcd\bar{e}$}; \node[below left=of query](cflipped){$ab\bar{c}de\succ ab\bar{c}d\bar{e}$}; \node[left=of cflipped](dflipped){$abc\bar{d}e\succ abc\bar{d}\bar{e}$}; \node[below right=of query](bflipped){$a\bar{b}cde\succ a\bar{b}cd\bar{e}$}; \node[font=\boldmath,right=of bflipped](aflipped){$\bar{a}bcd\bar{e}\succ \bar{a}bcde$}; \path (query) edge[->](dflipped) edge[->] (cflipped) edge[->](bflipped) edge[->](aflipped); \end{tikzpicture} \end{adjustbox} \caption{An example of the entailments of an instance $x$ and $F^1(x)$ for $x=(abcde,abcd\bar{e})$ with $Pa(v_5)=\{v_1\}$ and $\mathrm{CPT}(v_5)$ is $\{a:e\succ \bar{e},\bar{a}:\bar{e}\succ e\}$.} \label{fig:f1example} \end{figure} \iffalse The motivation of imposing a restriction over $F^1(x)\cap L$, for any queried instance $x$, is twofold: i) if we see the set of queried instances to the perfect oracle as the \emph{decision boundary} that defines our target concept, which is the case, it has been shown that oracles can perform poorly in classifying examples nearby the boundary and may return many corrupted answers \cite{Angluin1997}; ii) in terms of CP-nets, the end user could be less familiar with one value $v^j_u$ of a variable $v_j$ than another $v^j_{u'}$ for $V(x)\neq v_j$. Thus, given a less familiar value $x[v_j]=v^j_u$, she could hesitate over her preference and return \quotes{I don't know} while if we asked her the same instance but with the more familiar value of $v_j$, i.e., $v^j_{u'}$, we could get an answer. For instance, consider learning the dinner preference of a novice user where one of the variables is the sushi type. The user has tried california rolls before and liked it but has no knowledge over the different types of Sushi. If a query is made with \textit{Chirashi-Zushi} the user could return \quotes{I don't know} unlike if the user was queried with \textit{California-Rolls}. \fi We then obtain the following learnability result for the case that the indegree $k$ is bounded to be sufficiently small. \begin{theorem}\label{thm:corrupted} Suppose $n>2k+2$. For each swap pair $x\in\mathcal{X}_{swap}$, let the set $\mathrm{VQ}(x)$ of verification queries used by the LIM and MAL strategies be equal to $F^1(x)$. \begin{enumerate} \item If $|F^1(x) \cap L|\leq n-2-2k$ for every $x\in\mathcal{X}_{swap}$, then the strategy LIM will learn any complete acyclic $k$-bounded binary CP-net over $n$ variables, when interacting with a limited oracle. \item If $|F^1(x)\cap L|\le \lfloor \frac{n-1}{2}\rfloor -k-1$ for every $x\in\mathcal{X}_{swap}$, learn any complete acyclic $k$-bounded binary CP-net over $n$ variables, when interacting with a malicious oracle. \end{enumerate} \end{theorem} \begin{proof} Note that there are $n-1$ elements in $F^1(x)$, of which at least $n-1-k$ have the same label in the target concept as $x$ and at most $k$ have the opposite label. First, suppose $|F^1(x) \cap L|\leq n-2-2k$ for every $x\in\mathcal{X}_{swap}$, in the case of a limited oracle. Then, for every $x\in\mathcal{X}_{swap}$, the limited oracle will respond with a label to at least $|F^1(x)|-n+2+2k=2k+1$ of the queries for elements in $F^1(x)$. Since at most $k$ of these elements have the opposite label as $x$, the majority of these queries will return the label for $x$. Therefore, the strategy LIM will simulate Algorithm~2 with a perfect membership oracle and thus learn any complete acyclic $k$-bounded binary CP-net over $n$ variables. Second, suppose $|F^1(x)\cap L|\le \lfloor \frac{n-1}{2}\rfloor$ for every $x\in\mathcal{X}_{swap}$, in the case of a malicious oracle. Then, for every $x\in\mathcal{X}_{swap}$, the limited oracle will correctly respond to at least $|F^1(x)|-\lfloor \frac{n-1}{2}\rfloor+k+1= \lceil\frac{n-1}{2}\rceil +k+1$ of the queries for elements in $F^1(x)$. In the worst case, these $\lceil\frac{n-1}{2}\rceil +k+1$ correctly answered queries contain all of the $k$ elements of $F^1(x)$ that have the opposite label of $x$. That means that at least $\lceil\frac{n-1}{2}\rceil +1$ of the $n-1$ queries over $F^1(x)$ (and thus a majority) return the correct label for $x$. Therefore, the strategy MAL will simulate Algorithm~2 with a perfect membership oracle and thus learn any complete acyclic $k$-bounded binary CP-net over $n$ variables. \end{proof} We obtain the following corollary. \begin{corollary} Suppose $n>2k+2$. \begin{enumerate} \item If $|F^1(x) \cap L|\leq n-2-2k$ for every $x\in\mathcal{X}_{swap}$, then the class of all complete acyclic $k$-bounded binary CP-nets over $n$ variables is learnable with membership queries to a limited oracle. \item If $|F^1(x)\cap L|\le \lfloor \frac{n-1}{2}\rfloor -k-1$ for every $x\in\mathcal{X}_{swap}$, then the class of all complete acyclic $k$-bounded binary CP-nets over $n$ variables is learnable with membership queries to a malicious oracle. \end{enumerate} In either case, the worst-case number of queries can be upper-bounded by $O(n^2\mathcal{U}_k+e_{N^*}\log_2(n))$, which is in $O(n^22^k\log_2(n)k^{O(\log_2(k))}+e_{N^*}n\log_2(n))$. \end{corollary} \begin{proof} Learnability follows from Theorem~\ref{thm:corrupted}. The bound on the number of queries is derived from the bound in Theorem~\ref{thm:boundedPerfect} by multiplying with a factor of $O(n)$ due to the verification query set of size $\binom{n-1}{1}=n-1$. \end{proof} In the special case of learning tree CP-nets, i.e., when $k=1$, we obtain the following improved result. \begin{corollary} Suppose $n>4$. \begin{enumerate} \item If $|F^1(x) \cap L|\leq n-4$ for every $x\in\mathcal{X}_{swap}$, then the class of all complete acyclic binary tree CP-nets over $n$ variables is learnable with membership queries to a limited oracle. \item If $|F^1(x)\cap L|\le \lfloor \frac{n-1}{2}\rfloor -2$ for every $x\in\mathcal{X}_{swap}$, then the class of all complete acyclic binary tree CP-nets over $n$ variables is learnable with membership queries to a malicious oracle. \end{enumerate} In particular, in either case, the worst-case number of queries is in $O(n^2+e_{N^*}n\log_2(n))$, where $e_{N^*}$ is the number of edges in the target CP-net $N^*$. \end{corollary} \begin{proof} Learnability follows from Theorem~\ref{thm:corrupted}. The bound on the number of queries is derived from the bound in Theorem~\ref{thm:treePerfect} by multiplying with a factor of $O(n)$ due to the verification query set of size $\binom{n-1}{1}=n-1$. \end{proof} \iffalse \section{Discussion} \label{sec:discussion} \subsection{The $\mathrm{VCD}$ of Complete and Incomplete CP-nets} Our results on the $\mathrm{VCD}$ have many interesting consequences. First, Second, we can re-assess the optimality of Koriche and Zanuttini's \cite{Koriche2010685} algorithm. Koriche and Zanuttini (2010) provide an algorithm that learns the class $\mathcal{C}^*_{ac}$ of complete and incomplete (binary) acyclic CP-nets with nodes of bounded indegree from equivalence and membership queries. To evaluate their algorithm, they compare its query complexity to $\log_2(4/3)\mathrm{VCD}(\mathcal{C}^*_{ac})$, which lower-bounds the required number of membership and equivalence queries \cite{AuerL99}. They calculate a lower bound on $\mathrm{VCD}(\mathcal{C}^*_{ac})$, in lieu of the exact value, cf.\ their Theorem~6. Let $\mathcal{X}^*_{swap}=\{(o,o') | (o,o')$ is a swap$\}$ be the instance space of $\mathcal{C}^*_{ac}$. Clearly, $\mathcal{X}^*_{swap}\supseteq \mathcal{X}_{swap}$, $\mathcal{C}^*_{ac}\supseteq \mathcal{C}_{ac}^k$ and $\mathrm{VCD}(\mathcal{C}^*_{ac})\geq \mathrm{VCD}(\mathcal{C}_{ac}^k)$. The following Lemma states that it is actually the case that $\mathrm{VCD}(\mathcal{C}^*_{ac})=\mathrm{VCD}(\mathcal{C}_{ac}^k)\geq \mathcal{M}_k$ (for $m=2$). Intuitively, this is due to the fact that the largest shattering capacity is obtained when specifying complete $\mathrm{CPT}$s for all variables, i.e., when using complete CP-nets. \begin{lemma} $\mathrm{VCD}(\mathcal{C}^*_{ac})=\mathrm{VCD}(\mathcal{C}_{ac}^k)$. \label{lem:VCDinc} \end{lemma} We prove the Lemma by showing that the two classes are actually the same, when restricted to swap instances, and thus their $\mathrm{VCD}$ values would be identical. This is a surprising result as one would expect adding incomplete concepts would make the class \emph{richer}, i.e., shatter more instances. Let $x,x'\in \mathcal{X}_{swap}^*$ be any two instances corresponding to the two outcomes $o,o'$ such that $x=(o,o')$ and $x'=(o',o)$. It is obvious that $\mathcal{C}_{ac}^*$ will not shatter any set $S$ that contains $x$ and $x'$. This is due to the fact that there must be two labels for $x$ and $x'$ that give rise to $o\succ o'$ and $o'\succ o$ which will not be consistent with any acyclic (complete or incomplete) concept. This leaves us with a set of swap instances that are identical to the set of $\mathcal{X}_{swap}$ in the complete case where exactly one of $(o,o'),(o',o)$ is included. Let $\mathcal{C}^*_{{ac}_{|\mathcal{X}_{swap}}}$ be the class $\mathcal{C}_{ac}^*$ projected onto $ \mathcal{X}_{swap}$. Let $D_{v_i}=\{v^i_1,v^i_2\}$ and assume $<$ to be lexicographic order such that $v^i_1<v^i_2$ for any $v_i$ and $\mathcal{X}_{swap}$ is arranged in a way that for any $x\in \mathcal{X}_{swap}$, $x.1[V(x)]$ is smaller than $x.2[V(x)]$ w.r.t. $<$. Note that with this arrangement every instance related to a statement $u:v^i_2\succ v^i_1$ is mapped to $0$. In other words, it has the same mapping as if the statement $u:v^i_2\succ v^i_1$ actually does not exist. \begin{restatable}{proposition}{propequiv} $\mathcal{C}^*_{{ac}_{|\mathcal{X}_{swap}}}=\mathcal{C}_{ac}^k$. \label{prop:equiv} \end{restatable} \begin{proof} $\mathcal{C}_{ac}^k\subseteq \mathcal{C}^*_{{ac}_{|\mathcal{X}_{swap}}}$ holds by the definition of $\mathcal{C}_{ac}^*$ as it contains the set of all complete CP-nets which, in turn, can be defined over $\mathcal{X}_{swap}$ alone. For $\mathcal{C}^*_{{ac}_{|\mathcal{X}_{swap}}} \subseteq \mathcal{C}_{ac}^k$, for every concept $c\in \mathcal{C}^*_{{ac}_{|\mathcal{X}_{swap}}}$, assume $\mathrm{CPT}(v_i)$ is incomplete with parent set $Pa$. We construct a new complete preference table $\mathrm{CPT}(v_i)'$ with the same parent set as follows: for every context $u\in \mathcal{O}_{Pa}$: if it has a statement in $\mathrm{CPT}(v_i)$ we include it as it is in $\mathrm{CPT}(v_i)'$ otherwise we \quotes{fill the gap} of $u$ by adding a statement $u:v^i_2\succ v^i_1$. The resulting $\mathrm{CPT}$ always exists and has parent set $Pa'\subseteq Pa$. Doing the same for all variables results in a complete CP-net that has the same mapping as $c$. \end{proof} However, Koriche and Zanuttini's lower bound on $\mathrm{VCD}(\mathcal{C}^*_{ac})$ exceeds $\mathrm{VCD}(\mathcal{C}^*_{unb})=2^n-1$ in some cases. In particular, in case $k=n-1$, their lower bound (on $\mathrm{VCD}(\mathcal{C}^*_{unb})$) exceeds the exact value of $2^n-1$, cf.\ our Theorem~\ref{thm:VCDac} as soon as $n>6$. It appears as though their bound is correct only for $k\ll n$ as it is evaluated to $(n+(c-1))2^{n-(c+1)}-n^2-(c-1)n+\frac{(2c-1)(n+(c-1))}{2}$ which exceeds $\mathrm{VCD}(\mathcal{C}^*_{unb})$ for small values of $c$ where $k=n-c$. A detailed argument over the bound can be found in Appendix\ref{sec:app}. \fi \iffalse \subsection{Eliciting CP-nets from Membership Queries} In this work we proposed different strategies to elicit CP-nets using membership queries alone, that is, to exactly identify any target concept with a small number of membership queries. Thanks to the complexity results reported in the previous chapter, we can now assess the optimality of those strategies. We used the semantics of CP-nets to come up with successful strategies that were shown to be near-optimal. Informally, the main difficulty lies in finding a conflict pair with which the learner would learn something new about the target concept. Otherwise, the learner can query an exponential number of instances without learning something new. Note that, with equivalence queries, conflict pairs are taken for granted, i.e., by one equivalence query, and the membership queries are then used to find the reason of this conflict by binary search. In the case of a corrupted oracle, we discussed some limits on learning acyclic CP-nets and provided a strategy that exactly identifies acyclic CP-nets by imposing a restriction over the corruption distribution. One interesting related result in the field of learning theory is the result in \cite{DBLP:journals/jcss/BishtBK08} where it was shown that if a concept class is closed under projection, satisfies a specific structural property, and is efficiently learnable from membership and equivalence queries then it is also efficiently learnable from equivalence queries and corrupted membership queries. However, the result is specific to boolean function classes, i.e., when $\mathcal{X}$ is $\{0,1\}^n$ which is not the case for our instance space $\mathcal{X}_{swap}$. Therefore, the result cannot be used here and a further study on learning CP-nets from equivalence and corrupted membership oracles is needed. \fi \section{Conclusion} We determined exact values or non-trivial bounds on the parameters $\mathrm{VCD}$ and $\mathrm{TD}$ for the classes of all (all complete, resp.) $k$-bounded acyclic CP-nets for any $k$, and used some of the insights gained thereby for the design of algorithms for learning CP-nets from membership queries, both in a setting where membership queries are always answered correctly and in settings where some answers may be missing or incorrect. The $\mathrm{VCD}$ values we determined correct a mistake in \cite{Koriche2010685}. Further, we used the calculated $\mathrm{TD}$ values in order to show that our proposed algorithm for learning complete tree CP-nets from membership queries alone is close to optimal, and the calculated $\mathrm{VCD}$ values in order to refine an optimality assessment of Koriche and Zanuttini's algorithm for learning all $k$-bounded acyclic CP-nets from equivalence and membership queries. All our results were obtained over the swap instance space. When using membership queries, a restriction of the instance space to swaps actually limits the options of the algorithm; one may want to investigate whether our algorithms can be made more efficient when given access to the full set of outcome pairs. For fixed $k$, the number of membership queries made by our learning algorithms grows moderately with $n$, with an asymptotic worst-case behavior of $O(n\log_2(n))$ (to be multiplied by $n$ in the corrupted setting), which is at most a factor of $O(\log_2(n))$ above the best achievable, and suggests practical feasibility. In practice, running our algorithms may become prohibitive when $k$ grows too large---as is also evident in the complexity parameters we calculated for the unbounded case, i.e., when $k=n-1$. Intuitively though, learning preferences that depend on a large number of parent variables is a problem that one might prefer to approach with approximate learning. When the dependency structure between the variables becomes so complex that unbounded CP-nets are needed to model them, one might in practice worry about overfitting the observed preferences---a simpler yet approximate CP-net may in such cases be a more desirable learning target. Knowledge of the number of queries required for exact identification of $\mathrm{CPT}$s and CP-nets will then also be useful in the design of heuristic approaches for approximating a target $\mathrm{CPT}$ or CP-net. On top of the $\mathrm{VCD}$ and the $\mathrm{TD}$, we calculated another parameter, $\mathrm{RTD}$, for classes of all complete $k$-bounded acyclic CP-nets. While we did not use our $\mathrm{RTD}$ results for optimality assessments of proposed learning algorithms, they are of interest to learning-theoretic studies, as they exhibit, with the class $\mathcal{C}_{ac}^{n-1}$ of all complete unbounded acyclic CP-nets, the first known non-maximum class as well as the first not intersection-closed class that is interesting from an application point of view and satisfies $\mathrm{RTD}=\mathrm{VCD}$, cf.\ Appendix\ref{sec:struct}. Thus further studies on the structure of CP-nets may be helpful toward the solution of an open problem concerning the general relationship between $\mathrm{RTD}$ and $\mathrm{VCD}$ \cite{SimonZ15}. Our results may also have implications on the study of consistent CP-nets. Since the class of acyclic CP-nets is less expressive than that of all consistent CP-nets, while having the same information complexity in terms of $\mathrm{VCD}$, it would be interesting to find out whether learning algorithms for acyclic CP-nets can be easily adapted to consistent CP-nets in general. \section*{Acknowledgements} The authors would like to express their gratitude to the reviewers, whose detailed comments helped to improve the quality of this article. Eisa Alanazi's research was supported by the Saudi Cultural Bureau in Canada. Malek Mouhoub and Sandra Zilles were supported by the Discovery Grant program of the Natural Sciences and Engineering Research Council of Canada (NSERC). Sandra Zilles was also supported by the NSERC Canada Research Chairs program. \bibliographystyle{elsarticle-num}
\section{Introduction} The present paper is a continuation of our previous paper \cite{FJY1}, and focuses on solving mathematical difficulty by exploring various mathematical techniques. Let us first recall the content of \cite{FJY1}. As the title says, the paper focuses on how the timing risk--- a payment at a random time (a {\em stopping time} to be mathematically precise)--- is evaluated. It answers the question by how it can be {\em statically} hedged. The first contribution of \cite{FJY1} was to show that a timing risk is decomposed into an integral of continuum of static positions of knock-in options. This is an extension of an observation made by P. Carr and J. Picron in \cite{CP}, where just a constant payment at a stopping time was treated, and the decomposition was resulted by an elementary integration by part. The general case requires a more advanced mathematics with an argument on delta-approximating kernels. In \cite{CP} where the underlying asset price is assumed to be a geometric Brownian motion, each knock-in option is hedged by a static position of a call-type option and a put-type option, the strategy proposed by J. Bowie and P. Carr in \cite{BC} \footnote{It is often called semi-static hedge. Semi-static hedge represents the hedge of knock-out/knock-in options by simply holding positions in plain vanilla options: this topic has been widely discussed and extensively studied since the paper \cite{BC}. After this seminal contribution, the related financial literature has developed different directions of research. One stream of studies has focused on the extension of the reflection principle (i.e. the key tool in the Black-Scholes setting) to a 'weaker' symmetry property (see, for example, \cite{CL}) or to a more general setting (e.g.\cite{IT}). To provide a concrete example, as an extreme case, the paper by \cite{CN} obtained an exact semi-static hedging formula in a general one-dimensional diffusion environment by constructing an operator which maps the pay-off function (of the option to be hedged) to a function that admits an exact semi-static hedging formula. The approach has then been extended in \cite{BN} as ``weak reflection principle'' and may work for jump processes.}. As a consequence, the timing risk is hedged without error if an integral---infinitesimal amount for each maturity---of Bowie-Carr type strategies is allowed. The integral of static positions is referred to as Carr-Picron type hedging strategy in \cite{FJY1}. In a general case, Bowie-Carr strategy, and therefore Carr-Picron one brings about {\em hedging error}. Since the error is again a timing risk, it is decomposed into an integral of static positions of knock-in options to which Carr-Picron type strategy can be applied. The second contribution of \cite{FJY1} is that to claim that the error will be dramatically reduced by repeating this procedure, and converges to zero finally. The mathematics behind the above mentioned results of \cite{FJY1} is {\em parametrix}. The parametrix method is a classical way to construct a fundamental solution to a partial differential equation as an convergent series, called heat kernel expansion (see e.g. \cite{MR0181836}). Recently, the method has been successfully applied in finance and related fields (e.g. \cite{C} \cite{BK}, among others). The parametrix, not like the Watanabe expansion in Malliavin calculus, does not require smoothness but ellipticity in the diffusion coefficients. It heavily depends on the integrability of the second-order differentiation of the approximating kernel, and this is obtained by the ellipticity and (H\"older) continuity of the coefficient. The conditions for the parametrix to work is postulated as assumptions in \cite{FJY1}. Even though many diffusion models including generic 1-dimensional ones satisfy the required condition, a construction of the iterated static hedge that is applicable to any uniformly elliptic diffusions is postponed to the present paper. The contribution of the present paper is two-fold. Firstly, we propose a systematic way for constructing an exact static hedging strategy of (single) barrier options (instead of general timing risks, to avoid detailed economic discussions) under a general multi-dimensional diffusion setting, in contrast with the existing results based on price-expansion like \cite{KTY} or \cite{STY}. Secondly, we give an example with discontinuous diffusion coefficients where the parametrix method can give a heat kernel expansion, which is convergent if the discontinuity is ``controllable" (see Theorem \ref{errorrep}). The present paper describes a methodological proposal by stating existence and convergence of asymptotic static hedging errors by leveraging on both parametrix techniques and kernel symmetrization, a technique first introduced in \cite{AII} and generalized in \cite{AI}. This is done for a fairly large class of multi-dimensional stochastic assets' dynamics but with the uniformly elliptic condition. First order, second order and higher orders hedging errors are derived and their integral representation is reported. Existence and asymptotic convergence are then proved. The proposed methodology allows to build in a systematic manner exact static hedging strategies of barrier options; an example with discontinuous diffusion coefficients is discussed, by showing how parametrix techniques can bring to an exact heat kernel expansion with Dirichlet condition. The paper is organized as follows: Section \ref{GSSHE} recalls the main results achieved by \cite{FJY1}. Section \ref{Parametrix} provides and discusses the main theoretical results of the proposed methodology by conducting the analysis through subsequent steps: introduction of semi-static hedges based on symmetrization under a more general mathematical setting than in \cite{FJY1} (Subsection \ref{sshviasymm}); assumptions for the underlying asset price process (Subsection \ref{assonX}); integral decomposition of the hedging error and derivation of the first order hedging error (Subsection \ref{ErrF}, Theorem \ref{RCSVF}); second order hedging error (Subsection \ref{SOSSH}, Theorem \ref{2ndexp}); Subsection \ref{HOH} extends the basic ideas of the preceding sections to the identification of higher orders hedging errors. Section \ref{sec:conc} provides concluding remarks and Appendix \ref{App} contains the proofs of the main theoretical results presented in the paper. \section{A Framework of Asymptotic Static Hedges: A Quick Review of \cite{FJY1}} \label{GSSHE} {The aim of this Section is to recall the framework of asymptotic hedging error identification and expansion and the main theoretical results achieved in \cite{FJY1}. We first recall the strategy of semi-static hedge of barrier options. Let $ X $ be a diffusion process and $ \tau $ be the first exit time of $ X $ out of a domain $ D \subset \mathbf{R}^d $. We want to hedge the knock-out option by holding two plain options. Suppose that its pay-off is given by $ f(X_T) 1_{ \{ \tau > T\} } $, where $ f $ is, for the moment, a bounded measurable function on $ \mathbf{R}^d $. The hedge strategy we will be working on is as follows: long position of the option whose pay-off is $ f (X_T) 1_{\{ X_T \in D \} } $, and the short position of the one with $ \hat{f} $, where $ \hat{f} $ is a measurable function on $ \mathbf{R}^d $ such that $ \hat{f} = 0 $ on $ D $. Then, \begin{itemize} \item If $ X $ never exit $ D $, then the hedge works apparently. \item On the event $ \{ \tau < T\} $, at time $ \tau $ the hedger liquidates the portfolio. The cost is $$ e^{-r (T-\tau)} E [ ( f(X_T) 1_{\{ X_T \in D \} }- \hat{f} (X_T) ) | \mathcal{F}_\tau ] . $$ \end{itemize} If the latter was also zero, we could say that the static hedge works perfectly but otherwise the latter could be understood as the error of the static hedge. We can also consider the static hedge of the knock-in pay-off $ f(X_T) 1_{ \{ \tau < T\} } $ by holding $ f (X_T) 1_{ \{X_T \in D^c\} } $ and $ \hat{f} $. Then, \begin{itemize} \item If $ X $ never exit $ D $, then the hedge works apparently; nothing versus nothing. \item At $ \tau (< T) $, the hedger sell the option of pay-off $ \hat{f} $ and buy the one with pay-off $ f (X_T) 1_{ \{X_T \in D \}} $. Then the cost is again $ e^{-r (T-\tau)} E [ ( f (X_T) 1_{ \{X_T \in D \}} - \hat{f} (X_T) ) | \mathcal{F}_\tau ] $. \item At the maturity $ T $, the pay-off is zero: $ f (X_T) $ versus $ f (X_T) 1_{ \{ X_T \in D \}} + f(X_T) 1_{ \{ X_T \in D^c \}} $. \end{itemize} Thus in both cases, the {\em hedge error} evaluated at $ t\, (< \tau) $ is \begin{equation}\label{hdgerr} e^{-r (T-t)} E[ E [1_{ \{\tau < T \} } \pi (f) (X_T) | \mathcal{F}_\tau ]| \mathcal{F}_t], \end{equation} where $ \pi(f) (x) := f (x) 1_{ \{x \in D \}}- \hat{f} (x) $. In other words, we have \begin{equation}\label{koerr} \begin{split} &E [ f (X_T) 1_{\{ \tau > T \} }|\mathcal{F}_{t \wedge \tau} ] (\text{knock-out option to be hedged}) \\& =E [ \pi(f)(X_T) |\mathcal{F}_{t \wedge \tau} ] (\text{plain options to hedge}) - E[ E [1_{ \{\tau < T \} } \pi (f) (X_T) | \mathcal{F}_\tau ]| \mathcal{F}_{t} ] (\text{hedging error}) \end{split} \end{equation} and \begin{equation}\label{kierr} \begin{split} &E [ f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_{t \wedge \tau} ](\text{knock-in option to be hedged}) \\ & =E [ \pi^\bot (f)(X_T) |\mathcal{F}_{t \wedge \tau} ] (\text{plain options to hedge}) + E[ E [1_{ \{\tau < T \} } \pi (f) (X_T) | \mathcal{F}_\tau ] \mathcal{F}_{t} ] (\text{hedging error}), \end{split} \end{equation} where $ \pi^{\bot}(f)(x) := f(x) 1_{ \{x \in D^c \}}+\hat{f}(x) $. Here we assume that $ \hat{f} (x) = \widehat{ f(x) 1_{ \{x \in D\}}} $, which implies $ \widehat{\pi (f)} = \hat{f} $, $ \pi^2 (f) = \pi(f) $, and so on. The first main result of the paper \cite{FJY1} is to replace the hedging error \eqref{hdgerr}, with the integration of knock-in options maturing at $s $ with pay-off \begin{equation}\label{dblconv1} (\mathcal{S})^1_{t} f(x) := \int_{\mathbf{R}^d} (L_x -\partial_t )p_t(x,y) \pi(f) (y) \, dy, \end{equation} where $ L_x $ is the infinitesimal generator of $ X $ acting on the variable $ x $, and $ p $ is a kernel approximating Dirac's delta as $ t \to 0 $ with the property that for $x \in \partial D$ \begin{equation*} \int_{\mathbf{R}^d} \pi (f) (y) p_t(x, y) dy = 0, \end{equation*} or equivalently, \begin{equation}\label{relppi} \int_{D} p_t(x,y) f(y) \,dy = \int_{D^c} p_t(x,y) \hat{f} (y) \,dy. \end{equation} We note that the joint integrability in $ (t, y) $ of \begin{equation*} h_0 (t,x ,y) := (L_x -\partial_t )p_t(x,y) \end{equation*} is a naive requirement but if we could assume it, then everything works properly. We assume that $ X $ has a smooth transition density $ q_t(x,y) $ and that $ q_t(x,y) $ is the transition density of the adjoint semigroup. The following {\em error formula} is established in \cite{FJY1} by using a fundamental relation in parametrix. \begin{Theorem}[\cite{FJY1}]\label{GSH} Suppose that \begin{equation}\label{inrv1} \int_0^T \int_{\mathbf{R}^d} q_s(x, z) | (\mathcal{S})^1_{T-s} f(z) | \, dz ds < \infty \end{equation} for each $ x \in \mathbf{R}^d $. Then, the hedging error is decomposed into the integral of knock-in options: \begin{equation*} E[ E [1_{ \{\tau < T \} } \pi (f) (X_T) | \mathcal{F}_\tau ] \mathcal{F}_{t}] = \int_0^T E [ 1_{ \{ \tau \leq s \}} ( (\mathcal{S})^1_{T-s} (f) ) (X_s) | \mathcal{F}_{\tau \wedge t}] \, ds. \end{equation*} Consequently, we have the following formulas for knock-out and knock-in options, respectively; \begin{equation}\label{KOGSH} \begin{split} &E [ f (X_T) 1_{\{ \tau \geq T \} }|\mathcal{F}_{t \wedge \tau} ] \\& =E [ \pi(f)(X_T) |\mathcal{F}_{t \wedge \tau} ] - \int_0^T E [ 1_{ \{ \tau < s \}} ( (\mathcal{S})^1_{T-s} (f) ) (X_s) | \mathcal{F}_{\tau \wedge t}] \, ds, \end{split} \end{equation} and \begin{equation}\label{KIGSH} \begin{split} &E [ f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_{t \wedge \tau} ] \\& =E [ \pi^\bot (f)(X_T) |\mathcal{F}_{t \wedge \tau} ] + \int_0^T E [ 1_{ \{ \tau < s \}} ( (\mathcal{S})^1_{T-s} (f) ) (X_s) | \mathcal{F}_{\tau \wedge t}] \, ds. \end{split} \end{equation} \end{Theorem} Since the integrand of the second term of the right-hand-side of \eqref{KIGSH} is again a pay-off of knock-in option, the formula can be iterated repeatedly to obtain an asymptotic expansion. We suppose that, for $ n \in \mathbf{N} $, \begin{equation}\label{inrv2} \int_{0=s_0 < s_1 < \cdots < s_n < T} \int_{\mathbf{R}^{dN}} q_{T-s_n}(x, y_N) \prod_{j=1}^{n} | h_0 (s_j-s_{j-1}, y_{j}, y_{j-1})| dy_j ds_j < \infty \end{equation} Then, we can define operators $ (\mathcal{S} )_t^n $ for $ h = 2,\cdots, n $ recursively by \begin{equation*} \begin{split} (\mathcal{S} )^h_t f(x) = \int_0^t (\mathcal{S} )^1_s (\mathcal{S} )^{h-1}_{t-s} f(x)\,ds. \end{split} \end{equation*} The following asymptotic expansion formula for the semi-static hedge is obtained in \cite{FJY1}. \begin{Theorem}[\cite{FJY1}]\label{HSS} With \eqref{inrv2}, we have that for $n \in \mathbf{N}$ \begin{equation* \begin{split} & E [ f (X_T) 1_{\{ \tau \geq T \} }|\mathcal{F}_{t \wedge \tau} ] \,\, (\text{resp.} E [ f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_{t \wedge \tau} ]) \\ &= E [ \pi(f)(X_T) |\mathcal{F}_{t \wedge \tau} ] \,\, (\text{resp.} E [ \pi^{\bot} f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_t ]) \\ & \quad \mp \sum_{h=1}^{n-1} \int_0^T E [ \pi^\bot ((\mathcal{S})^h_{T-s} (f) ) (X_s)| \mathcal{F}_{\tau \wedge t} ] \,ds \\ & \qquad \mp \int_0^T E [ 1_{ \{ \tau < s \}} ( (\mathcal{S})^n_{T-s} (f) ) (X_s)| \mathcal{F}_{\tau \wedge t} ] \,ds, \end{split} \end{equation*} where we understand $ \sum_{h=1}^{0} (\cdots) =0 $ conventionally. Furthermore, if \eqref{inrv2} holds for any $ n \in \mathbf{N} $ and the quantity goes to zero as $ n \to \infty $, then we have that $ \sum_{h=1}^n \pi^\bot (\mathcal{S})^h_{T-s} (f) (x) $ converges uniformly in $ x $, $ \sum_{h=1}^\infty \pi^\bot (\mathcal{S})^h_{T-s} (f) (X_s) $ is integrable in $ (s,\omega) $, and \begin{equation*}\label{exact} \begin{split} & E [ f (X_T) 1_{\{ \tau \geq T \} }|\mathcal{F}_{t \wedge \tau} ] \,\, (\text{resp.} E [ f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_{t \wedge \tau} ]) \\ &= E [ \pi(f)(X_T) |\mathcal{F}_{t \wedge \tau} ] \,\, (\text{resp.} E [ \pi^{\bot} f (X_T) 1_{\{ \tau < T \} }|\mathcal{F}_{t \wedge \tau} ]) \\ & \qquad \mp \int_0^T E [ \sum_{h=1}^\infty \pi^\bot ( (\mathcal{S})^h_{T-s} (f) ) (X_s)| \mathcal{F}_{\tau \wedge t} ] \,ds. \\ \end{split} \end{equation*} \end{Theorem} \section{Static Hedge via Symmetrization }\label{Parametrix} This Section deals with the static hedge problem by showing how to build asymptotics of static hedge error by resorting to parametrix techniques and kernel symmetrization. The main theoretical results are presented under a more general setting than the one considered in \cite{FJY1}. The intermediate steps underlying the analysis are presented and discussed in separate Subsections. The introduction of semi-static hedges based on symmetrization under a fairly general class of multi-dimensional models is contained in Subsection \ref{sshviasymm}. The assumptions considered for the underlying asset price process and their implications are threated in Subsection \ref{assonX}. The integral decomposition of the hedging error and the derivation of the first order hedging error (Theorem \ref{RCSVF}) are contained in Subsection \ref{ErrF}. The results for the second order hedging error is instead given in Theorem \ref{2ndexp}, Subsection \ref{SOSSH}. Then, Subsection \ref{HOH} shows how to extend the basic ideas of the preceding Subsections to the identification of higher orders hedging errors. \subsection{Semi-static hedge based on symmetrization}\label{sshviasymm} This Subsection deals with the introduction of semi-static hedges based on symmetrization under a fairly general class of multi-dimensional models. A key element to be considered is the existence of a proper pair of the map $ f1_{\{ x \in D\}} \mapsto \hat{f} $ and the density $ p $ in \eqref{relppi}. Let us start from an example. In \cite{FJY1}, two specific cases are presented: the one dimensional case, and the multi-dimensional case based on {\em put-call symmetry} introduced in \cite{AI}. The one dimensional case relies on the reflection principle of $1$-dimensional Brownian motion to pick up $ p $ and $ \pi $, which are, respectively, the heat kernel of the standard Brownian motion and the reflection with respect to the boundary $ K $: \begin{equation}\label{refl1} \pi (f) (x) = f (x)1_{\{x >K\} } - f (2K-x) 1_{\{ x \leq K \} }. \end{equation} When working under the one-dimensional case, almost all diffusions can be smoothly transformed to Brownian motion with drift; since the knock-out region can always be characterized as an interval, the transformation would just shift it to a different interval\footnote{In \cite{FJY1} the cases where the region is a half line are studied. A similar approach can be extended to consider the cases with double boundaries.}. When working under the multi-dimensional setting, the same does not apply. Indeed, it is not always true that a generic diffusion process can be smoothly transformed into a Brownian motion with drift. This holds only for some special cases. Moreover, the knock-out/in region $D$ has not always the same shape, i.e. it cannot always be characterized as an interval, thus we cannot leverage on homeomorphic properties. In this paper, we consider a multi-dimensional setting by focusing on a specific class of knock-out/in regions, i.e. those which are diffeomorphic to a hyper-halfspace\footnote{Observe that by the diffeomorphism, the diffusion matrix can take any form, so we do not assume any specific form in the diffusion/drift coefficients except for the uniform ellipticity.}. Let us introduce the following notation and setting. Let define the region $D$ as \begin{equation*} D := \{ x \in \mathbf{R}^d | \langle x, \gamma \rangle > k \}, \end{equation*} for some $ \gamma \in \mathbf{R}^d $ with $ |\gamma|=1 $ and $ k \in \mathbf{R} $, and $ \theta $ being the reflection with respect to $ \partial D $ defined as \begin{equation*} \theta (x) = x - 2 {\langle \gamma, x \rangle \gamma} + 2 {k \gamma} = \left(I- 2 {\gamma \otimes \gamma} \right) x + 2 {k \gamma}. \end{equation*} The methodological proposal is to choose function $ \pi $ with the same approach reported in Equation \eqref{refl1}, by considering its multi-dimensional version as: \begin{equation}\label{sympi} \pi (f) (x) = f(x) 1_{\{x \in D \}} - f(\theta(x))1_{ \{ x \not\in D \}}. \end{equation} } For the delta-approximating kernel, we rely on the symmetrization introduced in \cite{FJY1}. We suppose that the infinitesimal generator of $ X $(already transformed one) is given by \begin{equation}\label{genrt} \frac{1}{2} A(x) \cdot \nabla^{\otimes 2} + b(x) \cdot \nabla \equiv \frac{1}{2} \sum_{i,j} a_{i,j} (x) \frac{\partial^2}{\partial x_i \partial x_j} + \sum_i b_i (x) \frac{\partial}{\partial x_i}, \end{equation} where $ A $ and $ b $ are functions on $ \mathbf{R}^d $, $ d \times d $- positive definite matrix valued, and $ \mathbf{R}^d $ valued, respectively. Let \begin{equation}\label{DPCS} p_t (x,y) := (2 \pi)^{-\frac{d}{2}} \{\det \tilde{A} (y)t\}^{-\frac{1}{2}} e^{- \frac{1}{2t} \langle \tilde{A}(y)^{-1} (x -y), x -y \rangle}, \end{equation} where \begin{equation}\label{smtrz} \tilde{A} (x) = \begin{cases} A(x) & x \in D \\ \Psi A (\theta(x)) \Psi & x \not\in D, \end{cases} \end{equation} and $ \Psi = I- 2 {\gamma \otimes \gamma} $. Observe that this is the symmetrization of $ A $ with respect to the reflection $\theta $ introduced in \cite{AI}. We can now state the following result linking function $p_t(x,y)$ and $\pi(\cdot)$ given, respectively, in \eqref{DPCS} and \eqref{relppi}. \begin{Proposition} The function $p_t (x,y)$ defined in \eqref{DPCS} satisfies \eqref{relppi} with respect to function $\pi(\cdot)$ defined in \eqref{sympi}. \end{Proposition} \begin{proof} Since $ \Psi^2 = I $ and $ x = \theta (x) $ for $ x \in \partial D $, \begin{equation*} \begin{split} & p_t (x, \theta(y) ) \\ &= (2 \pi)^{-\frac{d}{2}} \{\det \tilde{A}(\theta(y))t\}^{-\frac{1}{2}} e^{- \frac{1}{2t} \langle \tilde{A} (\theta(y))^{-1} (x -\theta(y)), x -\theta(y) \rangle} \\ &= (2 \pi)^{-\frac{d}{2}} \{\det \Psi \tilde{A} (y) \Psi t \}^{-\frac{1}{2}} e^{- \frac{1}{2t} \langle \tilde{A}(y)^{-1} \Psi (\theta(x) -\theta(y)), \Psi( \theta(x) -\theta(y)) \rangle} \\ & =(2 \pi)^{-\frac{d}{2}} \{\det \tilde{A} (y) t \}^{-\frac{1}{2}} e^{- \frac{1}{2t} \langle \tilde{A}(y)^{-1} \Psi^2 (x -y), \Psi^2( x -y) \rangle} \\ &= p_t (x,y). \end{split} \end{equation*} Therefore, \begin{equation}\label{pcsond} \begin{split} & \int_{\mathbf{R}^d} \pi (f) (y) p_t (x, y) \,dy = \int_{\mathbf{R}^d} f(y) 1_{ \{y \in D\}} \left( p_t (x, y) - p_t (x, \theta (y)) \right) \,dy =0 \end{split} \end{equation} for any bounded measurable $ f $ and $ x \in \partial D $. \qed \end{proof} Thus, $ \pi $ of \eqref{sympi} and $ p $ of \eqref{DPCS} can be chosen as a specific example of the framework of \cite{FJY1}, but it turns out that the integrability conditions \eqref{inrv1} or \eqref{inrv2} may fail. The formula \eqref{pcsond} may economically mean the following. The kernel $ p $ is a kind of fictitious transition probability of the underlying process. If it were the real one, the price at $ \tau $ of the option with pay-off $ \pi (f) $ would be zero, and therefore the static hedge by the option with pay-off $ f (\theta (x)) $ works without error. \subsection{Underlying asset price dynamics}\label{assonX} This Subsection aims to describe the mathematical setting characterizing the assumptions on the underlying asset price dynamics. Specific assumptions on both parameters $A$ and $b$ are provided and discussed. \begin{Assumption}\label{Hypo} There exist positive constants $ m $ and $ M $ such that \begin{equation}\label{uelli} m |y|^2 \leq \langle A (x) y,y \rangle \leq M |y|^2 \quad \forall x,y \in \mathbf{R}^d \end{equation} where $ a_{ij}, b_j $ have any order of derivatives, all bounded above. \end{Assumption} Notice that $ A $ and $ b $ are Lipschitz continuous under Assumption \ref{Hypo}. In particular, by considering the case \begin{equation*} a_{\infty} := \left\{ \sum_{i,j} d \max_k \left( \sup_{x \in \mathbf{R}^d} | \partial_k a_{i,j} (x) | \right)^2 \right\}^{\frac{1}{2}}, \end{equation*} we have \begin{equation}\label{Lipschitz1} \Vert A (x) - A(y) \Vert \leq a_{\infty} | x -y |, \end{equation} where $\Vert M \Vert \equiv (\mathrm{Tr}MM^* )^{\frac{1}{2}} $ for a matrix $M$. Moreover, Assumption \ref{Hypo} implies what follows (see e.g. \cite[Theorem 1.11, Theorem 1.15]{MR0181836}) on the transition density of $X$. Under Assumption \ref{Hypo}, the transition density $q_t (x,y)$ associated to $ X $ \begin{equation*} q_t (x,y) = P (X_t \in dy |X_0=x)/dy \end{equation*} exists, it is twice continuously differentiable in $ (x,y) $ and continuously differentiable in $ t $. Moreover, there exists a constant $C_q >0$ such that for $M_0 > M $ the transition density satisfies the following inequalities \begin{equation}\label{ineq-q} q_t(x,y) \leq C_q t^{-\frac{d}{2}}\exp\{-\frac{ |x-y|^2}{4M_0t}\}, \end{equation} \begin{equation}\label{ineq-q1} |\nabla q_t (x,y) | \leq C_q t^{-\frac{d+1}{2}}\exp\{-\frac{ |x-y|^2}{4M_0t}\}, \end{equation} and \begin{equation}\label{adj0} \partial_s q_s (x,y) = (L_x q_s ) (x,y) = (L^*_y q_s )(x,y), \end{equation} where $ L_x $ is the infinitesimal generator of $ X $ (see (\ref{genrt})) acting on the variable $ x $, and $ L^*_y $ is the adjoint of $ L $, acting on the variable $ y $. The adjoint $ L^*_y $ can be written under the following form: \begin{equation*} \begin{split} L^*_y &= \frac{1}{2} \nabla^{\otimes 2}_y \cdot A(y) - \nabla_y \cdot b (y) \\ & \equiv \frac{1}{2} \sum_{i,j} a_{i,j} (y) \frac{\partial^2}{\partial y_i \partial y_j} + \sum_i \left( \sum_j \frac{\partial a_{ij}}{\partial y_j} (y) - b_i (y) \right) \frac{\partial}{\partial y_i} + \frac{1}{2} \sum_{i,j} \frac{\partial^2 a_{ij}}{\partial y_i \partial y_j}(y) - \sum_i \frac{\partial b_i }{\partial y_i} (y). \end{split} \end{equation*} Notice that we have \begin{equation}\label{adj1} \int_{\mathbf{R}^d} (L^*_y q_s )(x,y) g(y) \,dy = \int_{\mathbf{R}^d} q_s (x,y) L_y g(y) \,dy \end{equation} for any test function $ g \in C_0^\infty (\mathbf{R}^d) $ (see e.g. \cite{MR0181836}). Let us consider the operator $L^y_z$ defined as \begin{equation*} L^y_z = \frac{1}{2} \tilde{A}(y) \cdot \nabla^{\otimes 2}, \end{equation*} acting on the variable $ z $. By considering $ (x,y) \in \mathbf{R}^d \times \mathbf{R}^d $, we then have \begin{equation}\label{Gauss} \partial_s p_s (x,y) = (L^y_x p_t) (x,y). \end{equation} \subsection{Hedging error formula} \label{ErrF} We shall establish the Error formula corresponding to Theorem \ref{GSH}. Due to the lack of continuity in $ \tilde{A} $, this requires extra efforts. Recall that \begin{equation*} \begin{split} h_0 (t,x,y) &=(L_x - \partial_t ) p_{t} (x,y) \\& = (L_x - L^y_x ) p_{t} (x,y). \end{split}\end{equation*} \begin{Lemma}\label{fof} For $ y \in \mathbf{R}^d $, \begin{equation}\label{param22} \begin{split} q_t ( x, y) - p_t ( x, y) &= \int_0^t ds \int_{\mathbf{R}^d}\, dz \,\, q_s (x,z) h_0 (t-s, z,y). \end{split} \end{equation} \end{Lemma} The equation (\ref{param22}) is the key to the parametrix theory (see e.g. \cite{BK}). To give a proof to Lemma \ref{fof} is somewhat difficult since we have explicitly, \begin{equation}\label{hzero} \begin{split} & h_0 (t,z,y) \\& = \frac{1}{2}\{ A(z) - \tilde{A}(y) \} \cdot \nabla^{\otimes 2} p_t (z,y) + b (z) \cdot \nabla p_t (z,y) \\ &= \frac{1}{2}\{ A(z) - \tilde{A}(y) \} \cdot \left( \frac{1}{t^2} \{\tilde{A}(y)\}^{-1} (z-y) \otimes \{\tilde{A}(y)\}^{-1}(z-y) - \frac{1}{t} \{\tilde{A}(y)\}^{-1}\right) p_t (z,y) \\ & \qquad - b(z) \cdot \frac{1}{t} \{\tilde{A}(y)\}^{-1} (z-y) p_t (z,y) \\ &= \frac{1}{2t^2} \{ A(z) - \tilde{A}(y) \} \{\tilde{A}(y)\}^{-1}(z-y) \cdot \{\tilde{A}(y)\}^{-1}(z-y) p_t (z,y) \\ & \qquad - \frac{1}{2t} \{\tilde{A}(y)\}^{-1} \cdot \Big( \{ A(z) - \tilde{A}(y) \} + 2b(z) \otimes (z-y) \Big) p_t (z,y). \end{split} \end{equation} We recall here that the integrability in $ (t,z) \in [0,T] \times \mathbf{R}^d $ of the terms from the second order derivative are normally retrieved by the continuity of $ A $ in the classical parametrix theory (see e.g. \cite[Chapter 1. Section 4.]{MR0181836}). Here, it becomes a very naive problem since the symmetrized diffusion matrix $ \tilde{A} $ in most cases fails to be continuous at $ \partial D $. To overcome this difficulty, we introduce a parameter that can be as sufficiently small as possible when necessary. Set \begin{equation}\label{discon} \delta := 2 \sup_{ x \in \partial D} \Vert [A(x), \gamma \otimes \gamma ] \Vert. \end{equation} Then the constant $ \delta $ controls the discontinuity in the following sense: \begin{Lemma} \label{disconlem} For $ x \in D $ and $ y \in D^c $, \begin{equation}\label{condiscon} \Vert A (x) - \tilde{A} (y) \Vert \leq a_\infty | x- y | + \delta. \end{equation} \end{Lemma} A proof of the Lemma \ref{disconlem} will be given in the Appendix \ref{lemdiscon}. Thus, if $ \delta = 0 $, we have the Lipschitz continuity of $ \tilde{A} $ and therefore, the integrability of $ h_0 $. If this is the case, we can establish the convergent expansion by using standard theory (see \cite{MR0181836}, \cite{BK}, and \cite{FJY1}). Without the continuity, the standard approach does not work. However, we have the following estimate which is critical to obtain the result contained in Theorem \ref{intbh}. \begin{Lemma}\label{hestimate} For $x, y \in \mathbf{R}^d$, \begin{equation}\label{inequalityh_0} |h_0 (t,x,y)| \leq C_1 t^{-\frac{1}{2}} p_t^{2M} (x,y) + (\delta 1_{\{x \in D \} } + 2M d 1_{\{ x \in D^c\} })C_2 t^{-1 } p_t^{2M} (x,y) 1_{\{y \notin D\}}, \end{equation} where \begin{equation}\label{C1C2} \begin{split} C_1 &:= 2^{\frac{d}{2}} m^{- \frac{2+d}{2}} M^{\frac{1+d}{2}} (4m^{-1} M K_{\frac{3}{2}} a_\infty + d^{\frac{1}{2}} K_{\frac{1}{2}} a_\infty + b_\infty ), \\ C_2 &:= 2^{\frac{d}{2}} m^{- \frac{2+d}{2}} M^{\frac{d}{2}} (2 m^{-1} M K_1 + 2^{-1} d^{\frac{1}{2}}) \end{split} \end{equation} with $ \delta $ and $ a_\infty $ as defined in \eqref{discon} and (\ref{Lipschitz1}), respectively, \begin{equation*} b_\infty =\max_{1 \leq i \leq d} \Vert b_i \Vert_{\infty}, \end{equation*} \begin{equation}\label{Kbeta} \sup_{x \geq 0 } |x^{\beta} e^{-x}| =:K_\beta < \infty, \end{equation} and \begin{equation*}\label{p2M} p_t^{2M} (x,y) =(4 \pi M t)^{-d/2} e^{- |x-y|^2/{4Mt}}, \end{equation*} $ M $ being the same as the one appearing in (\ref{uelli}) of Assumption \ref{Hypo}. \end{Lemma} \begin{proof}See Appendix \ref{hestimate_Pr}. \qed\end{proof} Let \begin{equation*}\label{hone} h (t,x,y) := h_0 (t,x,y) - h_0 (t,x,\theta(y)), \end{equation*} The following estimates are also essential in obtaining our economic results, so we state them separately as Theorem. \begin{Theorem}\label{intbh} Under Assumption \ref{Hypo}, we have the following inequalities.\\ (i) There exists a constant $ C_3 $ such that, for $ t \in [0,T] $ and $ x \in \mathbf{R}^d $, \begin{equation*} \begin{split} \int_{D} |h (t,x,y)| dy &\leq \int_{\mathbf{R}^d} |h_0 (t,x,y)| \,dy \\& \leq C_3\left( t^{-\frac{1}{2}} + t^{-1} \left( e^{-\frac{(k- \langle \gamma, x \rangle )^2}{4M t}}1_{ \{x \in D \} } + 1_{ \{x \not\in D \}} \right) \right). \end{split}\end{equation*}\\ (ii) There exists a constant $ C_4 $ depending on $ T $ such that, for $ s,t \in [0,T] $, $ (x,y,z,w) \in \mathbf{R}^d \times \mathbf{R}^d \times \mathbf{R}^d \times \mathbf{R}^d$ and $ M_0 > M $, \begin{equation*} q_s (x,y) | h (t, z,w)| \leq 2 q_s (x,y) | h_0 (t, z,w)| \leq C_4 s^{-\frac{d}{2}} t^{-1} \exp\left( -\frac{ |x-y|^2}{4M_0 s} \right) \exp\left( -\frac{ |z-w|^2}{4M t} \right). \end{equation*} In particular, they are integrable in $ (z,y) \in \mathbf{R}^d \times \mathbf{R}^d $.\\ (iii) Further, there exists a constant $ C_5$ depending on $ T $ such that \begin{equation*}\label{Hintegrability} \left| \int_{\mathbf{R}^d} q_s (x,z) h_0 (t, z,y) \,dz \right| \leq C_5 s^{-\frac{1}{2}} t^{-\frac{1}{2}} (s+t)^{-\frac{d}{2}} \exp\left( -\frac{ |x-y|^2}{4M_0 (t+s)} \right), \end{equation*} for any $y \in \mathbf{R}^d $. In particular, \begin{equation*} \int_{\mathbf{R}^d} q_s (x,z) h_0 (t-s, z,y) \,dz, \end{equation*} and hence \begin{equation*} \int_{\mathbf{R}^d} q_s (x,z) h (t-s, z,y) \,dz, \end{equation*} are integrable in $ (s,y) \in [0,t]\times \mathbf{R}^d $ for any $ t \in [0,T] $. \end{Theorem} \begin{proof} See Appendix \ref{pintbh}. \qed \end{proof} The point here is that the singularity of $ t^{-1} $ in the estimate (i) is handled by integration by part in (iii), using the integrability of (ii) and the Gaussian estimates \eqref{ineq-q} and \eqref{ineq-q1} of $ q $ and $ \nabla q $. \begin{Remark} We note that we do not have the integrability of \eqref{inrv1} here, so we cannot apply Theorem \ref{GSH}. \end{Remark} The first assertion of Theorem \ref{intbh} ensures that we can define an operator $ S_t $ on $ L^\infty (D) $ for each $ t > 0 $ by \begin{equation*} \begin{split} {S}_{t} f (x) &= \int_{D} h(t, x ,y) f(y) \,dy, \end{split} \end{equation*} just as \eqref{dblconv1}. \begin{Corollary}\label{bddness} For for each $ t > 0 $, $ S_t $ is an operator on $ L^\infty(D) $ into $ L^\infty (\mathbf{R}^d) $. \end{Corollary} \begin{proof} It directly follows from (i) of Theorem \ref{intbh}. \qed \end{proof} By leveraging on Lemma \ref{fof} that is derived mathematically from Theorem \ref{intbh}, we can now state the hedging error formula (integral decomposition) under the proposed multi-dimensional setting, corresponding to the one provided in Theorem \ref{GSH} by \cite{FJY1} as follows. \begin{Theorem}\label{RCSVF} Suppose that $ f $ is bounded. Under the Assumption \ref{Hypo}, the formulas \eqref{KOGSH} and \eqref{KIGSH} hold, by replacing the notation $ \mathcal{S}^1 $ with $ S $: in other words, for any $t < T$, \begin{equation}\label{error5+} \begin{split} & E[ E [ 1_{ \{ \tau < T \}} \pi (f) (X_T) | \mathcal{F}_\tau ] | \mathcal{F}_t ] = \int_0^T E [1_{\{\tau < s \}} S_{T-s} f(X_s) |\mathcal{F}_{\tau \wedge t}] \,ds. \end{split} \end{equation} \end{Theorem} \begin{proof} See Appendix \ref{RCSVF_Pr}. \qed \end{proof} \subsection{Second order semi-static hedges}\label{SOSSH} As we have seen in the previous section, the hedge error is represented by the integral with respect to $ s $ of knock-in options with pay-off $ S_{T-s} f (X_s) $. For each of them we construct the static hedge by $ \pi^\bot S_{T-s} f (X_s) $ with infinitesimal amount $ ds $. To be more precise, for the knock-in option with pay-off $ S_{T-s} f $ for each $ s $, we adopt the Bowie-Carr type strategy by the option with pay-off $ \pi^\bot S_{T-s} f $; we construct a portfolio composed of options with pay-off \begin{equation*} \begin{split} \pi^\bot S_{T-s} f (X_s) &= \{ S_{T-s} f (X_s) + S_{T-s} f (\theta(X_s))\} 1_{\{ X_s \not\in D \}}, \end{split} \end{equation*} at the volume ``$e^{-r(T-s)} ds$" for each $ s $. Note that $ \pi^\bot S_{T-s} f(X_s) $ may not be integrable in $ (s, \omega) \in [0,T] \times \Omega $, although it is in $ L^1 (P) $ for each $ s $ since $ S_{T-s} f $ is bounded. Once it is conditioned, however, we retrieve the integrability; \begin{Lemma}\label{intgso} The random variable $ E [\pi^\bot S_{T-s} f (X_s) |\mathcal{F}_\tau] $ is jointly integrable in $ (s, \omega) \in [0,T] \times \Omega \end{Lemma} \begin{proof}See Appendix \ref{intgso_Pr}.\qed\end{proof} Let us consider the value of the ``portfolio". Until the knock-in time $ \tau $, all the options whose maturity is before $ \tau $ are cleared with pay-off zero. At the knock-in time, the hedger sells all the options at the price \begin{equation*} E [\pi^\bot S_{T-s} f (X_s) |\mathcal{F}_\tau]. \end{equation*} Thus, the value at time $ t $ of the strategy should be defined as \begin{equation*}\label{vopt} \Pi_t^{2,s} := e^{-r(T-t)} E [ E [\pi^\bot S_{T-s} f (X_s) |\mathcal{F}_\tau] | \mathcal{F}_{t \wedge \tau} ], \end{equation*} which, on $ \{ t < \tau \} $, is equal to \begin{equation*} e^{-r(T-t)} E [\pi^\bot S_{T-s} f (X_s) | \mathcal{F}_{t} ]. \end{equation*} Since it is integrable in $ s \in [0,T]$, the total value at time $ t $ of the portfolios is given by \begin{equation}\label{intval2} \int_0^T \Pi_t^{2,s} \,ds =e^{-r(T-t)} \int_0^T E [\pi^\bot S_{T-s} f (X_s) | \mathcal{F}_{t \wedge \tau} ] ds. \end{equation} \begin{Remark} Lemma \ref{intgso} ensures the change of the order of the integrals to have another expression of the totality of the portfolio as \begin{equation*} \int_0^T \Pi_t^{2,s} \,ds = e^{-r(T-t)} E [ \int_{0}^T E [ \pi^\bot S_{T-s} f (X_s) |\mathcal{F}_\tau] ds | \mathcal{F}_{t \wedge \tau} ], \end{equation*} In particular, discounted by $ e^{rt} $, it is a martingale. This means that the portfolio is arbitrage-free, or should we say, it is still within the classical arbitrage theory. \end{Remark} As we have discussed in section \ref{GSSHE} as \eqref{koerr} and \eqref{kierr}, the hedge error of the strategy that holding $ \pi^\bot (\cdot) $ for a knock-in option coincides with the one by the $ \pi (\cdot) $ strategy for the corresponding knock-out option. So the error, evaluated at $ t $ for each maturity $ s $ is given by, in the infinitesimal form, \begin{equation*} \begin{split} \mathrm{Err}^s_{2,t}ds &:= e^{-r(s-t)} E [ E [ 1_{ \{ \tau < s \} } \pi S_{T-s} f (X_s) |\mathcal{F}_{\tau}] |\mathcal{F}_t] e^{-r(T-s)} ds \\ &= e^{-r(s-t)} E [ E [ \pi S_{T-s} f (X_s) |\mathcal{F}_{\tau \wedge s}] |\mathcal{F}_t] e^{-r(T-s)} ds. \end{split} \end{equation*} \begin{Lemma}\label{interr2} The error $ \mathrm{Err}^s_{2,t} $ for maturity $ s $ is integrable in $ s \in [0,T] $ and \begin{equation}\label{2ndinterr} \begin{split} \int_0^T \mathrm{Err}^s_{2,t} ds &= e^{-r(T-t)} \int_0^T \int_u^T E[ 1_{ \{ \tau < u \} } S_{s-u} S_{T-s} f (X_u) |\mathcal{F}_{t \wedge \tau}] ds du . \\ \end{split} \end{equation} \end{Lemma} \begin{proof}See Appendix \ref{interr2_Pr}.\qed \end{proof} Combining (\ref{intval2}) and Lemma \ref{interr2} we have the following \begin{Theorem}\label{2ndexp} It holds that, for each $ t>0 $, \begin{equation}\label{2nderr} \begin{split} & e^{-r(T-t)} \left(- E [ f (X_T) 1_{ \{ \tau > T \}} | \mathcal{F}_{t \wedge \tau} ] + E [ \pi f (X_T) | \mathcal{F}_{t \wedge \tau} ] - \int_0^T ds \,\,E [ \pi^\bot S^{}_{T-s}f (X_s) | \mathcal{F}_{t \wedge \tau}] \right) \\ & \qquad = e^{-r(T-t)} \int_0^T \,\, \int_u^T E [ 1_{ \{ \tau \leq u \} } S_{s-u} S_{T-s} f (X_u) |\mathcal{F}_{t \wedge \tau}] \, ds du \\ & \qquad \left( = e^{-r(T-t)} E [ \int_0^T \,\, \int_u^T E [ 1_{ \{ \tau \leq u \} } S_{s-u} S_{T-s} f (X_u) |\mathcal{F}_\tau] \, ds du |\mathcal{F}_{t \wedge \tau}] \right). \end{split} \end{equation} \end{Theorem} In \eqref{2nderr}, the left-hand-hand side is the value of the knock-out option in short position and the static hedging position of the first and the second order. So the formula claims that the hedging error evaluated at time $ t $ equals to the price of the doubly integrated knock-in options. \begin{proof} has been already done. \qed \end{proof} \begin{Remark} Notice that the proposed framework is weaker than the one studied in \cite{FJY1}; here we identify the second order hedge via two-parameters, while in \cite{FJY1} we have a one-parameter family of hedges. The reason why we express it by double integral is that we are missing the integrability to ensure the change of the order. The double integrability comes from (iii) of Theorem \ref{intbh} with the aid of integration by part. \end{Remark} \subsection{Higher orders semi-static hedges} \label{HOH} This Subsection is devoted to the discussion of asymptotics of semi-static hedges, for orders higher than two. Let us consider for a moment the third order as an example. Equation (\ref{2nderr}) may suggest that the third order semi-static hedge can be written as function of the options with pay-off \begin{equation*} \pi^\bot S_{s-u} S_{T-s} f (X_u) \end{equation*} maturing at $ u \in (0,T] $, parameterized by $ s \in (u,T] $ with infinitesimal amount $ e^{-r(T-u)} ds du $. Once the integrability of \begin{equation*} E [ \pi^\bot S_{s-u} S_{T-s} f (X_u) | \mathcal{F}_\tau ], \end{equation*} in $ (u,s) $ is established, we can say that the value of the hedging portfolio is given by \begin{equation*} e^{-r(T-t)} \int_0^T \int_u^{T} E [\pi^\bot S_{s-u} S_{T-s} f (X_u) | \mathcal{F}_{t \wedge \tau} ] ds du, \end{equation*} which is equivalent to \begin{equation*} e^{-r(T-t)} E [ \int_{0}^T \int_u^{T} E [ \pi^\bot S_{s-u} S_{T-s} f (X_u) |\mathcal{F}_\tau] \,ds du | \mathcal{F}_{t \wedge \tau} ]. \end{equation*} Furthermore, for each $ (u,s) $, the error $\mathrm{Err}^{u,s}_{3,t}$ should be defined as \begin{equation*} \mathrm{Err}^{u,s}_{3,t} := e^{-r(T-t)} E [ E[ \pi S_{s-u} S_{T-s} f (X_s) ds | \mathcal{F}_{\tau \wedge s}] |\mathcal{F}_t]. \end{equation*} Notice that, by showing the integrability of $\mathrm{Err}^{u,s}_{3,t}$ in $ (u,s) $, by following Proposition \ref{interr2} we can write: \begin{equation*} \begin{split} \int_0^T \int_0^s \mathrm{Err}^s_{3,t} \, du ds &= e^{-r(T-t)}\int_0^T \int_u^T \int_s^{T} E [ 1_{ \{ \tau \leq u \} } S_{s-u} S_{v-s} S_{T-v} f (X_u) |\mathcal{F}_{t \wedge \tau}] dv ds du. \\ \end{split} \end{equation*} Based on the above observation, we can thus construct the $ n $-th order static hedge and the corresponding error with the aggregation of $ 1,\cdots,n $-th hedges for any $ n \geq 3 $. The following Theorem extends the results stated in Theorem \ref{intbh} and has a key role in the determination of higher order hedges. \begin{Theorem}\label{nhint} The following holds: (i) For $ n \geq 2 $, and for $ y_{n+1} \in \mathbf{R}^d $ and $0= u_0 < u_1 < \cdots <u_n \leq T$, \begin{equation*}\label{primineq} \begin{split} &\int_{D^{n}} \prod_{i=1}^{n}|h( u_{i}-u_{i-1}, y_{i+1}, y_{i})|dy_1 \cdots dy_n \\ &\leq \bigg( C_1 + 1_{ \{ y_{n+1} \in D^c \}} 2MdC_2 (u_n- u_{n-1})^{-\frac{1}{2}} + 1_{ \{y_{n+1} \in D \}} \frac{\delta C_2}{2}(u_n- u_{n-1})^{-\frac{1}{2}} e^{-\frac{(\langle y_{n+1}, \gamma \rangle -k)^2}{4M (u_n-u_{n-1})}} \bigg) \\ & \qquad \times \prod_{i=1}^{n}(u_{i}-u_{i-1})^{-\frac{1}{2}} \sum_{I \subset \{ 1, \cdots, n-1\}} (\frac{\delta C_2}{2})^{|I|} C_1^{|I^c|} \prod_{ j \in I } (u_{j+1}-u_{j-1})^{-\frac{1}{2}}, \end{split} \end{equation*} where $ C_1 $ and $ C_2 $ are the ones given in \eqref{C1C2}, and $ M $ is the constant in \eqref{uelli}.\\ \noindent (ii) For $ y_{n+1} \in D $, $ u_n \in (0,T)$ and $f \in L^\infty (D) $, \begin{equation}\label{secondeq} \begin{split} &\int_{0=u_0 < u_1 <\cdots < u_n } du_1 \cdots du_{n-1} \int_{D^N} |\prod_{i=1}^{n} h(u_{i} - u_{i-1}, y_{i+1}, y_i) ||f(y_1)| dy_1 \cdots dy_n \\& \leq ||f ||_{\infty} ( C_6 \delta)^{N-1} C_7 \left( u_n^{-\frac{1}{2}} + (\langle y_{n+1}, \gamma \rangle -k)^{-\frac{3}{4}} u_n^{-\frac{5}{8}} \right), \end{split} \end{equation} where $ C_6 $ is a constant independent of $ N $ and $ \delta $, while $ C_7 $ is a constant depending on $ \delta $. \end{Theorem} \begin{proof} See Appendix \ref{pnhint}. \qed \end{proof} By Theorem \ref{nhint} we can define operators $ S_{u_n}^{*n} $ for $ u_n \in [0,T] $, $ n \geq 2 $, on $ L^\infty (D) $ by \begin{equation*} S_{u_n}^{*n}f(y_{n+1}) =\int_{0=u_0 < u_1 <\cdots < u_n } du_1 \cdots du_{n-1} \int_{D^n} \prod_{i=1}^{n} h(u_{i} - u_{i-1}, y_{i+1}, y_i) f(y_1) dy_1 \cdots dy_n , \end{equation*} for $ y_{n+1} \in \mathbf{R}^d $. \begin{Remark}\label{imppts} For $ n\geq 2 $, \begin{equation*} \begin{split} S^{*n}_t f (x) &= \int_0^t \int_D h(s, x, y) S^{*(n-1)}_{t-s} f (y) dyds \\ & = \int_0^t S_s S^{*(n-1)}_{t-s} f (x) ds \end{split} \end{equation*} with the convention that $ S^{*1}_t = S_t $. \end{Remark} The following Theorem contains one of our most relevant theoretical results, by extending Theorem \ref{2ndexp}. \begin{Theorem}\label{errorrep} Under Assumption \ref{Hypo}, we have, for $ n \geq 2 $:\\ (i) the options for the $ n $-th hedge, $ E [ \pi^\bot S_{s-u} S^{*(n-1)}_{T-s} f(X_u) | \mathcal{F}_{\tau}] $, are integrable in $ (s,u,\omega) \in \{ (s,u) : 0 \leq u \leq s \leq T \} \times \Omega $,\\ (ii) and the corresponding error is \begin{equation*} E [ 1_{ \{ \tau \leq u \} } S_{s-u} S^{*n}_{T-s} f (X_u) |\mathcal{F}_{t \wedge \tau}], \end{equation*} which is also integrable in $ (s,u,\omega) \in \{ (s,u) : 0 \leq u \leq s \leq T \} \times \Omega $.\\ (iii) As a consequence, we have, for each $ t $, \begin{equation}\label{param3} \begin{split} & e^{-r(T-t)} \bigg( - E [ f (X_T) 1_{ \{ \tau > T \}} | \mathcal{F}_{t \wedge \tau} ] + E [ \pi f (X_T) | \mathcal{F}_{t \wedge \tau} ] - \int_0^T \, E [ \pi^\bot S_{T-s}f (X_s) | \mathcal{F}_{t \wedge \tau}] \,ds \\&\qquad - \sum_{h=2}^n \int_0^T \int_u^T \, E [ \pi^\bot S_{s-u} S^{*(h-1)}_{T-s}f (X_u) | \mathcal{F}_{t \wedge \tau}] \,ds du \bigg) \\ & = e^{-r(T-t)} \int_0^T \int_u^T \, E [ 1_{ \{ \tau \leq u \} } S_{s-u} S^{*n}_{T-s} f (X_u) |\mathcal{F}_{t \wedge \tau}] \,ds du . \end{split} \end{equation}\\ (iv) If $ \delta $ is sufficiently small, the right-hand-side of \eqref{param3} converges uniformly in $t $ to $0$ almost surely as $n \rightarrow \infty$.\\ (v) If $ \delta $ is sufficiently small, the series \begin{equation*} \sum_{h=2}^n \int_0^T \int_u^T \, E [ \pi^\bot S_{s-u} S^{*(h-1)}_{T-s}f (X_u) | \mathcal{F}_{t \wedge \tau}] \,ds du \end{equation*} is absolutely convergent uniformly in $t $ almost surely as $ n \to \infty $, and \begin{equation*} \begin{split} E [ f (X_T) 1_{ \{ \tau > T \}} | \mathcal{F}_{t \wedge \tau} ] &= E [ \pi f (X_T) | \mathcal{F}_{t \wedge \tau} ] - \int_0^T \, E [ \pi^\bot S_{T-s} f(X_s) | \mathcal{F}_{t \wedge \tau}] \,ds \\&\qquad -\int_0^T \int_u^T \, \sum_{h=2}^\infty E [ \pi^\bot S_{s-u} S^{*(h-1)}_{T-s} f(X_u) | \mathcal{F}_{t \wedge \tau}] \,ds du. \end{split} \end{equation*} \end{Theorem} \begin{proof} See Appendix \ref{errorrep_Pr}. \qed\end{proof} Roughly speaking, the results (i)--(iii) are obtained by repeating the procedure we did for Theorem \ref{2ndexp}. To get the convergence result (iv) and (v) we need extra efforts. The right-hand-side of \eqref{param3} basically gives the error estimate as multiple integral like Taylor expansion case. If, let say, the integrand were bounded, the term would be dominated by $ (C^n)/n! $ for some constant $ C $ to ensure the convergence, but in our case, the naive integrability appearing all the time in this paper prevents from such a nice estimate. Instead we work on a more precise estimate, with a reduction to a determinantal equation in Lemma \ref{spacon} and the hyper-geometrical estimate in Lemma \ref{timcon}, in place of the standard exponential type estimate. In addition, a careful treatment of Gaussian type estimates is required to obtain (v). \section{Conclusion} \label{sec:conc} In the context of static hedge, the present paper introduces a methodology allowing to obtain asymptotic static hedge results for a fairly large class of multi-dimensional underlying assets' dynamics. From a financial point of view, we consider the problem of an investor who wants to hedge a portfolio of barrier options. The present paper extends the existing literature on static hedge by discussing the existence of asymptotic static hedging error and its convergence. Starting from the main results stated in \cite{FJY1}, the paper extends the asymptotic static hedge error construction to a more general mathematical setting. Both parametrix techniques and kernel symmetrization are considered to build in a systematic way the exact static hedging strategies of barrier options.
\section{Introduction} Modular curves, which are coarse moduli spaces for elliptic curves with prescribed level structure, appear in the study of Galois torsion structures on elliptic curves. A well-known example is Mazur's Theorem \cite{mazur} which states that there are no rational $\ell$-isogenies between rational elliptic curves if $\ell > 163$. This result is proven by showing the modular curve $X_0(\ell)$ has no non-cuspidal rational point if $\ell > 163$. Mazur's method is based on descent on the Jacobian of $X_0(\ell)$, but because of the rich arithmetic structure of these curves, the method is more powerful and efficient. Let $\ell$ be a prime, and $\z/\ell\z = \f_\ell$ be a finite field of cardinality $\ell$. For a subgroup $H$ of $\GL_2(\f_\ell)$ which contains $-1$, it is possible to associate a modular curve $X_H := X/H$. In the case when $H$ is a non-split Cartan subgroup $C'$ or its normalizer $N'$, it is relevant from the point of view of Mazur's method to understand the Jacobian of $X_H$. In \cite{chen-98}, it was proven using the trace formula that $X_{N'}$ and $X_{C'}$ are related by an isogeny over $\q$ to certain quotients of the Jacobian of the modular curves $X_0(\ell^2)$. Subsequently, a proof based on the representation theory of $\GL_2(\f_\ell)$ was given in \cite{edixhoven}. In \cite{merel}, it was conjectured that the above isogeny relation between the Jacobian of $X_{N'}$ and the Jacobian of $X_0(\ell^2)$ was given by a certain explicit correspondence. This was proven in \cite{chen} using the representation theory of $\GL_2(\f_\ell)$ and identities in finite double coset algebras. In this paper, we recall an alternative proof of Merel's conjecture, which does not require extensive representation theory, based on arguments given by B.\ Birch and D.\ Zagier \cite{zagier}. The proof can be formulated in terms of certain finite geometries over $\f_\ell$ and is largely elementary in its statement and proof, though some algebraic number theory is used. Secondly, we generalize these arguments to exhibit an explicit correspondence which gives the isogeny relation between the Jacobians associated to split and non-split Cartan subgroups. An interesting feature is that the required explicit correspondence is considerably more complicated but can be expressed as a certain linear combination of double coset operators whose coefficients we are able to make explicit. The precise statements of the theorems we prove are as follows. \begin{itemize} \item Let $\ell$ be an odd prime and $\epsilon$ a non-square in $\f_\ell^\times$. \item Let $G = \GL_2(\f_\ell)$. \item Let $\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta$ denote the set of ordered pairs $(a,b)$ of distinct points in $\Pr^1(\f_\ell)$. \item Let $(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) -\Delta)/\sim$, where $(a,b) \sim (b,a)$, denote the set of unordered pairs $\left\{a,b\right\}$ of distinct points in $\Pr^1(\f_\ell)$. \item Let $\C_\ell = \left\{ x + y \sqrt{\epsilon} : x \in \f_\ell, y \in \f_\ell^\times \right\}$. \item Let $\HH_\ell = \C_\ell/\sim$, where $x + y \sqrt{\epsilon} \sim x - y \sqrt{\epsilon}$. \item When $S$ is a set, we denote by $\q[S]$ the free $\q$-vector space generated by the set $S$. \item For convenience, we write column vectors in the form $(x,y)^t$ for instance. \end{itemize} Given an unordered pair $\left\{ a, b \right\}$ in $(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) -\Delta)/\sim$, we define in~\eqref{geodesic} a `geodesic' $\gamma_{\left\{a, b \right\}}$ in $\HH_\ell$ between $a$ and $b$. \begin{thm} \label{main-N} The map \begin{align*} \label{main-Neq}\psi^+ : \q[(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta)/\sim] & \rightarrow \q[\HH_\ell] \\ \notag \left\{ a,b \right\} & \mapsto \sum_{x \in \gamma_{\left\{a,b\right\}}} x \end{align*} is a surjective $\q[G]$-module homomorphism. \end{thm} Given an ordered pair $(a,b)$ in $\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta$ and a parameter $s \in \f_\ell^\times$, we define in~\eqref{path} a `path' $\gamma^s _{(a,b)}$ in $\C_\ell$ from $a$ to $b$. \begin{thm} \label{main-C} The map \begin{align*} \psi : \q[\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta] & \rightarrow \q[\C_\ell] \\ (a,b) & \mapsto \sum_{s=1}^{\ell-1}(\alpha_s + \beta_s) \sum_{x \in \gamma^s_{(a,b)}} x \end{align*} is a surjective $\q[G]$-module homomorphism, where $0 \le \alpha_s, \beta_s \le \ell-1$ are integers satisfying $\alpha_s \equiv 1\pod \ell$ and $\beta_s \equiv s^{-1} \pod \ell$ for $s \in \left\{ 1, \ldots, \ell-1 \right\}$. \end{thm} We explain in section~\ref{lastchapter} how Theorems~\ref{main-N} and \ref{main-C} imply relations between the Jacobians of $X_{N'}$ and $X_{C'}$ and quotients of the Jacobians of the more standard modular curve $X_0(\ell^2)$. \section*{Acknowledgments} We would like to thank B.\ Birch and D.\ Zagier for explaining to us their alternative proof of Merel's conjecture. \section{Double coset operators} \begin{lem} \label{doublecoset} Let $G$ be a group, $H$ and $K$ be subgroups of $G$, then \begin{align*} & HgK = \bigcup_{\alpha \in H/H \cap g K g^{-1}} \alpha g K, \end{align*} where the union is disjoint. We call $[H : H \cap g K g^{-1}]$ the degree of $HgK$. This is independent of the choice of $g$ in the sense that $deg(HgK)= deg(Hg'K)$ if $HgK=Hg'K$. \end{lem} \begin{defn} Let $G$ be a finite group with subgroups $H$ and $K$. Given a double coset $H g K$ and a decomposition into disjoint cosets \begin{equation*} H g K = \bigcup_{\alpha \in \Omega} \alpha g K, \end{equation*} we obtain a $\z[G]$-module homomorphism $\sigma = \sigma(H g K)$ given by \begin{align} \label{doublecoset-defn} \sigma : \z[G/H] & \rightarrow \z[G/K] \\ \notag x H & \mapsto \sum_{\alpha \in \Omega} x \alpha g K. \end{align} The $\z[G]$-module homomorphism $\sigma$ is called a double coset operator. \end{defn} Let $C$ (resp.\ $C'$) be the split (resp.\ non-split) Cartan subgroup of $G$ given respectively by \begin{align*} & C= \left\{ \begin{pmatrix} \eta & 0 \\ 0 & \beta \end{pmatrix} : \eta , \beta \in \f_\ell ^{\times} \right\}, \\ & C' = \left\{ \begin{pmatrix} x & \epsilon y \\ y & x \end{pmatrix} : (x, y) \neq (0, 0), x, y \in \f_\ell \right\}. \end{align*} Let $N$ (resp.\ $N'$) be the normalizer in $G$ of $C$ (resp. $C'$) which is given respectively by \begin{align*} & N= \left\{ \begin{pmatrix} \eta & 0 \\ 0 & \beta \end{pmatrix}, \begin{pmatrix} 0 & \eta \\ \beta & 0 \end{pmatrix} : \eta , \beta \in \f_\ell ^{\times} \right\}, \\ & N' = \left\{ \begin{pmatrix} x & \epsilon y \\ y & x \end{pmatrix}, \begin{pmatrix} x & - \epsilon y \\ y & - x \end{pmatrix} : (x, y) \neq (0, 0), x, y \in \f_\ell \right\}. \end{align*} \begin{lem} \label{doublecosetoperatorN} The double coset operator $NN': \Z[G/N] \rightarrow \Z[G/N']$ coincides with the map $\psi^+:\Z[(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta)/\sim] \rightarrow \Z[\HH_\ell]$ in~\eqref{geodesic} and is hence a $\z[G]$-module homomorphism. \end{lem} \begin{proof} Since \begin{equation*} N \cap N' = \left\{ \begin{pmatrix} \alpha & 0 \\ 0 & \pm \alpha \end{pmatrix} : \alpha \in \f_\ell^\times \right\} \cup \left\{ \begin{pmatrix} 0 & \pm \epsilon \alpha \\ \alpha & 0 \end{pmatrix} : \alpha \in \f_\ell^\times \right\}, \end{equation*} we have from Lemma~\ref{doublecoset} that \begin{equation*} N N' = \cup_{\alpha \in \f_\ell^\times/\left\{ \pm 1 \right\}} \begin{pmatrix} \alpha & 0 \\ 0 & 1 \end{pmatrix} N'. \end{equation*} The $\z[G]$-module homomorphism from $\z[G/N] \rightarrow \z[G/N']$ induced by $NN'$ from \eqref{doublecoset-defn} is then seen to be the map $\psi^+$. \end{proof} \begin{lem} \label{doublecosetoperatorC} The double coset operator $C \begin{pmatrix} 1 & s \\ 0 & 1 \end{pmatrix} C':\Z[G/C] \rightarrow \Z[G/C']$ coincides with the map $H_s:\Z[\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta] \rightarrow \Z[\C_\ell]$ in~\eqref{path} and is hence a $\z[G]$-module homomorphism. \end{lem} \begin{proof} For $g = \begin{pmatrix} 1 & s \\ 0 & 1 \end{pmatrix}$, we have that \begin{equation*} C \cap g C' g^{-1} = \left\{ \begin{pmatrix} \alpha & 0 \\ 0 & \alpha \end{pmatrix} : \alpha \in \f_\ell^\times \right\}. \end{equation*} Thus, from Lemma~\ref{doublecoset}, we have that \begin{equation*} C \begin{pmatrix} 1 & s \\ 0 & 1 \end{pmatrix} C' = \cup_{\alpha \in \f_\ell^\times} \begin{pmatrix} \alpha & \alpha s \\ 0 & 1 \end{pmatrix} C'. \end{equation*} The $\z[G]$-module homomorphism from $\z[G/C] \rightarrow \z[G/C']$ induced by $CC'$ from \eqref{doublecoset-defn} is then seen to be the map $H_s$. \end{proof} \section{Normalizer of Cartan subgroup case} \label{sectionN} In this section, we explain and give a detailed proof of Merel's conjecture for normalizers of Cartan subgroups using methods in \cite{zagier}. In this situation, the conjectural explicit intertwining operator is given by a single double coset operator. Define $\gamma_{\left\{ 0,\infty \right\}} := \f_\ell^\times \sqrt{\epsilon} \subseteq \HH_\ell$, which can be thought of as the geodesic in $\HH_\ell$ between $0$ and $\infty$. Given an unordered pair $\left\{ a,b \right\}$, there is a $g \in G$ such that $\left\{ a , b \right\} = \left\{ g(0), g(\infty) \right\}$, which is unique up to multiplication on the left by $N$. Thus, we may define \begin{equation} \label{geodesic} \gamma_{\left\{a, b\right\}} := g(\gamma_{\left\{0,\infty\right\}}), \end{equation} which can be thought of as the geodesic in $\HH_\ell$ between $a$ and $b$. \begin{lem} \label{g-matrix} A choice for the element $g$ above is given by $$\begin{pmatrix} b & a \\ 1 & 1 \end{pmatrix}.$$ \end{lem} \begin{proof} The point at infinity $\infty$ is denoted by $(1,0)^{t}$ and the point 0 by $(0,1)^{t}$. We require a matrix $g$ such that $g \cdot 0 = (a,1)^{t}$ and $g \cdot \infty = (b,1)^{t}$, which is given by the above matrix. \end{proof} The finite field $\f_{\ell^2}$ is a vector space over $\f_\ell$ of dimension $2$. The basis $\left\{ 1, \sqrt{\epsilon} \right\}$ gives us an identification $\f_{\ell^2} \cong \f_\ell + \sqrt{\epsilon} \f_\ell$. Thus, for every $z \in \f_{\ell^2}$, we can write $z = x+ \sqrt{\epsilon} y$ for some $x, y \in \f_\ell$. \begin{lem} \label{geodesicircle} The quadratic equation \begin{equation} \label{equN} \left( x - \frac{a+b}{2} \right)^2 - \epsilon y^2 = \left(\frac{b - a}{2}\right)^2. \end{equation} gives the geodesic $\gamma_{\left\{a,b\right\}}$ with coordinates(see Figure~\ref{m2}) \begin{align*} & x =\frac{a- \epsilon \lambda^2 b}{1-\epsilon \lambda^2},\\ & y= \lambda \left( \frac{a-b}{1-\epsilon \lambda^2} \right). \end{align*} \end{lem} \begin{figure} \centering \begin{tikzpicture}[domain=-4:4] \draw[->] (-4,0 ) -- (4,0) node[right] {$\f_\ell$}; \draw[->] (0,-3.75) -- (0,3.75) node[above] {$\f_\ell \sqrt\epsilon$}; \draw(1,0) circle (2cm) node [black,below left]{$O$}; \coordinate (O) at (1,0); \def\radius{2cm} \draw (O) circle[radius=\radius]; \fill (O) circle[radius=2pt] node[below left] {O}; \coordinate (a) at (-1,0); \fill (a) circle[radius=2pt] node[below left] {$a$}; \coordinate (b) at (3,0); \fill (b) circle[radius=2pt] node[below right] {$b$}; \draw(1,2) node[above]{$\gamma_{\left\{a,b\right\}}$}; \end{tikzpicture} \caption{ The geodesic $\gamma_{\left\{a,b\right\}}$ in $\HH_\ell$} \label{m2} \end{figure} \begin{proof} Writing $g(\lambda\sqrt\epsilon,1)^{t}$ as a fraction and then rationalizing it, we obtain: \begin{align*} & \frac{b\lambda \sqrt\epsilon+a}{\lambda \sqrt\epsilon+1} = \frac{a-b\lambda^2 \epsilon}{1-\epsilon \lambda^2}+\sqrt\epsilon \frac{\lambda(b-a)}{1-\epsilon \lambda^2}. \end{align*} Therefore, as $\gamma_{\left\{a,b\right\}} \in \f_{\ell^2}^{\times}$ we conclude $x,y$ from the above expression are given by (see Figure~\ref{m2}) \begin{align*} & x =\frac{a- \epsilon \lambda^2 b}{1-\epsilon \lambda^2},\\ & y= \lambda \left( \frac{a-b}{1-\epsilon \lambda^2} \right). \end{align*} \end{proof} \subsection{Coordinates for $G/N$ and $G/N'$}~\\ We need a more convenient coordinate to represent elements in (a certain subset of) $(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta)/\sim$ and $\HH_\ell$, where $(\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) -\Delta)/\sim$ is in bijection with $G/N$, and $\HH_\ell$ is in bijection with $G/N'$. \begin{lem} \label{bijectN} Let $A_+ = (\f_\ell \times \f_\ell - \Delta)/\sim$ and $B_+ = \left\{(t, n): t^2 - 4n \neq 0 \text{ is a square in } \f_\ell \right\}$. Then there is a bijection between the sets $A_+$ and $B_+$ given by \begin{align*} \left\{a, b \right\} \mapsto (a+b,ab). \end{align*} \end{lem} \begin{proof} The inverse map is given by $(t,n) \mapsto \left\{ a,b \right\}$, where $\left\{ a, b \right\}$ is the set of roots in $\f_\ell$ of the polynomial $x^2 - t x + n$. \end{proof} \begin{lem} \label{bijectNp} Let $A'_+ = \HH_\ell$ and $B'_+ = \left\{ (T,N) : T^2 - 4 N \text{ is a non-square in } \f_\ell \right\}$. Then there is a bijection between the sets $A'_+$ and $B'_+$ given by \begin{align*} \left\{z, \bar z\right\} \mapsto (z + \bar z, z\bar z). \end{align*} \end{lem} \begin{proof} The inverse map is given by $(T,N) \mapsto \left\{ z, \bar z \right\}$, where $\left\{ z, \bar z \right\}$ is the set of roots in $\HH_\ell$ of the polynomial $x^2 - T x + N$. \end{proof} \begin{lem} \label{lemm} Let \begin{align*} & B_+ =\left\{(t,n):t^2 - 4n \neq 0 \text{ is a square in } \f_\ell \right\},\\ & S_+ = \left\{(t, m):m \text{ is a square in } \f_\ell\right\}. \end{align*} Then there is a bijection between the sets $B_+$ and $S_+$ given by: \begin{align*} & (t,n) \mapsto (t, m), \end{align*} where $m= t^2 - 4n$. \end{lem} \begin{proof} The inverse map is given by $(t,m) \mapsto (t, \frac{t^2 - m}{4})$. \end{proof} \begin{lem} \label{lemM} Let \begin{align*} & B'_+ = \left\{(T,N):T^2 - 4N \text{ is a non-square in }\f_\ell \right\}, \\ & S'_+ = \left\{(T,M): M \text{ is a non-square in }\f_\ell \right\}. \end{align*} Then there is a bijection between the sets $B'_+$ and $S'_+$ given by: \begin{align*} & (T,N) \mapsto (T,M), \end{align*} where $M = T^2 - 4N$. \end{lem} \begin{proof} The inverse map is given by $(T,M) \mapsto (T, \frac{T^2 - M}{4})$. \end{proof} \subsection{Proof of Theorem~\ref{main-N}}~\\ By Lemma~\ref{doublecosetoperatorN}, $\psi^+$ is a $\q[G]$-module homomorphism. To prove Theorem~\ref{main-N}, it suffices to prove that the restriction \begin{equation} \label{equationmain} \psi^+_{\mid_{\q[A_+]}} : \q[A_+] \rightarrow \q[\HH_\ell], \end{equation} is an isomorphism of $\q$-vector spaces. Using the bijections given by Lemmas~\ref{bijectN}-\ref{lemM}, to prove ~\eqref{equationmain} is equivalent to proving that \begin{equation*} \psi^+: \q[S_+] \rightarrow \q[S'_+], \end{equation*} is an isomorphism of $\q$-vector spaces, where $\psi^{+}$ is the same map as $\psi^{+}_{\mid_{\q[A]}}$ under the identifications given by two bijections $A_+ \leftrightarrow S_+$ and $\HH_\ell \leftrightarrow S'_+$. Recall the equation giving the geodesic between $a$ and $b$ is \begin{equation*} \left( x - \frac{a+b}{2} \right)^2 - \epsilon y^2 = \left(\frac{b-a}{2}\right)^2, \end{equation*} by Lemma~\ref{geodesicircle}. This equation becomes \begin{align*} & \left( x - \frac{a+b}{2} \right)^2 - \epsilon y^2 = \left(\frac{b-a}{2}\right)^2 \\ \iff & (T-t)^2 = l^2 + 4\epsilon y^2 = m+M, \end{align*} in the new coordinates from Lemmas \ref{lemm} and \ref{lemM}. Here, $m$ and $M$ satisfy $(\frac{m}{\ell})=1$ and $(\frac{M}{\ell})= -1$, where $(\frac{\cdot}{\ell})$ is the Legendre symbol modulo $\ell$. Hence, the matrix of $\psi^+_{\mid \q[S_+]}$ with respect to the basis $S_+$ is given by \begin{equation} a_{(T,M),(t,m)} = \begin{cases} 1 & \text{ if } (T-t)^2 \equiv m+M \pod{\ell} ,\\ 0 & \text{otherwise}. \end{cases} \end{equation} Thus, the above matrix is an $\frac{\ell-1}{2} \times \frac{\ell-1}{2}$ matrix $D_{m,M}$, with entries being the $\ell \times \ell$ matrices given by \begin{align*} (D_{m,M})_{t,T} := \begin{cases} 1 & \text{ if } (T-t)^2 \equiv m+M \pod{\ell}, \\ 0 & \text{otherwise}. \end{cases} \end{align*} Let $D$ be the matrix obtained from the $\ell \times \ell$ identity matrix by permuting its columns according to the cycle $(1\,2\,3...\,\ell)$. \begin{defn} A circulant matrix is a matrix of the form \begin{equation*} \begin{pmatrix} a_0 & a_1 & a_2 & ... & a_{r-1} \\ a_{r-1} & a_0 & a_1 & ... & a_{r-2} \\ \vdots & & & & \vdots \\ a_{1} & a_{2} & ... & a_{r-1} & a_0 \end{pmatrix}, \end{equation*} that is, a matrix whose $i$-th row is obtained from the $(i-1)$-th row by cyclically shifting the entries one position to the right. \end{defn} \begin{lem} $D_{m,M} = \sum_{x^2 \equiv m+M (\ell)} D^x$ \end{lem} \begin{proof} If $m + M$ is not a square in $\f_\ell$, therefore $D_{m,M}$ is a zero matrix due to 0 entries, so $D_{m,M}= \sum _{x^2 \equiv m + M (\ell)} D^x = 0$. If $m + M = x^2$ is a square in $\f_\ell$. Then $T-t = \pm x$ and \begin{equation*} (D_{m,M})_{t,T} = \begin{cases} 1 & T = t \pm x ,\\ 0 & \text{otherwise}. \end{cases} \end{equation*} In this case, $D_{m,M}$ coincides with $\sum_{x^2 \equiv m+M \pod\ell} D^x$. \end{proof} Let $\zeta$ be an $\ell$-th root of unity. The matrix $D_{m,M}$ has entries in $\q[D]$, but we can replace the matrix $D$ by an element in the cyclotomic field $\q(\zeta)$ in the following manner: the minimal polynomial of $D$ over $\q$ is given by $m(x) = x^{\ell-1}+\cdots+x+1$, so we have that \begin{align*} & \q[D] \cong \frac{\q[x]}{(m(x))} \cong \q[\zeta] \cong \q(\zeta), \end{align*} where $\zeta$ is a primitive $\ell$-th root of unity. \begin{lem} \label{ramified} Let $\mathfrak{L}$ be a prime of $\q(\zeta)$ above $\ell$. Then $\zeta \equiv 1 \pod{\mathfrak{L}}$. \end{lem} \begin{proof} \cite[lemma 10.1]{Neukirch}. \end{proof} From the above discussion, we see that $D_{m,M} = \sum_{x^2 \equiv m +M(\ell)} 1$ (after reduction modulo $\mathfrak{L}$). We label $m,M$ as $m=g^{2i}$ for $0 \le i \le r-1$ and $M = \epsilon g^{2j}$ for $0 \le j \le r-1$, where $r=\frac{\ell-1}{2}$ and $g$ is a primitive root modulo $\ell$. This gives us a new matrix denoted by $D_{i,j}$: \begin{equation} \label{circulant} D_{i,j} = \sum_{x^2 \equiv g^{2i} + \epsilon g^{2j} \pod{\ell} } 1. \end{equation} \begin{prop} \label{determinantofcirculant} The determinant of a circulant matrix is given by \begin{equation} \label{circulantM} \prod_{k=0}^{r-1} (a_0 + a_1 \omega_k + a_2 \omega_k^2 + ... + a_{r-1} \omega_k^{r-1}) = \prod_{k=0} ^{r-1} \left(\sum_{j=0} ^{r-1} a_j \omega_k ^{j}\right), \end{equation} where $\omega_k = e^{\frac{2\pi i k}{r}} = \omega^k, r \ge 1$ and $\omega = e^{\frac{2\pi i}{r}}$. \end{prop} \begin{proof} Suppose \begin{equation*} A = \begin{pmatrix} a_0 & a_1 & a_2 & ... & a_{r-1} \\ a_{r-1} & a_0 & a_1 & ... & a_{r-2} \\ \vdots & \vdots & & & \vdots \\ a_{1} & a_{2} & a_3 & ... & a_0 \end{pmatrix}, \end{equation*} is a circulant matrix. Let $\omega_{k} = e^{2\pi i k/r}$ for $0 \le k \le r-1$. Now, consider the row vector $(1, \omega_k, \omega_k ^2, ..., \omega_k ^{r-1})$, whose transpose we denote by $\gamma_{k} \in \mathbb{C}^r$, and let $\sigma_{k} = a_0 + a_1 \omega_{k} + a_2 \omega_k ^2 + ... + a_{r-1} \omega_k ^{r-1}$. Then we get that \begin{equation*} \begin{pmatrix} a_0 & a_1 & ... & a_{r-1} \\ a_{r-1} & a_0 & ... & a_{r-2} \\ \vdots \\ a_1 & a_2 & ... & a_0 \end{pmatrix} \begin{pmatrix} 1 \\ \omega_k \\ \vdots \\ \omega_k ^{r-1} \end{pmatrix} = \sigma_k \begin{pmatrix} 1 \\ \omega_k \\ \vdots \\ \omega_k ^{r-1} \end{pmatrix}, \end{equation*} which implies that $\sigma_k$ is an eigenvalue of $A$ with eigenvector $\gamma_k$. Furthermore, the set $\left\{\gamma_0, \gamma_1, ..., \gamma_{r-1} \right\}$ is a linearly independent set in $\mathbb{C}^{r}$, since the eigenvalues $\sigma_{k}$ are distinct. Therefore, a diagonal matrix with the corresponding eigenvalues is conjugate to $A$, and hence the determinant of $A$ is given by $\text{det}(A) = \prod_{k=0} ^{r-1} \sigma_k$. \end{proof} For later reference, we call each factor in the above formula \textit{an eigenvalue} for $k$. We also let $r = \frac{\ell - 1}{2}$ in this section. \begin{lem} \label{equationmatrix} The matrix $D_{i,j}$ is an $r \times r$ circulant matrix. \end{lem} \begin{proof} This follows because \begin{equation*} D_{i,j} = \sum_{x^2 \equiv g^{2i} + \epsilon g^{2j}} 1 \equiv \sum_{x^2 \equiv g^2(g^{2(i-1)} +\epsilon g^{2(j-1)})} 1 = D_{i-1, j-1}, \end{equation*} where the indices are taken modulo $\ell$. \end{proof} Remark that $D_{0,j} = a_j$ is equal to the number of solutions of $x^2 \equiv 1 + \epsilon g^{2j} \pod \ell$. To show that $D_{i,j}$ has non-zero determinant, it suffices to show that $D_{i,j}$ has non-zero determinant modulo $\ell$ in ~\eqref{circulantM}. Using the above formula for the determinant of a circulant matrix, it suffices to show in $\z[\omega]$ that we have \begin{equation} \label{nonzerow} a_0 + a_1 \omega_k +a_2 \omega_k^2 + ... + a_{r-1} \omega_k^{r-1} \not\equiv 0 (\vartheta) \end{equation} for every $0 \le k \le r-1$, where $\vartheta$ is any prime above $\ell$ in $\z[\omega]$, $\omega_k = \omega^k$ and $\omega = e^{2\pi i/r}$. \begin{lem} Let $\vartheta$ be a prime above $\ell$ in $\z[\omega]$ where $\omega = e^{2\pi i/r}$. Then $\omega \equiv g^2 (\vartheta)$, where $g$ is a primitive root modulo $\ell$. \end{lem} \begin{proof} Let $\mathcal{O} = \z[\omega]$ be the maximal order of $\q(\omega)$. The residue field of $\vartheta$ is $\mathcal{O}/\vartheta \cong \f_\ell$. Furthermore, since the polynomial $x^r - 1$ splits in $\mathcal{O}/\vartheta[x] \cong \f_\ell[x]$ with distinct roots $\omega_1 = \omega, \omega_2 = \omega^2, \ldots, \omega_r = \omega^r = 1$, we have that every root of $x^r-1$ in $\f_\ell$ is a power of $\omega \in \mathcal{O}/\vartheta \cong \f_\ell$. Hence, $\omega \cong g^2 \pod{\vartheta}$ for some primitive root $g$ modulo $\ell$. \end{proof} By the above lemma, to show \eqref{nonzerow}, it suffices to show \begin{lem} \begin{equation*} \sum _{j=0} ^{r-1} a_j (g^{2k})^j \not\equiv 0 (\ell), \end{equation*} for every $0 \le j, k \le r-1$. \end{lem} \begin{proof} The above sum can be calculated as: \begin{align} & \sum_{j=0} ^{r-1} D_{0,j} (g^{2k})^j \equiv \sum _{j=0} ^{r-1} a_j (g^{2k})^j \equiv \sum_{j=0}^{r-1} \left( \sum_{x^2 \equiv 1 + \epsilon g^{2j} \pod \ell} 1 \right) (g^{2j})^k \notag\\ \equiv & \sum_{\substack{j=0,...,r-1\\ x=0,...,\ell-1 \\ x^2 \equiv 1 + \epsilon g^{2j} \pod \ell}} (g^{2j})^k \equiv 2 \sum_{\substack{x=0,...,\ell-1\\ y = 1,\ldots,\ell-1 \\ x^2 \equiv 1 + \epsilon y^{2}\pod \ell}} \left(\frac{x^2 - 1}{\epsilon} \right)^k \label{nonzero}. \end{align} Now, we need to show that \eqref{nonzero} is non-zero modulo $\ell$ for every $0 \le k \le r-1$. We can rewrite $(\frac{x^2 - 1}{\epsilon})$ as $y^2$ since $y=g^j$ for $0 \le j \le r-1$. The conic $x^2 \equiv 1 + \epsilon y^2 \pod \ell$ is parametrized by $x= \frac{a - \epsilon \lambda^2 b}{1 - \epsilon\lambda^2}, y= \frac{\lambda(a-b)}{1- \epsilon \lambda^2}$ from \eqref{equN}. Here, we compute $D_{i,j}$ for $i=0$ which corresponds to $m=1=(a-b)^2$. Thus, we can rewrite \eqref{nonzero} as \begin{align*} \sum_{\lambda =1} ^{\ell -1} \left(\frac{\lambda}{1- \epsilon \lambda^2} \right) ^{2k} \equiv \sum_{\lambda = 1} ^{\ell -1} (\lambda^{-1} - \epsilon \lambda)^{-2k} \equiv \sum_{\lambda =1} ^{\ell -1} (\lambda^{-1} - \epsilon \lambda)^{2k'}, \end{align*} where $-2k' \equiv 2k \pod{\ell -1} $ and $0 \le 2k' \le \ell - 2$, hence $0 \le k' \le \frac{\ell -3}{2}$. Here, we have to consider two cases. The first case is $k \ge 1$. The sum of all terms except the constant terms will be zero modulo $\ell$. Therefore, we just have to compute the sum of the constant terms which is \begin{align} \label{equationsum} \sum_{\lambda = 1} ^{\ell - 1} \frac{(2k')!}{k'! k'!} (-1)^{k'} \epsilon ^{k'} \equiv \frac{(2k')!}{k'! k'!} (-1)^{k'+1} \epsilon^{k'} \pod{\ell}, \end{align} which is non-zero modulo $\ell$, since $2k' < \ell$ for all values of $k'$, hence none of the terms of ~\eqref{equationsum} is a multiple of $\ell$, therefore it is non-zero modulo $\ell$. The second case is when $k=0$, then the sum in \eqref{equationsum} becomes $\sum_{\lambda=1} ^{\ell -1} 1 \equiv -1 \not\equiv 0 \pod\ell$. \end{proof} This concludes the proof of Theorem ~\ref{main-N}. \section{Cartan subgroup case} In this section, we generalize Merel's conjecture to Cartan subgroups and give a proof by generalizing the methods in Section~\ref{sectionN}. A new feature is that the conjectural explicit intertwining operator is now a linear combination of double coset operators (rather than a single double coset operator) whose coefficients we are able to make explicit. Define $\gamma_{(0, \infty)} := \f_{\ell} ^{\times} \sqrt{\epsilon} \subseteq \C_{\ell}$, which can be thought of as a path in $\C_{\ell}$ from $0$ to $\infty$. Given an ordered pair $(a, b)$, there is a $g \in G$ such that $(a, b) = (g(0), g(\infty) )$, which is unique up to multiplication on the left by $C$. Thus, we may define $\gamma_{(a, b)} := g(\gamma_{(0, \infty)})$, which can be thought as a path in $\C_{\ell}$ from $a$ to $b$ (see Figure~\ref{m3}). Here, for each $s=1, \ldots, \ell-1$, we define the linear operator $H_s$ by: \begin{align} \label{main-Ceq} H_s : \q[\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta] \longrightarrow \q[\C_\ell]&\\ \notag (a, b)\longmapsto \sum_{x \in \gamma^{s}_{(a,b)}} x. \end{align} \begin{defn} Define $\gamma^s _{(0, \infty)}$ to be $\left\{(\lambda s + \lambda \sqrt{\epsilon}, 1)^{t}: \lambda \in \f_\ell^{\times}, s\in \f_\ell^{\times} \right\} \subseteq \C_\ell$. This is a path in $\C_\ell$ which is a line with slope $s$. \end{defn} By Lemma~\ref{g-matrix}, we know that $g = \begin{pmatrix} b & a \\ 1 & 1 \end{pmatrix}$, hence the path in $\C_\ell$ from $a$ to $b$ can be obtained as \begin{equation} \label{path} \gamma_{(a,b)}^{s} = g(\gamma_{(0,\infty)}^s) = g(\lambda s + \lambda \sqrt{\epsilon}, 1)^{t} = (bs \lambda + b \lambda \sqrt{\epsilon}+a, \lambda s + \lambda \sqrt{\epsilon}+1)^{t}, \end{equation} which is represented by an equation defined by the next lemma. \begin{lem} \label{pathlem} The quadratic equation \begin{equation} \label{equM} \left(x - \frac{a+b}{2} \right)^2 - \epsilon \left(y - \frac{s(b-a)}{2\epsilon} \right)^2 = \frac{(\epsilon - s^2)(a - b)^2 }{4 \epsilon} \end{equation} gives the path $\gamma^s_{(a, b)}$ with coordinates (see Figure~\ref{m3}) \begin{align*} & x= \frac{(b \lambda s + a)(\lambda s + 1) - b \lambda^2 \epsilon}{(\lambda s + 1)^2 - \lambda ^2 \epsilon},\\ & y = \frac{\lambda (b-a)}{(\lambda s + 1)^2 - \lambda ^2 \epsilon }. \end{align*} \end{lem} \begin{figure} \centering \begin{tikzpicture}[domain=-6:6] \draw[->] (-5,0 ) -- (6,0) node[right] {$\f_\ell$}; \draw[->] (0,-3.5) -- (0,4) node[above] {$\f_\ell \sqrt\epsilon$}; \draw(3,1) circle (2cm) node [black,below left]{$O$}; \coordinate (O) at (3,1); \def\radius{2cm} \draw (O) circle[radius=\radius]; \fill (O) circle[radius=2pt] node[below left] {O}; \coordinate (a) at (1.3,0); \fill (a) circle[radius=2pt] node[below left] {$a$}; \coordinate (b) at (4.7,0); \fill (b) circle[radius=2pt] node[below right] {$b$}; \draw(3,3) node[above]{$\gamma_{\left(a,b\right)}$}; \end{tikzpicture} \caption{The path $\gamma_{\left(a,b\right)}$ in $\C_\ell$} \label{m3} \end{figure} \begin{proof} Writing $g (\lambda s + \lambda \sqrt{\epsilon}, 1)^{t}$ as a fraction and then rationalizing it, we obtain: \begin{align*} \frac{(b \lambda s + a) + b \lambda \sqrt{\epsilon}}{(\lambda s+ 1) + \lambda \sqrt{\epsilon}} = \frac{(b \lambda s + a)(\lambda s + 1) - b \lambda ^2 \epsilon}{(\lambda s + 1)^2 - \lambda ^2 \epsilon} + \sqrt{\epsilon}\frac{\lambda (b -a)}{(\lambda s + 1)^2 - \lambda ^2 \epsilon}. \end{align*} Therefore, as $\gamma_{(a, b)}^s \in \f_{\ell^2}^{\times}$ we conclude $x, y$ from the above expression are given by (see Figure~\ref{m3}) \begin{align*} &x = \frac{(b \lambda s + a)(\lambda s + 1) - b \lambda ^2 \epsilon}{(\lambda s + 1)^2 - \lambda ^2 \epsilon}, \\ &y = \frac{\lambda (b -a)}{(\lambda s + 1)^2 - \lambda ^2 \epsilon}. \end{align*} \end{proof} \subsection{Coordinates for $G/C$ and $G/C'$}~\\ We need more convenient coordinates to represent elements in (a certain subset of) $\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta$ and $\C_\ell$, where $\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta$ is in bijection with $G/C$ and $\C_\ell$ is in bijection with $G/C'$. \begin{lem} \label{lemt'} Let $A = \f_\ell \times \f_\ell - \Delta$ and $S= \left\{(t, t'): t' \neq 0 \right\}$. Then there is a bijection between the sets $A$ and $S$ given by: \begin{align*} & (a, b) \mapsto (a+b, a-b). \end{align*} \end{lem} \begin{proof} The inverse map is given by $a= \frac{x+y}{2}$ and $b=\frac{x-y}{2}$. \end{proof} \begin{lem} \label{lemT'} Let $A'= \C_\ell $ and $S'= \left\{(T, T'): T' \neq 0 \right\}$. Then there is a bijection between the sets $A'$ and $S'$ given by: \begin{align*} & (z, \bar z) \mapsto (z+\bar z, z - \bar z). \end{align*} \end{lem} \begin{proof} The inverse map is given by $z= \frac{z+ \bar z}{2} + \sqrt\epsilon \frac{z - \bar z}{2}$ and $\bar z = \frac{z + \bar z}{2} -\sqrt\epsilon \frac{z - \bar z}{2}$. \end{proof} \subsection{Proof of Theorem~\ref{main-C}}~\\ By Lemma~\ref{doublecosetoperatorC}, $\psi$ is a $\q[G]$-module homomorphism. To prove Theorem~\ref{main-C}, it suffices to prove that the restriction \begin{equation} \label{theorem2} \psi_{\mid \q[A]} : \q[A] \rightarrow \q[\C_\ell], \end{equation} is an isomorphism of $\q$-vector spaces. Using the bijections given by Lemma~\ref{lemt'} and Lemma~\ref{lemT'}, to prove \eqref{theorem2} is equivalent to proving that \begin{equation*} \psi: \q[S] \rightarrow \q[S'], \end{equation*} is an isomorphism of $\q$-vector spaces, where $\psi$ is the same map as $\psi_{\mid{\q[A]}}$ under identifications given by two bijections $A \leftrightarrow S$ and $\C_\ell \leftrightarrow S'$. Recall the equation giving the path $\gamma^s_{(a,b)}$ from $a$ to $b$ is \begin{equation*} \left(x - \frac{a+b}{2} \right)^2 - \epsilon \left(y - \frac{s(b-a)}{2\epsilon} \right)^2 = \frac{(\epsilon - s^2)(a-b)^2}{4 \epsilon}, \end{equation*} by Lemma \ref{pathlem}. By the bijections $P \leftrightarrow E$ and $P' \leftrightarrow E'$, this equation becomes \begin{align} \notag & \left(x - \frac{a+b}{2} \right)^2 - \epsilon \left(y - \frac{s(b-a)}{2\epsilon} \right)^2 = \frac{(\epsilon - s^2)(a-b)^2}{4 \epsilon} \\ \label{newquad} \iff & (T-t)^2 = (a-b)^2 + 4\epsilon y^2 + 4sy(b-a), \end{align} in the new coordinates from Lemma~\ref{lemt'} and Lemma~\ref{lemT'}. Hence, the matrix of $H_s$ restricted to $\q[S]$ with respect to the basis $S$ is given by \begin{equation} a_{(t,t'),(T,T')}(s) = \begin{cases} 1 & \text{ if } (T-t)^2\equiv t'^2 + 4 \epsilon T'^2 + 4sT't' \pod \ell ,\\ 0 & \text{ otherwise}. \end{cases} \end{equation} The above matrix is an $(\ell-1) \times (\ell-1)$ matrix $X_{t',T'}(s)$, with entries being the $\ell\times \ell$ matrices $(X_{t',T'})_{t,T}$(s) given by \begin{equation*} (X_{t',T'})_{t,T}(s) = \begin{cases} 1 & \text{ if } (T-t)^2\equiv t'^2 + 4 \epsilon T'^2 + 4sT't' \pod \ell ,\\ 0 & \text{ otherwise}.\end{cases} \end{equation*} Let $X$ be the matrix which permutes columns of the $\ell \times \ell$ identity matrix according to the cycle $(1\,2\, 3\cdots \ell)$. \begin{lem} $X_{t',T'} (s) = \sum_{v^2 \equiv t'^2 + 4 \epsilon T'^2 + 4sT't' \pod \ell} X^v$. \end{lem} \begin{proof} If $t'^2 + 4 \epsilon T'^2 + 4sT't'$ is not square in $\f_\ell$, then $X_{t,T}(s)$ is a zero matrix due to $0$ entries. Therefore, $X_{t,T}(s) = \sum_{v^2 \equiv t'^2 + 4 \epsilon T'^2 + 4sT't' \pod \ell} X^v = 0$. If $t'^2 + 4 \epsilon T'^2 + 4sT't'=v^2$ is a square in $\f_\ell$, then $T - t=\pm v$ and \begin{align*} (X_{t',T'})_{t,T}(s) = \begin{cases} 1 \quad T = t \pm v ,\\ 0 \quad \text{otherwise}. \end{cases} \end{align*} In this case, $X_{t',T'}(s)$ coincides with $\sum_{v^2 \equiv t'^2+4\epsilon T'^2+4sT't' \pod\ell} X^v$. \end{proof} Arguing similarly as in the discussion preceeding Lemma~\ref{ramified}, we obtain that $X_{t',T'}(s) = \sum_{v^2 \equiv t'^2 + 4 \epsilon T'^2 + 4sT't' \pod \ell} 1$. We label $t', T'$ as $t' = g^i$ and $T'= g^j$ for $0 \le i, j \le \ell -1$, and $(T-t)^2 = v^2$. This gives us a new matrix denoted by $X_{i,j}(s)$ which is given by \begin{equation*} X_{i,j}(s) =\sum_{v^2 \equiv g^{2i} + 4 \epsilon g^{2j} - 4s g^{i+j}\pod\ell} 1 \pod{\ell}. \end{equation*} \begin{lem} \label{lemma29} The matrix $X_{i,j}(s)$ is a $(\ell - 1) \times (\ell -1)$ circulant matrix. \end{lem} \begin{proof} This follows since \begin{align*} & X_{i,j}(s) \equiv \sum_{v^2 \equiv g^{2i}+4\epsilon g^{2j}-4sg^{i+j}\pod \ell} 1 \equiv \sum_{v ^2 \equiv g^2(g^{2(i-1)}+4\epsilon g^{2(j-1)}-4sg^{i+j -2})\pod\ell} 1 \equiv X_{i-1,j-1}(s) \pod\ell, \end{align*} where the indices are taken modulo $\ell$. Remark, $X_{0, j}(s)= a_j(s)$ is equal to the number of solutions of $v^2 \equiv 1 + 4 \epsilon g^{2j} - 4sg^j \pod \ell$. \end{proof} Let $a_j(s) = X_{0,j}(s)=c_j$, and $\omega = e^{\frac{2 \pi i}{\ell - 1}}$. \begin{lem} Let $\vartheta$ be a prime above $\ell$ in $\Z[\omega]$ where $\omega = e^{\frac{2\pi i}{\ell-1}}$. Then $\omega \equiv g \pod \vartheta$, where $g$ is a primitive root modulo $\ell$. \end{lem} \begin{proof} Let $\mathcal{O}= \z[\omega]$ be the maximal order of $\q(\omega)$. The residue field of $\vartheta$ is $\mathcal{O}/\vartheta \cong \f_\ell$ by \cite[Proposition 10.3]{Neukirch}. Furthermore, since the polynomial $x^{\ell -1} - 1$ splits in $\mathcal{O}/\vartheta[x] \cong \f_\ell[x]$ with distinct roots $\omega_1=\omega, \omega_2=\omega^2, \cdots,\omega_{\ell-1}=\omega^{\ell-1} = 1$, we have that every root of $x^{\ell-1}-1$ in $\f_\ell$ is a power of $\omega \in \mathcal{O}/\vartheta \cong \f_\ell$. Hence, $\omega \cong g \pod\vartheta$ for some positive root $g$ modulo $\ell$. \end{proof} The eigenvalues of $H_s$ modulo $\vartheta$ can be calculated as \begin{align} \label{proof-of-thm-2} \notag & \sum_{j = 0 } ^{\ell - 2} a_j(s) \omega ^{kj} \equiv_{\vartheta} \sum_{j=0} ^{\ell-2} a_j(s) (g^{k})^j \equiv \sum_{j=0} ^{\ell-2} \left(\sum_{v ^2 \equiv 1 + 4 \epsilon g^{2j} - 4s g^j\pod\ell} 1\right)(g^{k})^j \\ \equiv & \sum_{j=0} ^{\ell-2} \sum_{v ^2 \equiv 1 + 4 \epsilon g^{2j} - 4s g^j\pod\ell} g^{kj} \equiv \sum_{\lambda =1}^{\ell-1} y(\lambda)^{k} \equiv \sum_{\lambda =1}^{\ell-1} \frac{\lambda^k (a-b)^k}{\left((\lambda s + 1)^2 - \lambda^2 \epsilon \right)^k} \pod \ell. \end{align} Here, $a_j(s) = X_{0,j}(s)$, which corresponds to $m=1=(a-b)^2$. We now consider a linear combination $\sum_{s=1} ^{\ell-1} \alpha_s H_s : \q[\Pr^1(\f_\ell) \times \Pr^1(\f_\ell) - \Delta] \rightarrow \q[\C_\ell]$ of the maps $H_s$. Note that a linear combination of circulant matrices is circulant. The eigenvalue of $\sum_{s=1} ^{\ell-1} \alpha_s H_s$ is thus given by $\sum_{j=0} ^{\ell-2} b_j \omega ^{kj}$, where $b_j = \sum_{s=1} ^{\ell-1} \alpha _s a_j (s)$. Then, we have that \begin{align*} & \sum_{j=0} ^{\ell - 2} b_j \omega ^{kj} = \sum_{j=0} ^{\ell - 2} \left( \sum_{s=1} ^{\ell-1} \alpha_s a_j(s) \right) \omega^{kj} = \sum_{s=1} ^{\ell-1} \alpha_s \sum_{j=0} ^{\ell - 2} a_j(s) \omega^{kj} \\ \equiv_{\vartheta} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} y(\lambda, s)^k = \sum_{\lambda=1}^{\ell-1} \sum_{s=1} ^{\ell-1} \alpha_s y(\lambda, s)^k \\ = & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k}. \\ \end{align*} \begin{lem} \label{lemA} Let $\alpha_s \equiv 1\pod\ell$ for $s \in \f_\ell^\times$, then the sum \begin{align} \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k}, \end{align} is non-zero modulo $\ell$ for $k$ even. \end{lem} \begin{proof} In the case $k = 0$, we cannot use a binomial expansion so we perform a direct computation: \begin{align} \label{casezero} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k} \equiv \sum_{s=1}^{\ell-1} \alpha_s (\ell-1) \notag \\ \equiv & (\ell-1) \sum_{s=1} ^{\ell-1} \alpha_s \equiv (\ell-1)\sum_{s=1} ^{\ell-1} 1 \equiv (\ell-1)(\ell-1) \equiv 1 \pod \ell. \end{align} If $k > 0$, then choose $k' \in \mathbb{N}$ such that $k \equiv -k' \pod {\ell-1}$, and $1 \le k' \le \ell -2$. Then \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s+ 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{-k} \\ \equiv & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s + 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{k'} \pod{\ell}, \end{align*} where \begin{align*} & \left( \frac{(\lambda s + 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{k'} \\ = & \left( \frac{\lambda ^2 s^2 + 2 \lambda s + 1 - \epsilon \lambda^2}{\lambda}\right)^{k'} \\ = & (\lambda s^2 + 2s + \lambda^{-1} - \epsilon \lambda)^{k'} \\ = & (\lambda (s^2 - \epsilon) + 2s + \lambda^{-1})^{k'}. \end{align*} Here, we just need the constant terms of $\left(\frac{(\lambda s +1)^2 - \epsilon \lambda^2}{\lambda} \right)^{k'}$ as the other terms are powers of $\lambda$, and the sum of these powers is zero modulo $\ell$. Now, \begin{align*} & \text{constant term of } (\lambda (s^2 - \epsilon) + 2s + \lambda^{-1})^{k'} \\ \equiv & \sum_{i=0} ^{\frac{k'}{2}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell} \quad \text{for $k'$ even}. \end{align*} Thus, we obtain that \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s+ 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{-k} \equiv & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}}\frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell}. \end{align*} If $\alpha_s \equiv 1\pod\ell$ for $s = 1, \ldots, \ell-1$, then for $k' > 0$ even, we have that \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & \sum_{s=1} ^{\ell-1} \sum_{i=0}^{\frac{k'}{2}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & \sum_{i=0}^{\frac{k'}{2}} \sum_{s=1} ^{\ell-1} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & \epsilon^{\frac{k'}{2}} \frac{k'!}{\frac{k'}{2}! \frac{k'}{2}!} \not\equiv 0 \pod{\ell}. \end{align*} The last equality holds because the only power of $s$ whose exponent is divisible by $\ell-1$ happens when $i = k'/2$. This proves the lemma. \end{proof} \begin{lem} \label{lemB} Let $\alpha_s \equiv1 \pod\ell$ for $s \in \f_\ell^\times$, then the sum \begin{align} \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k}, \end{align} is equal to zero modulo $\ell$ for $k$ odd. \end{lem} \begin{proof} We choose $k' \in \mathbb{N}$ such that $k \equiv -k' \pod {\ell-1}$, and $1 \le k' \le \ell -2$. Then \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s+ 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{-k} \\ \equiv & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s + 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{k'} \pod{\ell}. \end{align*} Hence, we get \begin{align*} & \left( \frac{(\lambda s + 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{k'} \\ = & \left( \frac{\lambda ^2 s^2 + 2 \lambda s + 1 - \epsilon \lambda^2}{\lambda}\right)^{k'} \\ = & (\lambda s^2 + 2s + \lambda^{-1} - \epsilon \lambda)^{k'} \\ = & (\lambda (s^2 - \epsilon) + 2s + \lambda^{-1})^{k'}. \end{align*} Therefore, we have \begin{align*} & \text{constant term of } (\lambda (s^2 - \epsilon) + 2s + \lambda^{-1})^{k'} \equiv\\ & \sum_{i=0} ^{\frac{k' - 1}{2}} \frac{k'!}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod\ell\quad \text{for $k'$ odd} \end{align*} Thus, \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{\lambda=1}^{\ell-1} \left(\frac{(\lambda s+ 1)^2 - \epsilon \lambda^2}{\lambda} \right)^{-k} \equiv & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}}\frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell}. \end{align*} If $\alpha_s \equiv 1\pod\ell$ for $s = 1, \ldots, \ell-1$, then for $k' > 0$ odd, we have that \begin{align*} & \sum_{s=1} ^{\ell-1} \alpha_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & \sum_{s=1} ^{\ell-1} \sum_{i=0}^{\frac{k'-1}{2}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & \sum_{i=0}^{\frac{k'-1}{2}} \sum_{s=1} ^{\ell-1} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv & 0 \pod{\ell}. \end{align*} The last equality holds because there are no powers of $s$ whose exponent is divisible by $\ell-1$, which proves the lemma. \end{proof} \begin{lem} \label{lemC} Let $\beta_s \equiv s^{-1} \pod \ell$ for $s\in \f_\ell^{\times}$. Then, the sum \begin{align} \sum_{s=1} ^{\ell-1} \beta_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k}, \end{align} is zero modulo $\ell$ for $k$ even. \end{lem} \begin{proof} In the case $k = 0$, we cannot use a binomial expansion so we perform a direct computation: \begin{align} \label{casezero} & \sum_{s=1} ^{\ell-1} \beta_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k} \equiv \sum_{s=1}^{\ell-1} \beta_s (\ell-1) \equiv \sum_{s=1}^{\ell-1} s^{-1} (\ell-1) \notag \\ \equiv & \sum_{s=1}^{\ell-1} s^{\ell-2}(\ell-1) \equiv (\ell-1)\sum_{s=1}^{\ell-1} s^{\ell-2} \equiv 0 \pod{\ell}. \end{align} For $k' > 0$ even, we have that \begin{align*} & \sum_{s=1} ^{\ell-1} \beta_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv &\sum_{s=1} ^{\ell-1} s^{-1} \sum_{i=0}^{\frac{k'}{2}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell} \\ \equiv & \sum_{i=0}^{\frac{k'}{2}} \sum_{s=1} ^{\ell-1} s^{-1} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell} \equiv 0 \pod{\ell}. \end{align*} The last equality holds because there are no powers of $s$ whose exponent is divisible by $\ell-1$, which proves the lemma. \end{proof} \begin{lem} \label{lemD} Let $\beta_s \equiv s^{-1} \pod \ell$ for $s\in \f_\ell^{\times}$. Then the sum \begin{align} \sum_{s=1} ^{\ell-1} \beta_s \sum_{\lambda=1}^{\ell-1} \left(\frac{\lambda}{(\lambda s + 1)^2 - \epsilon \lambda ^2} \right)^{k} \end{align} is non-zero modulo $\ell$ for $k$ odd. \end{lem} \begin{proof} For $k' > 0$ odd, we have that \begin{align*} & \sum_{s=1} ^{\ell-1} \beta_s \sum_{i=0}^{\myfloor{\frac{k'}{2}}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \\ \equiv &\sum_{s=1} ^{\ell-1} s^{-1} \sum_{i=0}^{\frac{k'-1}{2}} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell} \\ \equiv &\sum_{i=0}^{\frac{k'-1}{2}} \sum_{s=1} ^{\ell-1} s^{-1} \frac{k' !}{i! i! (k' - 2i)!}(2s)^{k' - 2i}(s^2 - \epsilon)^i \pod{\ell} \\ \equiv & \epsilon^{\frac{k'-1}{2}} \frac{k'!}{\frac{k'-1}{2}!\frac{k'-1}{2}!} \not\equiv 0 \pod{\ell}. \end{align*} The last equality holds because the only power of $s$ whose exponent is divisible by $\ell-1$ happens when $i = \frac{k'-1}{2}$, which proves the lemma. \end{proof} \begin{cor} The operator $\sum_{s=1} ^{\ell-1} (\alpha_s+\beta_s) H_s$ has non-zero eigenvalue modulo $\ell$ for all $k > 0$ in its circulant determinant formula. \end{cor} \begin{proof} Using \eqref{casezero}, the operator $\sum_{s=1} ^{\ell-1} (\alpha_s + \beta_s) H_s$ has non-zero eigenvalue for $k = 0$. Furthermore, by Lemmas~\ref{lemA}, ~\ref{lemB},~\ref{lemC}, and ~\ref{lemD}, the eigenvalue of $\sum_{s=1} ^{\ell-1}(\alpha_s + \beta_s) H_s$ is non-zero modulo $\vartheta$ for $k > 0$, since the eigenvalue of $\sum_{s=1} ^{\ell-1} (\alpha_s + \beta_s) H_s$ for $k$ is the sum of the eigenvalues for $k$ of $\sum_{s=1} ^{\ell-1} \alpha_s H_s$ and $\sum_{s=1} ^{\ell-1} \beta_s H_s$. \end{proof} The above corollary shows that determinant of $\sum_{s=1} ^{\ell-1} (\alpha_s + \beta_s) H_s$ is non-zero modulo $\ell$, and is hence non-zero. This concludes the proof of Theorem~\ref{main-C}. \section{Relations between Jacobians of certain modular curves} \label{lastchapter} In this section, we summarize some applications of the main results of this paper to Jacobians of modular curves. Let $X = X(\ell)$ denote the modular curve of full level $\ell$ structure which has the structure of a projective algebraic curve over $\q$ for $p \ge 3$ (cf.\ \cite[p.241]{mazur-wiles} or \cite{katz-mazur}). The group $G = \GL_2(\f_\ell)$ acts on $X$ and the quotients $X_H := X/H$ by subgroups $H$ of $G$ (which contain $-1$) exist as projective algebraic curves over $\q$ \cite[p.244]{mazur-wiles} and \cite{katz-mazur}. Let $J$ denote the Jacobian of $X$ and $J_H$ denote the Jacobian of $X_H$. \begin{prop} \label{induce-Jacobians} Let $\sigma : \z[G/H'] \rightarrow \Z[G/H]$ be a $\z[G]$-module homomorphism. Then $\sigma$ induces a homomorphism of Jacobians $\sigma^* : J_H \rightarrow J_{H'}$. \end{prop} \begin{proof} This is proved in \cite[Lemma 3.3]{chen}. \end{proof} \begin{prop} \label{induce-relation} Suppose a cochain complex of $\z[G]$-modules \begin{equation*} \ldots \longrightarrow \z[G/H_{i-1}] \longrightarrow \z[G/H_i] \longrightarrow \z[G/H_{i+1}] \longrightarrow \ldots \end{equation*} has finite cohomology groups. Then the induced sequence of Jacobians by applying Proposition~\ref{induce-Jacobians} yields a chain complex \begin{equation*} \ldots \longleftarrow J_{H_{i-1}} \longleftarrow J_{H_i} \longleftarrow J_{H_{i+1}} \longleftarrow \ldots \end{equation*} with finite homology groups. \end{prop} \begin{proof} This is proved in \cite[Proposition 3.7]{chen}. \end{proof} Theorems~\ref{main-N} and \ref{main-C} imply that \begin{align} \label{Q-rel-1} \q[G/N] \longrightarrow_{\psi^+} \q[G/N'] \longrightarrow 0 \\ \label{Q-rel-2} \q[G/C] \longrightarrow_{\psi} \q[G/C'] \longrightarrow 0 \end{align} are exact cochain complexes of $\q[G]$-modules. \begin{prop} The following are cochain complexes \begin{align} \z[G/N] \longrightarrow_{\psi^+} \z[G/N'] \longrightarrow 0 \\ \z[G/C] \longrightarrow_{\psi} \z[G/C'] \longrightarrow 0 \end{align} with finite cohomology groups. \end{prop} \begin{proof} This follows from tensoring the cochain complexes above by $\q$. If the cohomology groups were not finite, this would contradict the exactness of the cochain complexes in \eqref{Q-rel-1}-\eqref{Q-rel-2}. \end{proof} Applying Proposition~\ref{induce-relation}, we obtain: \begin{cor} \label{main-cor} The following are chain complexes \begin{align} 0 \longrightarrow J_{N'} \longrightarrow_{\psi^{+*}} J_N \\ 0 \longrightarrow J_{C'} \longrightarrow_{\psi^*} J_C \end{align} with finite homology groups. \end{cor} From \cite{chen-98}, we have that \begin{align} J_N \sim J_{N'} \times J_B \\ J_C \sim J_{C'} \times J_B^2, \end{align} where $\sim$ denotes the relation of isogeny over $\q$, and $B$ is the subgroup of upper triangular matrices in $G$. Hence, Corollary~\ref{main-cor} describes the main part of the well-known relations between $J_N$ and $J_{N'}$ (resp.\ $J_C$ and $J_{C'}$) using explicit correspondences. It is known that $X_{C} \cong X_0(\ell^2)$ and $X_{N} \cong X_0(\ell^2)/\left< w_\ell \right>$, which are the more standard modular curves studied in the literature.
\section{Introduction} The chimera state \cite{Kuramoto2002} was so dubbed \cite{Abrams2004} because of its similarity to the Greek mythological creature made up of parts (a lion's head, a goat's body, a serpent's tail) that didn't belong together. It seemed unbelievable that identical oscillators, coupled in identical ways to their neighbors, could behave in radically different fashions. Appeals to insight from other symmetry-breaking phenomena were fruitless, because in most comparable problems the symmetric state loses stability; here, both the symmetric (fully-synchronized) and the asymmetric (chimera) state were simultaneously stable. Despite continued research on chimera states (see, e.g., \cite{Montbrio2004, Sakaguchi2006, Abrams2008, Arenas2008, Bordyugov2010, Motter2013, Omelchenko2013, Panaggio2013, GONZALEZAVELLA2014, Rothkegel2014, Ashwin2015, Bastidas2015, Panaggio2015_1, Panaggio2015_2, Nishikawa2016, Roulet2016, Ulonska2016, Cho2017}) and significant mathematical insight, they have resisted intuitive explanation. In this Letter, we show how intuition can indeed yield understanding of the chimera state. For a natural extension of the model, it occurs as the limiting case of a pitchfork bifurcation that destabilizes the symmetric state. \textbf{Mathematical background.} The ``traditional'' Kuramoto model \cite{Kuramoto1975, Kuramoto1984book, Kuramoto1984} has been extensively studied (see, e.g., \cite{Acebron2005, STROGATZ2000}); it is \begin{equation} \label{eq:KM0} \dot{\theta}_i = \omega_i - \frac{K}{N} \sum_{j=1}^N \sin(\theta_i - \theta_j), \end{equation} where $\theta_i$ and $\omega_i$ are the phase and the natural frequency of the $i$th oscillator in a population of $N$ coupled oscillators. Typically the natural frequencies $\left\{\omega_i\right\}$ are drawn from a known distribution $g(\omega)$. In the thermodynamic limit $N \to \infty$, the continuum of oscillators at each $\omega$ value can be described by the probability density function $f(\theta, t; \omega)$, which must satisfy the continuity equation. The sum in \eqref{eq:KM0} represents an average of the sine of the phase difference over all oscillators, and is therefore generalized as an integral. Thus the instantaneous velocity of an oscillator with natural frequency $\omega$ becomes \begin{align} \label{eq:KM1} v(\theta, t; &\omega) = \omega - \\ \nonumber & K \int_{-\pi}^{\pi} \int_{-\infty}^{\infty} \sin \big( \theta - \theta ' \big) \ f \big( \theta ', t; \omega ' \big) \ g \big( \omega ' \big) \ d \omega ' \ d \theta '. \end{align} A simple system that can form chimera states consists of two clusters of oscillators \cite{Abrams2008, Laing2009, Laing2012_2}, with equations given by \begin{equation} \label{eq:twoclusterode} \dot{\theta}_{i}^{\sigma} = \omega_{i}^{\sigma} - \sum_{\sigma' = 1}^{2} \frac{K_{\sigma \sigma'}}{N_{\sigma'}} \sum_{j=1}^{N_{\sigma'}} \sin(\theta_i^{\sigma} - \theta_j^{\sigma'} + \alpha). \end{equation} Here the two clusters are identified by $\sigma \in \{1,2\}$, $\omega_{i}^{\sigma}$ are drawn from a distribution $g ( \omega )$, $N_{\sigma}$ is the number of oscillators in cluster $\sigma$ and $\alpha$ is the phase lag. The coupling strength between oscillators in cluster $\sigma'$ and those in cluster $\sigma$ is given by $K_{\sigma \sigma'}$; we take $K_{11} = K_{22} = \mu > 0$, and $K_{12} = K_{21} = \nu > 0$, with $\mu > \nu$ (so intra-cluster coupling is stronger than inter-cluster coupling). By rescaling time, we may set $\mu + \nu = 1$. It is useful to define the parameters $A = \mu - \nu$ and $\beta = \pi/2 - \alpha$, because, as will be shown later, chimera states exist in the limit where these quantities are small. We begin by analyzing system \eqref{eq:twoclusterode} in the continuum limit where $N_{\sigma} \rightarrow \infty$ for $\sigma \in \{1,2\}$. Two probability densities $f^{\sigma}(\theta, t; \omega)$ are assumed to exist and satisfy continuity equations for each population. Thus, equations \eqref{eq:twoclusterode} become \begin{multline} v^{\sigma}(\theta, t; \omega) = \omega \ - \sum_{\sigma ' = 1}^{2} K_{\sigma \sigma '} \int_{-\infty}^{\infty} \int_{-\pi}^{\pi} \sin\big( \theta - \theta ' + \alpha \big) \\ \times f^{\sigma '}(\theta ', t; \omega ') \ d \theta ' \ d \omega ', \end{multline} where $v^\sigma$ represents the phase velocity $\dot{\theta}$ of oscillators in cluster $\sigma$. Note that we have dropped the superscripts on $\theta$ and $\omega$ to ease the notation---$\theta$ means $\theta^{\sigma}$ and $\theta '$ means $\theta^{\sigma '}$, and similarly for $\omega$. We define a complex order parameter for each cluster \begin{equation} z_{\sigma}(t) = \left<e^{i \theta^\sigma} \right> = \int_{-\infty}^{\infty} \int_{-\pi}^{\pi} e^{i \theta} \ f^{\sigma}(\theta, t; \omega) \ d \theta \ d \omega, \end{equation} so that $v^{\sigma}(\theta, t; \omega)$ simplifies to \begin{equation} \small v^{\sigma}(\theta, t; \omega) = \omega + \frac{1}{2i} \sum_{\sigma ' = 1}^{2} K_{\sigma \sigma '} (z_{\sigma '} e^{-i(\theta + \alpha)} - \overline{z}_{\sigma '} e^{i(\theta + \alpha)}). \end{equation} Ott and Antonsen proposed the following ansatz for the expansion of $f^{\sigma}(\theta, \omega, t)$ in a Fourier series \cite{Ott2008}: \begin{equation} \label{eq:Ottansatz} f^{\sigma}(\theta, t; \omega) = \frac{g ( \omega )}{2\pi} \Bigg( 1 + \bigg( \sum_{n = 1}^{\infty} (a_{\sigma}(\omega, t) e^{i \theta})^{n} + \text{c.c.} \bigg) \Bigg), \end{equation} where $\text{c.c.}$ stands for complex conjugate. Plugging \eqref{eq:Ottansatz} into the continuity equation yields a system of two coupled partial integro-differential equations \begin{equation} \label{eq:ampeqn} \frac{\partial a_{\sigma}}{\partial t} + i \omega a_{\sigma} + \frac{1}{2} \sum_{\sigma ' = 1}^{2} K_{\sigma \sigma '} (z_{\sigma '} a_{\sigma}^{2} e^{-i\alpha} - \overline{z}_{\sigma '} e^{i\alpha}) = 0, \end{equation} where $z_{\sigma} (t) = \int_{-\infty}^{\infty} g ( \omega ) \ \overline{a}_{\sigma}(\omega, t) \ d \omega$. We henceforth take $g ( \omega )$ to be a Lorentzian (Cauchy) distribution with mean zero and scale parameter (width) $D$, so $\pi g(\omega) = D / (\omega^{2} + D^{2})$. This allows $z_{\sigma}(t)$ to be evaluated analytically by contour integration, yielding $z_{\sigma} (t) = \overline{a}_{\sigma} (-iD, t)$; plugging this into equation \eqref{eq:ampeqn} results in a two-dimensional system of complex ordinary differential equations (ODEs) that describe the dynamics of the order parameters of the two clusters. We rewrite the ODEs in polar coordinates by substituting $z_{1} = r_{1} e^{-i \phi_{1}}$ and $z_{2} = r_{2} e^{-i \phi_{2}}$ and defining $\phi = \phi_{1} - \phi_{2}$. This yields the three-dimensional system of real ODEs \begin{subequations} \label{eq:zdyn} \small \begin{align} \dot{\phi} &= \bigg( \frac{1 + r_{1}^{2}}{2r_{1}}\bigg) [\mu r_{1} \sin \alpha - \nu r_{2} \sin (\phi - \alpha)] \nonumber \\ &\quad - \bigg( \frac{1 + r_{2}^{2}}{2r_{2}}\bigg) [\mu r_{2} \sin \alpha + \nu r_{1} \sin (\phi + \alpha)]. \label{subeq:phidyn} \\ \dot{r}_{1} &= -D r_{1} + \bigg( \frac{1 - r_{1}^{2}}{2}\bigg) [\mu r_{1} \cos \alpha + \nu r_{2} \cos (\phi - \alpha)] \label{subeq:r1dyn} \\ \dot{r}_{2} &= -D r_{2} + \bigg( \frac{1 - r_{2}^{2}}{2}\bigg) [\mu r_{2} \cos \alpha + \nu r_{1} \cos (\phi + \alpha)] \label{subeq:r2dyn} \end{align} \end{subequations} For our analysis, we set $\mu = (1 + A)/2$, $\nu = (1 - A)/2$ and $\alpha = \pi/2 - \beta$. The bifurcation analysis will be carried out in the three-dimensional parameter space $(\beta, A, D)$. \textbf{Searching for the connection.} In previous works \cite{Abrams2008, Montbrio2004, Abrams2004}, the $D = 0$ case was analyzed, and it was shown that the chimera state disappears via a saddle-node bifurcation with an unstable saddle chimera state. There was no apparent connection between the stable chimera state and the fully synchronous state---both states seemed to be stable with different basins of attraction \cite{Martens2016}. In this section, we attempt to find such a connection by searching the 3-D parameter space $(\beta, A, D)$. \begin{figure}[thb] \centering \vspace{0mm} \includegraphics[width=\columnwidth]{Dslicechimerawedge_cropped_boxes} \vspace{-7mm} \caption{Bifurcations of equilibria from Eqs.~\eqref{eq:zdyn} with $D = 0.0006$, $\mu = (1+A)/2$, $\nu=(1-A)/2$. Red solid curves: pitchfork bifurcation; blue dashed curves: saddle-node bifurcation. Inset shows how curves shift as parameters change, with $D=0$, $D=0.00015$, $D=0.0003$, and $D=0.0006$ from bottommost curve to topmost (note that pitchfork bifurcation does not occur with $D=0$; in that case saddle-node curve extends to origin). Via numerical continuation \cite{Ermentrout2002, Doedel2007}. } \label{fig:Dslicechimerawedge} \end{figure} \setlength{\belowcaptionskip}{-10pt} \begin{figure}[thb] \centering \vspace{-4mm} \includegraphics[width=\columnwidth]{Aslicechimerawedge_cropped_boxes} \vspace{-7mm} \caption{Bifurcations of equilibria from Eqs.~\eqref{eq:zdyn} with $A = 0.05$ ($\mu = 0.525$, $\nu=0.475$). Red solid curves: pitchfork bifurcation; blue dashed curves: saddle-node bifurcation. Note the peculiar balloon-like shape of this section originating from the $A$ axis. Inset shows how curves shift as parameters change, with $A=0.0167$, $A=0.033$, and $A=0.05$ from bottommost curve to topmost. Via numerical continuation \cite{Ermentrout2002, Doedel2007}. } \label{fig:Aslicechimerawedge} \end{figure} In Fig.~\ref{fig:Dslicechimerawedge} we show bifurcation curves in $A$ vs $\beta$ for various slices of $D \ge 0$. For $D>0$, we observe a pitchfork bifurcation curve close to the origin that does not exist in the $D=0$ case. We also observe that the saddle-node curve does not extend to the origin for $D>0$. Another cross-sectional view with fixed $A$ is shown in Fig.~\ref{fig:Aslicechimerawedge}, where the pitchfork surface appears ``balloon-like.'' Laing obtained a similar figure in \cite{Laing2009}, where a chimera state on a 1-D ring with dispersion in natural frequency was analyzed. \begin{figure}[thb] \centering \vspace{-7mm} \includegraphics[width=0.9\columnwidth]{3d_chimera_wedge_v2_boxes} \vspace{-4mm} \caption{Three-dimensional bifurcation surfaces for equilibria of Eqs.~\eqref{eq:zdyn}. Red curved surface: pitchfork bifurcation; blue planar surface: saddle-node bifurcation. Via numerical continuation \cite{Ermentrout2002,Doedel2007}.} \label{fig:chimera_wedge} \end{figure} In Fig.~\ref{fig:chimera_wedge} we assemble a set of two-parameter sections to construct a 3-D bifurcation plot \footnote{All bifurcation diagrams were plotted using either XPP-Aut or our own continuation code. XPP-Aut \cite{Ermentrout2002} is software that consists of XPP, a differential equation solver, and AUTO \cite{Doedel2007}, an engine for numerical continuation of bifurcations. }. \textbf{Understanding the chimera ``wedge.''} How does the geometry of the bifurcation surfaces affect the order parameters $r_{1}, r_{2}$ of the two clusters? We address this question by looking at the effect of frequency dispersion on $\beta$-parameter sweeps of $r_{1}, r_{2}$. \begin{figure}[thb] \centering \vspace{0mm} \hspace{2.25mm} \includegraphics[width=0.763\columnwidth]{D_a_crop_v2} ~\\ \hspace{2.25mm} \includegraphics[width=0.763\columnwidth]{D_a2} ~\\ \hspace{-1mm} \includegraphics[width=0.8\columnwidth]{D_b_crop} ~\\ \hspace{3.5mm} \includegraphics[width=0.781\columnwidth]{D_c_crop_v2} \vspace{-4mm} \caption{Cluster order parameter $r_1$ and $r_2$ vs.~phase lag $\beta$ for three values of $D$ and $A=0.08$ Solid curves: stable branches; dashed curves: unstable branches. Top panel: symmetric sync state has $r_1=r_2=1$ and chimera states have $\{r_1=1, r_2<1\}$ or $\{r_1<1, r_2=1\}$. Middle and bottom panels: branches above and below central branch correspond to pairs of chimera states symmetric under interchange of cluster number, i.e., $\{r_1=a, r_2=b\}$ and $\{r_1=b, r_2=a\}$. Center branch always corresponds to symmetric extension of sync state with $r_1=r_2$. Via numerical continuation \cite{Ermentrout2002, Doedel2007}. } \label{fig:bifurcationasDinc} \end{figure} For the $D = 0$ case, only a saddle-node bifurcation exists \cite{Abrams2008}. As $D$ is increased from $0$, we expect the order parameter of the spatially symmetric sync state (or its extension, which we also refer to as a ``sync'' state\footnote{When oscillator frequency dispersion $D=0$, a fully synchronized spatially symmetric state $r_1=r_2=1$ exists and is stable. When $D>0$, perfect synchrony no longer exists, but a spatially symmetric state with $r_1=r_2$ continues to exist. This is the analog of the full sync state, and as is typical in the traditional Kuramoto model, we refer to it as the ``sync'' state even though it does not correspond to perfect synchrony, and even though the order can become quite small if $D$ is large. Any state without spatial symmetry, i.e., with $r_1 \neq r_2$, we refer to as a chimera state.}) to decrease due to the heterogeneity among oscillator natural frequencies. This is apparent from the traditional Kuramoto model, as increasing the dispersion in natural frequencies results in a smaller fraction of oscillators becoming phase-locked. The same phenomenon happens here, as shown in Fig.~\ref{fig:bifurcationasDinc}: moving from the top panel to the bottom, the sync branch lowers as $D$ is increased. It also ceases to be a horizontal line when $D>0$, and new intersections with the saddle-node branches of solution give rise to two pitchfork bifurcations, one supercritical and the other subcritical. As $D$ increases further, the subcritical pitchfork and two saddle-nodes collide leaving behind a second supercritical pitchfork bifurcation. The third panel in Fig.~\ref{fig:bifurcationasDinc} demonstrates this, and corresponds to a parametric path that intersects the pitchfork balloon without intersecting the saddle-node surface. We have now found a connection between the sync state and the stable chimera state via a pitchfork bifurcation! This connection is not evident in the $D=0$ case: the interesting behavior becomes compressed to the $\beta=0$ axis, where the system is integrable \cite{WATANABE1994}. The singular perturbation $D=0 \to D>0$ is necessary to reveal the ``hidden'' pitchfork bifurcations; the same pitchfork concept lies at the heart of many physical systems that spontaneously break symmetry, e.g., buckling in beams, magnetic interactions (Ising model), first-order phase transitions in statistical mechanics, etc.~(see, e.g., \cite{Strogatz1994}). In Fig.~\ref{fig:chimera_wedge}, the region inside the pitchfork balloon is the region where only the chimera state is stable, and the region between the pitchfork balloon and the saddle-node surface is the region of bistability. The bistable region grows to occupy $100\%$ when $D \to 0$, which explains why chimera states were observed to coexist with a stable sync state in this system with identical oscillators \cite{Abrams2008}. \textbf{Perturbation theory.} Motivated by our computational results regarding the geometry of the bifurcation surfaces, we wish to obtain analytical expressions for these surfaces, at least in the limit where parameter values are small. We start by trying to identify a path through the origin that remains exclusively in one region of the parameter space partition shown in Fig.~\ref{fig:chimera_wedge}; that is, we want to find a parametric path that passes through the origin and doesn't cross either the pitchfork or saddle-node surface. The parameter bounds on such a path should then correspond to the boundaries we wish to identify. A straight line path fails, since it exits the chimera wedge near the origin (recall that the wedge ``pinches off'' to the origin in the $D$ direction---see the inset of Fig.~\ref{fig:Aslicechimerawedge}). That means that, moving along a straight-line path toward the origin, a system initialized in the chimera state would necessarily switch to the sync state before it reached the origin. Instead, we find that a path where $D$ scales quadratically works as desired: a system initialized in the chimera state can be continued along such a path arbitrarily close to the origin. We will use this path to seek chimera state solutions to system \eqref{eq:zdyn} in the perturbative limit where $\beta$, $A$, and $D$ are all small. We thus impose the parameter scaling \{$\beta = k_{\beta} \varepsilon$, $A = k_{A} \varepsilon$, $D = k_{D} \varepsilon^{2}$\} together with the ansatz \{$r_{1} = r_{1,0} + r_{1,1} \varepsilon$, $r_{2} = r_{2,0} + r_{2,1} \varepsilon$, $\phi = \phi_{0} + \phi_{1} \varepsilon$\}, and look for equilibria of system \eqref{eq:zdyn} truncated to successive orders of $\varepsilon$. At the lowest order, i.e. $\varepsilon = 0$, we find $r_{1,0} = 1, \ r_{2,0} = 1$. Plugging in this zeroth order solution and solving the equations at first order in $\varepsilon$, we find $\phi_{0} = 0$. Substituting the zeroth and first order solutions in \eqref{eq:zdyn} and solving them at the second order in $\varepsilon$, we obtain a quartic equation in $\phi_{1}$ and explicit solutions for $r_{1,1}$ and $r_{2,1}$ in terms of its roots: \begin{subequations} \begin{multline} \label{eq:phi1quartic} k_{\beta} \phi_{1}^{4} - ( 8 k_{\beta}^{3} - 4 k_{A} k_{D} ) \phi_{1}^{2} + \\ 16 k_{\beta}^{5} - 16 k_{A} k_{\beta}^{2} k_{D} + 16 k_{\beta} k_{D}^{2} = 0. \end{multline} \vspace{-7mm} \begin{equation} r_{1,1} = \frac{-k_{D}}{k_{\beta} + \phi_{1}/2}, \end{equation} \vspace{-7mm} \begin{equation} r_{2,1} = \frac{-k_{D}}{k_{\beta} - \phi_{1}/2}, \end{equation} \end{subequations} Eq.~\eqref{eq:phi1quartic} is a quadratic in $\phi_{1}^{2}$, and imposing our expectation of real-valued solutions implies that two constraints (which will define our bifurcation surfaces) must be satisfied. The solutions of Eqn.~\eqref{eq:phi1quartic} after simplification are $\phi_{1} = \pm k_{\beta}^{-1/2} [2 k_{\beta} ^{3} \pm k_{d} \sqrt{k_{A}^{2} - 4 k_{\beta}^{2}} - k_{A} k_{D}]^{1/2}$. The first constraint is $k_{A}^{2} - 4 k_{\beta}^{2} > 0$ which gives us the saddle-node surface and is consistent with the expression obtained by Abrams, et al.~\cite{Abrams2008}, i.e. $A - 2\beta = 0$. The second constraint is a pair of inequalities which gives us the complete pitchfork balloon \begin{equation} 2\beta^{3} \pm \sqrt{A^{2}-4\beta^{2}} \ D - A D = 0. \label{eq:pitchfork} \end{equation} See Fig.~\ref{fig:chimera_wedge_theory} for a plot of these constraint surfaces. \begin{figure}[thb] \centering \vspace{-2mm} \includegraphics[width=\columnwidth]{3d_chimera_wedge_theory_cropped_new3_boxes} \vspace{-7mm} \caption{Three-dimensional bifurcation surfaces for equilibria of Eqs.~\eqref{eq:zdyn} in the perturbative limit $\beta, A, D \ll 0$. Red curved surface: Eq.~\eqref{eq:pitchfork}; blue planar surface: saddle-node surface. Green line: path between chimera state at $(\beta, A, D)=(0.02, 0.08, 0)$ and Kuramoto model state at $(\beta,A,D) = (\pi/2,0,0.2)$ (beyond axis limits).} \label{fig:chimera_wedge_theory} \end{figure} We also obtain closed form expressions for stable and unstable spatially symmetric synchronous states. To find these sync states, we plug $r_{1} = r_{2} = r$ into Eqs.~\eqref{eq:zdyn}, set time derivatives to zero, and solve to get the stable sync state (which has $\phi=0$) as \begin{equation} r = \sqrt{1 - \frac{2 D}{\sin \beta}}, \end{equation} and the unstable sync state (which has $\phi=\pi$) as \begin{equation} r = \sqrt{1 - \frac{2 D}{A \sin \beta}}. \end{equation} These equations imply yet more constraints, namely $\sin \beta > 2 D$ and $A \sin \beta > 2 D$, which specify the regions where stable and unstable sync states exist. \textbf{A different type of connection.} Having already obtained a connection between the sync branch and the chimera branch in Fig.~\ref{fig:bifurcationasDinc}, we now explicitly examine the connection between the Kuramoto model and the two-cluster chimera state model. \begin{figure}[tbh] \centering \vspace{0mm} \includegraphics[width=\columnwidth]{D2_cropped_boxes} \vspace{-6mm} \caption{Cluster orders $r_1$ and $r_{2}$ vs distance in parameter space from chimera state $s$ at $(\beta, A, D) = (0.02, 0.08, 0)$ via numerical continuation. Path in parameter space is a straight line connecting the above chimera state to the ``traditional'' Kuramoto model state as $(\beta, A, D) = (\pi/2, 0, 0.2)$. Solid lines: stable branches; dashed or dotted lines: unstable branches. Inset: results from numerical simulation of system \eqref{eq:twoclusterode} with $N_{1} = N_{2} = 256$, with natural frequencies drawn randomly from a Lorentzian distribution $g(\omega)$, with a total integration time of $1500 s$, and overlaid on stable branches from numerical continuation. Circles: order parameters averaged over final $750 s$; error bars: standard deviation of order parameter over final $750 s$. Note that, where multiple branches exist, pairs correspond to interchange symmetry $(r_1=a, r_2=b) \to (r_1=b, r_2=a)$.} \label{fig:D2} \end{figure} Motivated by our understanding of the dynamics from the 3-D bifurcation plot, we choose a straight line path from the ``traditional'' Kuramoto model at $(\beta, A, D) = (\pi/2, 0, 0.2)$ (global coupling without phase lag among non-identical oscillators) to a specific chimera state model $(0.02, 0.08, 0)$ (nonzero coupling disparity with phase lag among identical oscillators). This path, shown in Fig.~\ref{fig:chimera_wedge_theory}, intersects only the pitchfork balloon, crossing the surface twice, and thus undergoing two pitchfork bifurcations (note that only one crossing is visible in the figure). Starting from the Kuramoto model, as we enter the pitchfork balloon, the stable chimera state branches off and the symmetric sync state loses stability. This is visible moving along the curve from right to left in Fig.~\ref{fig:D2}, where $s$ indicates the distance in parameter space. Near $s = 0$, we see that there is a small region of bistability corresponding to the tiny region just under the pitchfork balloon. The key point of this analysis is to demonstrate a simple, intuitive aspect of the chimera state in this context: a standard pitchfork bifurcation off of the well-understood Kuramoto sync state leads to its appearance. In this construction, it is not even bistable with the Kuramoto sync state. \textbf{Conclusions.} For the ``two-cluster'' system, we have demonstrated that the chimera state emerges from a completely symmetric partially synchronized state familiar from the traditional Kuramoto model. It appears via a pitchfork bifurcation in which symmetry is broken so that oscillators in one cluster synchronize to a greater extent than oscillators in the other. Future work might build on this insight so that other puzzling aspects of the chimera state can be made clear. In particular, chimera states in variable amplitude oscillators and in systems with inertia remain poorly understood. Furthermore, we speculate that the connection between ``spot'' and ``spiral'' chimera states in two and higher dimensions might be understandable with an approach like that we use here. For the system on a ring with a nonlocal coupling kernel, we suspect that an approach similar to Laing's \cite{Laing2009} will allow for explicit analysis of the saddle-node and pitchfork surfaces. \begin{acknowledgments} The authors thank Carlo Laing for helpful correspondence and Gokul Nair for helpful conversations. \end{acknowledgments} \bibliographystyle{apsrev4-1}
\section{Introduction} Channel resolvability has been established as an important tool in information-theoretic security~\cite{CsiszarSecrecy,BlochStrongSecrecy,DevetakPrivateCapacity}. In particular, strong secrecy can be derived directly from channel resolvability. The latter, roughly speaking, is defined as the asymptotically smallest rate of a uniform random seed that is needed to generate a channel input for which the channel output well approximates a given target output under some suitable approximation measure. Potential measures that are commonly used in the literature are the Kullback-Leibler divergence and the variational distance. In this paper, we focus on the latter one which is strong enough to be related to security concepts from cryptography \cite{FreyMACResolvabilityRegion}. To the best of our knowledge, Wyner~\cite{WynerCommonInformation} was the first to propose the problem of approximating a given output distribution over a communication channel with as little randomness as possible on the transmitter side. In~\cite{WynerCommonInformation}, he used a normalized Kullback-Leibler divergence to measure the deviation between the actual and the target output distribution. Han and Verdú~\cite{HanApproximation} introduced the notion of channel resolvability and formulated a similar problem except that they assumed the variational distance as a metric. Unnormalized Kullback-Leibler divergence was considered as a measure of similarity in~\cite{HayashiResolvability} and later in~\cite{HouInformational}; Rényi divergence was considered in~\cite{YuRenyi}. The results of~\cite{CsiszarSecrecy,DevetakPrivateCapacity,CuffSoftCovering} show that not only good resolvability codebooks exist but also that the probability of drawing an unsuitable random codebook is doubly exponentially small. Second order results for resolvability rate are presented in~\cite{WatanabeSecondOrder,CuffSoftCovering} and for MAC in~\cite{FreyMACResolvability,FreyMACResolvabilityRegion}. Nonasymptotic results are obtained in~\cite{HayashiResolvability}. Converse theorems for arbitrary input and output distribution (without i.i.d. assumption across channel uses) are contained in~\cite{HanApproximation,YagiResolvability} and~\cite{SteinbergResolvability} for MAC. A converse resolvability result based on Kullback-Leibler divergence is shown in~\cite{WynerCommonInformation} and a simpler argument is given in~\cite{HouPhDThesis}. As we focus on variational distance, these results do not carry over to our case. For MAC with finite alphabets and i.i.d. inputs, we have established direct and converse results in~\cite{FreyMACResolvabilityRegion}. \emph{In this work, we extend those results to continuous alphabets in the point-to-point setting.} This extension to nondiscrete alphabets is in particular a step towards dropping the assumption common in secrecy results that the wiretapper's alphabet is discrete. Thus, these results may be extended to many channels particularly practically relevant in wireless communications such as the AWGN or the Rayleigh fading channel. We also remark that although we use the same technique as~\cite{CuffSoftCovering,FreyMACResolvability}, the extension to nondiscrete alphabets is not entirely straightforward: Dropping the assumption that the alphabets are finite means that bounding the typical part of the variational distance with applications of the Chernoff-Hoeffding and union bound is not possible. Instead, we apply the Chernoff-Hoeffding bound in the usual way and infer the bound on the variation distance more directly as layed out in Lemmas~\ref{lemma:typical} and \ref{lemma:typical-helper}. \section{Preliminaries} A \emph{channel} $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$ is given by an \emph{input alphabet} $\mathcal{X}$ with $\sigma$-algebra ${\mathcal{F}}$, an \emph{output alphabet} $\mathcal{Y}$ with $\sigma$-algebra ${\mathcal{G}}$ and a \emph{stochastic kernel} $K$ which defines a stochastic transition between the input and output alphabets. I.e., $K$ is a mapping from $\mathcal{X} \times {\mathcal{G}}$ to $[0,1]$ such that $K(\cdot, A)$ is measurable for each $A \in {\mathcal{G}}$ and $K(x, \cdot)$ is a probability measure on $(\mathcal{Y}, {\mathcal{G}})$ for each $x \in \mathcal{X}$. We assume throughout this paper that the input and output alphabets are Polish with Borel $\sigma$-algebra. $X$ and $Y$ are random variables denoting the channel input and output respectively. Given $\sigma$-algebras $\mathcal{F}$ and $\mathcal{G}$, we denote their product $\sigma$-algebra by $\mathcal{F} \otimes \mathcal{G}$. Likewise, the product of $n$ copies of $\mathcal{F}$ is denoted by $\sigmaAlgebraPower{\mathcal{F}}{n}$. The $n$th extension of $K$ is given by $ \kernelPower{K}{n}(x^n, \bigtimes_{j=1}^n A_j) := \prod_{j=1}^n K(x_j, A_j) $. An \emph{input distribution} $Q_X$ on $(\mathcal{X}, {\mathcal{F}})$ induces a joint distribution $Q_{X,Y}$ on $(\mathcal{X} \times \mathcal{Y}, {\mathcal{F}} \otimes {\mathcal{G}})$ via $ Q_{X,Y}(A_1 \times A_2) := \int_{A_1} K(x, A_2) Q_X(dx) $ for $A_1 \in {\mathcal{F}}$, $A_2 \in {\mathcal{G}}$. The induced \emph{output distribution} is denoted $Q_Y$. The $n$-fold products of the input and output distributions are denoted $Q_{X^n}$ and $Q_{Y^n}$, respectively. A \emph{codebook} for the input alphabet $\mathcal{X}$ with block length $n$ and rate $R$ is a tuple $\mathcal{C} = (C(m))_{m = 1}^{\exp(\codebookBlocklengthR)}$, where the \emph{codewords} are $C(m) \in \mathcal{X}^n$. We define the \emph{input distribution induced by $\mathcal{C}$} as $ P_{X^n | \mathcal{C}}(A) := \exp(-\codebookBlocklengthR) \sum_{m=1}^{\exp(\codebookBlocklengthR)} \indicator{C(m) \in A}. $ $P_{X^n | \mathcal{C}}$ and $\kernelPower{K}{n}$ induce an input-output distribution $P_{X^n, Y^n | \mathcal{C}}$ and output distribution $P_{Y^n | \mathcal{C}}$. Any $Q_X$ on $(\mathcal{X}, {\mathcal{F}})$ induces a distribution $P_\mathcal{C}$ on the set of possible codebooks by drawing all the components of all the codewords i.i.d. from $\mathcal{X}$ according to $Q_X$. Given probability measures $\mu$ and $\nu$ on $(\mathcal{X}, \mathcal{F})$, we define the \emph{variational distance} as $ \totalvariation{\mu - \nu} := \sup_{A \in \mathcal{F}} (\mu(A) - \nu(A)) $. We say that $\mu$ is absolutely continuous with respect to $\nu$, in symbols $\mu \ll \nu$, if all $\nu$-null sets are $\mu$-null sets. If $\mu \ll \nu$, the Radon-Nikodym theorem states that there exists a measurable function $\RNDerivative{\mu}{\nu}: \mathcal{X} \rightarrow [0,\infty)$, called the \emph{Radon-Nikodym derivative}, such that for every $A \in \mathcal{F}$, $ \mu(A) = \int\nolimits_{A} \RNDerivative{\mu}{\nu}(x) \nu(dx). $ Given a channel and an input distribution, we define for any $x \in \mathcal{X}$ and $y \in \mathcal{Y}$ the \emph{information density} of $(x,y)$ as $ \informationDensity{x}{y} := \log \RNDerivative{K(x,\cdot)} {Q_Y} (y). $ By convention, we say that the information density is $\infty$ on the singular set where $K(x,\cdot)$ is not absolutely continuous with respect to $Q_Y$ and $-\infty$ where the relative density is $0$. Note that if the information density is finite almost everywhere, we can pick versions of the Radon-Nikodym derivatives such that $\informationDensity{x}{y}$ is measurable with respect to ${\mathcal{F}} \otimes {\mathcal{G}}$ \cite[Chap. 5, Theorem 4.44]{CinlarProbability}. In this case, we can define the \emph{mutual information} of $X$ and $Y$ as $\mutualInformation{X}{Y}:=\mathbb{E}_{Q_{X, Y}} \informationDensity{x}{y}.$ \begin{shownto}{conference} Due to lack of space, we omit some proofs and we also skip some details. For complete and more detailed proofs, we refer the reader to the extended version of this paper~\cite{arxivVersion}. \end{shownto} \section{Resolvability Region} Given a channel $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$ and an output distribution $Q_Y$, a rate $R \in [0,\infty)$ is called \emph{achievable} if there is a sequence $(\mathcal{C}_\ell)_{\ell \geq 1}$ of codebooks with strictly increasing block lengths $n_\ell$ and rate $R$ such that $ \lim_{\ell \rightarrow \infty} \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} } = 0 $. The \emph{resolvability region} $\capacityRegion{\mathcal{W}}{Q_Y}$ is the closure of the set of all achievable rates. \begin{theorem} Let $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$ be a channel such that $\mathcal{X}$ is compact and for each $A \subseteq \mathcal{Y}$, $x \mapsto K(x, A)$ is a continuous mapping. Let $Q_Y$ be an output distribution. Define \begin{align*} \inducingInputDistributions{Q_Y} := \{ Q_X: &Q_X \text{ induces } Q_Y \text { through } \mathcal{W},~ \\ &\mutualInformationWrt{Q_{X, Y}}{X}{Y} < \infty \}. \end{align*} Then \begin{align*} \capacityRegion{\mathcal{W}}{Q_Y} = \left\{ R \in \mathbb{R}: R \geq \inf_{Q_X \in \inducingInputDistributions{Q_Y}} \mutualInformationWrt{Q_{X, Y}}{X}{Y} \right\}. \end{align*} \end{theorem} \begin{shownto}{conference} The inclusion ``$\supseteq$'' is a direct consequence of Theorem~\ref{theorem:firstorder} and Remark~\ref{remark:firstorder} in Section~\ref{section:direct}. Theorem~\ref{theorem:firstorder} does not require the input alphabet to be compact and in many practically relevant cases, it even states that not only there exists a sequence of codebooks witnessing that the rate is achievable, but also that the probability of randomly drawing a ``bad'' codebook vanishes doubly exponentially with increasing block length. The inclusion ``$\subseteq$'' is a consequence of Theorem~\ref{theorem:converse} proven in Section~\ref{section:converse}. \end{shownto} \begin{shownto}{arxiv} The inclusion ``$\supseteq$'' is a direct consequence of Theorem~\ref{theorem:firstorder-weakened} in Section~\ref{section:direct}, which is a variation of Theorem~\ref{theorem:firstorder}, our main direct result. Theorems~\ref{theorem:firstorder} and~\ref{theorem:firstorder-weakened} do not require the input alphabet to be compact and in many practically relevant cases, Theorem~\ref{theorem:firstorder} even states that not only there exists a sequence of codebooks witnessing that the rate is achievable, but also that the probability of randomly drawing a ``bad'' codebook vanishes doubly exponentially with increasing block length. The inclusion ``$\subseteq$'' is a consequence of Theorem~\ref{theorem:converse} proven in Section~\ref{section:converse}. \end{shownto} \section{Direct Results} \label{section:direct} The main result of this section is the following theorem. \begin{theorem} \label{theorem:firstorder} Given a channel $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$, an input distribution $Q_X$ such that the moment-generating function $\mathbb{E}_{Q_{X, Y}} \exp(t \cdot \informationDensity{X}{Y})$ of the information density exists and is finite for some $t > 0$, and $R > \mutualInformation{X}{Y}$, there exist $\gamma_1 > 0$ and $\gamma_2 > 0$ such that for large enough block lengths $n$, the randomized codebook distributions of block length $n$ and rate $R$ satisfy \begin{multline} \label{thm:resdirect-probstatement} P_\mathcal{C} \left( \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } > \exp(-\finalconstOnen) \right) \\ \leq \exp\left(-\exp\left(\finalconstTwon\right)\right). \end{multline} \end{theorem} \showto{arxiv}{With a slight refinement of the proof, we can also establish the following second-order result.} \showto{conference}{With a slight refinement of the proof, we can also establish the following second-order result. For details, we refer the reader to~\cite{arxivVersion}.} \begin{theorem} \label{theorem:secondorder} Given a channel $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$, an input distribution $Q_X$ such that the information density $\informationDensity{X}{Y}$ has finite central second moment $V$ and finite absolute third moment $\rho$, $\xi>0$ and $c>1$, \showto{arxiv}{ suppose the rate $R$ depends on $n$ in the following way: \begin{align} \label{def:secondorder-rate} R = \mutualInformation{X}{Y} + \sqrt{\frac{V}{n}} \mathcal{Q}^{-1}(\xi) + c \frac{\log n}{n}, \end{align} } \showto{conference}{ suppose that the rate is $ R = \mutualInformation{X}{Y} + \sqrt{V/n} \mathcal{Q}^{-1}(\xi) + c \log n/n, $ } where $\mathcal{Q} := 1 - \Phi$ with $\Phi$ the distribution function of the standard normal density. Then, for any $d \in (0, c-1)$ and $n$ that satisfy $n^{(c-d)/2} \geq 6$, we have \begin{multline} \label{theorem:secondorder-probstatement} P_\mathcal{C} \left( \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } > \mu\left(1+\frac{1}{\sqrt{n}}\right) + \frac{1}{\sqrt{n}} \right) \\ \begin{aligned} \leq &\exp\left( -\frac{1}{3} n \mu \exp(\codebookBlocklengthR) \right) \\ &+ \left( \frac{7}{6} + \sqrt{3\pi/2} \exp\left( \frac{3}{4} \right) \right) \exp\left( -n^{ \frac{1}{2} (c - d - 1) } \right), \end{aligned} \end{multline} where \showto{arxiv}{ \begin{align*} \mu := \mathcal{Q}\left( \mathcal{Q}^{-1}(\xi) + d \frac{\log n}{\sqrt{nV}} \right) + \frac{\rho} {V^{\frac{3}{2}} \sqrt{n}} \end{align*} tends to $\xi$ for $n \rightarrow \infty$. } \showto{conference}{ $ \mu := \mathcal{Q}\left( \mathcal{Q}^{-1}(\xi) + d \frac{\log n}{\sqrt{nV}} \right) + \frac{\rho} {V^{\frac{3}{2}} \sqrt{n}} $. } \end{theorem} \showto{conference}{In order to prove Theorem~\ref{theorem:firstorder},} \showto{arxiv}{In order to prove these theorems,} given a codebook $\mathcal{C}$, we write the variational distance as \begin{shownto}{arxiv} \begin{align} &\hphantom{{}={}} \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } \nonumber \\ &= \sup\limits_{A\in\sigmaAlgebraPower{{\mathcal{G}}}{n}} \left( P_{Y^n | \mathcal{C}}(A) - Q_{Y^n}(A) \right) \nonumber \\ &= \sup\limits_{A\in\sigmaAlgebraPower{{\mathcal{G}}}{n}} \int\nolimits_A \left( \RNDerivative{P_{Y^n | \mathcal{C}}}{Q_{Y^n}}(y^n) - 1 \right) Q_{Y^n}(dy^n) \nonumber \\ &= \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{Y^n | \mathcal{C}}}{Q_{Y^n}}(y^n) - 1 }. \label{totalvariation_positive} \end{align} \end{shownto} \begin{shownto}{conference} \begin{align} &\hphantom{{}={}} \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } \nonumber = \sup\limits_{A\in\sigmaAlgebraPower{{\mathcal{G}}}{n}} \left( P_{Y^n | \mathcal{C}}(A) - Q_{Y^n}(A) \right) \nonumber \\ &= \sup\limits_{A\in\sigmaAlgebraPower{{\mathcal{G}}}{n}} \int\nolimits_A \left( \RNDerivative{P_{Y^n | \mathcal{C}}}{Q_{Y^n}}(y^n) - 1 \right) Q_{Y^n}(dy^n) \nonumber \\ &= \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{Y^n | \mathcal{C}}}{Q_{Y^n}}(y^n) - 1 }. \label{totalvariation_positive} \end{align} \end{shownto} Note that throughout the proofs, we only consider codebooks $\mathcal{C}$ for which $P_{Y^n | \mathcal{C}}$ is absolutely continuous with respect to $Q_{Y^n}$. We can do this because the existence of a finite mutual information implies that $K(x, \cdot)$ is absolutely continuous with respect to $Q_{Y}$ for almost every $x$, and so the probability of drawing a codebook for which $P_{Y^n | \mathcal{C}}$ is not absolutely continuous with respect to $Q_{Y^n}$ is $0$. Similarly, we assume the existence of the other Radon-Nikodym derivatives that appear. \showto{arxiv}{ We define the typical set \begin{align} \label{def:typicalset} \typicalSet{\varepsilon} := \left\{ (x^n,y^n): \frac{1}{n} \informationDensity{x^n}{y^n} \leq \mutualInformation{X}{Y} + \varepsilon \right\} \end{align} and split $P_{Y^n | \mathcal{C}}$ into two measures \begin{align} \label{def:measure-typical-part} &\begin{aligned} &P_{1,\mathcal{C}}(A) := \exp(-\codebookBlocklengthR) \\ &~~\cdot\sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \kernelPower{K}{n}\left( C(m), A \cap \{ y^n: (C(m), y^n) \in \typicalSet{\varepsilon}\} \right) \end{aligned} \\ \label{def:measure-atypical-part} &\begin{aligned} &P_{2,\mathcal{C}}(A) := \exp(-\codebookBlocklengthR) \\ &~~\cdot\sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \kernelPower{K}{n}\left( C(m), A \cap \{ y^n: (C(m), y^n) \notin \typicalSet{\varepsilon}\} \right). \end{aligned} \end{align} } \showto{conference}{ We define the typical set $ \typicalSet{\varepsilon} := \{ (x^n,y^n): \informationDensity{x^n}{y^n}/n \leq \mutualInformation{X}{Y} + \varepsilon \} $ and split $P_{Y^n | \mathcal{C}}$ into two measures $ P_{1,\mathcal{C}}(A) := \exp(-\codebookBlocklengthR) \sum\nolimits_{m=1}^{\exp(\codebookBlocklengthR)} \kernelPower{K}{n}( C(m), A \cap \{ y^n: (C(m), y^n) \in \typicalSet{\varepsilon}\} ) $ and $ P_{2,\mathcal{C}}(A) := \exp(-\codebookBlocklengthR) \sum\nolimits_{m=1}^{\exp(\codebookBlocklengthR)} \kernelPower{K}{n}( C(m), A \cap \{ y^n: (C(m), y^n) \notin \typicalSet{\varepsilon}\} ) $. } We observe $P_{Y^n | \mathcal{C}} = P_{1,\mathcal{C}} + P_{2,\mathcal{C}}$, which allows us to split~(\ref{totalvariation_positive}) into a typical and an atypical part \begin{align} &\hphantom{{}={}} \totalvariation{P_{Y^n | \mathcal{C}} - Q_{Y^n}} \nonumber \\ &= \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) + \RNDerivative{P_{2,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } \nonumber \\ &\leq \label{split-typical-atypical} \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } + P_{2,\mathcal{C}}(\mathcal{Y}^n). \end{align} We next state and prove two lemmas that we will use as tools to bound the typical and atypical parts of this term separately. \begin{lemma}[Bound for atypical terms] \label{lemma:atypical} Suppose $Q_{X^n, Y^n} (\mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon}) \leq \mu$ and $\delta \in [0,1]$. Then \begin{align*} P_\mathcal{C}\big( P_{2,\mathcal{C}}(\mathcal{Y}^n) > \mu(1+\delta) \big) \leq \exp\left( -\frac{1}{3} \delta^2 \mu \exp(\codebookBlocklengthR) \right). \end{align*} \end{lemma} \begin{shownto}{conference} \begin{proof} The lemma follows from the Chernoff-Hoeffding bound. A complete proof can be found in~\cite{arxivVersion}. \end{proof} \end{shownto} \begin{shownto}{arxiv} \begin{proof} Observe $\mathbb{E}_{P_\mathcal{C}}(P_{2,\mathcal{C}}(\mathcal{Y}^n)) = Q_{X^n, Y^n} (\mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon}) \leq \mu$ and bound \begin{align*} &\hphantom{{}={}} P_\mathcal{C}\left(P_{2,\mathcal{C}}(\mathcal{Y}^n) > \mu(1+\delta) \right) \\ &= P_\mathcal{C}\left( \exp(\codebookBlocklengthR)P_{2,\mathcal{C}}(\mathcal{Y}^n) > \mu \exp(\codebookBlocklengthR) (1+\delta) \right) \\ &\begin{aligned} = P_\mathcal{C}\Bigg( &\sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \kernelPower{K}{n}\left( C(m), \{ y^n: (C(m), y^n) \notin \typicalSet{\varepsilon}\} \right) \\ &> \mu \exp(\codebookBlocklengthR) (1+\delta) \Bigg) \end{aligned} \\ &\leq \exp\left( -\frac{1}{3} \delta^2 \mu \exp(\codebookBlocklengthR) \right). \end{align*} The inequality follows from the Chernoff-Hoeffding bound~\cite[Ex. 1.1]{ConcentrationTextbook} by noting that we sum probabilities (i.e. values in $[0,1]$) on the left side, that these probabilities are independently distributed under $P_\mathcal{C}$ and that by the hypothesis of the lemma the expectation of the term on the left is bounded by $\mu\exp(\codebookBlocklengthR)$. \end{proof} \end{shownto} \begin{lemma}[Bound for typical terms] \label{lemma:typical} Let $\delta,\lambda > 0$ and define \begin{align} \label{proof:resdirect-subst-rateInf} r &:= \exp(n(R-\mutualInformation{X}{Y}-\varepsilon)). \end{align} Suppose $r/(6\lambda) \geq 1$. Then \begin{multline} \label{lemma:typicalbound-probstatement} P_\mathcal{C}\left( \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } > \delta \right) \\ \leq \Bigg( 1 + \sqrt{\frac{3\pi}{2}} \exp\left( \frac{3\lambda^2}{4r} \right) \frac{\lambda}{\sqrt{r}} + \exp(-\lambda) \Bigg) \exp(-\delta\lambda). \end{multline} \end{lemma} Before we prove this lemma, we make an observation that we need in the proof. \begin{lemma} \label{lemma:typical-helper} Let $f$ be a measurable function mapping codebooks and elements of $\mathcal{Y}^n$ to the nonnegative reals and let $\lambda, \delta > 0$. Then \begin{multline} \label{lemma:typical-helper-probstatement} \hat{P} := P_\mathcal{C}\left( \mathbb{E}_{Q^n} f(\mathcal{C}, y^n) > \delta \right) \\ \leq \mathbb{E}_{Q^n} \mathbb{E}_{P_\mathcal{C}} \Big( \exp(\lambdaf(\mathcal{C}, y^n)) \Big) \exp(-\delta\lambda). \end{multline} \end{lemma} \begin{shownto}{arxiv} \begin{proof} An application of the Chernoff bound yields \[ \hat{P} \leq \mathbb{E}_{P_\mathcal{C}} \left( \exp\left( \lambda \mathbb{E}_{Q^n} f(\mathcal{C}, y^n) \right) \right) \exp(-\delta\lambda). \] We can then prove (\ref{lemma:typical-helper-probstatement}) by successive applications of Jensen's inequality and Fubini's theorem. \end{proof} \end{shownto} \begin{shownto}{conference} \begin{proof} An application of the Chernoff bound yields $ \hat{P} \leq \mathbb{E}_{P_\mathcal{C}} \left( \exp\left( \lambda \mathbb{E}_{Q^n} f(\mathcal{C}, y^n) \right) \right) \exp(-\delta\lambda) $. We then prove (\ref{lemma:typical-helper-probstatement}) by applying Jensen's inequality and Fubini's theorem. \end{proof} \end{shownto} \begin{proof}[Proof of Lemma~\ref{lemma:typical}] We begin by examining parts of the term in (\ref{lemma:typicalbound-probstatement}) for fixed, but arbitrary $\mathcal{C}$ and $y^n$ and rewrite \begin{multline*} r \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) = \sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \exp\left(n(-\mutualInformation{X}{Y} - \varepsilon)\right) \\ \cdot \RNDerivative{\kernelPower{K}{n}(C(m), \cdot)}{Q_{Y^n}}(y^n) \indicator{(C(m), y^n) \in \typicalSet{\varepsilon}}. \end{multline*} \begin{shownto}{arxiv} Now, we observe that the indicator function bounds the relative density to be at most $\exp(n(\mutualInformation{X}{Y}+\varepsilon))$ and thus every term in the sum to range within $[0,1]$ and that furthermore \begin{align*} \mathbb{E}_{P_\mathcal{C}}\left( r \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n)\right) &\leq \exp\left(n(-\mutualInformation{X}{Y} - \varepsilon)\right) \\ &\cdot \sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \mathbb{E}_{P_\mathcal{C}}\left( \RNDerivative{\kernelPower{K}{n}(C(m), \cdot)}{Q_{Y^n}}(y^n)\right) \\ &= r. \end{align*} \end{shownto} \begin{shownto}{conference} Now, we observe that the indicator function bounds every term in the sum to range within $[0,1]$ and that furthermore \begin{multline*} \mathbb{E}_{P_\mathcal{C}}\left( r \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n)\right) \leq \exp\left(n(-\mutualInformation{X}{Y} - \varepsilon)\right) \\ \cdot \sum\limits_{m=1}^{\exp(\codebookBlocklengthR)} \mathbb{E}_{P_\mathcal{C}}\left( \RNDerivative{\kernelPower{K}{n}(C(m), \cdot)}{Q_{Y^n}}(y^n)\right) = r. \end{multline*} \end{shownto} We then use these observations to yield, for any $\xi > 0$, \begin{shownto}{arxiv} \begin{align} &\phantom{{}={}} P_\mathcal{C} \left( \exp\left( \lambda \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } \right) > \exp(\lambda\xi) \right) \nonumber \\ \label{proof:resdirect-equalevents} &= P_\mathcal{C} \left( \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) > 1 + \xi \right) \\ &\begin{aligned} = P_\mathcal{C} \bigg( r \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) > \left( 1 + \xi \right) r \bigg) \end{aligned} \nonumber \\ &\leq \label{proof:resdirect-typical-chhoeff} \exp \left( -\frac{\xi^2}{2\left(1+\frac{\xi}{3}\right)} r \right), \end{align} \end{shownto} \begin{shownto}{conference} \begin{align} &\phantom{{}={}} P_\mathcal{C} \left( \exp\left( \lambda \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } \right) > \exp(\lambda\xi) \right) \nonumber \\ \label{proof:resdirect-equalevents} &= P_\mathcal{C} \left( \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) > 1 + \xi \right) \\ &\begin{aligned} = P_\mathcal{C} \bigg( r \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) > \left( 1 + \xi \right) r \bigg) \end{aligned} \leq \label{proof:resdirect-typical-chhoeff} \exp \left( -\frac{\xi^2}{2\left(1+\frac{\xi}{3}\right)} r \right), \end{align} \end{shownto} where (\ref{proof:resdirect-equalevents}) holds because the two measured events are equal and (\ref{proof:resdirect-typical-chhoeff}) follows by the Chernoff-Hoeffding bound~\cite[Theorem 2.3b]{McDiarmidConcentration}. (\ref{proof:resdirect-typical-chhoeff}) can be upper bounded by \begin{shownto}{arxiv} \begin{align} \label{proof:resdirect-typical-lessthanone} \exp \left( -\frac{\xi^2}{3} r \right) \end{align} for $\xi \leq 1$ (in particular) and by \begin{align} \label{proof:resdirect-typical-greaterone} \exp \left( -\frac{\xi}{3} r \right) \end{align} for $\xi \geq 1$ (in particular). \end{shownto} \begin{shownto}{conference} \begin{align} \label{proof:resdirect-typical} \exp \left( -\frac{\xi^2}{3} r \right) \text{ for } \xi \leq 1;~ \exp \left( -\frac{\xi}{3} r \right) \text{ for } \xi \geq 1. \end{align} \end{shownto} We will in the following use the substitutions \showto{arxiv}{ \begin{align} \label{proof:resdirect-subst-dist} a &:= \exp(\lambda\xi) \\ \label{proof:resdirect-subst-int} b &:= \frac{\log(a)}{\lambda} \sqrt{\frac{2r}{3}} - \sqrt{\frac{3}{2r}} \lambda. \end{align} Since we will be using (\ref{proof:resdirect-subst-int}) for integration by substitution, we note that it implies \begin{align} \derivwrt{a}{b} = \exp\left( b \lambda \sqrt{\frac{3}{2r}}+\lambda^2\frac{3}{2r} \right) \lambda \sqrt{\frac{3}{2r}}. \end{align} } \showto{conference}{ \begin{align} \label{proof:resdirect-subst} a := \exp(\lambda\xi) ,~~ b := \frac{\log(a)}{\lambda} \sqrt{\frac{2r}{3}} - \sqrt{\frac{3}{2r}} \lambda. \end{align} } We have, e.g. by~\cite[Eq. 21.9]{BillingsleyProbability}, \begin{align} &\phantom{{}={}} \mathbb{E}_{P_\mathcal{C}} \left( \exp\left( \lambda \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } \right) \right) \nonumber \\ \label{proof:resdirect-exprepres} &= \int\nolimits_0^\infty P_\mathcal{C} \left( \exp\left( \lambda \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } \right) > a \right) da \end{align} and upper bound this integral by splitting the integration domain into three parts: The integration over $[0,1]$ can be upper bounded by $1$ (since the integrand is a probability). The integration over $[1,\exp(\lambda)]$ can be upper bounded by \begin{shownto}{arxiv} \begin{align} \label{proof:resdirect-substitution} &\hphantom{{}={}} \begin{aligned} \int\nolimits_1^{\infty} \exp \left( -\frac{(\log a)^2}{3\lambda^2} r \right) da \end{aligned} \\ \label{proof:resdirect-intsubst} &\begin{aligned} = \int\nolimits_{0}^\infty \exp \Bigg( &- \frac{b^2 \lambda^2 \frac{3}{2r} + 2 b \lambda^3 \left( \frac{3}{2r} \right)^{\frac{3}{2}} + \lambda^4 \left(\frac{3}{2r}\right)^2 } {3\lambda^2} r \\ &+ b \lambda \sqrt{\frac{3}{2r}} + \lambda^2\frac{3}{2r} \Bigg) \lambda \sqrt{\frac{3}{2r}} db \end{aligned} \\ \label{proof:resdirect-intfinal} &= \int\nolimits_{0}^\infty \exp \left( - \frac{b^2}{2} \right) db \cdot \exp\left( \frac{3\lambda^2}{4r} \right) \lambda \sqrt{\frac{3}{2r}}. \end{align} (\ref{proof:resdirect-substitution}) follows by substituting (\ref{proof:resdirect-typical-lessthanone}) as well as (\ref{proof:resdirect-subst-dist}) and enlarging the integration domain to $[1,\infty)$, which can be done because the integrand is nonnegative. (\ref{proof:resdirect-intsubst}) follows by the rule for integration by substitution using (\ref{proof:resdirect-subst-int}). \end{shownto} \begin{shownto}{conference} \begin{align} \label{proof:resdirect-substitution} &\hphantom{{}={}} \begin{aligned} \int\nolimits_1^{\infty} \exp \left( -\frac{(\log a)^2}{3\lambda^2} r \right) da \end{aligned} \\ \label{proof:resdirect-intfinal} &= \int\nolimits_{0}^\infty \exp \left( - \frac{b^2}{2} \right) db \cdot \exp\left( \frac{3\lambda^2}{4r} \right) \lambda \sqrt{\frac{3}{2r}}. \end{align} (\ref{proof:resdirect-substitution}) follows by substituting (\ref{proof:resdirect-typical}) as well as (\ref{proof:resdirect-subst}) and enlarging the integration domain to $[1,\infty)$. (\ref{proof:resdirect-intfinal}) follows by the rule for integration by substitution using (\ref{proof:resdirect-subst}). \end{shownto} The integration over $[\exp(\lambda), \infty)$ can be upper bounded by \begin{align} \label{proof:resdirect-substitution-large} &\hphantom{{}={}} \int\nolimits_{\exp(\lambda)}^{\infty} \exp \left( -\frac{\log a}{3\lambda} r \right) da = \int\nolimits_{\exp(\lambda)}^{\infty} a^{ -r/(3\lambda) } da \\ \label{proof:resdirect-intfinal-large} &= \frac{\exp(\lambda (1-r/(3\lambda)))} {r/(3\lambda)-1} \leq 6\frac{\lambda}{r} \exp\left(-\frac{r}{6}\right) \leq \exp(-\lambda), \end{align} where (\ref{proof:resdirect-substitution-large}) is by (\showto{arxiv}{\ref{proof:resdirect-typical-greaterone}}\showto{conference}{\ref{proof:resdirect-typical}}) and the inequalities are true because $r/(6\lambda) \geq 1$. We now apply Lemma~\ref{lemma:typical-helper} with $ f(\mathcal{C}, y^n) := \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } $. In the resulting bound, we substitute the bound of $1$ for integration domain $[0,1]$ as well as (\ref{proof:resdirect-intfinal}) and (\ref{proof:resdirect-intfinal-large}), substitute back (\ref{proof:resdirect-subst-rateInf}) and note that $\exp(-b^2/2)$ is the well-known unnormalized standard normal density, and get~(\ref{lemma:typicalbound-probstatement}). \end{proof} \begin{proof}[Proof of Theorem~\ref{theorem:firstorder}] \begin{shownto}{arxiv} In order to bound the atypical term in the sum~(\ref{split-typical-atypical}), note first that for any $\alpha>1$, \begin{align} &\hphantom{{}={}} Q_{X^n, Y^n}( \mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon} ) \nonumber \\ &= Q_{X^n, Y^n}\left( \left\{ (x^n,y^n) : \informationDensity{x^n}{y^n}/n > \mutualInformation{X}{Y} + \varepsilon \right\} \right) \nonumber \\ &\begin{aligned} = Q_{X^n, Y^n}\big( &\{ (x^n,y^n) : \exp\left((\alpha-1) \informationDensity{x^n}{y^n}\right) \\ &> \exp\left( (\alpha-1)n\left(\mutualInformation{X}{Y} + \varepsilon \right) \right) \} \big) \end{aligned} \nonumber \\ &\begin{aligned} \leq \label{atypical-bound-markov} &\int\nolimits_{\mathcal{X}^n \times \mathcal{Y}^n} \exp\left( (\alpha-1)\informationDensity{x^n}{y^n} \right) Q_{X, Y}(d(x^n, y^n)) \\ &\cdot \exp\left(-(\alpha-1)n\left(\mutualInformation{X}{Y} + \varepsilon \right) \right) \end{aligned} \\ &\begin{aligned} &\begin{aligned} = \exp \log \Bigg( \int\nolimits_{\mathcal{X}^n \times \mathcal{Y}^n} &\left( \RNDerivative{\kernelPower{K}{n}(C(m), \cdot)}{Q_{Y^n}} (y^n) \right)^{\alpha-1} \\ &\cdot Q_{X, Y}(d(x^n, y^n)) \Bigg) \end{aligned} \\ &~~~\cdot \exp\left( -n(\alpha-1)\left(\mutualInformation{X}{Y} + \varepsilon \right) \right) \nonumber \end{aligned} \\ &= \label{atypical-bound-mutualInformation} \exp \left( -n (\alpha-1) \left( \mutualInformation{X}{Y} + \varepsilon - \renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y} \right) \right) \\ &\leq \label{atypical-bound-final-result} \exp(-n{\beta_1}), \end{align} where~(\ref{atypical-bound-markov}) follows by applying Markov's inequality and~(\ref{atypical-bound-final-result}) as long as \begin{align} \label{proof:resdirect-renyidiv-bound} {\beta_1} \leq (\alpha-1)\left(\mutualInformation{X}{Y} + \varepsilon - \renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y} \right). \end{align} \end{shownto} \begin{shownto}{conference} In order to bound the atypical term in the sum~(\ref{split-typical-atypical}), note first that an application of the Chernoff bound and some elementary manipulations yield, for any $\alpha>1$, \begin{align} &\hphantom{{}={}} Q_{X^n, Y^n}( \mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon} ) \nonumber \\ &\leq \exp \left( -n (\alpha-1) \left( \mutualInformation{X}{Y} + \varepsilon - \renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y} \right) \right) \nonumber \\ &\leq \label{atypical-bound-final-result} \exp(-n{\beta_1}), \end{align} provided $ {\beta_1} \leq (\alpha-1)\left(\mutualInformation{X}{Y} + \varepsilon - \renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y} \right) $.\\ \end{shownto} Note that since the moment-generating function $\mathbb{E}_{Q_{X, Y}} \exp(t \cdot \informationDensity{X}{Y})$ exists and is finite for some $t > 0$, there is some $\alpha' > 1$ such that $\renyidiv{\alpha'}{Q_{X, Y}}{Q_X Q_Y}$ is finite, and thus $\renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y}$ is finite and continuous in $\alpha$ for $\alpha \leq \alpha'$~\cite{RenyiDiv}. Since $\renyidiv{\alpha}{Q_{X, Y}}{Q_X Q_Y} \rightarrow \mutualInformation{X}{Y}$ for $\alpha \rightarrow 1$, we can choose $\alpha > 1$, but sufficiently close to $1$ such that the bound on ${\beta_1}$ is positive. We can now apply Lemma~\ref{lemma:atypical} with $\mu := \exp(-n{\beta_1})$ and $\delta := 1$ and get \begin{multline} P_\mathcal{C}\big( P_{2,\mathcal{C}}(\mathcal{Y}^n) > 2\exp(-n{\beta_1}) \big) \\ \leq \exp\left( -\frac{1}{3} \exp(n(R-{\beta_1})) \right). \label{proof:firstorder-atypical-probability-statement} \end{multline} To bound the typical term in~(\ref{split-typical-atypical}), we apply Lemma~\ref{lemma:typical} with $\lambda := \exp(n{\beta_2})$ and $\delta := \exp(-n{\beta_1})$, which yields \begin{multline} P_\mathcal{C} \left( \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } > \exp(-n{\beta_1}) \right) \leq \\ \label{typical-bound-final-result} \Bigg( 1 + \sqrt{\frac{3 \pi}{2}} \exp\left( \frac{3}{4} \exp(-n(R-\mutualInformation{X}{Y} - \varepsilon - 2{\beta_2}) ) \right) \\ \hphantom{{}+{}}\cdot\exp\left( -\frac{1}{2}n(R-\mutualInformation{X}{Y} - \varepsilon - 2{\beta_2}) \right) \\ + \exp(-\exp(n{\beta_2})) \Bigg) \cdot\exp\left( - \exp(n({\beta_2}-{\beta_1})) \right), \end{multline} as long as $n$ is sufficiently large such that $\exp(n(R-\mutualInformation{X}{Y} - \varepsilon))/6 \geq 1$. We are now ready to put everything together: \begin{shownto}{arxiv} Considering (\ref{split-typical-atypical}), (\ref{proof:firstorder-atypical-probability-statement}) and (\ref{typical-bound-final-result}), an application of the union bound yields the sum of (\ref{proof:firstorder-atypical-probability-statement}) and (\ref{typical-bound-final-result}) as an upper bound for $ P_\mathcal{C} \left( \totalvariation{P_{Y^n | \mathcal{C}} - Q_{Y^n}} > 3\exp(-n{\beta_1}) \right) $. We choose $\varepsilon < R - \mutualInformation{X}{Y}$, then ${\beta_1} < (R - \mutualInformation{X}{Y} -\varepsilon)/2$ small enough to satisfy (\ref{proof:resdirect-renyidiv-bound}), then ${\beta_2}$ such that ${\beta_1} < {\beta_2} < (R - \mutualInformation{X}{Y} -\varepsilon)/2$, and finally we choose $\gamma_1 < {\beta_1}$ and $\gamma_2 < \min(R - {\beta_1}, {\beta_2}-{\beta_1})$. With these choices, we get (\ref{thm:resdirect-probstatement}) for all sufficiently large $n$, thereby concluding the proof. \end{shownto} \begin{shownto}{conference} Considering (\ref{split-typical-atypical}), (\ref{proof:firstorder-atypical-probability-statement}) and (\ref{typical-bound-final-result}), an application of the union bound yields an upper bound for $ P_\mathcal{C} \left( \totalvariation{P_{Y^n | \mathcal{C}} - Q_{Y^n}} > 3\exp(-n{\beta_1}) \right) $. This bound implies (\ref{thm:resdirect-probstatement}) for all sufficiently large $n$ if we choose $\varepsilon < R - \mutualInformation{X}{Y}$, then ${\beta_1} < (R - \mutualInformation{X}{Y} -\varepsilon)/2$ small enough to satisfy the previous condition necessary to ensure (\ref{typical-bound-final-result}), then ${\beta_2}$ such that ${\beta_1} < {\beta_2} < (R - \mutualInformation{X}{Y} -\varepsilon)/2$, then $\gamma_1 < {\beta_1}$ and finally $\gamma_2 < \min(R - {\beta_1}, {\beta_2}-{\beta_1})$. \end{shownto} \end{proof} \begin{shownto}{conference} \begin{remark} \label{remark:firstorder} The requirement that the moment-generating function of the information density exists is needed only to ensure the doubly exponential convergence in (\ref{thm:resdirect-probstatement}). We can instead put the weaker requirement that $\mutualInformation{X}{Y}$ exists and is finite and replace (\ref{thm:resdirect-probstatement}) with the weaker version \begin{align*} \lim\limits_{n \rightarrow \infty} P_\mathcal{C} \left( \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } > \delta \right) = 0 \end{align*} for all $\delta > 0$. This is possible by a slight modification of the proof of Theorem~\ref{theorem:firstorder}, in which we use the law of large numbers to show that $Q_{X^n, Y^n} (\mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon})$ vanishes with $n \rightarrow \infty$ instead of applying the Chernoff bound. \end{remark} \end{shownto} \begin{shownto}{arxiv} The existence of the moment-generating function is only needed to ensure the doubly exponential convergence in (\ref{thm:resdirect-probstatement}). In fact, modifying the preceding proof slightly, we can also establish the following variation of Theorem~\ref{theorem:firstorder}. \begin{theorem} \label{theorem:firstorder-weakened} Given a channel $\mathcal{W} = ((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$, an input distribution $Q_X$ such that $\mutualInformation{X}{Y}$ exists and is finite, there exist $\gamma_1 > 0$ and $\gamma_2 > 0$ such that for large enough block lengths $n$, the randomized codebook distributions of block length $n$ and rate $R$ satisfy, for every $\delta > 0$, \begin{align} \label{thm:resdirect-probstatement-weakened} \lim\limits_{n \rightarrow \infty} P_\mathcal{C} \left( \totalvariation{ P_{Y^n | \mathcal{C}} - Q_{Y^n} } > \delta \right) = 0 \end{align} \end{theorem} \begin{proof} The statement (\ref{thm:resdirect-probstatement}) is proven with an application of the union bound, using as ingredients (\ref{split-typical-atypical}), (\ref{proof:firstorder-atypical-probability-statement}) and (\ref{typical-bound-final-result}). (\ref{split-typical-atypical}) and (\ref{typical-bound-final-result}) do not require that the moment-generating function of the information density exists and moreover, (\ref{typical-bound-final-result}) can be weakened to \[ \lim\limits_{n \rightarrow \infty} P_\mathcal{C} \left( \int\nolimits_{\mathcal{Y}^n} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } Q_{Y^n}(dy^n) > \frac{\delta}{2} \right) = 0 \] for any $\delta > 0$. In order to find a suitable replacement for (\ref{proof:firstorder-atypical-probability-statement}), we consider \begin{multline*} \mathbb{E}_{P_\mathcal{C}}(P_{2,\mathcal{C}}(\mathcal{Y}^n)) = Q_{X^n, Y^n} (\mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon}) = \\ Q_{X^n, Y^n} \left(\left\{ (x^n, y^n): \frac{1}{n} \sum\limits_{j=1}^n \informationDensity{x_j}{y_j} - \mutualInformation{X}{Y} > \varepsilon \right\}\right) \end{multline*} and note that by the law of large numbers, it vanishes for any $\varepsilon > 0$ as $n$ tends to infinity. So by Markov's inequality \begin{align*} P_\mathcal{C}\left(P_{2,\mathcal{C}}(\mathcal{Y}^n) > \frac{\delta}{2}\right) \leq 2 \frac{\mathbb{E}_{P_\mathcal{C}}(P_{2,\mathcal{C}}(\mathcal{Y}^n))} {\delta} \end{align*} also vanishes for any $\delta > 0$. Thus, applying the union bound similarly as in the proof of Theorem~\ref{theorem:firstorder}, we can derive (\ref{thm:resdirect-probstatement-weakened}). \end{proof} \end{shownto} \begin{shownto}{arxiv} \begin{proof}[Proof of Theorem~\ref{theorem:secondorder}] We consider the typical set as defined in~(\ref{def:typicalset}), with \begin{align} \label{def:secondorder-typicalityparam} \varepsilon := \sqrt{\frac{V}{n}} \mathcal{Q}^{-1}(\xi) + d \frac{\log n}{n}. \end{align} In preparation for bounding the atypical term in~(\ref{split-typical-atypical}), we observe \begin{align} &\hphantom{{}={}} Q_{X^n, Y^n}( \mathcal{X}^n \times \mathcal{Y}^n \setminus \typicalSet{\varepsilon} ) \nonumber \\ &= Q_{X^n, Y^n}\left( \left\{ (x^n,y^n) : \informationDensity{x^n}{y^n}/n > \mutualInformation{X}{Y} + \varepsilon \right\} \right) \nonumber \\ \label{proof:secondorder-atypical-subst} &\begin{aligned} = Q_{X^n, Y^n}\Bigg( \Bigg\{ &(x^n,y^n) : \sum\limits_{k=1}^n \frac{1}{n} \Big( \informationDensity{x_k}{y_k} - \mutualInformation{X}{Y} \Big) \sqrt{\frac{n}{V}} \\ &> \mathcal{Q}^{-1}(\xi) + d \frac{\log n}{\sqrt{nV}} \Bigg\} \Bigg) \end{aligned} \\ \label{proof:secondorder-atypical-berry-esseen} &\leq \mathcal{Q}\left( \mathcal{Q}^{-1}(\xi) + d \frac{\log n}{\sqrt{nV}} \right) + \frac{\rho} {V^{\frac{3}{2}} \sqrt{n}} = \mu, \end{align} where (\ref{proof:secondorder-atypical-subst}) follows by substituting (\ref{def:secondorder-typicalityparam}) and (\ref{proof:secondorder-atypical-berry-esseen}) by the Berry-Esseen Theorem. Knowing this, we apply Lemma~\ref{lemma:atypical} with $\delta := 1/\sqrt{n}$ and get \begin{align} \label{proof:secondorder-atypicalbound} P_\mathcal{C}\big( P_{2,\mathcal{C}}(\mathcal{Y}^n) > \mu(1+1/\sqrt{n}) \big) \leq \exp\left( -\frac{1}{3} n \mu \exp(\codebookBlocklengthR) \right). \end{align} In order to get a bound for the typical part of~(\ref{split-typical-atypical}), we apply Lemma~\ref{lemma:typical} with $\lambda := \exp(\frac{n}{2}(R-\mutualInformation{X}{Y}-\varepsilon))$ and $\delta := 1/\sqrt{n}$, which yields \begin{align} &\hphantom{{}={}} P_\mathcal{C}\left( \mathbb{E}_{Q_{Y^n}} \positive{ \RNDerivative{P_{1,\mathcal{C}}}{Q_{Y^n}}(y^n) - 1 } > 1/\sqrt{n} \right) \\ \label{proof:secondorder-typicalbound-lemmaapplication} &\begin{aligned} \leq &\left( 1 + \sqrt{\frac{3\pi}{2}} \exp\left( \frac{3}{4} \right) + \exp\left( -\frac{n}{2}(R - \mutualInformation{X}{Y} - \varepsilon) \right) \right) \\ &\cdot\exp\left( -\frac{1}{\sqrt{n}} \exp\left( \frac{1}{2} n(R-\mutualInformation{X}{Y}-\varepsilon) \right) \right) \end{aligned} \\ \label{proof:secondorder-typicalbound-subst} &\begin{aligned} = &\left( 1 + \sqrt{\frac{3\pi}{2}} \exp\left( \frac{3}{4} \right) + n^{-\frac{1}{2}(c-d)} \right) \exp\left( -n^{ \frac{1}{2} (c - d - 1) } \right) \end{aligned} \\ \label{proof:secondorder-typicalbound-final} &\leq \left( \sqrt{\frac{3\pi}{2}} \exp\left( \frac{3}{4} \right) + \frac{7}{6} \right) \exp\left( -n^{ \frac{1}{2} (c - d - 1) } \right), \end{align} where (\ref{proof:secondorder-typicalbound-lemmaapplication}) is the application of Lemma~\ref{lemma:typical} taking into account the condition $n^{(c-d)/2} \geq 6$ and (\ref{proof:secondorder-typicalbound-subst}) follows by substituting (\ref{def:secondorder-rate}) and (\ref{def:secondorder-typicalityparam}). The inequality (\ref{proof:secondorder-typicalbound-final}) holds because of the condition $n^{(c-d)/2} \geq 6$ . Finally, we arrive at (\ref{theorem:secondorder-probstatement}) by combining (\ref{proof:secondorder-atypicalbound}) and (\ref{proof:secondorder-typicalbound-final}) using the union bound. \end{proof} \end{shownto} \section{Converse Result} \label{section:converse} The main result of this section is Theorem~\ref{theorem:converse}, the converse result for resolvability of continuous channels. We first prove Lemma~\ref{lemma:converse-finite}, a version of the theorem in which only a finite output alphabet is considered, and then show how the statement can be generalized to continuous alphabets by looking at a sequence of discrete approximations of the channel. \begin{theorem} \label{theorem:converse} Let $((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$ be a channel such that $\mathcal{X}$ is compact and for each $A \subseteq \mathcal{Y}$, $x \mapsto K(x, A)$ is a continuous mapping. Let $Q_Y$ be an output distribution and $(\mathcal{C}_\ell)_{\ell \geq 1}$ a sequence of codebooks with strictly increasing block lengths $n_\ell$ and fixed rate $R$ such that $ \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} } = \delta_\ell \leq 1/4 $ with $\delta_\ell \rightarrow 0$. Then there is a joint probability measure $Q_{X,Y}$ with marginal $Q_{Y}$ for $Y$ such that $Q_{X}$ induces $Q_{Y}$ through $K$ and $ \mutualInformationWrt{Q_{X,Y}}{X}{Y} \leq R $. \end{theorem} \begin{lemma} \label{lemma:converse-finite} Let $((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}, {\mathcal{G}}), K)$ be a channel such that $\mathcal{X}$ is compact, $(\mathcal{Y}, {\mathcal{G}})$ is a finite discrete space and $x \mapsto K(x, \cdot)$ is a continuous mapping from $\mathcal{X}$ to the probability measures on $\mathcal{Y}$. Let $Q_Y$ be an output distribution, and $(\mathcal{C}_\ell)_{\ell \geq 1}$ be a sequence of codebooks with strictly increasing block lengths $n_\ell$ and fixed rate $R$ such that \begin{align} \label{lemma:converse-finite-totvar} \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} } = \delta_\ell \leq \frac{1}{4} \end{align} with $\delta_\ell \rightarrow 0$. Define \begin{align} Q_X^{(\ell)} := \frac{1}{n_\ell} \sum_{j = 1}^{n_\ell} P_{X_j | \mathcal{C}_\ell} \end{align} and $Q_{X, Y}^{(\ell)}$ induced by $Q_X^{(\ell)}$ through $K$. Then there is a strictly increasing sequence $(\ell_i)_{i \geq 1}$ such that $Q_{X, Y}^{(\ell_i)}$ converges weakly to some $Q_{X, Y}$, the marginal $Q_X$ induces the marginal $Q_Y$ through $K$ and $\mutualInformationWrt{Q_{X,Y}}{X}{Y} \leq R$. \end{lemma} \begin{remark} The compactness of $\mathcal{X}$ and the continuity of $x \mapsto K(x,A)$ are technical conditions to ensure the convergence in Lemma~\ref{lemma:converse-finite}. It should be a subject of further research to explore whether these conditions can be dropped by using a more involved discretization or a wholly different technique. \end{remark} \begin{proof}[Proof of Lemma~\ref{lemma:converse-finite}] Since $\mathcal{X}$ is compact, the space of measures $\mu$ on $(\mathcal{X}, {\mathcal{F}})$ such that $\mu(\mathcal{X}) \leq 1$ endowed with the weak topology is compact~\cite[Corollary 31.3]{BauerMeasure}. Therefore, $(Q_X^{(\ell)})_{\ell \geq 1}$ must have a convergent subsequence, or, put differently, there is a strictly increasing sequence $(\ell_i)_{i \geq 1}$ such that $(Q_X^{(\ell_i)})_{i \geq 1}$ converges weakly to some $Q_{\hat{X}}$. By~\cite[Theorem A.5.9]{dupuis2011weak}, $Q_{X, Y}^{(\ell_i)}$ converges weakly to some $Q_{\hat{X}, \hat{Y}}$ and the marginal $Q_{\hat{X}}$ induces the marginal $Q_{\hat{Y}}$ through $K$. \begin{shownto}{arxiv} We note \begin{align*} &\hphantom{{}={}} \totalvariation{ P_{Y_j | \mathcal{C}_\ell} - Q_Y } \\ &= \frac{1}{2} \sum\limits_{y \in \mathcal{Y}} \absolute{ P_{Y_j | \mathcal{C}_\ell}(\{y\}) - Q_Y(\{y\}) } \\ &= \frac{1}{2} \sum\limits_{y \in \mathcal{Y}} \absolute{ \sum_{\substack{y^{n_\ell} \in \mathcal{Y}^{n_\ell} \\ y_j = y}} \left( P_{Y^{n_\ell} | \mathcal{C}_\ell}(\{y^{n_\ell}\}) - Q_{Y^{n_\ell}}(\{y^{n_\ell}\}) \right) } \\ &\leq \frac{1}{2} \sum\limits_{y^{n_\ell} \in \mathcal{Y}^{n_\ell}} \absolute{ P_{Y^{n_\ell} | \mathcal{C}_\ell}(\{y^{n_\ell}\}) - Q_{Y^{n_\ell}}(\{y^{n_\ell}\}) } \\ &= \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} } \end{align*} \end{shownto} \begin{shownto}{conference} We note that, by the triangle inequality, $ \totalvariation{ P_{Y_j | \mathcal{C}_\ell} - Q_Y } \leq \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} } $ for any $j$, and therefore \end{shownto} \begin{shownto}{arxiv} and therefore \begin{align} \totalvariation{ Q_Y^{(\ell)} - Q_Y } &= \totalvariation{ \frac{1}{n_\ell} \sum_{j = 1}^{n_\ell} P_{Y_j | \mathcal{C}_\ell} - Q_Y } \nonumber \\ &\leq \frac{1}{n_\ell} \sum_{j = 1}^{n_\ell} \totalvariation{ P_{Y_j | \mathcal{C}_\ell} - Q_Y } \nonumber \\ &\leq \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} }. \label{proof:converse-finite-totvar-bound} \end{align} \end{shownto} \begin{shownto}{conference} \begin{align} &\hphantom{{}={}} \totalvariation{ Q_Y^{(\ell)} - Q_Y } = \totalvariation{ \frac{1}{n_\ell} \sum_{j = 1}^{n_\ell} P_{Y_j | \mathcal{C}_\ell} - Q_Y } \nonumber \\ &\leq \frac{1}{n_\ell} \sum_{j = 1}^{n_\ell} \totalvariation{ P_{Y_j | \mathcal{C}_\ell} - Q_Y } \leq \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_{\ell}} - Q_{Y^{n_\ell}} }. \label{proof:converse-finite-totvar-bound} \end{align} \end{shownto} So $Q_Y^{(\ell)}$ converges to $Q_Y$ in total variation and thus, in particular, weakly. Moreover, we have $Q_Y = Q_{\hat{Y}}$ because marginalization is a continuous operation under the weak topology, so we can write $Q_{X,Y}$ instead of $Q_{\hat{X},\hat{Y}}$. We further observe \begin{shownto}{arxiv} \begin{align} &\hphantom{{}={}} n_\ell R \geq \entropyWrt{P_{X^{n_\ell} | \mathcal{C}_{\ell}}}{X} \geq \mutualInformationWrt{P_{X^{n_\ell}, Y^{n_\ell} | \mathcal{C}_{\ell}}}{X^{n_\ell}}{Y^{n_\ell}} \nonumber \\ &= \sum_{\substack{x^{n_\ell} \in \mathcal{X}^{n_\ell} \\ y^{n_\ell} \in \mathcal{Y}^{n_\ell}}} P_{X^{n_\ell}, Y^{n_\ell} | \mathcal{C}_\ell} (\{(x^{n_\ell}, y^{n_\ell})\}) \log \frac{\kernelPower{K}{n_\ell}(x^{n_\ell}, \{y^{n_\ell}\})} {P_{Y^{n_\ell} | \mathcal{C}_\ell}(\{y^{n_\ell}\})} \nonumber \\ &\begin{aligned} =\> &\sum_{j=1}^{n_\ell} \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} P_{X_j, Y_j | \mathcal{C}_\ell} (\{(x, y)\}) \log K(x, \{y\}) \\ &+ \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \end{aligned} \nonumber \\ &\begin{aligned} =\> &n_\ell \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} Q_{X, Y}^{(\ell)}(\{x, y\}) \log \frac{K(x, \{y\})} {Q_{Y}^{(\ell)}(\{y\})} \\ &+ n_\ell \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} Q_{X, Y}^{(\ell)}(\{x, y\}) \log Q_{Y}^{(\ell)}(\{y\}) + \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \end{aligned} \nonumber \\ &= n_\ell \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} - n_\ell \entropyWrt{Q_{Y}^{(\ell)}}{Y} + \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \nonumber \\ \label{proof:converse-finite-totvar-application} &\geq n_\ell \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} + \frac{1}{2} \delta_\ell \log\frac{\delta_\ell}{2 \cardinality{\mathcal{Y}^{n_\ell}}} + \frac{1}{2} {n_\ell} \delta_\ell \log\frac{\delta_\ell}{2 \cardinality{\mathcal{Y}}} \\ &\geq n_\ell \left( \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} + \delta_\ell \log\frac{\delta_\ell}{2 \cardinality{\mathcal{Y}}} \right) \nonumber, \end{align} \end{shownto} \begin{shownto}{conference} \begin{align} &\hphantom{{}={}} n_\ell R \geq \entropyWrt{P_{X^{n_\ell} | \mathcal{C}_{\ell}}}{X} \geq \mutualInformationWrt{P_{X^{n_\ell}, Y^{n_\ell} | \mathcal{C}_{\ell}}}{X^{n_\ell}}{Y^{n_\ell}} \nonumber \\ &\begin{aligned} =\> &\sum_{j=1}^{n_\ell} \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} P_{X_j, Y_j | \mathcal{C}_\ell} (\{(x, y)\}) \log K(x, \{y\}) \\ &+ \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \end{aligned} \nonumber \\ &\begin{aligned} =\> &n_\ell \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} Q_{X, Y}^{(\ell)}(\{x, y\}) \log \frac{K(x, \{y\})} {Q_{Y}^{(\ell)}(\{y\})} \\ &+ n_\ell \sum_{\substack{x \in \mathcal{X} \\ y \in \mathcal{Y}}} Q_{X, Y}^{(\ell)}(\{x, y\}) \log Q_{Y}^{(\ell)}(\{y\}) + \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \end{aligned} \nonumber \\ &= n_\ell \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} - n_\ell \entropyWrt{Q_{Y}^{(\ell)}}{Y} + \entropyWrt{P_{Y^{n_\ell} | \mathcal{C}_\ell}}{Y^{n_\ell}} \nonumber \\ \label{proof:converse-finite-totvar-application} &\geq n_\ell \left( \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} + \delta_\ell \log\frac{\delta_\ell}{2 \cardinality{\mathcal{Y}}} \right), \end{align} \end{shownto} where (\ref{proof:converse-finite-totvar-application}) is an application of~\cite[Lemma 2.7]{CsiszarInformation}\footnote{Note that the definition of the variational distance in~\cite{CsiszarInformation} differs from the one used in this paper by a factor of $1/2$.} taking into consideration (\ref{lemma:converse-finite-totvar}) and (\ref{proof:converse-finite-totvar-bound}). Thus, in particular, because the mutual information is lower semicontinuous in the weak topology \cite[Theorem 1]{PosnerRandom}, we can conclude \[ \mutualInformationWrt{Q_{X, Y}}{X}{Y} \leq \liminf\limits_{\ell \rightarrow \infty} \mutualInformationWrt{Q_{X, Y}^{(\ell)}}{X}{Y} \leq R. \qedhere \] \end{proof} \begin{proof}[Proof of Theorem~\ref{theorem:converse}] Pick an increasing sequence $({\mathcal{G}}_k)_{k \geq 1}$ of finite algebras on $\mathcal{Y}$ such that $\bigcup_{k \geq 1} {\mathcal{G}}_k$ generates ${\mathcal{G}}$. Recursively construct sequences $(\ell_i^{(k)})_{i \geq 1}$ for each $k \geq 0$. Set $\ell_i^{(0)} := i$. In order to construct $(\ell_i^{(k)})_{i \geq 1}$ for $k > 0$, first define a discrete finite alphabet $ \mathcal{Y}_k := \{ y \subseteq \mathcal{Y} : y \text{ is an atom of } {\mathcal{G}}_k \} $ and note that any probability measure $\mu$ on $\mathcal{Y}$ induces a probability measure $\mu^{(k)}$ on $\mathcal{Y}_k$ via $ \mu^{(k)}(A) := \mu\left(\bigcup A\right) $ and conversely, $\mu^{(k)}$ can be seen as a probability measure on $(\mathcal{Y}, {\mathcal{G}}_k)$ by assigning to any set in ${\mathcal{G}}_k$ the sum of the probabilities of all contained atoms, or, put equivalently, $\mu^{(k)}$ can be seen as the restriction of $\mu$ to ${\mathcal{G}}_k$. So for each $x \in \mathcal{X}$, $K(x, \cdot)$ induces a probability measure $K^{(k)}(x, \cdot)$ on $\mathcal{Y}_k$ and thus we get a stochastic kernel $K^{(k)}$ and thereby a channel $((\mathcal{X}, {\mathcal{F}}), (\mathcal{Y}_k, \mathcal{P}(\mathcal{Y}_k)) , K^{(k)})$. $x \mapsto K^{(k)}(x, \cdot)$ is a continuous map to the space of probability vectors on $\mathcal{Y}_k$, because $x \mapsto K(x, y)$ is continuous for each $y \in \mathcal{Y}_k$. Furthermore, $Q_Y$ induces $Q_Y^{(k)}$ in the same way. A codebook $\mathcal{C}_\ell$ is also a codebook for the new channel, and we note that also $P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)}$ is induced by $P_{Y^{n_\ell} | \mathcal{C}_\ell}$ in the same way. So for any $A \subseteq \mathcal{Y}_k$, we have $P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)}(A) = P_{Y^{n_\ell} | \mathcal{C}_\ell}( \bigcup A )$ and $Q_Y^{(k)}(A) = Q_Y(\bigcupA)$. Thus, \begin{shownto}{arxiv} \begin{align*} \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)} - Q_Y^{(k)} } &= \sup\limits_{A \subseteq \mathcal{Y}_k} \left( P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)}(A) - Q_Y^{(k)}(A) \right) \\ &\leq \sup\limits_{A \in {\mathcal{G}}} \left( P_{Y^{n_\ell} | \mathcal{C}_\ell}(A) - Q_Y(A) \right) \\ &= \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_\ell} - Q_Y }. \end{align*} \end{shownto} \begin{shownto}{conference} \begin{align*} &\hphantom{{}={}} \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)} - Q_Y^{(k)} } = \sup\limits_{A \subseteq \mathcal{Y}_k} \left( P_{Y^{n_\ell} | \mathcal{C}_\ell}^{(k)}(A) - Q_Y^{(k)}(A) \right) \\ &\leq \sup\limits_{A \in {\mathcal{G}}} \left( P_{Y^{n_\ell} | \mathcal{C}_\ell}(A) - Q_Y(A) \right) = \totalvariation{ P_{Y^{n_\ell} | \mathcal{C}_\ell} - Q_Y }. \end{align*} \end{shownto} We can therefore apply Lemma~\ref{lemma:converse-finite} to the codebook sequence $(\mathcal{C}_{\ell_i^{(k - 1)}})_{i \geq 1}$ to obtain a subsequence $(\ell_i^{(k)})_{i \geq 1}$ of $(\ell_i^{(k-1)})_{i \geq 1}$ such that $Q_{X, Y}^{(\ell_i^{(k)})}$ converges weakly to some $Q_{X, Y}^{(k)}$ such that $Q_{X}^{(k)}$ induces $Q_{Y}^{(k)}$ through $K^{(k)}$. Because of the subsequence construction, all the $Q_{X, Y}^{(k)}$ are compatible with each other and seeing them as measures on $(\mathcal{X} \times \mathcal{Y}, {\mathcal{F}} \otimes {\mathcal{G}}_k)$, we can define a probability measure $Q_{X, Y}$ on $(\mathcal{X} \times \mathcal{Y}, {\mathcal{F}} \otimes {\mathcal{G}})$ as the unique extension~\cite[Theorem 3.1]{BillingsleyProbability} of $ \bigcup_{k \geq 1} Q_{X, Y}^{(k)} $ to the $\sigma$-algebra ${\mathcal{F}} \otimes {\mathcal{G}}$. Since also the marginals are compatible (the marginals for $X$ are even identical), we can apply \cite[Corollary 5.2.3]{gray2011entropy} and obtain $\mutualInformationWrt{Q_{X, Y}^{(k)}}{X}{Y} \rightarrow \mutualInformationWrt{Q_{X, Y}}{X}{Y}$. Since we know from the statement of Lemma~\ref{lemma:converse-finite} that for all $k$, $\mutualInformationWrt{Q_{X, Y}^{(k)}}{X}{Y} \leq R$, it follows that $\mutualInformationWrt{Q_{X, Y}}{X}{Y} \leq R$, completing the proof of the theorem. \end{proof} \bibliographystyle{plain}
\section{Introduction}\label{section:introduction} Let $\Omega\subset\re^n$ be a bounded open smooth set. The Moser-Trudinger imbedding, which is due to Trudinger \cite{Trudinger} and in its sharp form to Moser \cite{Moser}, states that the following supremum is finite $$ \sup_{\substack {v\in W^{1,n}_0(\Omega) \\ \|\nabla v\|_{L^n}\leq 1}} \int_{\Omega}\left(e^{n\cnn v^\frac{n}{n-1}}-1\right)<\infty. $$ First it has been shown by Carleson-Chang \cite{Carleson-Chang} that the supremum is actually attained, if $\Omega$ is a ball. In \cite{Struwe 1}, Struwe proved for $n=2$ that the result remains true if $\Omega$ is close to a ball. Using the harmonic transplantation method Flucher \cite{Flucher} generalized this result to arbitrary bounded domains in $\re^2.$ If $n=2$ and $\Omega$ is the unit disk some new proofs have been obtained of the Moser-Trudinger inequality, respectively of the Carleson-Chang's result in Mancini-Martinazzi \cite{Gabriele Mancini and Martinazzi}. Other results dealing with critical points and extremal functions of the Moser-Trudinger inequality, or its sharper version, have also been obtained in Malchiodi-Martinazzi \cite{Malchiodi-Martinazzi} (for $\Omega$ equal the unit disk), Adimurthi-Druet \cite{Adimurthi-Druet} and Yang \cite{Yunyan Yang 2006}, \cite{Yunyan Yang 2006 manifold} (for a version on manifolds) and \cite{Yunyan Yang 2015 JDE}. These results use blow up analysis and are all restricted to $2$ dimensions. See also Adimurthi-Tintarev \cite{Adi-Tintarev}, Mancini-Sandeep \cite{manchini}, \cite{ngo}, \cite{ngyuen}, \cite{taka} and Yang \cite{Yunyan Yang manifold 2} and the references in these papers for other recent developments on the subject. However, the only result dealing with the extremal functions in higher dimension and more general bounded domains than balls, is by Lin \cite{Lin K C}, who gives an outline of a method how Flucher's proof can be generalized to $n\geq 3.$ Setting $\beta=0$ in this present paper we implicitly give rigorous proofs to all of Lin's statements. The Moser-Trudinger embedding has been generalized by Adimurthi-Sandeep \cite{Adi-Sandeep} to a singular version, which reads as the following: If $\alpha>0$ and $\beta\in[0,n)$ is such that \begin{equation} \label{intro:eq:alpha and beta sum} \frac{\alpha}{\alpha_n}+\frac{\beta}{n}\leq 1,\quad\text{ where }\alpha_n= n\cnn, \end{equation} $\omega_{n-1}$ is the $\mathcal{H}^{n-1}$ measure of the unit sphere, then the following supremum is finite \begin{equation} \label{eq:intro:supremum sing moser trud} \sup_{\substack {v\in W^{1,n}_0(\Omega) \\ \|\nabla v\|_{L^n}\leq 1}} \int_{\Omega}\frac{e^{\alpha |v|^\frac{n}{n-1}}-1}{|x|^{\beta}}<\infty\,. \end{equation} In the case $n=2$ it was proven first in Csat\'o-Roy \cite{Csato Roy Calc var Pde}, \cite{Csato Roy Comm in PDE} that the supremum is attained. Afterwards, using blow-up analyis, the same result and some refinements have also been obtained by Yang and Zhu \cite{Yunyan Yang and Zhu JFA 2017}. Their proof is based on classification theorems in $2$ dimensions by Chen and Li \cite{Chen Li Duke 1991}, \cite{Chen Li Duke 1995}. Recently, also in $2$ dimensions, a third proof was given by Lula-Mancini \cite{Lula and Mancini Gabriele}, also depending on \cite{Chen Li Duke 1991}. We point out that there is no available Chen-Li type classification result in higher dimensions. The aim of this paper is to generalize \cite{Csato Roy Calc var Pde} to higher dimensions and we prove the following theorem. {\color{red} \begin{theorem}\label{theorem:intro:Extremal for Singular Moser-Trudinger} Let $n\geq 2$ and $\Omega\subset\re^n$ be a bounded open smooth set. Let $\alpha>0$ and $\beta\in[0,n)$ be such that \eqref{intro:eq:alpha and beta sum} is satisfied. Then there exists $u\in W_0^{1,n}\left(\Omega\right)$ such that $\|\nabla u\|_{L^n}\leq 1, $ $u\geq 0$ and $$ \sup_{\substack {v\in W^{1,n}_0(\Omega) \\ \|\nabla v\|_{L^n}\leq 1}} \int_{\Omega}\frac{e^{\alpha |v|^{\frac{n}{n-1}}}-1}{|y|^{\beta}}dy=\int_{\Omega }\frac{e^{\alpha u^{\frac{n}{n-1}}}-1}{|y|^{\beta}}dy. $$ \end{theorem}} It is an immediate consequence of this theorem, that $u\in W_0^{1,n}$ gives a weak solution, for some $\mu>0,$ to the following semilinear elliptic eqaution involving the $n$-Laplacian $$ \left\{\begin{array}{rl} -\Delta_n u=\mu\,u^{\frac{1}{n-1}}\, e^{\alpha u^{\frac{n}{n-1}}}\,\frac{1}{|y|^{\beta}} & \text{ in }\Omega \smallskip \\ u\geq 0 & \text{ in }\Omega \smallskip \\ u=0 & \text{ on }\partial\Omega, \end{array}\right. $$ satisfying moreover $\int_{\Omega}|\nabla u|^n=1.$ The proof of Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger} follows the ideas of Flucher \cite{Flucher}, respectively Lin \cite{Lin K C} and we have given an overview of the method in Csat\'o-Roy \cite{Csato Roy Calc var Pde}, which we will not repeat here. The case $0\notin\Omegabar$ is rather elementery and exactly as in the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}, and the main difficulty is the case $0\in\Omega.$ The proof of Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger}, roughly speaking, consists in reducing the problem to a kind of isoperimetric problem with density involving the $n$-Green's function. The $n$-Green's function $G_{\Omega,0}$ of a general domain $\Omega$ containing the origin has the form $$ G_{\Omega,0}(y)=-\frac{1}{\cnn}\log|y|-H(y), $$ where $H$ is the regular part. The conformal incenter at $0$ is then defined by $$ I_{\Omega}(0)=e^{-\cnn H(0)}. $$ This is usually called the conformal inradius at $0,$ see Flucher \cite{Flucher book} and we have adopted the name conformal incenter at $0$ in \cite{Csato Roy Calc var Pde} mistakenly. However, in this paper, we will stick to this name for consistency with \cite{Csato Roy Calc var Pde}, \cite{Csato Roy Comm in PDE}. The isoperimetric problem to which the question of the existence of extremal function is reduced is the following inequality: \begin{equation} \label{eq:intro:main conjecture for G} \omega_{n-1}^{\frac{n}{n-1}}I_{\Omega}^{n-\beta}(0) \leq \int_{\partial\Omega}\frac{1}{|y|^{\beta}|\nabla G_{\Omega,0}(y)|}\dH(y)\quad \text{ for any $\Omega$ with $0\in\Omega$}. \end{equation} There is equality for balls cetered at the origin. Let us now point out the two main differences and difficulties compared to the $2$-dimensional case: \smallskip \textit{1.} The reduction of the problem to \eqref{eq:intro:main conjecture for G} uses the $n$-harmonic transplantation. This uses existence, regularity and other properties of th $n$-Laplace equation, which is a linear equation only if $n=2.$ Solutions to the $n$-Laplace equation have moreover weaker regularity properties if $n> 2.$ The difficulties are more of technical type and are mostly relevant in Section \ref{section:domain to ball}. \smallskip \textit{2.} If $n=2$ then \eqref{eq:intro:main conjecture for G} was proven by the following three inequalities (where $R_{\Omega}$ is the radius of $\Omega^{\ast},$ i.e. $\pi R_{\Omega}^2=|\Omega|$) \begin{align*} \omega_1^2I_{\Omega}^{2-\beta}(0) \,\substack{\phantom{\text{(a)}}\\ \leq \\ \text{(a)}}&\, \omega_1^2 R_{\Omega}^{2-\beta}=\omega_1^2\left(\frac{|\Omega|}{\pi}\right)^ {\frac{2-\beta}{2}} \,\substack{\phantom{\text{(b)}}\\ \leq \\ \text{(b)}}\, \left(\intdelomega\frac{1}{|y|^{\beta/2}}d\mathcal{H}^1(y)\right)^2 \smallskip \\ =& \left(\intdelomega\frac{\sqrt{|\nabla G|}}{\sqrt{|y|^{\beta}|\nabla G|}}d\mathcal{H}^1(y)\right)^2 \,\substack{\phantom{\text{(c)}}\\ \leq \\ \text{(c)}}\, \intdelomega\frac{1}{|y|^{\beta}|\nabla G|}d\mathcal{H}^1(y). \end{align*} The estimate (a), i.e. $I_{\Omega}\leq R_{\Omega}$ is standard, (b) is a weighted isoperimetric inequality and (c) is just H\"older inequality and the elementery property $\int_{\delomega}|\nabla G|=1.$ This is the method followed by Flucher \cite{Flucher}, Csat\'o-Roy \cite{Csato Roy Calc var Pde}. If $\beta=0,$ then the same steps work in any dimension, just by using the classical isoperimetric inequality and this is what was used by Lin \cite{Lin K C}. If $\beta\neq0,$ then the corresponding weighted isoperimetric inequality was proven by Csat\'o \cite{Csato DIE} if $n=2.$ However, a higher dimensional version of the appropriate weighted isoperimetric inequality fails, see Csat\'o \cite{Csato Isop with density n dim} Theorem 9 (ii) and Example 11. Example 11 shows precisely that such an isoperimetric inequality even fails for any ball not centered at the origin. Moreover, if $n\geq 3$ both estimates (a) and (c) are too generous to prove \eqref{eq:intro:main conjecture for G}, as numerical evidence suggests. So a completely new method had to be developed to prove the higher dimensional case, without using any of the estimates (a)-(c). {\color{red} This new method relies on a careful analysis of the properties of $G_{\Omega,0}$ and on a different weighted isoperimetric inequality by Alvino, Brock, Chiacchio, Mercaldo and Posteraro \cite{Alvino} Theorem $1.1$ (ii), which reads as. $$ \int_{\Omega}|y|^{-\beta} dy \leq C\left(\int_{\partial \Omega} |y|^{-\frac{n-1}n\beta} d\mathcal{H}^{n-1}(y)\right)^{\frac{n}{n-1}} \quad\text{ for any smooth set $\Omega\subset\re^n,$} $$ where $C$ is such that equality holds for balls centered at the origin.} The proof of \eqref{eq:intro:main conjecture for G} is contained in Section \ref{section:n greens function}. \smallskip \section{Notations and Definitions}\label{section:notation} Throughout this paper $n\geq 2$ is an integer and $\Omega\subset\re^n$ will denote a bounded open set with smooth boundary $\delomega.$ Its $n$-dimensional Lebesgue measure is written as $|\Omega|.$ The $(n-1)$-dimensional Hausdorff measure is denoted by $\mathcal{H}^{n-1}.$ Balls with radius $R$ and center at $x$ are written $B_R(x)\subset\re^n;$ if $x=0,$ we simply write $B_R$. The space $W^{1,n}(\Omega)$ denotes the usual Sobolev space of functions and $W^{1,n}_0(\Omega)$ those Sobolev functions with vanishing trace on the boundary. Throughout this paper $\alpha,\beta\in \re$ are two constants satisfying $\alpha>0,$ $\beta\in[0,n)$ and $$ \frac{\alpha}{\alpha_n}+\frac{\beta}{n}\leq 1,\quad\text{ where }\alpha_n= n\cnn, $$ where $\omega_{n-1}$ is the $\mathcal{H}^{n-1}$ measure of the unit sphere. $-$ We define the the funtctionals $F_{\Omega},J_{\Omega}:W_0^{1,n}(\Omega)\to \re$ by \begin{align*} F_{\Omega}(u)=&\int_{\Omega}\frac{e^{\alpha |u|^{\frac{n}{n-1}}}-1}{|x|^{\beta}}\,dx, \smallskip \\ J_{\Omega}(u)=&\int_{\Omega}\left(e^{\alpha_n |u|^{\frac{n}{n-1}}}-1\right)dx. \smallskip \\ \end{align*} $-$ We say that a sequence $\{u_i\}\subset W_0^{1,n}(\Omega)$ concentrates at $x\in\Omegabar$ if $$ \lim_{i\to\infty}\|\nabla u_i\|_{L^n}=1\quad\text{ and }\quad\forall\;\epsilon>0\quad \lim_{i\to\infty}\int_{\Omega\backslash B_{\epsilon}(x)}|\nabla u_i|^n=0. $$ This definition is equivalent to the convergence $|\nabla u_i|^ndx\rightharpoonup \delta_x$ weakly in measure, where $\delta_x$ is the Dirac measure at $x.$ We will use the following well known property of concentrating sequences: if $\{u_i\}$ concentrates, then $u_i\rightharpoonup 0$ in $W^{1,n}(\Omega).$ In particular \begin{equation} \label{eq:properties of concentrating sequences} u_i\to 0\quad\text{ in }L^q(\Omega)\quad\text{ for all }q<\infty. \end{equation} \smallskip $-$ We define the sets $$ W^{1,n}_{0,rad}(B_1)=\left\{u\in W^{1,n}_0(B_1)\,\Big|\, u\text{ is radial }\right\} $$ and analogously $C_{c,rad}^{\infty}(B_1)$ is the set of radially symmetric smooth functions with compact support in $B_1$. By abuse of notation we will usually write $u(x)=u(|x|)$ for $u\in W^{1,n}_{0,rad}(B_1).$ The space $C_{c,rad}^{\infty}(B_1)$ is dense in $W^{1,n}_{0,rad}(B_1)$ in the $W^{1,n}$ norm. If in addition $u$ is radially decreasing we write $u\in W^{1,n}_{0,rad\searrow}(B_1),$ respectively $u\in C_{c,rad\searrow}^{\infty}(B_1).$ \smallskip $-$ Define $$ \mathcal{B}_1(\Omega)=\left\{u\in W^{1,n}_0(\Omega)\,\big|\,\|\nabla u\|_{L^n}\leq 1\right\}. $$ \smallskip $-$ Finally we define $$ F_{\Omega}^{\text{sup}}=\sup_{u\in \mathcal{B}_1(\Omega)}F_{\Omega}(u). $$ $J_{\Omega}^{\text{sup}}$ is defined in an analogous way, replacing $F$ by $J.$ If $x\in\Omegabar$ and the supremum is taken only over concentrating sequences, we write $F_{\Omega}^{\delta}(x),$ more precisely $$ F_{\Omega}^{\delta}(x)=\sup\left\{\limsup_{i\to\infty}F_{\Omega}(u_i)\,\Big|\quad \{u_i\}\subset \mathcal{B}_1(\Omega)\text{ concentrates at } x\right\}. $$ We define in an analogous way $J_{\Omega}^{\delta}(x).$ If $\Omega=B_1$, then we define $$ F_{B_1,rad\searrow}^{\text{sup}}=\sup_{u\in W^{1,n}_{0,rad\searrow}(B_1)\cap \mathcal{B}_1(B_1)}F_{B_1}(u), $$ $$ F^{\delta}_{B_1,rad\searrow}(0)=\sup\left\{\limsup_{i\to\infty}F_{B_1}(u_i)\,\Big|\quad \{u_i\}\subset W_{0,rad\searrow}^{1,n}(B_1)\cap \mathcal{B}_1(B_1)\text{ concentrates at } 0\right\}. $$ We define $J_{B_1,rad\searrow}^{\text{sup}}$ and $J^{\delta}_{B_1,rad\searrow}(0)$ in an analogous way. \smallskip $-$ If $\Omega\subset\re^n$ then $\Omega^{\ast}$ is its symmetric rearrangement, that is $\Omega^{\ast}=B_R(0),$ where $|\Omega|=R^n\omega_{n-1}/n .$ If $u\in W_0^{1,n}(\Omega),$ then $u^{\ast}\in W^{1,n}_{0,rad\searrow}(B_R(0))$ will denote the Schwarz symmetrization of $u.$ For basic propertis of the Schwarz symmetrization we refer to Kesavan \cite{Kesavan}, Chapters 1 and 2, which we will use throughout. In particular we will use frequently and without further comment that if $u\in W_0^{1,2}(\Omega),$ then $u^{\ast}$ satisfies $$ F_{B_R}(u)\leq F_{B_R}(u^{\ast}) \quad\text{ if }\Omega=B_R \quad\text{ and }\quad \|\nabla u^{\ast}\|_{L^n(B_R)}\leq \|\nabla u\|_{L^n(\Omega)}. $$ We will additionally need, as in Flucher \cite{Flucher}, a slight modification of the Hardy-Littlewood, respectively P\'olya-Szeg\"o theorem, stated in the next proposition. \begin{proposition} \label{prop:Hardy littlewoood modified} (i) Lef $f\in L^p(\Omega)$ and $g\in L^q(\Omega),$ where $1/p+1/q=1.$ Then for any $a\in \re$ $$ \int_{\{f\geq a\}}f\,g\leq \int_{\{f^{\ast}\geq a\}}f^{\ast}g^{\ast}. $$ \smallskip (ii) Let $u\in W^{1,n}_0(\Omega)$ such that $u\geq 0.$ Then for any $t\in (0,\infty)$ $$ \int_{\{u^{\ast}\leq t\}}|\nabla u^{\ast}|^n\leq \int_{\{u\leq t\}}|\nabla u|^n \quad\text{ and }\quad \int_{\{u^{\ast}\geq t\}}|\nabla u^{\ast}|^n\leq \int_{\{u\geq t\}}|\nabla u|^n. $$ \end{proposition} \smallskip \section{$n$-Green's function} \label{section:n greens function} If $x\in\Omega,$ then $G_{\Omega,x}$ will denote the $n$-Green's function of $\Omega$ with singularity at $x.$ It is the unique function defined on $\Omega\backslash\{x\}$ such that the principal value of the integral \begin{equation} \label{eq:definition G Omega x} \intomega |\nabla G_{\Omega,x}(y)|^{n-2}\left\langle \nabla G_{\Omega,x}(y); \nabla\varphi(y)\right\rangle dy=\varphi(x)\quad\text{ for all }\varphi\in C_c^1(\Omega) \end{equation} and $G_{\Omega,x}=0$ on $\delomega.$ It can always be decomposed in the form $$ G_{\Omega,x}(y)=-\frac{1}{\cnn}\log(|x-y|)-H_{\Omega,x}(y),\qquad y\in\Omega\backslash\{x\}, $$ where $H_{\Omega,x}$ is a continuous function on $\Omegabar$ and is $C^{1,\alpha}_{loc}$ in $\Omega \setminus \{x\}.$ This result is due to \cite{Kichenassamy Veron} (see therein Theorem stated in (0.10) and (0.11) or Theorem 2.1 and in particular Remark 1.4). Another useful reference on the $n$-Green's function is \cite{Wang Wei}. The conformal incenter $I_{\Omega}(x)$ of $\Omega$ at $x$ is defined by $$ I_{\Omega}(x)=e^{-\cnn H_{\Omega,x}(x)}. $$ Before stating the next proposition we need the following definition. \smallskip \begin{definition} We say that a sequence of sets $\{A_i\}\subset \re^n$ are approximately small balls at $x\in\re^n$ (of radius $\tau_i$) as $i\to\infty$ if there exists sequences $\tau_i,\sigma_i>0$ such that $\lim_{i\to\infty}\tau_i=0,$ $$ \lim_{i\to\infty}\frac{\sigma_i}{\tau_i}=0 $$ and $$ B_{\tau_i-\sigma_i}(x)\subset A_i\subset B_{\tau_i+\sigma_i}(x)\quad\text{ for all $i$ big enough.} $$ \end{definition} We will need the following properties of the $n$-Green's function. For what follows it is convenient to abbreviate, for $\beta\in [0,n)$ $$ \alpha_{n,\beta}=(n-\beta)\omega_{n-1}^{1/(n-1)}. $$ \begin{proposition} \label{proposition:properties of Green's function} Let $x\in\Omega.$ Then $G_{\Omega,x}$ and $I_{\Omega}(x)$ have the following properties: (a) For every $t\in[0,\infty)$ $$ \int_{\{G_{\Omega,x}<t\}}\left|\nabla G_{\Omega,x}(y)\right|^n dy=t. $$ (b) For every $t\in [0,\infty)$ $$ \int_{\{G_{\Omega,x}=t\}}\left|\nabla G_{\Omega,x}(y)\right|^{n-1} \dH(y)=1. $$ (c) $$ \lim_{t\to\infty}\frac{n\,\left|\left\{G_{\Omega,x}>t\right\}\right|}{\omega_{n-1}e^{-n \cnn t}} = \left(I_{\Omega}(x)\right)^n. $$ (d) If $B_R=\Omega^{\ast}$ is the symmetrized domain, then for any $x\in\Omega$ $$ I_{\Omega}(x)\leq I_{B_R}(0)=R. $$ (e) If $t_i\geq 0$ is a given sequence such that $t_i\to\infty$, then the sets $\{G_{\Omega,x}>t_i\}$ are approximately small balls at $x$ of radius $\tau_i$ $$ \tau_i=I_{\Omega}(x)e^{-\cnn t_i}. $$ In particular $$ \lim_{t\to\infty}\frac{n-\beta}{\omega_{n-1}e^{-\alpha_{n,\beta}t}}\int_{\{G_{\Omega,x}>t\}}|y-x|^{-\beta}=I_{\Omega}(x)^{n-\beta}. $$ \end{proposition} \begin{proof} In all statements we can assume without loss of generality that $x=0\in\Omega$ and abbreviate $G_{\Omega,x}=G,$ $H_{\Omega,x}=H.$ \smallskip (a) By approximation \eqref{eq:definition G Omega x} holds also for any $\varphi\in W_0^{1,\infty}(\Omega).$ Thus (a) follows by taking $\varphi(y)=\min\{t,G(y)\}.$ \smallskip (b) Observe that by (a) and the coarea formula $$ t=\int_{\{G<t\}}\left|\nabla G(y)\right|^{n-1} \left|\nabla G(y)\right| dy = \int_0^t\left(\int_{\{G=s\}}\left|\nabla G(y)\right|^{n-1}\dH(y)\right)ds. $$ Hence, (b) follows from (a) by derivation. \smallskip (c) \textit{Step 1.} Write $G$ as \begin{equation} \label{eq:G with H0 minus Hy} G(y)=-\frac{1}{\omega_{n-1}^{1/(n-1)}}\log(|y|)-H(0)+H(0)-H(y) =-\frac{1}{\omega_{n-1}^{1/(n-1)}}\log\left(\frac{|y|}{I_{\Omega}(0)}\right)+H(0)-H(y) \end{equation} Let $\|H\|_{\infty}=\sup \{|H(y)|:\, y\in\Omega\}$ and define \begin{equation} \label{eq:def:S(t)} S(t)=\left\{y\in\Omega:\, |y|\leq I_{\Omega}(0) e^{-\omega_{n-1}^{1/(n-1)}(t-2\|H\|_{\infty})}\right\}, \end{equation} and set \begin{equation} \label{eq:def:m(t)} m(t)=\max_{y\in S(t)}|H(y)-H(0)| \end{equation} By the continuity of $H$ it holds that \begin{equation} \label{eq:m(t) goes to 0} \lim_{t\to\infty}m(t)=0. \end{equation} We now define also the sets \begin{align*} P(t)=& \left\{y\in\Omega:\, |y|<I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}(t+m(t))}\right\} \smallskip \\ Q(t)=& \left\{y\in\Omega:\, |y|<I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}(t-m(t))}\right\}, \end{align*} and claim that for all $t\geq 2\|H\|_{\infty}$ \begin{equation} \label{eq:P subset G geq t subset Q} P(t)\subset \{G>t\}\subset Q(t). \end{equation} Let $y\in P(t),$ then also $y\in S(t).$ So using \eqref{eq:G with H0 minus Hy}, \eqref{eq:def:m(t)} and finally the definition of $P(t)$ we get \begin{align*} G(y)\geq & -\frac{1}{\omega_{n-1}^{1/(n-1)}}\log\left(\frac{|y|}{I_{\Omega}(0)}\right)-m(t) = -\frac{1}{\omega_{n-1}^{1/(n-1)}}\log\left(\frac{|y|}{I_{\Omega}(0)}\right)-\left(m(t)+t\right)+t > t. \end{align*} This shows $P(t)\subset\{G>t\}.$ If $y\in \{G>t\},$ then using again \eqref{eq:G with H0 minus Hy} we obtain $$ |y|<I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}(t-H(0)+H(y))}. $$ As $t-H(0)+H(y)\geq t-2\|H\|_{\infty}$ it holds that $y\in S(t)$ and hence $|H(0)-H(y)|\leq m(t).$ This implies that $y\in Q(t)$ and proves the claim \eqref{eq:P subset G geq t subset Q}. It now follows from \eqref{eq:P subset G geq t subset Q} that \begin{align*} \frac{\omega_{n-1}}{n}I_{\Omega}(0)^ne^{-\omega_{n-1}^{1/(n-1)}(t+m(t))n}\leq |\{G>t\}| \leq \frac{\omega_{n-1}}{n}I_{\Omega}(0)^ne^{-\omega_{n-1}^{1/(n-1)}(t-m(t))n} \end{align*} Using \eqref{eq:m(t) goes to 0} proves (c). \smallskip (d) We refer to Flucher \cite{Flucher book} Lemma 8.2 page 64, or Lin \cite{Lin K C} Lemma 2. \smallskip (e) is deduced from \eqref{eq:P subset G geq t subset Q} in the following way: write $$ I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}(t+m(t))}=\tau(t)-\underline{\sigma}(t),\qquad I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}(t-m(t))}=\tau(t)+\overline{\sigma}(t), $$ where \begin{align*} &\tau(t)=I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}t}, \qquad \underline{\sigma}(t)=I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}t} \left(1-e^{-\omega_{n-1}^{1/(n-1)}m(t)}\right) \smallskip \\ &\text{and }\quad \overline{\sigma}(t)=I_{\Omega}(0)e^{-\omega_{n-1}^{1/(n-1)}t} \left(e^{\omega_{n-1}^{1/(n-1)}m(t)}-1\right) \end{align*} Using \eqref{eq:m(t) goes to 0} $$ \lim_{t\to\infty}\frac{\underline{\sigma}(t)}{\tau(t)}=\lim_{t\to\infty}\frac{\overline{\sigma}(t)}{\tau(t)}=0, $$ and the first statement follows by setting $\tau_i=\tau(t_i),$ $\sigma_i=\max\{\underline{\sigma}(t_i),\overline{\sigma}(t_i)\}.$ The second statment follows from $$ \int_{B_{\tau(t)-\sigma(t)}}|y|^{-\beta}dy\leq \int_{\{G>t\}}|y|^{-\beta}dy \leq \int_{B_{\tau(t)+\sigma(t)}}|y|^{-\beta}dy, $$ calculating explicitly the first and last integral, and using the first statement of (e). \end{proof} \smallskip We will need the following result. \begin{lemma}\label{Volumeradii} {\color{red}Let $\Omega$ be any smooth bounded domain of $\mathbb R^n$ and $x\in \Omega$. Suppose $\beta \in [0,n)$, then it holds} \begin{equation}\label{eq:Volumeradii} \int_\Omega |y-x|^{-\beta} dy \geq \frac{\omega_{n-1}}{n-\beta} I_\Omega(x)^{n-\beta}. \end{equation} \end{lemma} \begin{proof} It is enough to prove \eqref{eq:Volumeradii} for $x =0$ and assume $0\in\Omega.$ We start the proof by recalling a sharp weighted isoperimetric inequality from \cite{Alvino} Theorem $1.1$ (ii). \begin{equation} \label{eq:weightediso} \int_A |y|^{-\beta} dy \leq \frac1{\alpha_{n,\beta}} \left(\int_{\partial A} |y|^{-\frac{n-1}n\beta} d\mathcal{H}^{n-1}(y)\right)^{\frac{n}{n-1}} \quad\text{ for any smooth set $A\subset\re^n.$} \end{equation} Applying \eqref{eq:weightediso} to the set $\{G_{\Omega,0} >t\}$ and using H\"older inequality and Proposition \ref{proposition:properties of Green's function} (b), we have \begin{align} \label{eq:VR1} \int_{\{G_{\Omega,0} >t\}} |y|^{-\beta} dy &\leq \frac1{\alpha_{n,\beta}} \left(\int_{\{G_{\Omega,0} =t\}} |\nabla G_{\Omega,0}(y)|^{\frac{n-1}n} \frac{|y|^{-\frac{n-1}n \beta}}{|\nabla G_{\Omega,0}(y)|^{\frac{n-1}n}} \dH(y)\right)^{\frac n{n-1}} \notag\\ &\leq \frac1{\alpha_{n,\beta}} \left(\int_{\{G_{\Omega,0} =t\}} |\nabla G_{\Omega,0}(y)|^{n-1} \dH(y)\right)^{\frac1{n-1}} \left(\int_{\{G_{\Omega,0} =t\}} \frac{|y|^{-\beta}}{|\nabla G_{\Omega,0}(y)|} \dH(y)\right) \notag\\ &= \frac1{\alpha_{n,\beta}} \int_{\{G_{\Omega,0} =t\}} \frac{|y|^{-\beta}}{|\nabla G_{\Omega,0}(y)|} \dH(y). \end{align} By co-area formula, we have \[ \int_{\{G_{\Omega,0} >t\}} |y|^{-\beta} dy = \int_t^\infty \int_{\{G_{\Omega,0} =s\}} \frac{|y|^{-\beta}}{|\nabla G_{\Omega,0}(y)|} \dH(y)\, ds. \] Whence \eqref{eq:VR1} can be rewritten as \[ \frac{d}{dt} \left(e^{\alpha_{n,\beta} t} \int_{\{G_{\Omega,0} >t\}} |y|^{-\beta} dy\right) \leq 0. \] In other words, $t \to e^{\alpha_{n,\beta} t} \int_{\{G_{\Omega,0} >t\}} |y|^{-\beta} dy$ is a non-increasing function. Using Proposition \ref{proposition:properties of Green's function} (e) we get \[ \int_\Omega |y|^{-\beta} dy \geq \lim_{t\to \infty} e^{\alpha_{n,\beta} t} \int_{\{G_{\Omega,0} >t\}} |y|^{-\beta} dx = \frac{\omega_{n-1}}{n-\beta} I_\Omega(0)^{n-\beta}, \] as wanted. \end{proof} The following proposition and its corollary are the main results of this section. We have included also the case $\beta=n,$ although this is not needed for the application to the singular Moser-Trudinger functional. \begin{proposition} \label{prop:Hypot H for r equal 1} Let $\Omega\subset\re^n$ be any smooth bounded set and $x\in\Omega.$ Suppose $\beta\in [0,n],$ then it holds that $$ \omega_{n-1}^{n/(n-1)} I_{\Omega}(x)^{n-\beta}\leq \int_{\partial\Omega}\frac{|x-y|^{-\beta}}{\left|\nabla G_{\Omega,x}(y)\right|}\dH(y). $$ \end{proposition} \begin{proof} Let us first assume that $\beta\in [0,n).$ We can assume without loss of generality that $x=0\in\Omega$ and write again $G=G_{\Omega,x}.$ Applying \eqref{eq:VR1} to $t = 0$, we have $$ \int_{\Omega}|y|^{-\beta}dy\leq \frac{1}{\alpha_{n,\beta}}\intdelomega \frac{|y|^{-\beta}}{|\nabla G(y)|}\dH(y). $$ It then follows from \eqref{eq:Volumeradii} that $$ \omega_{n-1}^{n/(n-1)}I_{\Omega}(0)^{n-\beta}=\alpha_{n,\beta}\frac{\omega_{n-1}}{n-\beta}I_{\Omega}(0)^{n-\beta} \leq \int_{\partial\Omega}\frac{|y|^{-\beta}}{\left|\nabla G_{\Omega,x}(y)\right|}\dH(y), $$ which proves the proposition in the present case. The case $\beta=n$ is deduced by a continuity argument from the case $\beta<n.$ \end{proof} \smallskip For our application in Section \ref{section:ball to domain} the following extension to the level sets of $G_{\Omega,x}$ is crucial. This corollary generalizes Lemma 3 in Lin \cite{Lin K C} to the singular case $\beta\neq 0.$ \begin{corollary} \label{corollary:Hypot H} Let $n\geq 2,$ $\beta\in [0,n]$ and $\Omega$ be a bounded open smooth subset of $\re^n$ with $x\in\Omega.$ Then all level sets $A_r$ of $G_{\Omega,x}$ $$ A_r=\left\{y\in\Omegabar:\,G_{\Omega,x}(y)>-\frac{1}{\cnn}\log r\right\},\qquad r\in(0,1] $$ satisfy the inequality \begin{equation} \label{eq:hypothesis:level sets G for each r} \omega_{n-1}^{\frac{n}{n-1}}I_{\Omega}^{n-\beta}(x) \leq \frac{1}{r^{n-\beta}} \int_{\partial A_r}\frac{|x-y|^{-\beta}}{|\nabla G_{\Omega,x}(y)|}\dH(y). \end{equation} \end{corollary} \begin{remark} It can be shown that the inequality tends to an equality when $r\to 0,$ but this is not required for the proof of Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger}. This follows from tha fact that $\lim_{y\to x}|y-x|\,|\nabla H_{\Omega,x}(y)|=0$ (see (1.2) in \cite{Kichenassamy Veron}) and therefore $$ |\nabla G_{\Omega,x}(y)|=\frac{1}{\omega_{n-1}^{1/(n-1)}|x-y|}(1+o(1))\quad\text{ as }y\to x. $$ The proof is then similar to that of \cite{Lin K C} Lemma 1 (d) and Lemma 3, where it seems that it has been assumed that $\nabla H_{\Omega,x}$ is bounded near $x.$ The boundedness of $\nabla H_{\Omega,x}$ has been conjectured in \cite{Kichenassamy Veron} Remark 1.4, but we are not aware whether this has been proven. \end{remark} \begin{proof} We can assume without loss of generality that $x=0\in\Omega.$ Apply Proposition \ref{prop:Hypot H for r equal 1} to the set $\Omega=A_r$. Note that $0\in A_r$ for all $r\in (0,1],$ $$ G_{A_r,0}(y)=G_{\Omega,0}(y)+\frac{1}{\omega_{n-1}^{1/(n-1)}}\log r\quad\text{and}\quad H_{A_r,0}(y)=H_{\Omega,0}(y)-\frac{1}{\omega_{n-1}^{1/(n-1)}}\log r. $$ In particular this implies that $\nabla G_{A_r,0}=\nabla G_{\Omega,0}$ and $I_{A_r}(0)=r\, I_{\Omega}(0).$ This proves \eqref{eq:hypothesis:level sets G for each r}. \end{proof} \begin{comment} \section{Example: $n$-Green's function of balls} \label{section:n Green s function for balls example} {\color{red}We now analyse the $n$-Green's function $G_{\Omega,x}$ of balls. Instead of fixing the ball and letting $x\in\Omega$ be arbitrary, we fix the singularity at $0,$ and consider balls centered at a point $x,$ which we call shifted balls. We give in this section an elementary proof of Corollary \ref{corollary:Hypot H}, which is independent of the weighted isoperimetric inequality of \cite{Alvino}.} \begin{proposition} \label{proposition:n Greens function shifted ball} Let $0< |x|<1$ and $\Omega=B_1(0)+x\subset\re^n.$ \smallskip (i) Then the $n$-Green's function $G_{\Omega,0}$ with singularity at $0$ is given by $$ G_{\Omega,0}(y)=-\frac{1}{\cnn}\log{|y|}+\frac{1}{\cnn}\log\left(|x|\,\left|x-y-\frac{x}{|x|^2}\right|\right). $$ (ii) For $t\in [0,\infty)$ the level sets of $G_{\Omega,0}$ are equal to spheres (containing the origin): $$ \{G_{\Omega,0}=t\}=\left\{y\in\re^n|, |y-x_0|=R\right\} $$ where, $$ x_0=\frac{r^2\left(1-|x|^2\right)}{1-r^2|x|^2}x,\qquad R^2=|x_0|^2+r^2\frac{ \left(1-|x|^2\right)^2}{1-r^2|x|^2},\quad\text{ where }r=e^{-\cnn t}. $$ (iii) The conformal radius $I_{\Omega}(0)$ at zero is equal to $$ I_{\Omega}(0)=1-|x|^2. $$ (iv) For every $y\in \delomega$ $$ |\nabla G(y)|=\frac{I_{\Omega}(0)}{\cnn |y|^2}. $$ \end{proposition} \begin{definition} We recall that a map $\varphi:\Omega'\to\Omega$ is called conformal if it is differentiable at every $x\in\Omega'$ and $$ D\varphi(x)=\mu(x)A(x),\quad \mu(x)\in \re,\quad A(x)\in O(n), $$ that is, $A(x)$ is an orthogonal matrix. \end{definition} We now prove Propositon \ref{proposition:n Greens function shifted ball}. \begin{proof} (i) The $n$-Green's function for the unit ball is $$ G_{B_1,0}(y)=-\frac{1}{\cnn}\log{|y|}. $$ It is easy to see by a change of variables (and using that $|\nabla G_{B_1,0}|^{n-1}\in L^1(B_1)$) that for any domain $\Omega$ and $x_0\in \Omega$ $$ G_{\Omega,x_0}=G_{B_1,0}\circ\varphi,\quad\text{ if $\varphi\in \operatorname{Diff}^1(\Omegabar,\overline{B}_1)$ is conformal},\quad \varphi(x_0)=0. $$ In case $\Omega=B_1(0)+x,$ then $\varphi$ can be constructed by using M\"obius tranformations (see for instance \cite{Beardon 1983} Theorem 3.4.2.), in detail: Note that the following maps are conformal, for any $b\in \re^n,$ $\lambda\neq 0,$ $$ z\mapsto z+b,\qquad z\mapsto \lambda z,\qquad z\mapsto\frac{z}{|z|^2}, $$ and therefore also any of their compositions. Thus the map $$ \varphi(y)=\frac{x}{|x|^2}+\frac{\big|x-\frac{x}{|x|^2}\big|^2}{1-|x|^2} \frac{\big(x-y-\frac{x}{|x|^2}\big)}{\big|x-y-\frac{x}{|x|^2}\big|^2} {\color{red} = \frac{x}{|x|^2} + \frac{1 -|x|^2}{|x|^2} \frac{x-y -\frac{x}{|x|^2}}{\big|x-y -\frac{x}{|x|^2}\big|^2} } $$ is conformal. We claim that $|\varphi|$ simplifies to \begin{equation*} |\varphi(y)|=\frac{|y|}{|x|\,\big|x-y-\frac{x}{|x|^2}\big|}, \end{equation*} {\color{red}which follows by the following calculation: \begin{align*} |\varphi(y)|^2 &=\frac{1}{|x|^2} + 2\frac{1-|x|^2}{|x|^2} \frac{\big\langle x, x-y -\frac{x}{|x|^2}\big\rangle}{|x|^2 \big|x-y -\frac{x}{|x|^2}\big|^2} + \frac{(1-|x|^2)^2}{|x|^4} \frac1{\big|x-y -\frac{x}{|x|^2}\big|^2} \\ &=\frac{\big|x-y -\frac{x}{|x|^2}\big|^2 + 2\frac{1-|x|^2}{|x|^2} \big\langle x, x-y -\frac{x}{|x|^2}\big\rangle + \frac{(1-|x|^2)^2}{|x|^4} |x|^2}{|x|^2 \big|x-y -\frac{x}{|x|^2}\big|^2} \\ &= \frac{\Big|x-y - \frac{x}{|x|^2} + \frac{1-|x|^2}{|x|^2}x\Big|^2}{|x|^2 \big|x-y -\frac{x}{|x|^2}\big|^2} = \frac{|y|^2}{|x|^2 \big|x-y -\frac{x}{|x|^2}\big|^2}.\\ \end{align*}} Moreover $x-y-x/|x|^2\neq 0$ for all $y\in\overline{B}_1+x,$ $\varphi(0)=0$ and one easily verifies that $\varphi(\delomega)=\partial B_1$. Thus $\varphi$ is the desired conformal map and $$ G_{\Omega,0}=-\frac{1}{\cnn}\log\left(\frac{|y|}{|x|\,\left|x-y-\frac{x}{|x|^2}\right|}\right). $$ This proves (i). \smallskip (ii) $G_{\Omega,0}(y)=t$ is equivalent to $$ \frac{|y|}{|x|\,\left|x-y-\frac{x}{|x|^2}\right|}=e^{-\cnn t}=r \quad\Leftrightarrow\quad |y|^2=r^2|x|^2 \left|x-y-\frac{x}{|x|^2}\right|^2. $$ This can be written in the form $$ a|y|^2-2\langle v;y\rangle +c=0,\quad\text{ with }a=1-r^2|x|^2,\quad v=r^2(1-|x|^2) x,\quad c=-\left(1-|x|^2\right)^2r^2, $$ which is the equation of a sphere, with center $x_0$ and radius $R$ given by $$ x_0=\frac{v}{a},\qquad R^2=|x_0|^2-\frac{c}{a}. $$ (iii) By the definition of the conformal incenter at $0$ $$ I_{\Omega}(0)=|x|\,\left|x-\frac{x}{|x|^2}\right|=1-|x|^2. $$ An alternative proof is by using (ii) and Proposition \ref{proposition:properties of Green's function} (c). \smallskip (iv) The regular part of $G_{\Omega,0}$ is given by \begin{align*} -H(y)=&\frac{1}{\cnn}\log\left(|x|\,\left|x-y-\frac{x}{|x|^2}\right|\right) =\frac{1}{\cnn}\log\left(\frac{1}{|x|}\left|(x-y)|x|^2-x\right|\right) \smallskip \\ =&\frac{1}{\cnn}\log\left(\left|(x-y)|x|^2-x\right|\right) -\frac{1}{\cnn}\log(|x|). \end{align*} We thus obtain that $$ \cnn \nabla G_{\Omega,0}(y)=-\frac{y}{|y|^2}-\frac{(x-y)|x|^2-x}{\left|(x-y)|x|^2-x\right|}|x|^2. $$ Now assume that $y\in \delomega$ and hence $y=x+s$ for some $s$ with $|s|=1.$ This implies that $$ \left||x|^2 s+x\right|^2=|x|^2|x+s|^2. $$ We therefore get $$ \cnn \nabla G_{\Omega,0}(y)=-\frac{s}{|x+s|^2}\left(|x|^2-1\right). $$ Using (iii) this implies the claim of (iv). \end{proof} \begin{proposition} \label{proposition:main estimate for shifted balls} Let $0<|x|<1$ and $\Omega=B_1(0)+x\subset\re^n$ and $0\leq\beta\leq n.$ The $n$-Green's function $G_{\Omega,0}$ satisfies the following inequality $$ \omega_{n-1}^{\frac{n}{n-1}}I_{\Omega}^{n-\beta}(0)\leq \intdelomega\frac{1}{|y|^{\beta} |\nabla G_{\Omega,0}(y)|}\dH(y). $$ \end{proposition} \begin{proof} Without loss of generality we can assume that $x=(\delta,0,\ldots,0)$ for some $0<\delta<1.$ In view of Proposition \ref{proposition:n Greens function shifted ball} (i) and (ii) we have to prove that \begin{equation} \label{eq:main equat shifted balls with delta} \omega_{n-1}(1-\delta^2)^{n+1-\beta}\leq \intdelomega |y|^{2-\beta}\dH(y). \end{equation} We parametrize $\delomega=S^{n-1}+(\delta,0,\ldots,0)$ by using hypershperical coordinates centered at the origin (and not at $x$), more precisely set $$ Q=(0,\pi)^{n-2}\times(0,2\pi),\qquad F:Q\to\delomega,\qquad F(\varphi)=r(\varphi)H(\varphi), $$ where $H(\varphi)=(H_1(\varphi),\ldots,H_n(\varphi))$ are the hypershperical coordinates, see Section \ref{Appendix: hyperspherical coordinates in Rn} (Appendix 1) and $$ r(\varphi)=\delta\cos\varphi_1+\sqrt{1-\delta^2\sin^2\varphi_1}. $$ One easily verifies that $F:Q\to\delomega$ is a parametrization of $\delomega,$ namely $$ \mathcal{H}^{n-1}\left(\delomega \backslash F(Q)\right)=0,\qquad |F(\varphi)-x|=1\;\text{ for all }\varphi\in Q. $$ The last equality follows as \begin{align*} |F(\varphi)-x|^2=& \left(r(\varphi)H_1(\varphi)-\delta\right)^2+r^2(\varphi)\sum_{i=2}^n H_i^2(\varphi)=\left(r(\varphi)\cos\varphi_1-\delta\right)^2+r^2(\varphi)^2\sin^2\varphi_1 \smallskip \\ =&r^2(\varphi)-2r(\varphi)\cos\varphi_1+\delta^2=1. \end{align*} Let $g$ be the surface element of $S^{n-1}$ given by the parametrization $H,$ see Section \ref{Appendix: hyperspherical coordinates in Rn}. Hence we obtain from Lemma \ref{lemma:parametrization r H} that \begin{align*} \intdelomega|y|^{2-\beta}\dH(y)\geq \int_Q|F(\varphi)|^{2-\beta}r^{n-1}(\varphi) g(\varphi)d\varphi=\int_Q r^{n+1-\beta}(\varphi)d\mu(\varphi), \end{align*} if the measure $\mu$ is defined by $\mu(A)=\int_A g(\varphi)d\varphi$ for measurable subsets $A\subset Q.$ Note that $\mu(Q)=\omega_{n-1}$ and that $n+1-\beta\geq1.$ We therefore apply Jensen inequality to obtain \begin{align*} \intdelomega|y|^{2-\beta}\dH(y)\geq &\omega_{n-1}\frac{1}{\mu(Q)}\int_Q r^{n+1-\beta} (\varphi)d\mu(\varphi)\geq \frac{1}{\omega_{n-1}^{n-\beta}} \left(\int_Q r(\varphi)d\mu(\varphi)\right)^{n+1-\beta} \smallskip \\ =&\frac{1}{\omega_{n-1}^{n-\beta}} \left(\int_Q \left(\delta\cos\varphi_1+\sqrt{1-\delta^2\sin^2\varphi_1}\right)g(\varphi)d\varphi \right)^{n+1-\beta}. \end{align*} Using \eqref{eq:g for hypersph coord explicit} and that $\int_0^{\pi}\cos\varphi_1\sin^m\varphi_1 d\varphi_1=0$ for any $m\in\mathbb{N},$ $m\geq 0,$ we get $$ \int_Q\cos\varphi_1\,g(\varphi)d\varphi=0. $$ Using also that $\sqrt{1-\delta^2\sin^2\varphi_1}\geq 1-\delta^2$ for all $\varphi_1\in (0,\pi)$ and $\delta\in(0,1)$ we obtain $$ \intdelomega|y|^{2-\beta}\dH(y)\geq\frac{1}{\omega_{n-1}^{n-\beta}}\left(\int_Q \left(1-\delta^2\right)g(\varphi)d\varphi\right)^{n+1-\beta}=\omega_{n-1}(1-\delta^2)^ {n+1-\beta}, $$ which proves the proposition. \end{proof} \smallskip We first extend the result of the previous proposition by a rescaling argument to balls of any radius. \begin{corollary} \label{corollary:rescaling to R radius main estimate} Let $R>0$ and $0<|x|<R,$ $\Omega=B_R(0)+x$ and $0\leq\beta\leq n.$ Then the following inequality holds $$ \omega_{n-1}^{\frac{n}{n-1}}I_{\Omega}^{n-\beta}(0)\leq \intdelomega\frac{1}{|y|^{\beta} |\nabla G_{\Omega,0}(y)|}\dH(y). $$ \end{corollary} \begin{proof} Define $\Omega'=B_1(0)+x/R,$ that is $\Omega'=\Omega/R.$ From Proposition \ref{proposition:n Greens function shifted ball} (i) we deduce that $$ G_{\Omega',0}(y)=-\frac{1}{\cnn}\log{|y|}+\frac{1}{\cnn}\log\left(\frac{|x|}{R}\left|\frac{x}{R}-y-R\frac{x}{|x|^2}\right|\right). $$ and therefore (note that $z\mapsto z/R$ is conformal) $$ G_{\Omega,0}(z)=-\frac{1}{\cnn}\log\left(\frac{|z|}{R}\right)+\frac{1}{\cnn}\log\left(\frac{|x|}{R}\left|\frac{x}{R}-\frac{z}{R} -R\frac{x}{|x|^2}\right|\right). $$ From this we deduce that the regular part of the $n$-Green's function $H_{\Omega,0}$ is given by $$ -H_{\Omega,0}(z)=\frac{1}{\cnn}\log R+\frac{1}{\cnn}\log\left(\frac{|x|}{R}\left|\frac{x}{R}-\frac{z}{R} -R\frac{x}{|x|^2}\right|\right), $$ and we are able to calculate the conformal incenter at $0$: \begin{equation} \label{eq:formula for I BRx} I_{\Omega}(0)=R\left|\frac{x}{R}\left(\frac{x}{R} -R\frac{x}{|x|^2}\right) \right|=R\left(1-\frac{|x|^2}{R^2}\right)=R\,I_{\Omega'}(0). \end{equation} Applying Proposition \ref{proposition:main estimate for shifted balls} we get $$ \omega_{n-1}^{\frac{n}{n-1}}I_{\Omega}^{n-\beta}(0) = \omega_{n-1}^{\frac{n}{n-1}}R^{n-\beta}I_{\Omega'}^{n-\beta}(0) \leq R^{n-\beta}\int_{\delomega'}\frac{1}{|y|^{\beta} |\nabla G_{\Omega',0}(y)|}\dH. $$ Observe also that $$ \nabla G_{\Omega,0}(z)=\frac{1}{R}\nabla G_{\Omega',0}\Big(\frac{z}{R}\Big). $$ So the corollary follows from a change of parametrization. \end{proof} \begin{corollary}[{\color{red}Corollary \ref{corollary:Hypot H} for balls}] \label{corollary:estimate all level sets for balls} Let $0\leq |x|<R$ and $\Omega=B_R(0)+x.$ Then $\Omega$ satisfies \eqref{eq:hypothesis:level sets G for each r}. \end{corollary} \begin{proof} Define $A_r$ as $$ A_r=\left\{y\in\Omegabar:\,G_{\Omega,0}(y)>-\frac{1}{\cnn}\log r\right\},\qquad r\in(0,1] $$ and note that $$ G_{A_r,0}=G_{\Omega,0}+\frac{1}{\cnn}\log r. $$ From Proposition \ref{proposition:n Greens function shifted ball} (ii) we know that for each $r$ the set $A_r$ is a ball containing the origin. So by Corollary \ref{corollary:rescaling to R radius main estimate} we have $$ \omega_{n-1}^{\frac{n}{n-1}}I_{A_r}^{n-\beta}(0)\leq \int_{\partial A_r}\frac{1}{|y|^{\beta} |\nabla G_{A_r,0}(y)|}\dH(y) =\int_{\partial A_r}\frac{1}{|y|^{\beta} |\nabla G_{\Omega,0}(y)|}\dH(y). $$ To conclude use that $I_{A_r}(0)=r I_{\Omega}(0).$ \end{proof} \smallskip \end{comment} \section{Some Preliminary Results}\label{section:prelim. results} We first note that it is sufficient to work with non-negative smooth maximizing sequences. More precisely we have the following lemma, which we will use in Section \ref{section:domain to ball} in a crucial way. \begin{lemma} \label{lemma new:sup over W12 same as over Cinfty} Let $\{u_i\}\subset\mathcal{B}_1(\Omega)$ be a sequence such that the limit $\lim_{i\to\infty}F_{\Omega}(u_i)$ exists. Then there exists a sequence $\{w_i\}\subset \mathcal{B}_1(\Omega)\cap C_c^{\infty}(\Omega)$ such that $$ \liminf_{i\to\infty}F_{\Omega}(w_i)\geq \lim_{i\to\infty}F_{\Omega}(u_i). $$ Moreover, if $u_i$ concentrates at $x_0\in\Omegabar,$ then also $w_i$ concentrates at $x_0$. In particular maximizing sequences for $F_{\Omega}^{\sup}$ and $F_{\Omega}^{\delta}(x_0)$ can always be assumed to be smooth and non-negative. \end{lemma} \begin{proof}The proof is exactly the same as in the case $n=2,$ see Lemma 4 in \cite{Csato Roy Calc var Pde}. \end{proof} \begin{comment} For each $i\in\mathbb{N}$ there exists $\{v_i^k\}\subset C_c^{\infty}(\Omega)$ such that $v_i^k\to u_i$ almost everywhere in $\Omega,$ $$ v_i^k\to u_i\text{ in }W^{1,n}(\Omega)\text{ for }k\to\infty\quad \text{ and }\quad \|\nabla v_i^k\|_{L^n}=\|\nabla u_i\|_{L^n}\text{ for all }k. $$ Using Fatou's lemma there exists $k_1(i)\in\mathbb{N}$ such that $$ F_{\Omega}(u_i)\leq F_{\Omega}(v_i^j)+\frac{1}{2^i}\quad\forall\, j\geq k_1(i). $$ Moreover, from the convergence in $W^{1,n}(\Omega)$ we also obtan the existence of $k_2(i)\in\mathbb{N},$ such that $$ \|\nabla v_i^j-\nabla u_i\|_{L^n(\Omega)}\leq \frac{1}{2^i}\quad\forall\, j\geq k_2(i). $$ We now define $w_i=v_i^{k(i)},$ where $k(i)=\max\{k_1(i),k_2(i)\}.$ It can be easily verified that $w_i$ has all the desired properties. \end{comment} \begin{comment} \begin{lemma} \label{lemma old:sup over W12 same as over Cinfty} The following equality holds true $$ F_{\Omega}^{\text{sup}}=\sup_{\substack {v\in W^{1,2}_0(\Omega) \\ \|\nabla v\|_{L^2}\leq 1}} \int_{\Omega}\frac{e^{\alpha v^2}-1}{|x|^{\beta}} = \sup_{\substack {v\in C^{\infty}_0(\Omega) \\ \|\nabla v\|_{L^2}\leq 1,\,u\geq 0}} \int_{\Omega}\frac{e^{\alpha v^2}-1}{|x|^{\beta}}=:F_{\Omega}^{\sup,\infty}. $$ \end{lemma} \begin{proof} It is clear that we can take the supremum over all non-negative functions. It is obvious that $F_{\Omega}^{\text{sup}}\geq F_{\Omega}^{\sup,\infty},$ so let us show the reverse inequality. Let $v\in \mathcal{B}_1(\Omega)$ be given. Then there exists a sequence $\{v_i\}\subset C_c^{\infty}(\Omega)$ with the properties $$ v_k\to v\quad\text{ in }W^{1,2}_0(\Omega)\quad\text{ and }\quad \|\nabla v_k\|_{L^2}\leq 1\quad\forall\;k. $$ By standard lower semicontinuity results, see for instance \cite{Dacorogna} Theorem 3.23, we get $$ F_{\Omega}(v)\leq \liminf_{k\to\infty}F_{\Omega}(v_k)\leq F_{\Omega}^{\sup,\infty}. $$ Taking now the supremum over all $u$ gives the reverse inequality. \end{proof} \end{comment} \smallskip \begin{lemma}[compactness in interior]\label{lemma:compactness in the interior} Let $0<\eta<1$ and suppose $\{u_i\}\subset W_0^{1,n}(\Omega)$ is such that $$ \limsup_{i\to\infty}\|\nabla u_i\|_{L^n}\leq \eta\quad\text{and}\quad u_i\rightharpoonup u\text{ in }W^{1,n}(\Omega) $$ for some $u\in W^{1,n}(\Omega).$ Then for some subsequence $$ \frac{e^{\alpha u_i^\frac{n}{n-1}}}{|x|^{\beta}}\to \frac{e^{\alpha u^\frac{n}{n-1}}}{|x|^{\beta}}\quad\text{ in }L^1(\Omega) $$ and in particular $\lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}(u).$ \end{lemma} \begin{proof} The idea of the proof is to apply Vitali convergence theorem. We can assume that, up to a subsequence, that $u_i\to u$ almost everywhere in $\Omega$ and that $$ \|\nabla u_i\|_{L^n}\leq\theta=\frac{1+\eta}{2}<1\quad\forall\,i\in\mathbb{N}. $$ We can therefore define $v_i=u_i/\theta\in \WBOmega,$ which satisfies $\|\nabla v_i\|_{L^n}\leq 1$ for all $i.$ Moreover let us define $\overline{\alpha}=\alpha\theta^{n/(n-1)}<\alpha,$ such that $$ \frac{\overline{\alpha}}{\alpha_n}+\frac{\beta}{n}<1. $$ Let $E\subset\Omega$ be an arbitrary measurable set. We use H\"older inequality with exponents $r$ and $s,$ where $$ r=\frac{\alpha_n}{\overline{\alpha}}>1\quad\text{ and }\quad \frac{1}{s}=1-\frac{1}{r}> \frac{\beta}{n}, $$ to obtain that $$ \int_E\frac{e^{\alpha u_i^{\frac{n}{n-1}}}}{|x|^{\beta}}= \int_E\frac{e^{\overline{\alpha}v_i^{\frac{n}{n-1}}}}{|x|^{\beta}} \leq \left(\int_{E}e^{\alpha_n v_i^{\frac{n}{n-1}}}\right)^{\frac{1}{r}} \left(\int_E\frac{1}{|x|^{\beta s}}\right)^{\frac{1}{s}}. $$ Let $\epsilon>0$ be given. In view of the Moser-Trudinger inequality and using that $1/|x|^{\beta s}\in L^1(\Omega),$ we obtain that for any $\epsilon>0$ there exists a $\delta>0$ such that $$ \int_E\frac{e^{\alpha u_i^{\frac{n}{n-1}}}}{|x|^{\beta}}\leq \epsilon\quad\forall\,|E|\leq \delta\text{ and }i\in\mathbb{N}. $$ This shows that the sequence $e^{\alpha u_i^{n/(n-1)}}/|x|^{\beta}$ is equi-integrable and the Vitali convergence theorem yields convergence in $L^1(\Omega).$ This proves the lemma. \end{proof} \smallskip The proof of the next theorem can be found in Lions \cite{Lions}, Theorem I.6. \begin{theorem}[Concentration-Compactness Alternative]\label{theorem:concentration alternative for singular moser trudinger} Let $\{u_i\}\subset \mathcal{B}_1(\Omega).$ Then there is a subsequence and $u\in W_0^{1,n}(\Omega)$ with $u_i\rightharpoonup u$ in $W^{1,n}(\Omega),$ such that either (a) $\{u_i\}$ concentrates at a point $x\in\Omegabar,$ \newline or (b) the following convergence holds true $$ \lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}(u). $$ \end{theorem} The proof of the next two propositions is the same as in the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}. \begin{proposition} \label{proposition:if u_i concentrates somewhere else than zero} Let $\beta>0,$ $\{u_i\}\subset \mathcal{B}_1(\Omega)$ and suppose that $u_i$ concentrates at $x_0\in\Omegabar,$ where $x_0\neq 0.$ Then one has that, for some subsequence, $u_i\rightharpoonup 0$ in $W^{1,n}(\Omega)$ and $$ \lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}(0)=0. $$ In particular $F_{\Omega}^{\delta}(x_0)=0.$ \end{proposition} \begin{remark} \label{remark:F delta zero is not zero} However, if $\alpha/\alpha_n+\beta/n=1$ then $F_{\Omega}^{\delta}(0)>0.$ To see this assume that $\epsilon>0$ is such that $B_{\epsilon}(0)\subset\Omega$ and define $$ u_i(x)=\left\{ \begin{array}{rl} \displaystyle i&\text{ if }0\leq |x|\leq \epsilon e^{-\cnn i^{n/(n-1)}} \smallskip \\ -\frac{1}{\cnn i^{1/(n-1)}}\log\left(\frac{|x|}{\epsilon}\right) &\text{ if } \epsilon e^{-\cnn i^{n/(n-1)}}\leq |x|\leq \epsilon \smallskip \\ 0 &\text{ if } |x|\geq \epsilon. \end{array}\right. $$ One verifies by explicit calculation that $\{u_i\}\subset\mathcal{B}_1(\Omega)$ and it concentrates at $0.$ Let us show that $\liminf_{i\to\infty}F_{\Omega}(u_i)>0.$ First we make the estimate $$ F_{\Omega}(u_i)=\intomega\frac{e^{\alpha u_i^{\frac{n}{n-1}}}-1}{|x|^{\beta}} \geq \int_{B_{a_i}(0)}\frac{e^{\alpha u_i^{\frac{n}{n-1}}}-1}{|x|^{\beta}}, \quad\text{ where }\quad a_i=\epsilon e^{-\omega_{n-1}^{\frac{1}{n-1}}i^{\frac{n}{n-1}}}. $$ To conclude it is sufficient to show that $$ \lim_{i\to\infty}\int_{B_{a_i}(0)}\frac{e^{\alpha u_i^{\frac{n}{n-1}}}-1}{|x|^{\beta}}=\omega_{n-1}\epsilon^{n-\beta}>0. $$ We can use that $|x|^{-\beta}$ is integrable and hence $$ \lim_{i\to\infty}\int_{B_{a_i}(0)}|x|^{-\beta}=0. $$ One calculates that $$ \int_{B_{a_i}(0)}\frac{e^{\alpha u_i^{\frac{n}{n-1}}}}{|x|^{\beta}} =\omega_{n-1}\epsilon^{n-\beta}e^{i^{\frac{n}{n-1}}\left(\alpha-(n-\beta)\omega_{n-1}^{\frac{1}{n-1}} \right)} =\omega_{n-1}\epsilon^{n-\beta}\quad\text{ if }\frac{\alpha}{\alpha_n}+ \frac{\beta}{n}=1. $$ This shows that $F_{\Omega}^{\delta}(0)>0.$ \end{remark} We first prove Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger} for some simple cases, which is the content of the next proposition. The proof is exactly the same as in the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}. \begin{proposition} \label{proposition:sup attained if 0 notin Omegabar} There exists $u\in \mathcal{B}_1(\Omega)$ such that $F_{\Omega}(u)=F_{\Omega}^{\sup}$ in the following cases: $$ \text{(i)}\quad0\notin\Omegabar\quad\text{ or }\quad \text{(ii)}\quad\frac{\alpha}{\alpha_n}+\frac{\beta}{n}<1. $$ \end{proposition} \section{The Case $\Omega=B_1(0)$.}\label{section ball} In this section we deal with the case where $\Omega$ is the unit ball. The following lemma is essentailly due to Adimurthi-Sandeep \cite{Adi-Sandeep}. There one can find a proof, which is similar to the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}. \begin{lemma} \label{lemma:properties of T_a} Let $0<a<\infty,$ and $u$ be radial function on $B_1$. Define $$ T_a(u)(x)=a^{\frac{n-1}{n}}u\left(|x|^{\frac{1}{a}}\right). $$ Then $T_a$ satisfies that $$ T_a:W_{0,rad}^{1,n}(B_1)\to W_{0,rad}^{1,n}(B_1). $$ $T_a$ is invertible with $(T_a)^{-1}=T_{1/a}$ and it satisfies $$ \|\nabla(T_a(u))\|_{L^n}=\|\nabla u\|_{L^n},\quad \forall\,u\in W_{0,rad}^{1,n}(B_1). $$ Moreover if $a=1-\frac{\beta}{n},$ then \begin{equation}\label{lemma:eq: transformation Adi-Sandeep} F_{B_1}(u)=\frac{1}{a}J_{B_1}(T_a(u)),\quad\forall\,u\in W_{0,rad}^{1,n}(B_1). \end{equation} \end{lemma} \begin{comment} \begin{proof} \textit{Step 1.} Let us first show that $T_a$ satisfies $$ T_a\left(C_{c,rad}^{\infty}(B_1)\right)\subset W_{0,rad}^{1,n}(B_1). $$ and \begin{equation} \label{eq:proof of lemma properties of T_a grad transforms} \int_{B_1} |\nabla(T_a(u))|^n=\int_{B_1}|\nabla u|^n. \end{equation} Let $u\in C_{c,rad}^{\infty}({B_1})$ and $v=T_a(u).$ Since $u$ is bounded, so is also $v.$ In particular we immediately obtain that $v\in L^2({B_1}).$ Note that in general $v\notin C^1({B_1})$ (take for example $a<1$). However we will show that $v$ has weak derivatives. First note that $\nabla v$ is well defined on ${B_1}\backslash\{0\},$ since $v\in C^1({B_1}\backslash\{0\}).$ Moreover we have, by the change of variable $r=s^a$ that \begin{equation}\label{eq:proof lemma Ta:transformation r and s in nabla} \int_{B_1}|\nabla v|^n= \frac{1}{a}\int_0^1 \left|u'\left(r^{\frac{1}{a}}\right)\right|^nr^{\frac{n}{a}-n}\,\omega_{n-1}r^{n-1}dr =\int_0^1 (u'(s))^n\,\omega_{n-1} s^{n-1}ds. \end{equation} This proves \eqref{eq:proof of lemma properties of T_a grad transforms}. Since $v\in C^1({B_1}\backslash\{0\}),$ we have that for any $\epsilon>0,$ $$ \int_{{B_1}\backslash B_{\epsilon}(0)}v\frac{\partial\varphi}{\partial x_i} = -\int_{{B_1}\backslash B_{\epsilon}(0)}\frac{\partial v}{\partial x_i}\varphi + \int_{\partial B_{\epsilon}(0)}v\varphi\nu_i\quad\forall\,\varphi \in C^{\infty}_{c}({B_1}), $$ where $\nu=(\nu_1,\nu_2)$ is the unit outward normal on $\partial B_1$. In view of \eqref{eq:proof of lemma properties of T_a grad transforms} we have that $\|\nabla v\|_{L^2}<\infty.$ Therefore, recalling also $\|v\|_{L^{\infty}}\leq\infty,$ we obtain by letting $\epsilon\to 0,$ that $$ \int_{{B_1}}v\frac{\partial\varphi}{\partial x_i} = -\int_{{B_1}}\frac{\partial v}{\partial x_i}\varphi \quad\forall\,\varphi \in C^{\infty}_{c}({B_1}). $$ This shows that $v\in W^{1,n}_0({B_1}).$ We can therefore apply the Pioncar\'e inequality to obtain a constant $C$ which satisfies \begin{equation*} \|T_a(u)\|_{W^{1,n}}\leq C\|\nabla u\|_{L^n}\quad\forall\,u\in C^{\infty}_{c,rad}({B_1}). \end{equation*} We can now extend by a density argument $T_a$ to an operator defined on whole $W^{1,n}_{0,rad}(B_1).$ \begin{comment} \textit{Step 2.} In view of Step 1, in particular \eqref{eq:proof of lemma T_a and poincare lemma}, we can extend $T_a$ to an operator $\tilde{T}_a,$ such that $$ \tilde{T}_a:W_{0,rad}^{1,n}({B_1})\to W_{0,rad}^{1,n}({B_1}). $$ In detail: let $u_k\in C_{c,rad}^{\infty}({B_1})$ be such that $u_k\to u$ in $W^{1,n}({B_1}).$ Then by linearity of $T_a$ we obtain from \eqref{eq:proof of lemma T_a and poincare lemma} that $T_a(u_k)$ is a Cauchy sequence and we define $$ \tilde{T}_a(u)=\lim_{k\to\infty}T_a(u_k). $$ But for every $\epsilon>0$ the operetors $T_a$ and $\tilde{T}_a$ coincide on $W^{1,2}_{rad}({B_1}\backslash B_{\epsilon}(0)).$ From these considerations the first two statement of the lemma easily follow. \smallskip \textit{Step 2.} It remains to show \eqref{lemma:eq: transformation Adi-Sandeep}. Let again $v$ be given by $v=T_a(u).$ Recall that the assumptions on $a$ and $\beta$ imply that $a=\frac{\alpha}{\alpha_n}.$ Thus, by using the substitution $r=s^{1/a},$ we get \begin{align*} F_{B_1}(u)+\int_{B_1}\frac{1}{|x|^{\beta}}=& \omega_{n-1}\int_0^1\frac{e^{\alpha u(r)^{\frac{n}{n-1}}}}{r^{\beta}} r^{n-1} dr=\frac{\omega_{n-1}}{a}\int_0^1e^{\alpha_n u(s)^\frac{n}{n-1}}s^{n-1}ds \smallskip \\ =& \frac{1}{a}J_{B_1}(v)+\frac{1}{a}\int_{B_1} 1=\frac{1}{a}J_{B_1}(v)+\frac{|{B_1}|}{a}. \end{align*} Observe now that $$ \frac{|B_1|}{a}=\int_{B_1}\frac{1}{|x|^\beta}. $$ This concludes the proof of the last statement. \end{proof} \end{comment} The following corollary follows easily from Lemma \ref{lemma:properties of T_a}. \begin{corollary} \label{corollary:supremums for rad on D for F and G are same} Let $a=1-\beta/n.$ Then the following identities hold true $$ \sup_{u\in \WBDiskrad}F_{B_1}(u)=\frac{1}{a}\sup_{u\in \WBDiskrad}J_{B_1}(u), $$ and $$ F_{B_1}^{\text{sup}}=\frac{1}{a}J_{B_1}^{\text{sup}}. $$ \end{corollary} \begin{proof} The first equality follows directly from Lemma \ref{lemma:properties of T_a}. By Schwarz symmetrization, the two equalities of the corollary are equivalent. \end{proof} \smallskip One of the crucial ingredients of the proof is the following result of Carleson and Chang \cite{Carleson-Chang}. Essential is the strict inequality in the following theorem. The second equality is an immediate consequence of the properties of Schwarz symmetrization. \begin{theorem}[Carleson-Chang] \label{theorem:Carleson and Chang strict inequality} The following strict inequality holds true $$ J_{{B_1},rad\searrow}^{\delta}(0)<J_{B_1,rad\searrow}^{\sup}=J^{\sup}_{B_1}\,. $$ \end{theorem} \begin{remark} The result in Carleson and Chang is acutally more precise, stating that $$ e^{1 + \frac{1}{2}+ \cdots + \frac{1}{n-1}}|B_1|=\sup_{x\in \overline{{B_1}}}J_{{B_1},rad\searrow}^{\delta}(x)<J_{B_1,rad\searrow}^{\sup}\,, $$ but for our purpose we only need an estimate for the concentration level at $0.$ \end{remark} From Lemma \ref{lemma:properties of T_a} and Theorem \ref{theorem:Carleson and Chang strict inequality} we easily deduce the following proposition. \begin{lemma} \label{lemma:strict ineq. between concentration level and supremum for sing. MT on disk} Let $\{u_i\}\subset\mathcal{B}_1(B_1)$ be a sequence which concentrates at $0.$ If $\{u_i^{\ast}\}$ also concentrates at $0,$ then the following strict inequality holds true $$ \limsup_{i\to\infty}F_{{B_1}}(u_i)<F_{B_1}^{\sup}\,. $$ \end{lemma} \begin{proof}The proof is identical to the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}, with the only difference that one sets $a=1-\beta/n.$ \end{proof} \smallskip A consequence of Lemma \ref{lemma:strict ineq. between concentration level and supremum for sing. MT on disk} is the following theorem, stating that the supremum of $F_{B_1}$ is attained. The proof is here also identical to the $2$-dimensional case. \begin{theorem} \label{theorem:supremum of FOmega on Ball} The following strict inequality holds $$ F_{B_1}^{\delta}(0)<F_{B_1}^{\sup}. $$ In particular there exists $u\in\mathcal{B}_1(B_1)$ such that $F_{B_1}^{\sup}=F_{B_1}(u).$ \end{theorem} \section{Ball to Domain Construction}\label{section:ball to domain} In view of Proposition \ref{proposition:sup attained if 0 notin Omegabar}, it remains to prove Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger} for general domain with $0\in\Omega,$ when $\alpha/\alpha_n+\beta/n=1,$ and we can also take $\beta>0.$ Hence from now on we always assume that we are in this case. In addition, we assume in this section and Section \ref{section:domain to ball} that $0\in\Omega.$ The ball to domain construction is given by the following defnition: for $v\in W^{1,n}_{0,rad}(B_1)$ and $x\in\Omega,$ define $P_x(v)=u:\Omega\backslash\{x\}\to \re$ by \begin{equation*} P_x(v)(y)=v\left(e^{-\omega_{n-1}^\frac{1}{n-1} G_{\Omega,x}(y)}\right)=v\left(\left(G_{B_1,0}\right)^{-1}(G_{\Omega,x}(y)\right), \end{equation*} where, by abuse of notation, we have identified $v$ and $G_{B_1,0}$ with the corresponding radial function, for instance: $$ G_{B_1,0}(z)=-\frac{1}{\cnn}\log z, \quad\text{ if }z\in (0,1]. $$ The main result of this section is the following theorem. \begin{theorem} \label{theorem:ball to general domain:sup inequality} Assume $\Omega\subset\re^n$ is a bounded open smooth set with $0\in\Omega.$ For any $v\in W^{1,n}_{0,rad}(B_1)\cap \mathcal{B}_1(B_1)$ define $u=P_0(v).$ Then $u\in \mathcal{B}_1(\Omega)$ and it satisfies $$ F_{\Omega}(u)\geq I_{\Omega}(0)^{n-\beta}F_{B_1}(v). $$ In particular the following inequality holds true $$ F_{\Omega}^{\text{sup}}\geq I_{\Omega}(0)^{n-\beta}F^{\sup}_{B_1}. $$ Moreover if $\{v_i\}\subset W_{0,rad}^{1,n}(B_1)$ concentrates at $0,$ then $u_i=P_0(v_i)$ concentrates at $0.$ \end{theorem} The following lemma holds true for any domain, whether containing the origin or not. So we state this general version, although we will use it with $x=0.$ \begin{lemma} \label{lemma:ball to domain via G:preserves dirichlet norm} Let $x\in\Omega$ and let $v\in W^{1,n}_{0,rad}(B_1).$ Then $P_x(v)\in W^{1,n}_0(\Omega)$ and in particular \begin{equation}\label{lemma:eq:nablu u is nabla Pu} \|\nabla (P_x(v))\|_{L^n(\Omega)}=\|\nabla v\|_{L^n(B_1)}. \end{equation} Moreover if $\{v_i\}\subset W_{0,rad}^{1,n}(B_1)$ concentrates at $0,$ then $P_x(v_i)$ concentrates at $x.$ \end{lemma} \begin{proof} \textit{Step 1.} We write $G=G_{\Omega,x}.$ Let $h$ be defined by $h(y)=e^{-\cnn G(y)}$ and hence $u(y)=v(h(y)).$ In particular $$ \nabla u(y)=v'(h(y))\,\nabla h(y). $$ Note that, since $G\geq 0$ in $\Omega$ we get that if $y\in h^{-1}({\{t\}})\cap \Omega,$ then $t\in [0,1].$ Thus the coarea formula gives that \begin{align*} \intomega |\nabla u|^n=&\intomega |v'(h(y))|^n |\nabla h(y)|^{n-1}|\nabla h(y)| dy \smallskip \\ =&\int_0^1\left[\int_{h^{-1}({\{t\}})\cap \Omega}|v'(h(y))|^n|\nabla h(y)|^{n-1}\dH(y)\right]dt. \end{align*} Using that $|\nabla h(y)|=\cnn h(y)|\nabla G(y)|,$ gives $$ \intomega |\nabla u|^n=\int_0^1 \omega_{n-1} t^{n-1} |v'(t)|^n\left[\int_{h^{-1}({\{t\}})\cap\Omega}|\nabla G(y)|^{n-1}\dH(y)\right]dt. $$ Note that $h^{-1}({\{t\}})\cap\Omega$ is a level set of $G.$ Thus we obtain from Proposition \ref{proposition:properties of Green's function} (b) that $$ \int_{h^{-1}({\{t\}})\cap \Omega}|\nabla G(y)|^{n-1} \dH(y)=1\quad\forall\,t\in(0,1), $$ which implies that $$ \int_{\Omega}|\nabla u|^n=\int_0^1|v'(t)|^n \omega_{n-1} t^{n-1}\,dt=\int_{B_1}|\nabla v|^n. $$ This proves \eqref{lemma:eq:nablu u is nabla Pu}. \smallskip \textit{Step 2.} Let us now assume that $\{v_i\}$ concentrates at $0$ and let $\epsilon>0$ be given. We know from Proposition \ref{proposition:properties of Green's function} (e), that for some $M>0$ big enough $\{G>M\}\subset B_{\epsilon}(x).$ Thus we obtain exactly as in Step 1 that $$ \int_{\Omega\backslash B_{\epsilon}(x)}|\nabla u_i|^n\leq \int_{\{G\leq M\}}|\nabla u_i|^n=\int_{e^{-\cnn M}}^1|v_i'(t)|^n\, \omega_{n-1} t^{n-1}\,dt. $$ The right hand side goes to $0,$ since $v_i$ concentrates. This proves that $u_i$ concentrates too. \end{proof} \smallskip We are now able to prove the main theorem. \begin{proof}[Proof (Theorem \ref{theorem:ball to general domain:sup inequality}).] We abbreviate again $G=G_{\Omega,0}.$ From Lemma \ref{lemma:ball to domain via G:preserves dirichlet norm} we know that $u\in\mathcal{B}_1(\Omega).$ Using the coarea formula we get \begin{align*} F_{\Omega}(u)=&\intomega\frac{\big(e^{\alpha u^{n/(n-1)}}-1\big)}{|y|^{\beta}}\frac{|\nabla G(y)|}{|\nabla G(y)|}dy =\int_0^{\infty}\left[\int_{G^{-1}(\{t\})\cap\Omega}\frac{(e^{\alpha u^{n/(n-1)}}-1)}{|y|^{\beta}|\nabla G(y)|}\dH(y)\right]dt \smallskip \\ =&\int_0^{\infty}\left(e^{\alpha v^{\frac{n}{n-1}}\left(e^{-\cnn t}\right)}-1\right) \left[\int_{G^{-1}(\{t\})\cap\Omega}\frac{1}{|y|^{\beta}|\nabla G(y)|}\dH(y)\right]dt. \end{align*} We now use {\color{red}Corollary \ref{corollary:Hypot H}}, and set $$ r(t)=e^{-\cnn t}, $$ to obtain \begin{align*} F_{\Omega}(u)\geq &I_{\Omega}(0)^{n-\beta}\int_0^{\infty}\frac{ e^{\alpha v^{\frac{n}{n-1}}(r(t))}-1}{r(t)^{\beta}}\, \omega_{n-1}\,\omega_{n-1}^{\frac{1}{n-1}} (r(t))^n dt \smallskip \\ =&-I_{\Omega}(0)^{n-\beta}\int_0^{\infty}\frac{ e^{\alpha v^{\frac{n}{n-1}}(r(t))}-1}{r(t)^{\beta}} \,\omega_{n-1} (r(t))^{n-1}\,r'(t) dt \smallskip \\ =&I_{\Omega}(0)^{n-\beta}\int_0^{1}\frac{ e^{\alpha v^{\frac{n}{n-1}}(r)}-1}{r^{\beta}}\, \omega_{n-1} r^{n-1}\,dr=I_{\Omega}(0)^{n-\beta}F_{B_1}(v). \end{align*} This proves the first claim of the theorem. The statement about the concentration follows directly from Lemma \ref{lemma:ball to domain via G:preserves dirichlet norm}. \end{proof} \section{Domain to Ball Construction}\label{section:domain to ball} The aim of this section is to prove the inequality $F_{\Omega}^{\delta}(0)\leq I_{\Omega}(0)^{n-\beta}F_{B_1}^{\delta}(0)$. The main difficulty compared to the $2$-dimensional case is that we have to deal with the $n$-Laplace equation, which becomes a nonlinear partial differential equation with weaker regularity properties. We summarized the results on $n$-harmonic functions that we need in an Appendix. Recall that we assume $0\in\Omega.$ \begin{theorem}[Concentration Formula] \label{theorem:concentration formula by domain to ball} Suppose $\Omega$ contains the origin. Then the following formula holds $$ F_{\Omega}^{\delta}(0){\color{red}=} I_{\Omega}(0)^{n-\beta}F_{B_1}^{\delta}(0). $$ \end{theorem} The proof of this result will be a consequence of the following proposition, which allows to construct a concentrating sequence in the ball from a given concentrating sequence in $\Omega.$ \begin{proposition}\label{proposition:main domain to ball} Let $\{u_i\}\subset \mathcal{B}_1(\Omega)\cap C^{\infty}(\Omega)$ be a sequence which concentrates at $0$ and is a maximizing sequence for $F_{\Omega}^{\delta}(0).$ Then there exists a sequence $\{v_i\}\subset W_{0,rad}^{1, n}(B_1)\cap \mathcal{B}_1(B_1)$ concentrating at $0,$ such that \begin{equation*} F_{\Omega}^{\delta}(0)=\lim_{i\to\infty}F_{\Omega}(u_i)\leq I_{\Omega}^{n-\beta}(0)\liminf_{i\to\infty}F_{B_1}(v_i). \end{equation*} \end{proposition} \begin{proof}[Proof (Theorem \ref{theorem:concentration formula by domain to ball}).] From Lemma \ref{lemma new:sup over W12 same as over Cinfty} and Proposition \ref{proposition:main domain to ball} we immediately obtain that $$ F_{\Omega}^{\delta}(0)\leq I_{\Omega}^{n-\beta}(0)F_{B_1}^{\delta}(0). $$ The reverse inequality follows from Theorem \ref{theorem:ball to general domain:sup inequality}. \end{proof} \smallskip The proof of Proposition \ref{proposition:main domain to ball} is long and technical. We split it into several intermediate steps. To make the presentation less cumbersome, we assume in what follows that $0\in\Omega.$ However, we actually need this, and the fact that concentration occurs at $0,$ only in Step 6 in the proof of Lemma \ref{main lemma si instead of 1. domain to ball}. The proof of the next two Lemmas is identical to the $2$-dimensional case, see \cite{Csato Roy Calc var Pde}. \begin{lemma} \label{lemma:limit over Bri same as Omega for subsequence} Suppose $\{u_i\}\subset \mathcal{B}_1(\Omega)$ concentrates at $x_0\in\Omega$ and let $\{r_i\}\subset\re$ be such that $r_i>0$ for all $i$ and $\lim_{i\to\infty}r_i=0.$ Then there exists a subsequence $u_{j_i}$ such that $$ \lim_{i\to\infty}F_{\Omega}(u_i)= \lim_{i\to\infty}\int_{\Omega}\frac{e^{\alpha u_{i}^\frac{n}{n-1}}-1}{|x|^{\beta}}dx =\lim_{i\to\infty}\int_{B_{2r_i}(x_0)}\frac{e^{\alpha u_{j_i}^\frac{n}{n-1}}-1}{|x|^{\beta}}dx. $$ Moreover any subsequence of $u_{j_i}$ will also satisfy the above equality. \end{lemma} \begin{lemma} \label{lemma:a.e. convergence and bounded by 1} Suppose $\{u_i\}$ is a sequence of measurable non-negative functions such that $u_i\to 0$ almost everywhere in $\Omega.$ Let $\{s_i\}\subset\re$ be a bounded sequence. Then $$ \lim_{i\to\infty}\int_{\{u_i\leq s_i\}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}{|x|^{\beta}}dx=0. $$ \end{lemma} \begin{lemma} \label{lemma:the capacity argument} Suppose $\{u_i\}\subset\mathcal{B}_1(\Omega)\cap C^{\infty}(\Omega)$ concentrates at $0\in\Omega$ and satisfies \begin{equation} \label{eq:lemma:capacity argument maxim seq.} \lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}^{\delta}(0). \end{equation} Then for any $r>0$ there exists $j\in\mathbb{N}$ and $k_j\in [1,2]$ such that \begin{equation} \label{eq:lemma capacity arg. not empty Br} \{u_j\geq k_j\}\cap B_r(0)\neq \emptyset \end{equation} and all connected components $A$ of $\{u_j\geq k_j\}$ will have the property: \begin{equation} \label{eq:lemma:capacity arg. Br and B2r} \text{If }\;A\cap B_r(0)\neq\emptyset\quad\text{ then }\quad A\subset B_{2r}(0). \end{equation} Moreover $A$ has smooth boundary. \end{lemma} \begin{proof} It is sufficient to prove that there exists $j\in \mathbb{N}$ such that \eqref{eq:lemma capacity arg. not empty Br} is satisfied for $k_j=2$ and \eqref{eq:lemma:capacity arg. Br and B2r} holds for the connected components of $\{u_j\geq 1\},$ i.e. $k_j=1.$ This implies that \eqref{eq:lemma capacity arg. not empty Br} and \eqref{eq:lemma:capacity arg. Br and B2r} also hold for any $k\in [0,1],$ and hence, using Sard's theorem, one can choose $k_j\in [1,2]$ appropriately such that $A$ has smooth boundary in addition. First note that for all $ m\in\mathbb{N}$ there exists a $j\geq m$ such that \eqref{eq:lemma capacity arg. not empty Br} must hold. If this is not the case, then Lemma \ref{lemma:limit over Bri same as Omega for subsequence} and Lemma \ref{lemma:a.e. convergence and bounded by 1} imply that $$ \lim_{i\to\infty}F_{\Omega}(u_i)\leq \lim_{i\to \infty}\int_{B_r} \frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb \leq\lim_{i\to\infty}\int_{\{u_i\leq 2\}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb=0, $$ which is a contradiction to \eqref{eq:lemma:capacity argument maxim seq.} (Recall that $F_{\Omega}^{\delta}(0)>0,$ see Remark \ref{remark:F delta zero is not zero}). Suppose now that \eqref{eq:lemma:capacity arg. Br and B2r} does not hold. We show that this leads to a contradiction, using a capacity argument in dimension $n-1$ (following the idea in \cite{Flucher book} Equation (2.12) page 15). In that case there exists for all $j\in\mathbb{N}$ a connected component $D_j$ of $\{u_j\geq 1\}$ and $a,b\in\Omega$ such that $$ a\in D_j\cap B_r\quad\text{ and }\quad b\in D_j\cap \Omega\backslash B_{2r}. $$ For what follows we fix $j$ and omit the explicit dependence on $j$ (Note that $a$ and $b$ depend on $j$). Without loss of generality we can assume, by rotating the domain, that $b=(b_1,0)$ and $b_1\geq 2r.$ Therefore, since $D_j$ is connected, for all $x_1\in [r,2r]$ there exists a $X' = (x_2, \cdots, x_n) =X'(x_1)\in\re^{n-1}$ such that $x=(x_1, X'(x_1))\in D_j.$ In particular $u_j(x)\geq 1.$ Since $\Omega$ is bounded, there exists an $M>0,$ which is independent of the rotation of the domain (and hence of $j$), such that $\Omega\subset B_M(0)$. In particular this implies that \begin{equation}\label{eq:X prime smaller M} \left|X'(x_1)\right|\leq M\quad\text{ for all }x_1\in [r,2r]. \end{equation} Let us extend $u_j$ by zero in $\re^n\backslash\Omega.$ Denote by $$ B'_R(y')\text{ ball of radius $R$ in $\re^{n-1}$ centered at $y'\in \re^{n-1}$}\quad\text{ and }\quad \nabla'u=\left( \frac{\partial u}{\partial x_2},\ldots,\frac{\partial u}{\partial x_n}\right). $$ With this notation, using \eqref{eq:X prime smaller M}, we have $u_j\left(x_1,y\right)=0$ for $y$ outside of $B'_{2M}\left(X'(x_1)\right)$ for all $x_1\in (r,2r).$ Moreover $u_j(x_1,X'(x_1))\geq 1.$ Using now the properties of $n$-capacity in $n-1$ dimension, see for instance \cite{Heinonen and others} Example 2.12 pages 35--36, \begin{align*} \int_{B'_{2M}\left(X'(x_1)\right)}\left|\nabla'u_j(x_1,y')\right|^n dy' \geq & \operatorname{cap}_n\left(\left\{X'(x_1)\right\},B_{2M}'\left(X'(x_1)\right)\right) \smallskip \\ =& \operatorname{cap}_n\left(\left\{0\right\},B_{2M}'\left(0\right)\right)=c(n,M)>0,\quad\text{ for all }x_1\in (r,2r), \end{align*} for some positive constant $c(n,M)$ depending only on $n$ and $M.$ Hence, using also that $\Omega$ intersected with any plane where first coordinate equals $x_1$ is containded in $\{x_1\}\times B'_{M}(0),$ we get \begin{align*} \int_{\Omega\backslash B_r(0)}|\nabla u_j|^n \geq & \int_{\Omega\backslash B_r(0)}|\nabla'u_j|^n \geq \int_r^{2r}\int_{\Omega\cap \{y_1=x_1\}}|\nabla'u_j(x_1,y')|^n dy'\, dx_1 \smallskip \\ =& \int_r^{2r}\int_{B'_{M}(0)}|\nabla'u_j(x_1,y')|^n dy'\, dx_1 = \int_r^{2r}\int_{B'_{2M}(X'(x_1))}|\nabla'u_j(x_1,y')|^n dy'\, dx_1 \smallskip \\ \geq & c(n,M)r. \end{align*} This implies that $$ r\, c(n,M) \leq \int_{\Omega\backslash B_r}|\nabla u_j|^n. $$ But this cannot hold true for all $j,$ since $u_j$ concentrates at $0$. \end{proof} \smallskip The next lemma is about the first modification of the sequence $\{u_i\}$ given in Proposition \ref{proposition:main domain to ball}. \begin{lemma} \label{lemma:main properties step 1-3 in Flucher} Let $\{u_i\}\subset \mathcal{B}_1(\Omega)\cap C^{\infty}(\Omega) $ be a sequence which concentrates at $0\in\Omega$ and satisfies $$ \lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}^{\delta}(0). $$ Then there exists a sequence $\{v_i\}\subset \mathcal{B}_1(\Omega)$ and sequences $r_i>0,$ with $r_i\to 0$ and $\{k_i\}\in [1,2]$ such that \begin{align*} \{v_i\geq k_i\}\subset B_{2r_i},\quad \Delta_n v_i=0\quad\text{in }\{v_i<k_i\}. \end{align*} Moreover $v_i$ has the properties: there exist a sequence $\{\lambda_i\}\subset\re,$ $\lambda_i>0$ such that \begin{align*} &\text{(i)}\quad \lim_{i\to\infty}\lambda_i=\infty \smallskip \\ &\text{(ii)}\quad \lim_{i\to\infty}v_i(y)=0\quad\text{ for all $y$ in }\Omega\backslash\{0\} \smallskip \\ &\text{(iii)}\quad \lambda_i v_i\to G_{\Omega,0}\quad\text{in }C^1_{\text{loc}}(\Omega\backslash \{0\}) \smallskip \\ &\text{(iv)} \quad\lim_{i\to\infty}F_{\Omega}(v_i)=F_{\Omega}^{\delta}(0). \end{align*} \end{lemma} \begin{proof} \textit{Step 1.} Take a sequence of positive real numbers $r_i$ such that $\lim_{i\to\infty}r_i=0$ and choose a subsequence of $u_i$, using Lemma \ref{lemma:limit over Bri same as Omega for subsequence}, such that \begin{equation} \label{eq:proof:lemma st13 Bri} F_{\Omega}^{\delta}(0)=\lim_{i\to\infty}F_{\Omega}(u_i)=\lim_{i\to\infty} \int_{B_{r_i}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb. \end{equation} Choosing again a subsequence we can assume by Lemma \ref{lemma:the capacity argument} that there exist $k_i\in [1,2]$ such that all connected components $A$ of $\{u_i\geq k_i\}$ which intersect $B_{r_i}$ are contained in $B_{2r_i}.$ We define $A_i$ as the union of all such $A.$ We also know from Lemma \ref{lemma:the capacity argument} that $A_i$ is not empty. Let $w_i\in W^{1,n}(\Omega\backslash\overline{A}_i)$ be the solution of, see Theorem \ref{P2, Existence and regularity}, $$ \left\{\begin{array}{c} \Delta_n w_i=0\quad\text{in }\Omega\backslash \overline{A}_i \smallskip \\ w_i=0\quad\text{on }\delomega,\quad w_i=k_i\quad\text{on }\partial A_i. \end{array}\right. $$ We now define $v_i\in W^{1,n}_0(\Omega)$ as $$ v_i=\left\{\begin{array}{rl} u_i&\text{ in }A_i \smallskip \\ w_i&\text{ in }\Omega\backslash A_i\,. \end{array}\right. $$ Since $n$-harmonic functions minimize the $n$-Dirichlet integral we have $\|\nabla v_i\|_{L^n}\leq \|\nabla u_i\|_{L^n}.$ Thus we have constructed a sequence which has the properties: (we have used Theorem \ref{P1, Strong maximum principle} in the second property) \begin{align*} \{v_i\geq k_i\}\subset B_{2r_i},\quad \Delta_n v_i=0\quad\text{in }\{v_i<k_i\}\quad\text{and}\quad \|\nabla v_i\|_{L^n}\leq 1. \end{align*} \textit{Step 2.} We will show in this Step that for all $y\in\Omega\backslash\{0\}$ we have $v_i(y)>0$ for all $i$ large enough and $\lim_{i\to\infty}v_i(y)=0.$ The fact that $v_i(y)>0$ follows from the maximum principle Theorem \ref{P1, Strong maximum principle}. Since $\Omega$ is bounded there exists $M>0$ such that $\Omegabar\subset B_M.$ Define $W_i=B_M\backslash\overline{B_{2r_i}}$ and let $\psi_i$ be the solution of $$ \left\{\begin{array}{c} \Delta_n \psi_i=0\quad\text{ in }W_i \smallskip \\ \psi_i=2\;\text{ on }\partial B_{2r_i}\quad\text{ and } \quad\psi_i=0\;\text{ on }\partial B_M. \end{array}\right. $$ The function $\psi_i$ can be given explicitly: $$ \psi_i=\frac{2}{\log\big(\frac{2r_i}{M}\big)}\log\left(\frac{|x|}{M}\right). $$ Recall that $k_i\in[1,2]$ and note that \begin{align*} &\psi_i>0\,\text{ and }\,v_i=0\quad\text{ on }\delomega, \smallskip \\ &\psi_i=2\,\text{ and }\,v_i<k_i\leq 2\quad\text{ on }\partial B_{2r_i}, \end{align*} and thus $\psi_i-v_i>0$ on $\partial W_i$. Since $v_i$ is also harmonic in $W_i$ the comparison principle (Theorem \ref{P3, Comparison Principle}) implies that $v_i\leq \psi_i$ in $W_i$. For $i$ big enough $y\in W_i$ and the claim of Step 2 follows from the fact that $\lim_{i\to\infty}\psi_i(y)=0.$ \smallskip \textit{Step 3.} Choose $y\in \Omega\backslash\{0\}$ and define $\lambda_i$ by \begin{equation}\label{eq:lemma proof:def of lambdai by uiy} \lambda_i=\frac{G_{\Omega,0}(y)}{v_i(y)}\quad\Leftrightarrow\quad \lambda_iv_i(y)=G_{\Omega,0}(y) \end{equation} In view of Step 2 this is well defined, $\lambda_i>0$ and $$ \lim_{i\to\infty}\lambda_i=\infty. $$ Let $y\in K_1\subset \Omega\backslash\{0\}$ be a compact set. Choose another compact set $K_2,$ such that $K_1\subset\subset K_2\subset \Omega\backslash\{0\}.$ Applying Harnack inequality (Theorem \ref{P4, Harnack inequality}) on $K_2$ we get that there exist $c_1,c_2>0,$ such that \begin{equation} \label{vi uniformly bounded} c_1|G_{\Omega,0}(y)|\leq |\lambda_i v_i(x)|\leq c_2|G_{\Omega,0}(y)|,\quad\forall\,x\in K_2\,\text{ and }\,\forall\,i\text{ large enough}. \end{equation} Hence the sequence $\lambda_iv_i$ is uniformly bounded in the $C^0(K_2)$ norm. It follows from Theorem \ref{P5, Uniform Regularity} that \begin{equation} \label{vi uniformly bounded in C1 alpha norm} \lambda_i v_i\quad\text{ is uniformly bounded in the $C^{1,\alpha}(K_1)$ norm} \end{equation} for some $0<\alpha.$ Using the compact embedding $C^{1,\alpha}(K_1)\hookrightarrow C^1(K_1)$ we obtain that there exists $g\in C^1(K_1)$ and a subsequence $v_i$ with $$ g_i:=\lambda_i v_i\to g\quad\text{ in }C^1(K_1). $$ It follows from \eqref{eq:lemma proof:def of lambdai by uiy} and Corollary \ref{P6, Bocher Theorem} that $g=G_{\Omega,0},$ once we have shown that $g=0$ on $\delomega.$ We prove this claim in the next step. \smallskip \textit{Step 4.} We show now that $g=0$ on $\delomega.$ Define $\Omega_{\epsilon}$ as $$ \Omega_{\epsilon}=\left\{x\in\Omega:\, 0<\operatorname{dist}(x,\delomega)<\epsilon\right\}, $$ where $\epsilon$ will be chosen later small enough, and $$ \partial\Omega_{\epsilon}=\delomega\cup \Gamma_{\epsilon}\quad\text{ where }\quad \Gamma_{\epsilon}=\left\{ x\in \Omega:\, \operatorname{dist}(x,\delomega)=\epsilon\right\}. $$ \textit{Step 4.1.} We claim that $g_i$ are uniformly bounded on $\Omega_{\epsilon}.$ Note that $g_i=0$ on $\delomega.$ So for small enough $\epsilon$ it follows from Lemma \ref{lemma1:Moser iteration} and Remark \ref{remark:locality Lieberman hypothesis} (ii) (as in the proof of Proposition \ref{proposition:hypothesis Liebermann satisfied}) that \begin{equation} \label{gi Linf norm bound by Ln} \|g_i\|_{L^{\infty}(\Omega_{\epsilon})}\leq C(\Omega_{\epsilon})\|g_i\|_{L^n(\Omega_{\epsilon})}. \end{equation} We now fix such an $\epsilon>0$ for which \eqref{gi Linf norm bound by Ln} holds and we can also assume that $\Omega_{\epsilon}$ is a smooth set. It follows from \eqref{vi uniformly bounded in C1 alpha norm} that there exists $\Lambda_1=\Lambda_1(K_1,K_2)$ (chosing $K_1$ such that $\Gamma_{\epsilon}\subset K_1$), such that $$ \|g_i\|_{C^{1,\alpha}(\Gamma_{\epsilon})}\leq \Lambda_1\quad\text{ for all $i$ big enough}, $$ and hence also for some $\Lambda_2>0$ $$ \|g_i\|_{W^{1-\frac{1}{n},n}(\Gamma_{\epsilon})}\leq \Lambda_2\quad\text{ for all $i$ big enough}. $$ Chose now a bounded right inverse $T$ of the trace operator on $\delomega_{\epsilon}$ as $$ T:W^{1-\frac{1}{n}}(\partial\Omega_{\epsilon})\to W^{1,n}(\Omega_{\epsilon}) $$ and apply it to $g_i$ restricted to $\delomega_{\epsilon}.$ Hence there exists $h_i\in W^{1,n}(\Omega_{\epsilon}),$ $h_i=T(g_i)$ such that $$ h_i=g_i\quad\text{ on }\delomega_{\epsilon} $$ and \begin{equation} \label{hi uniformly bounded} \|h_i\|_{W^{1,n}(\Omega_{\epsilon})}\leq C_1(\Omega_{\epsilon})\|g_i\|_{W^{1-\frac{1}{n},n}(\delomega_{\epsilon})}\leq C_1(\Omega_{\epsilon})\Lambda_2\,. \end{equation} As in the proof of Proposition \ref{proposition:hypothesis Liebermann satisfied}, since $\Delta_n g_i=0$ in $\Omega_{\epsilon}$ for $i$ big enough, \begin{align*} \|g_i-h_i\|_{L^n(\Omega_{\epsilon})}\leq C_2(\Omega_{\epsilon})\|\nabla g_i-\nabla h_i\|_{L^n(\Omega_{\epsilon})} \leq C_2\left(\|\nabla g_i\|_{L^n(\Omega_{\epsilon})}+\|\nabla h_i\|_{L^n(\Omega_{\epsilon})}\right) \smallskip \\ \leq 2 C_2 \|\nabla h_i\|_{L^n(\Omega_{\epsilon})}\leq 2 C_1 C_2\Lambda_2\,. \end{align*} Since the $h_i$ are also uniformly bounded by \eqref{hi uniformly bounded} it follows the $g_i$ are uniformly bounded in the $L^{\infty}(\Omega_{\epsilon})$ norm. This shows Step 4.1. \smallskip \textit{Step 4.2.} We now conclude that $g=0$ on $\delomega.$ Fix some $a>0$ so that $B_a(0)\subset\subset\Omega$ and define $\Omega_a=\Omega\backslash \overline{B_a}(0).$ Note that $g_i$ is uniformly bounded on $\partial B_a(0)$ in the $C^{1,\alpha}$ norm, using again \eqref{vi uniformly bounded in C1 alpha norm}, i.e. for some $\Lambda_3>0$ we have $$ \|g_i\|_{C^{1,\alpha}(\partial B_a(0))}\leq \Lambda_3\,. $$ On the compact set $\Omega\backslash (B_a(0)\cup\Omega_{\epsilon})$ $g_i$ is uniformly bounded by \eqref{vi uniformly bounded}. Thus, together with Step 4.1 this shows that there exists a constant $M_0$ independent of $i$ such that $$ \|g_i\|_{L^{\infty}(\Omega_a)}\leq M_0\,. $$ Note that $$ \Delta_n g_i=0\quad\text{ in }\Omega_a\,. $$ So it follows from Theorem \ref{P2, Existence and regularity} that $$ \|g_i\|_{C^{1,\alpha}(\overline{\Omega_a})}\leq C \left(M_0,\Lambda_3\right). $$ It follows that for some subsequence $g_i\to g$ in $C^1(\overline{\Omega_a})$ from which it follows that $g=0$ on $\delomega.$ \smallskip \textit{Step 5.} It remains to prove (iv). Recall that $v_i\leq k_i$ in $\Omega\backslash A_i$. We therefore obtain, using Lemma \ref{lemma:a.e. convergence and bounded by 1} twice and the definition of $A_i$ that \begin{align*} &\lim_{i\to\infty}\intomega\frac{e^{\alpha v_i^\frac{n}{n-1}}-1}\dxb =\lim_{i\to\infty}\int_{A_i}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb \geq \lim_{i\to\infty}\int_{A_i\cap B_{r_i}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb \smallskip \\ =&\lim_{i\to\infty}\int_{ \{u_i\geq k_i\}\cap B_{r_i}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb=\lim_{i\to\infty}\int_{B_{r_i}}\frac{e^{\alpha u_i^\frac{n}{n-1}}-1}\dxb=F_{\Omega}^{\delta}(0), \end{align*} where we have used \eqref{eq:proof:lemma st13 Bri} in the last equality. \end{proof} \smallskip The next lemma is about the second modification of the sequence $\{u_i\}$ given in Proposition \ref{proposition:main domain to ball}, following the first modification given by Lemma \ref{lemma:main properties step 1-3 in Flucher}. \begin{lemma} \label{lemma:the one we sent to Struwe} Let $\{u_i\}\subset W_0^{1,n}(\Omega)$ be a sequence and $\lambda_i$ a sequence in $\re$ such that $\lambda_i\to\infty,$ $$ \lambda_i u_i\to G_{\Omega,0}\quad\text{ in }C^0_{loc}({\Omega}\backslash\{0\})\quad\text{ and }\quad \Delta_n u_i=0\text{ in }\{u_i<1\}. $$ Then there exists a subsequence $\lambda_{i_l}$ and a sequence $\{v_l\}\subset W^{1,n}_0(\Omega)$ such that the following properties hold true: (a) $\lambda_{i_l}\geq l$ (b) The sets $\left\{v_l\geq l/\lambda_{i_l}\right\}$ are approximately small balls at $0$ as $l\to\infty.$ (c) $v_l(x)\to 0$ as $l\to\infty$ for every $x$ in $\Omega\backslash\{0\}.$ (d) For every $l$ $$ \intomega|\nabla v_l|^n\leq\intomega|\nabla u_{i_l}|^n. $$ (e) The inequality $v_l\geq u_{i_l}$ holds in $\Omega.$ In particular $F_{\Omega}( v_l)\geq F_{\Omega} ( u_{i_l}).$ \end{lemma} \begin{proof} The proof is exactly the same as in the $2$-dimensional case, since one can use the strong maximum principle, Theorem \ref{P1, Strong maximum principle}, for $n$-harmonic functions. \end{proof} \smallskip After having modified the sequence $\{u_i\}$ given in Proposition \ref{proposition:main domain to ball} in the two previous lemmas, we finally construct the appropriate corresponding sequence $\{v_i\}\subset W_{0,rad}^{1,n}(B_1).$ This is contained in the following lemma. \begin{lemma}\label{main lemma si instead of 1. domain to ball} Let $\{u_i\}\subset W_0^{1,n}(\Omega)$ and $\{s_i\}\subset\re$ be sequences with the following properties: $$ s_i\leq 1\quad\forall\,i\in\mathbb{N}, $$ the sets $\{u_i\geq s_i\}$ are approximately small balls at $0$ as $i\to\infty$ and moreover suppose that pointwise $u_i(x)\to 0$ for all $x\in\Omega\backslash\{0\}.$ Then there exists a sequence $\{v_i\}\subset W^{1,n}_{0,rad}(B_1)$ such that for all $i$ $$ \|\nabla v_i\|_{L^n(B_1)}\leq \|\nabla u_i\|_{L^n(\Omega)} $$ and, assuming that the left hand side limit exists, $$ \lim_{i\to\infty}F_{\Omega}(u_i)\leq I_{\Omega}(0)^{n-\beta}\lim\inf_{i\to\infty}F_{B_1}(v_i). $$ Moreover $v_i(x)\to 0$ for all $x\in B_1\backslash \{0\}$ and if $v_i$ concentrates at some $x_0\in B_1,$ then $x_0=0.$ \end{lemma} \begin{proof} Throughout this proof $G=G_{\Omega,0}$ shall denote the $n$-Green's function of $\Omega$ with singularity at $0.$ Recall that by assumption there exists real positive numbers $\rho_i$ and $\epsilon_i$ such that for $i\to\infty$ \begin{equation} \label{eq:lemma si instead of 1:eps over rho to zero} \rho_i\to 0\quad\text{ and }\quad \frac{\epsilon_i}{\rho_i}\to 0, \end{equation} satisfying for all $i$ the following inclusion \begin{equation} \label{eq:lemma si instead of 1:ui bigger si are asymptotic balls} B_{\rho_i-\epsilon_i}\subset\{u_i\geq s_i\}\subset B_{\rho_i+\epsilon_i}. \end{equation} \smallskip \textit{Step 1.} Let us define $\lambda_i$, implicitly, by the following equation: \begin{equation} \label{eq:lemma:definition of rhoi via conf. incenter. dim n} \rho_i=I_{\Omega}(0)e^{-\cnn \lambda_i}, \end{equation} that is $$ \lambda_i=-\frac{1}{\cnn}\log\left(\frac{\rho_i}{I_{\Omega}(0)}\right). $$ Note that $\lambda_i\to\infty$ as $i\to\infty.$ We claim that there exists $t_i\geq \lambda_i$ such that \begin{equation} \label{eq:proof:ti-lambdai goes to zero. dim n} \lim_{i\to\infty}(t_i-\lambda_i)=0 \end{equation} and \begin{equation} \label{eq:proof:G bigger ti in ui bigger 1. dim n} \{G\geq t_i\}\subset\{u_i\geq s_i\}. \end{equation} To show this we use Proposition \ref{proposition:properties of Green's function} (e), which states that if $t_i\geq 0$ is given such that $t_i\to\infty$, then there exists $\sigma_i\geq 0$ such that $$ \lim_{i\to\infty}\frac{\sigma_i}{\tau_i}=0 $$ and $$ B_{\tau_i-\sigma_i}\subset\{G\geq t_i\}\subset B_{\tau_i+\sigma_i}, $$ where $\tau_i=I_{\Omega}(0)e^{-\cnn t_i}.$ In view of \eqref{eq:lemma si instead of 1:ui bigger si are asymptotic balls} it is therefore sufficient to choose $t_i$ such that \begin{equation} \label{eq:proof lemma:implicit def. of ti. dim n} \tau_i+\sigma_i=\rho_i-\epsilon_i\,. \end{equation} It remains to show that with this choice \eqref{eq:proof:ti-lambdai goes to zero. dim n} is also satisfied. Using \eqref{eq:lemma:definition of rhoi via conf. incenter. dim n} and solving the previous equation for $t_i$ explicitly gives that $$ t_i=\lambda_i-\frac{1}{\cnn}\log\left(1-\frac{\epsilon_i+\sigma_i}{\rho_i}\right). $$ Since we know from \eqref{eq:lemma si instead of 1:eps over rho to zero} that $\epsilon_i/\rho_i\to0,$ it is sufficient to show that $\sigma_i/\rho_i\to 0.$ We obtain from \eqref{eq:proof lemma:implicit def. of ti. dim n} that $$ \frac{\sigma_i}{\tau_i}=\frac{\sigma_i}{\rho_i-\epsilon_i-\sigma_i} =\frac{\sigma_i}{\rho_i\left(1-\frac{\epsilon_i}{\rho_i}-\frac{\sigma_i}{\rho_i} \right)}. $$ Solving this equation for $(\sigma_i/\rho_i)$ and using that $\epsilon_i/\rho_i\to 0$ and $\sigma_i/\tau_i\to 0$ shows that also $(\sigma_i/\rho_i)\to 0.$ This proves \eqref{eq:proof:ti-lambdai goes to zero. dim n}. \smallskip \textit{Step 2.} In this step we will show that \begin{equation} \label{eq:proof lemma: step 2 grad norm of ui and ti. dim n} \int_{\{u_i<1\}}|\nabla u_i|^{n}\geq \frac{s_i^n}{t_i^{n-1}}. \end{equation} Let us denote $$ U=\{u_i\geq s_i\}\quad\text{ and }\quad V=\{G\geq t_i\}. $$ From Step 1 we know that $V\subset U$ and since $u_i=0$ on $\delomega$ we also have that $\overline{U}\subset \Omega.$ Let $h_i\in W^{1,n}(\Omega\backslash V)$ be the unique solution of the problem \begin{align*} \Delta_n h_i=&0\quad\text{in }\Omega\backslash V \smallskip \\ h_i=0\quad\text{on }\delomega\quad\text{and}&\quad h_i=1\quad\text{on } \partial V. \end{align*} We see that this is satisfied precisely by $h_i=G/t_i$. Let us define $w_i\in W^{1,n}(\Omega\backslash V)$ by $$ w_i=\left\{\begin{array}{lr} \frac{u_i}{s_i} &\text{ in }\Omega\backslash U \smallskip \\ 1 &\text{ in } \overline{U}\backslash V. \end{array}\right. $$ Note that $w_i$ has the same boundary values as $h_i$ on the boundary of $\Omega\backslash V.$ Since $h_i$ is the unique minimizer of the functional $$ J(h)=\int_{\Omega\backslash V}|\nabla h|^n $$ among all functions with these fixed boundary values, we get that $$ \int_{\Omega\backslash V}|\nabla h_i|^n\leq \int_{\Omega\backslash V}|\nabla w_i|^n=\int_{\Omega\backslash U}|\nabla w_i|^n= \int_{\{u_i<s_i\}}|\nabla u_i|^n. $$ From Proposition \ref{proposition:properties of Green's function} (a) we know that $$ \int_{\Omega\backslash V}|\nabla h_i|^n =\int_{\{G<t_i\}}\left|\nabla\left(\frac{G}{t_i}\right)\right|^n=\frac{1}{t_i^{n-1}}. $$ Setting this into the previous inequality proves \eqref{eq:proof lemma: step 2 grad norm of ui and ti. dim n}. \smallskip \textit{Step 3.} In this step we will define $v_i\in W_{0,rad}^{1,n}(B_1).$ Let $\Omega^{\ast}=B_R$ be the symmetrized domain and $u_i^{\ast}\in W_{0,rad}^{1,n}(B_R)$ be the radially decreasing symmetric rearrangement of $u_i$. Then there exists $0<a_i<R$ such that \begin{equation} \label{eq:proof lemma step 3:definition of ai. dim n} \{u_i^{\ast}\geq s_i\}=B_{a_i}. \end{equation} Moreover define $0<\delta_i<1$ by $$ \delta_i=e^{-\cnn t_i}. $$ At last we can define $v_i$ as $$ v_i(x)=\left\{\begin{array}{lr} -\frac{s_i}{\cnn t_i}\log(|x|) &\text{ if }x\geq \delta_i \smallskip \\ u_i^{\ast}\left(\frac{a_i}{\delta_i}x\right) & \text{ if }x \leq \delta_i\,. \end{array}\right. $$ Note that $v_i$ belongs indeed to $W^{1,n}(B_1)$ since $$ u_i^{\ast}(a_i)=s_i=-\frac{s_i}{\cnn t_i}\log(\delta_i). $$ \smallskip \textit{Step 4.} In this Step we will show that $\|\nabla v_i\|_{L^n(B_1)}\leq \|\nabla u_i\|_{L^n(\Omega)}.$ Let us denote $$ A_i=\int_{B_1\backslash B_{\delta_i}}|\nabla v_i|^n\quad\text{ and } D_i=\int_{B_{\delta_i}}|\nabla v_i|^n. $$ A direct calculation gives that \begin{equation} \label{eq:Ai estimate} A_i=\frac{\omega_{n-1} \,s_i^n}{\omega_{n-1}^{n/(n-1)}\,t_i^n}\int_{\delta_i}^1\frac{1}{r}dr=\frac{s_i^n}{t_i^{n-1}}. \end{equation} Using a change of variables and Proposition \ref{prop:Hardy littlewoood modified} (ii) gives that $$ D_i=\int_{B_{a_i}}|\nabla u_i^{\ast}|^n=\int_{\{u_i^{\ast}\geq s_i\}} |\nabla u_i^{\ast}|^n\leq \int_{\{u_i\geq s_i\}}|\nabla u_i|^n. $$ Finally we get that, using \eqref{eq:proof lemma: step 2 grad norm of ui and ti. dim n}, that $$ \int_{B_1}|\nabla v_i|^n=D_i+A_i\leq \int_{\Omega}|\nabla u_i|^n-\int_{\{u_i<s_i\}}|\nabla u_i|^n+\frac{s_i^n}{t_i^{n-1}}\leq \int_{\Omega}|\nabla u_i|^n. $$ \smallskip \textit{Step 5.} In this step we show that $$ \lim_{i\to\infty}\frac{a_i}{\delta_i}=I_{\Omega}(0). $$ Using the fact that $|\{u_i^{\ast}\geq s_i\}|=|\{u_i\geq s_i\}|,$ we get from \eqref{eq:proof lemma step 3:definition of ai. dim n} and the hypthesis \eqref{eq:lemma si instead of 1:ui bigger si are asymptotic balls} we get that $\rho_i-\epsilon_i\leq a_i\leq \rho_i+\epsilon_i.$ From this equation we obtain that $$ \frac{\rho_i}{\delta_i}\left(1-\frac{\epsilon_i}{\rho_i}\right) \leq\frac{a_i}{\delta_i}\leq \frac{\rho_i}{\delta_i}\left(1+\frac{\epsilon_i}{\rho_i}\right). $$ From the hypothesis \eqref{eq:lemma si instead of 1:eps over rho to zero} we know that $\epsilon_i/\rho_i\to 0.$ It is therefore sufficient to calculate the limit of $\rho_i/\delta_i$. In view the definitions of $\rho_i$,$\delta_i$ and \eqref{eq:proof:ti-lambdai goes to zero. dim n} this is indeed equal to $$ \lim_{i\to\infty}\frac{\rho_i}{\delta_i}=\lim_{i\to\infty}I_{\Omega}(0)e^{\cnn(t_i-\lambda_i)}=I_{\Omega}(0), $$ which proves the statement of this step. \smallskip \textit{Step 6 (equality of functional limit).} Let us first show that both $u_i$ and $v_i$ converge to zero almost everywhere. For $u_i$ this holds true by hypothesis. So let $x\in B_1\backslash\{0\}$ be given and note that for all $i$ big enough $$ x\geq e^{-\cnn\sqrt{t_i}}\geq e^{-\cnn t_i}=\delta_i\,. $$ Therefore we obtain from the definition of $v_i$ that $$ v_i(x)\leq-\frac{s_i}{\cnn t_i}\log\left(e^{-\cnn\sqrt{t_i}}\right)= \frac{s_i}{\sqrt{t_i}}\to 0, $$ which shows the claim also for $v_i$. In view of lemma \ref{lemma:a.e. convergence and bounded by 1} it is therefore sufficient to show that \begin{equation} \label{eq:proof lemma:functional equality on ui bigger 1. dim n} \lim_{i\to\infty}\int_{\{u_i\geq s_i\}}\frac{e^{\alpha u_i^{n/(n-1)}}-1}{|x|^\beta} =I_{\Omega}^{n-\beta}(0) \liminf_{i\to\infty}\int_{\{v_i\geq s_i\}}\frac{e^{\alpha v_i^{n/(n-1)}}-1}{|x|^\beta}. \end{equation} From Proposition \ref{prop:Hardy littlewoood modified} (i) and the properties of symmetrization we get that for every $i$ $$ \int_{\{u_i\geq s_i\}}\frac{e^{\alpha u_i^{n/(n-1)}}-1}{|x|^\beta}\leq \int_{\{u_i^{\ast}\geq s_i\}}\frac{e^{\alpha (u_i^{\ast})^{n/(n-1)}}-1}{(|x|^\beta)^{\ast}} = \int_{B_{a_i}}\frac{e^{\alpha (u_i^{\ast})^{n/(n-1)}}-1}{(|x|^\beta)^{\ast}}. $$ Note that if $\beta=0$ then the inequality can actally be replaced by an equality (see Kesavan, page 14, equation (1.3.2)). For $i$ big enough $B_{a_i}\subset \Omega,$ and then $(|x|^{\beta})^{\ast}=|x|^{\beta}$ for all $x\in B_{a_i}.$ Making the substitution $x=(a_i/\delta_i)\,y$ gives $$ \int_{\{u_i\geq s_i\}}\frac{e^{\alpha u_i^{n/(n-1)}}-1}{|x|^\beta}\leq \left(\frac{a_i}{\delta_i}\right)^{n-\beta}\int_{B_{\delta_i}} \frac{e^{\alpha v_i^{n/(n-1)}}-1}{|y|^\beta} =\left(\frac{a_i}{\delta_i}\right)^{n-\beta}\int_{\{v_i\geq s_i\}} \frac{e^{\alpha v_i^{n/(n-1)}}-1}{|x|^\beta}. $$ From Step 5 we therefore get that $$ \lim_{i\to\infty}\int_{\{u_i\geq s_i\}}\frac{e^{\alpha u_i^{n/(n-1)}}-1}{|x|^\beta}\leq I_{\Omega}(0)^{n-\beta}\liminf_{i\to\infty}\int_{\{v_i\geq s_i\}} \frac{e^{\alpha v_i^{n/(n-1)}}-1}{|x|^\beta}, $$ which proves \eqref{eq:proof lemma:functional equality on ui bigger 1. dim n}. \smallskip \textit{Step 7.} The last statement of the lemma ($v_i$ can concentrate only at $0$) follows from \eqref{eq:Ai estimate}, because $\lim_{i\to\infty}A_i=0$ (using that $t_i\to\infty).$ Thus $v_i$ cannot concentrate at any other point than $0.$ \end{proof} \smallskip We are now able to prove the main proposition of this section. \smallskip \begin{proof}[Proof (Proposition \ref{proposition:main domain to ball}).] The proof is exactly the same as in the $2$-dimensional case, see details in \cite{Csato Roy Calc var Pde}: One modifies succesively the given sequence $u_i$ using Lemma \ref{lemma:main properties step 1-3 in Flucher} and Lemma \ref{lemma:the one we sent to Struwe} and construct finally a sequence $\{v_i\}\subset W_{0,rad}^{1,n}(B_1)\cap\mathcal{B}_1(B_1),$ using Lemma \ref{main lemma si instead of 1. domain to ball}, such that $$ F^{\delta}_{\Omega}(0)\leq\lim_{i\to\infty}F_{\Omega}(u_i)\leq I_{\Omega}^{n-\beta}(0)\liminf_{i\to\infty}F_{B_1}(v_i). $$ The sequence $\{v_i\}$ has to concentrate at $0,$ because it goes to zero almost everywhere. (use last statment of Lemma \ref{main lemma si instead of 1. domain to ball}, Theorem \ref{theorem:concentration alternative for singular moser trudinger} and Remark \ref{remark:F delta zero is not zero}). \end{proof} \smallskip \section{Proof of the Main Result}\label{section:proof main theorem} We now prove Theorem \ref{theorem:intro:Extremal for Singular Moser-Trudinger}. We assume that $0\in\Omega,$ the other cases are proven exactly as in the two dimensional setting. For the case $0\in \partial\Omega$ use \cite{Wang Wei} Proposition 2.4 (3), which implies that $I_{\Omega_m}(0)$ tends to zero if $\{\Omega_m\}$ is a sequence of sets whose boundary approaches the origin. \smallskip \begin{proof} Let $\{u_i\}_{i\in\mathbb{N}}\subset \mathcal{B}_1(\Omega)$ be a maximizing sequence for $F_{\Omega}$. Then by Theorem \ref{theorem:concentration alternative for singular moser trudinger}, for some subsequence, either $$ \lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}(u), $$ or $\{u_i\}$ concentrates at some point $x\in\Omegabar.$ In the first case $u$ is an extremal function and we are done. It remains to exclude concentration. Assume, by contradiction, we have concentration at $x.$ By Proposition \ref{proposition:if u_i concentrates somewhere else than zero} we must have $x=0$ (because we have assumed $\{u_i\}$ is a maximizing sequence and $F_{\Omega}^{\sup}\neq 0$). Thus we get \begin{equation} \label{eq:1} F_{\Omega}^{\sup}=\lim_{i\to\infty}F_{\Omega}(u_i)=F_{\Omega}^{\delta}(0). \end{equation} By Theorem \ref{theorem:concentration formula by domain to ball} it holds \begin{equation} \label{eq:2} F_{\Omega}^{\delta}(0)=I_{\Omega}(0)^{n-\beta}F_{B_1}^{\delta}(0), \end{equation} and by Theorem \ref{theorem:supremum of FOmega on Ball} \begin{equation} \label{eq:3} F_{B_1}^{\delta}(0)<F_{B_1}^{\sup}. \end{equation} Finally Theorem \ref{theorem:ball to general domain:sup inequality} states \begin{equation} \label{eq:4} F_{B_1}^{\sup}I_{\Omega}(0)^{n-\beta}\leq F_{\Omega}^{\sup}. \end{equation} Combining \eqref{eq:1}-\eqref{eq:4} gives the contradiction $F_{\Omega}^{\sup}<F_{\Omega}^{\sup},$ and therefore concentration cannot occur. \end{proof} \begin{comment} \section{Appendix I: hyperspherical coordinates in $\re^n$} \label{Appendix: hyperspherical coordinates in Rn} We have used in Section \ref{section:n greens function} the hyperspherical coordinates and their properties. Let us define $Q\subset\re^{n-1}$ by $$ Q=(0,\pi)^{n-2}\times (0,2\pi). $$ The hypershperical coordinates $H=(H_1,\ldots,H_n):Q\to S^{n-1}\subset\re^n$ are defined as: for $k=1,\ldots,n$ and $\varphi=(\varphi_1,\ldots,\varphi_{n-1})$ $$ H_k(\varphi)=\cos\varphi_k\prod_{l=0}^{k-1}\sin\varphi_l\quad\text{ with convention }\varphi_0=\frac{\pi}{2},\quad\varphi_n=0. $$ A calculation shows that $$ d_i(\varphi):=\left\langle \frac{\partial H}{\partial \varphi_i},\frac{\partial H}{\partial \varphi_i}\right\rangle =\prod_{l=0}^{i-1}\sin^2\varphi_l>0. $$ One verifies that the metric tensor $S^{n-1}$ in these coordinates is diagonal $$ g_{ij}(\varphi)=\left\langle\frac{\partial H}{\partial \varphi_i},\frac{\partial H}{\partial \varphi_j}\right\rangle=\delta_{ij}d_i(\varphi), $$ ($\delta_{ij}=1$ if $i=j$ and $0$ else) and hence the surface element $g$ is given by \begin{equation}\label{eq:g for hypersph coord explicit} g(\varphi)=\sqrt{\det g_{ij}(\varphi)}=\sqrt{\prod_{k=1}^{n-1}d_k(\varphi)}= \prod_{k=1}^{n-2}(\sin\varphi_k)^{n-k-1}. \end{equation} Let us also define the spherical change of variables in $\re^n,$ denoted by $G:(0,\infty)\times Q\to\re^n$ by $$ G(t,\varphi)=tH(\varphi). $$ Its Jacobian volume element is then given by $$ \det DG(t,\varphi)=t^{n-1}g(\varphi). $$ For our purpose the following lemma will be useful. \begin{lemma}\label{lemma:parametrization r H} Suppose $T\subset Q$ is an open set and a hypersurface $\Gamma\subset\re^n$ is given by the parametrization $F:T\to \Gamma$ $$ F(\varphi)=r(\varphi)H(\varphi), $$ where $r$ is some smooth function $r:T\to (0,\infty).$ Then the metric tensor in this parametrization calculates as $$ \det\left(\left\langle\frac{\partial F}{\partial \varphi_i},\frac{\partial F}{\partial \varphi_j}\right\rangle\right)_{i,j=1,\ldots,n-1} =r^{2n-4}\left(\sum_{i=1}^{n-1}\Big(\frac{\partial r}{\partial \varphi_i}\Big)^2d_1\cdots \widehat{d_i}\cdots d_{n-1}+r^2\prod_{i=1}^{n-1}d_i\right), $$ where $\widehat{d_i}$ means that $d_i$ should be omitted in the product. In particular, since $d_i>0,$ the surface element is bigger than $r^{n-1}g(\varphi).$ \end{lemma} \begin{proof} Using the relations $$ \langle H;H\rangle =1,\quad \left\langle H;\frac{\partial H}{\partial \varphi_i}\right\rangle=0, $$ one obtains that $$ M_{ij}:=\left\langle\frac{\partial F}{\partial \varphi_i},\frac{\partial F}{\partial \varphi_j}\right\rangle=\frac{\partial r}{\partial \varphi_i}\frac{\partial r}{\partial\varphi_j}+r^2g_{ij}=\frac{\partial r}{\partial \varphi_i}\frac{\partial r}{\partial\varphi_j}+r^2\delta_{ij}d_i\,. $$ Thus the matrix $M$ with entries $M_{ij}$ is of the form $M=A+r^2 D$ where $A$ has rank $1$ and $D$ is diagonal with entries $d_i$. Thus using the linearity of the determinant in the columns one obtains that (since no matrix with two columns of $A$ survives when developing the determinant succesively with respect to the columns) $$ \det M=\sum_{i=1}^{n-1}\det \widehat{A_i}+\det r^2 D, $$ where $\widehat{A_i}$ is the matrix obtained from $r^2D$ by replacing the $i$-th column of $r^2D$ by the $i$-th column of $A.$ From this the lemma follows. \end{proof} \end{comment} \section{Appendix: $n$-harmonic functions} \label{section:n harmonic functions} We summarize the results on $n$-harmonic functions that we have used. We only state them under the more restrictive hypothesis that are sufficient for our construction of the $n$-harmonic transplantation and we refer to references for more general versions. \begin{definition} Let $\Omega\subset\re^n$ be an open set and let $f\in W^{1,n}(\Omega).$ we say that $f$ is $n$-harmonic, that is $$ \Delta_n f=0\quad\text{ in }\Omega, $$ if $$ \intomega|\nabla f|^{n-2}\langle \nabla f,\nabla\varphi\rangle =0\quad \text{ for all }\varphi\in C_c^{\infty}(\Omega). $$ \end{definition} The existence of $W^{1,n}$ solutions to the $n$-Laplace equation follows easily by direct methods of the calculus of variations. The difficult part of the next theorem is the $C^{1,\alpha}$ regularity. For the interior regularity see \cite{diBenedetto}, \cite{Tolksdorf1} or \cite{Evans C1 alpha reg}. Lieberman \cite{Lieberman} proves regularity up to the boundary under the assumption that $f$ is bounded. In this paper we only need the regularity result for very special boundary values (constants on different parts of the boundary). In this case the proof is simple, so we have included a proof of the boundedness, see Proposition \ref{proposition:hypothesis Liebermann satisfied}. For a more general version, not assuming the boundedness of $f,$ we have not found a satisfactory reference. \begin{theorem}[Existence and Regularity] \label{P2, Existence and regularity} There exists $0<\alpha<1,$ depending only on $n,$ with the following property. Let $\Omega\subset\re^n$ be a bounded open smooth set, $g\in C^{1,\alpha}(\delomega)$ such that $\|g\|_{C^{1,\alpha}(\delomega)}\leq t_0$ . Then there exists a unique $f\in W^{1,n}(\Omega)$ such that \begin{align*} \Delta_n f=&0\quad\text{ in }\Omega \\ f=&g\quad\text{ on }\delomega. \end{align*} The solution $f$ satisfies \begin{equation} \label{eq:theorem:minimum of n gradient} \intomega|\nabla f|^n\leq \intomega |\nabla\varphi|^n\quad\forall \varphi\in W^{1,n}(\Omega)\text{ with }\varphi=g\quad\text{ on }\delomega. \end{equation} Moreover if $\|f\|_{L^{\infty}}(\Omega)\leq M_0$ then $f\in C^{1,\alpha}(\Omegabar)$ and there exists a constant $C$ depending on $n,\Omega,M_0$ and $t_0$ such that $$ \|f\|_{C^{1,\alpha}(\Omegabar)}\leq C(n,\Omega,M_0,t_0) $$ \end{theorem} A reference for the next three results is for instance \cite{Lindqvist} Theorems 2.15, 2.20 and Corollary 2.21. \begin{theorem}[Comparison Principle] \label{P3, Comparison Principle} Let $\Omega\subset\re^n$ be a bounded open smooth set. Suppose $f,g\in W^{1,n}(\Omega)$ and $\Delta_n f=\Delta_n g=0$ in $\Omega.$ If $$ f\leq g\quad\text{ on }\delomega, $$ then $$ f\leq g\quad\text{ in }\Omega. $$ \end{theorem} \begin{theorem}[Harnack Inequality] \label{P4, Harnack inequality} Let $V$ be a compact set and $U$ open with $V\subset\subset U.$ Then there is a constant $C=C(V)$ such that $$ \sup_V u \leq C \inf_V u $$ for all $u\in W^{1,n}(U)$ such that $\Delta_nu=0$ in $U$ and $u\geq 0$ in $U.$ \end{theorem} \begin{theorem}[Strong maximum principle] \label{P1, Strong maximum principle} Let $\Omega$ be a bounded open set with smooth boundary $\delomega$ and $u\in W^{1,n}(\Omega).$ Suppose $\Delta_n u=0$ in $\Omega,$ $u$ is not constant and $u\geq 0.$ Then the following holds $$ \inf_{\delomega}f<f(x)<\sup_{\delomega} f\quad\text{ for all }x\in \Omega. $$ \end{theorem} The next theorem follows from \cite{Tolksdorf1} Theorem 1. \begin{theorem} \label{P5, Uniform Regularity} Let $V$ be a compact set $V\subset\subset U,$ where is $U$ open. Then there exists $\alpha\in (0,1)$ and a constant $C>0$ depending on $V,U,n,$ and a variable $g_0$ such that $$ \|u\|_{C^{1,\alpha}(V)}\leq C\left(V,U,n,g_0\right) $$ for all $u\in W^{1,n}(U)$ with $\Delta_nu=0$ in $U$ and $=\|u\|_{L^{\infty}(U)}\leq g_0$. \end{theorem} The next theorem is contained in \cite{Serrin 1} Theorem 10 and \cite{Serrin 2} Theorem 3, combined with Theorem \ref{P2, Existence and regularity}. {\color{red}This is the generalization of Bocher's theorem (see \cite{Axler-Bourdon-Ramey} Theorem 3.9 page 50) to $n$-harmonic functions.} \begin{theorem} Let $\Omega\subset\re^n$ be a bounded open smooth set with $0\in \Omega$, $u\in W^{1,n}_{loc}(\Omega\backslash \{0\})$ with the properties $$ \Delta_nu=0\quad \text{ in }\Omega\backslash \{0\}. $$ Then \smallskip (a) \emph{either} $u\in L^{\infty}(\Omega),$ in which case $u$ is continuous in $\Omega.$ Moreove $u\in W^{1,n}(\Omega)$ and it solves the equation $$ \Delta_nu=0\quad\text{ in }\Omega, $$ and hence $u\in C^{1,\alpha}_{loc}(\Omega)$ for some $0<\alpha<1.$ \smallskip (b) \emph{or} there exists a constant $k\in \re$ such that $$ \intomega \langle |\nabla u|^{n-2}\nabla u,\nabla \varphi\rangle=k\varphi(0)\quad\text{ for all }\varphi\in C_c^1(\Omega). $$ \end{theorem} \begin{corollary} \label{P6, Bocher Theorem} Suppose $u\in W^{1,n}(\Omega\backslash\{0\}),$ $\Delta_nu=0$ in $\Omega\backslash\{0\}$ and $u=0$ on $\delomega.$ Then either $u$ is a constant multiple of the $n$-Green's function, i.e. $u=k G_{\Omega,0}(y)$ or $u$ vanishes identically. \end{corollary} The next lemma states that the hypothesis of the regularity result of Lieberman \cite{Lieberman} is satisfied, that is, the boundedness of $f$ by $M_0$ in Proposition \ref{P2, Existence and regularity}. \begin{proposition} \label{proposition:hypothesis Liebermann satisfied} Let $\Omega\subset\re^n$ be a bounded opens smooth set such that $\delomega=\bigcup_{i=1}^L \Gamma_i$ where $\Gamma_i$ are the connected smooth components of $\delomega.$ Let $k_i\in \re,$ $i=1,\ldots,L$ be constants such that $|k_i|\leq k.$ Then there exists a constant $M_0=M_0(\Omega,n,k)$ such that $$ \|u\|_{L^{\infty}}(\Omega)\leq M_0(\Omega,n,k) $$ for all $u\in W^{1,n}(\Omega)$ satisfying $\Delta_n u=0$ in $\Omega$ and $u=k_i$ on $\Gamma_i$ \end{proposition} The following lemma is required for the proof of Proposition \ref{proposition:hypothesis Liebermann satisfied} and has also been used in Lemma \ref{lemma:main properties step 1-3 in Flucher}. \begin{lemma} \label{lemma1:Moser iteration} Let $\Omega,$ $\Gamma_i$, $u$ and $k_i$ be as in Proposition \ref{proposition:hypothesis Liebermann satisfied}. Then there exists constants $C=C(\Omega,n)>0,$ $q=q(\Omega,n)>1$ such that for any $x\in \Gamma_i$ and $0<r<R$ with $B_{R}(x)\cap\delomega\subset \Gamma_i$ (that is the ball of radius $R$ does not intersect other connected parts of the boundary) one has \begin{equation} \label{eq:lemma:boundary moser iteration} \left\|(u-k_i)_+\right\|_{L^{\infty}(B_{r}(x)\cap\Omega)}\leq \frac{C}{(R-r)^q}\left\|(u-k_i)_+\right\|_{L^n(B_R(x)\cap\Omega)}. \end{equation} The same holds true for $(u-k_i)_-$ instead of $(u-k_i)_+$. \end{lemma} \begin{remark} \label{remark:locality Lieberman hypothesis}(i) The proof of the lemma shows that $1<q<\infty$ can be choosen freely, in which case $C$ depends also on $q.$ \smallskip (ii) The Lemma is a local result and requires $u$ to be $n$-harmonic only in a neighborhood of the ball $B_R(x)$ and constant on $\delomega\cap B_R(x).$ \end{remark} \begin{proof}[Proof (Proposition \ref{proposition:hypothesis Liebermann satisfied}).] By standard interior regularity, see for instance \cite{Lindqvist} Lemma 3.6, the estimate \eqref{eq:lemma:boundary moser iteration} holds true also for balls $B_R(x)$ contained in $\Omega$ (with $k_i$ replaced by $0$). Since $\delomega$ is smooth and compact and its connected components $\Gamma_i$ have positive distance between eachother, we can cover the boundary by finitely many balls $B_r(x),$ $x\in \delomega$ satisfying the estimate \eqref{eq:lemma:boundary moser iteration}. Summing up all these estimates we obtain that there exists a constant $C=C(\Omega)$ such that \begin{equation} \label{eq:u L infty estimate with u Ln} \|u\|_{L^{\infty}(\Omega)}\leq C \left(\|u\|_{L^n(\Omega)}+k\right). \end{equation} Choose a function $g\in W^{1,n}(\Omega)$ such that $g=k_i$ on $\Gamma_i$ (take for instance a bounded linear extension operator $T:W^{1-1/n,n}(\delomega)\to W^{1,n}(\Omega)$ ) so that $$ \|g\|_{W^{1,n}}(\Omega)\leq C(\Omega) k. $$ It follows from Poincar\'e inequality ($u-g=0$ on $\delomega$) and using \eqref{eq:theorem:minimum of n gradient} that $$ \|u-g\|_{L^n(\Omega)}\leq C \|\nabla u-\nabla g\|_{L^n(\Omega)} \leq C \left(\|\nabla u\|_{L^n(\Omega)}+\|\nabla g\|_{L^n(\Omega)}\right) \leq 2 C\|\nabla g\|_{L^n(\Omega)} \leq 2 C k $$ From this we obtain the desired estimate for $\|u\|_{L^n}$ which we plug into \eqref{eq:u L infty estimate with u Ln} to conclude. \end{proof} \smallskip We now prove Lemma \ref{lemma1:Moser iteration}, by a standard Moser iteration method. \begin{proof}[Proof (Lemma \ref{lemma1:Moser iteration})] Since the Lemma is a local result and $\Delta_n(u-k_i)=0,$ we can assume without loss of generality that $k_i=0$ and $u=0$ on $\Gamma_i$. The estimate \eqref{eq:lemma:boundary moser iteration} is clearly also valid for $(u-k_i)_{-}$ instead of $(u-k_i)_+$, by applying a posteriori the Lemma \ref{lemma1:Moser iteration} to $-u.$ \smallskip \textit{Step 1.} We shall first prove that if $\chi>1$ and $\gamma\geq n.$ Then there exists a constant $C=C(\Omega,n,\chi)>0$ such that for any $x\in \Gamma_i$ and $0<t<T$ such that $B_T(x)\cap\delomega\subset \Gamma_i$ \begin{equation} \label{eq:lemma:boundary moser iteration gamma} \left\|u_+\right\|_{L^{\gamma\chi}(B_{t}(x)\cap\Omega)}\leq \left(\frac{C\gamma}{T-t}\right)^{\frac{n}{\gamma}} \left\|u_+\right\|_{L^{\gamma}(B_{T}(x)\cap\Omega)}, \end{equation} provided the right hand side is finite. We fix and write henceforth for simplicity $$ B_T(x)=B_T\,,\quad B_t(x)=B_t\quad\text{ and }\quad \Omega_T=\Omega\cap B_T(x)\,,\quad \Omega_t=\Omega\cap B_t(x) $$ \smallskip \textit{Step 1.1.} By assumption we have that \begin{equation} \label{eq:moser it hypothesis eta} \intomega\langle |\nabla u|^{n-2}\nabla u,\nabla \varphi\rangle=0\quad\text{ for all }\varphi\in W_0^{1,n}(\Omega). \end{equation} Let $u_+=\max\{0,u\}.$ Let $\xi\in C_c^1(B_T).$ We define for $m\in\mathbb{N}$ and $\beta\geq n-1$ $$ u_m(y)=\left\{\begin{array}{rl} u_+(y)&\text{ if }u(y)<m \\ m&\text{ if }u(y)\geq m, \end{array}\right. \quad\text{ and }\quad \varphi=\xi^nu_m^{\beta} u\in W_0^{1,n}(\Omega), $$ which we plug into \eqref{eq:moser it hypothesis eta}. Deriving we obtain $$ \nabla\varphi=\xi^nu_m^{\beta}\nabla u+\beta\xi^n u_m^{\beta-1} u\nabla u_m +n\xi^{n-1}u_m^{\beta}u\nabla \xi. $$ This gives that \begin{align*} \int_{\Omega_T}\xi^nu_m^{\beta}|\nabla u|^{n}+\beta\int_{\Omega_T}\xi^n u_m^{\beta-1} u \langle \nabla u_m,\nabla u\rangle |\nabla u|^{n-2} =-n\int_{\Omega_T}\xi^{n-1}u_m^{\beta} u\langle \nabla \xi,\nabla u\rangle |\nabla u|^{n-2}. \end{align*} In the second term $\nabla u_m$ appears, which is zero if $u\geq m,$ and therefore we can replace everywhere $u$ by $u_m$ to get \begin{equation} \label{moser it before epsilon trick} \int_{\Omega_T}\xi^nu_m^{\beta}|\nabla u|^{n}+\beta\int_{\Omega_T}\xi^n u_m^{\beta} |\nabla u_m|^{n} =-n\int_{\Omega_T}\xi^{n-1}u_m^{\beta} u\langle \nabla \xi,\nabla u\rangle |\nabla u|^{n-2}. \end{equation} Take $\epsilon>0,$ which we will soon chose appropriately. We use the estimate $$ ab\leq \frac{(n-1) a^{n/(n-1)}}{n}+\frac{b^n}{n}, $$ with $a=\xi^{n-1}|\nabla u|^{n-1} u_m^{\beta(n-1)/n}\epsilon$ and $ b=u_m^{\beta/n} u|\nabla \xi|/\epsilon$ to estimate the right side of \eqref{moser it before epsilon trick} $$ -n\int_{\Omega_T}\xi^{n-1}u_m^{\beta} u\langle \nabla \xi,\nabla u\rangle |\nabla u|^{n-2} \leq (n-1)\int_{\Omega_T}\xi^n u_m^{\beta} |\nabla u|^n\epsilon^{\frac{n}{n-1}}+\int_{\Omega_T}u_m^\beta u^n|\nabla \xi|^n\frac{1}{\epsilon^n}. $$ So for an appropriate choice of $\epsilon=\epsilon(n)$ we obtain a constant $C=C(n)$ such that \begin{equation} \label{moser it after epsilon trick} \int_{\Omega_T}\xi^nu_m^{\beta}|\nabla u|^{n}+\beta\int_{\Omega_T}\xi^n u_m^{\beta} |\nabla u_m|^{n} \leq C\int_{\Omega_T}u_m^{\beta}u^n|\nabla \xi|^n. \end{equation} We now set $$ w=u_m^{\frac{\beta}{n}}u,\quad\Rightarrow\quad \nabla w=\frac{\beta}{n}u_m^{\frac{\beta}{n}-1}\nabla u_m\, u+u_m^{\frac{\beta}{n}}\nabla u. $$ Recall that if in any product $\nabla u_m$ appears, then $u=u_m$ in that product, so we obtain \begin{align*} |\nabla w|^n\leq &\left(\frac{\beta}{n}\left|u_m^{\frac{\beta}{n}}\right||\nabla u_m|+u_m^{\frac{\beta}{n}}|\nabla u|\right)^n \leq 2^{n-1}\left(\Big(\frac{\beta}{n}\Big)^n u_m^{\beta}|\nabla u_m|^n+u_m^{\beta}|\nabla u|^n\right) \smallskip \\ &=2^{n-1}\left(\frac{\beta^{n-1}}{n^n} \beta u_m^{\beta}|\nabla u_m|^n+u_m^{\beta}|\nabla u|^n\right) \smallskip \\ &\leq 2^{n-1}\left(1+\frac{\beta^{n-1}}{n^n}\right) \left( \beta u_m^{\beta}|\nabla u_m|^n+u_m^{\beta}|\nabla u|^n\right) \end{align*} We use this in \eqref{moser it after epsilon trick} to obtain that, renaming $2^{n-1}C$ by $C$ (as we will do henceforth) $$ \int_{\Omega_T}\xi^n|\nabla w|^n\leq C \left(1+\frac{\beta^{n-1}}{n^n}\right) \int_{\Omega_T} w^n|\nabla \xi|^n, $$ Now use that $$ |\nabla(\xi w)|^n\leq \left(|\xi|\,|\nabla w|+|\nabla \xi|\, |w|\right)^n\leq 2^{n-1}\left(|\xi|^n|\nabla w|^n+|\nabla \xi|^n|w|^n\right). $$ We thus get that \begin{equation} \label{moser itera before Sobolev} \int_{\Omega_T}|\nabla(\xi w)|^n\leq C \left(1+\frac{\beta^{n-1}}{n^n}\right) \int_{\Omega_T} w^n|\nabla \xi|^n, \end{equation} Note that $\xi w\in W_0^{1,n}(\Omega)$ and that $W_0^{1,n}(\Omega)\hookrightarrow L^q(\Omega)$ for any $1\leq q<\infty$ by the Sobolev embedding. In particular there exists a constant $C=C(\chi,\Omega,n)$ such that $$ \left(\int_{\Omega_T}|\xi w|^{\chi n}\right)^{\frac{1}{\chi}}= \left(\int_{\Omega}|\xi w|^{\chi n}\right)^{\frac{1}{\chi}}\leq C(\chi,\Omega,n)\intomega |\nabla (\xi w)|^n = C(\chi,\Omega,n)\int_{\Omega_T} |\nabla (\xi w)|^n. $$ So we obtain from \eqref{moser itera before Sobolev} $$ \left(\int_{\Omega_T}|\xi w|^{\chi n}\right)^{\frac{1}{\chi}} \leq C \left(1+\frac{\beta^{n-1}}{n^n}\right) \int_{\Omega_T} w^n|\nabla \xi|^n $$ We now choose $\xi$ such that $\xi=1$ in $B_t$ and $ |\nabla \xi|\leq 2/({T-t}). $ We also assume that $u$ has been extende by zero outside of $\Omega$ (more precisely on the other side of $\Gamma_i$). Thus, using the definition of $w=u_m^{\beta/n} u$ we get $$ \left(\int_{B_t}(u_m^{\frac{\beta}{n}}u)^{\chi n}\right)^{\frac{1}{\chi}} \leq C \left(1+\frac{\beta^{n-1}}{n^n}\right)\frac{2^n}{(T-t)^n}\int_{B_T}u_m^{\beta}u^n \leq C \left(1+\frac{\beta^{n-1}}{n^n}\right)\frac{2^n}{(T-t)^n}\int_{B_T}u_+^{\beta+n} $$ We now let $m\to\infty$ and obtain that $$ \left(\int_{B_t}u_+^{\chi(\beta+n)}\right)^{\frac{1}{\chi}} \leq C \left(1+\frac{\beta^{n-1}}{n^n}\right)\frac{2^n}{(T-t)^n}\int_{B_T}u_+^{\beta+n} $$ Set now $\gamma=\beta+n$ and we get that $$ \left(\int_{B_t} u_+^{\gamma\chi}\right)^{\frac{1}{\chi}}\leq C\left(1+ \frac{(\gamma-n)^{n-1}}{n^n}\right) \frac{1}{(T-t)^n}\int_{B_T}u_+^{\gamma} \leq C \gamma^n \frac{1}{(T-t)^n}\int_{B_T}u_+^{\gamma}. $$ From this \eqref{eq:lemma:boundary moser iteration gamma} follows. \smallskip \textit{Step 2.} We now use \eqref{eq:lemma:boundary moser iteration gamma} iteratively. Set $$ t_j=r+\frac{R-r}{2^j},\quad \gamma_j=\chi^j n\quad\text{ for }j=0,1,2,\ldots. $$ Note that $t_0=R,$ $t_j>t_{j+1}$ and $\gamma_0=n,$ $\gamma_{j+1}=\chi\gamma_j.$ Moreover $t_j-t_{j+1}=(R-r)/{2^{j+1}}.$ So it follows from \eqref{eq:lemma:boundary moser iteration gamma} (by induction the right hand side of the next inequality is bounded for each $j$) that \begin{equation} \label{eq:moser iter before D} \|u_+\|_{L^{\gamma_{j+1}}(B_{t_{j+1}})}\leq \left(\frac{C\gamma_j}{R-r}\right)^{\frac{n}{\gamma_j}}\left(2^{j+1}\right)^{\frac{n}{\gamma_j}}\|u_+\|_{L^{\gamma_j}(B_{t_j})}. \end{equation} Note that \begin{align*} \left(\frac{C\gamma_j}{R-r}\right)^{\frac{n}{\gamma_j}}\left(2^{j+1}\right)^{\frac{n}{\gamma_j}} =& \left(\frac{C\chi^j n}{R-r}\right)^{\frac{1}{\chi^j}}\left(2^{j+1}\right)^{\frac{1}{\chi^j}} = \left(2 C \chi^jn 2^j\right)^{\frac{1}{\chi^j}}(R-r)^{-\frac{1}{\chi^j}} \smallskip \\ \leq & D^{\frac{j}{\chi^j}}(R-r)^{-\frac{1}{\chi^j}}, \end{align*} for some constant $D=D(\Omega,n,\chi).$ We now set $a_j=\|u_+\|_{L^{\gamma_j}(B_{t_j})}$ and notice $a_0=\|u_+\|_{L^n(B_R)}.$ Thus we obtain from \eqref{eq:moser iter before D} that $$ a_{j+1}\leq D^{\frac{j}{\chi^j}}(R-r)^{-\frac{1}{\chi^j}}a_j. $$ It follows by induction that $$ a_{j+1}\leq D^{{\sum_{l=0}^j\frac{l}{\chi^l}}} (R-r)^{-\sum_{l=0}^{j}\frac{1}{\chi^l}}a_0\,. $$ Notice that for all $j$ we have $\|u_+\|_{L^{n\chi^j}(B_r)}\leq a_{j+1}.$ The sums $$ \sum \frac{l}{\chi^l}\quad\text{ and }\quad \sum\frac{1}{\chi^l} $$ are convergent. So letting $j\to\infty$ we obtain that $$ \|u_+\|_{L^{\infty}(B_r)}\leq \frac{C}{(R-r)^q} \|u_+\|_{L^n(B_R)}, $$ which proves the lemma. \end{proof} \begin{comment} \textit{Step 1.1.} By assumption we have that \begin{equation} \label{eq:moser it hypothesis eta} \intomega\langle |\nabla u|^{n-2}\nabla u,\nabla \eta\rangle=0\quad\text{ for all }\eta\in W_0^{1,n}(\Omega). \end{equation} Let $\xi\in C^{1}_c(B_{R_0}(x))$ be arbitrary and set for $m\in\mathbb{N},$ $m\geq k_i$ $$ \eta=\xi^n(u_m-k_i)_+^{\beta-(n-1)},\quad\text{ where }\; u_m(y)=\left\{\begin{array}{rl} u(y)&\text{ if }u(y)\leq m \smallskip \\ m &\text{ if }u(y)>m. \end{array}\right. $$ Note tha $\eta\in W^{1,n}_0(\Omega),$ if we assume $\eta$ to be extended by zero in $\Omega\backslash B_{R_0}(x).$ We set $$ \alpha=\beta-(n-1)\geq 1. $$ We calculate $$ \nabla\eta=n\xi^{n-1}\nabla\xi(u_m-k_i)_+^{\alpha}+\alpha\xi^n(u_m-k_i)_+^{\alpha-1} \nabla u_m. $$ From now on we write for simplicity $B_{R_0}(x_0)=B_{R_0}$ and similarly for $B_{r_0}$ and we set $$ \Omega_m=\Omega\cap\{y:\, u(y)<m\}. $$ Note also that $\nabla u_m=\nabla u$ on $\Omega_m$ and $\nabla u_m=0$ on the set where $u\geq m.$ So we plug in $\eta$ into \eqref{eq:moser it hypothesis eta} to get $$ \alpha\int_{\Omega_m\cap B_{R_0}}|\nabla u|^{n-2}\langle \nabla u,\nabla u_m\rangle \xi^n(u_m-k_i)_+^{\alpha-1} =-n\int_{\Omega\cap B_{R_0}}|\nabla u|^{n-2}\langle \nabla u,\nabla\xi\rangle \xi^{n-1}(u_m-k_i)_+^{\alpha}. $$ We want to apply Hölder inequality to the right hand side of this equation. For this purpose we write $$ (u_m-k_i)_+^{\alpha}=(u-k_i)_+^{\frac{(\alpha-1)(n-1)}{n}}\,(u_m-k_i)_+^{\frac{\alpha+n-1}{n}}, $$ and use H\"older inequality with exponents $n/(n-1)$ and $n$ to get \begin{align*} & \int \left\langle |\nabla u|^{n-2}\nabla u\, \xi^{n-1} (u_m-k_i)_+^{\frac{(\alpha-1)(n-1)}{n}},\nabla \xi (u_m-k_i)_+^{\frac{\alpha+n-1}{n}}\right\rangle \smallskip \\ \leq & \left(\int |\nabla u|^n\xi^n(u_m-k_i)_+^{\alpha-1}\right)^{\frac{n-1}{n}} \left(\int|\nabla \xi|^{n}(u_m-k_i)_+^{\alpha+n-1}\right)^{\frac{1}{n}}. \end{align*} We thus obtain that \begin{align*} &\alpha\int_{\Omega_m\cap B_{R_0}} |\nabla u|^n\xi^n(u_m-k_i)_+^{\alpha-1} \smallskip \\ \leq & n\left(\int_{\Omega\cap B_{R_0}} |\nabla u|^n\xi^n(u_m-k_i)_+^{\alpha-1}\right)^{\frac{n-1}{n}} \left(\int_{\Omega\cap B_{R_0}}|\nabla \xi|^{n}(u_m-k_i)_+^{\alpha+n-1}\right)^{\frac{1}{n}}. \end{align*} \end{comment} \bigskip \noindent\textbf{Acknowledgements} The first author was supported by Chilean Fondecyt Iniciaci\'on grant nr. 11150017 and is member of the Barcelona Graduate School of Mathematics. He also acknowledges financial support from the Spanish Ministry of Economy and Competitiveness, through the ``Mar\'ia de Maeztu'' Programme for Units of Excellence in RD (MDM-2014-0445). The research work of the second author is supported by the Indian "Innovation in Science Pursuit for Inspired Research (INSPIRE)" under the IVR Number: 20140000099 (IFA14-MA43). We have obtained significant help from A. Adimurthi, who helped us understand and work out the relevant results on the $n$-Laplace equation. We would like to extend our thanks to Sandeep for fruitful discussions on this problem. Finally, our special thanks goes to Debabrata Karmakar for his generous help.
\section{Introduction} One common criticism of symbolic AI approaches is that the symbols they operate on do not contain any meaning: For the system, they are just arbitrary tokens that can be manipulated in some way. This lack of inherent meaning in abstract symbols is called the “symbol grounding problem” \cite{Harnad1990}. One approach towards solving this problem is to devise a grounding mechanism that connects abstract symbols to the real world, i.e., to perception and action.\\ The framework of conceptual spaces \cite{Gardenfors2000,Gardenfors2014} attempts to bridge this gap between symbolic and subsymbolic AI by proposing an intermediate conceptual layer based on geometric representations. A conceptual space is a similarity space spanned by a number of quality dimensions that are based on perception and/or subsymbolic processing. Convex regions in this space correspond to concepts. Abstract symbols can thus be grounded in reality by linking them to regions in a conceptual space whose dimensions are based on perception. The framework of conceptual spaces has been highly influential in the last 15 years within cognitive science and cognitive linguistics \cite{Douven2011,Warglien2012,Fiorini2013,Zenker2015}. It has also sparked considerable research in various subfields of artificial intelligence, ranging from robotics and computer vision \cite{Chella2001,Chella2003,Chella2005} over the semantic web and ontology integration \cite{Dietze2008,Adams2009a} to plausible reasoning \cite{Schockaert2011,Derrac2015}.\\ One important question is however left unaddressed by these research efforts: How can an (artificial) agent learn about meaningful regions in a conceptual space purely from unlabeled perceptual data? Our overall approach for solving this concept formation problem is to devise an incremental clustering algorithm that groups a stream of unlabeled observations (represented as points in a conceptual space) into meaningful regions. In this paper, we lay the foundation for this approach by developing a thorough formalization of the conceptual spaces framework.\footnote{This chapter is a revised and extended version of research presented in the following workshop and conference papers: \cite{Bechberger2017AIC, Bechberger2017KI, Bechberger2017SGAI, Bechberger2017NeSy}} In Section \ref{CS}, we point out that G\"ardenfors' convexity requirement prevents a geometric representation of correlations. We resolve this problem by using star-shaped instead of convex sets. Our mathematical formalization presented in Section \ref{FSSSS} defines concepts in a parametric way that is easily implementable. We furthermore define various operations in Section \ref{Operations}, both for creating new concepts from old ones and for measuring relations between concepts. Moreover, in Section \ref{Implementation} we describe our implementation of the proposed formalization and illustrate it with a simple conceptual space for fruits. In Section \ref{RelatedWork}, we summarize other existing formalizations of the conceptual spaces framework and compare them to our proposal. Finally, in Section \ref{Outlook} we give an outlook on future work with respect to concept formation before concluding the paper in Section \ref{Conclusion}. \section{Conceptual Spaces} \label{CS} This section presents the cognitive framework of conceptual spaces as described in \cite{Gardenfors2000} and introduces our formalization of dimensions, domains, and distances. Moreover, we argue that concepts should be represented by star-shaped sets instead of convex sets. \subsection{Definition of Conceptual Spaces} \label{CS:Definition} A conceptual space is a similarity space spanned by a set $D$ of so-called ``quality dimensions''. Each of these dimensions $d \in D$ represents a cognitively meaningful way in which two stimuli can be judged to be similar or different. Examples for quality dimensions include temperature, weight, time, pitch, and hue. We denote the distance between two points $x$ and $y$ with respect to a dimension $d$ as $|x_d - y_d|$. A domain $\delta \subseteq D$ is a set of dimensions that inherently belong together. Different perceptual modalities (like color, shape, or taste) are represented by different domains. The color domain for instance consists of the three dimensions hue, saturation, and brightness. G\"{a}rdenfors argues based on psychological evidence \cite{Attneave1950,Shepard1964} that distance within a domain $\delta$ should be measured by the weighted Euclidean metric $d_E$: $$d_E^{\delta}\left(x,y, W_{\delta}\right) = \sqrt{\sum_{d \in \delta} w_{d} \cdot | x_{d} - y_{d} |^2}$$ The parameter $W_{\delta}$ contains positive weights $w_{d}$ for all dimensions $d \in \delta$ representing their relative importance. We assume that $\textstyle\sum_{d \in \delta} w_{d} = 1$.\\ The overall conceptual space $CS$ can be defined as the product space of all dimensions. Again, based on psychological evidence \cite{Attneave1950,Shepard1964}, G\"{a}rdenfors argues that distance within the overall conceptual space should be measured by the weighted Manhattan metric $d_M$ of the intra-domain distances. Let $\Delta$ be the set of all domains in $CS$. We define the overall distance within a conceptual space as follows: $$ d_C^{\Delta}\left(x,y,W\right) := \sum_{\delta \in \Delta} w_{\delta} \cdot d_E^{\delta}\left(x,y,W_{\delta}\right) = \sum_{\delta \in \Delta}w_{\delta} \cdot \sqrt{\sum_{d \in \delta} w_{d} \cdot |x_{d} - y_{d}|^2} $$ The parameter $W = \left\langle W_{\Delta},\left\{W_{\delta}\right\}_{\delta \in \Delta}\right\rangle$ contains $W_{\Delta}$, the set of positive domain weights $w_{\delta}$. We require that $\textstyle\sum_{\delta \in \Delta} w_{\delta} = |\Delta|$. Moreover, $W$ contains for each domain $\delta \in \Delta$ a set $W_{\delta}$ of dimension weights as defined above. The weights in $W$ are not globally constant, but depend on the current context. One can easily show that $d_C^{\Delta}\left(x,y,W\right)$ with a given $W$ is a metric.\\ The similarity of two points in a conceptual space is inversely related to their distance. G\"{a}rdenfors expresses this as follows : $$Sim\left(x,y\right) = e^{-c \cdot d\left(x,y\right)}\quad \text{with a constant}\; c >0 \; \text{and a given metric}\; d$$ Betweenness is a logical predicate $B\left(x,y,z\right)$ that is true if and only if $y$ is considered to be between $x$ and $z$. It can be defined based on a given metric $d$: $$B_d\left(x,y,z\right) :\iff d\left(x,y\right) + d\left(y,z\right) = d\left(x,z\right)$$ The betweenness relation based on the Euclidean metric $d_E$ results in the straight line segment connecting the points $x$ and $z$, whereas the betweenness relation based on the Manhattan metric $d_M$ results in an axis-parallel cuboid between the points $x$ and $z$. We can define convexity and star-shapedness based on the notion of betweenness: \begin{definition} \label{def:Convexity} (Convexity)\\ A set $C \subseteq CS$ is \emph{convex} under a metric $d \;:\iff$ \hspace{1cm}$\forall {x \in C, z \in C, y \in CS}: \left(B_d\left(x,y,z\right) \rightarrow y \in C\right)$ \end{definition} \begin{definition} \label{def:StarShapedSet} (Star-shapedness)\\ A set $S \subseteq CS$ is \emph{star-shaped} under a metric $d$ with respect to a set $P \subseteq S \;:\iff$ \hspace{1cm}$\forall {p \in P, z \in S, y \in CS}: \left(B_d\left(p,y,z\right) \rightarrow y \in S\right)$ \end{definition} Convexity under the Euclidean metric $d_E$ is equivalent to the common definition of convexity in Euclidean spaces. The only sets that are considered convex under the Manhattan metric $d_M$ are axis-parallel cuboids.\\ G\"{a}rdenfors distinguishes properties like ``red'', ``round'', and ``sweet'' from full-fleshed concepts like ``apple'' or ``dog'' by observing that properties can be defined on individual domains (e.g., color, shape, taste), whereas full-fleshed concepts involve multiple domains. \begin{definition} \label{def:CriterionP} (Property) \cite{Gardenfors2000}\\ A \emph{natural property} is a convex region of a domain in a conceptual space. \end{definition} Full-fleshed concepts can be expressed as a combination of properties from different domains. These domains might have a different importance for the concept which is reflected by so-called ``salience weights''. Another important aspect of concepts are the correlations between the different domains \cite{Medin1988}, which are important for both learning \cite{Billman1996} and reasoning \cite[Chapter 8]{Murphy2002}. \begin{definition} \label{def:CriterionC} (Concept) \cite{Gardenfors2000}\\ A \emph{natural concept} is represented as a set of convex regions in a number of domains together with an assignment of salience weights to the domains and information about how the regions in different domains are correlated. \end{definition} \subsection{An Argument Against Convexity} \label{CS:ArgumentAgainstConvexity} \cite{Gardenfors2000} does not propose any concrete way for representing correlations between domains. As the main idea of the conceptual spaces framework is to find a geometric representation of conceptual structures, we think that a geometric representation of these correlations is desirable. Consider the left part of Figure \ref{fig:ConvexityProblem}. In this example, we consider two domains, age and height, in order to define the concepts of child and adult. We expect a strong correlation between age and height for children, but no such correlation for adults. This is represented by the two ellipses.\footnote{Please note that this is a very simplified artificial example to illustrate our main point.} As one can see, the values of age and height constrain each other: For instance, if the value on the age dimension is low and the point lies in the child region, then also the value on the height dimension must be low. \begin{figure}[tp] \centering \includegraphics[width=\columnwidth]{ConvexityProblem.png} \caption{Left: Intuitive way to define regions for the concepts of ``adult'' and ``child''. Middle: Representation by using convex sets. Right: Representation by using star-shaped sets with central points marked by crosses.} \label{fig:ConvexityProblem} \end{figure} Domains are combined by using the Manhattan metric and convex sets under the Manhattan metric are axis-parallel cuboids. As the dimensions of age and height belong to different domains, a convex representation of the two concepts results in the rectangles shown in the middle of Figure \ref{fig:ConvexityProblem}. As one can see, all information about the correlation of age and height in the child concept is lost in this representation: The values of age and height do not constrain each other at all. According to this representation, a child of age 2 with a height of 1.60 m would be totally conceivable. This illustrates that we cannot geometrically represent correlations between domains if we assume that concepts are convex and that the Manhattan metric is used. We think that our example is not a pathological one and that similar problems will occur quite frequently when encoding concepts.\footnote{For instance, there is an obvious correlation between a banana's color and its taste. If you replace the ``age'' dimension with ``hue'' and the ``height'' dimension with ``sweetness'' in Figure \ref{fig:ConvexityProblem}, you will observe similar encoding problems for the ``banana'' concept as for the ``child'' concept.}\\ Star-shapedness is a weaker constraint than convexity. If we only require concepts to be star-shaped under the Manhattan metric, we can represent the correlation of age and height for children in a geometric way. This is shown in the right part of Figure \ref{fig:ConvexityProblem}: Both sketched sets are star-shaped under the Manhattan metric with respect to a central point.\footnote{Please note that although the sketched sets are still convex under the Euclidean metric, they are star-shaped but not convex under the Manhattan metric.} Although the star-shaped sets do not exactly correspond to our intuitive sketch in the left part of Figure \ref{fig:ConvexityProblem}, they definitely are an improvement over the convex representation. By definition, star-shaped sets cannot contain any ``holes''. They furthermore have a well defined central region $P$ that can be interpreted as a prototype. Thus, the connection that \cite{Gardenfors2000} established between the prototype theory of concepts and the framework of conceptual spaces is preserved. Replacing convexity with star-shapedness is therefore only a minimal departure from the original framework.\\ The problem illustrated in Figure \ref{fig:ConvexityProblem} could also be resolved by replacing the Manhattan metric with a diferent distance function for combining domains. A natural choice would be to use the Euclidean metric everywhere. We think however that this would be a major modification of the original framework. For instance, if the Euclidean metric is used everywhere, the usage of domains to structure the conceptual space loses its main effect of influencing the overall distance metric. Moreover, there exists some psychological evidence \cite{Attneave1950,Shepard1964,Shepard1987,Johannesson2001} which indicates that human similarity ratings are reflected better by the Manhattan metric than by the Euclidean metric if different domains are involved (e.g., stimuli differing in size and brightness). As a psychologically plausible representation of similarity is one of the core principles of the conceptual spaces framework, these findings should be taken into account. Furthermore, in high-dimensional feature spaces the Manhattan metric provides a better relative contrast between close and distant points than the Euclidean metric \cite{Aggarwal2001}. If we expect a large number of domains, this also supports the usage of the Manhattan metric from an implementational point of view. One could of course also replace the Manhattan metric with something else (e.g., the Mahanalobis distance). However, as there is currently no strong evidence supporting the usage of any particular other metric, we think that it is best to use the metrics proposed in the original conceptual spaces framework. Based on these arguments, we think that relaxing the convexity constraint is a better option than abolishing the use of the Manhattan metric.\\ Please note that the example given above is intended to highlight representational problems of the conceptual spaces framework if it is applied to artificial intelligence and if a geometric representation of correlations is desired. We do not make any claims that star-shapedness is a psychologically plausible extension of the original framework and we do not know about any psychological data that could support such a claim. \section{A Parametric Definition of Concepts} \label{FSSSS} \subsection{Preliminaries} \label{FSSSS:Preliminaries} Our formalization is based on the following insight: \begin{lemma} \label{lemma:UnionOfConvex} Let $C_1, ..., C_m$ be convex sets in $CS$ under some metric $d$ and let $P := \textstyle\bigcap_{i=1}^{m} C_i$. If $P \neq \emptyset$, then $S := \textstyle\bigcup_{i=1}^{m} C_i$ is star-shaped under $d$ with respect to $P$. \end{lemma} \begin{proof} Obvious (see also \cite{Smith1968}). \end{proof} We will use axis-parallel cuboids as building blocks for our star-shaped sets. They are defined in the following way:\footnote{All of the following definitions and propositions hold for any number of dimensions.} \begin{definition} \label{def:Cuboid} (Axis-parallel cuboid)\\ We describe an \emph{axis-parallel cuboid}\footnote{We will drop the modifier "axis-parallel" from now on.} $C$ as a triple $\left\langle\Delta_C, p^-, p^+\right\rangle$. $C$ is defined on the domains $\Delta_C \subseteq \Delta$, i.e., on the dimensions $D_C := \textstyle\bigcup_{\delta \in \Delta_C} \delta$. We call $p^-, p^+ $ the support points of $C$ and require that: $$ \forall {d \in D_C}: p^+_d,p^-_d \notin \left\{+\infty,-\infty\right\} \quad \land \quad \forall {d \in D \setminus D_C}: p^-_d := -\infty \land p^+_d := +\infty $$ Then, we define the cuboid $C$ in the following way: $$C = \left\{x \in CS \;|\; \forall {d \in D}: p^-_d \leq x_d \leq p^+_d\right\}$$ \end{definition} \begin{lemma} \label{lemma:Cuboid} A cuboid $C$ is convex under $d_C^{\Delta}$, given a fixed set of weights $W$. \end{lemma} \begin{proof} It is easy to see that cuboids are convex with respect to $d_M$ and $d_E$. Based on this, one can show that they are also convex with respect to $d_C^{\Delta}$, which is a combination of $d_M$ and $d_E$. \end{proof} Our formalization will make use of fuzzy sets \cite{Zadeh1965}, which can be defined in our current context as follows: \begin{definition} (Fuzzy set)\\ A \emph{fuzzy set} $\widetilde{A}$ on $CS$ is defined by its membership function $\mu_{\widetilde{A}}: CS \rightarrow [0,1]$. \end{definition} For each $x \in CS$, we interpret $\mu_{\widetilde{A}}\left(x\right)$ as degree of membership of $x$ in $\widetilde{A}$. Note that fuzzy sets contain crisp sets as a special case where $\mu_{\widetilde{A}}: CS \rightarrow \left\{0,1\right\}$. \begin{definition} (Alpha-cut)\\ Given a fuzzy set $\widetilde{A}$ on $CS$, its \emph{$\alpha$-cut} ${\widetilde{A}}^{\alpha}$ for $\alpha \in [0,1]$ is defined as follows: $${\widetilde{A}}^{\alpha} := \left\{x \in CS\; |\; \mu_{\widetilde{A}}\left(x\right) \geq \alpha\right\}$$ \end{definition} \begin{definition} \label{def:FuzzyStarShaped} (Fuzzy star-shapedness)\\ A fuzzy set $\widetilde{A}$ is called \emph{star-shaped} under a metric $d$ with respect to a crisp set $P$ if and only if all of its $\alpha$-cuts ${\widetilde{A}}^{\alpha}$ are either empty or star-shaped under $d$ with respect to $P$. \end{definition} One can also generalize the ideas of subsethood, intersection, and union from crisp to fuzzy sets. We adopt the most widely used definitions: \begin{definition} \label{def:FuzzyOperations} (Operations on fuzzy sets)\\ Let $\widetilde{A}, \widetilde{B}$ be two fuzzy sets defined on $CS$. \begin{itemize} \item Subsethood: \hspace{0.20cm}$\widetilde{A} \subseteq \widetilde{B} :\iff \left(\forall {x \in CS}: \mu_{\widetilde{A}}\left(x\right) \leq \mu_{\widetilde{B}}\left(x\right)\right)$ \item Intersection: \hspace{0.15cm}$\forall x \in CS: \mu_{\widetilde{A} \cap \widetilde{B}}\left(x\right) := \min\left(\mu_{\widetilde{A}}\left(x\right),\mu_{\widetilde{B}}\left(x\right)\right)$ \item Union: \hspace{1.2cm}$\forall x \in CS: \mu_{\widetilde{A} \cup \widetilde{B}}\left(x\right) := \max\left(\mu_{\widetilde{A}}\left(x\right),\mu_{\widetilde{B}}\left(x\right)\right)$ \end{itemize} \end{definition} \subsection{Fuzzy Simple Star-Shaped Sets} \label{FSSSS:FSSSS} By combining Lemma \ref{lemma:UnionOfConvex} and Lemma \ref{lemma:Cuboid}, we see that any union of intersecting cuboids is star-shaped under $d_C^{\Delta}$. We use this insight to define simple star-shaped sets (illustrated in Figure \ref{fig:FSSSS} with $m=3$ cuboids), which will serve as cores for our concepts: \begin{definition} \label{def:SSSS} (Simple star-shaped set)\\ We describe a \emph{simple star-shaped set} $S$ as a tuple $\left\langle\Delta_S,\left\{C_1,\dots,C_m\right\}\right\rangle$ where $\Delta_S \subseteq \Delta$ is a set of domains on which the cuboids $\left\{C_1,\dots,C_m\right\}$ (and thus also $S$) are defined. We further require that the central region $P :=\textstyle\bigcap_{i = 1}^m C_i \neq \emptyset$. Then the simple star-shaped set $S$ is defined as $$S := \bigcup_{i=1}^m C_i$$ \end{definition} \begin{figure}[tp] \centering \includegraphics[width = \columnwidth]{StarShaped.png} \caption{Left: Three cuboids $C_1, C_2, C_3$ with nonempty intersection. Middle: Resulting simple star-shaped set $S$ based on these cuboids. Right: Fuzzy simple star-shaped set $\tilde{S}$ based on $S$ with three $\alpha$-cuts for $\alpha \in \left\{1.0,0.5,0.25\right\}$.} \label{fig:FSSSS} \end{figure} In practice, it is often not possible to define clear-cut boundaries for concepts and properties. It is, for example, very hard to define a generally accepted crisp boundary for the property ``red''. We therefore use a fuzzified version of simple star-shaped sets for representing concepts, which allows us to define imprecise concept boundaries. This usage of fuzzy sets for representing concepts has already a long tradition \cite{Osherson1982,Zadeh1982,Ruspini1991,Bvelohlavek2011,Douven2011}. We use a simple star-shaped set $S$ as a concept's ``core'' and define the membership of any point $x \in CS$ to this concept as $\max_{y \in S}Sim\left(x,y\right)$: \begin{definition} \label{def:FSSSS} (Fuzzy simple star-shaped set)\\ A \emph{fuzzy simple star-shaped set} $\widetilde{S}$ is described by a quadruple $\left\langle S,\mu_0,c,W\right\rangle$ where $S = \left\langle\Delta_S,\left\{C_1,\dots,C_m\right\}\right\rangle$ is a non-empty simple star-shaped set. The parameter $\mu_0 \in (0,1]$ determines the highest possible membership to $\widetilde{S}$ and is usually set to 1. The sensitivity parameter $c > 0$ controls the rate of the exponential decay in the similarity function. Finally, $W = \left\langle W_{\Delta_S},\left\{W_{\delta}\right\}_{\delta \in \Delta_S}\right\rangle$ contains positive weights for all domains in $\Delta_S$ and all dimensions within these domains, reflecting their respective importance. We require that $\textstyle\sum_{\delta \in \Delta_S} w_{\delta} = |\Delta_S|$ and that $\forall {\delta \in \Delta_S}:\textstyle\sum_{d \in \delta} w_{d} = 1$. The membership function of $\widetilde{S}$ is then defined as follows: $$\mu_{\widetilde{S}}\left(x\right) := \mu_0 \cdot \max_{y \in S}\left(e^{-c \cdot d_C^{\Delta_S}\left(x,y,W\right)}\right)$$ \end{definition} The sensitivity parameter $c$ controls the overall degree of fuzziness of $\widetilde{S}$ by determining how fast the membership drops to zero (larger values of $c$ result in steeper drops of the membership function). The weights $W$ represent not only the relative importance of the respective domain or dimension for the represented concept, but they also influence the relative fuzziness with respect to this domain or dimension (again, larger weights cause steeper drops). Note that if $|\Delta_S| = 1$, then $\widetilde{S}$ represents a property, and if $|\Delta_S| > 1$, then $\widetilde{S}$ represents a concept. The right part of Figure \ref{fig:FSSSS} shows a fuzzy simple star-shaped set $\widetilde{S}$. In this illustration, the $x$ and $y$ axes are assumed to belong to different domains, and are combined with the Manhattan metric using equal weights. \begin{lemma} \label{lemma:epsilonNeighborhood} Let $\widetilde{S} = \left\langle S,\mu_0,c,W\right\rangle$ be a fuzzy simple star-shaped set and let $\alpha \leq \mu_0$. Then, $\widetilde{S}^\alpha$ is equivalent to an $\epsilon$-neighborhood of $S$ with $\epsilon = - \frac{1}{c} \cdot \ln\left(\frac{\alpha}{\mu_0}\right)$. \end{lemma} \begin{proof}\belowdisplayskip=-12pt \begin{align*} x \in \widetilde{S}^\alpha &\iff \mu_{\widetilde{S}}\left(x\right) = \mu_0 \cdot \max_{y \in S}\left(e^{-c \cdot d_C^{\Delta_S}\left(x,y,W\right)}\right) \geq \alpha \iff e^{-c \cdot \min_{y \in S} \left(d_C^{\Delta_S}\left(x,y,W\right)\right)} \geq \frac{\alpha}{\mu_0}\\ &\iff \min_{y \in S} d_C^{\Delta_S}\left(x,y,W\right) \leq - \frac{1}{c} \cdot \ln\left(\frac{\alpha}{\mu_0}\right) =: \epsilon \end{align*} \end{proof} \begin{proposition} Any fuzzy simple star-shaped set $\widetilde{S} = \left\langle S,\mu_0,c,W\right\rangle$ is star-shaped with respect to $P = \textstyle\bigcap_{i=1}^{m} C_i$ under $d_C^{\Delta_S}$. \end{proposition} \begin{proof} For $\alpha \leq \mu_0$, $\widetilde{S}^\alpha$ is an $\epsilon$-neighborhood of $S$ (Lemma \ref{lemma:epsilonNeighborhood}). We can define the $\epsilon$-neighborhood of a cuboid $C_i$ under $d_C^{\Delta_S}$ as $$C_i^{\epsilon} = \left\{z \in CS\; |\; \forall {d \in D_S}: p^{-}_{id} - u_d \leq z_d \leq p^{+}_{id} + u_d\right\}$$ where the vector $u$ represents the difference between $x \in C_i$ and $z \in C_i^{\epsilon}$. Thus, $u$ must fulfill the following constraints: $$\sum_{\delta \in \Delta_S} w_{\delta} \cdot \sqrt{\sum_{d \in \delta} w_{d} \cdot \left(u_{d}\right)^2} \leq \epsilon \quad \land \quad \forall d \in D_S: u_d \geq 0$$ Let now $x \in C_i,z \in C_i^{\epsilon}$. \begin{align*} \forall {d \in D_S}:\;\; &x_d = p^{-}_{id} + a_d \;\text{with} \; a_d \in [0, p^{+}_{id} - p^{-}_{id}]\\ &z_d = p^{-}_{id} + b_d \;\;\text{with} \; b_d \in [-u_d, p^{+}_{id} - p^{-}_{id} + u_d] \end{align*} We know that a point $y \in CS$ is between $x$ and $z$ with respect to $d_C^{\Delta_S}$ if the following condition is true: \begin{align*} &d_C^{\Delta_S}\left(x,y,W\right) + d_C^{\Delta_S}\left(y,z,W\right) = d_C^{\Delta_S}\left(x,z,W\right)\\ &\iff \forall {\delta \in \Delta_S}: d^{\delta}_E\left(x,y,W_{\delta}\right) + d^{\delta}_E\left(y,z,W_{\delta}\right) = d^{\delta}_E\left(x,z,W_{\delta}\right)\\ &\iff \forall {\delta \in \Delta_S}: \exists {t \in [0,1]}: \forall {{d} \in \delta}: y_{d} = t \cdot x_{d} + \left(1 - t\right) \cdot z_{d} \end{align*} The first equivalence holds because $d_C^{\Delta_S}$ is a weighted sum of Euclidean metrics $d^{\delta}_E$. As the weights are fixed and as the Euclidean metric is obeying the triangle inequality, the equation with respect to $d_C^{\Delta_S}$ can only hold if the equation with respect to $d_E^{\delta}$ holds for all $\delta \in \Delta$. We can thus write the components of $y$ like this: \begin{align*} \forall d \in D_S: \exists t \in [0,1]: y_d &= t \cdot x_d + \left(1-t\right)\cdot z_d = t \cdot \left(p^{-}_{id} + a_d\right) + \left(1-t\right) \left(p^{-}_{id} + b_d\right)\\ &= p^{-}_{id} + t \cdot a_d + \left(1-t\right) \cdot b_d = p^{-}_{id} + c_d \end{align*} As $c_d := t \cdot a_d + \left(1-t\right) \cdot b_d \in [-u_d, p^{+}_{id} - p^{-}_{id} + u_d]$, it follows that $y \in C_i^{\epsilon}$. So $C_i^{\epsilon}$ is star-shaped with respect to $C_i$ under $d_C^{\Delta_S}$. More specifically, $C_i^{\epsilon}$ is also star-shaped with respect to $P$ under $d_C^{\Delta_S}$. Therefore, $S^{\epsilon} = \bigcup_{i=1}^{m} C_i^{\epsilon}$ is star-shaped under $d_C^{\Delta_S}$ with respect to $P$. Thus, all $\widetilde{S}^\alpha$ with $\alpha \leq \mu_0$ are star-shaped under $d_C^{\Delta_S}$ with respect to $P$. It is obvious that $\widetilde{S}^\alpha = \emptyset$ if $\alpha > \mu_0$, so $\widetilde{S}$ is star-shaped according to Definition \ref{def:FuzzyStarShaped}. \end{proof} From now on, we will use the terms ``core'' and ``concept'' to refer to our definitions of simple star-shaped sets and fuzzy simple star-shaped sets, respectively. \section{Operations on Concepts} \label{Operations} In this section, we develop a number of operations, which can be used to create new concepts from existing ones and to describe relations between concepts. \subsection{Intersection} \label{Operations:Intersection} The intersection of two concepts can be interpreted as logical conjunction: Intersecting ``green'' with ``banana'' should result in the concept ``green banana''.\\ If we intersect two \emph{cores} $S_1$ and $S_2$, we simply need to intersect their cuboids. As an intersection of two cuboids is again a cuboid, the result of intersecting two cores can be described as a union of cuboids. It is simple star-shaped if and only if these resulting cuboids have a nonempty intersection. This is only the case if the central regions $P_1$ and $P_2$ of $S_1$ and $S_2$ intersect.\footnote{Note that if the two cores are defined on completely different domains (i.e., $\Delta_{S_1} \cap \Delta_{S_2} = \emptyset$), then their central regions intersect (i.e., $P_1 \cap P_2 \neq \emptyset$), because we can find at least one point in the overall space that belongs to both $P_1$ and $P_2$.} However, we would like our intersection to result in a valid core even if $P_1 \cap P_2 = \emptyset$. Thus, when intersecting two cores, we might need to apply some repair mechanism in order to restore star-shapedness.\\ We propose to extend the cuboids $C_i$ of the intersection in such a way that they meet in some ``midpoint'' $p^* \in CS$ (e.g., the arithmetic mean of their centers). We create extended versions $C_i^{*}$ of all $C_i$ by defining their support points like this: $$\forall {d \in D}: p_{id}^{-*} := \min\left(p_{id}^-, p^*_d\right), \quad p_{id}^{+*} := \max\left(p_{id}^+, p^*_d\right)$$ The intersection of the resulting $C^{*}_i$ contains at least $p^*$, so it is not empty. This means that $S' = \left\langle\Delta_{S_1} \cup \Delta_{S_2}, \left\{C_1^{*},\dots,C_{m}^{*}\right\}\right\rangle$ is again a simple star-shaped set. We denote this modified intersection (consisting of the actual intersection and the application of the repair mechanism) as $S' = I\left(S_1,S_2\right).$\\ \noindent We define the intersection of two \emph{concepts} as $\widetilde{S}' = I(\widetilde{S}_1,\widetilde{S}_2) := \left\langle S',\mu'_0,c',W'\right\rangle$ with: \begin{itemize} \item $S' := I\left(\widetilde{S}_1^{\alpha'},{\widetilde{S}}_2^{\alpha'}\right)$ (where $\alpha' = \max\left\{\alpha \in [0,1]: {\widetilde{S}}_1^{\alpha} \cap {\widetilde{S}}_2^{\alpha} \neq \emptyset\right\}$) \item $\mu'_0 := \alpha'$ \item $c' := \min\left(c^{\left(1\right)},c^{\left(2\right)}\right)$ \item $W'$ with weights defined as follows (where $s,t \in [0,1]$)\footnote{In some cases, the normalization constraint of the resulting domain weights might be violated. We can enforce this constraint by manually normalizing the weights afterwards.}: \begin{align*} &\forall {\delta \in \Delta_{S_1} \cap \Delta_{S_2}}: \left(\left(w'_{\delta} := s \cdot w^{\left(1\right)}_{\delta} + \left(1-s\right) \cdot w^{\left(2\right)}_{\delta}\right)\right.\\ & \hspace{3.0cm}\left.\land \forall {d \in \delta}: \left(w'_{d} := t \cdot w^{\left(1\right)}_{d} + \left(1-t\right) \cdot w^{\left(2\right)}_{d}\right)\right)\\ &\forall {\delta \in \Delta_{S_1} \setminus \Delta_{S_2}}: \left(\left(w'_{\delta} := w^{\left(1\right)}_{\delta}\right) \land \forall {d \in \delta}: \left(w'_{d} := w^{\left(1\right)}_{d}\right)\right)\\[-2pt] &\forall {\delta \in \Delta_{S_2} \setminus \Delta_{S_1}}: \left(\left(w'_{\delta} := w^{\left(2\right)}_{\delta}\right) \land \forall {d \in \delta}: \left(w'_{d} := w^{\left(2\right)}_{d}\right)\right) \end{align*} \end{itemize} When taking the combination of two somewhat imprecise concepts, the result should not be more precise than any of the original concepts. As the sensitivity parameter $c$ is inversely related to fuzziness, we take the minimum. If a weight is defined for both original concepts, we take a convex combination, and if it is only defined for one of them, we simply copy it. The importance of each dimension and domain to the new concept will thus lie somewhere between its importance with respect to the two original concepts.\\ \begin{figure}[tp] \centering \includegraphics[width=\textwidth]{IntersectionResults.png} \caption{Possible results of intersecting two fuzzy cuboids.} \label{fig:IntersectionResults} \end{figure} The key challenge with respect to the intersection of two concepts $\widetilde{S}_1$ and $\widetilde{S}_2$ is to find the new core $S'$, i.e., the highest non-empty $\alpha$-cut intersection of the two concepts. We simplify this problem by iterating over all combinations of cuboids $C_1 \in S_1, C_2 \in S_2$ and by looking at each pair of cuboids individually. Let $a \in C_1$ and $b \in C_2$ be the two closest points from the two cuboids under consideration (i.e., $\forall{x \in C_1, y \in C_2}: d\left(a,b\right) \leq d\left(x,y\right)$). Let us define for a cuboid $C \in S$ its fuzzified version $\widetilde{C}$ as follows (cf. Definition \ref{def:FSSSS}): $$\mu_{\widetilde{C}}\left(x\right) = \mu_0 \cdot \max_{y \in C}\left(e^{-c \cdot d_C^{\Delta}\left(x,y,W\right)}\right)$$ It is obvious that $\mu_{\widetilde{S}}\left(x\right) = \max_{C_i \in S} \mu_{\widetilde{C}_i}\left(x\right)$. When intersecting two fuzzified cuboids $\widetilde{C}_1$ and $\widetilde{C}_2$, the following results are possible: \begin{enumerate} \item The crisp cuboids have a nonempty intersection (Figure \ref{fig:IntersectionResults}a). In this case, we simply compute their crisp intersection. The $\alpha$-value of this intersection is equal to $\min(\mu_0^{\left(1\right)},\mu_0^{\left(2\right)})$. \item The $\mu_0$ parameters are different and the $\mu_0^{\left(i\right)}$-cut of $\widetilde{C}_j$ intersects with $C_i$ (Figure \ref{fig:IntersectionResults}b). In this case, we need to intersect $\widetilde{C}_j^{\mu_0^{\left(i\right)}}$ with $C_i$ and approximate the result by a cuboid. The $\alpha$-value of this intersection is equal to $\mu_0^{\left(i\right)}$. \item The intersection of the two fuzzified cuboids consists of a single point $x^*$ lying between $a$ and $b$ (Figure \ref{fig:IntersectionResults}c). In this case, we define a trivial cuboid with $p^- = p^+ = x^*$. The $\alpha$-value of this intersection is $\mu_{\widetilde{C}_1}\left(x^*\right) = \mu_{\widetilde{C}_2}\left(x^*\right)$. \item The intersection of the two fuzzified cuboids consists of a set of points (Figure \ref{fig:IntersectionResults}d). This can only happen if the $\alpha$-cut boundaries of both fuzzified cuboids are parallel to each other, which requires multiple domains to be involved and the weights of both concepts to be linearly dependent. Again, we approximate this intersection by a cuboid. We obtain the $\alpha$-value of this intersection by computing $\mu_{\widetilde{C}_1}\left(x\right) = \mu_{\widetilde{C}_2}\left(x\right)$ for some $x$ in the set of points obtained in the beginning. \end{enumerate} Moreover, it might happen that both $a$ and $b$ can vary in a certain dimension $d$ (Figure \ref{fig:IntersectionResults}e). In this case, the resulting cuboid needs to be extruded in this dimension.\\ After having computed a cuboid approximation of the intersection for all pairs of fuzzified cuboids, we aggregate them by removing all intersection results with non-maximal $\alpha$. If the remaining set of cuboids has an empty intersection, we perform the repair mechanism as defined above. \subsection{Unification} \label{Operations:Union} A unification of two or more concepts can be used to construct higher-level concepts. For instance, the concept of ``citrus fruit'' can be obtained by unifying ``lemon'', ``orange'', ``grapefruit'', ``lime'', etc.\\ As each core is defined as a union of cuboids, the unification of two \emph{cores} can also be expressed as a union of cuboids. The resulting set is star-shaped if and only if the central regions of the original cores intersect. So after each unification, we might again need to perform a repair mechanism in order to restore star-shapedness. We propose to use the same repair mechanism that is also used for intersections. We denote the modified unification as $S' = U\left(S_1, S_2\right)$.\\ \noindent We define the unification of two \emph{concepts} as $\widetilde{S}' = U(\widetilde{S}_1, \widetilde{S}_2) := \left\langle S',\mu'_0,c',W'\right\rangle$ with: \begin{itemize} \item $S' := U\left(S_1,S_2\right)$ \item $\mu'_0 := \max\left(\mu_0^{\left(1\right)},\mu_0^{\left(2\right)}\right)$ \item $c'$ and $W'$ as described in Section \ref{Operations:Intersection} \end{itemize} \begin{proposition} Let $\widetilde{S}_1 = \langle S_1, \mu_0^{\left(1\right)}, c^{\left(1\right)}, W^{\left(1\right)}\rangle$ and $\widetilde{S}_2 = \langle S_2, \mu_0^{\left(2\right)}, c^{\left(2\right)}, W^{\left(2\right)}\rangle$ be two concepts. If we assume that $\Delta_{S_1} = \Delta_{S_2}$ and $W^{\left(1\right)} = W^{\left(2\right)}$, then $\widetilde{S}_1 \cup \widetilde{S}_2 \subseteq U(\widetilde{S}_1, \widetilde{S}_2) = \widetilde{S}'$. \end{proposition} \begin{proof} As both $\Delta_{S_1} = \Delta_{S_2}$ and $W^{\left(1\right)} = W^{\left(2\right)}$, we know that $$d\left(x,y\right) := d_C^{\Delta_{S_1}}\left(x,y,W^{\left(1\right)}\right) = d_C^{\Delta_{S_2}}\left(x,y,W^{\left(2\right)}\right) = d_C^{\Delta_{S'}}\left(x,y,W'\right)$$ Moreover, $S_1 \cup S_2 \subseteq S'$. Therefore: \belowdisplayskip=-12pt \begin{align*} \mu_{\widetilde{S}_1 \cup \widetilde{S}_2}\left(x\right) &= \max\left(\mu_{\widetilde{S}_1}\left(x\right),\mu_{\widetilde{S}_2}\left(x\right)\right)\\ &= \max\left(\max_{y \in S_1} \left(\mu_0^{\left(1\right)} \cdot e^{-c^{\left(1\right)} \cdot d\left(x,y\right)}\right),\max_{y \in S_2} \left(\mu_0^{\left(2\right)} \cdot e^{-c^{\left(2\right)} \cdot d\left(x,y\right)}\right)\right)\\ &\leq \mu'_0 \cdot \max\left(e^{-c^{\left(1\right)} \cdot \min_{y \in S_1} d\left(x,y\right)}, e^{-c^{\left(2\right)} \cdot \min_{y \in S_2} d\left(x,y\right)}\right)\\ &\leq \mu'_0 \cdot e^{-c' \cdot \min\left(\min_{y \in S_1} d\left(x,y\right),\; \min_{y \in S_2} d\left(x,y\right)\right)}\\ &\leq \mu'_0 \cdot e^{-c' \cdot \min_{y \in S'} d\left(x,y\right)} = \mu_{\widetilde{S}'}\left(x\right) \end{align*} \end{proof} \subsection{Subspace Projection} \label{Operations:Projection} Projecting a concept onto a subspace corresponds to focusing on certain domains while completely ignoring others. For instance, projecting the concept ``apple'' onto the color domain results in a property that describes the typical color of apples.\\ Projecting a cuboid onto a subspace results in a cuboid. As one can easily see, projecting a \emph{core} onto a subspace results in a valid core. We denote the projection of a core $S$ onto domains $\Delta_{S'} \subseteq \Delta_S$ as $S' = P(S, \Delta_{S'})$.\\ We define the projection of a \emph{concept} $\widetilde{S}$ onto domains $\Delta_{S'} \subseteq \Delta_S$ as $\widetilde{S}' = P(\widetilde{S}, \Delta_{S'}) := \left\langle S', \mu'_0, c', W'\right\rangle$ with: \begin{itemize} \item $S' := P\left(S,\Delta_{S'}\right)$ \item $\mu'_0 := \mu_0$ \item $c' := c$ \item $W' := \left\langle\left\{|\Delta_S'| \cdot \frac{w_{\delta}}{\sum_{\delta' \in \Delta_{S'}} w_{\delta'}}\right\}_{\delta \in \Delta_{S'}},\left\{W_{\delta}\right\}_{\delta \in \Delta_{S'}}\right\rangle$ \end{itemize} Note that we only apply minimal changes to the parameters: $\mu_0$ and $c$ stay the same, only the domain weights are updated in order to not violate their normalization constraint.\\ Projecting a set onto two complementary subspaces and then intersecting these projections again in the original space yields a superset of the original set. This is intuitively clear for cores and can also be shown for concepts under one additional constraint: \begin{proposition} Let $\widetilde{S} = \left\langle S, \mu_0, c, W\right\rangle$ be a concept. Let $\widetilde{S}_1 = P(\widetilde{S}, \Delta_1)$ and $\widetilde{S}_2 = P(\widetilde{S}, \Delta_2)$ with $\Delta_1 \cup \Delta_2 = \Delta_S$ and $\Delta_1 \cap \Delta_2 = \emptyset$. Let $\widetilde{S}' = I(\widetilde{S}_1, \widetilde{S}_2)$ as described in Section \ref{Operations:Intersection}. If $\sum_{\delta \in \Delta_1} w_{\delta} = |\Delta_1|$ and $\sum_{\delta \in \Delta_2} w_{\delta} = |\Delta_2|$, then $\widetilde{S} \subseteq \widetilde{S}'$. \end{proposition} \begin{proof} We already know that $S \subseteq I\left(P\left(S, \Delta_1\right), P\left(S, \Delta_2\right)\right) = S'$. Moreover, one can easily see that $\mu'_0 = \mu_0$ and $c' = c$. \begin{align*} &\mu_{\widetilde{S}}\left(x\right) = \max_{y \in S} \left(\mu_0 \cdot e^{-c \cdot d_C^{\Delta_S}\left(x,y,W\right)}\right)\overset{!}{\leq} \max_{y \in S'} \left(\mu'_0 \cdot e^{-c' \cdot d_C^{\Delta_S}\left(x,y,W'\right)}\right) = \mu_{\widetilde{S}'}\left(x\right) \end{align*} This holds if and only if $W = W'$. $W^{\left(1\right)}$ only contains weights for $\Delta_1$, whereas $W^{\left(2\right)}$ only contains weights for $\Delta_2$. As $\sum_{\delta \in \Delta_i} w_{\delta} = |\Delta_i|$ (for $i \in \left\{1,2\right\}$), the weights are not changed during the projection. As $\Delta_1 \cap \Delta_2 = \emptyset$, they are also not changed during the intersection, so $W' = W$. \end{proof} \subsection{Axis-Parallel Cut} \label{Operations:Cut} In a concept formation process, it might happen that over-generalized concepts are learned (e.g., a single concept that represents both dogs and cats). If it becomes apparent that a finer-grained conceptualization is needed, the system needs to be able to split its current concepts into multiple parts.\\ One can split a concept $\widetilde{S} = \left\langle S, \mu_0, c, W \right\rangle$ into two parts by selecting a value $v$ on a dimension $d$ and by splitting each cuboid $C \in S$ into two child cuboids $C^{\left(+\right)} := \left\{x \in C \;|\; x_d \geq v\right\}$ and $C^{\left(-\right)} := \left\{x \in C \;|\; x_d \leq v\right\}$.\footnote{A strict inequality in the definition of $C^{\left(+\right)}$ or $C^{\left(-\right)}$ would not yield a cuboid.} Both $S^{\left(+\right)} := \bigcup_{i=1}^{m} C_i^{\left(+\right)}$ and $S^{\left(-\right)} := \bigcup_{i=1}^{m} C_i^{\left(-\right)}$ are still valid cores: They are both a union of cuboids and one can easily show that the intersection of these cuboids is not empty. We define $\widetilde{S}^{\left(+\right)} := \left\langle S^{\left(+\right)}, \mu_0, c, W \right\rangle$ and $\widetilde{S}^{\left(-\right)} := \left\langle S^{\left(-\right)}, \mu_0, c, W \right\rangle$, both of which are by definition valid concepts. Note that by construction, $S^{\left(-\right)} \cup S^{\left(+\right)} = S$ and $U(\widetilde{S}^{\left(-\right)}, \widetilde{S}^{\left(+\right)}) = \widetilde{S}$. \subsection{Concept Size} \label{Operations:Hypervolume} The size of a concept gives an intuition about its specificity: Large concepts are more general and small concepts are more specific. This is one obvious aspect in which one can compare two concepts to each other.\\ One can use a measure $M$ to describe the size of a fuzzy set. It can be defined in our context as follows (cf. \cite{Bouchon-Meunier1996}): \begin{definition} A measure $M$ on a conceptual space $CS$ is a function $M: \mathcal{F}\left(CS\right) \rightarrow \mathbb{R}^+_0$ with $M\left(\emptyset\right) = 0$ and $\widetilde{A} \subseteq \widetilde{B} \Rightarrow M(\widetilde{A}) \leq M(\widetilde{B})$, where $\mathcal{F}\left(CS\right)$ is the fuzzy power set of $CS$. \end{definition} A common measure for fuzzy sets is the integral over the set's membership function, which is equivalent to the Lebesgue integral over the fuzzy set's $\alpha$-cuts: \begin{equation} M\left(\widetilde{A}\right) := \int_{CS} \mu_{\widetilde{A}}\left(x\right)\; dx = \int_{0}^1 V\left(\widetilde{A}^{\alpha}\right)\; d\alpha \label{eqn:integral} \end{equation} We use $V(\widetilde{A}^{\alpha})$ to denote the volume of a fuzzy set's $\alpha$-cut. One can easily see that we can use the inclusion-exclusion formula (cf. e.g., \cite{Bogart1989}) to compute the overall measure of a concept $\widetilde{S}$ based on the measure of its fuzzified cuboids\footnote{Note that the intersection of two overlapping fuzzified cuboids is again a fuzzified cuboid.}: \begin{equation} M\left(\widetilde{S}\right) = \sum_{l=1}^m \left(\left(-1\right)^{l+1} \cdot \sum_{\substack{\left\{i_1,\dots,i_l\right\}\\\subseteq\left\{1,\dots,m\right\}}}M\left(\bigcap_{i \in \left\{i_1,\dots,i_l\right\}} \widetilde{C}_i\right)\right) \label{eqn:inclusionExclusion} \end{equation} The outer sum iterates over the number of cuboids under consideration (with $m$ being the total number of cuboids in S) and the inner sum iterates over all sets of exactly $l$ cuboids. The overall formula generalizes the observation that $|A\; \cup\; B| = |A| + |B| - |A\; \cap\; B|$ from two to $m$ sets.\\ In order to derive $M(\widetilde{C})$, we first describe how to compute $V(\widetilde{C}^{\alpha})$, i.e., the size of a fuzzified cuboid's $\alpha$-cut. Using Equation \ref{eqn:integral}, we can then derive $M(\widetilde{C})$, which we can in turn insert into Equation \ref{eqn:inclusionExclusion} to compute the overall size of $\widetilde{S}$.\\ Figure \ref{fig:2DAlphaCut} illustrates the $\alpha$-cut of a fuzzified two-dimensional cuboid both under $d_E$ (left) and under $d_M$ (right). From Lemma \ref{lemma:epsilonNeighborhood} we know that one can interpret each $\alpha$-cut as an $\epsilon$-neighborhood of the original $C$ with $\epsilon = -\frac{1}{c} \cdot \ln\left(\frac{\alpha}{\mu_0}\right)$. \begin{figure}[tp] \centering \includegraphics[width = 0.8\textwidth]{2D_AlphaCut.png} \caption{$\alpha$-cut of a fuzzified cuboid under $d_E$ (left) and $d_M $ (right), respectively.} \label{fig:2DAlphaCut} \end{figure} $V(\widetilde{C}^{\alpha})$ can be described as a sum of different components. Let us use the shorthand notation $b_d := p_d^+ - p_d^-$. Looking at Figure \ref{fig:2DAlphaCut}, one can see that all components of $V(\widetilde{C}^{\alpha})$ can be described by ellipses\footnote{Note that ellipses under $d_M$ have the form of streched diamonds.}: Component I is a zero-dimensional ellipse (i.e., a point) that was extruded in two dimensions with extrusion lengths of $b_1$ and $b_2$, respectively. Component II consists of two one-dimensional ellipses (i.e., line segments) that were extruded in one dimension, and component III is a two-dimensional ellipse. Let us denote by $\Delta_{\left\{d_1,\dots,d_i\right\}}$ the domain structure obtained by eliminating from $\Delta$ all dimensions $d \in D\setminus\left\{d_1, \dots, d_i\right\}$. Moreover, let $V\left(r, \Delta, W\right)$ be the hypervolume of a hyperball under $d_C^\Delta\left(\cdot,\cdot, W\right)$ with radius $r$. In this case, a hyperball is the set of all points with a distance of at most $r$ (measured by $d_C^\Delta\left(\cdot,\cdot, W\right)$) to a central point. Note that the weights $W$ can cause this ball to have the form of an ellipse. For instance, in Figure \ref{fig:2DAlphaCut}, we assume that $w_{d_1} < w_{d_2}$ which means that we allow larger differences with respect to $d_1$ than with respect to $d_2$. This causes the hyperballs to be streched in the $d_1$ dimension, thus obtaining the shape of an ellipse. We can in general describe $V(\widetilde{C}^{\alpha})$ as follows: $$V\left(\widetilde{C}^{\alpha}\right) = \sum_{i=0}^n \left( \sum_{\substack{\left\{d_1,\dots,d_i\right\}\\ \subseteq D}} \left( \prod_{\substack{d \in\\ D\setminus\left\{d_1,\dots,d_i\right\}}} b_d \right) \cdot V\left( -\frac{1}{c} \cdot \ln\left(\frac{\alpha}{\mu_0}\right),\Delta_{\left\{d_1, \dots, d_i\right\}},W \right)\right)$$ The outer sum of this formula runs over the number of dimensions with respect to which a given point $x \in \widetilde{C}^{\alpha}$ lies outside of $C$. We then sum over all combinations $\left\{d_1,\dots,d_i\right\}$ of dimensions for which this could be the case, compute the volume $V\left(\cdot,\cdot,\cdot\right)$ of the $i$-dimensional hyperball in these dimensions, and extrude this intermediate result in all remaining dimensions by multiplying with $\prod_{d \in D\setminus\left\{d_1,\dots,d_i\right\}} b_d$. Let us illustrate this formula for the $\alpha$-cuts shown in Figure \ref{fig:2DAlphaCut}: For $i = 0$, we can only select the empty set for the inner sum, so we end up with $b_1 \cdot b_2$, which is the size of the original cuboid (i.e., component I). For $i = 1$, we can either pick $\left\{d_1\right\}$ or $\left\{d_2\right\}$ in the inner sum. For $\left\{d_1\right\}$, we compute the size of the left and right part of component II by multiplying $V( -\frac{1}{c} \cdot \ln(\frac{\alpha}{\mu_0}),\Delta_{\left\{d_1\right\}},W)$ (i.e., their combined width) with $b_2$ (i.e., their height). For $\left\{d_2\right\}$, we analogously compute the size of the upper and the lower part of component II. Finally, for $i = 2$, we can only pick $\left\{d_1, d_2\right\}$ in the inner sum, leaving us with $V( -\frac{1}{c} \cdot \ln(\frac{\alpha}{\mu_0}),\Delta ,W)$, which is the size of component III. One can easily see that the formula for $V(\widetilde{C}^{\alpha})$ also generalizes to higher dimensions.\\ As we have shown in \cite{Bechberger2017Hyperball}, $V\left(r, \Delta, W\right)$ can be computed as follows, where $n_\delta = |\delta|$: $$V\left(r,\Delta, W\right) = \frac{1}{\prod_{\delta \in \Delta} w_{\delta} \cdot \prod_{d \in \delta} \sqrt{w_d}} \cdot \frac{r^n}{n!} \cdot \prod_{\delta \in \Delta} \left(n_\delta! \cdot \frac{\pi^{\frac{n_\delta}{2}}}{\Gamma\left(\frac{n_\delta}{2}+1\right)}\right)$$ Defining $\delta\left(d\right)$ as the unique $\delta \in \Delta$ with $d \in \delta$, and $a_d := w_{\delta\left(d\right)} \cdot \sqrt{w_{d}} \cdot b_d \cdot c$, we can use this observation to rewrite $V(\widetilde{C}^{\alpha})$: \begin{align*} V\left(\widetilde{C}^\alpha\right) &= \frac{1}{c^n\prod_{d \in D} w_{\delta\left(d\right)} \sqrt{w_d}} \sum_{i=0}^{n} \left( \frac{\left(-1\right)^i \cdot \ln\left(\frac{\alpha}{\mu_0}\right)^i}{i!} \cdot \sum_{\substack{\left\{d_1,\dots,d_i\right\}\\ \subseteq D}} \left(\prod_{\substack{d \in \\D \setminus \left\{d_1,\dots,d_i\right\}}} a_d\right) \cdot \right.\\ &\hspace{4.5cm}\left.\prod_{\substack{\delta \in \\ \Delta_{\left\{d_1,\dots,d_i\right\}}}} \left( n_\delta! \cdot \frac{\pi^{\frac{n_\delta}{2}}}{\Gamma\left(\frac{n_\delta}{2}+1\right)}\right)\right)\\ \end{align*} We can now solve Equation \ref{eqn:integral} to compute $M(\widetilde{C})$ by using the following lemma: \begin{lemma} \label{lemma:logIntegral} $\forall n \in \mathbb{N}: \int_0^{1} \ln\left(x\right)^n dx = \left(-1\right)^n \cdot n!$ \end{lemma} \begin{proof} Substitute $x = e^t$ and $s = -t$, then apply the definition of the $\Gamma$ function. \end{proof} \begin{proposition} \label{proposition:Measure} The measure of a fuzzified cuboid $\widetilde{C}$ can be computed as follows: \begin{align*} M\left(\widetilde{C}\right) &= \frac{\mu_0}{c^n\prod_{d \in D} w_{\delta\left(d\right)} \sqrt{w_d}} \sum_{i=0}^{n} \left( \sum_{\substack{\left\{d_1,\dots,d_i\right\}\\ \subseteq D}} \left(\prod_{\substack{d \in \\ D \setminus \left\{d_1,\dots,d_i\right\}}} a_d\right) \cdot \right.\\ &\hspace{5cm}\left.\prod_{\substack{\delta \in\\ \Delta_{\left\{d_1,\dots,d_i\right\}}}} \left( n_\delta! \cdot \frac{\pi^{\frac{n_\delta}{2}}}{\Gamma\left(\frac{n_\delta}{2}+1\right)}\right)\right) \end{align*} \end{proposition} \begin{proof} Substitute $x = \frac{\alpha}{\mu_0}$ in Equation \ref{eqn:integral} and apply Lemma \ref{lemma:logIntegral}. \end{proof} Although the formula for $M(\widetilde{C})$ is quite complex, it can be easily implemented via a set of nested loops. As mentioned earlier, we can use the result from Proposition \ref{proposition:Measure} in combination with the inclusion-exclusion formula (Equation \ref{eqn:inclusionExclusion}) to compute $M(\widetilde{S})$ for any concept $\widetilde{S}$. Also Equation \ref{eqn:inclusionExclusion} can be easily implemented via a set of nested loops. Note that $M(\widetilde{S})$ is always computed only on $\Delta_S$, i.e., the set of domains on which $\widetilde{S}$ is defined. \subsection{Subsethood} \label{Operations:Subsethood} In order to represent knowledge about a hierarchy of concepts, one needs to be able to determine whether one concept is a subset of another concept. For instance, the fact that $\widetilde{S}_{Granny Smith} \subseteq \widetilde{S}_{apple}$ indicates that Granny Smith is a hyponym of apple.\footnote{One could also say that the fuzzified cuboids $\widetilde{C}_i$ are sub-concepts of $\widetilde{S}$, because $\widetilde{C}_i \subseteq \widetilde{S}$.}\\ \noindent The classic definition of subsethood for fuzzy sets reads as follows (cf. Definition \ref{def:FuzzyOperations}): $$\widetilde{A} \subseteq \widetilde{B} :\iff \forall {x \in CS}: \mu_{\widetilde{A}}\left(x\right) \leq \mu_{\widetilde{B}}\left(x\right)$$ This definition has the weakness of only providing a binary/crisp notion of subsethood. It is desirable to define a \emph{degree} of subsethood in order to make more fine-grained distinctions. Many of the definitions for degrees of subsethood proposed in the fuzzy set literature \cite{Bouchon-Meunier1996,Young1996} require that the underlying universe is discrete. The following definition \cite{Kosko1992} works also in a continuous space and is conceptually quite straightforward: $$Sub\left(\widetilde{A},\widetilde{B}\right) = \frac{M\left(\widetilde{A} \cap \widetilde{B}\right)}{M\left(\widetilde{A}\right)} \quad \text{with a measure } M$$ One can interpret this definition intuitively as the ``percentage of $\widetilde{A}$ that is also in $\widetilde{B}$''. It can be easily implemented based on the intersection defined in Section \ref{Operations:Intersection} and the measure defined in Section \ref{Operations:Hypervolume}: $$Sub\left(\widetilde{S}_1,\widetilde{S}_2\right) := \frac{M\left(I\left(\widetilde{S}_1, \widetilde{S}_2\right)\right)}{M\left(\widetilde{S}_1\right)}$$ If $\widetilde{S}_1$ and $\widetilde{S}_2$ are not defined on the same domains, then we first project them onto their shared subset of domains before computing their degree of subsethood.\\ When computing the intersection of two concepts with different sensitivity parameters $c^{\left(1\right)}, c^{\left(2\right)}$ and different weights $W^{\left(1\right)}, W^{\left(2\right)}$, one needs to define new parameters $c'$ and $W'$ for the resulting concept. In Section \ref{Operations:Intersection}, we have argued that the sensitivity parameter $c'$ should be set to the minimum of $c^{\left(1\right)}$ and $c^{\left(2\right)}$. Now if $c^{\left(1\right)} > c^{\left(2\right)}$, then $c' = \min\left(c^{\left(1\right)}, c^{\left(2\right)}\right) = c^{\left(2\right)} < c^{\left(1\right)}$. It might thus happen that $M(I(\widetilde{S}_1, \widetilde{S}_2)) > M(\widetilde{S}_1)$, and that therefore $Sub(\widetilde{S}_1,\widetilde{S}_2) > 1$. As we would like to confine $Sub(\widetilde{S}_1,\widetilde{S}_2)$ to the interval $[0,1]$, we should use the same $c$ and $W$ for computing both $M(I(\widetilde{S}_1,\widetilde{S}_2))$ and $M(\widetilde{S}_1)$. When judging whether $\widetilde{S}_1$ is a subset of $\widetilde{S}_2$, we can think of $\widetilde{S}_2$ as setting the context by determining the relative importance of the different domains and dimensions as well as the degree of fuzziness. For instance, when judging whether tomatoes are vegetables, we focus our attention on the features that are crucial to the definition of the ``vegetable'' concept. We thus propose to use $c^{\left(2\right)}$ and $W^{\left(2\right)}$ when computing $M(I(\widetilde{S}_1,\widetilde{S}_2))$ and $M(\widetilde{S}_1)$. \subsection{Implication} \label{Operations:Implication} Implications play a fundamental role in rule-based systems and all approaches that use formal logics for knowledge representation. It is therefore desirable to define an implication function on concepts, such that one is able to express facts like $apple \Rightarrow red$ within our formalization.\\ In the fuzzy set literature \cite{Mas2007}, a fuzzy implication is defined as a generalization of the classical crisp implication. Computing the implication of two fuzzy sets typically results in a new fuzzy set which describes the local validity of the implication for each point in the space. In our setting, we are however more interested in a single number that indicates the overall validity of the implication $apple \Rightarrow red$. We propose to reuse the definition of subsethood from Section \ref{Operations:Subsethood}: It makes intuitive sense in our geometric setting to say that $apple \Rightarrow red$ is true to the degree to which $apple$ is a subset of $red$. We therefore define: $$Impl\left(\widetilde{S}_1,\widetilde{S}_2\right) := Sub\left(\widetilde{S}_1,\widetilde{S}_2\right)$$ \subsection{Similarity and Betweenness} \label{Operations:SimilarityBetweenness} Similarity and betweenness of concepts can be valuable sources of information for common-sense reasoning \cite{Derrac2015}: If two concepts are similar, they are expected to have similar properties and behave in similar ways (e.g., pencils and crayons). If one concept (e.g., ``master student'') is conceptually between two other concepts (e.g., ``bachelor student'' and ``PhD student''), it is expected to share all properties and behaviors that the two other concepts have in common (e.g., having to pay an enrollment fee).\\ In Section \ref{CS:Definition}, we have already provided definitions for similarity and betweenness of points. We can naively define similarity and betweenness for concepts by applying the definitions from Section \ref{CS:Definition} to the midpoints of the concepts' central regions $P$ (cf. Definition \ref{def:SSSS}). For computing the similarity, we propose to use both the dimension weights and the sensitivity parameter of the second concept, which again in a sense provides the context for the similarity judgement. If the two concepts are defined on different sets of domains, we use only their common subset of domains for computing the distance of their midpoints and thus their similarity. Betweenness is a binary relation and independent of dimension weights and sensitivity parameters. These proposed definitions are clearly very naive and shall be replaced by more sophisticated definitions in the future. Especially a graded notion of betweenness would be desirable. \section{Implementation and Example} \label{Implementation} \begin{figure}[t] \centering \includegraphics[width=0.95\textwidth]{class_diagram.png} \caption{Class diagram of our implementation.} \label{fig:classDiagram} \end{figure} We have implemented our formalization in Python 2.7 and have made its source code publicly avaliable on GitHub\footnote{See \url{https://github.com/lbechberger/ConceptualSpaces}.} \cite{Bechberger2018GitHub}. Figure \ref{fig:classDiagram} shows a class diagram illustrating the overall structure of our implementation. As one can see, each of the components from our definition (i.e., weights, cuboids, cores, and concepts) is represented by an individual class. Moreover, the ``cs'' module contains the overall domain structure of the conceptual space (represented as a dictionary mapping from domain identifiers to sets of dimensions) along with some utility functions (e.g., computing distance and betweenness of points). The ``concept\_inspector'' package contains a visualization tool that displays 3D and 2D projections of the concepts stored in the ``cs'' package. When defining a new concept from scratch, one needs to use all of the classes, as all components of the concept need to be specified in detail. When operating with existing concepts, it is however sufficient to use the \texttt{Concept} class which contains all the operations defined in Section \ref{Operations}.\\ Our implementation of the conceptual spaces framework contains a simple toy example -- a three-dimensional conceptual space for fruits, defined as follows: $$\Delta = \left\{\delta_{color} = \left\{d_{hue}\right\},\delta_{shape} = \left\{d_{round}\right\},\delta_{taste} = \left\{d_{sweet}\right\}\right\}$$ $d_{hue}$ describes the hue of the observation's color, ranging from $0.00$ (purple) to $1.00$ (red). $d_{round}$ measures the percentage to which the bounding circle of an object is filled. $d_{sweet}$ represents the relative amount of sugar contained in the fruit, ranging from 0.00 (no sugar) to 1.00 (high sugar content). As all domains are one-dimensional, the dimension weights $w_{d}$ are always equal to 1.00 for all concepts. We assume that the dimensions are ordered like this: $d_{hue},d_{round},d_{sweet}$. The conceptual space is defined as follows in the code: \begin{lstlisting}[language=Python] domains = {'color':[0], 'shape':[1], 'taste':[2]} dimension_names = ['hue', 'round', 'sweet'] space.init(3, domains, dimension_names) \end{lstlisting} \begin{table}[t] \centering \begin{footnotesize} \begin{tabular}{|l||c|c|c|c|c|c|c|c|} \hline Concept & $\Delta_S$& $p^-$ & $p^+$ & $\mu_0$ & $c$ & \multicolumn{3}{|c|}{$W$}\\ & & & & & & $w_{\delta_{color}}$ & $w_{\delta_{shape}}$ & $w_{\delta_{taste}}$\\ \hline \hline Pear & $\Delta$ & $\left(0.50, 0.40, 0.35\right)$ & $\left(0.70, 0.60, 0.45\right)$ & 1.0 & 12.0 & 0.50 & 1.25 & 1.25 \\ \hline Orange & $\Delta$ & $\left(0.80, 0.90, 0.60\right)$ & $\left(0.90, 1.00, 0.70\right)$ & 1.0 & 15.0 & 1.00 & 1.00 & 1.00 \\ \hline Lemon & $\Delta$ & $\left(0.70, 0.45, 0.00\right)$ & $\left(0.80, 0.55, 0.10\right)$ & 1.0 & 20.0 & 0.50 & 0.50 & 2.00 \\ \hline Granny & \multirow{2}{*}{$\Delta$} & \multirow{2}{*}{$\left(0.55, 0.70, 0.35\right)$} & \multirow{2}{*}{$\left(0.60, 0.80, 0.45\right)$} & \multirow{2}{*}{1.0} & \multirow{2}{*}{25.0} & \multirow{2}{*}{1.00} & \multirow{2}{*}{1.00} & \multirow{2}{*}{1.00}\\ Smith & & & & & & & &\\ \hline \multirow{3}{*}{Apple} & \multirow{3}{*}{$\Delta$} & $\left(0.50, 0.65, 0.35\right)$ & $\left(0.80, 0.80, 0.50\right)$ & \multirow{3}{*}{1.0} & \multirow{3}{*}{10.0} & \multirow{3}{*}{0.50} & \multirow{3}{*}{1.50} & \multirow{3}{*}{1.00} \\ & & $\left(0.65, 0.65, 0.40\right)$ & $\left(0.85, 0.80, 0.55\right)$ & & & & & \\ & & $\left(0.70, 0.65, 0.45\right)$ & $\left(1.00, 0.80, 0.60\right)$ & & & & & \\ \hline \multirow{3}{*}{Banana} & \multirow{3}{*}{$\Delta$} & $\left(0.50, 0.10, 0.35\right)$ & $\left(0.75, 0.30, 0.55\right)$ & \multirow{3}{*}{1.0} & \multirow{3}{*}{10.0} & \multirow{3}{*}{0.75} & \multirow{3}{*}{1.50} & \multirow{3}{*}{0.75} \\ & & $\left(0.70, 0.10, 0.50\right)$ & $\left(0.80, 0.30, 0.70\right)$ & & & & & \\ & & $\left(0.75, 0.10, 0.50\right)$ & $\left(0.85, 0.30, 1.00\right)$ & & & & & \\ \hline Red & $\left\{\delta_{color}\right\}$ & $\left(0.90, -\infty, -\infty\right)$ & $\left(1.00, +\infty, +\infty\right)$ & 1.0 & 20.0 & 1.00 & -- & -- \\ \hline \end{tabular} \end{footnotesize} \caption{Definitions of several concepts.} \label{tab:FruitSpace} \end{table} \begin{figure}[tp] \centering \includegraphics[width=\textwidth]{ConceptInspector_FruitSpace.png} \caption{Screenshot of the ConceptInspector tool for the fruit space example with subsequently added labels: pear (1), orange (2), lemon (3), Granny Smith (4), apple (5), banana (6), red (7). The 3D visualization only shows the concepts' cores, the 2D visualizations also illustrate the concepts' 0.5-cuts.} \label{fig:FruitSpace} \end{figure} Table \ref{tab:FruitSpace} defines some concepts in this space and Figure \ref{fig:FruitSpace} visualizes them. In the code, concepts can be defined as follows: \begin{lstlisting}[language=Python] c_pear = Cuboid([0.5, 0.4, 0.35], [0.7, 0.6, 0.45], domains) s_pear = Core([c_pear], domains) w_pear = Weights({'color':0.50, 'shape':1.25, 'taste':1.25}, {'color':{0:1.0}, 'shape':{1:1.0}, 'taste':{2:1.0}}) pear = Concept(s_pear, 1.0, 12.0, w_pear) \end{lstlisting} We can load the definition of this fruit space into our python interpreter and apply the different operations described in Section \ref{Operations} to these concepts. This looks for example as follows: \begin{lstlisting}[language=Python] >>> execfile('fruit_space.py') >>> granny_smith.subset_of(apple) 1.0 >>> apple.implies(red) 0.3333333333333332 >>> (pear.similarity_to(apple), pear.similarity_to(lemon)) (0.007635094218859955, 1.8553913626159717e-07) >>> print apple.intersect_with(pear) core: {[0.5, 0.625, 0.35]-[0.7, 0.625, 0.45]} mu: 0.6872892788 c: 10.0 weights: <{'color': 0.5, 'taste': 1.125, 'shape': 1.375}, {'color': {0: 1.0}, 'taste': {2: 1.0}, 'shape': {1: 1.0}}> \end{lstlisting} \section{Related Work} \label{RelatedWork} Our work is of course not the first attempt to devise an implementable formalization of the conceptual spaces framework. In this section, we review its strongest competitors.\\ An early and very thorough formalization was done by \cite{Aisbett2001}. Like we, they consider concepts to be regions in the overall conceptual space. However, they stick with G\"{a}rdenfors' assumption of convexity and do not define concepts in a parametric way. The only operations they provide are distance and similarity of points and regions. Their formalization targets the interplay of symbols and geometric representations, but it is too abstract to be implementable.\\ \cite{Rickard2006,Rickard2007} provide a formalization based on fuzziness. Their starting points are properties defined in individual domains. They represent concepts as co-occurence matrices of properties. For instance, $C\left(sour, green\right) = 0.8$ in the ``apple'' concept represents that in 80\% of the cases where the property ``sour'' was present, also the property ``green'' was observed. By using some mathematical transformations, Rickard et al. interpret these matrices as fuzzy sets on the universe of ordered property pairs. Operations defined on these concepts include similarity judgements between concepts and between concepts and instances. The representation of Rickard et al. nicely captures the correlations between different properties, but their representation of correlations is not geometrical: They first discretize the domains by defining properties and then compute co-occurence statistics between these properties. Depending on the discretization, this might lead to a relatively coarse-grained notion of correlation. Moreover, as properties and concepts are represented in different ways, one has to use different learning and reasoning mechanisms for them. The formalization by Rickard et al. is also not easy to work with due to the complex mathematical transformations involved. We would also like to point out that something very similar to the co-occurence values used by Rickard et al. can be extracted from our representation. One can interpret for instance $C\left({sour},{green}\right)$ as the degree of truth of the implication $\widetilde{S}_{sour} \Rightarrow \widetilde{S}_{green}$ within the apple concept. This number can be computed by using our implication operation: $$C\left({sour}, {green}\right) = Impl\left(I\left(\widetilde{S}_{sour}, \widetilde{S}_{apple}\right), I\left(\widetilde{S}_{green}, \widetilde{S}_{apple}\right)\right)$$ \cite{Adams2009} represent concepts by one convex polytope per domain. This allows for efficient computations while supporting a more fine-grained representation than our cuboid-based approach. The Manhattan metric is used to combine different domains. However, correlations between different domains are not taken into account as each convex polytope is only defined on a single domain. Adams and Raubal also define operations on concepts, namely intersection, similarity computation, and concept combination. This makes their formalization quite similar in spirit to ours. One could generalize their approach by using polytopes that are defined on the overall space and that are convex under the Euclidean and star-shaped under the Manhattan metric. However, we have found that this requires additional constraints in order to ensure star-shapedness. The number of these constraints grows exponentially with the number of dimensions. Each modification of a concept's description would then involve a large constraint satisfaction problem, rendering this representation unsuitable for learning processes. Our cuboid-based approach is more coarse-grained, but it only involves a single constraint, namely that the intersection of the cuboids is not empty.\\ \cite{Lewis2016} formalize conceptual spaces using random set theory. A random set can be characterized by a set of prototypical points $P$ and a threshold $\epsilon$. Instances that have a distance of at most $\epsilon$ to the prototypical set are considered to be elements of the set. The threshold is however not exactly determined, only its probability distribution $\delta$ is known. Based on this uncertainty, a membership function $\mu\left(x\right)$ can be defined that corresponds to the probability of the distance of a given point $x$ to any prototype $p \in P$ being smaller than $\epsilon$. Lewis and Lawry define properties as random sets within single domains and concepts as random sets in a boolean space whose dimensions indicate the presence or absence of properties. In order to define this boolean space, a single property is taken from each domain. This is in some respect similar to the approach of \cite{Rickard2006, Rickard2007} where concepts are also defined on top of existing properties. However, whereas Rickard et al. use two separate formalisms for properties and concepts, Lewis and Lawry use random sets for both (only the underlying space differs). Lewis and Lawry illustrate how their mathematical formalization is capable of reproducing some effects from the psychological concept combination literature. However, they do not develop a way of representing correlations between domains (such as ``red apples are sweet and green apples are sour''). One possible way to do this within their framework would be to define two separate concepts ``red apple'' and ``green apple'' and then define on top of them a disjunctive concept ``apple = red apple or green apple''. This however is a quite indirect way of defining correlations, whereas our approach is intuitively much easier to grasp. Nevertheless, their approach is similar to ours in using a distance-based membership function to a set of prototypical points while using the same representational mechanisms for both properties and concepts.\\ None of the approaches listed above provides a set of operations that is as comprehensive as the one offered by our proposed formalization. Many practical applications of conceptual spaces (e.g., \cite{Chella2003,Raubal2004,Dietze2008,Derrac2015}) use only partial ad-hoc implementations of the conceptual spaces framework which usually ignore some important aspects of the framework (e.g., the domain structure).\\ The only publicly avaliable implementation of the conceptual spaces framework that we are currently aware of is provided by \cite{Lieto2015, Lieto2017}. They propose a hybrid architecture that represents concepts by using both description logics and conceptual spaces. This way, symbolic ontological information and similarity-based ``common sense'' knowledge can be used in an integrated way. Each concept is represented by a single prototypical point and a number of exemplar points. Correlations between domains can therefore only be encoded through the selection of appropriate exemplars. Their work focuses on classification tasks and does therefore not provide any operations for combining different concepts. With respect to the larger number of supported operations, our formalization and implementation can thus be considered more general than theirs. In contrast to our work, the current implementation of their system\footnote{See \url{http://www.dualpeccs.di.unito.it/download.html}.} comes without any publicly available source code\footnote{The sorce code of an earlier and more limited version of their system can be found here: \url{http://www.di.unito.it/~lieto/cc_classifier.html}.}. \section{Outlook and Future Work} \label{Outlook} As stated earlier, our overall research goal is to devise a symbol grounding mechanism by defining a concept formation process in the conceptual spaces framework. Concept formation \cite{Gennari1989} is the process of incrementally creating a meaningful hierarchical categorization of unlabeled observations. One can easily see that a successful concept formation process implicitly solves the symbol grounding problem: If we are able to find a bottom-up process that can group observations into meaningful categories, these categories can be linked to abstract symbols. These symbols are then grounded in reality, as the concepts they refer to are generalizations of actual observations.\\ \begin{figure}[tp] \centering \includegraphics[width=0.82\textwidth]{Architecture.png} \caption{Visualization of our envisioned symbol grounding architecture. The translation from the subsymbolic to the conceptual layer will be based on both hard-coded conversions (like the HSB color space) and pre-trained artificial neural networks. The translation from the conceptual layer to the symbolic layer will be based on a clustering algorithm that performs concept formation.} \label{fig:Architecture} \end{figure} We aim for a three-layered architecture as depicted in Figure \ref{fig:Architecture} with the formalization presented in this paper serving as middle layer. The conceptual space that we will use for our work on concept formation will have a predefined structure: Domains having a well-known structure will be hand-crafted, e.g., color or sound. These domains can quite straightforwardly be represented by a handful of dimensions. Domains with an unclear internal structure (i.e., where it is inherently hard to hand-craft a dimensional representation) can potentially be obtained by deep representation learning \cite{Bengio2013}. This includes for instance the domain of shapes. We will investigate different neural network architectures that have shown promising results in extracting meaningful dimensions from unlabeled data sets, e.g., InfoGAN \cite{Chen2016} and beta-VAE \cite{Higgins2017}. This set-up of the conceptual space is not seen as an active part of the concept formation process, but as a preprocessing step to lift information from the subsymbolic layer (e.g., raw pixel information from images) to the conceptual layer.\\ The most straightforward way of implementing concept formation within the conceptual spaces framework is to use a clustering algorithm that groups unlabled instances into meaningful regions. Each of these regions can be interpreted as a concept and a symbol can be attached to it. As this research is seen in the context of artificial general intelligence, it will follow the assumption of insufficient knowledge and resources \cite{Wang2011}: The system will only have \emph{limited resources}, i.e., it will not be able to store all observed data points. This calls for an incremental clustering process. The system will also have to cope with \emph{incomplete information}, i.e., with incomplete feature vectors. As concept hierarchies are an important and useful aspect of human conceptualizations \cite[Chapter 7]{Murphy2002}, the concept formation process should ideally result in a hierarchy of concepts. It is generally unknown in the beginning how many concepts will be discovered. Therefore, the number of concepts must be adapted over time. There are some existing clustering algorithms that partially fulfill these requirements (e.g., CLASSIT \cite{Gennari1989} or SUSTAIN \cite{Love2004}), but none of them is a perfect fit. We will take inspiration from these algorithms in order to devise a new algorithm that fulfills all the requirements stated above. One can easily see that our formalization is able to support such clustering processes: Concepts can be created and deleted. Modifying the support points of the cuboids in a concept's core results in changes to the concept's position, size, and form. One must however ensure that such modifications preserve the non-emptiness of the cuboids' intersection. Moreover, a concept's form can be changed by modifying the parameters $c$ and $W$: By changing $c$, one can control the overall degree of fuzziness, and by changing $W$, one can control how this fuzziness is distributed among the different domains and dimensions. Two neighboring concepts $\widetilde{S}_1, \widetilde{S}_2$ can be merged into a single cluster by unifying them. A single concept can be split up into two parts by using the axis-parallel cut operation.\\ Finally, our formalization also supports reasoning processes: \cite{Gardenfors2000} argues that adjective-noun combinations like ``green apple'' or ``purple banana'' can be expressed by combining properties with concepts. This is supported by our operations of intersection and subspace projection: In combinations like ``green apple'', property and concept are compatible. We expect that their cores intersect and that the $\mu_0$ parameter of their intersection is therefore relatively large. In this case, ``green'' should narrow down the color information associated with the ``apple'' concept. This can be achieved by simply computing their intersection. In combinations like ``purple banana'', property and concept are incompatible. We expect that their cores do not intersect and that the $\mu_0$ parameter of their intersection is relatively small. In this case, ``purple'' should replace the color information associated with the ``banana'' concept. This can be achieved by first removing the color domain from the ``banana'' concept (through a subspace projection) and by then intersecting this intermediate result with ``purple''. \section{Conclusion} \label{Conclusion} In this paper, we proposed a new formalization of the conceptual spaces framework. We aimed to geometrically represent correlations between domains, which led us to consider the more general notion of star-shapedness instead of G\"{a}rden\-fors' favored constraint of convexity. We defined concepts as fuzzy sets based on intersecting cuboids and a similarity-based membership function. Moreover, we provided a comprehensive set of operations, both for creating new concepts based on existing ones and for measuring relations between concepts. This rich set of operations makes our formalization (to the best of our knowledge) the most thorough and comprehensive formalization of conceptual spaces developed so far. Our implementation of this formalization and its source code are publicly avaliable and can be used by any researcher interested in conceptual spaces. We think that our implementation can be a good foundation for practical research on conceptual spaces and that it will considerably facilitate research in this area. In future work, we will provide more thorough definitions of similarity and betweenness for concepts, given that our current definitions are rather naive. A potential starting point for this can be the betwenness relations defined by \cite{Derrac2015}. Moreover, we will use the formalization proposed in this paper as a starting point for our research on concept formation as outlined in Section \ref{Outlook}.
\section*{Abstract} Rapid popularity of Internet of Things (IoT) and cloud computing permits neuroscientists to collect multilevel and multichannel brain data to better understand brain functions, diagnose diseases, and devise treatments. To ensure secure and reliable data communication between end-to-end (E2E) devices supported by current IoT and cloud infrastructure, trust management is needed at the IoT and user ends. This paper introduces a Neuro-Fuzzy based Brain-inspired trust management model (TMM) to secure IoT devices and relay nodes, and to ensure data reliability. The proposed TMM utilizes node behavioral trust and data trust estimated using Adaptive Neuro-Fuzzy Inference System and weighted-additive methods respectively to assess the nodes trustworthiness. In contrast to the existing fuzzy based TMMs, the NS2 simulation results confirm the robustness and accuracy of the proposed TMM in identifying malicious nodes in the communication network. With the growing usage of cloud based IoT frameworks in Neuroscience research, integrating the proposed TMM into the existing infrastructure will assure secure and reliable data communication among the E2E devices. \section*{Introduction} \label{sec-intro} In recent years biological data has grown significantly, thanks to the technological developments, now scientists can acquire data simultaneously from multiple levels and channels of a living system \cite{mahmud_dl_rl_biol_2017}, and simulate large scale brain networks \cite{schadt_cloud_genetics_2010,shahand_neuro_gateway_2015}. One of the major contributors to this biological big data is Neuroscience \cite{landhuis_neuro_bigdata_2017}. Brain signals, e.g., Electroencephalogram (EEG), Electrocorticogram (ECoG), Neuronal Spikes (AP), Local Field Potentials (LFPs) along with brain imaging techniques, e.g., Magnetoencephalography (MEG), Magnetic Resonance Imaging (MRI), Functional MRI (fMRI), Positron Emission Tomography (PET) have been extensively used in diagnosis of neurodegenerative diseases \cite{sakkalis_eeg_cogn_res_2011,mcmillan_neurodegenerative_2016}, neuropsychiatric disorders \cite{liu_neuroimaging_review_2015}, and developmental disorders such as Autism Spectrum Disorder \cite{aljawahiri_autism_2017}. Additionally, this data has been effectively utilized in developing various data-driven disease models \cite{young_data_driven_2014,burns_data_intensive_2014}. Modern day Neuroscience research is driven by data (see Fig. \ref{fig-concept}). Both clinical and experimental neuroscience research generate huge amount of data \cite{mahmud_qst_2014} and analyzing those data to draw meaningful conclusions is very challenging \cite{mahmud_sig_proc_review_2016}. The extracted knowledge from these data allow the development and refining of data-intensive models and describe the underlying biological phenomena which in turn facilitate experimental design \cite{ncc_cloud_2016}. The data analytics and modeling phases are computationally intensive, and advancements in artificial intelligence \cite{luo_bics_2016} and cloud computing \cite{hashem_bigdata_cloud_review_2015} allowed scientists to perform these steps smoothly. The `cloudification' greatly facilitated scientists by providing `software as a service' (e.g., service oriented architecture or SOA) instead of running the data-intensive analyses and modeling locally in the computers. In other words, cloud computing and big data paradigms converted context-aware research into exhaustive, data-driven research. \begin{figure}[!btp] \centering \includegraphics[scale=1]{Fig01_concept} \caption{Cycle of modern Neuroscience research.} \label{fig-concept} \end{figure} Now, with the emergence of the Internet of Things (IoT), various sensors can be connected to the cloud for seamless resource sharing. Such IoT-Cyber Physical Systems (IoT-CPS) provide a platform to data-driven research and design appropriate medical services for patients. The IoT-CPS tailored to patient monitoring and care are around for a few years now and it allowed hospitals and healthcare processionals to seamlessly exchange patients' data even from remote locations. These data may represent a wide range of healthcare parameters collected through the IoT for healthcare (IoHT) sensors. One of the main challenges of this type of IoT-CPS is to ensure privacy and information security. Thus, the trust management plays a vital role for the end users which act as a first step of information security. Despite the fact that trust management is required for all such frameworks dealing with biological data acquirable through the IoHT devices, the Neuroscience data stands apart from the others and requires special attention due to their high variability and spontaneity. While in many biosignals (e.g., Electrocardiogram, Electromyogram) periodicities and similarities have been noticed in terms of frequency content, amplitude and shape, the Neuroscience data (e.g., EEG, ECoG, LFPs, AP, etc.) have been known for their variabilities \cite{mahmud_lfp_sorting_2012,mahmud_sigmate_2012,mahmud_single_lfp_2016} making them more prone to misidentification, misclassification and misinterpretation in cases when the signals are unsupervisedly acquired without any experts. Therefore, to design robust telemedicine systems using IoT-CPS targeting Neuroscience applications, extra care must be taken to ensure the trustworthiness of the IoHT nodes. Mahmud et al. introduced a service-oriented architecture for web based collaborative biomedical signal analysis \cite{mahmud_service_2012}. As an initial platform with three main components (i.e., users, contributors, and services), this model assumed the inherent security of the internet and used certificate based security as authentication scheme for the contributors and users to deploy and utilize services. The same architecture can be extended by delegating the data coming from the IoT devices to the cloud for analysis. Additionally, a cloud-based healthcare system was proposed in \cite{Zhang_Health-CPS_2017} to provide convenient patient-centric healthcare services. In this model, the cloud performed the big data analytics and the authors reported significant performance improvement in the cloud-based system which too can be adapted to suit smart healthcare applications. Also, biologically inspired cloud resource provisioning was proposed for optimal handling of big healthcare data \cite{ullah_ss_cloud_2016}. While the assumption of a secure cloud is appropriate in the context of currently discussed communication models, discarding malicious transmission -- identified by the nodes profile information, behavior, and data similarity -- is vital to ensure the optimized performance, reliability, and robustness of a system. In the current scenario, profile information is validated by the authentication services, and the nodes behavior and data similarity are handled by a trust management system. To make a more trustworthy system, Shabut et al. identified the malicious nodes based on their behavior and improved packets delivery through a multi-hop relay network excluding those misbehaving nodes \cite{Shabut_Recom_trust_2015}. Another work proposed a dynamic cluster based recommendation model to minimize the data sparsity or cold start situations using nodes behavior to improve quality of service (QoS) of end-to-end (E2E) transmission \cite{Shabut_sparsity_2017}. \ Chen et al. proposed a Fuzzy reputation-based trust model (TRM) for IoT-CPS which estimated the nodes trust from their behavior and showed an improved performance in comparison to a communication system without trust \cite{ Chen2011TRMIoTAT}. An ant colony based trust model was presented to determine the trust value of wireless nodes which exhibited improved accuracy \cite{marzi_enhanced_2013}. Context-aware multiservice trust management systems were proposed in \cite{ben_saied_trust_2013,dolera_tormo_dynamic_2015} which filtered malicious nodes in the E2E and heterogeneous IoT architectures with high accuracy. Another trust management model (TMM) was proposed to evaluate the trustworthiness of nodes in the wireless sensor network through beta distribution. The aggregated trust value from data and energy was used in identifying the untrustworthy relay nodes to reduce the internal threats \cite{fang_btres:_2016}. Yet another trust management system, based on an agent's trustworthiness and confidence, was proposed to evaluate the trustworthiness of the IoT nodes \cite{Ruan_TMF_2016}. Moreover, a joint social and QoS TMM was presented to find the trust level of wireless nodes in a mobile adhoc network \cite{Chen_Social_Qos_trust+2013}. However, identifying the malicious transmission using only nodes behavior isn't enough to ensure reliable communication. It is important to guarantee that the data generated by the nodes are error-free -- which is a big challenge -- and a TMM that takes into account both nodes behavior and data similarity can be a solution to confirm nodes reliability. This paper presents an Adaptive Neuro-Fuzzy based Brain-inspired TMM targeting cloud based IoT architecture to determine data trust and behavioral trust for all IoT devices and relay nodes to ensure reliable data communication between E2E devices. This work also investigates the effects of trust management on the QoS issues of the cloud based IoT architecture suitable for neuroscience applications. \begin{figure*}[!bthp] \hspace{-4cm} \includegraphics[scale=1]{Fig02_architecture} \caption{Cloud based IoT Architecture for Neuroscience Applications. All the IoT sensor nodes are deployed in the perception layer (IoT site).} \label{fig-IoT-Cloud} \end{figure*} \section{Cloud based IoT Architecture} \label{sec:NS} The big data and cloud are two paramount elements for creating collaborative frameworks to analyze brain signals (e.g., EEG, ECoG, AP, LFPs, etc.) and brain images (e.g., MEG, MRI, fMRI, PET, etc.) and to perform data-driven modeling \cite{mahmud_service_2012}. Due to the wide range of advantages offered by such architectures, they have become the trend in recent years \cite{Zhang-health-cps_2017}. \begin{figure}[!btp] \centering \includegraphics[scale=1]{Fig03_cloud-authentication} \caption{Cloud authentication model (adapted from \cite{mahmud_service_2012}).} \label{fig-cloudauth} \end{figure} Focusing on applications related to Neuroscience, Fig. \ref{fig-IoT-Cloud} illustrates a cloud based IoT framework which consists of three main components, i.e., the IoT end (contains the data generating devices), the cloud component (provides the access and connectivity, and processing and analysis of data), and the user end (provides the analyzed and processed data to the users, e.g., doctors, caregivers, and researchers). In this framework, the data from various Neurotechnology empowered devices are collected for the development of state-of-the-art techniques pertaining to intelligent healthcare and advancement of Neuroscience research. At the IoT end, also known as perception layer, various data generating devices are connected to respective transceiver devices to forward the data to the cloud through the IoT gateway either for data analytics or simply for storage. Additionally, the brain signals generated at the IoT end are also used in operating various medical and assistive devices (e.g., automatic wheelchair, robotic arm, etc.) \cite{kaiser_neuro-fuzzy_2016,Zhang-health-cps_2017} to provide the better monitoring and improve the quality of life. The cloud is used for defining the access and the network and perform data storage and analytics. Extending the work of Mahmud et al. \cite{mahmud_service_2012}, in our framework, we consider the cloud to be secure through existing certification and authentication models (see Fig. \ref{fig-cloudauth}). Finally, at the user end, the service consumers can access and visualize the processed data based on granted rights and privileges. \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig04_trust_steps} \caption{Block diagram showing various steps of a trust evaluation process. } \label{fig-trust-steps} \end{figure} In the cloud based IoT architectures, the IoT devices or nodes generate data owing to various Neuroscience applications. Like human relationships, these nodes collaborate with each other through certain predefined social properties, and these properties are the `Trust Compositions' (see section \ref{sec:Model}). The values of these social properties are propagated on the IoT and user ends (known as `Trust Propagation'). During direct or indirect interactions, the trust metrics of each node are aggregated through static weighted sum, neuro-fuzzy method, and Bayesian inference (known as `Trust Aggregation'). The trust value of each node is then updated when an interaction is completed (known as `Trust Update'). This update can also be done periodically for energy efficiency. The block diagram of the trust management steps is illustrated in Fig. \ref{fig-trust-steps}. \begin{figure}[!btp] \centering \includegraphics[scale=1]{Fig05_trust_weights} \caption{The trust management model. Data trust and behavioral trust values are aggregated to find the trust level of the sensor and relay nodes.} \label{fig-model} \end{figure} \section{Trust Management Model} \label{sec:Model} The proposed TMM is illustrated in Fig. \ref{fig-model}, where the IoT nodes directly or via local/global relay nodes (such as smartphones, routers, etc.) interact with the sensor hubs (see Fig. \ref{fig-IoT-Cloud}) to establish successful communication links. The individual trust levels of the IoT devices and relay nodes are required to be evaluated to discard the malicious nodes \cite{yan_iot_trust_review_2014}. As the data communication in the access and cloud layer is secured, the IoT and user ends are the main focus of our TMM for ensuring the E2E trust among IoT devices and users for cloud based Neuroscience applications. Mimicking the social relation of people, the IoT devices and relay nodes are assumed to have social relationships among themselves. Thus, the interactions and collaborations among these nodes are employed to evaluate the trust level of each node. In deducing E2E trust level, certain relationship among the nodes are considered which include-- node profile information, node behavioral trust, and data trust \cite{afsana_trust_energy_2015}. The profile information is assured by the authentication service, whereas, the latter two are estimated using adaptive neuro-fuzzy inference system (ANFIS) and weighted-additive method, respectively. The node behavioral evidence is assessed through direct and indirect interactions among the nodes. For each node, the assessment of the behavioral trust is performed considering three factors related to that node-- relative frequency of interaction (RFI), intimacy, and honesty. The data trust is assessed by estimating the deviation of a node's instantaneous data from the historical data of that node. Both direct and indirect methods can be employed to evaluate data trust of a node. Mathematically, the trust level of a given node ($j$) denoted by $\mathcal{T}_{j}$ is estimated by summing up the behavioral and data trust as Equation \ref{eq:node}. \begin{equation} \label{eq:node} \centering \mathcal{T}_{j}(t)=\mathcal{T}_{j}^{nb}(t)+\mathcal{T}_{j}^{d}(t), \end{equation} \noindent where, $\mathcal{T}_{j}^{nb}(t)$ is the evaluated behavioral trust and $\mathcal{T}_{j}^{d}(t)$ is the evaluated data trust. \subsection{Evaluating Behavioral Trust} \subsubsection{Behavioral Trust Metrics} \label{subsubsec:trust} The trust properties for the behavioral trust of a nodes are discussed below. \noindent \paragraph{Relative Frequency of Interaction (RFI).} Zhang et al. studied the interaction frequency among nodes \cite{zhang_effects_2001}. The interaction frequency refers to the number of interactions, between the assessor and assessee, that take place within a given unit of observation time. The higher the successful interaction rate, the higher the degree of closeness. It means the assessee node is a trustworthy node. It has also been reported that the closeness in a relationship (e.g., friendship) can be predicted from the past interaction and it confound the future interaction \cite{josang_survey_2007,cherry_entrepreneur_2014}. Therefore, the RFI-aware trust, $\mathcal{T}_{j}^{RFI}$, can be calculated by Equation \ref{eq:fi}. \begin{equation}\label{eq:fi} \mathcal{T}_{j}^{RFI}=\frac{n_j}{N}, \end{equation} \noindent where $n_j$ is the number of interactions between the assessee node $j$ and the assessor node in an observation period $t$, whereas, $N$ is total number of interactions between node $j$ with other $k$ nodes during $t$. \noindent \paragraph{Intimacy.} In any social context, the intimacy or relationship duration of interaction is an important factor in calculating the trust level. The higher is the time of interaction between an assessee node and an assessor or guarantor node, the higher is the intimacy. Considering the total time spend of an assessor node $i$ with the assessee node $j$ as $t_{ij}$ and the cumulative time spend of $j$ with other $k$ guarantor nodes as $t_{kj}$, the intimacy ($\mathcal{T}_{j}^{I}$) can be calculated by Equation \ref{eq:int} \cite{daly_social_2009}. \begin{equation} \label{eq:int} \mathcal{T}_{j}^{I}=\frac{t_{ij}}{t_{ij}-t_{kj}}. \end{equation} \noindent \paragraph{Honesty.} Honesty is one of the main factors for establishing social trust between two given nodes. It can be determined using the successful and unsuccessful interactions of those nodes. Usually, the value of honesty lies between [0,1], i.e., $\mathcal{T}_{j}^{H}\in [0,1]$. In other words, $\mathcal{T}_{j}^{H}=0$ means no successful interaction, and $\mathcal{T}_j^{H}(t)\rightarrow 1$ means the assessee node $j$ is a trustworthy node. While $a_j$ and $b_j$ denote successful and unsuccessful interactions respectively, their values are estimated using the Beta distribution \cite{momani_beta_distr_2014,liu_reputation_2017}, where the distribution $f(p|a_j,b_j)$ is expressed by the Gamma function $\Gamma(\cdot)$ with $0\leq p \leq 1$, $a_j>0$, $b_j>0$; and $p\neq0$ if $a_j<1$ and $p\neq1$ if $b_j<1$ \cite{josang_beta_2002}. Finally, the honesty aware trust value can be calculated by Equation \ref{eq:hon}. \begin{equation} \label{eq:hon} \mathcal{T}_{j}^{H}(t)=\frac{a_j}{a_j+b_j}. \end{equation} \subsubsection{Node Behavioral Trust} \label{subsubsec-nbt} The node behavioral trust is calculated from both direct and indirect interactions between nodes. At a given time $t$, an assessor node directly interacts with the assessed node and evaluates the direct trust level (i.e., $\mathcal{T}_{j}^{d,nb}(t)$) from the previous direct interactions. Based on the guarantee provided by the adjacent nodes the indirect trust level (i.e., $\mathcal{T}_{kj}^{ind,nb}(t)$) can be evaluated. The guarantor nodes ($k$ number of nodes) provide guarantee based on the previous interactions with the assessed node. The behavioral trust of $j$-th node is given by Equation \ref{eq:nodebehavioral}. \begin{equation} \label{eq:nodebehavioral} \mathcal{T}_{j}^{nb}(t)=\mathcal{T}_{j}^{d,nb}(t)+\sum_k \frac{1}{\mathcal{H}_k}\mathcal{T}_{kj}^{ind,nb}(t), \end{equation} \noindent where $\mathcal{H}_k$ is the hop count for the $k$-th guarantor node. \subsubsection{ANFIS based Node Behavioral Trust Model} \label{subsubsec:NFtrust} Fuzzy inference system (FIS) is a rule based expert system which can mimic Brain's logical inference to represent a system. In ANFIS, a fuzzy inference system is employed to represent a nonlinear system with any complexity. The parameters of the input and output membership functions can be tuned by the backpropagation or hybrid backpropagation-least squares algorithm \cite{Takagi-FIS-1985,Hmouz_ANFIS_2012}. Due to its adaptive nature, the ANFIS is more powerful in comparison to FIS. \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig06_node-trust-behavior} \caption{ANFIS for the node behavioral trust calculation. The model evaluates node behavioral trust based on the RFI, Intimacy, and Honesty. The `fn' denotes the $y_k$ function in the form $y_k=\sum_i w_{ki}I_i+b_k$.} \label{fig-anfis-model} \end{figure} The node behavior is evaluated by the ANFIS model as illustrated in Fig. \ref{fig-anfis-model}. The system consists of three inputs --relative frequency of interactions (RFI), Intimacy, and Honesty. Each input has three linguistic terms or membership functions (MFs), i.e., \textit{Low}, \textit{Medium}, and \textit{High}. Therefore, there are nineteen possible IF-THEN rules in the rule based system (see Fig. \ref{fig-anfis-model}) and one output called node behavioral trust level. There are five layers-- Fuzzification, Rule, Normalization, Defuzzification and Output. Detailed description of each of these layer is described in \cite{Takagi-FIS-1985,Hmouz_ANFIS_2012,kaiser_neuro-fuzzy_2016}. The outputs of the layers are expressed by: \begin{align*} \textrm{Fuzzification: \;} O_{ij}^1&=\mu_{ij}(I_i), \\ \textrm{Rule: \;} O_{k}^2&=\prod O_{ij}^1=\prod \mu_{ik}(I_i), \\ \textrm{Normalization: \;} O_{k}^3&=\frac{ O_{k}^2}{\sum_k O_{k}^2}, \\ \textrm{Defuzzification: \;} O_{k}^4&= O_{k}^3 y_k, \; y_k=\sum_i w_{ki}I_i+b_k, \\ \textrm{Output: \;} O_{k}^5&=\mathcal{T}_{j}^{nb}(t)=\sum_k O_{k}^4, \end{align*} where, $i=1,2,3$; $j=1,2,3$; $k=1,2,...,19$; $\mu_{ij}$ is $j$-th MF for input $I_i$, $w_ki$ and $b_k$ are consequent parameters; and $\mathcal{T}_{j}^{nb}(t)$ is the behavioral trust level of $j$-th node. \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig07_anfis_output} \caption{The output surface plots of ANFIS where node behavioral trust is plotted against the trust properties (a) Honesty and RFI, and (b) Honesty and Intimacy.} \label{fig-surfaceplot} \end{figure} The ANFIS model is trained with the input-output datasets generated from the NS2 simulator \cite{issariyakul_ns2_2009}. This dataset is generated for the placement of 50 nodes where a percentage of the nodes are configured as misbehaving nodes. Beta distribution calculated the failure and success of the interactions. For the predefined rule-based, the ANFIS model has changed the MFs, and premise/ consequent parameters for finding the node-behavior trust value. Fig. \ref{fig-surfaceplot} shows the output surface plots of ANFIS model where node behavioral trust is plotted against the trust properties (a) Honesty and RFI, and (b) Honesty and Intimacy. \subsection{Evaluation of Data Trust} The data trust of a node consists of direct and indirect trust based on the historical data of the node(s). \noindent \paragraph{Direct Data Trust.} The value of direct data trust depends on the deviation of a node's instantaneous data from its historical data. The historical data are the average value of the node's data for a recent period ($T$). Mathematically, the direct data trust, $T_{j}^{dd}(t)$, of the $j$-th node with the $i$-th relay can be expressed by equation \ref{eq:ddt} \begin{equation} \label{eq:ddt} T_{j}^{dd}(t)=\left\{ \begin{array}{ll} T_{max} \; \; \textrm{for \;} D_{j}^{dd}(t)=D^{his}\\ \frac{1}{|D_{j}^{dd}(t)-D^{his}|} \; \; \textrm{for \;} D_{j}^{dd}(t) \neq D^{his}, \end{array} \right. \end{equation} \noindent where, $D_{j}^{dd}$ is the instantaneous data of $j$-th node during direct interaction whereas $D^{his}$ is the historical data. \noindent \paragraph{Indirect Data Trust.} The indirect data trust, $T_{kj}^{di}$ is the average value of the deviation of a node's instantaneous data from the historical data of $k$ nodes with $j$-th relay under the assumption that the included nodes are all trusted. Mathematically, $T_{j}^{di}(t)$ can be expressed by the equation \ref{eq:didt} \begin{equation} \label{eq:didt} T_{j}^{di}(t)=\left\{ \begin{array}{ll} T_{max} \; \; \textrm{for \;} \frac{\sum_k D_{kj}^{ind}(t)}{k}=D^{his}\\ \frac{1}{|\frac{\sum_k D_{kj}^{ind}(t)}{k}-D_{j}^{his}|} \; \; \textrm{for \;} \frac{\sum_k D_{kj}^{ind}(t)}{k} \neq D_{j}^{his}, \end{array} \right. \end{equation} \noindent where, $D_{kj}^{ind}$ is the instantaneous data of $j$-th node during indirect interaction with $k$ nodes. Having obtained the direct and indirect trust values, data trust of the $j$-th node is calculated by Equation \ref{eq:datatrust} \begin{equation} \label{eq:datatrust} \mathcal{T}_{j}^{d}(t)=\mathcal{T}_{j}^{dd}(t)+\sum_k \frac{1}{\mathcal{H}_k}\mathcal{T}_{kj}^{di}(t-t_m), \end{equation} \noindent where $t_m$ is the $m$-th time. \section{Performance Metrics} \label{sec:permetric} The proposed Brain-inspired TMM, suitable for cloud based IoT frameworks targeting Neuroscience applications, has been evaluated using Packet Forwarding Ratio (PFR) \cite{gopinath_energy_2015}; Network Throughput (NetT) \cite{Kaur_MANET_2015, Gupta_AODV_2013, Talreja_TVF_2016,dhananjayan_t2ar:_2016}; Average Energy Consumption Ratio (AECR) \cite{Ruan_TMF_2016}; Accuracy \cite{kaiser_neuro-fuzzy_2016}; and F-measure \cite{ghosh_novel_2014}. \paragraph{PFR.} The PFR is the ratio between a number of packets received by the IoT CPS and the number of packets transmitted by the source node. The PFR decreases when the forwarded packets are dropped due to reasons like-- buffer overflow, blocking, route failure. Mathematically, the E2E PFR is calculated by Equation \ref{eq:R1}. \begin{equation} \label{eq:R1} \textrm{PFR}=\frac{\sum_k PKT_{rec}}{\sum_n PKT_{send}}, \end{equation} where, $PKT_{rec}$ and $PKT_{send}$ are the number of packets received by the destination node and packets send by the source node. The source node sends $n$ number of packets and destination node receives $k$ number of packets, and $k<n$. \paragraph{NetT.} The NetT can be defined as the rate at which the source transmissions are delivered successfully to the destination over the link(s) between the source-destination pair. The value of the throughput declines with the appearance of misbehaving nodes in the network. Mathematically, the NetT is calculated by equation \ref{eq:R2}. \begin{equation} \label{eq:R2} \textrm{NetT}=\frac{N_{success}}{t_{trans}}, \end{equation} where, $N_{success}$ is the number of successful transmission delivered to the destination and $t_{trans}$ is the considered transmission interval. \paragraph{AECR.} The AECR is an another performance metric which is the ratio between the energy consumption for evaluating a trust metric ($E_{te}$) and the energy consumption for the data transmission (for sending ($E_{send}$) and for receiving ($E_{rec}$)) of a node. The AECR of a malicious node is lower than that of a legitimate node as a malicious node does not participate in the packet forwarding or route discovery. Mathematically, AECR is calculated by Equation \ref{eq:R3}. \begin{equation} \label{eq:R3} \textrm{AECR}=\frac{\sum_n E_{te}}{\sum_n(E_{rec}+E_{send})}. \end{equation} \paragraph{Accuracy.} Accuracy is the ratio between the numbers of total successful interactions and total interactions. Mathematically, accuracy $A$ is expressed by Equation \ref{eq:accuracy} \cite{gu_evaluation_2009}. \begin{equation} \label{eq:accuracy} A=\frac{TP+TN}{TP+FP+TN+FN}, \end{equation} \noindent where, $TP$ is the number of successful interactions categorized as successful, $TN$ is the number of successful interactions categorized as unsuccessful, $FP$ is the number of unsuccessful interactions categorized as successful, and $FN$ is the number of unsuccessful interactions categorized as unsuccessful. \paragraph{F-measure.} The Precision (=$TP/(TP+FP)$) as well as recall (=$TP/(TP+TN)$) are two important measures considered in evaluating a classification outcome \cite{ghosh_novel_2014}. It is calculated by the harmonic mean of both recall and precision, and mathematically it is expressed by Equation \ref{eq:fmeasure}. \begin{equation} \label{eq:fmeasure} \textrm{F-measure}=\frac{2}{1/recall+1/precision}. \end{equation} \section{Results} \label{sec:Results} To verify the efficacy of the proposed TMM, simulation was performed in the NS-2 platform \cite{issariyakul_ns2_2009}. The parameters and setting employed in this platform are listed in Table \ref{tab:sim}. The results were obtained by running the simulation for twenty times and then taking the average values of these twenty runs. It was assumed that the nodes had wireless capabilities and were communicating either directly or through multihop relay nodes to the IoT-CPS. The Adhoc On-demand Distance Vector (AODV) routing protocol \cite{andel_adaptive_2008} was employed to simulate the communication scenario. The IoT devices or relay nodes were categorized in two types-- legitimate node and malicious node. The legitimate nodes took part in the route discovery and packet forwarding process, whereas the malicious nodes in neither took part in packet forwarding nor in route discovery. The ANFIS based TMM was incorporated in the IoT-CPS network and all the nodes were initialized with random trust values. After a certain number of interactions the node behavior trust, and direct and indirect data trust were evaluated by the model. \begin{table}[!tbhp] \centering \caption{Parameters and settings used in simulation.} \label{tab:sim} \begin{tabular}{ll} \hline\noalign{\smallskip} Parameters & Numerical Value \\ \hline\noalign{\smallskip} Simulator & NS-2 \\ Routing & AODV \\ Node distribution & Random \\ Traffic & CBR \\ Nodes & 50 \\ MAC & 802.11 \\ Speed & 3 m/s \\ Packet size & 512 bytes \\ Range & 250 m \\ Max. Connection & 12 \\ Reply delay & 60 ms \\ \noalign{\smallskip}\hline \end{tabular} \end{table} The PFR dropped significantly when the malicious nodes arose in the IoT or user end. A node was termed malicious if it hid (H) in the route discovery phase or dropped (D) packets intentionally. Fig. \ref{fig:NFTM_PFR} depicts the effect of malicious nodes on the PFR. The PFR decreased as the percentage of malicious nodes increased from 10\% to 50\%. In both cases of malicious behavior, the proposed TMM outperformed TRM \cite{Chen2011TRMIoTAT}. In addition, in terms of PFR, both TMM and TRM achieved better performance compared to AODV with no trust management framework (indicated as `AODV'). \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig08_misbehav_pfr} \caption{The effect of malicious nodes on PFR.} \label{fig:NFTM_PFR} \end{figure} The malicious nodes changed the overall network throughput as illustrated in Fig. \ref{fig:sim_throughput}. When the number of malicious nodes were increased (10\% to 50\%) and the remaining nodes showed legitimate behavior, the throughput of the network decreased. The performance drop was due to the fact that the appearance of the malicious nodes dropped the packet forwarding in the network. The performance of the proposed TMM (AODV-TMM in Fig. \ref{fig:sim_throughput}) was compared with the trusted AODV (TAODV in Fig. \ref{fig:sim_throughput}) and AODV without trust (AODV in Fig. \ref{fig:sim_throughput}). The results showed that the proposed TMM outperforms the TAODV and AODV. \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig09_misbehav_thrput} \caption{The effect of malicious nodes on overall network performance.} \label{fig:sim_throughput} \end{figure} \begin{figure}[!bthp] \centering \includegraphics[scale=1]{Fig10_misbehav_aecr} \caption{The effect of malicious nodes on AECR.} \label{fig:sim_aecr} \end{figure} Additionally, the proposed TMM is more energy efficient (see Fig. \ref{fig:sim_aecr}). In comparison to the TRM, with the increasing number of malicious nodes (10\% to 50\%) present in the communication network, the proposed TMM consumes less energy during the data transmission process. The reduced AECR value, compared to the TRM, indicates that the proposed TMM is capable of identifying more malicious nodes in the communication network. Table \ref{tab:performance} shows that the proposed TMM has higher accuracy (0.967 in case 1, when 5 linguistic terms were used: \textit{Very Low}, \textit{Low}, \textit{Medium}, \textit{High}, and \textit{Very High}; and 0.957 in case 2, when 3 linguistic terms were used: \textit{Low}, \textit{Medium}, and \textit{High}) in comparison to a Fuzzy Inference System (FIS) which has an accuracy of 0.89. In addition, the F-measure of the proposed TMM (case 1: 0.97 and case 2: 0.96) also obtained higher values than FIS (0.90). \begin{table} \centering \caption{Performance comparison of three types of Trust management techniques} \label{tab:performance} \begin{tabular}{lcc} \hline\noalign{\smallskip} Technique & Accuracy& f-measure \\ \hline\noalign{\smallskip} ANFIS (Case 1) &0.967 &0.97\\ ANFIS (Case 2) &0.957 &0.96\\ FIS &0.89 &0.90 \\ \noalign{\smallskip}\hline \end{tabular} \end{table} \section{Conclusion and Future Work} \label{sec:Conclusion} With the unprecedented growth of Brain data and IoT, cloud based data analytics solutions are gaining popularity and now security is a big concern. This paper proposed a Brain-inspired TMM to secure data transmission and ensure data reliability for the cloud-based IoT architecture targeting Neuroscience applications. The TMM evaluates jointly node behavioral trust and data trust using an ANFIS based node behavioral model and a weighted-additive method, respectively. Based on the evaluated trust levels, the model constructs a list of trustworthy nodes. The performance of the proposed TMM was evaluated regarding PFR, throughput, AECR and accuracy. The NS2 simulation results show that the model performs better than FIS, NFTM and other TM algorithms. In the future, sophisticated optimization techniques along with Bayesian statistics, Deep Learning, and Reinforcement Learning based TMM will be used in ensuring security, reliability and accuracy of the ever growing cloud based IoT and Block Chain architectures. \ \\ \noindent \textbf{Acknowledgments:} The work was supported by ACS Lab (http://www.acslab.info). Also, the authors express their gratitudes to the members of the ACS Lab for proof-reading the manuscript. \noindent \textbf{Conflict of Interest Statement}: The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest. \noindent \textbf{Authors and Contributors}: This work was carried out in close collaboration between all co-authors. MM, MSK, MMR, MRA, and SAM first defined the research theme and contributed an early design of the system. MSK and AS further implemented and refined the system development. MM and MSK first drafted the paper and all authors edited the draft. All authors have contributed to, seen, and approved the final manuscript. \noindent \textbf{Ethical Approval}: This article does not contain any studies with human participants or animals performed by any of the authors. \noindent \textbf{Informed Consent}: As this article does not contain any studies with human participants or animals performed by any of the authors, the informed consent in not applicable. \bibliographystyle{vancouver}
\section{Introduction} Jets and outflows are ubiquitous in accreting black hole systems such as stellar mass black holes in X-ray binaries (XRBs), intermediate mass black holes (IMBHs) and super massive black holes (SMBHs), respectively. By now, observations as well as numerical simulations confirm the existence of jets and outflows from accreting black hole systems (Mirabel et al. 1992; Mirabel \& Rodriguez 1994; Mirabel \& Rodriguez 1998; Fender et al. 2009; Miller et al. 2012b; Yuan et al. 2012, 2015; Das et al. 2014; Okuda \& Das 2015; Mezcua et al. 2013, 2015; Fender \& Munoz-Darias 2016). As the black holes do not have any hard surfaces or boundaries, the outflows or jets must be emerged out from the accretion disc itself. Meanwhile, several observations confirm the existence of disk-jet connections in black hole systems (Feroci et al. 1999; Vadawale et al. 2001; Nandi et al. 2001; Gallo et al. 2003; Miller et al. 2012a; Miller-Jones et al. 2012; Corbel et al. 2013; Radhika \& Nandi 2014; Radhika et al. 2016a, Radhika et al. 2016b). It is well know that in an advective accretion disc around black hole, accreting matter must be transonic in nature in order to satisfy the inner boundary condition imposed by the black hole horizon. Moreover, during the course of accretion, rotating matter experiences centrifugal repulsion in the vicinity of the black hole. When repulsion become comparable against the attractive gravity force, accreting matter slows down and starts to pile up that eventually triggers the discontinuous transition of flow variables in the form of shock wave. As a result, a virtual barrier is formed around the black hole that effectively behaves like the boundary layer of the black hole and we call it as post-shock corona (hereafter PSC). Interestingly, the formation of PSC in an accretion flow is thermodynamically preferred as it possesses high entropy content (Becker \& Kazanas 2001). Following this idea, the existence of shock wave around the black holes and its physical implications have been studied by several group of authors (Fukue 1987; Chakrabarti 1989; Chakrabarti 1996b; Lu et al. 1999; Becker \& Kazanas 2001; Das et al. 2001a; Chakrabarti \& Das 2004; Fukumura \& Tsuruta 2004; Mondal \& Chakrabarti 2006; Das 2007; Das \& Chakrabarti 2008; Das et al. 2009; Das et al. 2010; Aktar et al. 2015; Sarkar \& Das 2016; Aktar et al. 2017). When the flow is being advected towards the black hole, a part of the infalling matter after being intercepted at PSC is deflected along the black hole rotation axis to form bipolar outflows (Das et al., 2014, and reference therein). In a theoretical attempt, Penrose (1969) and Blandford \& Znajek (1977) proposed that the powerful jets could be originated due to the spin of the black hole. But, conflicting claims are also reported in the literature afterwards. Steiner et al. (2013) and McClintock et al. (2014) observed a significant positive correlation between the jet power and spin of the black hole. On the other hand, Russel et al. (2013) and Fender \& Gallo (2014) claimed that there are no such correlation exist based on their observational studies. Recently, Aktar et al. (2015) calculated maximum outflow rates as a function of spin of the black hole and observed no such significant positive correlation between spin and maximum outflow rates based on their accretion-ejection model. Essentially, in the context of black hole system, the spin-jet correlation is not conclusive yet. With the above findings, in this work, we consider an accretion-ejection model around a rotating black hole and investigate the effect of viscous dissipation on the generation of mass outflow rates. Further, we employ our model calculation to obtain $\nu_{\rm QPO}$. We identify the maximum value of QPO frequency ($\nu^{\rm max}_{\rm QPO}$) and find that $\nu^{\rm max}_{\rm QPO}$ increases with the increase of black hole spin ($a_k$). Next, we put an effort to explain the origin of HFQPOs for the source GRO J1655-40. For the purpose of representation, we consider two HFQPOs, namely $\sim 300$ Hz and $\sim 450$ Hz that was observed in GRO J1655-40 and using our model calculation, we constrain the range of $a_k$ and $\alpha$ that successfully reproduces the above two HFQPOs for this black hole source. In Section 2, we present the governing equations for accretion and outflow. In section 3, we discuss the solution methodology. In section 4, we discuss the obtained results. In section 5, we make use of the observed HFQPOs in GRO J1655-40 source to constrain the spin of the black hole. Finally, in section 6, we present the conclusion of our work. \section{Governing equations for accretion and outflow} In this paper, we consider a disc-jet system around a rotating black hole. The accretion disc lies along the equatorial plane and the jet geometry is considered in the off-equatorial plane about the axis of rotation of the black hole (Molteni et al. 1996a, Aktar et al. 2015, Aktar et al. 2017). Further, we consider a steady, geometrically thin, axisymmetric, viscous accretion flow around rotating black hole. We adopt pseudo-Kerr potential of Chakrabarti \& Mondal (2006) to mimic the space-time geometry around black hole. Here, we assume the unit system as $G=M_{BH}=c=1$ to represent the flow variables, where, $G$, $M_{BH}$ and $c$ are the gravitational constant, mass of the black hole and speed of light, respectively. \subsection{Equations for Accretion} The equations for accretion are given by,\\ (i) The radial momentum equation: $$ v\frac{dv}{dx} + \frac{1}{\rho}\frac{dP}{dx} + \frac{d\Phi_{eff}}{dx} =0 , \eqno(1) $$ where, $v$, $P$, $\rho$ and $x$ are the speed of matter, gas pressure, density and radial distance of the accretion flow, respectively. Here, $\Phi_{eff}$ is the effective potential around black hole. This potential mimic the Kerr geometry quite satisfactorily within the range of $-1\leq a_k\leq0.8$ (Chakrabarti \& Mondal 2006). (ii) The mass conservation equation: $$ \dot{M}=4 \pi \rho v x h , \eqno(2) $$ where, ${\dot M}$ denotes the mass accretion rate which is constant throughout the flow except at the region of mass loss. Here, $4\pi$ is the geometric constant. We calculate the half-thickness of the disc $h(x)$ considering the hydrostatic equilibrium in the vertical direction and is given by, $$ h(x)=a\sqrt{\frac{x}{\gamma \Phi_{r}^{\prime}}}, \eqno(3) $$ where, $a$ is the adiabatic sound speed defined as $a=\sqrt{\frac{\gamma P} {\rho}}$ and $\gamma$ is the adiabatic index. Here, $\Phi_{r}^{\prime}=\left( \frac{\partial \Phi_{eff}}{\partial r}\right)_{z<<x}$, and $z$ is the vertical height in the cylindrical coordinate system where $r = \sqrt{x^2 + z^2}$. (iii) The angular momentum distribution equation: $$ v\frac{d\lambda}{dx} + \frac{1}{\Sigma x}\frac{d}{dx}(x^2 W_{x\phi}) =0. \eqno(4) $$ where, $W_{x\phi}$ is the viscous stress which is dominated by the $x\phi$ component. The viscous stress $W_{x\phi}$ is modeled according to Chakrabarti (1996a) as, $$ W_{x\phi} = -\alpha (W + \Sigma v^2), \eqno(5) $$ where, $W = 2I_{n+1}Ph(x)$ and $\Sigma = 2 I_n \rho h(x)$ are the vertically integrated pressure and density (Matsumoto et al. 1984). Here, $I_n$ and $I_{n+1}$ are the vertical integration constants. And finally, (iv) The entropy generation equation: $$ \Sigma v T \frac{ds}{dx} = Q^{+} - Q^{-}, \eqno(6) $$ where, $T$, and $s$ are the temperature and entropy density of the accretion flow, respectively. $Q^{+}$ and $Q^{-}$ are the heat gain and lost by the flow, respectively. In the subsequent sections, we set $Q^{-} = 0$ as we ignore the cooling effect in this work. Following the prescription described in Aktar et al. 2017, we solve equations (1-6) in order to obtain the global transonic accretion solutions around black holes. \subsection{Equations for Outflow} Already, we mentioned that the accretion flow geometry is confined in the equatorial plane and the jet or outflow geometry is described in the off-equatorial plane about the axis of rotation of black hole. As the jets are tenuous in nature, the differential rotation of the outflowing matter is negligibly small. Thus, we ignore the viscous dissipation in the outflow calculation. Also, we consider the outflowing matter obey the polytropic equation of state as $P_j=K_j \rho_j^\gamma$, where, the suffix `$j$' denotes the outflow variables and $K_j$ is the measure of specific entropy of the jet. The equations of motion of the outflowing matter are given by, (i) The energy conservation equation of outflow: $$ \mathcal{E}_{j}=\frac{1}{2}v_j^2+\frac{a_j^2}{\gamma -1 }+\Phi_{eff}, \eqno(7) $$ where, $\mathcal{E}_{j}$ ($\equiv {\mathcal E}$) represent the specific energy of the outflow, $v_j$ is the outflow velocity and $a_j$ is the sound speed of the outflow, respectively. (ii) Mass conservation equation of outflow: $$ {\dot{M}_{out}}=\rho_{j}v_{j}\mathcal{A}_j, \eqno(8) $$ where, $\mathcal{A}_j$ represents the total area function of the jet. The jet area function $\mathcal{A}_j$ can be calculated by knowing the radius of two boundary surfaces, namely the centrifugal barrier (CB) and the funnel wall (FW). The centrifugal barrier (CB) is obtained by defining the pressure maxima surface as $(d \Phi^{eff}/dx)_{r_{CB}}=0$ and the funnel wall (FW) is the pressure minimum surface which is defined by the null effective potential as $\Phi^{eff}\vert_{r_{FW}} =0$. We use the jet area function considering the projection effect similar as Aktar et al. (2017). \section{Solution Methodology} In our model, the outflowing matter emerges out between the centrifugal barrier (CB) and funnel wall (FW) surfaces due to the excess thermal gradient force at the shock. Therefore, we focus only on the accretion solutions which satisfy Rankine-Hugoniot (hereafter RH) shock conditions. The local specific energy of the accretion flow is calculated by integrating the equation (1) as, $\mathcal{E}(x) = v^2/2 + a^2/(\gamma -1) +\Phi_{eff}$. While doing this, we consider the shock to be thin and non-dissipative. With this, we therefore have the shock conditions which are given by, (i) the conservation of energy flux: $$ \mathcal{E_{+}} = \mathcal{E_{-}}, \eqno(9a) $$ The quantities with subscripts `$+$' and `$-$' sign indicate the value of the variables after and before the shock, respectively. (ii) the conservation of mass flux: $$ \dot{M}_{+} = \dot{M}_{-} - \dot{M}_{out}=\dot{M}_{-}(1 - R_{\dot{m}}), \eqno(9b) $$ where, $\dot{M}_{-}$, and $\dot{M}_{+}$ are the pre-shock, post-shock mass accretion rate. $\dot{M}_{out}$ is the outflowing mass rate, where mass outflow rate is defined as $R_{\dot{m}} =\dot{M}_{out}/\dot{M}_{-}$. (iii) the conservation of momentum flux: $$ W_{+} + \Sigma_{+} v_{+}^2 = W_{-} + \Sigma_{-} v_{-}^2. \eqno(9c) $$ Now, as the inflow and outflow variables are coupled by the shock conditions, we solve accretion and outflow equations simultaneously (Aktar et al, 2017). Since outflowing matter emerges from the post-shock region (PSC), we assume that the jet launches with the same density as the density of the post-shock matter i.e., $\rho_{j}=\rho_{+}$. The mass outflow rates is calculated in terms of inflow and outflow properties at the shock using equations (2) and (8) and is given by, $$ R_{\dot{m}}=\frac{\dot{M}_{out}}{\dot{M}_{-}} =\frac{Rv_j(x_s)\mathcal{A}_j(x_s)}{4\pi \sqrt{\frac{1} {\gamma}} x_s^{3/2}{\Phi_{r}^{\prime}}^{-1/2} a_+ v_-} , \eqno(10) $$ where, $R=\Sigma_+/\Sigma_-$, is the compression ratio, $v_j(x_s)$ and $\mathcal{A}_j(x_s)$ are the jet velocity and jet area function at the shock, respectively. Here, we use iterative method to calculate $R_{\dot{m}}$ self-consistently similar as Aktar et al. (2017). \section{Results} In this section, we present the results based on our model calculations. More precisely, we discuss the effect of viscosity on mass loss around rotating black hole. In this paper, we ignore the cooling effect. We also calculate the maximum QPO frequency based on our model. The adiabatic index $\gamma$ lies in the range 4/3 $ \le$ $\gamma$ $\le$ 5/3 as far as theoretical limit is concerned. In this work, we use $\gamma =1.4$ throughout our calculation. \subsection{Effect of viscosity on mass loss} In Figure \ref{fig One}, we present the effect of viscosity parameter on inflow-outflow solutions around rotating black holes. Here, we fix the injection radius at $x_{inj}=500$ and the corresponding flow energy and flow angular momentum are $(\mathcal{E}_{inj}, \lambda_{inj})$= (0.002, 2.95) at the injection radius, respectively. We vary the spin $(a_k)$ of the black hole from 0.36 to 0.52 from left most to the right most curves with an interval of $\Delta a_k = 0.04$. We observe that the shock location $(x_s)$ moves towards the black hole horizon with the increase of viscosity parameter $\alpha$ in presence of mass loss, depicted in Figure 1a. Viscosity transports the angular momentum outward from the PSC, as a result, the centrifugal barrier weakens and this triggers the shock to move inward towards the black hole horizon. This also indicates that the effective area of PSC decreases with the increase of viscosity parameter $\alpha$. As a results, the amount of inflowing matter intercepted by the PSC is reduced and eventually, the outflow rate is also decreased with the increase of viscosity parameter. This is in agreement with the results reported by Chattopadhyay \& Das (2007). The variation of outflow rates $(R_{\dot{m}})$ is plotted in terms of viscosity parameter ($\alpha$) in Figure 1b corresponding to Figure 1a. Compression ratio indicates that how much the flow is compressed across the shock and it is measured by the ratio of post-shock density to the pre-shock density. The corresponding compression ratio $(R)$ is presented in Figure 1c. The compression ratio increases with the increase of viscosity because the shock forms closer to the black hole. In the same context, we show the effect of spin of the black hole on the shock properties and outflow rates in the viscous accretion flow in Figure \ref{fig Two}. Here, we fix the outer boundary at $x_{inj} = 500$ and flow energy and flow angular momentum $ (\mathcal{E}_{inj}, \lambda_{inj})$ = (0.0015, 2.85), respectively. We observe that the shock locations recede away from the black hole horizon with the increase of black hole spin $a_k$ for fixed viscosity parameter $\alpha$. As a consequence, the effective area of PSC also increases with the rotation of black hole. So, the amount of inflowing matter deflected by the PSC is also increased and ultimately, it increases the outflow rates with the spin of the black hole. But, for a fixed spin value, the outflow rates decreases with the increase of viscosity parameter similar to Figure 1b. On the other hand, the compression ratio decreases with the increase of spin of black hole. The variation of shock location $(x_s)$, outflow rates $(R_{\dot{m}})$ and compression ratio $(R)$ are shown in Figure 2(abc), respectively. All these findings are in agreement with the result of Aktar et al. (2015) in the context of inviscid accretion flow. \begin{figure}[!t] \includegraphics[width=0.95\columnwidth]{fig1.eps} \caption{Variation of $(a)$ shock location $(x_s)$, $(b)$ outflow rates $(R_{\dot{m}})$ and $(c)$ compression ratio $(R)$ as a function of viscosity parameter $\alpha$. Here, we vary spin $a_k$ = 0.36 to 0.52, with an interval $\Delta a_k=0.04$ from left most to right most curve.} \label{fig One} \end{figure} \begin{figure}[!t] \includegraphics[width=.95\columnwidth]{fig2.eps} \caption{Variation of $(a)$ shock location $(x_s)$, $(b)$ outflow rates $(R_{\dot{m}})$ and $(c)$ compression ratio $(R)$ as a function of spin of the black hole $a_k$. Here, we vary the viscosity parameter $\alpha$ = 0.001 to 0.009, with an interval $\Delta \alpha =0.002$ from left most to right most curve.} \label{fig Two} \end{figure} \begin{figure}[!t] \includegraphics[width=.95\columnwidth]{fig3.eps} \caption{Variation of maximum QPO frequency $(\nu_{QPO}^{max})$ for generalized black hole mass $(M_{BH})$ as a function of spin $a_k$. Solid, dotted and dashed curves represent $\alpha = 0.01$ (black), 0.05 (red) and 0.1 (blue), respectively. The shaded region represents the results beyond $a_k > 0.8$.} \label{fig Three} \end{figure} \subsection{Estimation of QPO frequency} Recent numerical simulation work of Das et al. (2014) reveals the fact that when viscosity parameter exceeds its critical limit, standing shock solution disappears and PSC exhibits quasi-periodic oscillation. In addition, Okuda \& Das (2015) showed the unstable nature of the inner part of the advective accretion disk for low angular momentum flow around black holes. Motivating with this, in the present work, we calculate the QPO frequency considering the accretion-ejection model of viscous advective accretion flow around rotating black hole. Here, we estimate the infall time from the post-shock velocity profile as $t_{infall}=\int{dt} =\int_{x_s}^{x_{in}}\frac{dx}{v(x)}$, where $v(x)$ is the post-shock velocity. For this calculation, the integration is carried out from the shock location to the inner sonic point as the distance between the inner sonic point to the event horizon is negligibly small. Now, we estimate the QPO frequency from the infall time as $\nu_{QPO}\sim 1/t_{infall}$ in units of $r_g/c$ (Molteni et al. 1996b), where $r_g=GM_{BH}/c^2$. The unit of QPO frequency is converted into Hertz by multiplying with $c/r_g$. We vary all the flow parameters freely to calculate the QPO frequency scaled with black hole mass ($\nu_{QPO}/M_{BH}$~{\rm Hz} $M^{-1}_{\odot}$) and then identify the maximum QPO frequency ($\nu_{QPO}^{max}/M_{BH}$~{\rm Hz} $M^{-1}_{\odot}$) for a given $a_k$. Here $M_{BH}$ denotes the black hole mass measured in units of solar mass ($M_{\odot}$). In this analysis, we notice that shocks corresponding to $\nu_{QPO}^{max}$ usually form very close to the black hole but not necessarily its closest position. In Figure 3, we plot $\nu_{QPO}^{max}/M_{BH}$ as function of $a_k$ where filled circles connected with solid, dotted and dashed curves are for viscosity $\alpha=0.01$ (black), $\alpha=0.05$ (red) and $\alpha=0.1$, respectively. This maximum QPO frequency calculation is more general in the sense that it is independent of black hole mass. \section{HFQPOs and Spin of BH sources - Application to GRO J1655-40} Several attempts have been made to constrain the spin (Shafee et al. 2006; Miller et al. 2009) using the characteristics of the HFQPOs (Wagoner et al. 2001; Abramowicz et al. 2001) observed in Galactic black hole sources (Remillard et al., 1999; Strohmayer, 2001; Belloni et al., 2012). In our earlier paper, we attempted to constrain the spin of GRO J1655-40 using the observed maximum QPO frequency ($\sim$ 450 Hz). Based on our accretion-ejection formalism (see Aktar et al. 2017 for details), we further attempt to constrain the spin of GRO J1655-40 using both HFQPOs ($\sim$ 300 Hz and $\sim$ 450 Hz) observed in this source. \subsection{Observation and Data Reduction} The Galactic black hole source GRO J1655-40 has two characteristic HFQPOs observed at $\sim$ 300 Hz and $\sim$ 450 Hz in the power spectrum. There have been several detections of the 300 Hz HFQPOs during the 1996 outburst of the source. The detection of 300 Hz HFQPOs (Remillard et al., 1999, Belloni et al., 2012) is not so significant, whereas the detection of 450 Hz HFQPO (Strohmayer, 2001, Belloni et al., 2012) is prominent and significant (see also Aktar et al. 2017). For our specific purpose, we re-analysed the archival RXTE data for both HFQPOs ($\sim$ 300 Hz and $\sim$ 450 Hz). We use two RXTE observations which was carried out on 01 August, 1996 (ObsID: 10255-01-04-00) and on 09 September, 1996 (ObsID: 10255-01-10-00) for the detection of HFQPOs at $\sim$ 300 Hz and $\sim$ 450 Hz respectively. For both observations, light curves were generated with a time resolution of 0.00048828125 sec with Nyquist frequency of 1024 Hz in the energy band of 2-12 keV, 13-27 keV and 2-27 keV. We extract light curve from science array data (exposure of $\sim$ 9 ksec) for the observation on 01 August, 1996 and from science event data (exposure of $\sim$ 8 ksec) for the observation on 09 September, 1996 based on required time resolution and energy ranges. Further, we follow the standard procedures (see Nandi et al. 2012; Radhika et al. 2016a) to extract the energy spectrum in the energy range of $3 - 150$ keV using both PCA ($3-30$ keV) and HEXTE ($25-150$ keV) data of RXTE observations. \subsection{Analysis and Modelling} We compute the power spectra for both observations in the range 20 Hz to 1024 Hz with 8192 newbins per frame and with a geometrical binning factor of -1.02. The 300 Hz QPO was detected only in the energy range 2-12 keV while the 450 Hz HFQPO was observed in the energy range 13-27 keV. The power spectra are modeled with a \textit{lorentzian} and \textit{powerlaw} components for QPO like feature and continuum in the lower frequency range respectively. Figure \ref{fig Four} shows the simultaneous plot of both HFQPOs observed in GRO J1655-40 during 1996 outburst. The $\sim 300$ Hz HFQPO has centroid frequency at $275\pm 9$ Hz (see Figure 4) with an FWHM of 71.7 Hz. The detection of broad feature has a significance of $\sim$ 4.17 and a Q-factor of $\sim$ 3.84. Power spectrum also shows two more QPO like feature at around 57 Hz and 80 Hz. The highest observed HFQPO (see Figure 4) was found at a central frequency of 444.8 Hz with an FWHM of 32.4 Hz, a significance of 2.79 and a Q-factor of 13.72. Both HFQPOs plotted in Figure 4 is in {\it Leahy Power} - {\it Frequency} space (Leahy et al. 1983). \begin{figure}[!t] \includegraphics[width=1.05\columnwidth]{fig4.eps} \caption{Power spectra corresponding to the $\sim$ 300 Hz and $\sim$ 450 Hz HFQPOs of GRO J1655-40 during its 1996 outburst are shown in {\it Lehay Power} - {\it Frequency} space. The QPO like features are modelled with \textit{lorentzians}. Detection of HFQPOs at $\sim$ 300 Hz and $\sim$ 450 Hz are marked in the plot.} \label{fig Four} \end{figure} In Figure \ref{fig Five}, we plot the combined broadband energy spectra of both observations in the energy range of 3 - 150 keV. We modelled the energy spectra with phenomenological models consisting of \textit{diskbb} and a \textit{powerlaw} components along with \textit{phabs} model to consider the equivalent hydrogen column density ($nH \sim 0.7 \times 10^{22}$ atoms ${\rm cm}^{-2}$) in the line-of-sight towards the source. The energy spectrum of $\sim$ 300 Hz observation (01 August, 1996) was modelled with a steep \textit{powerlaw} component (photon index, $\Gamma=$ 2.80) in the energy range of $3-150$ keV. A very weak signature of thermal emission is observed at low energies. Additionally, a smeared edge at $\sim$ 8 keV was required for fitting the spectrum. On the other hand, the energy spectrum of 450 Hz QPO (09 September, 1996) was modelled with a strong disk component (see Figure 5) of disk temperature of $\sim$ 1.3 keV and with considerably steeper powerlaw ($\Gamma=$ 2.43) at higher energy. This also clearly indicates that the disk has proceeded towards the black hole horizon with a smaller size of PSC for 450 Hz QPO compared to the 300 Hz QPO. \begin{figure}[!t] \includegraphics[angle = 270, width=0.48\textwidth]{fig5.eps} \caption{Broadband energy spectra (3-150 keV) using PCA and HEXTE data corresponding to the $\sim$ 300 Hz and $\sim$ 450 Hz HFQPOs are observed during 1996 outburst of GRO J1665-40. Both energy spectra show strong high energy emission with steep powerlaw component. Interestingly, the energy spectrum of 300 Hz observation shows very weak signature of thermal emission, whereas thermal emission is strong in the energy spectrum of 450 Hz observation. See text for details.} \label{fig Five} \end{figure} \begin{figure}[!t] \includegraphics[width=.95\columnwidth]{fig6.eps} \caption{Ranges of viscosity parameter $(\alpha)$ and black hole spin $(a_k)$ that provide HFQPOs $\nu_{QPO}$ $\sim$ 300 Hz and $\sim$ 450 Hz observed in GRO J1655-40.}\label{fig Six} \end{figure} Following the prescription of Aktar et al. 2017, we identify the parameter spaces spanned by the black hole spin ($a_k$) and viscosity ($\alpha$) that successfully reproduce the HFQPOs ($\sim$ 300 Hz and $\sim$ 450 Hz) observed for the black hole source GRO J1655-40. While doing so, we vary all the remaining flow variables freely and consider the mass of GRO J1655-40 as $6 M_{\odot} $ (Green et al. 2001; Beer \& Podsiadlowski 2002). In Figure 6, the region shaded with solid and dotted lines denote the parameter space corresponding to $\sim 300$ Hz and $\sim 450$ Hz. The latter result is recently reported by Aktar et al, 2017, where authors constrained the spin of GRO J1655-40 and found the minimum value $a_k^{\rm min} \sim 0.57$ as indicated by the dashed vertical (red) line with downward arrow at the top. The viscosity associated with $a_k^{\rm min}$ is obtained as $\alpha \sim 0$. Since black hole spin is not expected to evolve noticeably within the couple of weeks or so, it is reasonable to adhere the above spin range and calculate the range of viscosity as function of $a_k$ that provides $\sim 300$ Hz QPOs. We find that viscosity spreads over a wide range for all $a_k$ and in particular, we obtain $0 \le \alpha <0.04$ for $a_k^{\rm min} \sim 0.57$. When the apriori restriction on $a_k$ is removed, we find the spin ranges for $\sim 300$ Hz QPO is $a_k$ $\ge 0.26$ which is in agreement with the results reported by Abramowicz \& Kluz\'niak 2001; Motta et al. 2014; Stuchl\`ik \& Kolo\`s 2016. Since there exists a common overlapping region in the $a_k - \alpha$ plane, we argue that the spin of the black hole source GRO J1655-40 seems to be $a_k \ge 0.57$. \section{Conclusions} We self-consistently solve the accretion-ejection hydrodynamic equations around rotating black holes by using the inflow parameters and subsequently calculate the mass outflow rates. We observe that viscosity plays an important role in deciding the mass loss from the advective accretion disk. As the viscous dissipation is increased, shock location (equivalently size of PSC) as well as mass outflow rate are decreased for a given spin value. Since PSC is hot and dense, hard radiations are likely to emerge out from PSC. This essentially indicates that the dynamics of PSC manifests both the mass outflow rates and spectro-temporal properties of the black hole. Next, we explore the characteristics of HFQPOs ($\sim$ 300 Hz and $\sim$ 450 Hz) and corresponding broadband energy spectra of the source GRO J1655-40. We find that the low energy photons ($2-12$ keV) contribute to generate the $\sim 300$ Hz QPO, whereas $\sim 450$ Hz QPO has been observed in the higher energy band of $13-27$ keV. Moreover, the energy spectrum of $\sim 300$ Hz QPO does not show any prominent signature of disk emission, although the disk contribution (thermal emission) is significant in the spectrum (upto $15$ keV) containing $\sim 450$ Hz QPO. It has also been observed that both the energy spectra are dominated by steep {\it powerlaw} components ($\Gamma= 2.80$ and $2.43$ for $\sim 300$ Hz and $\sim 450$ Hz, respectively) up to the high energies ($\sim 150$ keV). The spectro-temporal analysis indicates that the origin of HFQPOs in GRO J1655-40 probably may not be coupled with disk emission ($i. e.$, independent of disk flux). Rather, it is possible that a strong source might be present in the system, which produces not only the high energy photons, but also responsible for HFQPOs observed in this source. Based on the above discussion, it is quite indicative that PSC behaves like the strong source that inverse-comptonizes the significant fraction of the soft photons originated from the disk and produces the high energy emission with steep power-law index. Moreover, when PSC forms close to black hole and exhibits modulation, it gives rise to HFQPOs which we observe for GRO J1655-40. This apparently provides an indication that the origin of HFQPOs in black hole systems could be explained using the method of shock dynamics without invoking the prescription of orbital frequency associated with inner most stable circular orbit (Strohmayer, 2001). Further, we discuss the limiting range of the spin parameter of GRO J1655-40 based on the observed HFQPOs. \section*{Acknowledgement} Authors thank the reviewer for useful comments and suggestions. AN thanks GD, SAG; DD, PDMSA and Director, ISAC for encouragement and continuous support to carry out this research. This research has made use of the data obtained through High Energy Astrophysics Science Archive Research Center online service, provided by NASA/Goddard Space Flight Center.
\section{Introduction}\label{sect:Intro} On s'int\'eresse dans cet article \`a l'\'etude des cycles alg\'ebriques des hypersurfaces cubiques (lisses) de dimension 5 d\'efinie sur le corps $\mbb{C}$ des nombres complexes. L'objet central est leurs \emph{anneaux de Chow}, qui consistent en des combinaisons lin\'eaires formelles de sous-sch\'emas ferm\'es int\`egres modulo l'\'equivalence rationnelle, munis d'un produit d'intersection bien d\'efini \cite{MR1644323}. Soit $X\subset \mbb{P}_{\mbb{C}}^{6}$ une telle hypersurface. Ses groupes de Chow sont bien compris sauf en codimension 3\,: \begin{itemize} \item $\CH^{0}(X)\cong \mbb{Z}$, engendr\'e par la classe fondamentale de $X$. \item $\CH^{1}(X)\cong \mbb{Z}$, engendr\'e par la classe de section hyperplane $h:=c_{1}\left(\mathcal{O}_{X}(1)\right)$, gr\^ace au th\'eor\`eme classique de Lefschetz sur les sections hyperplanes. \item $\CH^{2}(X)\cong \mbb{Z}$, engendr\'e par $h^{2}$. Ceci r\'esulte de la d\'ecomposition de la diagonale de Bloch--Srinivas \cite{MR714776}. Donnons quelques d\'etails\,: $X$ \'etant rationnellement connexe, Th\'eor\`eme 1 \emph{loc.~cit.}~implique que $\CH^{2}(X)_{\hom}=\CH^{2}(X)_{\alg}$ et que le dernier est faiblement repr\'esentable. Comme $H^{3}(X, \mbb{Z})$ est nul, par \cite[Theorem 1.9]{MR805336}, le repr\'esentant alg\'ebrique de $\CH^{2}(X)_{\alg}$ est z\'ero. Par cons\'equent, $\CH^{2}(X)$ est isomorphe \`a son image par l'application classe de cycle. \item $\CH^{4}(X)\cong \mbb{Z}$, engendr\'e par la classe d'une droite projective contenue dans $X$. D'une part, par \cite{MR1283872}, le groupe de Chow des courbes de $X$ est engendr\'e par les droites\,; d'autre part, toutes les droites sont rationnellement \'equivalentes car la vari\'et\'e de Fano des droites de $X$ est de Fano et donc rationnellement connexe. \item $\CH^{5}(X)\cong \mbb{Z}$, engendr\'e par la classe d'un point de $X$, car $X$ est unirationnelle.\end{itemize} Dans le travail pr\'esent, on compl\`ete la liste ci-dessus par le calcul de $\CH^{3}(X)$. Rappelons que l'on dispose d'une filtration $$\CH^{3}(X)\supset \CH^{3}(X)_{\ho}\supset \CH^{3}(X)_{\alg}\supset 0$$ par les sous-groupes des cycles alg\'ebriques \emph{homologiquement, resp. alg\'ebriquement} triviaux (\emph{cf.} \cite{MR2115000}). Regardons les trois gradu\'es associ\'es \`a cette filtration\,: \begin{itemize} \item Le quotient $\CH^{3}(X)/\CH^{3}(X)_{\ho}$ est isomorphe, \emph{via} l'application classe, \`a $H^{6}(X,\mbb{Z})\cong \mbb{Z}$, qui est engendr\'e par la classe d'un plan projectif contenu dans $X$. \item Le quotient $\CH^{3}(X)_{\ho}/\CH^{3}(X)_{\alg}$ est par d\'efinition le troisi\`eme \emph{groupe de Griffiths} \cite[\S 20.3]{MR1988456}, not\'e $\Griff^{3}(X)$. \item Pour comprendre $\CH^{3}(X)_{\alg}$, on consid\`ere l'application d'Abel--Jacobi (\emph{cf.} \cite[\S 12.1]{MR1988456})$$\Phi\colon\CH^{3}(X)_{\alg}\to J^{5}(X),$$ o\`u $J^{5}(X):=\frac{H^5(X, \mbb{C})}{F^3H^{5}(X)\oplus H^5(X, \mbb{Z})}$ est la \emph{jacobienne interm\'ediaire} de $X$, qui est une vari\'et\'e ab\'elienne principalement polaris\'ee de dimension 21. \end{itemize} \bigskip Notre r\'esultat principal est d'identifier les deux derniers gradu\'es et de calculer le groupe $\CH^{3}(X)$\,: \begin{thm}\label{main} Soit $X$ une hypersurface cubique lisse de dimension $5$ d\'efinie sur le corps des nombres complexes $\mbb{C}$. Alors \begin{enumerate} \item $\Griff^3(X)=0$, i.e. $\CH^{3}(X)_{\ho}=\CH^{3}(X)_{\alg}$. \item L'application d'Abel--Jacobi induit un isomorphisme $\Phi\colon\CH^3(X)_{\alg} \xrightarrow{\cong} J^5(X)(\mbb{C})$. \end{enumerate} Par cons\'equent, on a une suite exacte courte scind\'ee \begin{equation*} 0\to J^{5}(X)(\mbb{C})\xrightarrow{\Phi^{-1}} \CH^{3}(X)\xrightarrow{\cl} \mbb{Z}\to 0, \end{equation*} dont un scindage est fourni par la classe d'un plan projectif contenu dans $X$. \end{thm} Ren\'e Mboro \cite[Proposition 0.1 et Theorem 0.9]{mboro2017cubic} avait d\'ej\`a \'etabli que le noyau de $\Phi$ est annul\'e par 18. \begin{rem} La partie (1) du th\'eor\`eme \ref{main} est l'analogue du th\'eor\`eme de Bloch--Srinivas \cite[Theorem 1 (ii)]{MR714776} qui dit que pour une vari\'et\'e projective lisse complexe, si le groupe $\CH_{0}$ est support\'e sur un sous-ensemble alg\'ebrique de dimension 2, alors le deuxi\`eme groupe de Griffiths s'annule. La partie (2) du th\'eor\`eme \ref{main} est l'analogue du th\'eor\`eme de Murre \cite{MR805336} (annonc\'e dans \cite{MR777590}), bas\'e sur les r\'esultats de Merkurjev--Suslin en K-th\'eorie \cite{MR675529} et Bloch--Ogus sur la conjecture de Gersten \cite{MR0412191}, qui dit que pour une vari\'et\'e projective lisse complexe, si le groupe $\CH_{0}$ est support\'e sur un sous-ensemble alg\'ebrique de dimension 1, alors le groupe de Chow des cycles de codimension 2 alg\'ebriquement triviaux est isomorphe, par l'application d'Abel--Jacobi, \`a la jacobienne interm\'ediaire en degr\'e 3. On remarque aussi que le r\'esultat ci-dessus pour $\CH^{3}(X)$ est compatible, en ignorant sa torsion, avec la conjecture de Bloch--Beilinson--Murre (\emph{cf.} \cite{Murre}, \cite[\S 23.2]{MR1988456}, \cite[\S 11.2]{MR2115000}), car les structures de Hodge $H^{i}(X, \mbb{Q})$, pour $3\leq i\leq 6$, sont de coniveau de Hodge $\geq 2$. \end{rem} \bigskip Un outil important utils\'e dans la preuve du th\'eor\`eme \ref{main} est la \emph{cohomologie non ramifi\'ee} (\emph{cf.} \S \ref{sect:Hnr}), qui est un invariant birationnel pour les vari\'et\'es projectives lisses. Avec l'int\'er\^et potentiel pour le probl\`eme de rationalit\'e des hypersurfaces cubiques de dimension 5, on peut se demander si les groupes de cohomologie non ramifi\'ee fournissent une vraie obstruction dans cette situation. Malheureusement, le r\'esultat suivant, qui est probablement connu par les experts, montre que toutes ces obstructions s'annulent\footnote{ On ignore aussi s'il existe une hypersurface cubique lisse de dimension 5 rationnelle.}. Pour un groupe ab\'elien $A$, notons par $\HH^{i}(A)$ le faisceau pour la topologie de Zariski associ\'e au pr\'efaisceau $U\mapsto H^{i}(U, A)$, o\`u l'ouvert de Zariski $U$ est munie de la topologique classique et $H^{i}(-, A)$ est la cohomologie singuli\`ere \`a coefficients dans $A$. \begin{thm}\label{main2} Soit $X$ une hypersurface cubique lisse de dimension 5 d\'efinie sur $\mbb{C}$. Alors \begin{enumerate} \item \begin{equation*} H^{p}\left(X_{\Zar}, \HH^{q}(\mbb{Z})\right)\cong \begin{cases} H^{2p}(X, \mbb{Z})\simeq \mbb{Z} & \text{ si } 0\leq p=q\leq 5\\ H^{5}(X, \mbb{Z}) \simeq \mbb{Z}^{\oplus 42} & \text{ si } p=2 \text{ et } q=3\\ 0 & \text{ sinon.} \end{cases} \end{equation*} \item De mani\`ere similaire, \begin{equation*} H^{p}\left(X_{\Zar}, \HH^{q}(\mbb{Q}/\mbb{Z})\right)\cong \begin{cases} H^{2p}(X, \mbb{Q}/\mbb{Z})\simeq \mbb{Q}/\mbb{Z} & \text{ si } 0\leq p=q\leq 5\\ H^{5}(X, \mbb{Q}/\mbb{Z}) \simeq (\mbb{Q}/\mbb{Z})^{\oplus 42} & \text{ si } p=2 \text{ et } q=3\\ 0 & \text{ sinon.} \end{cases} \end{equation*} En particulier, $H^{i}_{\nr}(X, \mbb{Q}/\mbb{Z}):=\bigcup_{n\in \mbb{N}^{*}} H^{i}_{\nr}(X, \mbb{Z}/n)=0$ pour tout $i>0$. \item La suite spectrale de coniveau $$E_{1}^{p,q}=\bigoplus_{Y\in X^{(p)}}H^{q-p}\left(\mbb{C}(Y), \mbb{Z}(-p)\right)\Longrightarrow H^{p+q}(X, \mbb{Z})$$ est d\'eg\'en\'er\'ee en $E_{2}$ avec le terme $E_{2}^{p,q}=E^{p,q}_{\infty}=H^{p}\left(X_{\Zar}, \HH^{q}(\mbb{Z})\right)$, pr\'ecis\'e dans (1). \end{enumerate} \end{thm} La valeur de la plupart des groupes de cohomologie dans le th\'eor\`eme \ref{main2} \'etait connue (\emph{cf.} \cite{CTVoisin2012IHC}). L'ingr\'edient le plus important, en plus de \cite{MR0412191} et \cite{CTVoisin2012IHC}, pour avoir le r\'esultat complet ci-dessus est l'annulation de $H^{4}_{\nr}(X, \mbb{Q}/\mbb{Z})$, qui r\'esultera directement du travail de Kahn--Sujatha \cite{kahn2001unramifiedquadric2}, \emph{cf.} \cite[P.4]{mboro2017cubic} et Lemme \ref{nr4} pour les d\'etails. Ceci r\'epond une question de Voisin \cite[P.144, Question 11.2]{MR3586396}. Certains de nos arguments sont inspir\'es de \cite{MR2987669} et \cite{CTVoisin2012IHC}. \begin{rem} Les annulations de cohomologie non ramifi\'ee dans le th\'eor\`eme \ref{main2} laissent ouverte la question de savoir si $H^{i}_{\nr}(X, \mbb{Q}/\mbb{Z})$ est \emph{universellement trivial}, \emph{i.e.} si la fl\`eche $$H^{i}(K, \mbb{Q}/\mbb{Z})\to H^{i}_{\nr}(X_{K}/K, \mbb{Q}/\mbb{Z})$$ est un isomorphisme pour toute extension du corps $K/\mbb{C}$. Pour $i=0, 1, 2$, c'est un isomorphisme pour des raisons g\'en\'erales. Pour $i=3$, c'est encore un isomorphisme, comme \'etabli par Colliot-Th\'el\`ene dans \cite[Th\'eor\`eme 5.6 (vii)]{MR3404380}. \end{rem} \bigskip Donnons la structure de l'article\,: au \S \ref{sect:Hnr}, apr\`es un rappel de quelques r\'esultats de base en cohomologie non ramifi\'ee dont nous aurons besoin, on montre les annulations de $H^{4}_{\nr}(X, \mbb{Q}/\mbb{Z})$ et $H^{5}_{\nr}(X, \mbb{Q}/\mbb{Z})$\,; le \S \ref{sect:Prepa} contient deux ingr\'edients cruciaux pour la preuve du th\'eor\`eme \ref{main}, \`a savoir, le fait que $H^{5}(X, \mbb{Z})$ est support\'e en codimension 2 et une d\'ecomposition de la diagonale de $X$\,; les d\'emonstrations de la partie (1) et la partie (2) du th\'eor\`eme \ref{main} sont donn\'ees aux \S \ref{sect:Griff} et \S \ref{sect:IsomAJ} respectivement\,; finalement au \S\ref{sect:SS} on montre le th\'eor\`eme \ref{main2}. \bigskip \noindent\textit{Remerciements\,:} L'id\'ee de ce travail est issue du groupe de travail que nous avons coorganis\'e \`a Lyon en 2016-2017. Nous remercions la F\'ed\'eration de Recherche en Math\'ematiques Rh\^one-Alpes-Auvergne (FR 3490) pour le support de financement \emph{Projets Inter-laboratoires}. L'article a \'et\'e pr\'epar\'e durant les deux rencontres \emph{G\'eom\'etrie Alg\'ebrique et G\'eom\'etrie Complexe} au CIRM en janvier et d\'ecembre 2017. On remercie Olivier Benoist, Alberto Collino, Jean-Louis Colliot-Th\'el\`ene et les rapporteurs pour leurs questions et nombreuses suggestions qui am\'eliorent beaucoup cet article. \section{Cohomologie non ramifi\'ee}\label{sect:Hnr} \subsection{Rappels} Nous renvoyons les lecteurs \`a \cite{MR999316}, \cite{MR1327280}, \cite{CTVoisin2012IHC} pour plus de d\'etails sur la cohomologie non ramifi\'ee. Certains des r\'esultats rappel\'es ci-dessous (le lemme \ref{lemma:SES} par exemple) reposent sur la conjecture de Bloch--Kato, \'etudi\'ee par Merkurjev--Suslin \cite{MR675529}, \cite{MR1062517}, Rost \cite{RostNonpub} et Voevodsky \cite{MR2031199}, montr\'ee par Voevodsky \cite{MR2811603} et Rost (\emph{cf.}~\cite{MR2220090}). Soit $X$ une vari\'et\'e complexe projective lisse connexe. On consid\`ere l'application `identit\'e' $$\pi\colon X_{\cl}\to X_{\Zar}$$ qui est un morphisme (continu) entre le site de la topologie classique et celui de la topologie de Zariski. Pour tout groupe ab\'elien $A$ et tout entier positif $i$, on d\'efinit un faisceau pour la topologie de Zariski sur $X$ par l'image directe d\'eriv\'ee du faisceau constant $A$\,: \begin{equation*} \HH^{i}(A):= \HH^{i}_{X}(A):=R^{i}\pi_{*}A. \end{equation*} Autrement-dit, $\HH^{i}(A)$ est le faisceau pour la topologie de Zariski associ\'e au pr\'efaisceau $U\mapsto H^{i}(U, A)$, o\`u $U$ est un ouvert de Zariski de $X$, muni de la topologie classique et $H^{i}$ signifie la cohomologie singuli\`ere (Betti). Par d\'efinition, la $i$-\`eme \emph{cohomologie non ramifi\'ee} de $X$ \`a coefficient dans $A$ est \begin{equation*} H^{i}_{\nr}\left(X, A\right):= H^{0}\left(X, \HH^{i}(A)\right). \end{equation*} Pour toute sous-vari\'et\'e ferm\'ee int\`egre $Y$ de $X$, on note $H^{j}(\mbb{C}(Y), A):=\varinjlim_{U}H^{j}(U, A)$ o\`u $U$ parcourt les ouverts de Zariski non vides de $Y$. Gr\^ace au travail de Bloch--Ogus sur la conjecture de Gersten \cite{MR0412191}, on a une r\'esolution flasque suivante du faisceau $\HH^{i}(A)$ pour la topologie de Zariski\,: \begin{equation}\label{eqn:Resolution} 0\to \HH^{i}(A)\to H^{i}(\mbb{C}(X), A)\xrightarrow{\partial} \bigoplus_{Y\in X^{(1)}} {i_{Y}}_{*}H^{i-1}(\mbb{C}(Y), A(-1))\xrightarrow{\partial} \cdots\xrightarrow{\partial} \bigoplus_{Y\in X^{(i)}} {i_{Y}}_{*}A(-i)\to 0, \end{equation} o\`u les fl\`eches $\partial$ sont donn\'ees par le r\'esidu topologique (\cite[P.~417]{MR1988456}) et ${i_{Y}}_{*}$ signifie l'image directe pour un faisceau constant par l'immersion ferm\'ee naturelle de $Y$ vers $X$. Comme la longueur de la r\'esolution (\ref{eqn:Resolution}) est $i$, on a la cons\'equence suivante\,: \begin{cor}[{\cite[0.3]{MR0412191}}]\label{cor:Vanishing} Pour tout $j>i$, $H^{j}(X, \HH^{i}(A))=0$. \end{cor} Pour comparer la cohomologie \`a coefficients de torsion et celle \`a coefficients dans $\mbb{Z}$, on a besoin souvent du r\'esultat suivant\,: \begin{lem}\label{lemma:SES} Pour tout $i,j\in \mbb{N}$ et $n\in \mbb{N}^{*}$, on a une suite exacte courte $$0\to H^{j}(X, \HH^{i}(\mbb{Z}))/n\to H^{j}(X, \HH^{i}(\mbb{Z}/n))\to H^{j+1}(X,\HH^{i}(\mbb{Z}))[n]\to 0.$$ Prenant la limite inductive sur $n$, $$0\to H^{j}(X, \HH^{i}(\mbb{Z}))\otimes \mbb{Q}/\mbb{Z}\to H^{j}(X, \HH^{i}(\mbb{Q}/\mbb{Z}))\to H^{j+1}(X,\HH^{i}(\mbb{Z}))_{\tor}\to 0.$$ \end{lem} \begin{proof} Par \cite[Th\'eor\`eme 3.1]{CTVoisin2012IHC}, on a une suite exacte courte de faisceaux pour la topologie de Zariski sur $X$ $$0\to \HH^{i}(\mbb{Z})\xrightarrow{\times n}\HH^{i}(\mbb{Z})\to \HH^{i}(\mbb{Z}/n)\to 0.$$ La conclusion d\'ecoule directement de la suite exacte longue associ\'ee. \end{proof} Nous aurons besoin du r\'esultat suivant, d\^u \`a Deligne dans un cadre plus g\'en\'eral, qui compare deux suites spectrales\,: \begin{prop}[\cite{MR1424593}, \emph{cf.} {\cite[Proposition 6.4]{MR0412191}}, {\cite[Remark 4.19]{MR2723320}}]\label{prop:TwoSS} Soit $X$ une vari\'et\'e projective lisse complexe connexe. La suite spectrale de coniveau $$E_{1}^{p,q}=\bigoplus_{Y\in X^{(p)}}H^{q-p}\left(\mbb{C}(Y), A(-p)\right)\Longrightarrow H^{p+q}(X, A)$$ co\"incide \`a partir de la page $E_{2}$ avec la suite spectrale de Leray associ\'ee au morphisme continu $\pi\colon X_{\cl}\to X_{\Zar}$ $$E_{2}^{p,q}=H^{p}(X, \HH^{q}(A))\Longrightarrow H^{p+q}(X, A).$$ En particulier, la filtration d'aboutissement $N^{\bullet}$ sur $H^{k}(X, A)$ est celle par le \emph{coniveau alg\'ebrique}\,: $$N^{c}H^{k}(X, A)=\sum_{Z}\ker\left(H^{k}(X,A)\to H^{k}(X\backslash Z, A)\right),$$ o\`u $Z$ parcourt les sous-ensembles alg\'ebriques ferm\'es de $X$ de codimension $\geq c$. \end{prop} \subsection{Quelques annulations de cohomologie non ramifi\'ee}\label{subsect:VanishingHnr} Dans la suite de cet article, $X$ est une hypersurface cubique lisse de dimension $5$ d\'efinie sur $\mbb{C}$. On calcule sans difficult\'e par \cite[Proposition 18.2]{MR1988456} les nombres de Hodge de $X$: $h^{i,i}(X)=1$ pour tout $0\leq i\leq 5$, $h^{2,3}(X)=21$ et les autres $h^{p,q}(X)$ sont nuls. D'apr\`es \cite[Proposition 3.3]{CTVoisin2012IHC}, $H^{>0}_{\nr}(X, \mbb{Z})$ s'annule comme $X$ est une vari\'et\'e rationnellement connexe. On s'int\'eresse alors aux groupes de cohomologie non ramifi\'ee \`a coefficients de torsion $$H^{*}_{\nr}(X, \mbb{Q}/\mbb{Z}):=\bigcup_{n\in \mbb{N}^{*}} H^{i}_{\nr}(X, \mbb{Z}/n).$$ Notons que l'union ici a bien un sens car pour tous entiers positifs $n, m$, on a l'injectivit\'e de la fl\`eche $H^{i}(\mbb{C}(X), \mbb{Z}/n)\to H^{i}(\mbb{C}(X), \mbb{Z}/nm)$ gr\^ace aux th\'eor\`emes de Voevodsky \cite{MR2031199}, \cite{MR2811603}. Le groupe $H^{*}_{\nr}(X, \mbb{Q}/\mbb{Z})$ \'etaient bien compris sauf en degr\'es 4 et 5\,: \begin{itemize} \item $H^{0}_{\nr}(X, \mbb{Q}/\mbb{Z})\cong \mbb{Q}/\mbb{Z}$. \item $H^{1}_{\nr}(X, \mbb{Q}/\mbb{Z})\cong H^{1}(X, \mbb{Q}/\mbb{Z})=0$. \item $H^{2}_{\nr}(X, \mbb{Q}/\mbb{Z})\cong \Br(X)\cong H^{3}(X, \mbb{Z})_{\tor}=0$. (\emph{cf.} \cite[Proposition 4.2.3]{MR1327280}). \item $H^{3}_{\nr}(X, \mbb{Q}/\mbb{Z})=0$, car d'apr\`es l'interpr\'etation \cite[Th\'eor\`eme 1.1]{CTVoisin2012IHC}, il mesure exactement le d\'efaut de la conjecture de Hodge enti\`ere\,; or $H^{4}(X, \mbb{Z})$ est bien engendr\'e par la classe alg\'ebrique $h^{2}$, o\`u $h=c_{1}\left(\mathcal{O}_{X}(1)\right)$ la classe d'une section hyperplane. \item $H^{i}_{\nr}(X, \mbb{Q}/\mbb{Z})=0$ pour tout $i>\dim(X)=5$, car le faisceau $\HH^{i}(\mbb{Q}/\mbb{Z})=0$ par le th\'eor\`eme de Lefschetz pour les vari\'et\'es affines (\cite{MR0177422}). \end{itemize} Traitons les deux cas restant\,: \begin{lem}[{\cite[P.4]{mboro2017cubic}}]\label{nr4} Le groupe $H^4_{\nr}\left(X, \mbb{Q}/\mbb{Z}(4)\right)$ est nul. \end{lem} \begin{proof} On fixe un plan projectif $\Pi$ contenu dans $X$. Alors la projection depuis $\Pi$ fournit une application rationnelle $X\dashrightarrow \mbb{P}^{3}$. L'\'eclatement de $X$ le long de $\Pi$ r\'esout le lieu d'ind\'etermination et donne une fibration en quadriques $$\pi: \tilde X\to \mbb{P}^{3}.$$ Notons $Q$ la fibre g\'en\'erique de $\pi$, qui est une surface quadrique lisse sur le corps des fonctions $K:=\mbb{C}(\mbb{P}^{3})$. Par \cite[Theorem 3]{kahn2001unramifiedquadric2}, pour tout $n\in \mbb{N}^{*}$, il y a une application surjective \begin{equation}\label{eqn:SurjToH4nr} H^4\left(K, \mu_n^{\otimes 4}\right) \to H^4_{\nr}\left(Q/K, \mu_n^{\otimes 4}\right), \end{equation} o\`u le groupe \`a gauche est la cohomologie galoisienne et le groupe \`a droite est la cohomologie non ramifi\'ee, qui est plus g\'en\'eralement bien d\'efinie pour une vari\'et\'e sur un corps quelconque (\emph{cf.}~\cite[\S 2.2]{CTVoisin2012IHC}). Observons que $H^{4}\left(K, \mu_n^{\otimes 4}\right)$ est nul car la dimension cohomologique du corps $K$ est $3$ \cite[Chapitre II, \S 4.2, Proposition 11]{MR1324577}. Donc $H^4_{\nr}\left(Q/K, \mu_n^{\otimes 4}\right)=0$ par la surjectivit\'e de \eqref{eqn:SurjToH4nr}. Comme $H^{i}_{\nr}(-, \mbb{Q}/\mbb{Z})$ est un invariant birationnel des vari\'et\'es projectives lisses \cite{MR999316}, on a $H^{4}_{\nr}\left(X, \mu_{n}^{\otimes 4}\right)\cong H^{4}_{\nr}\left(\tilde X, \mu_{n}^{\otimes 4}\right)$, qui est nul car c'est un sous-groupe de $H^4_{\nr}\left(Q/K, \mu_n^{\otimes 4}\right)$. Finalement, $H^4_{\nr}(X, \mbb{Q}/\mbb{Z}(4))$ est l'union de ses sous-groupes $H^{4}_{\nr}\left(X, \mu_{n}^{\otimes 4}\right)$, donc est \'egalement nul. \end{proof} \begin{lem}\label{nr5} Le groupe $H^{5}_{\nr}(X, \mbb{Q}/\mbb{Z}(5))$ est nul. \end{lem} \begin{proof} La preuve est similaire \`a celle du lemme \ref{nr4} pr\'ec\'edent\,: on choisit une droite $\Lambda$ contenue dans $X$ et l'\'eclatement $\tilde X$ de $X$ le long de $\Lambda$ admet une structure de fibration en coniques sur $\mbb{P}^{4}$, par la projection depuis $\Lambda$\,: $$\pi: \tilde X\to \mbb{P}^{4}.$$ Soit $C$ la conique g\'en\'erique sur le corps des fonctions $K:=\mbb{C}(\mbb{P}^{4})$. Alors pour tout $n\in \mbb{N}^{*}$, on a une application surjective (\emph{cf.} \cite[Proposition A.1]{MR1637963}) $$H^{5}(K, \mu_{n}^{\otimes 5})\to H^{5}_{\nr}(C/K, \mu_{n}^{\otimes 5}).$$ Comme la dimension cohomologique de $K$ est 4, ces deux groupes sont nuls \cite[Chapitre II, \S 4.2, Proposition 11]{MR1324577}. Donc par \cite{MR999316}, le groupe $H^{5}_{\nr}(X, \mu_{n}^{\otimes 5})\cong H^{5}_{\nr}(\tilde X, \mu_{n}^{\otimes 5})$, qui est un sous-groupe de $H^{5}_{\nr}(C/K, \mu_{n}^{\otimes 5})$, est aussi nul. \end{proof} \section{Pr\'eparations de la preuve}\label{sect:Prepa} Rappelons que $X\subset \mbb{P}^{6}_{\mbb{C}}$ est toujours une hypersurface cubique lisse. \subsection{Coniveau alg\'ebrique 2} Comme $H^{5,0}(X)=H^{4,1}(X)=0$ et $H^{3,2}(X)=21$ (\emph{cf.} \cite[Proposition 18.2]{MR1988456}), le coniveau de Hodge de $H^{5}(X, \mbb{Z})$ est \'egal \`a 2. Nous montrons que son coniveau alg\'ebrique est aussi 2. Plus pr\'ecis\'ement, on a l'observation suivante\,: \begin{prop}\label{coniveau} (1). Si $X$ est g\'en\'erale \footnote{C'est-\`a-dire en dehors d'un sous-ensemble alg\'ebrique ferm\'e propre convenable dans l'espace de modules des hypersurfaces cubiques de dimension 5.}, il existe une famille de plans projectifs contenus dans $X$ param\'etr\'ee par une courbe projective lisse $C$, telle que l'application d'Abel--Jacobi $H^1(C, \mbb{Z}) \to H^5(X, \mbb{Z})$ est un morphisme surjectif de structures de Hodge.\\ (2). Si $X$ est arbitraire (lisse), alors $H^{5}(X, \mbb{Z})$ est de coniveau alg\'ebrique 2, \emph{i.e.} il existe un sous-ensemble alg\'ebrique ferm\'e $Z$ de codimension 2 dans $X$, tel que l'application de restriction $H^{5}(X,\mbb{Z})\to H^{5}(X\backslash Z, \mbb{Z})$ est nulle. \end{prop} \begin{proof} Soient $F$ le sch\'ema de Fano des plans contenus dans $X$ et $P \to F$ la famille universelle des plans. \begin{equation*} \xymatrix{ P \ar[r]^{q} \ar[d]^{p}& X\\ F } \end{equation*} Si $X$ est g\'en\'erale, alors par le r\'esultat de Collino \cite{collino1986AJcubic5fold}, $F$ est une surface lisse et l'application d'Abel--Jacobi induit un isomorphisme entre la vari\'et\'e d'Albanese de $F$ et la jacobienne interm\'ediaire de $X$\,: \begin{eqnarray*} F\to &\Alb(F)& \xrightarrow{\simeq} J^5(X)\\ {[\Pi]}&\mapsto& \Phi(\Pi-\Pi_{0}) \end{eqnarray*} o\`u $\Pi_{0}$ est un plan projectif contenu dans $X$ fix\'e. En particulier, par \cite[Th\'eor\`eme 12.17]{MR1988456}, l'application $$q_{*}p^{*}\colon H^3(F, \mbb{Z}) \xrightarrow{\cong} H^5(X, \mbb{Z})$$ est un isomorphisme de structures de Hodge. On choisit $i\colon C\hookrightarrow F$ un diviseur lisse ample. Le th\'eor\`eme de Lefschetz implique que le compos\'e $$H^1(C, \mbb{Z}) \xrightarrow{i_{*}} H^3(F, \mbb{Z}) \xrightarrow{q_{*}p^{*}}H^5(X, \mbb{Z})$$ est bien un morphisme surjectif de structures de Hodge. On passe dans le cadre holomorphe. Pour $X$ arbitraire (lisse), il y a un disque analytique $\mathbb{D}$ de petit rayon dans $\mbb{C}$ de centre $0$ et une famille $\mathcal{X}\to \mathbb{D}$ d'hypersurfaces cubiques lisses dont la fibre centrale $\mathcal{X}_0\cong X$, tels que pour tout $t \in \mathbb{D}\backslash\{0\}$, $\mathcal{X}_t$ est g\'en\'erale au sens ci-dessus. On consid\`ere le sch\'ema de Fano relatif ainsi que la famille universelle\,: \begin{equation*} \xymatrix{ \mathcal{Q}:=\mathcal{P}|_\mathcal{C} \ar@{^{(}->}[r]\ar[d]\ar@{}[dr]|\square & \mathcal{P} \ar[r]^{q} \ar[d]^{p}& \mathcal{X}\ar[ddl]\\ \mathcal{C} \ar@{^{(}->}[r]^{i} & \mathcal{F} \ar[d]& \\ &\mathbb{D} & } \end{equation*} o\`u $\mathcal{C}$ est un diviseur ample g\'en\'eral de $\mathcal{F}$. Donc $\mathcal{C} \to \mathbb{D}$ est une famille de courbes qui param\`etrent des plans dans les fibres de $\mathcal{X}\to \mathbb{D}$. On a alors le diagramme commutatif suivant\,: \begin{equation*} \xymatrix{ & H_{5}(\mathcal{Q}_{t}, \mbb{Z}) \ar[r]^{{q_{t}}_{*}} \ar[d]& H_{5}(\mathcal{X}_{t}, \mbb{Z}) \ar[d]_{\simeq}\\ & H_{5}(\mathcal{Q}, \mbb{Z}) \ar[r]^{q_{*}} & H_{5}(\mathcal{X}, \mbb{Z})\\ & H_{5}(\mathcal{Q}_{0}, \mbb{Z}) \ar[r]^{{q_{0}}_{*}} \ar[u]^{\simeq} & H_{5}(\mathcal{X}_{0}, \mbb{Z}) \ar[u]^{\simeq} } \end{equation*} o\`u $t\in \mathbb{D}\backslash\{0\}$, les fl\`eches verticales sont induites par des inclusions naturelles. Les fl\`eches verticales entre la deuxi\`eme et la troisi\`eme ligne sont des isomorphismes car la fibre centrale $\mathcal{Q}_{0}$ (\emph{resp.} $\mathcal{X}_{0}$) est un r\'etract par d\'eformation de l'espace total $\mathcal{Q}$ (\emph{resp.} $\mathcal{X}$). L'autre fl\`eche \`a droite est un isomorphisme car toutes les hypersurfaces cubiques lisses sont diff\'eomorphes et la projection $\mathcal{X}\to \mathbb{D}$ est une submersion par le th\'eor\`eme de fibration d'Ehresmann (\emph{cf.}~\cite[Proposition 9.3]{MR1988456}). Par le paragraphe pr\'ec\'edent, la fl\`eche de la premi\`ere ligne est la compos\'ee de \[ H_5(\mathcal{Q}_t, \mbb{Z}) \cong H^1(\mathcal{C}_t, \mbb{Z}) \to H^3(\mathcal{F}_t, \mbb{Z})\to H^5(\mathcal{X}_t, \mbb{Z})\cong H^5(\mathcal{X}_t, \mbb{Z}), \] donc surjective. Il en est donc de m\^eme pour la deuxi\`eme et la troisi\`eme ligne. En particulier, $${q_{0}}_{*}: H_{5}(\mathcal{Q}_0, \mbb{Z}) \to H_{5}(\mathcal{X}_{0}, \mbb{Z})$$ est surjective. De mani\`ere \'equivalente, $H^{5}(\mathcal{X}_{0}, \mbb{Z})$ est support\'ee sur la pr\'eimage de $\mathcal{C}_{0}$ dans $\mathcal{P}_{0}$, qui est un sous-ensemble alg\'ebrique de dimension 3. \end{proof} \subsection{D\'ecomposition de la diagonale} La technique de la \emph{d\'ecomposition de la diagonale} est initi\'ee par Bloch--Srinivas \cite{MR714776}. Nous avons besoin de la version raffin\'ee suivante due \`a Paranjape \cite{MR1283872} et Laterveer \cite{MR1669995}, \emph{cf.} \cite[\S 22]{MR1988456} et \cite[Theorem 3.18]{MR3186044}. \begin{thm}[{\cite[Theorem 3.18]{MR3186044}}]\label{thm:DD} Soient $Y$ une vari\'et\'e complexe projective lisse connexe de dimension $n$ et $c$ un entier positif. Suppose que pour tout $0\leq k<c$, l'application de classe $$\cl\colon\CH_{k}(Y)_{\mbb{Q}}\hookrightarrow H^{2n-2k}(Y, \mbb{Q})$$ est injective. Alors il existe un entier non nul $m$ et une d\'ecomposition dans $\CH^{n}(Y\times Y)$ \begin{equation}\label{eqn:DDgeneral} m\Delta_{Y}=Z_{0}+Z_{1}+\cdots+Z_{c-1}+Z', \end{equation} tels que $Z_{i}$ est support\'e sur $W_{i}\times W_{i}'$ avec $\dim W_{i}=i$ et $\dim W_{i}'=n-i$, et $Z'$ est support\'e sur $Y\times T$ avec $T$ un sous-ensemble alg\'ebrique ferm\'e de codimension $\geq c$ dans $Y$. \end{thm} Pour les hypersurfaces cubiques de dimension 5, le th\'eor\`eme g\'en\'eral ci-dessus donne le r\'esultat suivant\,: \begin{cor}\label{cor:DDcubique5} Soit $X\subset \mbb{P}^{6}_{\mbb{C}}$ une hypersurface cubique lisse. Alors il existe un entier non nul $m$ et une d\'ecomposition dans $\CH^{5}(X\times X)$ \begin{equation}\label{eqn:DD} m\Delta_{X}=m~x\times X+m~ l\times h+Z' \end{equation} o\`u $x$ est un point arbitraire de $X$, $l$ est une droite projective contenue dans $X$ arbitraire, $h=c_{1}\left(\mathcal{O}_{X}(1)\right)$ est la classe de section hyperplane et $Z'$ est support\'e sur $X\times T$ avec $T$ un sous-ensemble alg\'ebrique ferm\'e de codimension $\geq 2$ dans $X$. \end{cor} \begin{proof} L'hypoth\`ese du th\'eor\`eme \ref{thm:DD} est v\'erifi\'ee pour $c=2$ car $\CH_{0}(X)$ et $\CH_{1}(X)$ sont des groupes cycliques infinis engendr\'es respectivement par un point et une droite dans $X$ (\emph{cf.} \S \ref{sect:Intro} Introduction). On a donc une d\'ecomposition (\ref{eqn:DDgeneral}) avec $c=2$. Pour d\'eterminer $Z_{0}$ et $Z_{1}$, on utilise encore une fois les descriptions de $\CH_{0}(X)$ et $\CH_{1}(X)$ plus le fait que $\CH^{1}(X)\cong \mbb{Z}\cdot h$, pour obtenir que $Z_{0}=m_{1}~x\times X$ et $Z_{1}=m_{2}~ l\times h$ avec deux entiers $m_{1}, m_{2}$. Finalement, pour voir que $m_{1}=m_{2}=m$, on fait agir (\ref{eqn:DDgeneral}) par correspondances sur la classe d'un point $x$ et la classe d'une droite $l$. D'une part, $\Delta_{X}$ agit toujours par l'identit\'e et d'autre part, $(x\times X)^{*}(x)=x$, $(x\times X)^{*}(l)=0$, $(l\times h)^{*}(x)=0$, $(l\times h)^{*}(l)=l$ et ${Z'}^{*}(x)={Z'}^{*}(l)=0$ par raison de dimension, on obtient $m~ x=m_{1}~ x$ et $ m~ l=m_{2}~ l$. D'o\`u, $m=m_{1}=m_{2}$. \end{proof} \section{Preuve de l'annulation de $\Griff^{3}(X)$}\label{sect:Griff} On d\'emontre dans cette section le th\'eor\`eme \ref{main} (1). Commen\c cons par la r\'einterpr\'etation cohomologique suivante du groupe de Griffiths des cycles de codimension 3. On utilise les notations du \S \ref{sect:Hnr}. \begin{prop}\label{prop:Griffiths} Soit $X$ une hypersurface cubique lisse dans $\mbb{P}^{6}_{\mbb{C}}$. On a un isomorphisme $H^1(X, \HH^4(\mbb{Z}(4))) \cong \Griff^3(X)$. \end{prop} \begin{proof} Consid\'erons la suite spectrale de Leray associ\'ee au morphisme continu de sites $\pi: X_{\cl}\to X_{\Zar}$\,: $$E_2^{p, q}=H^p\left(X, \HH^q(\mbb{Z})\right) \Rightarrow H^{p+q}(X, \mbb{Z}).$$ D'une part, rappelons les annulations du corollaire \ref{cor:Vanishing}: $H^{p}\left(X, \HH^{q}(\mbb{Z})\right)=0$ pour tout $p>q$\,; d'autre part, d'apr\`es \cite[Proposition 3.3 (i)]{CTVoisin2012IHC}, on a $H^0\left(X, \HH^q(\mbb{Z})\right)=0$ pour tout $q>0$. En regardant la suite spectrale, on obtient une suite exacte \begin{equation}\label{eqn:Exact} 0\to H^{2}\left(X, \HH^{3}(\mbb{Z})\right)\to H^{5}(X, \mbb{Z})\to H^{1}\left(X, \HH^{4}(\mbb{Z})\right)\xrightarrow{d_{2}} H^{3}\left(X, \HH^{3}(\mbb{Z})\right)\to H^{6}(X, \mbb{Z}) \end{equation} Gr\^ace \`a la proposition \ref{prop:TwoSS}, la filtration d'aboutissement est celle de coniveau alg\'ebrique, donc l'image de la premi\`ere fl\`eche $H^2\left(X, \HH^3(\mbb{Z})\right) \to H^5(X, \mbb{Z})$ est $$N^2H^5(X, \mbb{Z}):=\sum_{\substack{Z \subset X \text{ Zariski ferm\'e}\\ \codim Z\geq 2}}\ker\left(H^{5}(X,\mbb{Z})\to H^{5}(X\backslash Z, \mbb{Z})\right),$$ qui est simplement $H^{5}(X, \mbb{Z})$, par la proposition \ref{coniveau}. Autrement dit, le morphisme $H^2(X, \HH^3(\mbb{Z})) \to H^5(X, \mbb{Z})$ est surjectif (en fait un isomorphisme). Par cons\'equent, la suite exacte (\ref{eqn:Exact}) se simplifie et implique que $d_{2}$ induit un isomorphisme $$H^{1}\left(X, \HH^{4}(\mbb{Z})\right)\simeq \ker\left(H^{3}\left(X, \HH^{3}(\mbb{Z})\right)\to H^{6}(X, \mbb{Z})\right).$$ Or \cite[Corollary 7.4]{MR0412191} \'etablit un isomorphisme $H^{3}\left(X, \HH^{3}(\mbb{Z})\right)\cong \CH^{3}(X)/\alg$, le groupe des cycles de codimension 3 modulo l'\'equivalence alg\'ebrique. De plus, l'application $H^{3}\left(X, \HH^{3}(\mbb{Z})\right)\to H^{6}(X, \mbb{Z})$ s'identifie, \emph{via} cet isomorphisme, \`a l'application classe de cycles, dont le noyau est $\Griff^{3}(X)$ par d\'efinition. On en d\'eduit l'isomorphisme cherch\'e. \end{proof} \begin{cor}\label{cor:SansTorsion} Le troisi\`eme groupe de Griffiths $\Griff^3(X)$ est sans torsion. \end{cor} \begin{proof} Par le lemme \ref{lemma:SES} on a une suite exacte courte $$0\to H^{4}_{\nr}(X, \mbb{Z}(4))/n\to H^{4}_{\nr}(X, \mu_n^{\otimes 4})\to H^{1}(X, \HH^{4}(\mbb{Z}(4)))[n]\to 0.$$ Comme $H^{4}_{\nr}(X, \mbb{Z}(4))=0$ par \cite[Proposition 3.3 (i)]{CTVoisin2012IHC}, on a que pour tout $n\in \mbb{N}^{*}$, $$H^{4}_{\nr}(X, \mu_n^{\otimes 4})\simeq H^{1}(X, \HH^{4}(\mbb{Z}(4)))[n].$$ Il en r\'esulte que $H^4_{\nr}(X, \mbb{Q}/\mbb{Z}(4))$ est le sous-groupe de torsion du groupe $H^1(X, \HH^4(\mbb{Z}(4)))$, qui s'identifie \`a celui du groupe $ \Griff^3(X)$ par la proposition \ref{prop:Griffiths}. Donc le lemme \ref{nr4} nous permet de conclure. \end{proof} \begin{rem} Les arguments dans la proposition \ref{prop:Griffiths} et le corollaire \ref{cor:SansTorsion} sont essentiellement dus \`a Voisin \cite[Corollary 1.3]{MR2987669}. \end{rem} \begin{prop}\label{prop:DeTorsion} Le troisi\`eme groupe de Griffiths $\Griff^3(X)$ est de torsion. \end{prop} \begin{proof} On utilise la d\'ecomposition raffin\'ee de la diagonale (\ref{eqn:DD}) dans le corollaire \ref{cor:DDcubique5}. On peut supposer que $T$ est de dimension pure 3, en g\'en\'eral r\'eductible. Soient $\tilde T\to T$ une d\'esingularisation et $\tilde Z'\in \CH_{5}(X\times \tilde T)$ tel que son image dans $\CH_{5}(X\times X)$ est $m'Z'$ avec certain entier $m'$ . Notons $\tilde i: \tilde T\to X$ le compos\'e de la d\'esingularisation et l'inclusion. On \'ecrit $\tilde T=\coprod_{j} \tilde T_{j}$ la d\'ecomposition en composantes connexes. Soit $\alpha\in \CH^{3}(X)_{\ho}$ un 2-cycle homologiquement trivial quelconque. Faisons agir sur $\alpha$ les correspondances apparaissant dans (\ref{eqn:DD}): on a $\Delta_{*}(\alpha)=\alpha$, $(x\times X)_{*}(\alpha)=(l\times h)_{*}(\alpha)=0$ par raison de dimension, et $m'{Z'}_{*}(\alpha)={\tilde i}_{*}\circ {\tilde {Z'}}_{*}(\alpha)$. On obtient $$mm'\alpha={\tilde i}_{*}\left(\tilde Z'_{*}(\alpha)\right).$$ Comme $\tilde Z'_{*}(\alpha)$ est un diviseur homologue \`a 0 sur $\tilde T$, il est alg\'ebriquement \'equivalent \`a 0 sur $\tilde T$. Donc $mm'\alpha$ est aussi alg\'ebriquement \'equivalent \`a 0, \emph{i.e.} $\alpha$ est de torsion dans $\Griff^{3}(X)$. \end{proof} La combinaison du corollaire \ref{cor:SansTorsion} et de la proposition \ref{prop:DeTorsion} implique que $\Griff^{3}(X)=0$. La partie (1) du th\'eor\`eme \ref{main} est d\'emontr\'ee. \qed \section{Preuve de l'isomorphisme d'Abel--Jacobi}\label{sect:IsomAJ} Cette section est consacr\'ee \`a la preuve du th\'eor\`eme \ref{main} (2) qui dit que l'application d'Abel--Jacobi $$\Phi: \CH^{3}(X)_{\alg}\to J^{5}(X)$$ est un isomorphisme. Rappelons que $\CH^{3}(X)_{\alg}$ est un groupe divisible par le lemme standard suivant\,: \begin{lem}[{\cite[P.10 Lemma 1.3]{MR2723320}}]\label{lemma:divisible} Le groupe de Chow des cycles alg\'ebriquement triviaux est divisible. \end{lem} On d\'emontre d'abord que $\Phi$ est une `isog\'enie', ou, dans le langage de \cite{MR714776}, que $\CH^{3}(X)_{\alg}$ est \emph{faiblement repr\'esentable}. \begin{prop}\label{prop:Isogenie} L'application d'Abel--Jacobi $\Phi: \CH^{3}(X)_{\alg}\to J^{5}(X)$ est surjective avec un noyau fini. \end{prop} \begin{proof} On utilisera la d\'ecomposition raffin\'ee de la diagonale (\ref{eqn:DD}) du corollaire \ref{cor:DDcubique5}. Comme dans la d\'emonstration de la proposition \ref{prop:DeTorsion}, on suppose que $T$ est de dimension pure 3 et on choisit une d\'esingularisation $\tilde T\to T$ \'equip\'ee d'un cycle $\tilde Z'\in \CH^{3}(X\times \tilde T)$ dont l'image dans $\CH_{5}(X\times T)$ est un multiple $m'Z'$ de $Z'$. On note $\tilde i: \tilde T\to X$ le compos\'e de la d\'esingularisation et l'inclusion. Notons que $\tilde T$ n'est pas forc\'ement connexe et on \'ecrit $\Pic^{0}(\tilde T)=\prod \Pic^{0}(\tilde T_{i})$ et $\Alb(\tilde T)=\prod \Alb(\tilde T_{i})$, o\`u $\tilde T=\coprod_{i} \tilde T_{i}$ est la d\'ecomposition en composantes connexes. Montrons la surjectivit\'e de $\Phi$. Par la compatibilit\'e entre les applications d'Abel--Jacobi et les actions des correspondances (\emph{cf.} \cite[\S 12.2]{MR1988456}), on a le diagramme commutatif suivant\,: \begin{equation}\label{diag:Surj} \xymatrix{ \CH^{3}(X)_{\alg} \ar[r]^-{\Phi} \ar[d]^{{\tilde i}^{*}} \ar@{->>}@/_3pc/[dd]_{\times mm'}& J^{5}(X) \ar[d]^{{\tilde i}^{*}} \ar@{->>}@/^3pc/[dd]^{\times mm'}\\ \CH^{3}(\tilde T)_{\alg} \ar@{->>}[r]^{\alb} \ar[d]^{{\tilde {Z'}}^{*}}& \Alb(\tilde T)\ar@{->>}[d]^{[\tilde {Z'}]^{*}}\\ \CH^{3}(X)_{\alg} \ar[r]^-{\Phi}& J^{5}(X) } \end{equation} o\`u les fl\`eches \`a droite sont induites par les morphismes indiqu\'es sur les structures de Hodge. La d\'ecomposition (\ref{eqn:DD}) implique que les deux compos\'ees des fl\`eches verticales dans (\ref{diag:Surj}) sont toutes la multiplication par $mm'$, car les deux premiers termes de (\ref{eqn:DD}) agissent par z\'ero par raison de dimension. Elles sont donc surjectives par la divisibilit\'e. Du coup la fl\`eche verticale du carr\'e inf\'erieur est surjective. Or l'application d'Albanese $\alb$ est aussi surjective, on peut conclure que $\Phi$ est surjective. Montrons ensuite la finitude du noyau de $\Phi$. \`A nouveau, nous avons un diagramme commutatif \begin{equation}\label{diag:FiniteKer} \xymatrix{ \CH^{3}(X)_{\alg} \ar[r]^-{\Phi} \ar[d]^{{\tilde {Z'}}_{*}} \ar@{->>}@/_3pc/[dd]_{\times mm'}& J^{5}(X) \ar[d]^{[\tilde {Z'}]_{*}} \ar@{->>}@/^3pc/[dd]^{\times mm'}\\ \CH^{1}(\tilde T)_{\alg} \ar[r]^{\simeq} \ar[d]^{{\tilde i}_{*}}& \Pic^{0}(\tilde T)\ar[d]^{{\tilde i}_{*}}\\ \CH^{3}(X)_{\alg} \ar[r]^-{\Phi}& J^{5}(X) } \end{equation} De mani\`ere similaire, (\ref{eqn:DD}) implique que les compos\'ees des fl\`eches verticales dans (\ref{diag:FiniteKer}) sont toutes deux la multiplication par $mm'$. Maintenant pour tout $\alpha\in \ker{\Phi}$, par la divisibilit\'e de $\CH^{3}(X)_{\alg}$, rappel\'ee dans le lemme \ref{lemma:divisible}, il existe un $\beta\in \CH^{3}(X)_{\alg}$, tel que $\alpha=mm'\beta$. Donc $\Phi(\beta)\in J^{5}(X)[mm']$. Comme la fl\`eche au milieu de (\ref{diag:FiniteKer}) est un isomorphisme, on trouve que ${\tilde {Z'}}_{*}(\beta)\in \CH^{1}(\tilde T)_{\alg}[mm']$. D'o\`u, $$\alpha=mm'\beta={\tilde i}_{*}\circ{\tilde {Z'}}_{*}(\beta)\in {\tilde i}_{*}\left(\CH^{1}(\tilde T)_{\alg}[mm']\right),$$ qui est un ensemble fini. \end{proof} On peut en d\'eduire le th\'eor\`eme \ref{main} (2) pour une hypersurface cubique \emph{g\'en\'erale}\,: \begin{prop}\label{prop:aj} Si $X$ est g\'en\'erale, alors l'application d'Abel--Jacobi $\Phi: \CH^3_{alg} \to J^5(X)$ est un isomorphisme de groupes. \end{prop} \begin{proof} Par la proposition \ref{coniveau} (1), il existe une famille de plans contenu dans $X$ param\'etr\'ee par une courbe projective lisse $C$, telle que l'application d'Abel--Jacobi $H^1(C, \mbb{Z}) \to H^5(X, \mbb{Z})$ est surjective. On a donc un diagramme commutatif \begin{equation} \xymatrix{ \CH^1(C)_{\alg} \ar[r]^-{\cong} \ar[d]& J(C) \ar@{->>}[d]^{\text{ fib. conn. }}\\ \CH^3(X)_{\alg} \ar@{->>}[r]^-{\Phi} & J^5(X) } \end{equation} dont la fl\`eche verticale de droite est surjective \`a fibres connexes par la surjectivit\'e de $H^1(C, \mbb{Z}) \to H^5(X, \mbb{Z})$. On note $A$ le noyau de cette fl\`eche, qui est une sous-vari\'et\'e ab\'elienne de $J(C)$. Par la proposition \ref{prop:Isogenie}, $\Phi$ est surjective avec un noyau fini. Comme tout morphisme d'un groupe divisible vers un groupe fini est trivial, l'image de $A$ dans $\ker(\Phi)$ est triviale. Il en r\'esulte que l'image du groupe $\CH^1(C)_{\alg}$ dans $\CH^3(X)_{\alg}$ est isomorphe \`a $J^5(X)$. Donc on a un scindage de $\Phi$ et $\CH^3(X)_{\alg} \cong J^5(X)\oplus \ker(\Phi)$. Or le groupe $\CH^3(X)_{\alg}$ est divisible (Lemme \ref{lemma:divisible}), et donc $\ker(\Phi)=0$. \end{proof} Pour d\'emontrer le th\'eor\`eme \ref{main} (2) pour une hypersurface cubique lisse \emph{arbitraire}, on a besoin du lemme suivant pour faire un argument de d\'eformation. Voir \cite[\S 20.3]{MR1644323} pour l'application de sp\'ecialisation. \begin{lem}[{\emph{cf.}~\cite[Corollaire 1.5]{mboro2017cubic}}]\label{lem:deformation} Soit $\mathcal{X} \to T$ une famille d'hypersurfaces cubiques lisses de dimension 5 sur une courbe et $\mathcal{X}_{\bar{\eta}}$ la fibre g\'en\'erique g\'eom\'etrique. Alors pour tout point ferm\'e $t \in T$, l'application de sp\'ecialisation $\CH^3(\mathcal{X}_{\bar{\eta}}) \to \CH^3(\mathcal{X}_t)$ est surjective. \end{lem} \begin{proof La d\'emonstration est quasiment la m\^eme que celle de \cite[Corollaire 1.5]{mboro2017cubic}, sauf qu'on montre la surjectivit\'e pour le groupe des cycles modulo l'\'equivalence rationnelle au lieu de l'\'equivalence alg\'ebrique, en utilisant un r\'esultat plus fort sur la d\'eformation des courbes d'une vari\'et\'e rationnellement connexe. Soit $F(\mathcal{X})\to T$ la famille des sch\'emas de Fano des droites de la famille $\mathcal{X}\to T$. Alors l'application $\CH_1(F(\mathcal{X}_{t})) \to \CH_2(\mathcal{X}_{t})$ induite par la famille universelle des droites est surjective pour chaque point ferm\'e $t$ de $T$ (\cite[Proposition 1.4]{mboro2017cubic}). Donc il suffit de montrer que l'application de sp\'ecialisation $\CH_1(F(\mathcal{X}_{\bar{\eta}})) \to \CH_1(F(\mathcal{X}_t))$ est surjective pour tout $t\in T$. Notons $\mathcal{Y}_{t}:=F(\mathcal{X}_t)$ et $\mathcal{Y}_{\bar\eta}:=F(\mathcal{X}_{\bar\eta})$ respectivement. Ce sont des vari\'et\'es de Fano et donc rationnellement connexes par \cite{MR1189503} et \cite{MR1191735}. Soit $f_0: C_0 \to \mathcal{Y}_t$ un morphisme, o\`u $C_{0}$ est une courbe. Gr\^{a}ce \`a la connexit\'e rationnelle de $\mathcal{Y}_{t}$, on peut construire un \emph{peigne} $f: C \to \mathcal{Y}_t$ (voir par exemple \cite[Paragraph 25 et Theorem 27]{MR2011743}) tel que \begin{enumerate} \item La courbe $C=C_0 \cup \bigcup_{i=1}^k C_i$ est une courbe nodale, et chaque point nodal est le seul point d'intersection de $C_{0}$ avec une des courbes $C_1, \ldots, C_k$. \item Les courbes $C_1, \ldots, C_k$ sont des courbes rationnelles, et le faisceau localement libre $f_i^*T_{\mathcal{Y}_t}$ est ample pour tout $1\leq i\leq k$. \item La d\'eformation du peigne $f: C \to \mathcal{Y}_t$ est non obstru\'ee. \end{enumerate} Par cons\'equent, il existe des courbes $$\mathcal{F}:\mathcal{C}\to \mathcal{Y}_{\bar{\eta}}, ~~\mathcal{F}_i: \mathcal{C}_i \to \mathcal{Y}_{\bar{\eta}}, ~~i=1, \ldots, k,$$ dont les sp\'ecialisations sont des courbes $$f: C \to \mathcal{Y}_t,~~ f_i: C_i \to \mathcal{Y}_t,~~ i=1, \ldots, k.$$ Alors la classe $f_{0,*}(C_0)$ dans $CH_1(\mathcal{Y}_{t})$, qui est $C-\sum_{i=1}^{k}C_{i}$, est dans l'image de l'application de sp\'ecialisation $\CH_1(\mathcal{Y}_{\bar\eta}) \to \CH_1(\mathcal{Y}_t)$. \end{proof} \begin{proof}[D\'emonstration du th\'eor\`eme \ref{main}(2)] La surjectivit\'e de l'application d'Abel--Jacobi $\Phi$ est prouv\'ee dans la proposition \ref{prop:Isogenie}. Il reste \`a montrer son injectivit\'e. Soit $\mathcal{X}\to T$ une famille d'hypersurfaces cubiques lisses de dimension 5 telle que la fibre sur un point $0\in T$ est isomorphe \`a $X$ et pour tout $t\in T\backslash\{0\}$, l'application d'Abel--Jacobi $\Phi_{t}: \CH^{3}(\mathcal{X}_{t})_{\alg}\to J^{5}(\mathcal{X}_{t})$ est un isomorphisme. L'existence d'une telle famille est garantie par la proposition \ref{prop:aj}. Pour un cycle $\alpha\in \ker\left(\Phi\colon\CH^{3}(X)_{\alg}\to J^{5}(X)\right)$ quelconque, par le lemme \ref{lem:deformation}, quitte \`a faire un changement de base de la famille $\mathcal{X}/T$, on peut supposer qu'il existe un cycle $Z\in \CH^{3}(\mathcal{X})$ tel que $Z_0$ est rationnellement \'equivalent \`a $\alpha$ dans $\mathcal{X}_{0}=X$. On consid\`ere la fonction normale (\emph{cf.} \cite[D\'efinition 19.5 et Th\'eor\`eme 19.9]{MR1988456}) induite par $Z$, not\'ee $\sigma$, qui est une section de la fibration en jacobiennes interm\'ediaires $\pi: \mathcal{J}^{5}(\mathcal{X}/T)=:\mathcal{J}\to T$. Le fait que $\alpha\in \ker(\Phi)$ dit que $\sigma(0)=0$ dans $\mathcal{J}_{0}$. Comme la surjectivit\'e de l'application d'Abel--Jacobi vaut pour toute hypersurface cubique lisse, le morphisme suivant de $T$-sch\'emas est surjectif\,: \begin{eqnarray*} \coprod_{d\in \mbb{N}}\Chow^{2,d}(\mathcal{X}/T)\times_{T}\Chow^{2,d}(\mathcal{X}/T)&\to& \mathcal{J}\\ (z_{1}, z_{2})& \mapsto & \Phi(z_{1}-z_{2}), \end{eqnarray*} o\`u $\Chow^{2,d}(\mathcal{X}/T)$ est la vari\'et\'e de Chow du $T$-sch\'ema $\mathcal{X}$ des cycles (effectifs) de dimension 2 et de degr\'e $d$ par rapport \`a certaine polarisation. Par la d\'enombrabilit\'e du nombre des composantes de la vari\'et\'e de Chow et la non-d\'enombrabilit\'e du corps de base $\mbb{C}$, il existe un $d$, tel que la restriction \`a la composante $$\mathcal{W}:=\Chow^{2,d}(\mathcal{X}/T)\times_{T}\Chow^{2,d}(\mathcal{X}/T)\to \mathcal{J}$$ est d\'ej\`a un $T$-morphisme surjectif. Quitte \`a faire encore un changement de base qu'on notera toujours par $\mathcal{W}/T$, on peut supposer que le morphisme structural $p: \mathcal{W}\to T$ a une section $r: T\to \mathcal{W}$. On dispose donc d'une famille de 2-cycles $Z'$ dans les fibres de $\mathcal{X}/T$, param\'etr\'ee par $\mathcal{W}/T$, telle que l'application d'Abel--Jacobi \begin{eqnarray*} AJ_t\colon \mathcal{W}_t &\to& \mathcal{J}_t\\ w&\mapsto& \Phi(Z'_{w}-Z'_{r(p(w))}) \end{eqnarray*} est surjective pour tout $t \in T$. De plus, on peut supposer que $\mathcal{W}_t$ est irr\'educible pour tout $t \in T$ g\'en\'eral et que le morphisme $\mathcal{W} \to T$ est propre et plat. On peut donc trouver une courbe $S$ dans $\mathcal{W}$, passant par $r(0)\in \mathcal{W}_{0}$, plate sur $T$, telle que $AJ_{p(s)}(s)=\sigma(s)$ dans $\mathcal{J}_{p(s)}$ pour tout $s\in S$. Par le changement de base $p\colon S\to T$, on obtient une nouvelle famille d'hypersurfaces cubiques lisses $\mathcal{X}_{S}/S$ et une famille de 2-cycles homologiquement triviaux $$\Gamma:=Z\times_{T}S-\left({Z'}\times_{W}S-Z'|_{r(T)}\times_{T} S\right)\in \CH^{3}(\mathcal{X}_{S}),$$ tels que la nouvelle fonction normale est la section nulle de la nouvelle fibration en jacobiennes interm\'ediaires $\mathcal{J}^{5}(\mathcal{X}_{S}/S)\to S$. Gr\^ace \`a la proposition \ref{prop:aj}, pour tout $s\notin p^{-1}(0)$, $\Gamma_{s}$ est rationnellement \'equivalent \`a z\'ero. Par la sp\'ecialisation \cite[\S 20.3]{MR1644323}, $\Gamma_{s}=0$ dans $\CH^{3}\left(\mathcal{X}_{p(s)}\right)$ pour tout $s\in S$. En particulier, $$\alpha=\Gamma_{r(0)}=0$$ dans $\CH^{3}(X)$. D'o\`u l'injectivit\'e de $\Phi$. La partie (2) du th\'eor\`eme \ref{main} est \'etablie. \end{proof} \section{Preuve du th\'eor\`eme \ref{main2}}\label{sect:SS} \begin{lem}\label{lem:H1i} Pour tout $i\geq 2$, le groupe $H^{1}(X, \HH^{i}(\mbb{Z}))$ est nul. \end{lem} \begin{proof} Par le lemme \ref{lemma:SES}, on a une suite exacte courte $$0\to H^{i}_{\nr}(X, \mbb{Z})\otimes \mbb{Q}/\mbb{Z}\to H^{i}_{\nr}(X, \mbb{Q}/\mbb{Z})\to H^{1}(X, \HH^{i}(\mbb{Z}))_{\tor}\to 0.$$ Donc $H^{1}(X, \HH^{i}(\mbb{Z}))$ est sans torsion par l'annulation de $H^{i}_{\nr}(X, \mbb{Q}/\mbb{Z})$ (\S \ref{subsect:VanishingHnr}, lemmes \ref{nr4} et \ref{nr5}). Il reste \`a voir qu'il est de torsion. On fait agir les deux c\^ot\'es de la d\'ecomposition de la diagonale (\ref{eqn:DD}), modulo l'\'equivalence alg\'ebrique (\emph{cf.} \cite[Appendice A]{CTVoisin2012IHC}), sur $H^{1}(X, \HH^{i}(\mbb{Z}))$ et on trouve que \begin{itemize} \item l'action $\Delta_{X, *}$ est l'identit\'e\,; \item l'action $(x\times X)_{*}$ se factorise par $H^{1}(\{x\}, \HH^{i}_{\{x\}}(\mbb{Z}))$, or le faisceau $\HH^{i}_{\{x\}}(\mbb{Z})=0$ par \cite{MR0177422}, pour tout $i\geq 1$\,; \item l'action $(l\times h)_{*}$ se factorise par $H^{1}(l, \HH^{i}_{l}(\mbb{Z}))$, or le faisceau $\HH^{i}_{l}(\mbb{Z})=0$ par \cite{MR0177422}, pour tout $i\geq 2$\,; \item l'action $(Z')_{*}$ se factorise par $H^{-1}(\tilde T, \HH^{i-2}_{\tilde T}(\mbb{Z}))=0$, o\`u $\tilde T$ est une r\'esolution des singularit\'es de $T$, comme dans le d\'ebut de la d\'emonstration de la proposition \ref{prop:DeTorsion}. \end{itemize} Par cons\'equent, $H^{1}(X, \HH^{i}(\mbb{Z}))$ est annul\'e par la multiplication par $m$. \end{proof} \begin{lem}\label{lem:Hii} Pour tout $0\leq i\leq 5$, l'application classe $$H^{i}(X, \HH^{i}(\mbb{Z}))\cong \CH^{i}(X)/\alg\to H^{2i}(X, \mbb{Z})\simeq \mbb{Z}$$ est un isomorphisme. \end{lem} \begin{proof} La surjectivit\'e est \'equivalente \`a la conjecture de Hodge enti\`ere, qui vaut pour $X$ par l'existence des droites et des plans dans $X$. L'injectivit\'e est \'equivalente \`a l'annulation du groupe de Griffiths $\Griff^{i}(X)$, qui est prouv\'ee dans \S \ref{sect:Griff} pour $i=3$ et facile pour les autres $i$ (\emph{cf.} \S \ref{sect:Intro}). \end{proof} \begin{proof}[D\'emonstration du th\'eor\`eme \ref{main2}] On regarde la suite spectrale de Leray $$E_{2}^{p,q}=H^{p}(X, \HH^{q}(\mbb{Z}))\Longrightarrow H^{p+q}(X, \mbb{Z}).$$ En tenant compte les annulations \begin{itemize} \item $H^{p}(X, \HH^{q}(\mbb{Z}))=0$ pour tout $q>\dim X=5$, par \cite{MR0177422}\,; \item $H^{p}(X, \HH^{q}(\mbb{Z}))=0$ pour tout $p>q$, par \cite[0.3]{MR0412191}\,; \item $H^{0}(X, \HH^{q}(\mbb{Z}))=0$ pour tout $q>0$, par \cite[Proposition 3.3(i)]{CTVoisin2012IHC}\,; \item $H^{1}(X, \HH^{q}(\mbb{Z}))=0$ pour tout $q>1$, par le lemme \ref{lem:H1i}, \end{itemize} on voit que dans cette suite spectrale, il n'y qu'une seule fl\`eche $d_{2}\colon H^{2}(X, \HH^{5}(\mbb{Z}))\to H^{4}(X, \HH^{4}(\mbb{Z}))$ qui pourrait \^etre non nulle. Montrons que $H^{2}(X, \HH^{5}(\mbb{Z}))$ est un groupe de torsion par un argument similaire \`a celui du lemme \ref{lem:H1i}: on fait agir les deux c\^ot\'es de (\ref{eqn:DD}) sur le groupe $H^{2}(X, \HH^{5}(\mbb{Z}))$: \begin{itemize} \item l'action $\Delta_{X}^{*}$ est l'identit\'e\,; \item l'action $(x\times X)^{*}$ se factorise par $H^{-3}(\{x\}, \HH^{0}_{\{x\}}(\mbb{Z}))=0$\,; \item l'action $(l\times h)^{*}$ se factorise par $H^{-2}(l, \HH^{1}_{l}(\mbb{Z}))=0$\,; \item l'action $(Z')^{*}$ se factorise par $H^{2}(\tilde T, \HH^{5}_{\tilde T}(\mbb{Z}))$, o\`u $\tilde T$ est une r\'esolution des singularit\'es de $T$, comme dans le d\'ebut de la d\'emonstration de la proposition \ref{prop:DeTorsion}. Or le faisceau $\HH^{5}_{\tilde T}(\mbb{Z})=0$ par \cite{MR0177422}, car $\dim \tilde T=3<5$. \end{itemize} Par cons\'equent, $H^{2}(X, \HH^{5}(\mbb{Z}))$ est bien de torsion et donc n'admet pas de morphisme non nul vers le groupe ab\'elien libre $H^{4}(X, \HH^{4}(\mbb{Z}))$. Par cons\'equent, la suite spectrale est d\'eg\'en\'er\'ee en $E_{2}$. La partie (3) du th\'eor\`eme \ref{main2} est d\'emontr\'ee (\emph{cf.} Proposition \ref{prop:TwoSS}). La d\'eg\'en\'erescence de la suite spectrale \'etant prouv\'ee, le lemme \ref{lem:Hii}, avec les annulations ci-dessus, implique la partie (1) du th\'eor\`eme \ref{main2}. Finalement, la partie (2) du th\'eor\`eme \ref{main2} d\'ecoule de la partie (1), en particulier du fait que tous les termes de la suite spectrale pour le faisceau $\mbb{Z}$ sont sans torsion, et du lemme \ref{lemma:SES}. \end{proof} \bibliographystyle{plain}
\section{Introduction} \label{sec:intro} Ridesharing platforms such as Uber and Lyft are rapidly disrupting traditional forms of transit, completing millions of trips each day. These platforms connect drivers and riders, with both sides in a customer relationship with the platforms. When a rider opens the app and enters an origin and destination, these platforms quote a price for the trip and an estimated wait time. If a rider requests the ride, the platform dispatches a nearby driver to pick up the rider, and if neither side cancels and the trip is completed, payment is made from the rider to the driver through the platform \footnote{The actual practice is somewhat more complicated, in that platforms may operate multiple products, for example, high-end cars, sports utility vehicles, trips shared by multiple riders, etc. Moreover, drivers within even a single class are differentiated (e.g., cleanliness of car, skill of driving), as are riders (e.g., politeness, loud vs.~quiet, safety of neighborhood). We ignore these effects in our model, and assume that, conditioned on the same trip, all drivers are equivalent from the perspective of riders and all riders equivalent from the perspective of drivers. } Comparing with traditional taxi systems, ridesharing platforms significantly increase the fraction of time when drivers have a rider in the back seat, reducing trip costs for riders~\cite{cramer2016disruptive}. The platforms also emphasize the importance of providing reliable transportation. For example, Uber's mission is ``to connect riders to reliable transportation, everywhere for everyone.''\footnote{\url{https://www.uber.com/legal/community-guidelines/us-en/}, visited September 1, 2017.} This mission is also stated as ``to make transportation as ubiquitous and reliable as running water.''\footnote{\url{http://time.com/time-person-of-the-year-2015-runner-up-travis-kalanick/}, visited September 1, 2017.} Lyft's mission is ``to provide the best, most reliable service possible by making sure drivers are on the road when and where you need them most.''\footnote{\url{https://help.lyft.com/hc/en-us/articles/115012926227}, visited September 1, 2017.} Whereas taxi systems have reliable pricing but often unreliable service, these platforms use dynamic ``surge" pricing to guarantee rider wait times do not exceed a few minutes~\cite{rayle2014app}. Moreover, the platforms provide the flexibility for drivers to drive on their own schedule. Uber advertises itself as ``work that put you first--- drive when you want, earn what you need,"\footnote{\url{https://www.uber.com/drive/}, visited December 12, 2017.} and Lyft promises drivers ``To drive or not to drive? It's really up to you."\footnote{\url{https://blog.lyft.com/posts/reasons-to-drive-with-lyft}, visited December 12, 2017.} Despite their success, there remain a number of problems with the pricing and dispatching rules governing the ridesharing platforms, leading in turn to various kinds of market failure. A particular concern, is that trips may be mis-priced relative to each other, incentivizing drivers to strategize~\cite{cook2018gender,chaudhari2018putting} \footnote{There are also other incentive problems, including inconsistencies across classes of service, competition among platforms, drivers' bonuses and off-platform incentives. In the interest of simplicity, we only model a single class of service and ignore cross-platform competition.} For example, many platforms hide trip destinations from drivers before the pick-up. However, experienced drivers will call riders to ask about trip details, and cancel those that are not worthwhile~\cite{cook2018gender}. Drivers also strategize in the following scenarios, where there is spatial imbalance and temporal variation of rider trip flows: \vspace{-0.2em} \begin{enumerate}[$\bullet$] \setlength\itemsep{0.0em} \item (spatial mis-pricing) when the price is substantially higher for trips that start in location $A$ than an adjacent location $B$, drivers in location $B$ that are close to the boundary will decline trips. This spatial mis-pricing leads to drivers' ``chasing the surge''--- turning off a ridesharing app while relocating to another location.\footnote{\url{http://maximumridesharingprofits.com/advice-new-uber-drivers-dont-chase-surge/}, visited Jan 8, 2018; \url{https://www.youtube.com/watch?v=qI094xqMiPA}, visited Jan 8, 2018.} % \item (temporal mis-pricing) when large events such a sports game will soon end, drivers can anticipate that prices will increase in order to balance supply and demand. In this case, drivers will decline trips and even go off-line in order to wait in place. % \item (network externalities) the origin-based dynamic ``surge pricing" used in standard practice does not correctly factor market conditions at the destination of a trip. As a result, drivers decline trips to destinations where the continuation payoffs are low, e.g. quiet suburbs with low prices and long wait times.% \footnote{\label{fn:turn_off_phone}\href{https://therideshareguy.com/uber-drops-destination-filters-back-to-2-trips-per-day/}{https://therideshareguy.com/uber-drops-destination-filters-back-to-2-trips-per-day/}, visited September 1, 2018; \href{https://www.marketwatch.com/story/new-york-citys-new-uber-rules-could-make-those-5-cancellation-fees-go-away-2018-08-16}{https://www.marketwatch.com/story/new-york-citys-new-uber-rules-could-make-those-5-cancellation-fees-go-away-} \url{2018-08-16}, visited September 1, 2018. } \end{enumerate} \if 0 \footnote{\dcp{I think we should drop this FN. it doesn't fit into temporal or spatial problems, and we don't address it. could mention in conclusion of paper instead.} Current ridesharing platforms are also susceptible to driver collusion, where drivers find a way to coordinate in order to reduce supply and increase prices--- turning off their apps and waiting for prices to increase. See \url{http://www.wsoctv.com/news/9-investigates/wednesday-9-investigates-factors-affecting-ubers-surge-pricing/286958015} (accessed July 22, 2017) as well as social media posts teaching riders how to do this \url{https://www.reddit.com/r/uberdrivers/comments/2dd171/driver_driven_surge_pricing/}.} \fi These kinds of mis-pricing undercut the mission of reliable transport, with even high willingness-to-pay riders unable to get access to reliable service for certain trips, such as trips leaving the stadium before a game ends, and trips going to a quiet suburb.\footnote{A related consideration is that these opportunities for strategic behavior make it very difficult for platforms to introduce additional mechanisms to accomodate idiosyncratic driver preferences, for example over location. Rather, these mechanisms are used as tools for strategic behavior by drivrs. \url{https://www.uber.com/blog/180-days-of-change-more-flexibility-and-choice/}, visited September 1, 2018; \url{https://therideshareguy.com/uber-drops-destination-filters-back-to-2-trips-per-day/}, visited September 1, 2018.} This can also lead to inequity, with demonstrated learning effects leading to differences in long-run earnings (e.g. a gender gap in driver hourly earnings~\cite{cook2018gender}), with potential consequences around driver churn from the platform. The imposition of cancellation penalties on drivers does not solve these problems, since drivers can always go offline, or choose not to participate in the platform from certain locations or times.$^{\ref{fn:turn_off_phone}}$ We conceptualize many of the problems with current platforms as arising from prices failing to be appropriately ``smooth'' in space and time--- if prices for trips are higher in one location then they should be appropriately higher in adjacent locations; if demand would soon increase in a location then the current prices should already be appropriately higher; and if destinations differ in continuation payoffs then trip prices to these destinations need to reflect this. With appropriately smooth prices, drivers who retain the flexibility to choose when to work will choose to accept any trip to which they are dispatched (recall that drivers, too, are customers of the platform). Dispatching decisions are also suboptimal on current platforms; sending drivers away from a sports stadium five minutes before a game ends at low prices is inefficient, for example, and driver behavior may actually be moving a system back towards efficiency. Correctly designed, ridesharing platforms can succeed in optimally orchestrate trips in a centralized manner, without having the power to tell drivers what to do. \subsection{Our results} We propose the \emph{Spatio-Temporal Pricing} (STP) mechanism for dispatching and pricing in the context of a ridesharing platform, addressing the problem of incentive alignment for drivers in the presence of spatial imbalance and temporal variation of rider trip flows. The STP mechanism has the following properties: \vspace{-0.2em} \begin{enumerate}[$\bullet$] \setlength\itemsep{0.0em} \item welfare-optimality: maximizing total rider values minus driver costs \item incentive-alignment: drivers will always choose to accept any dispatched trips \item envy-freeness: drivers at the same location and time do not envy each other's future payoff; riders requesting the same trips do not envy each other's outcomes \item core-selecting: no coalition of riders and drivers can make a better plan among themselves \item robustness: the mechanism updates the plans after deviations from the original dispatches \item temporal-consistency: plans are computed and updated based on the current state but not past history, without using penalties or time-extended contracts \end{enumerate} Welfare optimality and incentive alignment are standard desiderata. % For the others, we consider envy-freeness and core-selecting to be of special importance for sharing economy systems such as ridesharing platforms. These properties both relate to fairness. An envy-free mechanism is fair, removing the variation in drivers' income that depends on lucky dispatches or from learning by doing. A core outcome is fair, in that no group of riders and drivers could do better by breaking away and operating their own ridesharing economy. Even given incentive alignment, we consider robustness to be important in the face of unmodeled effects, erroneous predictions, or mistakes by participants. By being robust, the mechanism is able to ensure the other properties from any history onward. Without this, any solution would be necessarily brittle and poorly suited to practice. Finally, temporal-consistency is important, since using penalties and threatening to fire drivers or to shut down the system are incompatible with the spirit of the gig economy, and the the real-time flexibility of being able to choose when to work. \medskip We work in a complete information, discrete time, multi-period and multi-location model. Thus, the challenge addressed in this paper is one of promoting desirable behavior in the absence of time-extended contracts, and not one of information asymmetry. At the beginning of each time period, based on the history, current positioning of drivers, and current and future demand, the STP mechanism dispatches each available driver to a rider trip, or to relocate, or to exit the platform for the planning horizon. The mechanism also determines a payment to be made if the driver follows the dispatch. Each driver then decides whether to follow the suggested action, or to decline and stay or relocate to any location, or to exit the platform. After observing the driver actions in a period, the mechanism collects payments from the riders and makes payments to the drivers. The main assumptions that we make are: (i) complete information about supply and demand over a finite planning horizon, (ii) impatient riders, who need to be picked-up at a particular time and location (and without preferences over drivers), and (iii) drivers who are willing to take trips until the end of the planning horizon, and with no intrinsic preference for locations or passengers, and no heterogeneity in costs. We allow for heterogeneity in rider values and trip details (origin, destination, and time). For drivers, they can become available at different times and locations, and can also differ in whether they are already driving in the platform (for example, finishing a trip), or have not yet joined and thus need to make an entry decision (for example, the driver will be dropping off a child at school at a specific location and time, and is willing to drive afterwards). We also allow a driver whom is asked to exist the platform earlier than their intended exit time to incur a cost, modeling the forgone opportunity of outside options after driving for some time. \if 0 \hma{Hmm we are modeling trip costs as costs for driving some trip without a rider, therefore, the base payment subtracting from riders' willingness to pay should only cover the differences in drivers' costs for a relocation trip v.s. completing the same trip with a rider. Updated the following paragraph. How does it work and is it too long? The Original: A rider's value is modeled as her willingness-to-pay, over and above a base payment that covers driver costs for fuel, wear-and-tear, time, and so forth. The prices determined by the STP mechanism are the payments collected on top of the base payments.} \fi A rider's value is modeled as her willingness-to-pay, over and above a base payment that covers a drivers' extra costs for picking up a rider (extra wear and tear, inconvenience, etc), in comparison to the cost of driving the same trip as relocation without a rider (fuel, time, and so forth). This base payment is transferred directly to the driver, so that all drivers completing the same trip with or without a rider incur the same trip cost. The prices determined by the STP mechanism are the payments collected on top of the base payments. We first prove the existence of anonymous, origin-destination, competitive equilibrium (CE) prices, allowing the unit price of a trip to depend on market conditions at both the origin and destination.\footnote{The idea that the unit price for a trip might depend on the destination is already familiar in taxi systems, with trips to the suburbs billed with a surcharge to reflect that drivers may need to return to the city without a fare. Origin-destination pricing also seems practical. Indeed, ridesharing platforms are moving in this direction, and this is facilitated by the movement to quoting a total payment for a trip rather than an origin-based surge multiplier. \url{https://newsroom.uber.com/upfront-fares-no-math-and-no-surprises/}, visited September 1, 2017; \url{https://blog.lyft.com/posts/now-live-see-your-ride-total}, visited September 1, 2017; \href{https://www.bloomberg.com/news/articles/2017-05-19/uber-s-future-may-rely-on-predicting-how-much-you-re-willing-to-pay}{https://www.bloomberg.com/news/articles/2017-05-19/uber-s-future-may-rely-on-predicting-how-much-you-re-} \url{willing-to-pay}, visited September 1, 2017.} The STP mechanism users {\em driver-pessimal CE prices}, recomputing a driver-pessimal CE plan in the event of any deviations from the current plan. The mechanism induces an extensive-form game among the drivers, where the total payoff to each driver is determined by the mechanism's dispatch and payment rules. The main result is that the STP mechanism satisfies all the desiderata outlined above. Somewhat surprisingly, the use of driver-pessimal CE prices (vs., for example, driver-optimal CE prices as in Vickrey-Clarke-Groves mechanisms) is essential for achieving our main result, that accepting the mechanism's dispatches at all times forms a subgame-perfect equilibrium among the drivers. The proof of incentive alignment makes use of the $M^\natural$ concavity of min-cost flow objectives~\cite{murota2003discrete}. The same connection to min-cost flow leads to an efficient algorithm to compute an optimal dispatch plan and prices, and to operationalize the STP mechanism. \medskip The rest of this paper is organized as follows. After a brief discussion on related work, we introduce the model in Section~\ref{sec:preliminaries}, and illustrate through an example that a myopic pricing mechanism, which naively clears the market for each location without considering future demand and supply, fails to be welfare-optimal or incentive aligned. In Section~\ref{sec:static_mech}, we formulate the optimal planning problem and establish integrality properties of a linear-programming relaxation (Lemma~\ref{thm:lp_integrality}). We prove a welfare theorem, that a plan is welfare-optimal if and only if it is supported by some anonymous trip prices in competitive equilibrium (CE) (Lemma~\ref{thm:optimal_plans}). Optimal CE plans always exist and are efficient to compute. We also prove that drivers' total utilities among all CE plans form a lattice (Lemma~\ref{thm:opt_pes_plans}), and that the CE outcomes and the core are utility-equivalent (Lemma~\ref{lem:core_equal_CE}). A class of static CE mechanisms are discussed, that implement an optimal CE plan in dominant strategy (Theorem~\ref{thm:static_CE_mech}), but may fail to be welfare-optimal or envy-free after driver deviations. Section~\ref{sec:st_pricing} introduces the STP mechanism, and establishes that the STP mechanism is subgame-perfect incentive compatible, and is also welfare-optimal, envy-free, core-selecting, individually rational and budget balanced from any history onward (Theorem~\ref{thm:SPE}).% \footnote{The STP mechanism balances budget. Alternatively, we many think about the ridesharing platform taking a fixed fraction of the driver surplus. This does not affect the results presented in this paper, and the equilibrium outcome under STP still resides in some $\epsilon$-core of the market, depending on the cut taken by the platform.} We also provide an impossibility result, that no dominant-strategy mechanism has the same economic properties (Theorem~\ref{thm:impossibility_of_DSE}), followed by discussions on the effect of relaxing the model assumptions. An empirical analysis conducted through simulation (Section~\ref{sec:illustrations}) suggests that the STP mechanism can achieve significantly higher social welfare than a myopic pricing mechanism, and highlights the failure of incentive alignment due to non-smooth prices in myopic mechanisms. We consider three stylized scenarios: the end of a sports event, the morning rush hour, and trips to and from the airport with unbalanced flows. We conclude in Section~\ref{sec:conclusion}. Omitted proofs, additional examples, discussions, relations to the literature and simulation results are provided in the Appendix. \subsection{Related Work} \label{sec:related_work} To the best of our knowledge, this current paper is unique in that it considers both multiple locations and multiple time periods, along with rider demand, rider willingness-to-pay, and driver supply that can vary across both space and time. This leads to the focus of the present paper on the design of a ridesharing mechanism with prices that are smooth in both space and time. Earlier, Banerjee et al.~\cite{banerjee2015pricing} adopt a queuing-theoretic approach in analyzing the effect of dynamic pricing on the revenue and throughput of ridesharing platforms, assuming a single location and stationary system state. In this context, the optimal dynamic pricing strategy, where prices can depend on supply and demand conditions, does not achieve better performance than the optimal static pricing strategy when the platform correctly estimates supply and demand. However, dynamic pricing is more robust to fluctuations and to mis-estimation of system parameters. By analizing a two-location, stationary state queueing model, Af{\`e}che et al.~\cite{afeche2018ride} study the impact of platform control on platform revenue and driver income. By analyzing the equilibrium outcome under a continuum model (supply and demand), and with stationary demand and unlimited driver supply (at fixed opportunity costs), Bimpikis et al.~\cite{Bimpikis2016} in independent, contemporaneous work study the steady-state and show that a ridesharing platform's profit is maximized when the demand pattern across different locations is balanced. In simulation they show that, in comparison to setting a single price, pricing trips differently depending on trip origins improves the platform's profit. The same simulation also shows that there is not a substantial, additional gain from using origin-destination based pricing in their model. Our model is quite distinct, in that it is not a continuum model, does not have unlimited driver supply, and is not stationary. These authors explain that the solution to optimal origin-destination prices in their model only has dimensionality linear in the number of locations, but do not offer a complete theory to explain their simulation results. Banerjee et al.~\cite{banerjee2017pricing}, also independent and contemporaneous, model a shared vehicle system as a continuous-time Markov chain, and establish approximation guarantees for a static, state-independent pricing policy (i.e. fixed prices that do not depend on the spatial distribution of cars), w.r.t. the optimal, state-dependent policy. Castillo et al.~\cite{castillo2017surge} study the impact of myopically dispatching the closest drivers to rider requests. In particular, they discuss a ``wild goose chase'' phenomena. When demand much exceeds supply, myopic dispatching means that drivers spend too much time driving to pick up riders instead of carrying riders on trips, which leads to decreased social welfare and revenue to the platform. The theoretical model assumes a stationary state, where driver supply is driven by hourly earnings, rider demand depends on trip prices and wait times, and the wait time increases as the number of idle cars decreases. They do not have an explicit model of location. Empirical evidence is provided by analyzing Uber data. The wild goose chase is an effect of the ridesharing platform always dispatching a driver as soon as any rider requests a ride. The authors establish the importance of dynamic pricing when using this kind of myopic dispatching scheme, in keeping enough cars idle to avoid the inefficiency of long pick-ups, and show this is superior to other possible solutions, for example limiting the pick-up radius. \if 0 \hma{Labor market papers:} \begin{itemize} \item \cite{hall2017labor} show that after changes in base payment rates of Uber rides in US cities, there is a short-term impact on driver earnings, however, the supply of labor market equilibrates and after roughly 8 weeks driver earnings returns to the pre-change level. \item \cite{hall2016analysis} provides the first comprehensive analysis of the labor market for Uber's driver partners: demographics, hourly earnings, working hours, and reasons for joining Uber. \item \cite{cohen2016using} estimated the consumer surplus generated by the Uber platform, using individual-level data to estimate demand elasticity. \end{itemize} \fi There are various empirical studies of the Uber platform as a two-sided marketplace, analyzing Uber's driver partners~\cite{hall2016analysis}, the labor market equilibrium~\cite{hall2017labor}, consumer surplus~\cite{cohen2016using} and the commission vs. medallion lease based compensation models~\cite{angrist2017uber}. By analyzing the hourly earnings of drivers on the Uber platform, Chen et al.~\cite{chen2017value} show that drivers' reservation wages vary significantly over time, and that the real-time flexibility of being able to choose when to work increases both driver surplus and the supply of drivers; Cook et al.~\cite{cook2018gender} show that driving speed, preferred time and location to drive, driver experience and their ability to strategically canceling rides together contribute to a 7\% gender gap in hourly earnings. In regard to dynamic pricing, Chen and Sheldon~\cite{chen2015dynamic} show, by analyzing the trips provided by a subset of driver partners in several US cities from 2014-2015, that surge pricing increases the supply of drivers on the Uber platform at times when the surge pricing is high. A case study~\cite{hall2015effects} into an outage of Uber's surge pricing during the 2014-2015 New Year's Eve in New York City found a large increase in riders' waiting time after requesting a ride, and a large decrease in the percentage of requests completed. The dynamic variations on the VCG mechanism~\cite{athey2013efficient,bergemann2010dynamic,cavallo2009efficient} truthfully implement efficient decision policies, where agents receive private information over time. These mechanisms are not suitable for our problem, however, because some drivers may be paid negative payments for certain periods of time. The payment to an agent in a single period in the dynamic VCG mechanism is equal to the flow marginal externality imposed on the other agents by its presence in the current period~\cite{cavallo2009efficient}. The problem in our setting is that the existence of a driver for only one period may exert negative externality on the rest of the economy by inducing suboptimal positioning of the rest of the drivers in the subsequent time periods. See Appendix~\ref{appx:dynamic_vcg} for examples and discussions. The literature on {\em trading networks} studies economic models where agents in a network can trade via bilateral contracts~\cite{hatfield2013stability,hatfield2015chain,ostrovsky2008stability}. Efficient, competitive equilibrium outcomes exist when agents' valuation functions satisfy the ``full substitution" property, and the utilities of agents on either end of an acyclic network form lattices. Under proper assumptions, the optimal dispatching problem in ridesharing can be reduced to a trading network problem, where drivers and riders trade the right to use a car for the rest of the planning horizon (see Appendix~\ref{appx:trading_network}). However, the underlying network in the ridesharing problem evolves as time progresses, and to our knowledge, the dynamics and incentives in trading networks with time-varying networks are not studied in the literature. Principal-agent problems have been studied extensively in contract theory~\cite{bolton2005contract,salanie2005economics}, where problems with information asymmetry before the time of contracting are referred to as {\em adverse selection}, and problems where asymmetric information or hidden action arise after the time of contracting are referred to as {\em moral hazard}. Contracts specify how agents are going to be rewarded or penalized based on observed performance measures. In the setting where contracts cannot be perfectly enforced, {\em relational incentive contracts}~\cite{levin2003relational} have also been studied, which are self-enforcing by threatening to terminate an agent following poor performance. In our model, there are neither hidden actions nor asymmetric information. Instead, the challenge we address is one of incentive alignment in the absence of contracts. We insist on retaining flexibility for drivers, in the spirit of the customer relationship with platforms and the Gig economy, with drivers free to decide on their own actions without incurring penalties or termination threats. \section{Preliminaries} \label{sec:preliminaries} Let $\horizon$ be the length of the planning horizon, starting at time $t = 0$ and ending at time $t = \horizon$. We adopt a discrete time model, and refer to each time point $t$ as ``time $t$", and call the duration between time $t$ and time $t + 1$ a \emph{time period}. Trips start and end at time points.\footnote{We may think about each time period as $\sim5$ minutes, and with $\horizon = 6$ the planning horizon would be half an hour.} Denote $[\horizon] = \{0, 1, \dots, \horizon \}$ and $[\horizon - 1] = \{ 0, 1, \dots, \horizon - 1 \}$. Let $\loc = \{A, B, \dots, \}$ be a set of $|\loc|$ discrete locations, and we adopt $a$ and $b$ to denote generic locations. For all $a,b \in \loc$ and $t \in [\horizon]$, the triple $(a,b,t)$ denotes a \emph{trip} with origin $a$, destination $b$, starting at time $t$. Each trip can represent (i) taking a rider from $a$ to $b$ at time $t$, (ii) relocating without a rider from $a$ to $b$ at time $t$, and (iii) staying in the same location for one period of time (in which case $a = b$). Let the distance $\dist: \loc \times \loc \rightarrow \mathbb{N} $ be the time to travel between locations, so that trip $(a,b,t)$ ends at $t + \dist(a, b)$.\footnote{We can also allow the distance between a pair of locations to change over time, modeling the changes in traffic conditions, i.e. a trip from $a$ to $b$ starting at time $t$ ends at time $t + \dist(a,b,t)$. This does not affect the results presented in this paper, and we keep $\dist(a,b)$ for simplicity of notation.} We allow $\dist(a, b) \neq \dist(b, a)$ for locations $a \neq b$, modeling asymmetric traffic flows. We assume $\dist(a, b) \geq 1$ and $\dist(a,a) = 1$ for all $a, b \in \loc$. $\trips \triangleq \set{(a,b,t)}{a \in \loc, ~b \in \loc, ~ t \in \{0, 1,\dots, \horizon - \dist(a,b)\}}$ denotes the set of all feasible trips within the planning horizon. Let $\driverSet$ denote the set of drivers, with $\nd \triangleq |\driverSet|$. Each driver $i \in \driverSet$ is characterized by {\em type} $\theta_i = (\driverEntrance_i, \re_i, \te_i, \tl_i)$--- driver $i$ is able to enter the platform at location $\re_i$ and time $\te_i$, and plans to exit the platform at time $\tl_i$ (with $\te_i < \tl_i$). $\driverEntrance_i$ indicates driver $i$'s entrance status. A driver with $\driverEntrance_i = 0$ has not yet entered the platform, and needs to make an entry decision. A driver with $\driverEntrance_i = 1$ has already entered the platform, and will become available to pick up again at $(\re_i, \te_i)$ (she may be completing an earlier trip, or relocating to another location). Here we make the assumption (S1) that {\em driver types are known to the mechanism and that all drivers stay until at least the end of planning horizon, and do not have an intrinsic preference over location, including where they finish their last trip in the planning horizon.} Any driver who completes a trip $(a,b,t) \in \trips$ without a rider incurs a trip cost $c_{a,b,t} \geq 0$, which models the cost of time, driving, fuel, etc. A driver who has already entered the platform may exit earlier than her intended exit time, in which case she will not be able to complete any trip in the remaining periods of the planning horizon. Exiting $\Delta$ periods earlier than time $\horizon$ incurs a cost of $\kappa_\Delta \geq 0$ (with $\kappa_0 = 0$), modeling the the forgone opportunity of outside employment options, after driving for the platform for some time. A driver with $\driverEntrance_i = 0$ who does not enter the platform at $(\re_i, \te_i)$ does not incur any cost, and will not enter at a later time. Drivers have quasi-linear utilities, and seek to maximize the total payments received over the planning horizon minus the total costs. Denote $\riders$ as the set of riders, each intending to take a single trip during the planning horizon. The {\em type} of rider $j \in \riders$ is $(\origin_j, \dest_j, \tr_j, \val_j)$, where $\origin_j$ and $\dest_j$ are the trip origin and destination, $\tr_j$ the requested start time, and $\val_j\geq 0$ the {\em value} for the trip. We assume (S2) {\em that riders are impatient, only value trips starting at $\tr_j$, are not willing to relocate or walk from a drop-off point to their actual, intended destination, and do not have preference over drivers.} The value $\val_j$ models the willingness-to-pay of the rider, over-and-above a base payment for a trip, which covers additional cost a driver incurs driving a rider from $\origin_j$ to $\dest_j$ at time $\tr_j$ (in comparison to relocating from $\origin_j$ to $\dest_j$ at time $\tr_j$).\footnote{This base payment is made directly from a rider to the driver that picked her up, so that the cost any driver incurs for any trip $(a,b,t) \in \trips$ is always $c_{a,b,t}$, regardless of whether a rider is in the back seat. The prices that we design, as a result, are the amounts that the riders pay on top of the base payments.} Rider utility is quasi-linear, with utility $\val_j - \price$ to rider $j$ for a completed trip at (incremental to base) price $\price$. We assume the platform has complete information about supply and demand over the planning horizon (travel times, trip costs, driver and rider types, including driver entry during the planning horizon). We assume drivers have the same information, and that this is common knowledge amongst drivers.\footnote{More generally, it is sufficient that it be common knowledge amongst drivers that the platform has the correct information.} Unless otherwise noted, we assume properties~(S1), (S2), and complete, symmetric information throughout the paper, and discuss the effect of relaxing these assumptions in Section~\ref{sec:discussions}. \medskip At each time $t$, a driver is \emph{en route} if she started her last trip from $a$ to $b$ at time $t'$ (with or without a rider), and $t < t' + \dist(a,b)$. A driver is \emph{available} if she has entered or is able to enter the platform, and has not yet exited, and is not \emph{en route}. A driver who is available at time $t$ and location $a$ is able to complete a pick-up at this location and time. We allow a driver to drop-off a rider and pick-up another rider in the same location at the same time point (see Appendix~\ref{appx:cont_time}). A {\em path} is a sequence of tuples $(a,b,t)$, representing driver entrance, exit, and the trips she takes over the planning horizon. Let $\pathSet_i$ denote the set of all \emph{feasible paths} of driver $i$, with $\path_{i,k}\in \pathSet_i $ to denote the $k\th$ feasible path. The path $\path_{i,0}$ includes no trip: for a driver with $\driverEntrance_i = 0$, $\path_{i,0}$ models the option to not enter the platform at all; for a driver s.t. $\driverEntrance_i = 1$, $\path_{i,0}$ models the option exit immediately at $(\re_i, \te_i)$. For each $k = 1, \dots, |\pathSet_i|$, $\path_{i,k}$ is a path that starts $(\re_i, \te_i)$, with the starting time and location of each successive trip equal to the ending time and location of the previous trip. Denote $(a,b,t) \in \path_{i,k}$ if path $\path_{i,k}$ includes (or {\em covers}) trip $(a,b,t)$, and let $\pathCost_{i,k}$ be the total cost of the $k\th$ path to driver $i$. We know that $\pathCost_{i,0} = 0$ if $\driverEntrance_i = 0$, $\pathCost_{i,0} = \kappa_{T - \te_i}$ if $\driverEntrance_i = 1$, and for $k>1$, $\pathCost_{i,k} = \sum_{(a,b,t)\in \trips} c_{a,b,t}\one{(a,b,t) \in \path_{i,k}} + \kappa_\Delta$, if path $\path_{i,k}$ ends $\Delta$ periods earlier than $T$. Driver $i$ that takes the path $\path_{i,k}$ is able to pick up rider $j$ if $(\origin_j, \dest_j, \tr_j) \in \path_{i,k}$, however, a path specifies only the movement in space and time, and does not specify whether a rider is picked up for each of the trips on the path. Let an \emph{action path} for driver $i$ be a sequence of tuples, each of them can either be of the form $(a,b,t)$, representing a relocation trip from $a$ to $b$ at time $t$ without a rider, or be of the form $(a,b,t,j)$, in which case the driver sends rider $j$ from $a$ to $b$ at time $t$ (thus requiring $(a,b,t) = (\origin_j, \dest_j, \tr_j)$). Let $\tilde{\pathSet}_{i}$ be the set of all feasible action paths of driver $i$. For an action path $\tilde{z}_i \in \tilde{\pathSet}_{i}$, denote $(a,b,t) \in \tilde{z}_i$ or $(a,b,t,j) \in \tilde{z}_i$ if the action path includes a relocation or rider trip from $a$ to $b$ at time $t$. A driver taking action path $\tilde{z}_i$ that is \emph{consistent} with path $\path_{i,k}$ (i.e. results in the same movement in space and time) incurs a total cost of $\pathCost_{i,k}$. \begin{example} \label{exmp:toy_econ_1} \newcommand{0.8}{0.8} \newcommand{3.5cm}{3cm} \newcommand{\vdistI}{2cm} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2cm,semithick][font = \small] \tikzstyle{vertex}=[fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistI, scale=0.8] {$B,0$}; \node[state] (A1) [right of=A0, node distance = 3.5cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 3.5cm, scale=0.8] {$B,1$}; \node[state] (A2) [right of=A1, node distance = 3.5cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 3.5cm, scale=0.8] {$B,2$}; \path (A0) edge node[pos=0.5, sloped, below] {$\val_1=5$} (A1); \path (A1) edge node[pos=0.5, sloped, below] {$\val_2=6$} (A2); \path (A0) edge node[pos=0.5, sloped, above] {$\val_3=8$} (B2); \node[text width=3cm] at (-0.3, 0) {Driver 1}; \end{tikzpicture} \caption{The economy in Example~\ref{exmp:toy_econ_1}, with two locations $A$, $B$, two time periods and three riders. \label{fig:toy_econ_1}} \end{figure} The planning horizon is $\horizon = 2$ and there are two locations $\loc = \{A, B\}$ with distance $\dist(A,A) = \dist(B,B) = 1$ and $\dist(A,B) = \dist(B,A) = 2$. See Figure~\ref{fig:toy_econ_1}. Trip costs are given by $c_{a,b,t} = 2 \dist(a,b)$ for all $(a,b,t) \in \trips$, and the opportunity cost of exiting early is $\kappa_\Delta = \Delta$. There is one driver, who has not yet entered the platform (i.e. $\driverEntrance_1 = 0$), but is able to enter at time $\te_1 = 0$ at location $\re_1 = A$, and leaves at time $\tl_1 = 2$. There are three riders: \vspace{-0.5em} \begin{multicols}{2} \begin{itemize} \setlength\itemsep{0.0em} \item Rider 1: $\origin_1 = A$, $\dest_1 = A$, $\tr_1 = 0$, $\val_1=5$, \item Rider 2: $\origin_2 = A$, $\dest_2 = A$, $\tr_2 = 1$, $\val_1=6$, \item Rider 3: $\origin_3 = A$, $\dest_3 = B$, $\tr_3 = 0$, $\val_3 = 8$. \end{itemize} \end{multicols} \vspace{-0.5em} In addition to not entering the platform at all--- path $\path_{1,0}$ with cost $\pathCost_{1,0} = 0$, there are three more feasible paths for driver 1: $\path_{1,1} = ((A,A,0),~(A,A,1))$, $\path_{1,2} = ((A,B,0))$, and $\path_{1,3} = ((A,A,0))$. In $\path_{1,3}$, the driver exits one period before the end of planning horizon. The path costs are $\pathCost_{1,1} = c_{A,A,0} + c_{A,A,1} = 2$, $ \pathCost_{1,2} = c_{A,B,0} = 4$, and $\pathCost_{1,3} = c_{A,A,0} + \kappa_1 = 3$. Path $((A,A,0),~(A,B,1))$ is infeasible, since the last trip ends later than the driver's leaving time. Similarly, paths $((A,B,0),~(B,B,1))$ and $((A,A,0), (B,B,1))$ are infeasible. In addition to not entering, there are eight feasible actions paths of rider $1$. $((A,B,0))$, relocating from $A$ to $B$ at time $0$, and $((A,B,0,3))$, sending rider $3$ from $A$ to $B$ at time $0$, are both consistent with the path $\path_{1,2}$, and both have cost $4$. Four action paths, $((A,A,0),(A,A,1))$, $((A,A,0,1),(A,A,1))$, $((A,A,0),(A,A,1,2))$, $((A,A,0,1),(A,A,1,2))$, are consistent with $\path_{1,1}$ and have cost $4$. Both $((A,A,0))$ and $((A,A,0,1))$ are both consistent with $\path_{1,3}$ and have cost $3$. \qed \end{example} We now provide an informal timeline of a {\em ridesharing mechanism} (see Section~\ref{sec:st_pricing} for a formal definition). At each time point $t \in [\horizon - 1]$, given the history of trips, current driver locations, driver availability status, and information about future driver supply and rider demand for trips: \begin{enumerate}[1.] \setlength\itemsep{0.0em} \item The ridesharing mechanism determines for each rider with trip start time $t$, whether a driver will be dispatched to pick her up, and if so, the price of her trip. \item The mechanism dispatches available drivers to pick up riders, to relocate, or to exit (for those already in the platform), or not to enter (for those have not entered, with $\te_i = t$ and $\driverEntrance_i = 0$). The mechanism also determines the payments offered to drivers for accepting the dispatches. % \item Each available driver decides whether to accept the dispatch, or to deviate and either stay in the same location, or relocate, or exit/not enter. A driver may still decide to enter the platform even if asked not to do so. The mechanism collects and makes payments based on driver actions. \end{enumerate} \if 0 \dcp{in above, should we be explicit about the idea that drivers can also simply decline to participate (``turn off app'') ... it is only those who are active in the platform who can be dispatched} \hma{I just realized that I had never thought about this. I think this is quite tricky. It is like splitting each time point into two phases. In the first, each driver makes a decision on whether to turn off the app. Then the mechanism determines the dispatches, and then the dispatched drivers decide whether to accept the dispatch, or to decline and do whatever they want. Then we would need to claim that under our mechanism, drivers would all stay online during the first phase, and then all decide to accept during the second phase. I think we have this guarantee as long as we assume when the mechanism is doing the computation in the middle of the two phases, for all drivers that had already turned off their apps, the mechanism already know where they are relocating to and when they would turn on the app again. Not sure if it's possible to describe this here in a simple manner...} \hma{Last time we discussed if we would still have the guarantees if the mechanism assumes that the drivers are gone forever when it's doing the computation...This wasn't totally trivial... I tried to come up with a quick proof and didn't succeed, but I didn't find a counter example either.}\dcp{not a big deal} \fi Any undispatched, available driver makes their own choices of actions. We assume that any driver already \emph{en route} will continue their current trip. A driver's payment in a period in which the driver declines a dispatch is zero, so that drivers are not charged penalties for deviation. \if 0 \dcp{i don't think we need these informal things here. wait for formal definitions. commented out, but note that you might want text from the `we adopt incentive' footnote.} Informally, we seek ridesharing mechanisms that have the following desired properties: \begin{itemize} \item \emph{Efficiency}, so that the total value of the riders that are picked up are is maximized. \item \emph{Incentive compatibility} (IC), so that it is always in a driver's and rider's best interest to follow the dispatch(s) of the mechanism.\footnote{We adopt incentive compatibility to describe this property on the driver side, emphasizing the agency of drivers and using the same phrasing that is used in the principal-agent literature for alignment of incentives. In turn, we adopt this phrasing in place of ``individual rationality'' for riders, emphasizing the parallel with the incentive alignment on the driver side. For riders, the IC property implies that the payment charged does not exceed a rider's value for a trip.} \item \emph{Budget balanced} (BB), so that the total payment to drivers does not exceed the total payment collected from riders. \item \emph{envy-free} (EF), so that any pair of drivers who joined the platform at the same location at the same time have the same total payoff in the planning horizon, and no pair of riders prefer each other's trip dispatches and prices. \item \emph{Anonymous trip prices} (ANON), so that all riders picked up for the same trip are charged the same amount, and any driver dispatched the same trip is paid the same amount for the trip. \end{itemize} We formally define these properties properties in Section~\ref{sec:st_pricing}. \fi As a baseline, we define the following myopic pricing mechanism. For each rider $j \in \riders$, denote the per-period surplus of her trip as $\surplus_j \triangleq (\val_j -c_{\origin_j, \dest_j, \tr_j})/\dist(\origin_j, \dest_j)$. \begin{definition}[Myopic pricing mechanism] \label{defn:myopic_mech} At each time point $t \in [\horizon]$, for each location $a \in \loc$, the {\em myopic pricing mechanism} dispatches available drivers at $(a,t)$ to riders with $(\origin_j,\tr_j) = (a,t)$ and $\surplus_j \geq 0$, in decreasing order of $\surplus_j$. The mechanism sets a market clearing rate $\rho_{a,t}$ (i.e. between highest unallocated $\surplus_j$ and lowest allocated $\surplus_j$), and sets prices $\price_{a,b,t} = \rho_{a,t}\dist(a,b) + c_{a, b, t}$ for each destination $b \in \loc$, which is offered to all dispatched drivers and collected from all riders. \end{definition} The market clearing prices may not be unique, and a fully defined myopic mechanism must provide a rule for picking a particular set of prices. This mechanism has anonymous, origin-based pricing, and is very simple in ignoring the need for smooth pricing, or future supply and demand. \begin{example}[Super Bowl example] \label{exmp:super_bowl} \newcommand{0.8}{0.8} \newcommand{3.5}{3.5} \newcommand{2}{2} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \draw[line width=0.25mm] (-1, 2*2+0.8) -- (3.5 * 3 + 1, 2*2+0.8); \node[text width=1.2cm] at (0, 2*2+1.2) {9:50pm}; \node[text width=1.3cm] at (3.5, 2*2+1.2) {10:00pm}; \node[text width=3cm] at (3.5 + 0.2, 5.7) {Super Bowl Ends}; \node[text width=1.3cm] at (3.5*2, 2*2+1.2) {10:10pm}; \node[text width=1.3cm] at (3.5*3, 2*2+1.2) {10:20pm}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = 2 cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = 2 cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 3.5 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 3.5 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 3.5 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 3.5 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 3.5 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 3.5 cm, scale=0.8] {$C,2$}; \node[state] (A3) [right of=A2, node distance = 3.5 cm, scale=0.8] {$A,3$}; \node[state] (B3) [right of=B2, node distance = 3.5 cm, scale=0.8] {$B,3$}; \node[state] (C3) [right of=C2, node distance = 3.5 cm, scale=0.8] {$C,3$}; \node[text width=3cm] at (-0.3, 2 * 2 + 0.2) {{\color{violet} Driver 1}}; \node[text width=3cm] at (-0.3, 2 * 2 - 0.2) {{\color{orange} Driver 2}}; \node[text width=3cm] at (-0.3, 2) {{\color{lightblue} Driver 3}}; \path (C0) edge node[pos=0.53, sloped, above] {{\color{violet}$\boldsymbol{\val_1 \hspace{-0.2em}=\hspace{-0.2em} 20}$}, \hspace{0.7em} {\color{orange} $\boldsymbol{\val_2 \hspace{-0.2em}=\hspace{-0.2em} 30}$}} (B1); \path (B0) edge node[pos=0.17, sloped, above] {$\val_3 \hspace{-0.2em}=\hspace{-0.2em} 10$} (C1); \path (B0) edge node[pos=0.5, sloped, above] {{\color{lightblue} $\boldsymbol{\val_4 \hspace{-0.2em}=\hspace{-0.2em} 20}$}} (A1); \path (B1) edge node[pos=0.5, sloped, above] {{\color{violet} $\boldsymbol{\val_5 \hspace{-0.2em}=\hspace{-0.2em} 20}$} } (B2); \path (C1) edge node[pos=0.5, sloped, above] {$\val_6 \hspace{-0.2em}=\hspace{-0.2em} 100$} (B2); \draw[->] (3.9, 4) to[out=-2, in= 120 ](10.15, 0.1); \node[text width=3cm] at (9, 3.3) {$\val_7 \hspace{-0.2em}=\hspace{-0.2em} 100$}; \node[text width=3cm] at (9.5, 2.9) {$\val_8 \hspace{-0.2em}=\hspace{-0.2em} 90$}; \node[text width=3cm] at (10, 2.5) {$\val_9 \hspace{-0.2em}=\hspace{-0.2em} 80$}; \draw[dashed, thick, violet] (0.27, 2 * 2 - 0.3) -- (3.5 - 0.38, 2 + 0.07 ); \draw[dashdotted, thick, orange] (0.2, 2 * 2 - 0.4) -- (3.5 - 0.38, 2 - 0.1 ); \draw[dotted, thick, lightblue] (0.27, 2 * 1 - 0.3) -- (3.5 - 0.4, + 0.07 ); \draw[dashed, thick, violet] (3.5 + 0.4, 2 - 0.15) -- (3.5 * 2 - 0.35, 2 - 0.15); \draw[dashed, thick, violet](3.5 * 3 + 1.5, 1) -- (3.5 * 3 + 2.3, 1); \draw[dashdotted, thick, orange](3.5*3 + 1.5, 0.5) -- (3.5*3 + 2.3, 0.5); \draw[dotted, thick, lightblue](3.5 * 3 + 1.5, 0) -- (3.5 * 3 + 2.3, 0); \node[text width=0.32cm] at (3.5 * 3 + 2.5, 1.1) {{ \color{violet} $z_1$}}; \node[text width=0.32cm] at (3.5 * 3 + 2.5, 0.6) {{ \color{orange} $z_2$}}; \node[text width=0.32cm] at (3.5 * 3 + 2.5, 0.1) {{ \color{lightblue}$z_3$}}; \if 0 \node[text width=1cm] at (2.5, 2.3) {\emph{5}}; \node[text width=2cm] at (3.5 * 1 + 2.5, 1.5) {{\footnotesize \emph{5}}}; \node[text width=1cm] at (1.3, 2.3) {\emph{10}}; \node[text width=1cm] at (2.5, 0.3) {\emph{10}}; \node[text width=1cm] at (1.5 + 3.5, 2.9) {\emph{100}}; \node[text width=1cm] at (2.5 + 2* 3.5, 0.8) {\emph{200}}; \fi \end{tikzpicture} \caption{A Super Bowl game: time $0$ plan under the myopic pricing mechanism. \label{fig:super_bowl_myopic} } \end{figure} Consider the economy illustrated in Figure~\ref{fig:super_bowl_myopic}, modeling the end of a sports event, with $\horizon = 3$ time periods and three locations. Time $t = 0$ is 9:50pm, and 10 minutes before the Super Bowl ends, and each time period is 10 minutes. There are three locations $A$, $B$ and $C$ with symmetric distances $\dist(A,A) = \dist(B,B) = \dist(C,C) = \dist(A,B) = \dist(B,A) = \dist(B,C) = \dist(C,B) = 1$ and $\dist(A,C) = \dist(C,A) = 2$. Drivers $1$ and $2$ enter at location $C$ at time $0$, while driver $3$ enters at location $B$ at time $0$, with exit times $\tl_i = \horizon$ for all $i \in \driverSet$. At time $1$, many riders with very high values show up at location $C$, where the game takes place. Riders' trips and their willingness to pay are as shown in the figure. Assume the trips cost drivers $10$ per time period, i.e. $c_{a,b,t} = 10\dist(a,b)$ for all $(a,b,t) \in \trips$, and exiting early costs $5$ per period: $\kappa_{\Delta} = 5 \Delta$. Under the myopic pricing mechanism, at time $0$, drivers $1$ and $2$ are dispatched to pick up riders $1$ and $2$ respectively, and driver $3$ is dispatched to pick up rider $4$. At time $1$, driver $1$ picks up rider $5$. Even assuming that drivers exit optimally (i.e. driver $2$ exits at time $2$ at a cost of $\kappa_{1} = 5$, and drivers $2$ and $3$ exit at time $1$ and each incur a cost of $\kappa_{2} = 10$), the total social welfare would be no more than $\val_1 + \val_2 + \val_4 + \val_5 - 10 \times 4 - 5 - 10 - 10 = 25$. The set of market clearing rates for location $C$ at time $0$ determined by a myopic pricing mechanism is $\rho_{C,0} \in [0, \surplus_1] = [0, 10]$, thus the possible market clearing prices for the trip $(C,B,0)$ is $\price_{C,B,0} \in [10,~20]$. The price for the $(B,B,1)$ trip is $\price_{B,B,1} = c_{B,B,1} = 10$, since there is excessive supply. The highest possible total utility to driver $1$ under any myopic pricing mechanism would in fact be $(20-10) + (10-10) - 5 = 5$. At time $1$, since no driver is able to pick up the four riders at location $C$, the lowest market clearing rate is $\rho_{C,1} = \surplus_6 = 90$, thus the prices must be at least $\price_{C,B,1} \geq \rho_{C,1} + c_{C,B,1} = 100$ and $\price_{C,A,1} \geq \dist(C,A)\rho_{C,1} + c_{C,A,1} = 200$. Suppose driver $1$ deviates from the dispatches and stays in location $C$ until time $1$. The mechanism would then dispatch driver $1$ to pick up rider $6$, and driver $1$ would be paid the new market clearing price of $\dist(C,B) \surplus_7 + c_{C,B,1} = 50$. This is a useful deviation, since exiting at time $2$, the utility of driver $1$ is $50 - 10 - 10 - 5 = 25$. Observe that by strategizing, driver $1$ improves the social welfare by making use of information about the future demand and supply. Also observe that the outcome is not in the core: driver $1$ at $(C,1)$ has an incentive to make a side deal with rider $7$, who is willing to pay more than $50$, but is not picked up. \qed \end{example} \section{A Static CE Mechanism} \label{sec:static_mech} In this section, we formulate the optimal planning problem and define competitive equilibrium (CE) prices. We also introduce the \emph{static CE mechanism}, which computes an optimal plan at the start of the planning horizon and does not replan in the future. This makes the static CE mechanism fragile, for example it is not welfare optimal or envy-free forward from a period in which some driver has deviated from the suggested plan. The STP mechanism resolves this concern, combining driver-pessimal CE prices with replanning to provide robustness forward from any history. \subsection{Plans} A {\em plan} describes the paths taken by all drivers until the end of the planning horizon, rider pick-ups, as well as payments for riders and drivers for each trip associated with these paths. Formally, a plan is the 4-tuple $(x, \tilde{z}, \rPayment, \dPayment)$, where: $x$ is the indicator of rider pick-ups, where for all $j \in \riders$, $x_j = 1$ if rider $j$ is picked-up according to the plan, and $x_j = 0$ otherwise; $\tilde{z}$ is a vector of action paths, where $\tilde{z}_i \in \tilde{\pathSet}_i$ is the dispatched action path for driver $i$; $\rPayment_j$ denotes the payment made by rider $j$, $\dPayment_{i,t}$ denotes the payment made to driver $i$ at time $t$, and let $\dPayment_i \triangleq \sum_{t = 0}^\horizon \dPayment_{i,t}$ denote the total payment to driver $i$. If $\tilde{z}_i$ is consistent with $\path_{i,k}$, the $k\th$ feasible path of driver $i$, then the driver incurs a total cost of $\pathCost_{i,k}$, and her utility is $\pi_i \triangleq \dPayment_i - \pathCost_{i,k}$. A plan $(x, \tilde{z}, \rPayment, \dPayment)$ is \emph{feasible} if for each rider $j \in \riders$, $x_j = \sum_{i \in \driverSet} \one{(\origin_j, \dest_j, \tr_j, j) \in \tilde{z}_i} \in \{0,~1\}$, where $\one{\cdot}$ is the indicator function. \if 0 if for all trips $(a ,b, t) \in \trips$, the number of riders that are picked up for this trip is no more than the number of drivers whose paths cover this trip, i.e. \begin{align} \sum_{j \in \riders} x_j \one{(\origin_j, \dest_j, \tr_j) = (a,b,t)} \leq \sum_{i \in \driverSet} \one{(a,b,t) \in z_i}, ~\forall(a,b,t) \in \trips. \end{align} \fi Unless stated otherwise, when we mention a plan in the rest of the paper, it is assumed to be feasible. For the {\em budget balance} (BB) of a plan, we need: \vsq{-0.5em} \begin{align} \sum_{j \in \riders} \rPayment_j \geq \sum_{i \in \driverSet} \dPayment_i, \label{equ:BB} \end{align} with strict budget balance if \eqref{equ:BB} holds with equality. A plan is \emph{individually rational for riders} if \vsq{-0.5em} \begin{align*} x_j \val_j \geq \rPayment_j, ~ \forall j \in \riders. \end{align*} A plan is \emph{individually rational for drivers} if $\pi_i \geq 0$ for all $i \in \driverSet$ s.t. $\driverEntrance_i = 0$, i.e. drivers that are not yet in the platform do not get negative utility from participating. A plan is {\em envy-free for riders} if no rider strictly prefers the outcome of another rider requesting the same trip, that is \vsq{-0.5em} \begin{align} x_jv_j - \rPayment_j \geq x_{j'} \val_j - \rPayment_{j'} \text{ for all } j,~j' \in \riders ~\mathrm{s.t.}~ \origin_j = \origin_{j'},~\dest_j = \dest_{j'}, ~\mathrm{and}~ \tr_j = \tr_{j'}. \end{align} A plan is \emph{envy-free for drivers} if any pair of drivers with the same type have the same utility: \vsq{-0.5em} \begin{align} \pi_i = \pi_{i'} \text{ for all } i,~i' \in \driverSet ~\mathrm{s.t.}~ \te_i = \te_{i'},~ \re_i = \re_{i'}, ~\mathrm{and}~ \driverEntrance_i = \driverEntrance_{i'}. \end{align} \begin{definition}[Anonymous trip prices] \label{defn:anon_trip_prices} A plan $(x, \tilde{z}, \rPayment, \dPayment)$ uses \emph{anonymous trip prices} if there exist $\price = \{ \price_{a,b,t} \}_{ (a,b,t) \in \trips}$ such that for all $(a,b,t) \in \trips$, we have: \begin{enumerate}[(i)] \setlength\itemsep{0.0em} \item all riders taking the same $(a,b,t)$ trip are charged the same payment $\price_{a,b,t}$, and there is no payment by riders who are not picked up, and % \item all drivers that are dispatched on a rider trip from $a$ to $b$ at time $t$ are paid the same amount $\price_{a,b,t}$ for the trip at time $t$, and there is no other payment to or from any driver. \end{enumerate} \end{definition} Given dispatches $(x,\tilde{z})$ and anonymous trips prices $\price$, all payments are fully determined: the total payment to driver $i $ is $\dPayment_i = \sum_{j \in \riders} \one{(\origin_j,\dest_j,\tr_j,j) \in \tilde{z}_i} \price_{\origin_j,\dest_j,\tr_j}$ and the payment made by rider $j$ is $\rPayment_j = x_j \price_{\origin_j, \dest_j, \tr_j}$. For this reason, we will represent plans with anonymous trip prices as $(x, \tilde{z},\price)$. By construction, plans with anonymous trip prices are strictly budget balanced. \begin{definition}[Competitive equilibrium] \label{defn:CE} A plan with anonymous trip prices $(x, \tilde{z},\price)$ forms a \emph{competitive equilibrium} (CE) if: \begin{enumerate}[(i)] \setlength\itemsep{0.0em} \item (rider best response) all riders $j \in \riders$ that can afford the ride are picked up, i.e. $\val_j > \price_{\origin_j, \dest_j, \tr_j} \Rightarrow x_j = 1$, and all riders that are picked up can afford the price: $ x_j = 1 \Rightarrow \val_j \geq \price_{\origin_j, \dest_j, \tr_j}$, \item (driver best response) $\forall i \in \driverSet$, $\pi_i = \max_{k = 0, \dots, |\pathSet_i|} \left\lbrace \sum_{(a,b,t) \in \path_{i,k} } \max \{ \price_{a,b,t} , 0 \} - \pathCost_{i,k} \right\rbrace$, i.e. each driver achieves the highest possible utility given prices and the set of feasible paths. % \end{enumerate} \end{definition} Given any set of anonymous trip prices $\price$, let anonymous trip prices $\price^+$ be defined as $\price^+_{a,b,t} \triangleq \max\{\price_{a,b,t}, ~ 0\}$ for each $(a,b,t) \in \trips$. \begin{restatable}{lemma}{lemCEPlan} \label{lem:CE_plan_properties} Given any CE plan $(x, \tilde{z}, \price)$, the plan with anonymous prices $(x, \tilde{z}, \price^+)$ also forms a CE, and has the same driver and rider payments and utilities as those under $(x, \tilde{z}, \price)$. \end{restatable} The lemma implies that when studying the set of possible rider and driver payments and utilities among all CE outcomes, it is without loss to consider only anonymous trip prices that are non-negative. We leave the full proof to Appendix~\ref{appx:proof_lem_CE_plan}. Prices must be non-negative for any trip that is requested by any rider, thus changing prices from $\price$ to $\price^+$ does not affect the payments for any rider or driver, or the best response on the riders side. The driver best response property also continues to hold, since $\max \{ \price_{a,b,t} , 0 \} = \max \{ \price^+_{a,b,t} , 0 \}$ for all $(a,b,t) \in \trips$. \if 0 \dcp{could the following just be simplified, to something like ``We refer to the {\em time $0$ plan} as a plan that is computed at time $0$, under the assumption that all drivers will follow the dispatches at all times.'' (Not actually clear to me we even need to say `under the assumption that all drivers will follow the dispatches at all times'). Not sure if we need the Example. This seems simple to get!} \hma{Because when the mechanism is defined as e.g. the myopic pricing mechanism, there isn't anything like a ``time 0 plan". There is only dispatches at each time given the current state. If everyone follows, then looking forward from time $0$, a plan is induced, and we are calling that the ``time 0 plan". Let's talk more when we meet!} \fi Given any mechanism, complete information about supply and demand, and assuming that all drivers follow the dispatches of the mechanism at all times, the assignments of all riders, action paths taken by all drivers, and the corresponding payment schedule through the planning horizon can be computed at time $0$, if all available drivers are dispatched at all times. We call this outcome the ``time $0$ plan" under the given mechanism. \subsection{Optimal Plans and CE Prices} The welfare-optimal planning problem can be formulated as an integer linear program (ILP) that determines optimal rider pick-ups and driver paths, followed by an assignment of riders to drivers whose paths cover the rider trips. Let $x_j$ be the indicator that rider $j \in \riders$ is picked up, and $y_{i,k}$ be the indicator that driver $i$ takes $\path_{i,k}$, her $k\th$ feasible path in $\pathSet_i$. We have: \vsq{-0.5em} \begin{align} \max_{x,y} ~& \sum_{j \in \riders} x_j \val_j - \sum_{i \in \driverSet} \sum_{k = 0}^{|\pathSet_i|} y_{i,k}\pathCost_{i,k} \label{equ:ilp} \\ ~\mathrm{s.t.}~ & \sum_{j \in \riders} x_j \one{(\origin_j, \dest_j, \tr_j) = (a,b,t)} \leq \sum_{i \in \driverSet} \sum_{k=0}^{|\pathSet_i|} y_{i,k} \one{(a,b,t) \in \path_{i, k}}, & \forall (a,b,t) \in \trips \label{equ:ilp_trip_capacity} \\ & \sum_{k = 0}^{|\pathSet_i|} y_{i,k} = 1, & \forall i \in \driverSet \label{equ:ilp_driver_constraint} \\ & x_j \in \{0, 1\}, & \forall j \in \riders \\ & y_{i,k} \in \{0, 1\}, & \forall i \in \driverSet,~k = 1, \dots, |\pathSet_i| \end{align} Constraint \eqref{equ:ilp_driver_constraint} requires that each driver takes exactly one path (which includes the path $\path_{i,0}$ representing not entering/exiting immediately). The feasibility constraint \eqref{equ:ilp_trip_capacity} requires that for all trips $(a,b,t) \in \trips$, the number of riders who request this trip and are picked up is no more than the total number of drivers whose paths cover this trip. Once pick-ups $x$ and paths $y$ are computed, \eqref{equ:ilp_trip_capacity} guarantees that each rider with $x_j = 1$ can be assigned to a driver Relaxing the integrality constraints on variables $x$ and $y$, we obtain the following linear program (LP) relaxation of the ILP: \vsq{-0.5em} \begin{align} \max_{x,y} ~& \sum_{j \in \riders} x_j \val_j - \sum_{i \in \driverSet} \sum_{k = 0}^{|\pathSet_i|} y_{i,k}\pathCost_{i,k} \label{equ:lp} \\ ~\mathrm{s.t.}~ & \sum_{j \in \riders} x_j \one{ (\origin_j, \dest_j, \tr_j) = (a,b,t) } \leq \sum_{i \in \driverSet} \sum_{k = 0}^{|\pathSet_i|} y_{i,k} \one{(a,b,t) \in \path_{i, k}}, & \forall (a,b,t) \in \trips \label{equ:lp_trip_capacity_constraint} \\ & \sum_{k = 0}^{|\pathSet_i|} y_{i,k} = 1, & \forall i \in \driverSet \label{equ:lp_driver_constraint} \\ & x_j \leq 1, & \forall j \in \riders \label{equ:lp_rider_constraint} \\ & x_j \geq 0, & \forall j \in \riders \label{equ:lp_rider_nonneg} \\ & y_{i,k} \geq 0, & \forall i \in \driverSet,~k = 1, \dots, |\pathSet_i| \label{equ:lp_driver_nonneg} \end{align} We refer to \eqref{equ:lp} as the primal LP. The constraint $y_{i,k} \leq 1$, that each path is taken by each driver at most once is guaranteed by imposing \eqref{equ:lp_driver_constraint} and \eqref{equ:lp_driver_nonneg}, and is omitted. \begin{restatable}[Integrality]{lemma}{thmLPIntegrality} \label{thm:lp_integrality} There exists an integer optimal solution to the linear program~\eqref{equ:lp}. \end{restatable} We leave the proof to Appendix~\ref{appx:proof_thm_lp_integrality}, showing there a correspondence to a min cost flow (MCF) problem (that has integral optimal solutions), where drivers flow through a network with vertices corresponding to (location, time) pairs, edges corresponding to trips, and with edge costs equal to driver's costs minus riders' values. The reduction to MCF can also be used to solve the LP efficiently. \if 0 For every instance of the LP \eqref{equ:lp}, we can construct a {\em minimum cost flow (MCF) problem}, where drivers flow through a network with vertices corresponding to (location, time) pairs, edges corresponding to trips, and with edge costs equal to the negation of riders' values. We show a correspondence between optimal solutions of \eqref{equ:lp} and optimal solutions of the MCF problem, and appeal to the integrality of the optimal solution of MCF~\cite{murota2003discrete}. \fi \medskip Let $\price_{a,b,t}$, $\pi_i$ and $u_j$ denote the dual variables corresponding to the primal constraints \eqref{equ:lp_trip_capacity_constraint}, \eqref{equ:lp_driver_constraint} and \eqref{equ:lp_rider_constraint}, respectively. The dual LP of \eqref{equ:lp} is: \vsq{-0.5em} \begin{align} \min~ &\sum_{i \in \driverSet} \pi_i + \sum_{j \in \riders} u_j & \label{equ:dual} \\ ~\mathrm{s.t.}~ & \pi_{i} \geq \sum_{(a,b,t) \in \path_{i,k}} \price_{a,b,t} - \pathCost_{i,k} & \forall k = 0, 1, \dots, |\pathSet_{i}|, ~ \forall i \in \driverSet \label{equ:dual_cnst_driver} \\ & u_j \geq \val_j - \price_{\origin_j, \dest_j, \tr_j}, & \forall j \in \riders \label{equ:dual_cnst_rider} \\ & \price_{a,b,t} \geq 0, &\forall (a,b,t) \in \trips & \label{equ:dual_price_nonneg}\\ & u_j \geq 0, & \forall j \in \riders \label{equ:dual_util_nonneg} \end{align} \begin{restatable}[Welfare Theorem]{lemma}{thmOptPlans} \label{thm:optimal_plans} A dispatching $(x, \tilde{z})$ is welfare-optimal if and only if there exists anonymous trip prices $\price$ s.t.~the plan $(x, \tilde{z}, \price)$ forms a competitive equilibrium. Such optimal CE plans always exist and are efficient to compute. Moreover, these plans are strictly budget balanced, and are individually rational and envy-free for both riders and drivers. \end{restatable} \if 0 \dcp{I think the following could be replaced with a simple `See app B.4 for the proof, which follows from LP duality theory.'} \hma{Slightly simplified. I feel that we need to at least include the interpretation of the dual variables, and the fact that negative prices doesn't matter (lemma 1). Then there is not much to compress.} \fi Given optimal primal and dual solutions, we show that the dual variables $\pi$ and $u$ can be interpreted as utilities of drivers and riders, when the anonymous trip prices are given by $\price$. We then make use of Lemma~\ref{lem:CE_plan_properties}, and the standard observations about complementary slackness conditions and their connection with competitive equilibria~\cite{parkes2000iterative,bertsekas1990auction}. By integrality, optimal CE plans always exist, and can be efficiently computed by solving the primal and dual LPs of the MCF problem. See Appendix~\ref{appx:proof_thm_opt_plan} for the proof of the lemma. \medskip For any two driver utility profiles $\pi = (\pi_1, \dots, \pi_\nd)$ and $\pi' = (\pi'_1, \dots, \pi_\nd')$ that correspond to CE plans, let the join $\bar{\pi} = \pi \vee \pi'$ and the meet $\underline{\pi} = \pi \wedge \pi'$ be defined as $\bar{\pi}_i \triangleq \max\{\pi_i, \pi_i'\}$ and $\underline{\pi}_i \triangleq \min \{ \pi_i, \pi_i'\}$ for all $i\in \driverSet$. The following lemma shows that drivers' utilities among all CE outcomes form a lattice, meaning that there exist CE plans where the driver utilities are given by $\bar{\pi}$ or $\underline{\pi}$. The lemma also shows a connection between the top/bottom of the lattice and the welfare differences from losing/replicating a driver, which plays an important role in establishing the incentive properties of the STP mechanism. Denote $\sw(\driverSet,~\riders)$ as the highest welfare achievable by drivers $\driverSet$ and riders $\riders$ (i.e. the optimal objective of \eqref{equ:lp}). For each driver $i \in \driverSet$, define the {\em social welfare gain from replicating driver} $i$, and the {\em social welfare loss from losing driver} $i$, as: \vsq{-0.5em} \begin{align} \Phi_{\driverNode_i} & \triangleq \sw(\driverSet \cup \{i'\},~\riders) - \sw(\driverSet,~\riders), \label{equ:welfare_gain_driver}\\ \Psi_{\driverNode_i} & \triangleq \sw(\driverSet,~\riders) - \sw(\driverSet \backslash \{ i \},~\riders), \label{equ:welfare_loss_driver} \end{align} where driver $i'$ with $\theta_{i'} = \theta_i$ is a replica of driver $i$. A \emph{driver-optimal plan} has a driver utility profile at the top of the lattice, and a \emph{driver-pessimal plan} has a utility profile at the bottom of the lattice. \begin{restatable}[Lattice Structure]{lemma}{lemOptPesPlans} \label{thm:opt_pes_plans} Drivers' utility profile $\pi$ among all CE outcomes form a lattice. Moreover, for each driver $i \in \driverSet$, $\Phi_{\driverNode_i}$ and $\Psi_{\driverNode_i}$ are equal to utility of driver $i$ in the driver-pessimal and driver-optimal CE plans, respectively. \end{restatable} We leave the proof of Lemma~\ref{thm:opt_pes_plans} to Appendix~\ref{appx:proof_lemma_opt_pes_plans}. The lattice structure follows from the correspondences between driver utilities, optimal solutions to dual LP \eqref{equ:dual}, and optimal solutions to the dual of the flow LP, and the fact that optimal dual solutions of MCF form a lattice. Standard arguments on shortest paths in the residual graph~\cite{ahuja1993network}, and the connection between optimal dual solutions and subgradients (w.r.t. flow boundary conditions), then imply the correspondence between welfare gains/losses and driver pessimal/optimal utilities. Unlike the classical unit-demand assignment problem, where the prices of items and the utilities of buyers both form lattices~\cite{shapley1971assignment}, it is drivers' utilities, and not trip prices or rider utilities that have a lattice structure. This is because although the driver-pessimal utilities are unique, the price for a trip under all driver-pessimal plans need not be unique. See Section~\ref{sec:discussions} for further a development. \if 0 \footnote{From Lemma~\ref{thm:opt_pes_plans}, the driver-optimal plans correspond to payments in a VCG mechanism. Surprisingly, driver-pessimal plans are important here, and the driver-optimal plans do not provide incentive compatibility (see Example~\ref{exmp:toy_econ_2}).} \fi \medskip A plan is in the \emph{core} of a ridesharing problem if no coalition of riders and drivers can break out of this plan and make an alternative plan among themselves, such that all drivers and riders in the coalition get at least their utilities from the original plan, and at least one of the drivers or riders is strictly better off. The following lemma proves that CE and core are utility-equivalent. \begin{restatable}[Core equivalence]{lemma}{lemCoreCE} \label{lem:core_equal_CE} All CE plans are in the core. Moreover, for any budget-balanced core outcome $(x, \tilde{z}, \rPayment, \dPayment)$, there exists prices $\price$ such that the plan with anonymous prices $(x, \tilde{z}, \price)$ forms a CE, and has the same driver and rider total utilities. \end{restatable} See Appendix~\ref{appx:proof_lem_core} for the full proof of this lemma. Intuitively, every CE plan is in the core since for any $\driverSet' \subseteq \driverSet$ and $\riders' \subseteq \riders$, the highest achievable coalitional welfare $\sw(\driverSet',~\riders')$ is no greater than the sum of utilities of all driver and riders in this coalition under any CE plan. Given any core outcome, we can construct anonymous trip prices $\price$ that support the outcome in CE, and have the same driver and rider total payments: $\rPayment_j = x_j \price_{\origin_j, \dest_j, \tr_j} $ and $\dPayment_i = \sum_{j \in \riders}\one{ (\origin_j, \dest_j, \tr_j, j) \in \tilde{z}_i } \price_{\origin_j, \dest_j, \tr_j}$.% \subsection{The Static CE Mechanism} A {\em static mechanism} announces a plan $(x, \tilde{z}, \rPayment, \dPayment)$ at time $t = 0$, and never again updates the plan, even after deviations by drivers. Rather, each driver can choose to take any feasible path, but can only pick up riders that are dispatched to her (and is only paid for the subset of these rider trips that are completed). Riders pay according to prices $\rPayment$ in the event they are picked up by a driver. \begin{definition}[Static CE mechanism] A static CE mechanism announces an optimal CE plan $(x, \tilde{z}, \price)$ at the beginning of the planning horizon. Each driver $i \in \driverSet$ then decides on the actual action path $\tilde{z}'_i$ that she takes, and gets paid $ \hat{\dPayment}_i = \sum_{j \in \riders} \price_{\origin_j, \dest_j, \tr_j} \one{(\origin_j, \dest_j, \tr_j,j) \in \tilde{z}_i,~(\origin_j, \dest_j, \tr_j,j) \in \tilde{z}_i'}$. Each rider $j \in \riders$ pays $\rPayment_j$ only if she is picked up. \end{definition} A static CE mechanism can be defined for any set of CE prices. Driver best response guarantees that no other path gives her a higher total utility, and it is a dominant strategy for each driver to follow the dispatched action path $\tilde{z}_i$. \begin{theorem}\label{thm:static_CE_mech} A static CE mechanism implements an optimal CE plan in dominant strategy. \end{theorem} In addition, if all riders and drivers follow the plan, the outcome under a static CE mechanism is strictly budget balanced and envy-free for both sides. The CE property also ensures that every rider that is picked up is happy to take the trip at the offered price, and that no rider who is not picked up has positive utility for the trip.\footnote{Still, Example~\ref{exmp:toy_econ_1_continued} in Appendix~\ref{appx:rider_incentives} shows that truthful reporting of a rider's value need not be a dominant strategy (and this can be the case whichever CE prices are selected).} The optimal static mechanism enjoys many good properties, but has a decisive design flaw--- it is fragile to driver deviations since it does not react by replanning. Deviations could occur for many reasons: mistakes, unexpected contingencies, unexpected traffic, or unmodeled idiosyncratic preferences, etc. We show by revisiting the Super Bowl example that once a driver has deviated, the resulting outcome in the subsequent periods may no longer be welfare-optimal or envy-free. \addtocounter{example}{-1} \begin{example}[Continued] \newcommand{0.8}{0.8} \newcommand{3.5}{3.5} \newcommand{2}{2} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \draw[line width=0.25mm] (-1, 2*2+0.8) -- (3.5*3 + 1, 2*2+0.8); \node[text width=1.3cm] at (0, 2*2+1.2) {9:50pm}; \node[text width=1.3cm] at (3.5, 2*2+1.2) {10:00pm}; \node[text width=3cm] at (3.5 + 0.2, 5.7) {Super Bowl Ends}; \node[text width=1.3cm] at (3.5*2, 2*2+1.2) {10:10pm}; \node[text width=1.3cm] at (3.5*3, 2*2+1.2) {10:20pm}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = 2 cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = 2 cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 3.5 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 3.5 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 3.5 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 3.5 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 3.5 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 3.5 cm, scale=0.8] {$C,2$}; \node[state] (A3) [right of=A2, node distance = 3.5 cm, scale=0.8] {$A,3$}; \node[state] (B3) [right of=B2, node distance = 3.5 cm, scale=0.8] {$B,3$}; \node[state] (C3) [right of=C2, node distance = 3.5 cm, scale=0.8] {$C,3$}; \node[text width=3cm] at (-0.3, 2 * 2 + 0.2) {{\color{violet} Driver 1}}; \node[text width=3cm] at (-0.3, 2 * 2 - 0.2) {{\color{orange} Driver 2}}; \node[text width=3cm] at (-0.3, 2) {{\color{lightblue} Driver 3}}; \path (C0) edge node[pos=0.55, sloped, above] {$\val_1 \hspace{-0.2em}=\hspace{-0.2em} 20$ \hspace{0.7em} $\val_2 \hspace{-0.2em}=\hspace{-0.2em} 30$} (B1); \path (B0) edge node[pos=0.2, sloped, above] {{\color{lightblue} $\boldsymbol{\val_3 \hspace{-0.2em}=\hspace{-0.2em} 10}$}} (C1); \path (B0) edge node[pos=0.5, sloped, above] {$\val_4 \hspace{-0.2em}=\hspace{-0.2em} 20$} (A1); \path (B1) edge node[pos=0.5, sloped, above] {$\val_5 \hspace{-0.2em}=\hspace{-0.2em} 20$} (B2); \path (C1) edge node[pos=0.5, sloped, above] {{\color{lightblue} $\boldsymbol{\val_6 \hspace{-0.2em}=\hspace{-0.2em} 100}$}} (B2); \draw[->] (3.9, 4) to[out=-2, in= 120 ](10.15, 0.1); \node[text width=3cm] at (9, 3.3) {{\color{violet} $\boldsymbol{\val_7 \hspace{-0.2em}=\hspace{-0.2em} 100}$}}; \node[text width=3cm] at (9.5, 2.9) {{\color{orange} $\boldsymbol{\val_8 \hspace{-0.2em}=\hspace{-0.2em} 90}$}}; \node[text width=3cm] at (10, 2.5) {$\val_9 \hspace{-0.2em}=\hspace{-0.2em} 80$}; \draw[dashed,violet, thick] (0.4, 2 *2 + 0.1) -- (3.5 - 0.35, 2 * 2 + 0.1); \draw[dashdotted, orange, thick] (0.4, 2 *2 - 0.1) -- (3.5 - 0.35, 2 * 2 - 0.1); \draw[dotted, lightblue, thick] (0.4, 2 + 0.07 ) -- (3.5 - 0.27, 2 * 2 - 0.3); \draw[dashed, violet, thick] (3.9, 2 * 2 + 0.1) to[out=-2, in= 120 ](10.2, 0.2); \draw[dashdotted, orange, thick] (3.9, 2*2 - 0.1) to[out=-2, in= 120 ](10.12, - 0.08); \draw[dotted, lightblue, thick] (3.5 + 0.27, 2 * 2 - 0.3) -- (2 * 3.5 - 0.38, 2 + 0.07 ); \draw[dashed, violet, thick](3.5 * 3 + 1.5, 1) -- (3.5 * 3 + 2.5, 1); \draw[dashdotted, orange, thick](3.5*3 + 1.5, 0.5) -- (3.5*3 + 2.5, 0.5); \draw[dotted, lightblue, thick](3.5 * 3 + 1.5, 0) -- (3.5 * 3 + 2.5, 0); \node[text width=0.4cm] at (3.5 * 3 + 2.7, 1) {{\color{violet} $z_1$}}; \node[text width=0.4cm] at (3.5 * 3 + 2.7, 0.6) {{ \color{orange} $z_2$}}; \node[text width=0.4cm] at (3.5 * 3 + 2.7, 0.0) {{\color{lightblue} $z_3$}}; \node[text width=1cm] at (3.5 * 2 + 2.3, 1.1) {\emph{80}}; \node[text width=1cm] at (3.5 + 2, 1.8) {\emph{20}}; \node[text width=1cm] at (3.5 + 1.3, 3) {\emph{75}}; \node[text width=1cm] at (1.5, 2.3) {\emph{0}}; \node[text width=1cm] at (2.7, 2.3) {\emph{55}}; \node[text width=1cm] at (1.9, 0.7) {\emph{70}}; \if 0 \node[text width=2cm] at (3.5 * 2 + 1.8, 0.8) {{\footnotesize $\price_{C,A,1} \hspace{-0.2em}=\hspace{-0.2em} 80$}}; \node[text width=2cm] at (3.5 + 1.8, 1.7) {{\footnotesize $\price_{B,B,1} \hspace{-0.2em}=\hspace{-0.2em} 10$}}; \node[text width=2cm] at (3.5 + 1, 2.8) {{\footnotesize $\price_{C,B,1} \hspace{-0.2em}=\hspace{-0.2em} 80$}}; \node[text width=2cm] at (1.8, 2.3) {{\footnotesize $\price_{B,C,1} \hspace{-0.2em}=\hspace{-0.2em} 0$}}; \node[text width=2cm] at (2.5, 2) {{\footnotesize $\price_{C,B,1} \hspace{-0.2em}=\hspace{-0.2em} 70$}}; \node[text width=2cm] at (2.2, 0.2) {{\footnotesize $\price_{B,A,1} \hspace{-0.2em}=\hspace{-0.2em} 80$}}; \fi \end{tikzpicture} \caption{The Super Bowl example: the driver pessimal competitive equilibrium plan. \label{fig:super_bowl_spatio_temporal}} \end{figure} For the Super Bowl game scenario, the static CE mechanism with a driver-pessimal plan adopts the plan illustrated in Figure~\ref{fig:super_bowl_spatio_temporal}. In this plan, all drivers stay at location $C$ or re-position to location $C$ at time $0$, picking up riders with high values. Driver $3$ exits at time $2$ after dropping off rider $6$. The total rider value is $300$, and the total trip costs incurred is $80$, and the total exit cost is $5$, resulting in an optimal welfare of $205$. The anonymous trip prices are shown in italics, below the edges corresponding to the trips. For each feasible path of each driver, the total prices minus costs is $50$, the welfare gain of the economy if the driver is replicated. The outcome forms a CE, that there is no other path with a higher total utility for any driver. All riders are happy with their dispatched trips given the prices, and there is no driver or rider envy. Suppose now that driver $3$ did not follow the plan at time 0 to pick-up rider $3$ going from $B$ to $C$, but stayed in location $B$ until time $1$. The effect of this deviation and not updating the plan is that driver $3$ is no longer able to pick up rider $6$, who strictly prefers to be picked up given the original price of $\price_{C,B,1} = 75$. One of the drivers $1$ and $2$ who was supposed to pick up rider $8$ with value $90$ is actually able to pick up rider $6$, and this would lead to a higher social welfare. Moreover, driver $3$ is now able to pick up rider $5$, however, she wouldn't be dispatched to do so. \qed \end{example} One may think of a naive fix for this robustness issue of the static CE mechanisms, simply repeating the computation of the plan at all times. The following example shows that the mechanism that recomputes a driver pessimal plan at all times fails to be incentive compatible. Similarly, we show that the mechanism that repeatedly recomputes a {\em driver-optimal} plan is not envy-free and can have incentive issues (see Example~\ref{exmp:always_compute_driver_opt} in Appendix~\ref{appx:examples}). \begin{example}\label{exmp:toy_econ_3} \newcommand{0.8}{0.8} \newcommand{3.5cm}{4} \newcommand{\vdistI}{1.7} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt,auto,node distance=2cm,semithick][font = \small] \tikzstyle{vertex}=[fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistI cm, scale=0.8] {$B,0$}; \node[state] (A1) [right of=A0, node distance = 3.5cm cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 3.5cm cm, scale=0.8] {$B,1$}; \node[state] (A2) [right of=A1, node distance = 3.5cm cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 3.5cm cm, scale=0.8] {$B,2$}; \path (B1) edge node[pos=0.5, sloped, above] {$\boldsymbol{\val_1 \hspace{-0.2em}=\hspace{-0.2em} 8}$} (B2); \path (A1) edge node[pos=0.5, sloped, above] {$\boldsymbol{\val_2 \hspace{-0.2em}=\hspace{-0.2em} 6}$, $\val_3 \hspace{-0.2em}=\hspace{-0.2em} 5$, $\val_4 \hspace{-0.2em}=\hspace{-0.2em} 4$} (A2); \node[text width=3cm] at (-0.3, \vdistI) {Driver 1}; \node[text width=3cm] at (-0.3, 0) {Driver 2}; \draw[dashed] (0.4, \vdistI - 0.1) -- (3.5cm - 0.38, \vdistI - 0.1); \draw[dashed] (3.5cm + 0.4, \vdistI - 0.1) -- (3.5cm * 2 - 0.38, \vdistI - 0.1); \draw[dashdotted] (0.4, - 0.1) -- (3.5cm - 0.38, - 0.1); \draw[dashdotted] (3.5cm + 0.4, - 0.1) -- (3.5cm * 2 - 0.38, - 0.1); \draw[dashed](3.5cm * 2 + 1.5, 0.5) -- (3.5cm * 2 + 2.5, 0.5); \draw[dashdotted](3.5cm * 2 + 1.5, 0) -- (3.5cm * 2 + 2.5, 0); \node[text width=0.4cm] at (3.5cm * 2 + 2.7, 0.5) {$z_1$}; \node[text width=0.4cm] at (3.5cm * 2 + 2.7, 0) {$z_2$}; \node[text width=1cm] at (3.5cm * 1 + 2.35, \vdistI - 0.3) {\emph{5}}; \node[text width=1cm] at (3.5cm * 1 + 2.35, -0.3) {\emph{5}}; \end{tikzpicture} \caption{The economy in Example~\ref{exmp:toy_econ_3} and the driver pessimal CE plan computed at time $0$. \label{fig:toy_econ_3}} \end{figure} Consider the economy as shown in Figure~\ref{fig:toy_econ_3}, where there are two locations $\loc = \{A, B\}$ with distances $\dist(A,A) = \dist(A,B) = \dist(B,A) = \dist(B,B) = 1$. Assume for simplicity that all trip costs and opportunity costs are zero: $c_{a,b,t}= 0$ for all $(a,b,t) \in \trips$, and $\kappa_\Delta = 0$ for all $\Delta = 0, 1, \dots, \horizon$. In the driver-pessimal plan computed at time $0$ as shown in the figure, the anonymous trip prices are $\price_{B,B,1} = \price_{A,A,1} = 5$. Assume that both drivers $1$ and $2$ follow the plan at time $0$, and reach $(B,1)$ and $(A,1)$ respectively. If the mechanism re-computes the plan at time $1$, the new driver-pessimal plan would set a new price of $0$ for the trip $(B,B,1)$--- the updated lowest market-clearing price for the trip. Therefore, if driver $1$ follows the mechanism at all times, her total payment and utility would actually be $0$. Now consider the scenario where driver $2$ follows the mechanism at time $0$, but driver $1$ deviates and relocates to $A$, so that both drivers are at location $A$ at time $1$. At time $1$, when the mechanism recomputes a driver-pessimal plan, both drivers would take the trip $(A,A,1)$ and pick up riders $2$ and $3$ respectively. The updated price for the trip $(A,A,1)$ would be $4$, and this is a useful deviation for driver $1$. \qed \end{example} The challenge is to achieve robustness, but at the same time handle the new strategic considerations that can occur as a result of drivers being able to trigger re-planning through deviations. \section{The Spatial-Temporal Pricing Mechanism} \label{sec:st_pricing} The Spatio-Temporal Pricing (STP) mechanism computes a driver-pessimal CE plan at the beginning of the planning horizon, and recomputes a driver-pessimal plan upon any deviation. This leads to our main result: the STP mechanism achieves subgame-perfect incentive compatibility without the use of time-extended contracts, and is welfare-optimal, core-selecting, individually rational, budget balanced, and envy-free from any history onward. \subsection{A Dynamic Mechanism} We first formally define a dynamic mechanism, that can use the history of actions to update the plan forward from the current state. Let $\state_t = (\state_{1,t}, \state_{2,t}, \dots, \state_{\nd, t})$ denote the \emph{state} of the ridesharing platform at time $t$, where each $\state_{i,t}$ describes the state of driver $i \in \driverSet$. If driver $i$ has entered the platform and is available at time $t$ at location $a \in \loc$, denote $\state_{i,t} = (1, a,t)$. Otherwise, if driver $i$ is {\em en route}, finishing the trip from $a$ to $b$ that she started at time $t' < t$ s.t. $t' + \dist(a,b) > t$, denote $\state_{i,t} = (a,b,t')$ if she is relocating with no rider, or $\state_{i,t} = (a, b, t', j)$ if she is taking a rider $j$ from $a$ to $b$ at time $t'$. For drivers that had already exited or decided not to enter, denote $\state_{i,t} = \phi$. For drivers with $\te_i \geq t$, i.e. who enters or is able to enter now or in the future, $\state_{i,t} = ( \driverEntrance_i, \re_i, \te_i)$. The initial state of the platform is $\state_0 = ((\driverEntrance_1, \re_1, \te_1), \dots, (\driverEntrance_{\nd}, \re_{\nd}, \te_{\nd}))$. At each time $t$, each driver $i$ takes an \emph{action} $\action_{i,t}$. An available driver $i$ with $\state_{i,t} = (1,a,t)$ or $\state_{i,t} = (0,a,t)$ may (enter and then) relocate to any location $b$ within reach by the end of the planning horizon (i.e. $b \in \loc$ s.t. $t + \dist(a,b) \leq \horizon$), which we denote $\action_{i,t}= (a, b, t)$. She may pick up a rider $j \in \riders$ with $\tr_j = t$ and $\origin_j = a$, in which case we write $\action_{i,t} = (a, \dest_j, t, j)$. She may also decide to exit (if $\driverEntrance_i = 1$) or not enter (if $\driverEntrance_i = 0$), for both cases we denote $\action_{a,t} = \phi$. For a driver $i$ that is {\em en route} at time $t$, (i.e. $\state_{i,t} = (a,b,t')$ or $\state_{i,t} = (a,b,t',j)$ for some $t'$ s.t. $t' + \dist(a,b) > t$), $\action_{i,t} = \state_{i,t}$--- the only available action is to finish the current trip. For driver $i$ with $\te_i > t$, denote $\action_{i,t} = \state_{i,t} = (\driverEntrance_i, \te_i, \re_i)$. A driver with $\state_{i,t} = \phi$ takes no more actions: $\action_{i,t} = \state_{i,t} = \phi$. The action $\action_{i,t}$ taken by driver $i$ at time $t$ determines her state $\state_{i,t+1}$ at time $t+1$: \begin{itemize \setlength\itemsep{0.0em} \item (will complete trips at $t+1$) if $\action_{i,t} = (a,b,t')$ or $\action_{i,t} = (a,b,t', j)$ s.t. $t' + \dist(a,b) = t+1$, then $\state_{i,t+1} = (1, b, t+1)$, meaning these drivers will become available at time $t+1$ at the destination of their trips,\footnote{Here we assume that a driver that declines the mechanism's dispatch and decide to relocate from $a$ to $b$ also does so in time $\dist(a,b)$. We can also handle drivers who move more slowly when deviating, just as long as the mechanism knows when and where the driver will become available again.} % \item (still \emph{en route}) if $\action_{i,t} = (a,b,t')$ or $\action_{i,t} = (a,b,t', j)$ s.t. $t' + \dist(a,b) > t+1$, then $\state_{i, t+1} = \action_{i,t}$, % \item (not yet entered) for $i \in \driverSet$ s.t. $\action_{i,t} = (\driverEntrance_i, \te_i, \re_i)$, we have $\state_{i, t+1} = (\driverEntrance_i, \te_i, \re_i)$, \item (already exited / never entered) if $\action_{i,t} = \phi$, then $\state_{i,t+1} = \phi$. \end{itemize} Let $ \action_t = ( \action_{1,t}, \action_{2,t}, \dots, \action_{\nd,t})$ be the \emph{action profile} of all drivers at time $t$, and let \emph{history} $\history_t \triangleq (\state_0, \action_0, \state_{1}, \action_1, \dots, \state_{t-1}, \action_{t-1}, \state_{t})$, with $\history_0 = (\state_0)$. Finally, let $\driverSet_t(\history_{t})= \{i \in \driverSet ~|~ \state_{i,t} = (1,a,t) \text{ or } \state_{i,t} = (0,a,t) \text{ for some } a \in \loc \}$ be the set of drivers available at time $t$. \begin{definition}[Dynamic ridesharing mechanism] \label{defn:ride_sharing_mech} A dynamic ridesharing mechanism is defined by its {\em dispatch rule} $\action^\ast$, {\em driver payment rule} $\dPayment^\ast$ and {\em rider payment rule} $\rPayment^\ast$. At each time $t$, given history $\history_{t}$ and rider information $\riders$, the mechanism: \begin{itemize \setlength\itemsep{0.0em} \item uses its dispatch rule $\action^\ast$ to determine for each of a subset of available drivers, a {\em dispatch action} $\action_{i,t}^\ast (\history_{t})$ to either pick up a rider, or to relocate, or to exit/not enter. \item uses its driver payment rule $\dPayment^\ast$ to determine, for each dispatched driver, a payment $\dPayment_{i,t}^\ast(\history_{t})$ in the event the driver takes the action ($\dPayment_{i,t}^\ast(\history_{t}) = 0$ for available drivers that are not dispatched). \item dispatches each {\em en route} driver to keep driving (i.e. $\action_{i,t}^\ast(\history_t) = \state_{i,t}$), and does not make any payment to driver $i$ in this period: $\dPayment_{i,t}^\ast (\history_t) = 0$. \item determines for drivers entering in the future ($i \in \driverSet$ s.t. $\te_i > t$), and drivers who had already exited ($i \in \driverSet$ s.t. $\state_{i,t} = \phi$), $\action_{i,t}^\ast(\history_t) = \state_{i,t}$ and $\dPayment_{i,t}^\ast (\history_t) = 0$. \item uses its rider payment rule $\rPayment^\ast$ to determine, for each rider who receives a dispatch at time $t$, the payment $\rPayment_j^\ast (\history_t)$ in the event that the rider is picked up. \end{itemize} Each driver then decides on which action $\action_{i,t} \in \actionSet_{i,t}(\history_{t})$ to take, where $\actionSet_{i,t}(\history_{t})$ is the set of actions available to agent $i$ at time $t$ given history $\history_t$. For an available driver at $(a,t)$ with dispatched action $\action_{i,t}^\ast(\history_{t})$, $\actionSet_{i,t}(\history_{t}) = \{\action_{i,t}^\ast(\history_{t})\} \cup \{(a,b,t)~|~b \in \loc ~\mathrm{s.t.}~ t + \dist(a,b) \leq \horizon \} \cup \{\phi\}$, i.e. the driver can either take the dispatched action, or to relocate to any location, or to exit or not enter; if an available driver at $(a,t)$ is not dispatched, $\action_{i,t}^\ast(\history_{t})$, $\actionSet_{i,t}(\history_{t}) = \{(a,b,t)~ |~b \in \loc ~\mathrm{s.t.}~ t + \dist(a,b) \leq \horizon \} \cup \{\phi\}$; for an {\em en route} driver, or a driver that enters in the future, or a driver that has already exited, $\actionSet_{i,t}(\history_{t}) = \{\state_{i,t}\}$. After observing the action profile $\alpha_t$, the mechanism pays each dispatched driver $\hat{\dPayment}_{i,t} (\action_{i,t}, \history_t)= \dPayment_{i,t}^\ast(\history_{t}) \one{\action_{i,t} = \action_{i,t}^\ast}$, and charges each rider $j \in \riders$ with $\tr_j = t$ the amount $\hat{\rPayment}_j (\action_t) = \rPayment^\ast_j (\history_t) \sum_{i \in \driverSet_t} \one{\action_{i,t}= (\origin_j, \dest_j, t, j)}$. \end{definition} A mechanism is \emph{feasible} if (i) it is possible for each available driver to take the dispatched trip, i.e. $\forall t$, $\forall \history_t$, $\forall i \in \driverSet_t$, if $\state_{i,t} = (1, a,t)$ or $\state_{i,t} = (0, a, t)$ for some $a \in \loc$, $\action_{i,t}^\ast (\history_t) \in \set{(a,b,t)}{b \in \loc,~t + \dist(a,b) \leq \horizon} \cup \set{(\origin_j, \dest_j, \tr_j, j)}{ j \in \riders,~\tr_j = t,~\origin_j = a}$, (ii) no rider is picked-up more than once, i.e. $\forall t$, $\forall \history_t$, $\forall j \in \riders$ s.t. $\tr_j = t$, $\sum_{i \in \driverSet_t} \one{\action_{i,t}^\ast(\history_t) = (\origin_j, \dest_j, \tr_j, j)} \leq 1$, and (iii) unavailable drivers are not dispatched. From Definition~\ref{defn:ride_sharing_mech}, there is no payment to or from unavailable or undispatched drivers, or a dispatched driver $i$ who deviated from $\action^\ast_{i,t}(\history_t)$ at time $t$, or riders who are not picked up.\sloppy Let $\historySet_t$ be the set of all possible {\em histories} up to time $t$. A \emph{strategy} $\strategy_{i}$ of driver $i$ defines for all times $t \in [\horizon - 1]$ and all histories $\history_t \in \historySet_t$, the action she takes $\action_{i,t} = \strategy_{i}(\history_t) \in \actionSet_{i,t}(\history_t)$. For a mechanism that always dispatches all available drivers, $\strategy_i^\ast$ denotes the \emph{straightforward strategy} of always following the mechanism's dispatches at all times. Let $\strategy = (\strategy_1, \dots, \strategy_{\nd})$ be the {\em strategy profile}, with $\strategy_{-i} = (\strategy_1, \dots, \strategy_{i-1}, \strategy_{i+1}, \dots, \strategy_{\nd})$. The strategy profile $\strategy$, together with the initial state $\state_0$ and the rules of a mechanism, determine all actions and payments of all drivers through the planning horizon. Let $\strategy_i |_{\history_t}$, $\strategy |_{\history_t}$ and $\strategy_{-i} |_{\history_t}$ denote the strategy profile from time $t$ and history $\history_t$ onward for driver $i$, all drivers, and all drivers but $i$, respectively. For each rider $j \in \riders$, let $\hat{x}_j(\strategy)\in \{0,1\}$ be the indicator that rider $j$ is picked-up given strategy $\strategy$, and let $\hat{\rPayment}_j(\strategy) = \hat{x}_j(\strategy) \rPayment^\ast_j(\history_{\tr_j})$ be her actual payment. For each driver $i \in \driverSet$, $\hat{\dPayment}_i(\strategy) \triangleq \sum_{t=0}^{\horizon-1} \hat{\dPayment}_{i,t}(\strategy_i(\history_t), \history_{t})$ denotes the total actual payments made to driver $i$, where drivers follow $\strategy$ and the history $\history_t$ is induced by the initial state and strategy $\strategy$. Let $\hat{\pi}_{i,t}(\strategy_i(\history_t), \history_{t})$ be the actual utility driver $i$ gets at time $t$ given history $\history_t$ and strategy $\strategy_i$, we know that if $\strategy_i(\history_t) = (a,b,t)$ or $\strategy_i(\history_t) = (a,b,t,j)$, then $\hat{\pi}_{i,t}(\strategy_i(\history_t), \history_{t}) = \hat{\dPayment}_{i,t}(\strategy_i(\history_t), \history_{t}) - c_{a,b,t}$; if $\strategy_i(\history_t) = \phi$ and $\state_{i,t} = (1,a,t)$ for some $a \in \loc$, then $\hat{\pi}_{i,t}(\strategy_i(\history_t), \history_{t}) = \hat{\dPayment}_{i,t}(\strategy_i(\history_t), \history_{t}) - \kappa_{\horizon - t}$. For every other scenario, $\hat{\pi}_{i,t}(\strategy_i(\history_t), \history_{t}) = \hat{\dPayment}_{i,t}(\strategy_i(\history_t), \history_{t})$. Denote $\hat{\pi}_i(\strategy) \triangleq \sum_{t=0}^{\horizon-1} \hat{\pi}_{i,t}(\strategy_i(\history_t), \history_{t})$ as driver $i$'s total utility. Fixing driver and rider types, a ridesharing mechanism induces an extensive form game. At each time point $t$, each driver decides on an action $\alpha_{i,t} = \strategy_i(\history_t)\in \actionSet_{i,t}(\history_t)$ to take based on strategy $\strategy_i$ and the history $\history_t$, and receives utility $\hat{\pi}_{i,t}(\alpha_{i,t}, \history_t)$. The total utility $\hat{\pi}_i(\strategy)$ to each driver is determined by the rules of the mechanism. We define the following properties. \begin{definition}[Budget balance] A ridesharing mechanism is {\em budget balanced} if for any set of riders and drivers, and any strategy profile $\strategy$ taken by the drivers, we have \begin{align} \sum_{j \in \riders} \hat{\rPayment}_j (\strategy) \geq \sum_{i \in \driverSet} \hat{\dPayment}_i(\strategy). \end{align} \end{definition} \begin{definition}[Subgame-perfect incentive compatibility] A ridesharing mechanism that always dispatches all available drivers is \emph{subgame-perfect incentive compatible} (SPIC) for drivers if given any set of riders and drivers, following the mechanism's dispatches at all times forms a subgame-perfect equilibrium (SPE) among the drivers, meaning for all $t \in [\horizon - 1]$, for any history $\history_{t} \in \historySet_t$, \begin{align} \sum_{t' = t}^{\horizon - 1} \hat{\pi}_{i, t'}( \strategy_i^\ast |_{\history_t}, \strategy_{-i}^\ast |_{\history_t}) \geq \sum_{t' = t}^{\horizon - 1} \hat{\pi}_{i, t'}(\strategy_i |_{\history_t}, \strategy_{-i}^\ast |_{\history_t}), ~\forall \strategy_i,~\forall i \in \driverSet. \label{equ:ICSPE} \end{align} \end{definition} A ridesharing mechanism is {\em dominant strategy incentive compatible (DSIC)} if for any driver, following the mechanism's dispatches at all time points that the driver is dispatched maximizes her total payment, regardless of the actions taken by the rest of the drivers. \if 0 \hma{Here, DSIC can actually be defined for mechanisms that not always dispatch all drivers. The problem with defining SPIC for mechanisms that do not always dispatch all drivers is that when some driver is not dispatched, we don't know what they do ``in equilibrium". Should we add a comment to say that SPIC is only well defined for mechanisms that always dispatch all available drivers, however, even for mechanisms that are not always dispatching all available drivers, it is possible do define that the mechanism is NOT IC? As long as all drivers are dispatched in some economy, we can find useful deviations from always following the mechanism. This is not totally necessary, though. We had been calling the myopic pricing mechanism ``not IC" earlier in the paper without defining what we mean, but in the subsequent parts of the paper we only talked about ``regret" for economies where all drivers are always dispatched.} \dcp{my feeling is that it is already clear enough as is,and i'm happy with not insisting that all are dispatched for defn of DSIC} \fi \begin{definition}[Individual rationality (IR)] A ridesharing mechanism that always dispatches all available drivers is \emph{individually rational in SPE for drivers} if for any set of riders and drivers, (i) the mechanism is SPIC for drivers, and (ii) assuming $\strategy^\ast$, drivers that have not yet entered do not get negative utility from participating, i.e. \begin{align*} \hat{\pi}_i(\strategy^\ast) \geq 0 ~\mathrm{for}~ i \in \driverSet ~\mathrm{s.t.}~ \driverEntrance_i = 0. \end{align*} A ridesharing mechanism is {\em individually rational for riders} if for any set of riders and drivers, and any strategy profile $\strategy$ taken by the drivers, \begin{align} \hat{x}_j(\strategy) \val_j \geq \hat{\rPayment}_j(\strategy), ~\forall i \in \riders. \end{align} \end{definition} \begin{definition}[Envy-freeness in SPE] A ridesharing mechanism that always dispatches all available drivers is {\em envy-free in SPE for drivers} if for any set of riders and drivers, (i) the mechanism is SPIC for drivers, and (ii) for any time $t \in [\horizon - 1]$, for all history $\history_{t} \in \historySet_t$, all drivers with the same state at time $t$ are paid the same total amount in the subsequent periods, assuming all drivers follow the mechanism's dispatches: \begin{align} \sum_{t' = t}^{\horizon - 1} \hat{\pi}_{i, t'}( \strategy^\ast|_{\history_t}) = \sum_{t' = t}^{\horizon - 1} \hat{\pi}_{i', t'}( \strategy^\ast|_{\history_t}), ~ \forall i, i' \in \driverSet ~\mathrm{s.t.}~ \state_{i,t} = \state_{i', t}. \end{align} A ridesharing mechanism is {\em envy-free in SPE for riders} if (i) the mechanism is SPIC for drivers, and (ii) for all $j \in \riders$, for all possible $\history_{\tr_j} \in \historySet_{\tr_j}$, and all $j' \in \riders$ s.t. $(\origin_j, \dest_j, \tr_j) = (\origin_{j'}, \dest_{j'}, \tr_{j'})$ \begin{align} \hat{x}_j(\strategy^\ast)\val_j - \hat{\rPayment}_j(\strategy^\ast) \geq \hat{x}_{j'}(\strategy^\ast)\val_j - \hat{\rPayment}_{j'}(\strategy^\ast). \end{align} \end{definition} \begin{definition}[Core-selecting] A ridesharing mechanism that always dispatches all available drivers is \emph{core-selecting} if for any set of riders and drivers, (i) the mechanism is SPIC, and (ii) for any time $t \in [\horizon - 1]$ and any history $\history_t \in \historySet_t$ onward, the outcome under the straightforward strategy $\strategy^\ast$ is in the core. \end{definition} \if 0 As we discussed in Section~\ref{sec:static_mech}, given the set of riders $\riders$, the straightforward strategy $\strategy^\ast$, and $\history_0$ (which is simply the initial state of drivers $\state_0$), the outcome of a ridesharing mechanism over the entire planning horizon with dispatch rule $\alpha_{i,t}^\ast(\history_t)$ and payment rule $\pi_{i,t}^\ast(\history_t)$ can be computed at time $0$. We denote such outcomes the time $0$ plan \ff{move this earlier} $(x^{(0)} (\history_0), z^{(0)}(\history_0), \rPayment^{(0)}(\history_0), \pi^{(0)}(\history_0))$. With no driver deviation, the mechanism ``executes" the original plan. If some driver deviated from the plan at time $t-1$ for some $t > 0$, the outcome looking forward from $\history_t$ under the straightforward strategy $\sigma^\ast | _{\history_t}$ may differ from that of the original plan. We denote the downward outcomes, which can be thought of as an updated plan, as $(x^{(t)}(\history_{t}),~z^{(t)}(\history_{t}),~ \rPayment^{(t)}(\history_{t}),~\pi^{(t)}(\history_{t}))$. We call the mapping from the history $\history_t$ (at the beginning of the planning horizon or right after some driver deviation) to the plan from time $t$ onward the \emph{planning rule} of the mechanism. The planning rule can be derived from the dispatch and payment rules by analyzing the outcome under $\sigma^\ast|_{\history_t}$: \begin{itemize} \item $z_i ^{(t)}(\history_t) = (\action_{i,t}^\ast(\history_t), \action_{i,t}^\ast(\history_{t+1}), \dots, \action^\ast_{i,\horizon-1}(\history_{\horizon-1}) )$ \hma{This is not totally correct actually... a path is just a collection of trips which can be with or without a rider. The actions do specify if there is a rider or not, and also there might be duplication... Fixing this properly takes a lot more notations, and I guess decisions on this should probably depend on what do we define as a ``path" or what does a plan specify.} \item $\pi_i ^{(t)}(\history_t) = \sum_{t' = t}^{\horizon} \pi_{i,t'}^\ast(\history_{t'})$ \item $x_j ^{(t)}(\history_t) = \sum_{i \in \driverSet} \one{ \action_{i,\tr_j}^\ast(\history_{\tr_j}) = (\origin_j, \dest_j, \tr_j, j) }$, \item $\rPayment_j ^{(t)}(\history_t) = \rPayment^\ast_j(\history_{\tr_j})$ \end{itemize} where the histories above are those resulting from drivers take strategy $\strategy^\ast|_{\history_t}$. The planning rule also fully pins down the dispatch and payment rules of the mechanism: (i) if the most recent plan $(x^{(t')}(\history_{t'}), ~z^{(t')}(\history_{t'}),~ \rPayment^{(t')}(\history_{t'}),~\pi^{(t')}(\history_{t'}))$ is computed at time $t' < t$ and no deviation had happened by time $t$, the dispatch and payment at time $t$ simply takes the outcome at time $t$ under $(x^{(t')}(\history_{t'}), ~z^{(t')}(\history_{t'}),~ \rPayment^{(t')}(\history_{t'}),~\pi^{(t')}(\history_{t'}))$; (ii) if some driver deviated at time $t-1$, compute $(x^{(t)}(\history_{t}),~z^{(t)}(\history_{t}),~ \rPayment^{(t)}(\history_{t}),~\pi^{(t)}(\history_{t}))$ and determine for riders and drivers actions and payments at time $t$ according to the updated plan. \bigskip In general, the dependence of the planning rule on the entire history $\history_t$ enables the mechanism to penalize drivers that had deviated from the plan in the past. For example, we can think of a mechanism that computes a CE plan at time $0$, and ``fires" a driver (i.e. stops dispatching trips or making payments in subsequent time periods) after she deviated from the plan while still paying the rest of the drivers as originally planned. Incentive compatibility can be easily achieved in this way, however, such mechanisms may not be desirable in practice. We seek ridesharing mechanisms that are history-independent and time-invariant, and we call such mechanisms \emph{dynamic mechanisms}. \begin{definition}[History independence] A ridesharing mechanism is \emph{history independent}, if it's planning rule is oblivious to the past history and depends only on the state of the platform at the time of planning or re-planning. \end{definition} Taking the initial state $\state_0$ into consideration, a history independent mechanism computes and announces a plan $(x(\state_0), z(\state_0), \rPayment(\state_0), \pi(\state_0))$ at time $0$. If any driver(s) deviated from the plan at time $t-1$ for some $t > 0$, the mechanism recomputes a plan $(x ^{(t)}(\state_t), z^{(t)}(\state_t), \rPayment ^{(t)}(\state_t), \pi ^{(t)}(\state_t)) $ at time $t$ that depends only on the state of the platform $\state_t$. Given any time $t$ and any state $\state_t$ of the platform at time $t$, let $E ^{(t)} (\state_t)$ represent the time-shifted economy starting at state $\state_t$, with planning horizon $\horizon ^{(t)} = \horizon - t$, the same set of locations and distances, the remaining riders $\riders ^{(t)} = \{(\origin_j, \dest_j, \tr_j - t, \val_j) ~|~ j \in \riders, \tr_j \geq t \}$ and set of drivers $\driverSet ^{(t)} (\state_t)$ s.t. $(\te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)}) = (0, \tl_i-t, a)$ for available drivers $\state_{i, t} = (a,t)$ and $(\te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)}) = (t' + \dist(a,b) - t, \tl_i-t, b)$ for \emph{en route} drivers $\state_{i, t} = (a, b, t')$ or $(a, b, t', j)$. \begin{definition}[Time invariance] A history-independent mechanism mechanism is \emph{time-invariant} if the planning rule is independent to the time point when the plan is computed. In other words, the plan re-computed at time $t > 0$ given state $\state_t$ is the same as the plan computed at time $0$ in the economy $E ^{(t)} (\state_t)$. \hma{I'm evading a lot of notations by saying ``same" here...} \end{definition} A history-independent mechanism may not penalize individual riders that had deviated in the past, however, it may still deter deviation by penalizing all drivers as soon as any driver deviated from the original plan. For example, think about a mechanism that computes an initial optimal plan, but threats to ``shut down" and not making any further dispatch or payment for any driver as soon as the observed $\state_t$ differs from the state that would follow from the initial plan. A time-invariant mechanism would need to recompute an optimal plan from any time $t$ onward as if it was the beginning of the planning horizon. For time-invariant mechanisms, we drop the superscript denoting time when the plans are computed and write the planning rule as $(x(\state_t), z(\state_t), \rPayment(\state_t), \pi(\state_t))$ for all $t \in [\horizon]$. \fi Fix a ridesharing mechanism with dispatch rule $\alpha^\ast$ and payment rules $\rPayment^\ast,~\dPayment^\ast$, where all available drivers are always dispatched. Recall that given complete information and the straightforward strategy $\strategy^\ast$, the outcome over the entire planning horizon can be computed at time $0$, and is called the {\em time $0$ plan} of the mechanism. If some driver deviated at time $t-1$ for some $t > 0$, the downward outcomes given the dispatching and payment rules, assuming all drivers follow $\sigma^\ast|_{\history_t}$, can be thought of as an updated time $t$ plan. For any time $t \in [\horizon]$, given any state $\state_t$ of the platform, let $E ^{(t)} (\state_t)$ represent the \emph{time-shifted economy} starting at state $\state_t$, with planning horizon $\horizon ^{(t)} = \horizon - t$, the same set of locations $\loc$ and distances $\dist$, and the remaining riders $\riders ^{(t)} = \{(\origin_j, \dest_j, \tr_j - t, \val_j) ~|~ j \in \riders, \tr_j \geq t \}$. For drivers, we have $\driverSet ^{(t)} (\state_t) = \{ \theta_i^{(t)} ~|~ i \in \driverSet \}$, with types $\theta_i^{(t)} = (\driverEntrance_i ^{(t)}, \te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)})$ determined as follows: \begin{itemize \setlength\itemsep{0.0em} \item for available drivers $i \in \driverSet$ s.t. $\state_{i, t} = (1, a, t)$ or $\state_{i,t} = (0, a, t)$ for some $a \in \loc$, let $\theta_i^{(t)} = (\driverEntrance_i^{(t)}, \te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)}) = (1, a, 0, \tl_i-t)$ or $(1, a, 0, \tl_i-t)$, respectively, \item for {\em en route} drivers $i \in \driverSet$ s.t. $\state_{i, t} = (a, b, t')$ or $(a, b, t', j)$ where $t'+ \dist(a,b) > t$, let $\theta_i^{(t)} = (\driverEntrance_i ^{(t)}, \te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)}) = (1, b, t' + \dist(a,b) - t, \tl_i-t)$, \item for each driver $i \in \driverSet$ with $\te_i >t$, let $\theta_i^{(t)} = (\driverEntrance_i ^{(t)}, \te_i^{(t)}, \tl_i^{(t)}, \re_i^{(t)}) = (\driverEntrance_i, \re_i, \te_i-t, \tl_i-t)$, and \item exclude drivers that have already exited or chose not to enter. \end{itemize} \begin{definition}[Temporal consistency] \label{defn:temp_invariance} A ridesharing mechanism is \emph{temporally consistent} if after deviation at time $t-1$, the updated plan is identical to that determined for economy $E ^{(t)} (\state_t)$. \end{definition} Upon deviation(s) at time $t-1$, a temporally consistent mechanism computes its updated plan from time $t$ onward as if $t$ is the beginning of the planning horizon, thus the mechanism does not make use of time-extended contracts, including penalties for previous actions. In fact, a temporally inconsistent mechanism would be able to trivially align incentives. For example, a mechanism that replans based on the history could fire any driver who has deviated in the past, while keeping the plans for the rest of the economy unchanged. A mechanism can also threaten to ``shut down" and not make any further dispatches or payments to the drivers if any of them had deviated. \subsection{The Spatio-Temporal Pricing Mechanism} We define the STP mechanism by providing a method to plan or re-plan, this implicitly defining the dispatch and payment rules. For each $a \in \loc$ and $t \in [\horizon]$, denote the welfare gain from an additional driver at $(a,t)$ that is already in the platform as, \begin{align} \Phi_{a,t} \triangleq \sw(\driverSet \cup \{(1, a, t, \horizon) \}) - \sw(\driverSet), \label{equ:welfare_gain} \end{align} where $(1, a, t, \horizon)$ represents the type of this driver that stays until the end of the planning horizon. \begin{definition}[Spatio-Temporal pricing mechanism] \label{defn:stp} The {\em spatio-temporal pricing (STP) mechanism} is a dynamic ridesharing mechanism that always dispatches all available drivers. Given economy $E^{(0)}$ at the beginning of the planning horizon, or economy $E^{(t)}(\state_t)$ immediately after a deviation by one or more drivers, the mechanism completes the following planning step: \begin{itemize \item {\em Dispatch rule:} To determine the dispatches ($\alpha^\ast$), compute an optimal solution $(x, y)$ to the ILP~\eqref{equ:ilp}, and dispatch each driver $i \in \driverSet$ to take the path $\path_{i,k}$ for $k$ s.t. $y_{i,k} = 1$, and pick up riders $j \in \riders$ s.t. $x_j = 1$, \item {\em Payment rules:} To determine driver and rider payments ($\dPayment^\ast$ and $\rPayment^\ast$), for each $(a,b,t) \in \trips$, set anonymous trip prices to be $\price_{a,b,t} = \Phi_{a,t} - \Phi_{b, t+\dist(a,b)} + c_{a,b,t}$: \begin{enumerate}[-] \item for each rider $j \in \riders$, $\rPayment_j^\ast = \price_{\origin_j, \dest_j, \tr_j} \sum_{i \in \driverSet} \one{\action^\ast_{i,\tr_j} = (\origin_j, \dest_j, \tr_j, j)} $, \item for each driver $i \in \driverSet$, $\dPayment_{i,t}^\ast = \sum_{j \in \riders, \tr_j = t} \price_{\origin_j,\dest_j,t} \one{\action^\ast_{i,\tr_j} = (\origin_j, \dest_j, t, j)} $. % \end{enumerate} \end{itemize} \end{definition} We now state the main result of the paper. \begin{restatable}{theorem}{spe} \label{thm:SPE} The spatio-temporal pricing mechanism is temporally consistent and subgame-perfect incentive compatible. It is also individually rational for riders and strictly budget balanced for any action profile taken by the drivers, and is welfare optimal, core-selecting, individually rational for drivers and envy-free in subgame-perfect equilibrium from any history onward. \end{restatable} We provide the full proof of Theorem~\ref{thm:SPE} in Appendix~\ref{appx:proof_thm_spe}. We first prove, via a telescoping sum, that the total utility of each driver under the STP mechanism is $\pi_i = \Phi_{\driverNode_i}$, the welfare gain from replicating driver $i$. \if 0 We first observe that $\Phi_{a,\horizon} = 0$ for all $a \in \loc$ since an additional driver that enters at time $\horizon$ cannot pick up any rider thus does not improve welfare. Any feasible path of each driver $i \in \driverSet$ over the planning horizon starts at $(\re_i, \te_i)$ and ends at $(a,\horizon)$ for some $a \in \loc$. By a telescoping sum, the total payment to driver $i$ under the planning rule of the STP mechanism is \begin{align} \pi_i= \sum_{(a,b,t) \in z_i} \price_{a,b,t}= \sum_{(a,b,t) \in z_i} \Phi_{a,t} - \Phi_{b, t+\dist(a,b)} = \Phi_{\re_i, \te_i} - 0 = \Phi_{\re_i, \te_i}, \end{align} and the welfare gain of the economy from replicating driver $i$. \fi Setting $u_j = \max\{ \val_j - \price_{\origin_j, \dest_j, \tr_j} ,~ 0 \}$ for all riders $j \in \riders$, we show that $(\price, \pi, u)$ forms an optimal solution to the dual LP \eqref{equ:dual} by observing (i) $(\Phi, u)$ forms an optimal solution to the dual of the corresponding MCF problem (the proof of Lemma~\ref{thm:opt_pes_plans}), and (ii) a correspondence between the optimal solutions of the dual LP~\eqref{equ:dual} and the optimal solutions of the dual of the MCF (Lemma~\ref{lem:dual_payment_correspondence} in Appendix~\ref{appx:proof_thm_opt_plan}). This implies that the plan determined by the STP mechanism starting from any history onward forms a CE, and as a result is IR for riders and drivers, strictly budget balanced, envy-free, and resides in the core. For incentive alignment, the single-deviation principle for finite horizon extensive-form games~\cite{osborne1994course} means that we only need show that a single deviation from the mechanism's dispatching is not useful. For any driver in the platform, available at location $a$ and time $t$, her total utility from time $t$ onward, if all drivers follow the dispatches, is equal the welfare gain (at the time when the plan is computed) from adding a driver at location $a$ and time $t$. We establish that this welfare gain is weakly higher than the welfare gain for the economy (at time $t+1$) from replicating this driver at any location and time that the driver can deviate and relocate to. For this, we use the $M^\natural$ concavity (and more specifically, the local exchange properties) of optimal objectives of MCF problems~\cite{murota2003discrete}. In particular, to maximize welfare, there is stronger substitution among drivers at the same location than among drivers at different locations. This shows that declining the mechanism's dispatch to stay/relocate is not useful. We also show that none of (i) exiting earlier than dispatched, (ii) not entering/exiting when asked to, and (iii) entering when dispatched not to, is a useful deviation. From incentive alignment and the CE property, we have the desired properties as stated. \newcommand{0.8}{0.8} \newcommand{3.5}{3.5} \newcommand{2}{2} \addtocounter{example}{-2} \begin{example}[Continued] \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \draw[line width=0.25mm] (-1, 2*2 + 1.37) -- (3.5*3 + 1, 2*2 + 1.37); \node[text width=1.3cm] at (0, 2*2+1.7) {9:50pm}; \node[text width=1.3cm] at (3.5, 2*2+1.7) {10:00pm}; \node[text width=3cm] at (3.5 + 0.2, 6.2) {Super Bowl Ends}; \node[text width=1.3cm] at (3.5*2, 2*2+1.7) {10:10pm}; \node[text width=1.3cm] at (3.5*3, 2*2+1.7) {10:20pm}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = 2 cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = 2 cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 3.5 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 3.5 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 3.5 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 3.5 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 3.5 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 3.5 cm, scale=0.8] {$C,2$}; \node[state] (A3) [right of=A2, node distance = 3.5 cm, scale=0.8] {$A,3$}; \node[state] (B3) [right of=B2, node distance = 3.5 cm, scale=0.8] {$B,3$}; \node[state] (C3) [right of=C2, node distance = 3.5 cm, scale=0.8] {$C,3$}; \node[text width=3cm] at (3.5 + 0.9, 2 * 2 + 1) {{\color{violet} Driver 1}}; \node[text width=3cm] at (3.5+ 0.9, 2 * 2 + 0.6) {{\color{orange} Driver 2}}; \node[text width=3cm] at (3.5+ 0.9, 2-0.7) {{\color{lightblue} Driver 3}}; \path (C0) edge node[pos=0.55, sloped, above] {$\val_1 \hspace{-0.2em}=\hspace{-0.2em} 20$ \hspace{0.7em} $\val_2 \hspace{-0.2em}=\hspace{-0.2em} 30$} (B1); \path (B0) edge node[pos=0.2, sloped, above] { ${\val_3 \hspace{-0.2em}=\hspace{-0.2em} 10}$} (C1); \path (B0) edge node[pos=0.5, sloped, above] {$\val_4 \hspace{-0.2em}=\hspace{-0.2em} 20$} (A1); \path (B1) edge node[pos=0.5, sloped, above] {{\color{lightblue} $\boldsymbol{\val_5 \hspace{-0.2em}=\hspace{-0.2em} 20}$}} (B2); \path (C1) edge node[pos=0.5, sloped, above] {{\color{orange} $\boldsymbol{\val_6 \hspace{-0.2em}=\hspace{-0.2em} 100}$}} (B2); \draw[->] (3.9, 4) to[out=-2, in= 120 ](10.15, 0.1); \node[text width=3cm] at (9, 3.3) {{\color{violet} $\boldsymbol{\val_7 \hspace{-0.2em}=\hspace{-0.2em} 100}$}}; \node[text width=3cm] at (9.5, 2.9) {$\val_8 \hspace{-0.2em}=\hspace{-0.2em} 90$}; \node[text width=3cm] at (10, 2.5) {$\val_9 \hspace{-0.2em}=\hspace{-0.2em} 80$}; \draw[dashed, violet, thick] (0.4, 2 *2 + 0.1) -- (3.5 - 0.35, 2 * 2 + 0.1); \draw[dashdotted, orange, thick] (0.4, 2 *2 - 0.1) -- (3.5 - 0.35, 2 * 2 - 0.1); \draw[dotted, red, thick] (0.4, 2 - 0.1) -- (3.5 - 0.35, 2 - 0.1); \draw[dashed, violet, thick] (3.9, 2 * 2 + 0.1) to[out=-2, in= 120 ](10.2, 0.2); \draw[dashdotted, orange, thick] (3.5 + 0.27, 2 * 2 - 0.3) -- (2 * 3.5 - 0.38, 2 + 0.07 ); \draw[dotted, lightblue, thick] (3.5 +0.4, 2 - 0.1) -- (3.5 *2 - 0.35, 2 - 0.1); \draw[dashed, violet, thick](3.5 * 3 + 1.5, 1) -- (3.5 * 3 + 2.5, 1); \draw[dashdotted, orange, thick](3.5*3 + 1.5, 0.5) -- (3.5*3 + 2.5, 0.5); \draw[dotted, lightblue, thick](3.5 * 3 + 1.5, 0) -- (3.5 * 3 + 2.5, 0); \node[text width=0.4cm] at (3.5 * 3 + 2.7, 1) {{\color{violet} $z_1$}}; \node[text width=0.4cm] at (3.5 * 3 + 2.7, 0.6) {{ \color{orange} $z_2$}}; \node[text width=0.4cm] at (3.5 * 3 + 2.7, 0.0) {{\color{lightblue} $z_3$}}; \node[text width=1cm] at (3.5 * 2 + 2.3, 1.1) {\emph{90}}; \node[text width=1cm] at (3.5 + 2, 1.6) {\emph{5}}; \node[text width=1cm] at (3.5 + 1.3, 3) {\emph{85}}; \end{tikzpicture} \caption{The Super Bowl example: replanning under the STP mechanism at time $1$ after driver $3$ deviated from the original plan and stayed in location $B$ until time $1$. \label{fig:super_bowl_spatio_temporal_replan}} \end{figure} Whereas the static CE mechanism fails to be welfare-optimal or envy-free for riders after driver $3$ deviates from the dispatch and stays in location $B$ until time $1$, the plan recomputed under the STP mechanism at time $1$ is as illustrated in Figure~\ref{fig:super_bowl_spatio_temporal_replan}. Driver $3$ is re-dispatched to pick up rider $5$ and then exit from $(B,2)$. Instead of picking up rider $8$ whose value is $90$, driver $2$ now picks up rider $6$ who was initially assigned to driver $3$. If there existed an additional driver at $(C,1)$, the driver will be dispatched to pick up rider $8$, and contribute to a welfare gain of $\val_8 - c_{C,A,1} = 70$. An additional driver at $(A,3)$ has no effect on welfare, thus the price for the $(C,A,1)$ trip is updated to $\price_{C,A,1} = \Phi_{C,1} - \Phi_{A,3} + c_{C,A,1} = 70 - 0 + 20 = 90$, and the utility of each driver from $(C,1)$ onward is equal to $\Phi_{C,1} = 70$. Similarly, we have $\price_{C,B,1} = \Phi_{C,1} - \Phi_{B,2} + c_{C,B,1} = 70 - (-5) + 10 = 85$ and $\price_{B,B,1} = \Phi_{B,1} - \Phi_{B,2} + c_{B,B,1} = -10 - (-5) + 10 = 5$. The utility of driver $3$ from $(B,1)$ onward is $\price_{B,B,1} - c_{B,B,1} - \kappa_{1} = 5 - 10 - 5 = -10$. The outcome remains envy-free for riders, and welfare optimal from time $1$ onward. \qed \end{example} \addtocounter{example}{1} Under the STP mechanism, replanning can be triggered by the deviation of any driver, and for this reason the total payment of a driver is affected by the actions of others, and the straightforward behavior is not a dominant strategy. We show that no mechanism can implement the desired properties in a dominant-strategy equilibrium. \begin{theorem} \label{thm:impossibility_of_DSE} Following the mechanism's dispatch at all times does not form a dominant strategy equilibrium under any dynamic ridesharing mechanism that is, from any history onward, (i) welfare-optimal, (ii) IR for riders, (iii) budget balanced, and (iv) envy-free for riders and drivers. \end{theorem} \begin{proof} We show that for the economy in Example~\ref{exmp:toy_econ_3}, as shown in Figure~\ref{fig:toy_econ_3}, under any mechanism that satisfies conditions (i)-(iv), following the dispatches at all times cannot be a DSE. We start by analyzing what must be the outcome at time $0$ under such a mechanism. At time $0$, optimal welfare is achieved by dispatching one of the two drivers to go to $(B,1)$ so that at time $1$ she can pick up rider $1$, and the other driver to go to $(A,1)$ to pick up rider $2$. Assume w.l.o.g.~that at time $0$, driver $1$ is dispatched to stay in $B$ and driver $2$ is dispatched to stay in $A$. Now consider the scenario where driver $2$ deviated, and took the trip $(A,B,0)$ at time $0$ instead. If driver $1$ followed the mechanism's dispatch at time $0$, both drivers are at $(B,1)$ at time $1$, and the welfare-optimal outcome is to pick up rider $1$. Individual rationality requires that the highest amount of payment we can collect from rider $1$ is $8$. Budget balance and envy-freeness of drivers then imply that drivers $1$ and $2$ are each paid at most $4$ at time $1$. If driver $2$ is going to deviate at time $0$ and relocate to $B$, driver $1$ may deviate from the mechanism's dispatch and relocate to $(A,1)$ instead. In this case, at time $1$ it is welfare optimal for driver $1$ to pick up rider $2$. Her payment for the trip $(A,A,1)$ is at least $5$, for otherwise rider $3$ envies the outcome of rider $2$. This is better than following the mechanism and get utility at most 4. \end{proof} A natural variation of the STP mechanism is to consider the driver-optimal analog, which always computes a driver-optimal CE plan at the beginning of the planning horizon, or upon deviation of any driver. This mechanism pays each driver the externality she brings to the economy, $\Psi_{\driverNode_i}$, and corresponds to the reasoning of the VCG mechanism. The driver-optimal mechanism is, however, not incentive compatible. See Appendix~\ref{appx:driver_opt_mech} for a detailed example and explanation. \subsection{Discussion} \label{sec:discussions} Throughout the paper, we assume~(S1) that drivers stay until the end of the planning horizon and have no intrinsic preference over locations, and~(S2), that riders are impatient. Examples~\ref{exmp:different_exit_times} and~\ref{exmp:patient_riders} in Appendix~\ref{appx:integrality} show that if either assumption is relaxed, the LP relaxation \eqref{equ:lp} of the planning problem may no longer be integral, and thus, there may not exist anonymous, origin-destination CE prices. This is because the reduction to the minimum cost flow problem fails (see Appendix~\ref{appx:integrality}). The triangle inequalities in distance and trip costs, i.e. $\dist(a, a') \leq \dist(a, b) + \dist(b, a')$ and $c_{a,a',t} \leq c_{a,b,t} + c_{b,a',t+\dist(a,b)}$ for all $a, a', b \in \loc$ and all $t \in [\horizon]$, is not necessary for our results on drivers' incentives. On the rider's side, one concern in practice is that riders may try to break a long trip into a few shorter trips in order to get a lower total price, especially for platforms where riders may set multiple stops for a single trip.\footnote{\url{https://www.ridester.com/uber-adds-multiple-stops/}, visited January 8, 2018.} With the triangle inequalities, we recover an arbitrage-proofness: the total price under the STP mechanism for the shorter trips is higher than for the single trip. This is because the shorter trips take a longer total time and incur a higher total cost, and the rider's total payment, which equals the difference in the welfare gain from having an additional driver at the (origin, starting time) and the (destination, ending time) of the trip plus the total costs, is higher if the ending time is later. The focus of this paper is to align incentives for drivers in a dynamic environment while maintaining driver flexibility, instead of that of information asymmetry. On the rider side, we show via Example~\ref{exmp:toy_econ_1_continued} in Appendix~\ref{appx:rider_incentives} that although the STP mechanism chooses a driver-pessimal CE plan, it may not be a dominant strategy for the riders to truthfully report their values. This is different from the classical, unit-demand assignment problem~\cite{shapley1971assignment}, where the set of CE prices form a lattice--- the seller-pessimal CE prices correspond to the buyer-side VCG prices, and is incentive compatible for the buyers. In fact, we show in Theorem~\ref{thm:minCE_riderVCG} that the rider-side VCG payment for a rider is equal to the minimum price for her trip among all CE outcomes, and such trip prices may not form a CE. This implies that no mechanism that computes optimal CE plans and balances budget incentivizes the riders to truthfully report their values. Moreover, we show that no BB, optimal and SPIC mechanism is incentive compatible on the rider's side. On the driver's side, we may consider a scenario where the mechanism does not know about drivers' entrance information, but asks the drivers to report their times and locations to enter the platform at the beginning of the planning horizon. We show in Appendix~\ref{appx:driver_entrance} that under the STP mechanism, for a driver with entrance location and time $(\re_i, \te_i)$, there is no incentive for her to report feasible location and time $(\hat{\re_i}, \hat{\te_i})$ where $\hat{\te_i} \geq \te_i + \dist(\re_i, \hat{\re_i})$, and then actually enter the platform at $(\hat{\re_i}, \hat{\te_i})$. If drivers are allowed to enter at any arbitrary time and location regardless of their reports, and if the mechanism simply replans without penalizing the drivers that deviated from their reports, then truthfully reporting entrance information is no longer a dominant strategy for drivers. We consider it less important to provide flexibility for drivers to enter the platform in a way that is different from their reports, since there is less uncertainty in driver's ability to enter (e.g. many drivers start driving from home at a certain time). \if 0 \hma{Additional bits from the talk notes: (ii) why doesn't follow from revelation mechanism, (iii) fairness in regard to effect on trips to quiet neighborhoods and opportunity for decoupling of rider and driver payments and transfers on rider side, (iv) why punishment/reputation doesn't fix the driver incentive problem} \fi \section{Simulation Results} \label{sec:illustrations} In this section, we compare, through numerical simulations, the performance of the STP mechanism against the myopic pricing mechanism, for three stylized scenarios: the end of a sporting event, the morning rush hour, and trips to and from the airport with unbalanced demand. In addition to social welfare, we consider the \emph{time-efficiency} of drivers, which is defined as the proportion of time where the drivers have a rider in the car, divided by the total time drivers spend on the platform. We also consider the \emph{regret} to drivers for following the straightforward strategy in a non incentive-aligned mechanism: the highest additional amount a driver can gain by strategizing in comparison to following a mechanism's dispatch, assuming that the rest of the drivers all follow the mechanism's dispatches at all times. The analysis suggests that the STP mechanism achieves substantially higher social welfare, as well as time-efficiency for drivers, whereas, under the myopic pricing mechanism, prices are highly unstable, and drivers incur a high regret. We define the myopic pricing mechanism to use the lowest market clearing prices (which market clearing prices are chosen is unimportant for the results). In addition, since this mechanism need not always dispatch all available drivers, we model any available driver who is not dispatched as randomly choosing a location that is within reach, and relocates there if this trip cost is no greater than the cost for exiting immediately (in which case she exits). \subsection{Scenario One: The End of a Sporting Event} \newcommand{0.8}{0.8} \newcommand{4}{4} \newcommand{\vdistSI}{1.5} \begin{figure}[t!] \centering \begin{tikzpicture}[->, >=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistSI cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = \vdistSI cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 4 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 4 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 4 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 4 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 4 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 4 cm, scale=0.8] {$C,2$}; \node[text width=3cm] at (-0.7, 2 * \vdistSI ) {15 Drivers}; \node[text width=3cm] at (-0.7, \vdistSI) {10 Drivers}; \path (C0) edge node[pos=0.25, sloped, above] {$20$ riders} (B1); \path (B0) edge node[pos=0.27, sloped, below] {$10$ riders} (C1); \path (B0) edge node[pos=0.5, sloped, below] {$10$ riders} (A1); \path (C1) edge node[pos=0.5, sloped, above] {$N_{C,B,1}$ riders} (B2); \end{tikzpicture} \caption{An example to illustrate the end of an event. \label{fig:ex1_end_of_event}} \end{figure} We first consider the scenario in Figure~\ref{fig:ex1_end_of_event}, modeling the end of a sporting event. There are three locations $\loc = \{A, B, C\}$ with unit distances $\dist(a,b) = 1$ for all $a,b\in \loc$, and two time periods. Trip costs are $3$ per period, and exiting early costs $1$ per period: $c_{a,b,t} = 3\dist(a,b)$, and $\kappa_{\Delta} = \Delta$. In each economy, at time $0$, there are $15$ and $10$ drivers that are already in the platform becoming available at locations $C$ and $B$.\footnote{We assume that all drivers are already in the platform, so that the results do not reflect the disadvantage of myopic for not making optimal entrance decisions.} $20$ riders request trip $(C,B,0)$ and $10$ riders request trips $(B,C,0)$ and $(B,A,0)$ respectively. When the event ends, there are $N_{C,B,1}$ riders hoping to take a ride from $(C,1)$ to $(B,2)$. The values of all riders are independently drawn from the exponential distribution with mean $10$. As we vary the number of riders $N_{C,B,1}$ requesting the trip $(C,B,1)$ from $0$ to $100$, we randomly generate $1,000$ economies, and compare the average welfare, driver's time efficiency and average regret as shown in Figure~\ref{fig:ex1_welfare_regret_efficiency}. \newcommand{1.8}{1.8} \begin{figure}[t!] \centering \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex1_event_welfare.eps} \caption{Social welfare.\label{fig:ex1_event_welfare}} \end{subfigure}% \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex1_event_efficiency.eps} \caption{Driver time efficiency. \label{fig:ex1_event_efficiency}} \end{subfigure}% \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex1_event_regret.eps} \caption{Average driver regret. \label{fig:ex1_event_regret}} \end{subfigure}% \caption{Comparison of welfare, driver time efficiency and average driver regret for the of an event. \label{fig:ex1_welfare_regret_efficiency} } \end{figure} Figure~\ref{fig:ex1_event_welfare} shows that the STP mechanism achieves a substantially higher social welfare than the myopic pricing mechanism, especially when there are a large number of drivers taking the trip $(C,B,1)$. Figure~\ref{fig:ex1_event_efficiency} shows that the STP mechanism becomes less time-efficient as the number of $(C,B,1)$ riders increases, as more of the $15$ drivers starting at $(C,0)$ stay in the same location until time $1$. The high time-efficiency achieved by myopic is because of the fact that undispatched drivers decided to exit immediately. The effective use of driver's time under myopic (total amount of time driver spend driving riders, divided by the total time a driver is willing to work) is in fact around 60 percent. We also see the extent to which the myopic pricing mechanism is not incentive aligned. Drivers that are dispatched to the trips $(C,B,1)$ and $(B,A,1)$ may regret having not relocated to $C$ instead and get paid a large amount at time $1$. Figure~\ref{fig:ex1_event_regret} shows that the average regret of the 25 drivers increases significantly as $N_{C,B,1}$ increases. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex1_event_stp_drivers.eps} \caption{The STP mechanism. \label{fig:ex1_event_stp_drivers}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex1_event_myopic_drivers.eps} \caption{The myopic pricing mechanism. \label{fig:ex1_event_myopic_drivers}} \end{subfigure}% \caption{Comparison of the number of drivers per trip for the end of an event. \label{fig:ex1_drivers} } \end{figure} \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex1_event_stp_prices.eps} \caption{The STP mechanism.\label{fig:ex1_event_stp_prices}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex1_event_myopic_prices.eps} \caption{The myopic pricing mechanism. \label{fig:ex1_event_myopic_prices}} \end{subfigure}% \caption{Comparison of trip prices for the end of an event. \label{fig:ex1_prices} } \end{figure} The average number of drivers taking each of the four trips of interest under the two mechanisms are shown in Figure~\ref{fig:ex1_drivers}. As $N_{C,B,1}$ increases, the STP mechanism dispatches more drivers to $(C,1)$ to pick-up higher-valued riders leaving $C$, while sending less drivers on trips $(C,B,0)$ and $(B,A,0)$. The myopic pricing mechanism, being oblivious to future demand, sends all drivers starting at $(C,0)$ to location $B$, and an average of only $5$ drivers to $(C,1)$ from $(B,1)$. The average trip prices are plotted in Figure~\ref{fig:ex1_prices}. First of all, prices are temporally ``smooth"--- trips leaving $C$ at times $0$ and $1$ have very similar prices. On average, $\price_{C,B,1}$ is higher than $\price_{C,B,0}$, since drivers taking the $(C,0)$-$(B,1)$ trip can exit at time $1$ and incur a smaller total cost. The price for the trip $(B,A,0)$ is the highest, so that a driver dispatched to $A$ does not envy those dispatched to take the trip $(B,C,0)$ and then $(C,B,1)$. In contrast, the price for for the $(C,B)$ trip drastically increases from time $0$ to time $1$ under the myopic pricing mechanism, and the drivers taking the trip $(B,A,0)$ envy those that take $(B,C,0)$ and subsequently $(C,B,1)$. The ``surge" for the trip $(C,B,1)$ is significantly higher under the myopic pricing mechanism, implying that the platform is providing even less price reliability for the riders. \subsection{Scenario Two: The Morning Rush Hour} \label{sec:sim_morning_rush} We now compare the two mechanisms for the economy in Figure~\ref{fig:ex2_morning_rush}, modeling the demand pattern of the morning rush hour. There are $\horizon = 20$ time periods and three locations $\loc = \{A, B, C\}$ with $\dist(a,b) = 1$ for all $a,b \in \loc$. Trip costs are $3$ per period, and exiting early costs $1$ per period: $c_{a,b,t} = 3\dist(a,b)$, and $\kappa_{\Delta} = \Delta$. $C$ is a residential area, where there are a number of riders requesting rides to $B$, the downtown area, in every period. Location $A$ models some other area in the city. \renewcommand{0.8}{0.8} \renewcommand{4}{2.5} \renewcommand{\vdistSI}{1.5} \if 0 \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistSI cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = \vdistSI cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 4 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 4 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 4 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 4 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 4 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 4 cm, scale=0.8] {$C,2$}; \node[state] (A9) [right of=A2, node distance = 1.2* 4 cm, scale=0.8] {$A,9$}; \node[state] (B9) [right of=B2, node distance = 1.2* 4 cm, scale=0.8] {$B,9$}; \node[state] (C9) [right of=C2, node distance = 1.2* 4 cm, scale=0.8] {$C,9$}; \node[state] (A10) [right of=A9, node distance = 4 cm, scale = 0.7] {$A,10$}; \node[state] (B10) [right of=B9, node distance = 4 cm, scale = 0.7] {$B,10$}; \node[state] (C10) [right of=C9, node distance = 4 cm, scale = 0.7] {$C,10$}; \node[text width=3cm] at (9, 2 * \vdistSI ) {\dots}; \node[text width=3cm] at (9, \vdistSI ) {\dots}; \node[text width=3cm] at (9, 0 ) {\dots}; \node[text width=3cm] at (-0.7, 2 * \vdistSI ) {10 Drivers}; \node[text width=3cm] at (-0.7, \vdistSI) {10 Drivers}; \node[text width=3cm] at (-0.7, 0) {10 Drivers}; \path (C0) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B1); \path (C1) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B2); \path (C9) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B10); \end{tikzpicture} \caption{Morning rush hour. \label{fig:ex2_morning_rush}} \end{figure} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = 0.8* \vdistSI cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = 1.2 * \vdistSI cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 4 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 4 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 4 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 4 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 4 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 4 cm, scale=0.8] {$C,2$}; \node[state] (A3) [right of=A2, node distance = 4 cm, scale=0.8] {$A,3$}; \node[state] (B3) [right of=B2, node distance = 4 cm, scale=0.8] {$B,3$}; \node[state] (C3) [right of=C2, node distance = 4 cm, scale=0.8] {$C,3$}; \if 0 \node[state] (A9) [right of=A3, node distance = 1.2* 4 cm, scale=0.8] {$A,9$}; \node[state] (B9) [right of=B3, node distance = 1.2* 4 cm, scale=0.8] {$B,9$}; \node[state] (C9) [right of=C3, node distance = 1.2* 4 cm, scale=0.8] {$C,9$}; \fi \node[state] (A10) [right of=A3, node distance = 2 * 4 cm, scale = 0.7] {$A,10$}; \node[state] (B10) [right of=B3, node distance = 2 * 4 cm, scale = 0.7] {$B,10$}; \node[state] (C10) [right of=C3, node distance = 2 * 4 cm, scale = 0.7] {$C,10$}; \node[text width=3cm] at (11.2, 2 * \vdistSI ) {\dots}; \node[text width=3cm] at (11.2, \vdistSI ) {\dots}; \node[text width=3cm] at (11.2, 0 ) {\dots}; \node[text width=3cm] at (-0.7, 2 * \vdistSI ) {10 Drivers}; \node[text width=3cm] at (-0.7, \vdistSI) {10 Drivers}; \node[text width=3cm] at (-0.7, 0) {10 Drivers}; \path (C0) edge node[pos=0.6, sloped, above] {$N_{C,B}$ riders} (B2); \path (C1) edge node[pos=0.6, sloped, above] {$N_{C,B}$ riders} (B3); \end{tikzpicture} \caption{Morning rush hour. \label{fig:ex2_morning_rush}} \end{figure} \fi \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistSI cm, scale=0.8] {$B,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (C0) [above of=B0, node distance = \vdistSI cm, scale=0.8] {$C,0$}; \node[state] (A1) [right of=A0, node distance = 4 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 4 cm, scale=0.8] {$B,1$}; \node[state] (C1) [right of=C0, node distance = 4 cm, scale=0.8] {$C,1$}; \node[state] (A2) [right of=A1, node distance = 4 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 4 cm, scale=0.8] {$B,2$}; \node[state] (C2) [right of=C1, node distance = 4 cm, scale=0.8] {$C,2$}; \node[state] (A9) [right of=A2, node distance = 1.2* 4 cm, scale=0.8*0.93] {$A,19$}; \node[state] (B9) [right of=B2, node distance = 1.2* 4 cm, scale=0.8*0.93] {$B,19$}; \node[state] (C9) [right of=C2, node distance = 1.2* 4 cm, scale=0.8*0.93] {$C,19$}; \node[state] (A10) [right of=A9, node distance = 4 cm, scale = 0.7] {$A,20$}; \node[state] (B10) [right of=B9, node distance = 4 cm, scale = 0.7] {$B,20$}; \node[state] (C10) [right of=C9, node distance = 4 cm, scale = 0.7] {$C,20$}; \node[text width=3cm] at (7.8, 2 * \vdistSI ) {\dots}; \node[text width=3cm] at (7.8, \vdistSI ) {\dots}; \node[text width=3cm] at (7.8, 0 ) {\dots}; \node[text width=3cm] at (-0.7, 2 * \vdistSI ) {10 Drivers}; \node[text width=3cm] at (-0.7, \vdistSI) {10 Drivers}; \node[text width=3cm] at (-0.7, 0) {10 Drivers}; \path (C0) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B1); \path (C1) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B2); \path (C9) edge node[pos=0.5, sloped, above] {$N_{C,B}$ riders} (B10); \end{tikzpicture} \caption{Morning rush hour. \label{fig:ex2_morning_rush}} \end{figure} In each economy, at time $t=0$, there are $10$ drivers starting in each of the three locations $A$, $B$ and $C$, who all stay until the end of the planning horizon. There are a total of $100$ riders with trip origins and destinations independently drawn at random from $\loc$ and trip starting times randomly drawn from $[\horizon - 1]$. In addition, in each period there are $N_{C,B}$ commuters traveling from $C$ to $B$. We assume that the commuters' values for the rides are i.i.d. exponentially distributed with mean 20, whereas the random rides have values exponentially distributed with mean 10. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex2_morning_welfare.eps} \caption{Social welfare.\label{fig:ex2_morning_welfare}} \end{subfigure}% \hspace{2em} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex2_morning_efficiency.eps} \caption{Driver time efficiency. \label{fig:ex2_morning_efficiency}} \end{subfigure}% \caption{Comparison of social welfare and driver time efficiency for the morning rush hours. \label{fig:ex2_welfare_efficiency}} \end{figure} As we vary the $N_{C,B}$ from $0$ to $100$, the average social welfare achieved by the two mechanisms for $1,000$ randomly generated economies is as shown in Figure~\ref{fig:ex2_morning_welfare}. The STP mechanism achieves higher social welfare than the myopic pricing mechanism. Figure~\ref{fig:ex2_morning_efficiency} shows that the STP mechanism achieves much higher driver time efficiency. The time efficiency of STP mechanism actually decreases as the number of $(C,B)$ riders per period increases above $10$, since the mechanism sends more empty cars to $C$ to pick up the higher value riders there. For the four origin-destination pairs, $(C,B)$, $(B,C)$, $(B,A)$ and $(A,B)$, Figures~\ref{fig:ex2_drivers} and~\ref{fig:ex2_prices} plot the average number of drivers getting dispatched to take these trips in each time period (including both trips with a rider, and repositioning without a rider), and the average trip prices. For each economy, the number of drivers for each origin-destination (OD) pair and the trip prices for this OD pair are averaged over the entire planning horizon. Results on the other five trips, $(A,A)$, $(A,C)$, $(B,B)$, $(C,A)$ and $(C,C)$ can be interpreted similarly, therefore are deferred to Appendix~\ref{appx:additional_simulations}. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex2_morning_stp_drivers.eps} \caption{The STP mechanism. \label{fig:ex2_morning_stp_drivers}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex2_morning_myopic_drivers.eps} \caption{The myopic pricing mechanism. \label{fig:ex2_morning_myopic_drivers}} \end{subfigure}% \caption{Comparison of the number of drivers per trip for the morning rush hour. \label{fig:ex2_drivers} } \end{figure} Under the STP mechanism, given the large demand for trips from $C$ to $B$ in each time period, there is a large number of drivers taking the trip $(C,B)$, and also a large number of drivers relocating from $B$ to $C$ in order to pick up future riders from $C$ (see Figure~\ref{fig:ex2_morning_stp_drivers}). A small number of drivers are dispatched from $B$ to $A$ due to the lack of future demand at $A$. Because of the abundance of supply at $B$ that are brought in by the $(C,B)$ trips, very few drivers are sent from $A$ to $B$. Under the myopic pricing mechanism, the number of drivers dispatched to take each trip, in contrast, does not contribute to the repositioning of drivers. See Figure~\ref{fig:ex2_morning_myopic_drivers}. There are an equal number of drivers traveling from $B$ to $A$ and $C$ despite the significant difference in the demand conditions at the two destinations. Moreover, a non-trivial number of drivers are traveling from $A$ to $B$ despite the fact that there are already too much of supply at location $B$. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex2_morning_stp_prices.eps} \caption{The STP mechanism.\label{fig:ex2_morning_stp_prices}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex2_morning_myopic_prices.eps} \caption{The myopic pricing mechanism. \label{fig:ex2_morning_myopic_prices}} \end{subfigure}% \caption{Comparison of trip prices for the morning rush hour. \label{fig:ex2_prices} } \end{figure} Regarding the average prices under the STP mechanism plotted in Figure~\ref{fig:ex2_morning_stp_prices}, the morning commute route $(C,B)$ has a higher average price due to the large demand for this trip. The $(B,A)$ trip is less costly than the $(A,B)$ trip since there is plenty of supply of drivers that are brought to $B$ by the $(C,B)$ trips, so that the marginal value of supply at $B$ is low. The $(A,B)$ price is high so that not too many drivers are dispatched from $A$ to $B$. The $(B,C)$ trips are priced almost always at zero, despite the fact that the trip cost for the drivers is $3$, since it is beneficial for the economy for drivers move to $C$ to pick up the commuters. Finally, Figure~\ref{fig:ex2_morning_myopic_prices} shows that the $(C,B)$ trip has a much higher average price under the myopic pricing mechanism than the STP mechanism, whereas the rest three trips are priced at the trip costs--- this is because without optimizing for the supply of drivers at each location, locations $A$ and $B$ almost always have plenty of supply to pick up all riders starting from these locations, whereas there is far from enough drivers to satisfy the large demand at location $C$. \subsection{Scenario Three: Unbalanced Airport Trips} \label{sec:sim_airport} In this scenario, we consider the imbalance between trips to and from the airport from the downtown area, as illustrated in Figure~\ref{fig:ex3_airport}. There are a total of $\horizon = 20$ time periods and two locations $\loc = \{A, D\}$, modeling the airport and the downtown area respectively. $\dist(A, A) = \dist(D,D) = 1$, whereas trips in between downtown and the airport are longer: $\dist(A,D) = \dist(D,A) = 2$. Trip costs are $3$ per period, and exiting early costs $1$ per period: $c_{a,b,t} = 3\dist(a,b)$, and $\kappa_{\Delta} = \Delta$. \renewcommand{0.8}{0.8} \renewcommand{4}{3} \renewcommand{\vdistSI}{2} \begin{figure}[t!] \centering \begin{tikzpicture}[->,>=stealth',shorten >=1pt, auto, node distance=2cm,semithick][font = \small] \tikzstyle{vertex} = [fill=white,draw=black,text=black,scale=0.9] \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (B0) [above of=A0, node distance = \vdistSI cm, scale=0.8] {$D,0$}; \node[state] (A0) [scale = 0.8] {$A,0$}; \node[state] (A1) [right of=A0, node distance = 4 cm, scale=0.8] {$A,1$}; \node[state] (B1) [right of=B0, node distance = 4 cm, scale=0.8] {$D,1$}; \node[state] (A2) [right of=A1, node distance = 4 cm, scale=0.8] {$A,2$}; \node[state] (B2) [right of=B1, node distance = 4 cm, scale=0.8] {$D,2$}; \node[state] (A3) [right of=A2, node distance = 4 cm, scale=0.8] {$A,3$}; \node[state] (B3) [right of=B2, node distance = 4 cm, scale=0.8] {$D,3$}; \if 0 \node[state] (A9) [right of=A2, node distance = 1.2* 4 cm, scale=0.8] {$A,9$}; \node[state] (B9) [right of=B2, node distance = 1.2* 4 cm, scale=0.8] {$D,9$}; \fi \node[state] (A10) [right of=A3, node distance = 1.2*4 cm, scale = 0.75] {$A,20$}; \node[state] (B10) [right of=B3, node distance = 1.2*4 cm, scale = 0.75] {$D,20$}; \node[text width=3cm] at (12, \vdistSI ) {\dots}; \node[text width=3cm] at (12, 0 ) {\dots}; \node[text width=3cm] at (-0.7, \vdistSI ) {10 Drivers}; \node[text width=3cm] at (-0.7, 0) {10 Drivers}; \path (B0) edge node[pos=0.55, sloped, above] {$40$ riders} (B1); \path (B1) edge node[pos=0.55, sloped, above] {$40$ riders} (B2); \path (B0) edge node[pos=0.2, sloped, below] {$N_{D,A}$ } (A2); \path (A0) edge node[pos=0.25, sloped, below] {$40$ - $N_{D,A}$} (B2); \path (B1) edge node[pos=0.75, sloped, below] {$N_{D,A}$ } (A3); \path (A1) edge node[pos=0.8, sloped, below] {$40$ - $N_{D,A}$} (B3); \end{tikzpicture} \caption{Imbalance in trips to and from the airport. \label{fig:ex3_airport}} \end{figure} In each economy, there are $20$ available drivers at each of $A$ and $D$ at time $0$. Within the downtown area, there are $40$ riders requesting rides in each period, whereas in between the downtown area and the airport, there are a total of $40$ riders heading toward or leaving the airport, which may be unevenly distributed on the two directions. The value of each of the downtown riders are drawn i.i.d from the exponential distribution with mean $10$, and the value for each trip to or from the airport is drawn i.i.d from the exponential distribution with mean $40$. Since the airport trips are twice as long, we are modeling the scenario where the airport travelers are less price sensitive, and are willing to pay twice as much, in comparison to the downtown riders. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex3_airport_welfare.eps} \caption{Social welfare.\label{fig:ex3_airport_welfare}} \end{subfigure}% \hspace{2em} \begin{subfigure}[t]{0.33\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex3_airport_efficiency.eps} \caption{Driver time efficiency. \label{fig:ex3_airport_efficiency}} \end{subfigure}% \caption{Comparison of social welfare and driver time efficiency for the morning rush hours. \label{fig:ex3_welfare_efficiency}} \end{figure} As we vary $N_{D,A}$ from $0$ to $40$ (thus at the same time varying the number of $(A,D)$ riders from $40$ to $0$), the average social welfare and driver-time efficiency achieved by the two mechanisms over $1,000$ randomly generated economies are as shown in Figure~\ref{fig:ex3_welfare_efficiency}. We first observe that the more balanced the trip flow to and from the airport is (i.e. when $N_{D,A}$ is closer to $20$), the higher the social welfare and driver time efficiency achieved by STP. This is because when the trip flow is more balanced, it is more likely for a driver to pick up riders with high values for the trips both to and from the airport, whereas when the flow is unbalanced, drivers may relocate with an empty car or pick up riders with low values for one of the two directions. The myopic pricing mechanism achieves comparatively good welfare and driver time-efficiency when trip flows are reasonably balanced, however, the performance downgrades quickly as the flow becomes more unbalanced. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex3_airport_stp_drivers.eps} \caption{The STP mechanism. \label{fig:ex3_airport_stp_drivers}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex3_airport_myopic_drivers.eps} \caption{The myopic pricing mechanism. \label{fig:ex3_airport_myopic_drivers}} \end{subfigure}% \caption{Comparison of driver numbers for the unbalanced trips to and from the airport. \label{fig:ex3_drivers}} \end{figure} Figure~\ref{fig:ex3_airport_stp_drivers} shows that regardless of the flow imbalance, the number of drivers doing downtown or airport trips stay reasonably stable under the STP mechanism. However, Figure~\ref{fig:ex3_airport_myopic_drivers} shows that when $N_{D,A}$ is too small, too many drivers staying in downtown, forgoing the opportunity to pick up the large number of drivers hoping to return to downtown from the airport. Similarly, when $N_{D,A}$ is too large, the myopic pricing mechanism sends too many drivers to the airport, since they have higher per period surplus. As a result, a large number of drivers line up at the airport, and too few rider traveling within downtown are picked up, resulting in much lower efficiency. \begin{figure}[t!] \centering \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height= 1.8 in]{figures_new/ex3_airport_stp_prices.eps} \caption{The STP mechanism.\label{fig:ex3_airport_stp_prices}} \end{subfigure}% \begin{subfigure}[t]{0.4\textwidth} \centering \includegraphics[height=1.8 in]{figures_new/ex3_airport_myopic_prices.eps} \caption{The myopic pricing mechanism. \label{fig:ex3_airport_myopic_prices}} \end{subfigure}% \caption{Comparison of trip prices for the unbalanced trips to and from the airport. \label{fig:ex3_prices} } \end{figure} The average prices for trips under the two mechanisms are shown in Figure~\ref{fig:ex3_prices}. Comparing the two mechanisms, we can see that the price for the $(D,D)$ downtown trip is almost constant, regardless of how unbalanced the airport trip flows are, however, the price for the downtown trip is seriously affected by the conditions at the airport. For the trips to and from the airport, we can see that both mechanisms increase the prices for the direction that is over-demanded, and lowers the price for other direction. The differences are (i) the price surges are much lower under STP than under myopic, providing riders more price stability, and (ii) the price for the under-demanded direction is close to zero under STP, reflecting the need to relocate cars even when there is no demand, however, myopic insists on setting a prices to at least cover the trip cost. \section{Conclusion} \label{sec:conclusion} We study the problem of optimal dispatching and pricing in two-sided ridesharing platforms in a way that drivers would choose to accept the platform's dispatches instead of driving to another area or waiting for a higher price. Under a complete information, discrete time, multi-period and multi-location model, we show that always following the mechanism's dispatches forms a subgame-perfect equilibrium among the drivers under the spatio-temporal pricing mechanism, which always computes a driver-pessimal competitive equilibrium plan at the beginning of the planning horizon as well as after any deviations. Our empirical study suggests that the STP mechanism achieves substantially higher social welfare and drivers' time efficiency in comparison to the myopic pricing mechanism, where in addition prices are highly unstable and drivers incur a large regret. Throughout the paper, we assumed complete information and a finite planning horizon. Our ongoing work include generalizing the model to settings where there is uncertainty in demand/supply prediction, and where the planning horizon rolls forward as the uncertainty gets resolved over time. One challenge is that of balancing budget--- strict balance does not hold for arbitrary driver action profiles, but may still hold in subgame perfect equilibrium. Another challenge is that the class of $M^\natural$ concave functions is not closed under addition, thus the continuation value of a distribution of drivers at the end of the planning horizon (which is the expectation of its continuation value for each realized future demand pattern) may no longer be $M^\natural$ concave, and this affects the integrality of the optimal planning problem and the existence of CE. Other interesting directions include: (i) empirical analysis on the ridesharing platforms, especially on the loss of welfare due to myopia and the strategic behavior of drivers, (ii) the fairness in regard to effect of welfare-optimal planning on trip prices to and from different neighborhoods with different demand patterns, (iii) truthful elicitation of information in scenarios where drivers poses information on local demand/supply in the near future, and where drivers have preferences with respect to locations or heterogeneity in costs, and (iv) pricing and dispatching with multiple classes of services, and with the existence of competition between platforms. \bigskip
\section{Introduction} \subsection{Background} The open nature of wireless communication channels makes transmitted signals susceptible to passive eavesdroppers present in the communication range. As a result, the problem of secure communication channel has always been of utmost priority. As such, various security techniques have been developed for application at different layers of the protocol stack such as cryptography and fequency hopping. Recently, information theoretic secrecy has gained more attention since it has significant advantages by not considering assumptions of limited computational power of the eavesdropper. Information theoretic secrecy in the presence of eavesdroppers was first applied in point-to-point communication systems and the earliest study dates back to Shannon's paper in 1949 \cite{cref8}. In the paper, Shannon proposed a secure communication strategy by having the transmitter and legitimate receiver share a secret key, which is unknown to the eavesdropper. This secret key approach (also known as one-time pad) which achieves perfect secrecy, i.e., zero information leakage, however, requires the secret key to be at least the size of the message and be independent of the message. The statistical difference in channel noise has also been exploited as a means to ensure information theoretic secrecy. This is demonstrated by Wyner who introduced the wiretap channel in which the signal transmitted by a sender is received by a legitimate receiver and an eavesdropper via noisy channels \cite{cref4}. The wiretap coding scheme invovles multicoding and randomized encoding. The principle behind this coding scheme is to provide sufficient randomness to the codeword in order to protect the message from the eavesdropper. However, secret communication is viable through this scheme if the channel to the eavesdropper is weaker than the channel to the legitimate receiver. The common approaches of information theoretic secrecy discussed above were even applied in broadcast channels. Schaefer and Khisti implemented the usage of secret keys to securely transmit a common message to two legitimate receivers while keeping the message ignorant from an eavesdropper \cite{Schaefer_Khisti14}. On the other hand, Csisz$\acute{\text{a}}$r and K$\ddot{\text{o}}$rner \cite{iref1} as well as Chia and El Gamal \cite{iref2} extended Wyner wiretap coding to the general discrete memoryless broadcast channels. The cases in \cite{iref1}, \cite{iref2} study broadcast channels with different number of receivers but both involve securing a single private message. A combinational approach was even demonstrated by Chen, Koyluoglu and Sezgin \cite{cref2} in which both the one-time pad approach and Wyner serecy coding are combined into the superposition-Marton coding scheme \cite{cref6,cref5} to ensure secure broadcasting in the case of the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper. Over the course of the aforementioned studies, there is no single unified strategy while integrating secrecy techniques into existing error-correcting coding schemes (without secrecy constraints) to ensure information theoretic secrecy. This motivates us to investigate if there exists a more intuitive guide on applying secrecy techniques to existing error-correcting coding schemes when secrecy is concerned. To achieve this goal, we continue from the study of Chen et al. \cite{cref2} which focus on the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with an eavesdropper under individual secrecy constraints. Our choice of study follows upon the fact that Chen-Koyluoglu-Sezgin secrecy coding scheme is more comprehensive since it combines two secrecy techniques into the popular superposition-Marton error-correcting coding scheme. In short, this paper aims to obtain an intuitive understanding on the integration of individual secrecy techniques to existing channel coding schemes. \subsection{Contributions} We notice that Carleial-Hellman secrecy coding \cite{cref3}, which allows each message to act as a random component in ensuring the individual secrecy of each another, can be used to simplify the stucture of Chen-Koyluoglu-Sezgin secrecy coding scheme for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper. This leads us to perform a two-step scheme simplification which involves the gradual replacement of Wyner secrecy coding with Carleial-Hellman secrecy coding. The final simplified coding scheme essentially allows us to identify the redundant components in the existing coding scheme. Although the proposed simplified coding scheme is shown to achieve the same rate region as the existing coding scheme, its construction simplicity provides a clear view on the integration of secrecy techniques into existing error-correcting coding schemes and enriches our present understanding on coding principles for individual secrecy. This understanding also acts as a basis while devising a coding scheme for secure broadcasting in the two-receiver discrete memoryless broadcast channel with one-sided receiver side information in our parallel work \cite{Me2}. \subsection{Paper Organization} The entire paper will be organized as follows. Section II will focus on the system model. Section III will provide an overview of the related works that motivate this paper. Section IV will provide the main results on the coding scheme simplification. Lastly, section V will provide a brief discussion and conclude the paper. \section{System Model} In this paper, we will denote random variables by uppercase letters, their corresponding realizations by lowercase letters and their corresponding sets by calligraphic letters. A $(j-i+1)$-sequence of random variables will be denoted by $X_i^j=(X_i,…,X_j)$ for $1\leq i\leq j$. Whenever $i=1$, the subscript will be dropped, resulting in $X^j=(X_1,…,X_j)$. $\mathbb{R}^d$ represents the $d$-dimensional real Euclidean space and $\mathbb{R}_+^d$ represents the $d$-dimensional non-negative real Euclidean space. $\mathcal{R}$ will be used to represent a subset of $\mathbb{R}^d$, and the convex hull of $\mathcal{R}$ will be denoted as co$(\mathcal{R})$. Meanwhile, $[a:b]$ refers to a set of natural numbers between and including $a$ and $b$, for $a\leq b$. Lastly, the operator $\times$ denotes the Cartesian product. \begin{figure}[t] \centering \includegraphics[width=2.5in,height=1in,keepaspectratio]{System_Model} \caption{The two-receiver broadcast channel with an eavesdropper.} \label{fig:1} \end{figure} The focus of this paper will be on the scheme simplification for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper (hereafter referred as the broadcast channel with complementary side information). The system model for this case is illustrated in Fig.~\ref{fig:1}. In this model, we define $(M_1, M_2)$ as the source messages, $M_i$ as the message requested by legitimate receiver $i$ and $M_{\hat{\imath}}$, $\hat{\imath}\triangleq (i\bmod 2)+1$ as the message known a priori (i.e., receiver side information), for all $i\in\{1,2\}$. Let $X$ denote the channel input from the sender, while $Y_i$ and $Z$ denote the channel output to receiver $i$ and the eavesdropper respectively. In $n$ channel uses, $X^n$ represents the transmitted codeword, $Y_i^n$ represents the signal received by legitimate receiver $i$ and $Z^n$ represents the signal received by the eavesdropper. The memoryless (and without feedback) nature of the channel also implies that \begin{align} &p(y_1^n,y_2^n,z^n|x^n)=\prod_{i=1}^n p(y_{1i},y_{2i},z_i|x_i) \end{align} In this case, the transmitter will be sending messages $M_{1}$ and $M_{2}$ to legitimate receiver 1 and 2, respectively through the channel $p(y_{1},y_{2},z|x)$. Both legitimate receivers have complementary receiver side information to aid them in decoding the transmitted messages. In other words, receiver 1 will be having $M_2$ as side information, whereas receiver 2 will be having $M_1$ as side information. \textit{Definition 1:} A $(2^{nR_1},2^{nR_2},n)$ secrecy code for the two-receiver discrete memoryless broadcast channel with complementary side information consists of \begin{itemize} \item two message sets, where $\mathcal{M}_1=[1:2^{nR_1}]$ and $\mathcal{M}_2=[1:2^{nR_2}]$; \item an encoding function, $f:\mathcal{M}_1\times\mathcal{M}_2\rightarrow\mathcal{X}^n$, such that $X^n=f(M_1,M_2)$; and \item two decoding functions, $g_i:\mathcal{Y}_i^n\times\mathcal{M}_{\hat{\imath}}\rightarrow\mathcal{M}_i$, such that $\hat{M}_i=g_i(Y_i^n, M_{\hat{\imath}})$, where $\hat{\imath}\triangleq (i\bmod 2)+1$, for all $i\in\{1,2\}$. \end{itemize} Both messages, $M_1$ and $M_2$ are assumed to be uniformly distributed over their respective message set. Hence, we have $R_i=\frac{1}{n}H(M_i)$, for all $i\in\{1,2\}$. Meanwhile the individual information leakage rate associated with the $(2^{nR_1},2^{nR_2},n)$ secrecy code is defined as $R_{\text{L},i}^{(n)}=\frac{1}{n}I(M_i;Z^n)$, for all $i\in\{1,2\}$. The probability of error for the secrecy code at each receiver $i$ is defined as $P_{\text{e},i}^{(n)}=P\{\hat{M}_i\ne M_i\}$, for $i\in\{1,2\}$. A rate pair $(R_1,R_2)$ is said to be achievable if there exist a sequence of $(2^{nR_1},2^{nR_2},n)$ codes such that \begin{align} &P_{\text{e},i}^{(n)}\leq \epsilon_n\text{, for all }i\in\{1,2\}\\ &R_{\text{L},i}^{(n)}\leq \tau_n\text{, for all }i\in\{1,2\}\\ & \lim\limits_{n\rightarrow\infty}\epsilon_n=0\text{ and }\lim\limits_{n\rightarrow\infty}\tau_n=0 \end{align} \section{Related Works} The problem in this paper is motivated by the discussions of Chen et al. \cite{cref2}. Chen et al. proposed a coding scheme for the broadcast channel with complementary side information under the context of individual secrecy. As illustrated in Fig.~\ref{fig:3a}, this coding scheme involves splitting $M_i$, for all $i\in\{1,2\}$, into four independent message segments, namely $M_{ia}$ at rate $R_{a}$, $M_{ib}$ at rate $R_{b}$, $M_{ic}$ at rate $R_{ic}$ and $M_{id}$ at rate $R_{id}$, i.e., $M_i=(M_{ia},M_{ib},M_{ic},M_{id})$ where $M_{ia}\in [1:2^{nR_{a}}]$, $M_{ib}\in [1:2^{nR_{b}}]$, $M_{ic}\in [1:2^{nR_{ic}}]$, $M_{id}\in [1:2^{nR_{id}}]$ and $R_i=R_{a}+R_{b}+R_{ic}+R_{id}$. These message segments then make up the coding scheme in Fig.~\ref{fig:3b} which comprises of four layers: cloud center codeword $U^n$, common satellite codeword $V^n$ as well as private satellite codewords $V_1^n$ and $V_2^n$. In this scheme, the cloud center codeword $U^n$ comprises a one-time pad signal \cite{cref8}. This secret key $M_{1a}\oplus M_{2a}$ is formed by XOR-ing the first segment of each message. The utilization of a one-time pad signal is possible since the legitimate receivers can utilize their receiver side information to unveil the original message. A main contribution in the coding scheme proposed by Chen et al. \cite{cref2} is a common satellite codeword $V^n$ formed and combined with $U^n$ using superposition coding \cite{cref6}. In the $V^n$ codeword layer, Wyner secrecy coding \cite{cref4} is implemented to protect the message segments $M_{1c}$ and $M_{2c}$ using a randomly generated $D$. However, apart from the regular randomness $D$, the authors presented an interesting idea of providing additional randomness through another one time-pad signal $M_{1b}\oplus M_{2b}$. Meanwhile, the private satellite codewords $V_1^n$ and $V_2^n$, which are responsible of carrying the remaining message segments $M_{1d}$ and $M_{2d}$ to their respective legitimate receivers, are also secured with Wyner secrecy coding \cite{cref4} using randomly generated $D_1$ and $D_2$ respectively. The private satellite codewords $V_1^n$ and $V_2^n$ are first combined under Marton coding in which the components $L_1$ and $L_2$ are present to ensure the existence of at least one jointly typical sequence pair between $V_1^n$ and $V_2^n$ \cite{cref5}. Next, the $V_1^n$ and $V_2^n$ codeword layers are combined with the upper $U^n$ and $V^n$ codeword layers using superposition coding, forming a superposition-Marton coding framework to achieve an improved rate region. This coding scheme has the achievability conditions listed in Theorem~\ref{theorem2}. After the Fourier-Motzkin procedure \cite[Appendix D]{cref6}, the achievable individual secrecy rate region $\mathcal{R}^{\text{old}}$ is obtained as in Corollary~\ref{corollary 2}. \begin{figure*}[t] \centerline{\subfloat[Rate splitting]{\includegraphics[width=2in,height=0.6in,keepaspectratio]{Rate_Split_Case_2_Old} \label{fig:3a}} \hfil \subfloat[Encoding]{\includegraphics[width=0.45\textwidth]{Encode_Case_2_Old} \label{fig:3b}}} \caption{An existing coding scheme for the two-receiver broadcast channel with complementary receiver side information and with an eavesdropper.} \label{fig:3} \end{figure*} \begin{theorem}[Chen et al.~\cite{cref2}]\label{theorem2} The following individual secrecy rate region is achievable for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper: \begin{equation}\label{eq1} \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1=R_a+R_b+R_{1c}+R_{1d},\\ &R_2=R_a+R_b+R_{2c}+R_{2d},\\ &R_{L1}+R_{L2}>I(V_1;V_2|V),\\ &R_1+R_D+R_{D1}+R_{L1}<I(U,V,V_1;Y_1),\\ &R_1-R_a+R_D+R_{D1}+R_{L1}<I(V,V_1;Y_1|U),\\ &R_{1d}+R_{D1}+R_{L1}<I(V_1;Y_1|V),\\ &R_2+R_D+R_{D2}+R_{L2}<I(U,V,V_2;Y_2),\\ &R_2-R_a+R_D+R_{D2}+R_{L2}<I(V,V_2;Y_2|U),\\ &R_{2d}+R_{D2}+R_{L2}<I(V_2;Y_2|V),\\ &R_{D1}+R_{L1}\geq I(V_1;Z|V),\\ &R_{D2}+R_{L2}\geq I(V_2;Z|V),\\ &R_b+R_D\overset{\text{(a)}}{\geq}I(V;Z|U),\\ &R_{L1}+R_{L2}\leq I(V_1;Z|V)+I(V_2;Z|V)\\&-I(V_1,V_2;Z|V),\\ &R_1\geq 0,R_a\geq 0,R_b\geq 0,R_{1c}\geq 0,\\ &R_{1d}\geq 0,R_2\geq 0,R_{2c}\geq 0,R_{2d}\geq 0,\\ &R_D\geq 0,R_{D1}\geq 0,R_{D2}\geq 0,R_{L1}\geq 0,R_{L2}\geq 0\\ &\text{over all } p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2) \end{split} \right. \right\} \end{equation} \end {theorem} \begin{corollary}[{\cite[Theorem 9]{cref2}}]\label{corollary 2} The achievable individual secrecy rate region in Theorem~\ref{theorem2} can be written as follows: \begin{equation}\label{eq2} \mathcal{R}^{\text{old}} \triangleq \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1<I(U;Y_1)+I(V,V_1;Y_1|U)\\&-I(V,V_1;Z|U)+I(V;Z|U),\\ &R_1-R_2<I(V,V_1;Y_1|U)-I(V,V_1;Z|U),\\ &R_2<I(U;Y_2)+I(V,V_2;Y_2|U)\\&-I(V,V_2;Z|U)+I(V;Z|U),\\ &R_2-R_1<I(V,V_2;Y_2|U)-I(V,V_2;Z|U)\\ &\text{over all }p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2)\\ &\text{ subject to }I(V_1;V_2|V)\overset{\text{(a)}}{<}I(V_1;Z|V)\\&+I(V_2;Z|V)-I(V_1,V_2;Z|V),\\ &I(V,V_i;Y_i|U)\overset{\text{(b)}}{>}I(V,V_i;Z|U)\text{ and }\\ &I(V_i;Y_i|V)\overset{\text{(c)}}{>}I(V_i;Z|V)\text{, for all }i\in\{1,2\}. \end{split} \right. \right\} \end{equation} \end{corollary} Note that for the superscript of $\mathcal{R}$, we use the shorthand notation 'old' to denote an existing region and 'new' to denote a new region. We will also use (\textit{xx}.\textit{yy}) to denote the \textit{yy} constraint in equation \textit{xx}. \section{Proposed Simplification for the Two-Receiver Broadcast Channel with Complementary Side Information} The coding scheme simplification for the two-receiver broadcast channel with complementary side information was carried out in two steps. \begin{figure*}[t] \centerline{\subfloat[Rate splitting]{\includegraphics[width=2in,height=0.6in,keepaspectratio]{Rate_Split_Case_2_New} \label{fig:6a}} \hfil \subfloat[Encoding]{\includegraphics[width=0.35\textwidth]{Encode_Case_2_New_1} \label{fig:6b}}} \caption{Simplified coding scheme 1.} \label{fig:6} \end{figure*} \subsection{Simplification Step 1} For the first simplification step, we performed rate splitting to break $M_i$, for all $i\in\{1,2\}$, into three indepedent message segments as shown in Fig.~\ref{fig:6a}. Compared to rate splitting for the existing coding scheme in Fig.~\ref{fig:3a}, our approach requires one less message split for $M_i$, i.e., $M_{ib}=\phi$. In line with the existing coding scheme, our proposed simplified coding scheme 1 is then constructed from a combination of a one-time pad signal \cite{cref8}, superposition coding \cite{cref6}, Wyner secrecy coding \cite{cref4} and Marton coding \cite{cref5} as illustrated in Fig.~\ref{fig:6b}. Our simplified coding scheme 1 differs from the existing coding scheme \cite{cref2} in Fig.~\ref{fig:3} as we bring in Carleial-Hellman secrecy coding \cite{cref3} to partially replace Wyner secrecy coding \cite{cref4} in the common satellite codeword $V^n$. Through this approach, the message segments $M_{1c}$ and $M_{2c}$ are now responsible of ensuring the individual secrecy of each another with the aid of an additional randomness $D$. The partial replacement of Wyner secrecy coding \cite{cref4} with Carleial-Hellman secrecy coding \cite{cref3} changes the individual secrecy analysis. Hence, it is insufficient to directly set $R_b=0$ in order to reflect $M_{ib}=\phi$. A modified decoding strategy is required, resulting in Lemma~\ref{lemma 1}. Using $\mathcal{R}^{\text{old'}}$ in Lemma~\ref{lemma 1}, we then obtain the achievable individual secrecy rate region of the simplified coding scheme 1 as presented in Theorem~\ref{theorem5}. \begin{lemma}\label{lemma 1} The existing coding scheme by Chen et al. \cite{cref2} for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper also achieves an alternative individual secrecy rate region $\mathcal{R}^{\text{old'}}$ as stated below: \begin{equation}\label{eq3} \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1=R_a+R_b+R_{1c}+R_{1d},\\ &R_2=R_a+R_b+R_{2c}+R_{2d},\\ &R_{L1}+R_{L2}>I(V_1;V_2|V),\\ &R_1+R_D+R_{D1}+R_{L1}<I(U,V,V_1;Y_1),\\ &R_1-R_a+R_D+R_{D1}+R_{L1}<I(V,V_1;Y_1|U),\\ &R_{1d}+R_{D1}+R_{L1}<I(V_1;Y_1|V),\\ &R_2+R_D+R_{D2}+R_{L2}<I(U,V,V_2;Y_2),\\ &R_2-R_a+R_D+R_{D2}+R_{L2}<I(V,V_2;Y_2|U),\\ &R_{2d}+R_{D2}+R_{L2}<I(V_2;Y_2|V),\\ &R_{D1}+R_{L1}\geq I(V_1;Z|V),\\ &R_{D2}+R_{L2}\geq I(V_2;Z|V),\\ &R_b+R_{1c}+R_D\overset{\text{(a)}}{\geq}I(V;Z|U),\\ &R_b+R_{2c}+R_D\overset{\text{(b)}}{\geq}I(V;Z|U),\\ &R_{L1}+R_{L2}\leq I(V_1;Z|V)+I(V_2;Z|V)\\&-I(V_1,V_2;Z|V),\\ &R_1\geq 0,R_a\geq 0,R_b\geq 0,R_{1c}\geq 0,\\ &R_{1d}\geq 0,R_2\geq 0,R_{2c}\geq 0,R_{2d}\geq 0,\\ &R_D\geq 0,R_{D1}\geq 0,R_{D2}\geq 0,R_{L1}\geq 0,R_{L2}\geq 0\\ &\text{over all } p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2) \end{split} \right. \right\} \end{equation} and $\mathcal{R}^{\text{old'}}=\mathcal{R}^{\text{old}}$. \end{lemma} \begin{IEEEproof}[Proof of Lemma~\ref{lemma 1}] The achievability conditions of $\mathcal{R}^{\text{old'}}$ are obtained based on the existing coding scheme for the two-receiver broadcast channel with complementary receiver side information \cite{cref2}. However, the achievability conditions of $\mathcal{R}^{\text{old'}}$ differ slightly from the achievability conditions of $\mathcal{R}^{\text{old}}$ in Theorem~\ref{theorem2}, where constraints (\ref{eq3}.a) and (\ref{eq3}.b) have replaced constraint (\ref{eq1}.a). This is a result of a difference in individual secrecy analysis for the $V^n$ codewords. In Theorem~\ref{theorem2}, both the message segments $M_{1c}$ and $M_{2c}$ are secured by the XOR-ed message segments $M_{1b}\oplus M_{2b}$ and additional randomness $D$. Meanwhile, in Lemma~\ref{lemma 1}, we apply the concept of Carleial-Hellman secrecy coding and treat the respective message segments $M_{1c}$ or $M_{2c}$ as additional randomness in ensuring the individual secrecy of their counterparts. This approach results in the looser constraints (\ref{eq3}.a) and (\ref{eq3}.b). Although $\mathcal{R}^{\text{old}}$ seems to have stricter achievability conditions compared to $\mathcal{R}^{\text{old'}}$, we now show that the two regions are in fact the same. Applying the Fourier-Motzkin procedure to eliminate the terms $R_a$, $R_b$, $R_{1c}$, $R_{1d}$, $R_{2c}$, $R_{2d}$, $R_D$, $R_{D1}$, $R_{D2}$, $R_{L1}$ and $R_{L2}$ in (\ref{eq3}), we obtain the individual secrecy rate region $\mathcal{R}^{\text{old'}}$, which has the same rate region expression as $\mathcal{R}^{\text{old}}$ in (\ref{eq2}). This gives us the relationship $\mathcal{R}^{\text{old'}}=\mathcal{R}^{\text{old}}$. \end{IEEEproof} Using the alternative expression in (\ref{eq3}), we will prove the following theorem. \begin{theorem}\label{theorem5} The simplified coding scheme 1 for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper achieves an individual secrecy rate region $\mathcal{R}^{\text{new1}}$, where $\mathcal{R}^{\text{new1}}=\mathcal{R}^{\text{old}}$. \end{theorem} \begin{IEEEproof}[Proof of Theorem~\ref{theorem5}] The proposed simplified coding scheme 1 in Fig.~\ref{fig:6b} can be readily obtained from the existing coding scheme by Chen et al. \cite{cref2} in Fig.~\ref{fig:3b} by setting $M_{ib}=\phi$, for all $i\in\{1,2\}$ in the existing coding scheme. With this change, $R_b=0$, allowing us to rewrite the achievability conditions in (\ref{eq3}) as follows: \begin{equation}\label{eq6} \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1=R_a+R_{1c}+R_{1d},\\ &R_2=R_a+R_{2c}+R_{2d},\\ &R_{L1}+R_{L2}>I(V_1;V_2|V),\\ &R_1+R_D+R_{D1}+R_{L1}<I(U,V,V_1;Y_1),\\ &R_1-R_a+R_D+R_{D1}+R_{L1}<I(V,V_1;Y_1|U),\\ &R_{1d}+R_{D1}+R_{L1}<I(V_1;Y_1|V),\\ &R_2+R_D+R_{D2}+R_{L2}<I(U,V,V_2;Y_2),\\ &R_2-R_a+R_D+R_{D2}+R_{L2}<I(V,V_2;Y_2|U),\\ &R_{2d}+R_{D2}+R_{L2}<I(V_2;Y_2|V),\\ &R_{D1}+R_{L1}\geq I(V_1;Z|V),\\ &R_{D2}+R_{L2}\geq I(V_2;Z|V),\\ &R_{1c}+R_D\geq I(V;Z|U),\\ &R_{2c}+R_D\geq I(V;Z|U),\\ &R_{L1}+R_{L2}\leq I(V_1;Z|V)+I(V_2;Z|V)\\&-I(V_1,V_2;Z|V),\\ &R_1\geq 0,R_a\geq 0,R_{1c}\geq 0,R_{1d}\geq 0,\\ &R_2\geq 0,R_{2c}\geq 0,R_{2d}\geq 0,R_D\geq 0,\\ &R_{D1}\geq 0,R_{D2}\geq 0,R_{L1}\geq 0,R_{L2}\geq 0\\ &\text{over all } p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2) \end{split} \right. \right\} \end{equation} Applying the Fourier-Motzkin procedure to eliminate the terms $R_a$, $R_{1c}$, $R_{1d}$, $R_{2c}$, $R_{2d}$, $R_D$, $R_{D1}$, $R_{D2}$, $R_{L1}$ and $R_{L2}$ in (\ref{eq6}), we obtain $\mathcal{R}^{\text{old}}$. \end{IEEEproof} \subsection{Simplification Step 2} \begin{figure}[t] \centering \includegraphics[width=0.35\textwidth]{Encode_Case_2_New_2} \caption{Simplified coding scheme 2.} \label{fig:7} \end{figure} Referring to the common satellite codeword $V^n$ of simplified coding scheme 1 in Fig.~\ref{fig:6b}, we recall that Carleial-Hellman secrecy coding \cite{cref3} allows each message to act as a random component which ensures individual secrecy of each another. Intuitively, additional random component should not be necessary in securing messages since each message has provided sufficient randomness. With this concept in mind, we proceed with the removal of the randomness $D$ from the $V^n$ codeword of the previous simplified coding scheme 1. The simplified coding scheme 2 is illustrated in Fig.~\ref{fig:7}. The achievable individual secrecy rate region of this simplified coding scheme 2 is shown in Theorem~\ref{theorem6} and rate region comparison is done through the proofs for Theorem~\ref{theorem7} and Theorem~\ref{theorem8} below. \begin{theorem}\label{theorem6} Define \begin{equation}\label{eq7} \mathcal{R}_{0}^{\text{new2}}\triangleq \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1\overset{\text{(a)}}{>}I(V;Z|U),\\ &R_1\overset{\text{(b)}}{<}I(U;Y_1)+I(V,V_1;Y_1|U)\\&-I(V,V_1;Z|U)+I(V;Z|U),\\ &R_1-R_2\overset{\text{(c)}}{<}I(V,V_1;Y_1|U)\\&-I(V,V_1;Z|U),\\ &R_2\overset{\text{(d)}}{>}I(V;Z|U),\\ &R_2\overset{\text{(e)}}{<}I(U;Y_2)+I(V,V_2;Y_2|U)\\&-I(V,V_2;Z|U)+I(V;Z|U),\\ &R_2-R_1\overset{\text{(f)}}{<}I(V,V_2;Y_2|U)\\&-I(V,V_2;Z|U)\\ &\text{over all }p(u)p(v|u)p(v_1,v_2|v)\\&p(x|v_1,v_2) \text{ subject to }I(V_1;V_2|V)\overset{\text{(g)}}{<}\\&I(V_1;Z|V)+I(V_2;Z|V)\\&-I(V_1,V_2;Z|V), I(V,V_i;Y_i|U)\overset{\text{(h)}}{>}\\&I(V,V_i;Z|U)\text{ and } I(V_i;Y_i|V)\overset{\text{(i)}}{>}\\&I(V_i;Z|V)\text{, for all }i\in\{1,2\}. \end{split} \right. \right\} \end{equation} and \begin{equation}\label{eq8} \begin{split} \mathcal{R}_{i}^{\text{new2}}\triangleq \mathcal{R}_{0}^{\text{new2}} &\text{ without constraints (\ref{eq7}.a), (\ref{eq7}.d) and (\ref{eq7}.g)--(\ref{eq7}.i)}\\ &\text{ but with an additional constraint }V_i=V=U\text{,}\\ &\text{ for }i\in\{1,2\}. \end{split} \end{equation} The simplified coding scheme 2 for the two-receiver discrete memoryless broadcast channel with complementary receiver side information and with a passive eavesdropper achieves an individual secrecy rate region $\mathcal{R}^{\text{new2}}$, where \vspace{-2pt} \begin{equation}\label{eq9} \mathcal{R}^{\text{new2}} = \mathcal{R}_{0}^{\text{new2}}\cup \mathcal{R}_{1}^{\text{new2}}\cup \mathcal{R}_{2}^{\text{new2}}. \end{equation} \end{theorem} \textit{Remark:} By comparing $\mathcal{R}^{\text{old}}$ in (\ref{eq2}) and $\mathcal{R}_{0}^{\text{new2}}$ in (\ref{eq7}), we notice that the latter region is bounded away from the $R_1$ and $R_2$ axes. The origin $(0,0)$ in particular is not in (\ref{eq7}) but is in (\ref{eq2}). This results from the usage of Carleial-Hellman secrecy coding in the $V^n$ common satellite codeword for our proposed simplified coding scheme 2. The principle behind Carleial-Hellman secrecy coding is to let neighbouring message segments act as random components which ensure the individual secrecy of each another. In order to do so, each message segment should reach a certain threshold in randomness to keep the eavesdropper totally ignorant of each message segment. In our case, each of the $M_{1c}$ and $M_{2c}$ message segments has a minimum threshold of $nI(V;Z|U)$ bits to fulfill the role as a random component. This results in constraints (\ref{eq7}.a) and (\ref{eq7}.d), which bound $\mathcal{R}_{0}^{\text{new2}}$ away from the $R_1$ and $R_2$ axes. However, the points along the $R_1$ and $R_2$ axes can be retrieved from $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$. Both $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ are achievable from a reduced version of the proposed simplified coding scheme 2 as shown in the following proof. \begin{IEEEproof}[Proof of Theorem~\ref{theorem6}] The proposed simplified coding scheme 2 is a special case of the proposed simplified coding scheme 1 by setting $D=\phi$. Setting $D=\phi$ forces the rate $R_D=0$, hence, we rewrite the achievable individual secrecy rate region in (\ref{eq6}) as \begin{equation}\label{eq10} \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1=R_a+R_{1c}+R_{1d},\\ &R_2=R_a+R_{2c}+R_{2d},\\ &R_{L1}+R_{L2}\overset{\text{(a)}}{>}I(V_1;V_2|V),\\ &R_1+R_{D1}+R_{L1}<I(U,V,V_1;Y_1),\\ &R_1-R_a+R_{D1}+R_{L1}\overset{\text{(b)}}{<}I(V,V_1;Y_1|U),\\ &R_{1d}+R_{D1}+R_{L1}\overset{\text{(c)}}{<}I(V_1;Y_1|V),\\ &R_2+R_{D2}+R_{L2}<I(U,V,V_2;Y_2),\\ &R_2-R_a+R_{D2}+R_{L2}\overset{\text{(d)}}{<}I(V,V_2;Y_2|U),\\ &R_{2d}+R_{D2}+R_{L2}\overset{\text{(e)}}{<}I(V_2;Y_2|V),\\ &R_{D1}+R_{L1}\overset{\text{(f)}}{\geq}I(V_1;Z|V),\\ &R_{D2}+R_{L2}\overset{\text{(g)}}{\geq}I(V_2;Z|V),\\ &R_{1c}\overset{\text{(h)}}{\geq}I(V;Z|U),\\ &R_{2c}\overset{\text{(i)}}{\geq}I(V;Z|U),\\ &R_{L1}+R_{L2}\overset{\text{(j)}}{\leq}I(V_1;Z|V)+I(V_2;Z|V)\\&-I(V_1,V_2;Z|V),\\ &R_1\geq 0,R_a\geq 0,R_{1c}\geq 0,R_{1d}\geq 0,\\ &R_2\geq 0,R_{2c}\geq 0,R_{2d}\geq 0,R_{D1}\geq 0,\\ &R_{D2}\geq 0,R_{L1}\geq 0,R_{L2}\geq 0\\ &\text{over all } p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2) \end{split} \right. \right\} \end{equation} Applying the Fourier-Motzkin procedure to eliminate the terms $R_a$, $R_{1c}$, $R_{1d}$, $R_{2c}$, $R_{2d}$, $R_{D1}$, $R_{D2}$, $R_{L1}$ and $R_{L2}$ in (\ref{eq10}), the region $\mathcal{R}_{0}^{\text{new2}}$ is obtained. Note that when $V_i=V=U$, $i\in\{1,2\}$, the proposed scheme reduces to a superposition coding scheme in which only the $U^n$ cloud center codeword and one $V_i^n$ private satellite codeword need to be decoded. The following changes to the simplified coding scheme 2 in Fig.~\ref{fig:7} ensue from the reduction: \begin{itemize} \item No new message segments are encoded to the $V^n$ codeword, i.e., $M_{1c}=\phi$ and $M_{2c}=\phi$, \item No new message segments are encoded to the reduced $V_i^n$ codeword, i.e., $M_{id}=\phi$ and $D_i=\phi$, \item Components of Marton coding are removed, i.e., $L_i=\phi$, for all $i\in\{1,2\}$. \end{itemize} These changes affect (\ref{eq10}) by \begin{itemize} \item Removing the rate terms $R_{1c}$, $R_{2c}$, $R_{id}$, $R_{Di}$, $R_{L1}$ and $R_{L2}$ (together with their respective non-negativity constraints), \item Removing achievability constraints of the $V^n$ codeword, i.e., both (\ref{eq10}.b) and (\ref{eq10}.d), \item Removing achievability constraints of the reduced $V_i^n$ codeword, i.e., (\ref{eq10}.c) if $i=1$ and (\ref{eq10}.e) if $i=2$, \item Removing individual secrecy constraints of the $V^n$ codeword, i.e., both (\ref{eq10}.h) and (\ref{eq10}.i), \item Removing individual secrecy constraints of the reduced $V_i^n$ codeword, i.e., (\ref{eq10}.f) if $i=1$ and (\ref{eq10}.g) if $i=2$, \item Removing constraints due to Marton coding, i.e., both (\ref{eq10}.a) and (\ref{eq10}.j). \end{itemize} Substituting $V_i=V=U$ in the mutual information terms of (\ref{eq10}), we get \begin{equation}\label{eq12} \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_{\hat{\imath}}=R_a+R_{\hat{\imath}d},\\ &R_i=R_a,\\ &R_{\hat{\imath}}+R_{D\hat{\imath}}<I(U,V_{\hat{\imath}};Y_{\hat{\imath}}),\\ &R_{\hat{\imath}d}+R_{D\hat{\imath}}<I(V_{\hat{\imath}};Y_{\hat{\imath}}|U),\\ &R_i<I(U;Y_i),\\ &R_{D\hat{\imath}}\geq I(V_{\hat{\imath}};Z|U),\\ &R_{\hat{\imath}}\geq 0,R_a\geq 0,R_{\hat{\imath}d}\geq 0, R_i\geq 0,R_{D\hat{\imath}}\geq 0,\\ &\text{over all } p(u)p(v_{\hat{\imath}}|u)p(x|v_{\hat{\imath}},u)\\ &\text{where }\hat{\imath}\triangleq (i\bmod 2)+1\text{, for }i\in\{1,2\} \end{split} \right. \right\} \end{equation} By applying the Fourier-Motzkin procedure to eliminate the terms $R_a$, $R_{\hat{\imath}d}$ and $R_{D\hat{\imath}}$ in (\ref{eq12}), we get (\ref{eq7}) with constraints (\ref{eq7}.a), (\ref{eq7}.d) and (\ref{eq7}.g)--(\ref{eq7}.i) removed, giving us the regions $\mathcal{R}_{i}^{\text{new2}}$, for $i\in\{1,2\}$. Taking the union of $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ will then give us the individual secrecy rate region $\mathcal{R}^{\text{new2}}$ in Theorem~\ref{theorem6}. \end{IEEEproof} \begin{figure*}[t] \centerline {\captionsetup[subfloat]{format=hang,width=0.24\textwidth,justification=raggedright} \subfloat[$\mathcal{R}^{\text{old}}$]{\includegraphics[width=0.2\textwidth]{8a} \label{fig:8a}} \hfil \captionsetup[subfloat]{format=hang,width=0.24\textwidth,justification=raggedright} \subfloat[$\mathcal{R}_{0}^{\text{new2}}$, \newline $I(V;Z|U)\leq \newline I(V,V_i;Y_i|U)-I(V,V_i;Z|U)$, for all $i\in\{1,2\}$]{\includegraphics[width=0.2\textwidth]{8b} \label{fig:8b}} \hfil \captionsetup[subfloat]{format=hang,width=0.24\textwidth,justification=raggedright} \subfloat[$\mathcal{R}_{0}^{\text{new2}}$, \newline $I(V;Z|U)>\newline I(V,V_i;Y_i|U)-I(V,V_i;Z|U)$,\newline for all $i\in\{1,2\}$]{\includegraphics[width=0.2\textwidth]{8c} \label{fig:8c}}} \centerline{\captionsetup[subfloat]{format=hang,width=0.24\textwidth,justification=raggedright} \subfloat[$\mathcal{R}_{0}^{\text{new2}}$, \newline $I(V;Z|U)>\newline I(V,V_1;Y_1|U)-I(V,V_1;Z|U)$, \newline $I(V;Z|U)\leq \newline I(V,V_2;Y_2|U)-I(V,V_2;Z|U)$]{\includegraphics[width=0.2\textwidth]{8d} \label{fig:8d}} \hfil \captionsetup[subfloat]{format=hang,width=0.24\textwidth,justification=raggedright} \subfloat[$\mathcal{R}_{0}^{\text{new2}}$, \newline $I(V;Z|U)\leq \newline I(V,V_1;Y_1|U)-I(V,V_1;Z|U)$, \newline $I(V;Z|U)>\newline I(V,V_2;Y_2|U)-I(V,V_2;Z|U)$]{\includegraphics[width=0.2\textwidth]{8e} \label{fig:8e}}} \caption{Plots of individual secrecy rate regions $\mathcal{R}^{\text{new1}}=\mathcal{R}^{\text{old}}$ and $\mathcal{R}_{0}^{\text{new2}}$ (shaded region) for some chosen $p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2)$.} \label{fig:8} \end{figure*} \begin{theorem}\label{theorem7} $\text{co}(\mathcal{R}^{\text{new2}})=\mathcal{R}^{\text{new1}}$. \end{theorem} \begin{IEEEproof}[Proof of Theorem~\ref{theorem7}] Now, we show that by taking the convex hull of the union of $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$, we will be able to achieve the region $\mathcal{R}^{\text{new1}}$. As a start, we plot the rate region $\mathcal{R}^{\text{new1}}$ as illustrated in Fig.~\ref{fig:8a}. It can be observed that $\mathcal{R}_{0}^{\text{new2}}$ has two additional constraints (\ref{eq7}.a) and (\ref{eq7}.d) compared to $\mathcal{R}^{\text{new1}}$. By comparing RHS of (\ref{eq7}.a) and (\ref{eq7}.d) to RHS of (\ref{eq7}.c) and (\ref{eq7}.f), $\mathcal{R}_{0}^{\text{new2}}$ can be plotted for four cases as shown in Fig.~\ref{fig:8b} to Fig.~\ref{fig:8e}. For all plots in Fig.~\ref{fig:8}, we have labelled \begin{flalign*} &s_1=(A-\varepsilon,0)\text{, } s_2=(B-\varepsilon,0)\text{, } s_3=(0,C-\varepsilon)\text{, }&\\ &s_4=(0,D-\varepsilon)\text{, } s_5=(E-\varepsilon,0)\text{, } s_6=(0,E-\varepsilon)& \end{flalign*} where \begin{flalign*} &A\triangleq I(U;Y_1)+I(V,V_1;Y_1|U)-I(V,V_1;Z|U)+I(V;Z|U)\text{,}&\\ &B\triangleq I(V,V_1;Y_1|U)-I(V,V_1;Z|U)\text{,}&\\ &C\triangleq I(U;Y_2)+I(V,V_2;Y_2|U)-I(V,V_2;Z|U)+I(V;Z|U)\text{,}&\\ &D\triangleq I(V,V_2;Y_2|U)-I(V,V_2;Z|U)\text{,}&\\ &E\triangleq I(V;Z|U)& \end{flalign*} for some arbitrarily small $\varepsilon$, $\varepsilon>0$. Note that $E\leq A$ and $E\leq C$ at all times. The proof of $E\leq A$ is as follows: \begin{align*} A&=I(U;Y_1)+I(V,V_1;Y_1|U)-I(V,V_1;Z|U)+I(V;Z|U)\\ &\overset{\text{(a)}}{\geq}I(U;Y_1)+I(V;Z|U)\\ &\geq I(V;Z|U)\\ &=E \end{align*} where (a) follows from (\ref{eq2}.b) and (\ref{eq7}.h). The same proof applies to $E\leq C$. Referring to Fig.~\ref{fig:8b}, when $I(V;Z|U)\leq I(V,V_i;Y_i|U)-I(V,V_i;Z|U)$, for all $i\in\{1,2\}$, the additional constraints (\ref{eq7}.a) and (\ref{eq7}.d) result in the excluded square region T1. Meanwhile, in Fig.~\ref{fig:8c}, when $I(V;Z|U)>I(V,V_i;Y_i|U)-I(V,V_i;Z|U)$, for all $i\in\{1,2\}$, (\ref{eq7}.a) and (\ref{eq7}.d) form a hexagonal cut and result in the excluded region T2. On the other hand, for the remaining cases in Fig.~\ref{fig:8d} and Fig.~\ref{fig:8e}, (\ref{eq7}.a) and (\ref{eq7}.d) form a pentagonal cut and result in the excluded regions T3 and T4 respectively. In order to retrieve the excluded rate points in regions T1 to T4, it is essential to recover point $s_2$ and point $s_4$. To recover point $s_2$, we first consider the random variables $(U,V,V_1)$ that are arbitrarily correlated. Next, from $\mathcal{R}_{2}^{\text{new2}}$ in (\ref{eq8}), we set $V'_2=V'=U'=U$ and $V'_1=(V,V_1)$ such that $(U',V',V'_1,V'_1,V'_2,X,Y_1,Y_2,Z)$ satisfy $p(u')p(v'|u')p(v'_1,v'_2|v')p(x|v'_1,v'_2)p(y_1,y_2,z|x)$ and the constraint $V'_2=V'=U'$. The substitutions are as follows:\\ From (\ref{eq7}.b),\\ \begin{flalign*} R_1<&I(U';Y_1)+I(V',V'_1;Y_1|U')-I(V',V'_1;Z|U')&\\&+I(V';Z|U')&\\ =&I(U;Y_1)+I(U,V,V_1;Y_1|U)-I(U,V,V_1;Z|U)&\\&+I(U;Z|U)&\\ =&I(U;Y_1)+I(V,V_1;Y_1|U)-I(V,V_1;Z|U)& \end{flalign*} From (\ref{eq7}.c),\\ \begin{flalign*} R_1-R_2<&I(V',V'_1;Y_1|U')-I(V',V'_1;Z|U')&\\ =&I(U,V,V_1;Y_1|U)-I(U,V,V_1;Z|U)&\\ =&I(V,V_1;Y_1|U)-I(V,V_1;Z|U)& \end{flalign*} From (\ref{eq7}.e),\\ \begin{flalign*} R_2<&I(U';Y_2)+I(V',V'_2;Y_2|U')-I(V',V'_2;Z|U')&\\&+I(V';Z|U')&\\ =&I(U;Y_2)+I(U;Y_2|U)-I(U;Z|U)+I(U;Z|U)&\\ =&I(U;Y_2)& \end{flalign*} From (\ref{eq7}.f),\\ \begin{flalign*} R_2-R_1<&I(V',V'_2;Y_2|U')-I(V',V'_2;Z|U')&\\ =&I(U;Y_2|U)-I(U;Z|U)&\\ \text{And hence, }\\ R_2<&R_1& \end{flalign*} Note that we have been using constraints from (\ref{eq7}) for the substitutions since (\ref{eq8}) is expressed in terms of (\ref{eq7}). This series of substitutions allows us to obtain a subregion $\mathcal{R}_{2}^{\text{new2'}}$: \begin{equation}\label{eq11} \mathcal{R}_{2}^{\text{new2'}}\triangleq \left\{ \begin{split} (R_1,R_2)\\ \in \mathbb{R}_+^2 \end{split} \left\vert \begin{split} &R_1\overset{\text{(a)}}{<}I(U;Y_1)+I(V,V_1;Y_1|U)\\&-I(V,V_1;Z|U),\\ &R_1-R_2\overset{\text{(b)}}{<}I(V,V_1;Y_1|U)\\&-I(V,V_1;Z|U),\\ &R_2\overset{\text{(c)}}{<}I(U;Y_2),\\ &R_2\overset{\text{(d)}}{<}R_1\\ &\text{over all }p(u,v,v_1)\\&p(x|u,v,v_1). \end{split} \right. \right\} \end{equation} From (\ref{eq2}), point $s_2$ has the coordinates $(I(V,V_1;Y_1|U)-I(V,V_1;Z|U)-\varepsilon,0)$ for some arbitrarily small $\varepsilon$, $\varepsilon>0$ where $(U,V,V_1,V_2)$ satisfy $p(u)p(v|u)p(v_1,v_2|v)p(x|v_1,v_2)$ and constraints (\ref{eq2}.a)--(\ref{eq2}.c). From here, we observe that the coordinates of $s_2$ satisfies (\ref{eq11}.a)--(\ref{eq11}.d). This shows that $s_2$ is recoverable and lies in $\mathcal{R}_{2}^{\text{new2}}$ since $\mathcal{R}_{2}^{\text{new2'}} \subseteq \mathcal{R}_{2}^{\text{new2}}$. Likewise, to recover point $s_4$, we again consider the random variables $(U,V,V_2)$ that are arbitrarily correlated. Next, from $\mathcal{R}_{1}^{\text{new2}}$ in (\ref{eq8}), we can set $V'_1=V'=U'=U$ and $V'_2=(V,V_2)$ such that $(U',V',V'_1,V'_1,V'_2,X,Y_1,Y_2,Z)$ satisfy $p(u')p(v'|u')p(v'_1,v'_2|v')p(x|v'_1,v'_2)p(y_1,y_2,z|x)$ and the constraint $V'_1=V'=U'$. These arguments show that $s_2\in \mathcal{R}_{2}^{\text{new2}}$ and $s_4\in \mathcal{R}_{1}^{\text{new2}}$. Noting that the point $(0,0)\in \mathcal{R}_{i}^{\text{new2}}$, for all $i\in\{1,2\}$, hence, by time-sharing, we take co$(\mathcal{R}_{0}^{\text{new2}}\cup \mathcal{R}_{1}^{\text{new2}}\cup \mathcal{R}_{2}^{\text{new2}})$ to achieve $\mathcal{R}^{\text{new1}}$. \end{IEEEproof} \begin{theorem}\label{theorem8} $\text{co}(\mathcal{R}^{\text{new2}})=\mathcal{R}^{\text{new2}}$. \end{theorem} \begin{IEEEproof}[Proof of Theorem~\ref{theorem8}] In the proof for Theorem~\ref{theorem7}, we show that through time-sharing, we take $\text{co}(\mathcal{R}^{\text{new2}})$ to obtain $\mathcal{R}^{\text{new1}}$. Time-sharing, however, is redundant, i.e., $\mathcal{R}^{\text{new2}}=\mathcal{R}^{\text{new1}}$, if the following conditions are met: \begin{enumerate} \item $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ are convex. \item $\mathcal{R}_{0}^{\text{new2}}$ contains all the interior points of $\mathcal{R}^{\text{new1}}$. \item $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ contain all boundary points of $\mathcal{R}^{\text{new1}}$ that are excluded by $\mathcal{R}_{0}^{\text{new2}}$. \end{enumerate} Fulfilling all three conditions above allows us to recover all points of $\mathcal{R}^{\text{new1}}$ by taking the union of $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$, i.e., $\mathcal{R}^{\text{new2}}$. In order to proof condition 1, we first note that the regions $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ can be convexified by introducing a time-sharing variable $Q$ which is independent of $(U,V,V_1,V_2,X,Y_1,Y_2,Z)$. Alternatively, by defining $U'=(U,Q)$, $V'=(V,Q)$, $V'_1=(V_1,Q)$ and $V'_2=(V_2,Q)$, we naturally include the time-sharing variable, hence, showing that $\mathcal{R}_{0}^{\text{new2}}$, $\mathcal{R}_{1}^{\text{new2}}$ and $\mathcal{R}_{2}^{\text{new2}}$ are convex. Recalling our earlier discussion, we understand that $\mathcal{R}_{0}^{\text{new2}}$ is bounded away from the $R_1$ and $R_2$ axes due to constraints (\ref{eq7}.a) and (\ref{eq7}.d). As a result, in order to fulfill condition 2, we need to show that $\mathcal{R}_{0}^{\text{new2}}$ can go arbitrarily close to the $R_1$ and $R_2$ axes, i.e., $\mathcal{R}_{0}^{\text{new2}}$ approaches the points $(0,0)$, $s_2$ and $s_4$ in Fig.~\ref{fig:8a}. Now, we show that $\mathcal{R}_{0}^{\text{new2}}$ goes arbitrarily close to the $R_1$ axis by proving that the points $(\varepsilon,\varepsilon)$ and $(B-\varepsilon,\varepsilon)$ are in $\mathcal{R}_{0}^{\text{new2}}$ for any arbitrarily small $\varepsilon$, $\varepsilon>0$. Using an argument similar to time-sharing, let $\mathcal{R}_{0}^{\text{new2}}$ be achievable from two sets of random variables $(U_\alpha,V_\alpha,V_{1\alpha},V_{2\alpha})$ and $(U_\beta,V_\beta,V_{1\beta},V_{2\beta})$ through an auxiliary random variable $Q$ with probability mass function $p_{}(q)$ given by: \begin{flalign*} p_{}(q)=& \biggl\{ \begin{aligned} \gamma &\text{\qquad if }q=\alpha\\ 1-\gamma &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} where $\alpha$ and $\beta$ are integer values taken by $Q$ at different instances of time-sharing and $0< \gamma \leq 1$. Considering a new set of random variables $(U^*,V^*,V^*_1,V^*_2,X^*,Y^*_1,Y^*_2,Z^*)$ which satisfies some $p(u^*)p(v^*|u^*)p(v^*_1,v^*_2|v^*)p(x^*|v^*_1,v^*_2)p(y^*_1,y^*_2,z^*|x^*)$, we define: \begin{itemize}[leftmargin=*] \item $U_\alpha=U^*,V_\alpha=V^*\text{ and }V_{i\alpha}=V^*_i,\text{for all }i\in\{1,2\}$ such that $(U_\alpha,V_\alpha,V_{1\alpha},V_{2\alpha})$ satisfy $p(u_\alpha)p(v_\alpha|u_\alpha)p(v_{1\alpha},v_{2\alpha}|v_\alpha)p(x^*|v_{1\alpha},v_{2\alpha})p(y^*_1,y^*_2,z^*|x^*)$, \item $V_{2\beta}=V_\beta=U_\beta=U^*\text{ and }V_{1\beta}=(V^*,V^*_1)$ such that $(U_\beta,V_\beta,V_{1\beta},V_{2\beta})$ satisfy $p(u_\beta)p(v_\beta|u_\beta)p(v_{1\beta},v_{2\beta}|v_\beta)p(x^*|v_{1\beta},v_{2\beta})p(y^*_1,y^*_2,z^*|x^*)$ and the constraint $V_{2\beta}=V_\beta=U_\beta$. \end{itemize} In order to incorporate the auxiliary random variable $Q$ into (\ref{eq7}), we next define additional random variables $U'=(U,Q)$, $V'=(V,Q)$, $V'_1=(V_1,Q)$ and $V'_2=(V_2,Q)$ such that $(U',V',V'_1,V'_2,X,Y_1,Y_2,Z)$ has the pmf $p(u')p(v'|u')p(v'_1,v'_2|v')p(x|v'_1,v'_2)p(y_1,y_2,z|x)$ assigned as follows: \begin{flalign*} p_{}(u')=&p_{}(u,q)&\\ =&p_{}(q)p_{}(u|q)&\\ =&\biggl\{ \begin{aligned} p_{}(\alpha)p_{}(u|\alpha) &\text{\qquad if }q=\alpha\\ p_{}(\beta)p_{}(u|\beta) &\text{\qquad if }q=\beta \end{aligned}&\\ \overset{\text{assign}}{=}&\biggl\{ \begin{aligned} \gamma p(u_\alpha) &\text{\qquad if }q=\alpha\\ (1-\gamma) p(u_\beta) &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} \begin{flalign*} p_{}(v'|u')=&p_{}(v,q|u,q)&\\ =&p_{}(q)p_{}(v|u,q)&\\ =&\biggl\{ \begin{aligned} p_{}(\alpha)p_{}(v|u,\alpha) &\text{\qquad if }q=\alpha\\ p_{}(\beta)p_{}(v|u,\beta) &\text{\qquad if }q=\beta \end{aligned}&\\ \overset{\text{assign}}{=}&\biggl\{ \begin{aligned} \gamma p(v_\alpha|u_\alpha) &\text{\qquad if }q=\alpha\\ (1-\gamma) p(v_\beta|u_\beta) &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} \begin{flalign*} p_{}(v'_1|v')=&p_{}(v_1,q|v,q)&\\ =&p_{}(q)p_{}(v_1|v,q)&\\ =&\biggl\{ \begin{aligned} p_{}(\alpha)p_{}(v_1|v,\alpha) &\text{\qquad if }q=\alpha\\ p_{}(\beta)p_{}(v_1|v,\beta) &\text{\qquad if }q=\beta \end{aligned}&\\ \overset{\text{assign}}{=}&\biggl\{ \begin{aligned} \gamma p(v_{1\alpha}|v_\alpha) &\text{\qquad if }q=\alpha\\ (1-\gamma) p(v_{1_\beta}|v_\beta) &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} \begin{flalign*} p_{}(v'_2|v')=&p_{}(v_2,q|v,q)&\\ =&p_{}(q)p_{}(v_2|v,q)&\\ =&\biggl\{ \begin{aligned} p_{}(\alpha)p_{}(v_2|v,\alpha) &\text{\qquad if }q=\alpha\\ p_{}(\beta)p_{}(v_2|v,\beta) &\text{\qquad if }q=\beta \end{aligned}&\\ \overset{\text{assign}}{=}&\biggl\{ \begin{aligned} \gamma p(v_{2\alpha}|v_\alpha) &\text{\qquad if }q=\alpha\\ (1-\gamma) p(v_{2\beta}|v_\beta) &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} \begin{flalign*} p_{}(x|v'_1,v'_2)=&p_{}(x|v_1,v_2,q)&\\ =&\biggl\{ \begin{aligned} p_{}(x|v_1,v_2,\alpha) &\text{\qquad if }q=\alpha\\ p_{}(x|v_1,v_2,\beta) &\text{\qquad if }q=\beta \end{aligned}&\\ \overset{\text{assign}}{=}&\biggl\{ \begin{aligned} p(x^*|v_{1\alpha},v_{2\alpha}) &\text{\qquad if }q=\alpha\\ p(x^*|v_{1\beta},v_{2\beta}) &\text{\qquad if }q=\beta \end{aligned}& \end{flalign*} Substituting these properties into (\ref{eq7}), we have: \\From (\ref{eq7}.a) and (\ref{eq7}.d), \begin{flalign}\label{eq13} R_1>&I(V';Z|U')&\nonumber\\ =&I(V,Q;Z|U,Q)&\nonumber\\ =&I(V;Z|U,Q)&\nonumber\\ =&\sum_q p(q)I(V;Z|U,Q=q)&\nonumber\\ =&p(\alpha)I(V_\alpha;Z^*|U_\alpha)+p(\beta)I(V_\beta;Z^*|U_\beta)&\nonumber\\ =&\gamma I(V^*;Z^*|U^*)+(1-\gamma)I(U^*;Z^*|U^*)&\nonumber\\ =&\gamma I(V^*;Z^*|U^*) \end{flalign} \begin{flalign}\label{eq14} R_2>&I(V';Z|U')&\nonumber\\ =&\gamma I(V^*;Z^*|U^*) \end{flalign} From (\ref{eq7}.b),\\ \begin{flalign}\label{eq15} R_1<&I(U';Y_1)+I(V',V'_1;Y_1|U')-I(V',V'_1;Z|U')&\nonumber\\&+I(V';Z|U')&\nonumber\\ =&I(U,Q;Y_1)+I(V,V_1,Q;Y_1|U,Q)&\nonumber\\&-I(V,V_1,Q;Z|U,Q)+I(V,Q;Z|U,Q)&\nonumber\\ =&I(Q;Y_1)+I(U;Y_1|Q)+I(V,V_1;Y_1|U,Q)&\nonumber\\&-I(V,V_1;Z|U,Q)+I(V;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(U;Y_1|Q=q)+I(V,V_{1};Y_1|U,Q=q)&\nonumber\\&-I(V,V_{1};Z|U,Q=q+I(V;Z|U,Q=q)]+I(Q;Y_1)&\nonumber\\ =&p(\alpha) [I(U_\alpha;Y^*_1)+I(V_\alpha,V_{1\alpha};Y^*_1|U_\alpha)-I(V_\alpha,V_{1\alpha};Z^*|U_\alpha)&\nonumber\\&+I(V_\alpha;Z^*|U_\alpha)]+p(\beta) [I(U_\beta;Y^*_1)+I(V_\beta,V_{1\beta};Y^*_1|U_\beta)&\nonumber\\&-I(V_\beta,V_{1\beta};Z^*|U_\beta)+I(V_\beta;Z^*|U_\beta)]+I(Q;Y_1)&\nonumber\\ =&\gamma [I(U^*;Y^*_1)+I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)&\nonumber\\&+I(V^*;Z^*|U^*)]+(1-\gamma) [I(U^*;Y^*_1)&\nonumber\\&+I(U^*,V^*,V^*_{1};Y^*_1|U^*)-I(U^*,V^*,V^*_{1};Z^*|U^*)&\nonumber\\&+I(U^*;Z^*|U^*)]+I(Q;Y_1)&\nonumber\\ =&\gamma [I(U^*;Y^*_1)+I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)&\nonumber\\&+I(V^*;Z^*|U^*)]+(1-\gamma) [I(U^*;Y^*_1)&\nonumber\\&+I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]+I(Q;Y_1)&\nonumber\\ =&I(U^*;Y^*_1)+I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)&\nonumber\\&+\gamma I(V^*;Z^*|U^*)+I(Q;Y_1)& \end{flalign} From (\ref{eq7}.c),\\ \begin{flalign}\label{eq16} R_1-R_2<&I(V',V'_1;Y_1|U')-I(V',V'_1;Z|U')&\nonumber\\ =&I(V,V_1,Q;Y_1|U,Q)-I(V,V_1,Q;Z|U,Q)&\nonumber\\ =&I(V,V_1;Y_1|U,Q)-I(V,V_1;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(V,V_{1};Y_1|U,Q=q)&\nonumber\\&-I(V,V_{1};Z|U,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_\alpha,V_{1\alpha};Y^*_1|U_\alpha)-I(V_\alpha,V_{1\alpha};Z^*|U_\alpha)]&\nonumber\\&+p(\beta) [I(V_\beta,V_{1\beta};Y^*_1|U_\beta)-I(V_\beta,V_{1\beta};Z^*|U_\beta)]&\nonumber\\ =&\gamma [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\&+(1-\gamma) [I(U^*,V^*,V^*_{1};Y^*_1|U^*)&\nonumber\\&-I(U^*,V^*,V^*_{1};Z^*|U^*)]&\nonumber\\ =&\gamma [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\&+(1-\gamma) [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\ =&I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]& \end{flalign} From (\ref{eq7}.e),\\ \begin{flalign}\label{eq17} R_2<&I(U';Y_2)+I(V',V'_2;Y_2|U')-I(V',V'_2;Z|U')&\nonumber\\&+I(V';Z|U')&\nonumber\\ =&I(U,Q;Y_2)+I(V,V_2,Q;Y_2|U,Q)&\nonumber\\&-I(V,V_2,Q;Z|U,Q)+I(V,Q;Z|U,Q)&\nonumber\\ =&I(Q;Y_2)+I(U;Y_2|Q)+I(V,V_2;Y_2|U,Q)&\nonumber\\&-I(V,V_2;Z|U,Q)+I(V;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(U;Y_2|Q=q)+I(V,V_{2};Y_2|U,Q=q)&\nonumber\\&-I(V,V_{2};Z|U,Q=q)+I(V;Z|U,Q=q)]+I(Q;Y_2)&\nonumber\\ =&p(\alpha) [I(U_\alpha;Y^*_2)+I(V_\alpha,V_{2\alpha};Y^*_2|U_\alpha)&\nonumber\\&-I(V_\alpha,V_{2\alpha};Z^*|U_\alpha)+I(V_\alpha;Z^*|U_\alpha)]&\nonumber\\&+p(\beta) [I(U_\beta;Y^*_2)+I(V_\beta,V_{2\beta};Y^*_2|U_\beta)&\nonumber\\&-I(V_\beta,V_{2\beta};Z^*|U_\beta)+I(V_\beta;Z^*|U_\beta)]+I(Q;Y_2)&\nonumber\\ =&\gamma [I(U^*;Y^*_2)+I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)&\nonumber\\&+I(V^*;Z^*|U^*)]+(1-\gamma) [I(U^*;Y^*_2)+I(U^*;Y^*_2|U^*)&\nonumber\\&-I(U^*;Z^*|U^*)+I(U^*;Z^*|U^*)]+I(Q;Y_2)&\nonumber\\ =&\gamma [I(U^*;Y^*_2)+I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)&\nonumber\\&+I(V^*;Z^*|U^*)]+(1-\gamma) I(U^*;Y^*_2)+I(Q;Y_2)&\nonumber\\ =&I(U^*;Y^*_2)+\gamma [I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)&\nonumber\\&+I(V^*;Z^*|U^*)]+I(Q;Y_2)& \end{flalign} From (\ref{eq7}.f),\\ \begin{flalign}\label{eq18} R_2-R_1<&I(V',V'_2;Y_2|U')-I(V',V'_2;Z|U')&\nonumber\\ =&I(V,V_2,Q;Y_2|U,Q)-I(V,V_2,Q;Z|U,Q)&\nonumber\\ =&I(V,V_2;Y_2|U,Q)-I(V,V_2;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(V,V_{2};Y_2|U,Q=q)&\nonumber\\&-I(V,V_{2};Z|U,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_\alpha,V_{2\alpha};Y^*_2|U_\alpha)-I(V_\alpha,V_{2\alpha};Z^*|U_\alpha)]&\nonumber\\&+p(\beta) [I(V_\beta,V_{2\beta};Y^*_2|U_\beta)-I(V_\beta,V_{2\beta};Z^*|U_\beta)]&\nonumber\\ =&\gamma [I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)]&\nonumber\\&+(1-\gamma)[I(U^*;Y^*_2|U^*)-I(U^*;Z^*|U^*)]&\nonumber\\ =&\gamma [I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)]& \end{flalign} From (\ref{eq7}.g),\\ \begin{flalign}\label{eq19} 0<&I(V'_1;Z|V')+I(V'_2;Z|V')-I(V'_1,V'_2;Z|V')&\nonumber\\&-I(V'_1;V'_2|V')&\nonumber\\ =&I(V_1,Q;Z|V,Q)+I(V_2,Q;Z|V,Q)&\nonumber\\&-I(V_1,V_2,Q;Z|V,Q)-I(V_1,Q;V_2,Q|V,Q)&\nonumber\\ =&I(V_1;Z|V,Q)+I(V_2;Z|V,Q)-I(V_1,V_2;Z|V,Q)&\nonumber\\&-I(V_1;V_2|V,Q)&\nonumber\\ =&\sum_q p(q) [I(V_{1};Z|V,Q=q)+I(V_{2};Z|V,Q=q)&\nonumber\\&-I(V_{1},V_{2};Z|V,Q=q)-I(V_{1};V_{2}|V,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_{1\alpha};Z^*|V_\alpha)+I(V_{2\alpha};Z^*|V_\alpha)-I(V_{1\alpha},V_{2\alpha};Z^*|V_\alpha)&\nonumber\\&-I(V_{1\alpha};V_{2\alpha}|V_\alpha)]+p(\beta) [I(V_{1\beta};Z^*|V_\beta)+I(V_{2\beta};Z^*|V_\beta)&\nonumber\\&-I(V_{1\beta},V_{2\beta};Z^*|V_\beta)-I(V_{1\beta};V_{2\beta}|V_\beta)]&\nonumber\\ =&\gamma [I(V^*_{1};Z^*|V^*)+I(V^*_{2};Z^*|V^*)-I(V^*_{1},V^*_{2};Z^*|V^*)&\nonumber\\&-I(V^*_{1};V^*_{2}|V^*)]+(1-\gamma) [I(V^*,V^*_{1};Z^*|U^*)&\nonumber\\&+I(U^*;Z^*|U^*)-I(V^*,V^*_{1},U^*;Z^*|U^*)&\nonumber\\&-I(V^*,V^*_{1};U^*|U^*)]&\nonumber\\ =&\gamma [I(V^*_{1};Z^*|V^*)+I(V^*_{2};Z^*|V^*)-I(V^*_{1},V^*_{2};Z^*|V^*)&\nonumber\\&-I(V^*_{1};V^*_{2}|V^*)]& \end{flalign} From (\ref{eq7}.h),\\ \begin{flalign}\label{eq20} 0<&I(V',V'_1;Y_1|U')-I(V',V'_1;Z|U')&\nonumber\\ =&I(V,V_1,Q;Y_1|U,Q)-I(V,V_1,Q;Z|U,Q)&\nonumber\\ =&I(V,V_1;Y_1|U,Q)-I(V,V_1;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(V,V_{1};Y_1|U,Q=q)-I(V,V_{1};Z|U,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_\alpha,V_{1\alpha};Y^*_1|U_\alpha)-I(V_\alpha,V_{1\alpha};Z^*|U_\alpha)]&\nonumber\\&+p(\beta) [I(V_\beta,V_{1\beta};Y^*_1|U_\beta)-I(V_\beta,V_{1\beta};Z^*|U_\beta)]&\nonumber\\ =&\gamma [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\&+(1-\gamma) [I(U^*,V^*,V^*_{1};Y^*_1|U^*)-I(U^*,V^*,V^*_{1};Z^*|U^*)]&\nonumber\\ =&\gamma [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\&+(1-\gamma) [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]&\nonumber\\ =&I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]& \end{flalign} \begin{flalign}\label{eq21} 0<&I(V',V'_2;Y_2|U')-I(V',V'_2;Z|U')&\nonumber\\ =&I(V,V_2,Q;Y_2|U,Q)-I(V,V_2,Q;Z|U,Q)&\nonumber\\ =&I(V,V_2;Y_2|U,Q)-I(V,V_2;Z|U,Q)&\nonumber\\ =&\sum_q p(q) [I(V,V_{2};Y_2|U,Q=q)-I(V,V_{2};Z|U,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_\alpha,V_{2\alpha};Y^*_2|U_\alpha)-I(V_\alpha,V_{2\alpha};Z^*|U_\alpha)]&\nonumber\\&+p(\beta) [I(V_\beta,V_{2\beta};Y^*_2|U_\beta)-I(V_\beta,V_{2\beta};Z^*|U_\beta)]&\nonumber\\ =&\gamma [I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)]&\nonumber\\&+(1-\gamma) [I(U^*;Y^*_2|U^*)-I(U^*;Z^*|U^*)]&\nonumber\\ =&\gamma [I(V^*,V^*_{2};Y^*_2|U^*)-I(V^*,V^*_{2};Z^*|U^*)]& \end{flalign} From (\ref{eq7}.i),\\ \begin{flalign}\label{eq22} 0<&I(V'_1;Y_1|V')-I(V'_1;Z|V')&\nonumber\\ =&I(V_1,Q;Y_1|V,Q)-I(V_1,Q;Z|V,Q)&\nonumber\\ =&I(V_1;Y_1|V,Q)-I(V_1;Z|V,Q)&\nonumber\\ =&\sum_q p(q) [I(V_{1};Y_1|V,Q=q)-I(V_{1};Z|V,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_{1\alpha};Y^*_1|V_\alpha)-I(V_{1\alpha};Z^*|V_\alpha)]&\nonumber\\&+p(\beta) [I(V_{1\beta};Y^*_1|V_\beta)-I(V_{1\beta};Z^*|V_\beta)]&\nonumber\\ =&\gamma [I(V^*_{1};Y^*_1|V^*)-I(V^*_{1};Z^*|V^*)]&\nonumber\\&+(1-\gamma) [I(V^*,V^*_{1};Y^*_1|U^*)-I(V^*,V^*_{1};Z^*|U^*)]& \end{flalign} \begin{flalign}\label{eq23} 0<&I(V'_2;Y_2|V')-I(V'_2;Z|V')&\nonumber\\ =&I(V_2,Q;Y_2|V,Q)-I(V_2,Q;Z|V,Q)&\nonumber\\ =&I(V_2;Y_2|V,Q)-I(V_2;Z|V,Q)&\nonumber\\ =&\sum_q p(q) [I(V_{2};Y_2|V,Q=q)-I(V_{2};Z|V,Q=q)]&\nonumber\\ =&p(\alpha) [I(V_{2\alpha};Y^*_2|V_\alpha)-I(V_{2\alpha};Z^*|V_\alpha)]&\nonumber\\&+p(\beta) [I(V_{2\beta};Y^*_2|V_\beta)-I(V_{2\beta};Z^*|V_\beta)]&\nonumber\\ =&\gamma [I(V^*_{2};Y^*_1|V^*)-I(V^*_{2};Z^*|V^*)]&\nonumber\\&+(1-\gamma) [I(U^*;Y^*_1|U^*)-I(U^*;Z^*|U^*)]&\nonumber\\ =&\gamma [I(V^*_{2};Y^*_1|V^*)-I(V^*_{2};Z^*|V^*)]& \end{flalign} For any $p(u^*)p(v^*|u^*)p(v^*_1,v^*_2|v^*)p(x^*|v^*_1,v^*_2) p(y^*_1,y^*_2,z^*|x^*)$ and any $\epsilon>0$, the points $(\varepsilon,\varepsilon)$ and $(I(V^*,V^*_1;Y^*_1|U^*)-I(V^*,V^*_1;Z^*|U^*)-\varepsilon,\varepsilon)$ satisfy the constraints (\ref{eq13})--(\ref{eq23}) for some sufficiently small $\gamma>0$. Likewise, in order to show that the point $(\varepsilon,D-\varepsilon)$ lies in $\mathcal{R}_{0}^{\text{new2}}$, we can present a similar argument by replacing $V_{2\beta}=V_\beta=U_\beta=U^*$ and $V_{1\beta}=(V^*,V^*_1)$ with $V_{1\beta}=V_\beta=U_\beta=U^*$ and $V_{2\beta}=(V^*,V^*_2)$. This proves that $\mathcal{R}_{0}^{\text{new2}}$ also goes arbitrarily close to the $R_2$ axis. Prior to proving condition 3, we note that $\mathcal{R}^{\text{new1}}$ is convex following our argument for condition 1. Recall in Theorem~\ref{theorem7}, we have $\text{co}(\mathcal{R}^{\text{new2}})=\mathcal{R}^{\text{new1}}$. We also proved condition 2 which states that $\mathcal{R}_{0}^{\text{new2}}$ contains all the interior points of $\mathcal{R}^{\text{new1}}$. Referring to Fig.~\ref{fig:8a}, $\mathcal{R}^{\text{new1}}\setminus \mathcal{R}_{0}^{\text{new2}}$ gives us the boundary points of $\mathcal{R}^{\text{new1}}$ along the $R_1$ and $R_2$ axes, i.e., all axes points from $(0,0)$ to $s_2$ as well as from $(0,0)$ to $s_4$. In the proof of Theorem~\ref{theorem7}, we have also shown that $(0,0),s_2\in\mathcal{R}_{2}^{\text{new2}}$. Due to the convexity of $\mathcal{R}_{2}^{\text{new2}}$, the line segment joining $(0,0)$ and $s_2$ falls in ${R}_{2}^{\text{new2}}$. Likewise, the line segment joining $(0,0)$ and $s_4$ falls in $\mathcal{R}_{1}^{\text{new2}}$ due to the same argument. Hence, we obtain condition 3. Upon proving the three conditions, we have $\mathcal{R}^{\text{new2}}=\mathcal{R}_{0}^{\text{new2}}\cup \mathcal{R}_{1}^{\text{new2}}\cup \mathcal{R}_{2}^{\text{new2}}=\mathcal{R}^{\text{new1}}=\text{co}(\mathcal{R}^{\text{new2}})$ after combining Theorem~\ref{theorem6} and Theorem~\ref{theorem7}. \end{IEEEproof} \begin{corollary}\label{corollary 3} cl($\mathcal{R}_{0}^{\text{new2}}$)=cl($\mathcal{R}^{\text{old}}$). \end{corollary} \begin{IEEEproof}[Proof of Corollary~\ref{corollary 3}] Corollary~\ref{corollary 3} follows from the fact that $\mathcal{R}_{0}^{\text{new2}}$ contains all the interior points of $\mathcal{R}^{\text{new1}}$ as stated in condition 2 for the proof of Theorem~\ref{theorem8}. \end{IEEEproof} \section{Discussions and Conclusion} \begin{figure}[t] \centering \includegraphics[width=0.35\textwidth]{Secrecy_Integration} \caption{A secrecy technique integration strategy: Superposition-Marton coding scheme without secrecy (left); superposition-Marton coding scheme with secrecy (right).} \label{fig:9} \end{figure} For the case of the two-receiver discrete memoryless broadcast channel with complementary receiver side information where there is a passive eavesdropper, our proposed scheme simplification shows that the usage of Carleial-Hellman secrecy coding \cite{cref3} for the common satellite codewords achieves the same result as Wyner secrecy coding \cite{cref4}. The usage of Carleial-Hellman secrecy coding \cite{cref3} drops the usage of one-time pad signal for randomness, effectively reducing the number of message splits. The reduction in number of message splits simplifies the rate region computation process as the number of messages grows with the number of receivers in multi-receiver broadcast channels. Not least, no additional random component is needed to ensure individual secrecy of message segments in the common satellite codeword since each of the message segments is capable of fulfilling this requirement. The generation of random variables from a uniform distribution maximizes the difficulty of eavesdroppers in tapping the information. However, perfect uniformity is often difficult to achieve and slight information leakage is still probable \cite{cref10}. Hence, this reduction in the number of random components helps lower the probability of information leakage due to non-uniform distributions and results in a more secured secrecy coding scheme. The proposed simplified coding scheme has a simple construction which allows us to identify an intuitive strategy on applying secrecy techniques to error-correcting coding schemes under individual secrecy constraints. Referring to the left figure in Fig.~\ref{fig:9}, when secrecy is not required, the best achievability scheme for broadcast channels in up-to-date literature would be the superposition-Marton coding scheme. In this scheme, the $V^n$ codeword carries common messages which will be decoded by all receivers. Meanwhile, the remaining $V_1^n$ and $V_2^n$ codewords will only carry private messages intended to be decoded at the respective receivers. Now, when individual secrecy sets in, we notice that secrecy techniques can be integrated into the superposition-Marton coding scheme without changing its structural framework. As shown in the right figure in Fig.~\ref{fig:9}, the private message codewords $V_1^n$ and $V_2^n$ can be secured with Wyner secrecy coding \cite{cref4} through the introduction of random components $D_1$ and $D_2$. Meanwhile, the common message codeword $V^n$ can also be protected from eavesdroppers by implementing Carleial-Hellman secrecy coding \cite{cref3} and have the message segments $M_{1c}$ and $M_{2c}$ act as random components to protect each another. It is also interesting to see that the availability of receiver side information allows us to integrate the one-time pad signal \cite{cref8}, which is a network layer solution, to our physical layer coding scheme. By forming an additional common message codeword $U^n$ which carries the one-time pad signal, we are able to cover extreme cases in which the channel to the eavesdropper is strictly stronger than the channel to the legitimate receiver(s). Lastly, it is important to note that although our discussion revolves around the case of two-receiver broadcast channels, this secrecy technique integration strategy should hold for broadcast channels with more than two receivers if individual secrecy is required and the superposition-Marton coding scheme is still applied. \enlargethispage{-0.8cm} \bibliographystyle{IEEEtran}
\section{Introduction} \label{sec:intro} $N$-body numerical simulations show that the density profile of dark-matter halos in galaxy clusters can be well described by the Navarro--Frenk--White (\citealp{nav97a}; NFW, hereafter) density profile: $\rho_{\rm DM}\propto (r/r_s)^{-1}(1+r/r_s)^{-2}$, where $r$ is the clustercentric distance and $r_s$ is the characteristic or scale radius. We define the mass inside $r_s$ as $M_s$. Recent higher-resolution simulations have shown that the internal structure of dark-matter halos reflects the growth history of the halos \citep{wec02a,zha03a,lud13a,cor15b,mor15b}. They show that in the early ``fast-rate growth'' phase, halos grow rapidly through massive matter accumulation. This growth is often associated with phenomena that erase the previous internal structure of the halos, such as major mergers with other halos. In the subsequent “slow-rate growth” phase, halos gradually grow through moderate matter accretion from their surroundings. There are multiple definitions of the formation time of a halo. One example is the time at which the mass of the main progenitor equals the characteristic mass $M_s$ of the $z=0$ halo \citep{lud13a,cor15b}, and it approximately represents the end of the fast-growth phase and the transitioning toward the slow-growth phase. Only the outskirts of the halos ($r> r_s$) gradually grow in the latter phase \citep{wec02a,zha03a,lud13a,cor15b,mor15b}. Thus, dark-matter halos are assembled from the inside out, and the results of the numerical simulations can be interpreted such that the characteristic radius $r_s$ and the mass $M_s$ preserve a memory of the formation time of the halo \citep{wec02a,zha03a,lud13a,cor15b}. In this ``inside-out'' scenario of halo formation, halos take a range of characteristic densities ($\rho_s\equiv 3 M_s/(4\pi r_s^3)$); older halos tend to be more concentrated and have larger characteristic densities, which reflects the higher average density of the universe in the past \citep{nav97a,wec02a,zha03a,lud13a,cor15b,mor15b}. This scenario is in contrast with the classical approach in which halos are continuously modified, even by minor mergers, and constantly changing their profiles so that dark-matter halos lose the memory of their epoch of formation \citep{gun72a,1974ApJ...187..425P}. If the inside-out halo growth scenario is correct, then we would expect that the formation time not only reflects the structural parameters ($r_s$ and $M_s$) in the form of the characteristic density ($\rho_s$), but also influences the properties of the X-ray intracluster gas. However, its quantitative dependence is not obvious because the gas is collisional matter in contrast with dark matter. The hot gas is expected to be heated mostly via merger shocks produced when smaller halos fall into the halo \citep{ras11a,kra12a}. However, it is difficult to directly observe the heating process, as the shocks are often located at the outskirts of clusters \citep{2000ApJ...542..608M,ryu03a}, where the gas emission is very faint. We here investigate correlations between the halo parameters ($r_s, M_s$) and the average X-ray gas temperature $T_X$ because the temperature is supposedly sensitive to the depth of the potential well and the past heating process \citep{1998ApJ...503..569E}. Since the emissivity of the X-ray gas is proportional to the gas density squared, the average measured temperature of a cluster mainly reflects the temperature in the region ($r\lesssim r_s$), where the density is high. While there were previous studies that attempted to investigate correlations among a certain combination of three cluster structural parameters \citep{sch93a,ada98a,fuj99c,lan04b,2006ApJ...640..673O}, they adopted parameters such as the galaxy luminosities that are not directly related to the structure of halos. In the paper, we assume a spatially flat $\Lambda$CDM cosmology with $\Omega_\mathrm{m}=0.27$, $\Omega_\Lambda=0.73$, and the Hubble constant of $H_0=70$\,km\,s$^{-1}$\,Mpc$^{-1}$ throughout this paper. \section{Observational Data} We study the Cluster Lensing And Supernova survey with Hubble (CLASH) observational dataset that includes 20 massive clusters, most of which are apparently relaxed, X-ray regular systems\footnote{Among the 20 clusters, 16 of them are X-ray selected and the rest are the CLASH high-magnification clusters that may not be relaxed systems.} \citep{pos12a,men14a}. The range of redshifts is 0.187--0.686, and their median redshift is 0.377 \citep{ume16a}. Lensing constraints on the NFW characteristic radius $r_s$ and $M_s$ were obtained from a joint analysis of strong-lensing, weak-lensing shear and magnification data of background galaxies \citep{ume16a}. Their analysis is based on 16-band Hubble Space Telescope observations \citep{2015ApJ...801...44Z} and wide-field multi-color imaging taken primarily with Suprime-Cam on the Subaru Telescope \citep{2014ApJ...795..163U}. The core-excised X-ray temperatures of the clusters were taken from \citet{pos12a}, in which the temperatures are measured for the region of 50--500 kpc from the cluster centers excluding the cool core at the center of the clusters. We chose the outer radius considering the field of view of the {\it Chandra} satellite and the completeness of the data. Since most of the X-ray emissions come from $<500$~kpc, the increase of the radius does not affect the results. The cluster data are shown in Table~\ref{tab:data}. \begin{figure*} \plottwo{./f1a.eps}{./f1b.eps} \epsscale{.50}\plotone{./f1c.eps} \caption{(a) Points (pin heads) show the distribution of the observed clusters in the space of $(\log (r_s/r_{s0}), \log (M_s/M_{s0}), \log (T_{\rm X}/T_{\rm X0}))$, where $r_{s0}=570$~kpc, $M_{s0}=3.8\times 10^{14}\: M_\odot$, and $T_{\rm X0}=8.2$~keV are the sample geometric averages (log means) of $r_s$, $M_s$, and $T_{\rm X}$, respectively. The length of a pin shows the distance between the point and the obtained plane. The orange plane is translucent and grayish points are located below the plane. The arrow $P_1$ shows the direction on the plane in which the data are most extended, and the arrow $P_2$ is perpendicular to $P_1$ on the plane. Red bars at the corner of the $\log r_s$--$\log M_s$ plane and on the $\log T_{\rm X}$ axis are typical $1\sigma$ errors of the data. (b) The cross-section of the plane in (a). The origin is the same as (a) and $P_3$ is the plane normal. Large black points are the observations shown in (a). Small red points are the MUSIC simulated clusters projected on the $P_1$--$P_3$ plane determined for the observed clusters. (c) Same as (a) but error bars for individual clusters are included. The viewing angle is changed so that the relation between the error bars and the plane is easily seen. \label{fig:plane}} \end{figure*} \section{Fundamental Plane Analysis for the CLASH Sample} In Figure~\ref{fig:plane}(a), we show the distribution of clusters in the $(\log r_s, \log M_s, \log T_{\rm X})$ space. We see that the data points are closely distributed on a plane that we have determined using a principal component analysis (PCA) to minimize deviations of the data points from the plane (see the \ref{sec:append}ppendix). The arrow $P_1$ shows the direction on the plane in which the data are most extended, and the arrow $P_2$ is perpendicular to $P_1$ on the plane. The plane normal is represented by $P_3$. The dispersion around the plane or the thickness of the plane is shown in Figure~\ref{fig:plane}(b) and it is only $0.045^{+0.008}_{-0.007}$ dex (all uncertainties are quoted at the $1\:\sigma$ confidence level unless otherwise mentioned). The thickness is comparable to that of the well-known fundamental plane for elliptical galaxies in the space of the surface brightness, the effective radius, and the velocity dispersion ($\sim 0.06$~dex; e.g., \citealp{lab08a,hyd09a}). In Figure~\ref{fig:plane}(c), we show error bars for individual clusters. In the vertical direction ($T_{\rm X}$), we show the temperature errors in Table~\ref{tab:data}. In the horizontal direction, however, the errors of $r_s$ and $M_s$ are highly correlated, and we display them as a single bar. That is, for each cluster, we draw a bar connecting ($r_s^u$, $M_s^u$) and ($r_s^l$, $M_s^l$), where the superscripts $u$ and $l$ are the upper and the lower limits shown in Table~\ref{tab:data}, respectively. Note that we have properly accounted for the correlation for each cluster using the joint posterior probability distribution of the NFW parameters (mass and concentration) when we calculate the plane parameters (see the \ref{sec:append}ppendix). Thus, the actual error is not represented by a single bar in a precise sense. The tight planar distribution in Figure~\ref{fig:plane} indicates that the structure of the dark-matter halos ($r_s$ and $M_s$) did make a direct influence on the properties of the intracluster gas ($T_{\rm X}$). In the context of the inside-out halo growth scenario, the most natural interpretation of our findings is that the intracluster gas was heated up to around $T_{\rm X}$ in the fast-rate growth phase when the shape of the potential well ($r_s$ and $M_s$) was established, and that the gas preserves the memory of the cluster formation as is the case of the dark-matter halo structure. The plane is described by $a\log r_s + b\log M_s + c\log T_{\rm X}=\mathrm{const.}$, with $a=0.76^{+0.03}_{-0.05}$, $b=-0.56^{+0.02}_{-0.02}$, and $c=0.32^{+0.10}_{-0.09}$. Likelihood contours of the parameters describing the direction of the plane normal, $P_3=(a,b,c)$, are shown in Figure~\ref{fig:prob}. The estimation of the errors is described in the \ref{sec:append}ppendix. If the intracluster gas at $r\lesssim r_s$ simply preserves its pressure equilibrium state at the cluster formation, the gas temperature should reflect the potential depth of the dark-matter halo at the formation. Thus, one may expect that the gas temperature follows the virial theorem in a narrow sense (``virial expectation'') at that time, $T_{\rm X} \propto M_s/r_s$, which is one of the main assumptions for the self-similar scaling relations of clusters. The resulting plane, however, is significantly tilted from this virial expectation (Figure~\ref{fig:prob}) and is represented by $T_{\rm X}\propto M_s^{-b/c} r_s^{-a/c}\propto M_s^{1.8\pm 0.5}/r_s^{2.3\pm 0.7}$. Our findings show that the temperature $T_{\rm X}$ is more sensitive to the depth of the gravitational potential represented by $M_s/r_s$ than the canonical virial expectation because $T_{\rm X}\propto M_s^{-0.2}r_s^{-0.3}(M_s/r_s)^{2.0}$. In other words, clusters with a deeper potential well tend to have higher temperatures $T_{\rm X}$ than the virial expectation, or visa versa. \begin{figure} \plotone{./f2.eps} \caption{Direction of the plane normal $P_3=(a,b,c)$ in the space of $(\log r_s, \log M_s, \log T_{\rm X})$; $\theta$ is the angle between $P_3$ and the $\log T_{\rm X}$ axis, and $\phi$ is the azimuthal angle around the $\log T_{\rm X}$ axis, measured anti-clockwise from the $\log r_s$ axis, or $\tan\phi=b/a$. Probability contours are shown for the observed clusters at the 68 ($1\:\sigma$), 90, and 99\% confidence levels from inside to outside. The contours are elongated in the direction of rotation around $P_1$ (Figure~\ref{fig:plane}), to which the direction $P_3$ is less constrained. The prediction of the virial expectation ($r_s M_s^{-1} T_{\rm X} \propto \rm const$) corresponds to $(\phi, \theta) = (-45^\circ,55^\circ)$ (black dot), and is rejected at the $>99$\% confidence level. Note that for the virial expectation the angle $\theta$ is the one between vectors $(1/\sqrt{3},-1/\sqrt{3},1/\sqrt{3})$ and $(0,0,1)$, which is $\approx 55^\circ$. The plane normals derived for simulation samples MUSIC, NF0, FB0, and FB1 are shown by the open red circle, the open purple square, the filled blue square, and the filled green triangle, respectively. All the simulated angles are located inside the 90\% contour level and are consistent with the observations at that level. A prediction based on a similarity solution is shown by the orange star (SSol).\label{fig:prob}} \end{figure} \begin{figure*} \plottwo{./f3a.eps}{./f3b.eps} \caption{Same as Figures~\ref{fig:plane}(a) and (b) but for the MUSIC clusters. The axes are normalized by the average parameters of the sample ($r_{s0}=414$~kpc, $M_{s0}=1.4\times 10^{14}\: M_\odot$, and $T_{\rm X0}=3.7$~keV). The plane and the directions $P_1$, $P_2$, and $P_3$ are determined for the MUSIC sample (Table~\ref{tab:vec}).\label{fig:planemusic}} \end{figure*} \section{Comparison with Numerical Simulations} Our CLASH sample includes only 20 clusters, and our results may be affected by observational biases. Here, we examine the results of numerical simulations to properly interpret the observations in the context of the CDM cosmology and discuss possible selection bias. First, we analyzed the outputs of MUSIC $N$-body/hydrodynamical simulations \citep{men14a}. These are adiabatic; that is, they do not include any nongravitational effects such as feedback from active galactic nuclei (AGNs) or from supernovae (SNe), and there is no radiative cooling. The details of the simulations for the MUSIC sample are given in \citet{men14a}. The MUSIC sample is obtained by resimulating halos selected from the MultiDark cosmological simulation \citep{2012MNRAS.423.3018P} in order to achieve a higher resolution. The parallel TREEPM+SPH GADGET code \citep{2005MNRAS.364.1105S} is used for the resimulations. The mass resolution for the dark-matter particles is $m_{\rm DM}=9.01\times 10^8\: h^{-1}\: M_\odot$ and that for the gas particles is $m_{\rm SPH}=1.9\times 10^8\: h^{-1}\: M_\odot$, where the Hubble constant is written as $H_0=100\: h$\,km\,s$^{-1}$\,Mpc$^{-1}$ and $h=0.7$. The gravitational softening is $6\: h^{-1}$~kpc for the both gas and dark-matter particles in the high-resolution regions. We select all of the 402 clusters at $z=0.25$ with $M_{200}>2\times 10^{14}\: h^{-1}\: M_\odot$ regardless of dynamical state, where $M_{200}$ is the mass enclosed within a sphere of radius ($r_{200}$) within which the mean overdensity equals 200 times the critical density of the universe. We compute the mass-weighted temperature including the core. The mass-weighted formulation is the most appropriate to evaluate the thermal energy of the X-ray gas to be included in the virial theorem. In addition, we kept the core because these simulations are nonradiative and thus do not present cool-core features. The scale radius $r_s$ is obtained by fitting the total density distribution (gas+dark matter) with the NFW profile up to $r_{200}$. The mass $M_s$ is then derived as the mass enclosed by a sphere of radius $r_s$. We see that 402 simulated MUSIC clusters at the redshift of $z=0.25$ form a plane in the $(\log r_s, \log M_s, \log T_{\rm X})$ space (Figure~\ref{fig:planemusic}). In Figure~\ref{fig:plane}(b), we project the simulated clusters on the cross-section of the observed plane, showing that the two sets of data are distributed around the same plane ($P_3=0$), although the band-like distribution of the MUSIC data is slightly tilted (see Figure~\ref{fig:prob}) while passing through the origin. Many of them are found at smaller $P_1$, because the average radius and mass of the MUSIC clusters are smaller than those of the observed clusters by a factor of a few. The plane angle is consistent with the observed one (90\% confidence level) and deviates from the virial expectation (Figure~\ref{fig:prob}). The dispersion around the plane for the simulated clusters is $0.025$ dex and is even smaller than the observed one ($0.045^{+0.008}_{-0.007}$ dex; Table~\ref{tab:disp}). Since unrelaxed clusters tend to have disturbed internal structure, they are expected to increase the dispersion. However, even when we choose the 20\% most unrelaxed (UR) clusters in the sample, it is only 0.033. Therefore, the slightly larger observed thickness of the plane is unlikely ascribable to the dynamical state of the systems. The direction of the plane for the UR clusters is also not much different from that of the full sample (Table~\ref{tab:vec}). Although our CLASH clusters are relatively massive and relaxed, these results of the numerical simulations show that the selection bias should not significantly affect the derived plane parameters. To study the evolution in detail, we analyzed another set of simulation data \citep{ras15a}. Each of the samples named FB0 and NF0 consists of 29 massive clusters at $z=0$, and contain both relaxed and unrelaxed ones. FB0 includes nongravitational effects and NF0 does not. The details of the simulations for samples FB0, FB1, and NB0 are given in \citet{ras15a} and \citet{2017MNRAS.467.3827P}. They are also carried out with the GADGET code \citep{2005MNRAS.364.1105S} but including an updated SPH scheme \citep{2016MNRAS.455.2110B}. The simulations consist in 29 Lagrangian regions around massive clusters with $M_{\rm 200}\sim 1$--$30\times 10^{14}\: h^{-1}\: M_\odot$ at $z=0$. The simulations FB0 and FB1 include phenomena such as heating by AGNs and SNe in addition to radiative cooling, while NF0 is from nonradiative runs. Samples FB0 and NF0 consist of the clusters at $z=0$, while sample FB1 refers to the runs at $z=1$. The mass resolution for the dark-matter particles is $m_{\rm DM}=8.3\times 10^8\: h^{-1}\: M_\odot$ and that for the initial gas particles is $m_{\rm SPH}=1.5\times 10^8\: h^{-1}\: M_\odot$. The gravitational softening is $3.75\: h^{-1}$~kpc for both the gas and dark-matter particles in the high-resolution regions \citep{2017MNRAS.468..531B}. We derive $r_s$ and $M_s$ for the clusters in the FB0, FB1, and NB0 samples using the same method exploited for the MUSIC simulations. Since this sample, contrary to the previous sample, is built on radiative simulations we do exclude the core. As we did for the observed CLASH sample, the temperatures are obtained in the region between 50 and 500 kpc from the cluster centers. Although we use the mass-weighted temperature in the following discussion, we have confirmed that the results such as the plane angle and thickness are not significantly affected by the choice of the temperature weighting (e.g. spectroscopic-like temperature; \citealt{maz04a}) or the choice of the metric radius for temperature measurements ($> 500$~kpc). We find that each sample forms a plane whose angle is consistent with the observed one (Figure~\ref{fig:prob}). The plane angles for FB0 and NF0 are almost the same, which means that the result is independent of the gas physics. The lack of dependence means that radiative cooling and SNe and AGN feedback counterbalance one another with the effect of not drastically changing the X-ray gas profile on a scale of $r_s$. Thus, even if our CLASH clusters are affected by some selection bias originating from gas physics (e.g. difference of AGN activities), the bias does not have a significant impact on the plane parameters. The thickness of the plane is, however, increased by the nongravitational effects. In fact, the dispersion around the plane for FB0 is $0.031$ dex, which is larger than that for NF0 ($0.023$ dex), but is still smaller than the observed one even if the observational errors are considered (Table~\ref{tab:disp}). In Figure~\ref{fig:prob}, we also show the plane angle for clusters in the same simulation as FB0 but at $z=1$ (sample FB1). Most of the clusters (25/29) are the progenitors of those in FB0. While more clusters should be in the fast-rate growth phase at $z=1$, the plane angle is not much different from that at $z=0$ (FB0). We find that the clusters in the samples FB0 and FB1 are virtually on the same plane (Figure~\ref{fig:sim}); though, FB1 clusters tend to have smaller physical radii and masses. This indicates that the redshifts of the clusters are unlikely to impact the plane parameters. The dispersion around the common plane is $0.037$ dex (FB0+FB1 in Table~\ref{tab:disp}). This indicates that the clusters evolve on this unique plane along the direction of $P_1$, and that the evolution of cluster halo structure and the thermodynamic history of intracluster gas are strictly regulated by the plane. In general, current numerical simulations are realistically reproducing the observed scaling relations including their slopes \citep{tru18a}. Any possible small discrepancy of the normalizations does not significantly affect the plane angle and the cluster evolution along the plane. \begin{figure*} \plottwo{./f4a.eps}{./f4b.eps} \caption{Same as Figures~\ref{fig:plane}(a) and (b) but for the simulated clusters. Large blue and small green points show the simulation samples FB0 ($z=0$) and FB1 ($z=1$), respectively. The axes are normalized by the average parameters of the combined sample (FB0+FB1; $r_{s0}=388$~kpc, $M_{s0}=1.4\times 10^{14}\: M_\odot$, and $T_{\rm X0}=4.8$~keV). The plane and the directions $P_1$, $P_2$, and $P_3$ are determined for the combined sample (Table~\ref{tab:vec}).\label{fig:sim}} \end{figure*} \begin{figure*} \epsscale{.40}\plotone{./f5a.eps}\\ \epsscale{.80} \plottwo{./f5b.eps}{./f5c.eps} \caption{(a) Projection of the MUSIC data points in Figure~\ref{fig:planemusic}(a) on the $\log r_s$--$\log M_s$ plane. The normalizations of the axes are the same as those in Figure~\ref{fig:planemusic}. Each dashed line satisfies $\rho_s=\rm const$ and the value of the constant increases in the direction of the thin dotted arrow. The thick solid arrow represents a line $r_s\propto M_s^{1/2}$, and the value $M_s r_s^{1/2}$ increases in the direction. (b) $T_{\rm X}$ is plotted against $M_s r_s^{1/2}$. (c) $T_{\rm X}$ is plotted against $\rho_s$. Evolution of a typical cluster belonging to FB0+FB1 is shown in the solid line. Prominent features are marked by the labels A, B, ..., F. The cluster and the labels are the same as those in Figure~\ref{fig:evol}. The green arrow shows the projected direction of $P_1$ for the MUSIC data. \label{fig:musicrel}} \end{figure*} \begin{figure*} \plottwo{./f6a.eps}{./f6b.eps} \caption{(a) Evolution of $r_s$ (black solid), $M_s$ (red dotted), and $T_{\rm X}$ (blue dashed) of a typical cluster in the sample FB0+FB1. The time $t$ is the cosmological one. Prominent features are marked by the labels A, B, ..., F. The area of the filled circles at the bottom is proportional to the reduced $\chi^2$ of the fit to the NFW profile. (b) Evolution of the cluster in the plane coordinate that is the same as that in Figure~\ref{fig:sim}. The labels A, B, ..., F correspond to those in (a). Note that scales of the axes $P_1$, $P_2$, and $P_3$ are different.\label{fig:evol}} \end{figure*} \section{Discussion} \subsection{The plane angle predicted by a similarity solution and cluster evolution} \label{sec:SSol} In this subsection, we attempt to explain the origin of the peculiar plane angle we found using an analytic solution. \citet{ber85a} constructed a one-dimensional similarity solution for secondary infall and accretion onto an initially overdense perturbation in an Einstein-de Sitter ($\Omega_0=1$) universe. For this solution, an object continues to grow, and the matter density $\rho$, pressure $p$ at the radius $r$, and mass $m$ inside $r$ at the cosmological time $t$ can be expressed by nondimensional functions ($D$, $P$, and $M$): \begin{eqnarray} \label{eq:nond} \rho(r,t) &=& \rho_{\rm H} D(\lambda)\:,\nonumber \\ p(r,t) &=& \rho_{\rm H}(r_{\rm ta}/t)^2 P(\lambda)\:, \\ m(r,t) &=& (4\pi/3)\rho_{\rm H} r_{\rm ta}^3 M(\lambda)\:,\nonumber \end{eqnarray} where $r_{\rm ta}(t)$ is the maximum radius that a mass shell reaches (the turnaround radius), $\rho_{\rm H}\propto t^{-2}$ is the density of the background universe, and $\lambda=r/r_{\rm ta}$ is the nondimensional radius. The turnaround radius is represented by $r_{\rm ta}=A_{\rm ita}t^{8/9}$, where $A_{\rm ita}$ is the coefficient that depends on the overdense perturbation \citep{ber85a}. The solution has an entropy integral, \begin{equation} \label{eq:enti} P(\lambda) D(\lambda)^{-\gamma} M(\lambda)^{10/3-3\gamma} = {\rm const}\:, \end{equation} where $\gamma=5/3$ is the adiabatic index. This relation holds even for a system with a mixture of gas and dark matter \citep{ber85a}. From equations~(\ref{eq:nond}) and~(\ref{eq:enti}), we have $p\rho^{-5/3}m^{-5/3}\propto A_{\rm ita}^{-3}$, which does not depend on $t$. The coefficient can be written as $A_{\rm ita}=r_{\rm ita}/t_{\rm ita}^{8/9}$, where $r_{\rm ita}$ and $t_{\rm ita}$ are the turnaround radius and time of the overdense perturbation, respectively. Note that $t_{\rm ita}$ is much earlier than ``the formation of a cluster'' discussed in this study. Assuming that the evolution of the overdense perturbation follows a theory of a spherical collapse, they are represented by \begin{equation} \label{eq:ita} r_{\rm ita}\propto m_{\rm ita}^{(n+5)/6},\hspace{15mm} t_{\rm ita}\propto m_{\rm ita}^{(n+3)/4}\:, \end{equation} where $m_{\rm ita}$ is the mass scale of the perturbation and $n$ is the local slope of the primordial matter power spectrum\footnote{Note that the relations are applied to the overdense perturbation and not to the whole cluster.} \citep{kai86a,pee93}, which is $n\sim -2$ at cluster scales \citep{eis98a,die15a}. Thus, we obtain $p\rho^{-5/3}m^{-5/3}\propto m_{\rm ita}^{-5/6}$. Assuming that $p\propto \rho T_{\rm X}$ and $\rho\propto M_s/r_s^3$ at $r\sim r_s$, the relation is $r_s^2 M_s^{-7/3}T_{\rm X}\propto m_{\rm ita}^{-5/6}$. Here, we speculate that the structure of the NFW profile at $r\lesssim r_s$ reflects the overdense perturbation that initially collapsed in the similarity solution by \citet{ber85a}. In other words, the fast-rate growth of a dark-matter halo is related to the initial collapse. In fact, \citet{cor15b} demonstrated that the characteristic density $\rho_s$ of the NFW profile is proportional to the critical density of the background universe $\rho_c$ at the time when the dark-matter halo transits from the fast-rate to the slow-rate growth phase (i.e. the halo formation time). On the other hand, since the initial collapse can be described as a simple spherical collapse of an overdense region, the typical density of the collapsed object is also proportional to $\rho_c$ at the collapse time \citep{ber85a}. This indicates that both the inner structure of the NFW profile and the overdense perturbation in the similarity solution follow the same evolution and scaling relation. Thus, we assume $M_s\propto m_{\rm ita}$ and $r_s \propto r_{\rm ita}$, which leads to \begin{equation} \label{eq:enti2} r_s^2 M_s^{-3/2}T_{\rm X}={\rm const}\:. \end{equation} The angle of this plane is shown in Figure~\ref{fig:prob} (SSol) and it is consistent with the observations. The essential point of the similarity solution is that clusters are not isolated but continuously growing through matter accretion from their outer environments. Therefore, additional contributions, such as the flux of inertia at the cluster surface, should be included in the virial theorem for the complete description of the dynamical state \citep{ber85a}. In the $\Lambda$CDM model \citep{pee93}, the cosmological constant becomes non-negligible at $z\lesssim ((1-\Omega_m)/\Omega_m)^{1/3}-1\sim 0.39$, which is close to the median redshift of our observational sample (Table~\ref{tab:disp}). Thus, about half of the sample may be affected by the cosmological constant. However, although the density profiles of these objects may become steeper in the outskirts \citep{ber85a}, the effect is not serious because we are interested in the inner region ($r\lesssim r_s$). This simple model may also explain the vector $P_1$. Since we assumed $r_s \propto r_{\rm ita}$ and $M_s \propto m_{\rm ita}$, we obtain $r_s \propto M_s^{1/2}$ from equation~(\ref{eq:ita}). The direction of the line $r_s \propto M_s^{1/2}$ on the $\log r_s$--$\log M_s$ plane is almost the same as that of $P_1$ projected on the $\log r_s$--$\log M_s$ plane, especially for $P_1$ for the simulation samples (Table~\ref{tab:vec}). Figure~\ref{fig:musicrel}(a) shows that the MUSIC data points are actually distributed along the line $r_s \propto M_s^{1/2}$ (thick solid arrow) on the $\log r_s$--$\log M_s$ plane. This means that the cluster's elongated distributions along $P_1$ (Figures~\ref{fig:planemusic} and~\ref{fig:sim}) reflect the evolution of the typical overdense perturbation along $r_{\rm ita} \propto m_{\rm ita}^{1/2}$, which can also be interpreted as the evolution of clusters during the fast-rate growth phase. The direction of $P_1$ for the observational sample (first line of Table~\ref{tab:vec}) is slightly different from those for the simulations. This may be because the observational sample is biased toward high temperature clusters. Cluster formation time is associated with the characteristic density \citep[e.g.][]{fuj99d,lud13a,cor15b}. The dashed lines in Figure~\ref{fig:musicrel}(a) are isochrones or $\rho_s = \rm const$. The MUSIC data points are widely distributed along each isochrone, which reflects a variety of cluster masses for a given formation time. In other words, it reflects a variety of peak densities of initial density fluctuations of the universe. Individual clusters evolve approximately in the direction of $P_1$ (Figures~\ref{fig:planemusic} and~\ref{fig:sim}), or in the direction to which $M_s r_s^{1/2}$ increases (Figure~\ref{fig:musicrel}(a)), that is, along the line $r_s \propto M_s^{1/2}$ ($r_s \propto M_s^{1/1.65}$ in a detailed study; \citealt{zha09a}). Figure~\ref{fig:musicrel}(b) shows that $M_s r_s^{1/2}$ and $T_{\rm X}$ are correlated, which reflects that $T_{\rm X}$ evolves according to the structure evolution of dark halos, although the projection of the band-like distribution of clusters in Figure~\ref{fig:planemusic}(a) onto the $M_s r_s^{1/2}$--$T_{\rm X}$ plane disperses the relation. In Figure~\ref{fig:musicrel}(a), clusters become denser (having larger $\rho_s$) or older in the direction of the thin dotted arrow. In Figure~\ref{fig:musicrel}(c), the correlation between $\rho_s$ and $T_{\rm X}$ is not clear, because a possible correlation is obscured by the projection of clusters with various masses along the dashed lines in Figure~\ref{fig:musicrel}(a) (see also Figure~\ref{fig:planemusic}(a)). However, each cluster moves mainly along the direction of $P_1$, which shows that the cluster temperature increases as the density $\rho_s$ decreases, although major mergers (A, B, and E in Figure~\ref{fig:musicrel}(c)) derail the cluster significantly from the evolution along $P_1$. We emphasize that the MUSIC data distribution on the plane does not follow a single line but has a finite spread, and $M_s$ has a distribution for a given formation time. In general, the correlation between some two parameters of clusters is not necessarily represented by a line but is often represented by a broad band (Figure~\ref{fig:musicrel}). This is because the mass scale of the initial density fluctuation of the universe has a distribution for a given peak height \citep[e.g.][]{bar01a}. Since the peak height also has its own distribution, these result in a two-dimensional band-like distribution of clusters. In general, clusters move along the band on the plane in the direction of $P_1$ (see also the next subsection). \begin{figure*} \plottwo{./f7a.eps}{./f7b.eps} \caption{Same as Figures~\ref{fig:plane}(a) and (b), but in the space of $(\log (r_{200}/r_{200,0}), \log (M_{200}/M_{200,0}), \log (T_{\rm X}/T_{\rm X0}))$, where $r_{200,0}=2040$~kpc, $M_{200,0}=1.4\times 10^{15}\: M_\odot$, and $T_{\rm X0}=8.2$~keV are the sample averages of $r_{200}$, $M_{200}$, and $T_{\rm X}$, respectively.\label{fig:plane200}} \end{figure*} \subsection{Stability of the plane against mergers} The similarity of clusters is generally good because most of them are well represented by the NFW profile. The thinness of the plane reflects the excellent similarity because cluster structure is well described by the similarity solution discussed in Section~\ref{sec:SSol}. However, clusters occasionally experience mergers that might break the similarity. In Figure~\ref{fig:evol}(a), we follow the evolution of a cluster that undergoes three major mergers in the sample FB0+FB1. This cluster experiences mergers around the times indicated by A, B, and E. While $M_s$ tends to correlate with $r_s$, the temperature $T_{\rm X}$ tends to inversely correlate with $r_s$. This can be explained as follows. When a large substructure is merging with a cluster, it does not dissolve immediately when it touches the viral radius of the cluster. The 3D cluster gas density profiles will, therefore, include the gas of the substructure as it moves within the cluster external atmosphere toward the inner regions. Very large substructures can even reach the center and cross it. This is the main origin of changing $r_s$ and $M_s$: when the substructure is in the outskirts, the profile is flatter and thus $r_s$ and $M_s$ are larger (less concentrated cluster), while when the substructure is closer to the center, the object appears more concentrated, i.e. with smaller $r_s$ and $M_s$. On the other hand, $T_{\rm X}$ increases for a moment, after the shock has time to propagate throughout a large region of the cluster. Thanks to the behavior of the three parameters $r_s$, $M_s$, and $T_{\rm X}$, the cluster does not substantially deviate from the plane ($P_3=0$) even during a merger (Figure~\ref{fig:evol}(b)), which contributes to the thinness of the plane. Figure~\ref{fig:evol} also shows that after the end of the last major merger indicated by the letter F, the three parameters do not change much and the cluster remains in almost the same position on the plane. This indicates that the current cluster structure is determined at the last major merger. \subsection{Cluster distribution in the space of $(\log r_{200}, \log M_{200}, \log T_{\rm X})$.} \label{sec:200} Contrary to the inside-out scenario, dark-matter halos possess only a common global density that is related to the virial overdensity in the classical picture of cluster formation \citep{gun72a,1974ApJ...187..425P,lac93a}. A representative density is $\rho_{200}$, which is 200 times the critical density of the universe at the cluster redshift. Individual halos can thus be characterized by $M_{200}$, the mass enclosed within a sphere of radius $r_{200}$ within which the mean overdensity equals $\rho_{200}$. The mass $M_{200}$ is often regarded as the total mass of a cluster. The values of $r_{200}$ and $M_{200}$ for our observed clusters are shown in Table~\ref{tab:data}. As an alternative parameter combination, we check the cluster distribution in the space of $(\log r_{200}, \log M_{200}$, $ \log T_{\rm X})$. In Figure~\ref{fig:plane200}(a), the data points are distributed on a plane almost vertical to the $\log r_{200}$--$\log M_{200}$ plane, which reflects the obvious relation of $M_{200}=4\pi \rho_{200} r_{200}^3/3 \propto r_{200}^3$ regardless of $T_{\rm X}$. The redshift dependence of $\rho_{200}$ is small because the majority of the clusters in our sample are distributed in a relatively narrow range at low-intermediate redshifts, although the small redshift dependence slightly slants the the plane. The dispersion in the direction of the plane normal ($P_3$) is small (Figure~\ref{fig:plane200}(b); $0.016^{+0.001}_{-0.001}$ dex). A weak correlation ($P_1$), in which clusters with a larger $M_{200}$ tend to have a larger $T_{\rm X}$, is seen on the plane, but the dispersion ($P_2$) is relatively large (Figure~\ref{fig:plane200}(a); $0.099^{+0.011}_{-0.011}$ dex). Although this correlation $P_1$ has been studied as a mass--temperature relation \citep[e.g.][]{sun09a,2014ApJ...794...48C}, the large dispersion suggests that it is not a primary relation, and that the combination of parameters ($r_s, M_s, T_{\rm X}$) rather than $(r_{200}, M_{200}, T_{\rm X})$ is appropriate for studying the connection between the X-ray gas and the dark halo structure and the interplay between gas heating and gravitational collapse in detail. The well-known large scatter of the concentration ($c_{200}\equiv r_{200}/r_s$)--mass ($M_{200}$) relation \citep[e.g.][]{2001MNRAS.321..559B} may be because $r_s$ has less to do with $r_{200}$ and $M_{200}$. \section{Conclusions} In this study, we showed that observational data of high-mass galaxy clusters form a plane in the three-dimensional logarithmic space of their characteristic radius $r_s$, mass $M_s$, and X-ray temperature $T_{\rm X}$ with a very small orthogonal scatter. Since the evolution history of a cluster is encoded in $r_s$ and $M_s$, the tight correlation suggests that the gas temperature was determined at a specific cluster formation time. We also found that the plane is tilted with respect to $T_{\rm X} \propto M_s/r_s$, which is the plane expected in the case of simplified virial equilibrium. This strange plane angle can be explained by a similarity solution, which indicates that clusters are not isolated but continuously growing through matter accretion from their outer environments. In other words, the effects of the growth must be considered when the internal structure of clusters is discussed. We have shown that numerical simulations reproduce the observed plane and its angle, regardless of the gas physics implemented in the code. The simulations show that clusters evolve along the plane and they do not deviate much from the plane even during major mergers, which contributes to the overall thinness of the plane. Further work is needed to understand the relation between the similarity solution and the formation of the NFW halo structure \citep{1998ApJ...499..542S,2004ApJ...604...18W}. Large-scale high-resolution numerical simulations from high to low redshifts would be useful to study these topics. It would also be interesting to extend the observational sample to objects other than massive clusters in the nearby universe. Those objects include clusters at higher redshifts and less massive systems, such as galaxy groups and elliptical galaxies that present a break from the cluster self-similarity behavior \citep{pon99a}. It would also be interesting to study relationships between the cluster plane and galactic-scale ones (e.g. \citealt{gou16a}). Galaxy clusters have been used to constrain cosmological parameters, such as the amount of matter and dark energy, and to investigate the growth of large-scale structure. In particular, the evolution of the abundance of rare massive clusters above a given mass threshold is highly sensitive to the expansion history and the growth rate of mass density fluctuations \citep[e.g.][]{2009ApJ...692.1060V}. Thanks to the thinness of the plane we discovered, precise determinations of the fundamental plane can be used to calibrate cluster mass--observable relations, a key ingredient of the cluster cosmology \citep{fuj18b}. \acknowledgments This work was supported by MEXT KAKENHI No.~15K05080 (YF). K.U. acknowledges support from the Ministry of Science and Technology of Taiwan through the grants MoST 103-2112-M-001-030-MY3 and MoST 106-2628-M-001-003-MY3. E.R. acknowledge support from the ExaNeSt and EuroExa projects, funded by the European Union’s Horizon 2020 research and innovation programme under grant agreements No 671553 and No 754337, respectively. \clearpage \begin{deluxetable*}{ccccccc}[h] \tablecaption{Cluster data\label{tab:data}} \tablenum{1} \tablewidth{0pt} \tablehead{ \colhead{Cluster} & \colhead{$z$} & \colhead{$r_s$} & \colhead{$r_{200}$} & \colhead{$M_s$} & \colhead{$M_{200}$} & \colhead{$T_{\rm X}$}\\ \colhead{} & \colhead{} & \colhead{(kpc)} & \colhead{(kpc)} & \colhead{($10^{14}\: M_\odot$) } & \colhead{($10^{14}\: M_\odot$)} & \colhead{(keV)} } \startdata \input{table1} \enddata \end{deluxetable*} \begin{deluxetable*}{ccccccc}[ht] \tablecaption{Cluster Samples\label{tab:disp}} \tablenum{2} \tablewidth{0pt} \tablehead{\colhead{} & \colhead{Observation} & \multicolumn{5}{c}{Simulations}\\ \cline{3-7} \colhead{} & \colhead{} & \colhead{MUSIC} & \colhead{NF0} & \colhead{FB0} & \colhead{FB1} & \colhead{FB0+FB1} } \startdata Nongravitational effects & \nodata & no & no & yes & yes & yes \\ Redshift & $0.377^{+0.309}_{-0.190}$ & 0.25 & 0 & 0 & 1 & $0+1$ \\ Dispersion Around the Plane (dex) & $0.045^{+0.008}_{-0.007}$ & 0.025\tablenotemark{a} & 0.023 & 0.031 & 0.035 & 0.037\\ \enddata \tablenotetext{a}{For the 20\% most relaxed (RE) and unrelaxed (UR) clusters in the sample, it is 0.015 and 0.033, respectively. The classification is based on fit residuals to the NFW profile.} \end{deluxetable*} \begin{deluxetable*}{cccc}[ht] \tablecaption{Plane vectors\label{tab:vec}} \tablenum{3} \tablewidth{0pt} \tablehead{ \colhead{Sample} & \colhead{$P_1$} & \colhead{$P_2$} & \colhead{$P_3$}} \startdata Observation & $(0.55^{+0.03}_{-0.02},0.82^{+0.01}_{-0.01},0.15^{+0.04}_{-0.06})$ & $(-0.34^{+0.08}_{-0.07},0.07^{+0.07}_{-0.07},0.93^{+0.03}_{-0.03})$ & $(0.76^{+0.03}_{-0.05},-0.56^{+0.02}_{-0.02},0.32^{+0.10}_{-0.09})$ \\ MUSIC & $(0.40,0.81,0.42)$ & $(-0.60,-0.11,0.79)$ & $(0.69,-0.57,0.44)$ \\ MUSIC (RE)\tablenotemark{a}& $(0.38,0.82,0.42)$ & $(-0.62,-0.11,0.78)$ & $(0.69,-0.56,0.47)$ \\ MUSIC (UR)\tablenotemark{a}& $(0.39,0.79,0.48)$ & $(-0.58,-0.19,0.79)$ & $(0.71,-0.59,0.39)$ \\ NF0 & $(0.43,0.83,0.36)$ & $(-0.48,-0.13,0.87)$ & $(0.77,-0.55,0.34)$ \\ FB0 & $(0.43,0.84,0.34)$ & $(-0.51,-0.08,0.86)$ & $(0.74,-0.54,0.39)$ \\ FB1 & $(0.37,0.84,0.40)$ & $(-0.55,-0.16,0.82)$ & $(0.75,-0.52,0.40)$ \\ FB0+FB1 & $(0.42,0.82,0.40)$ & $(-0.53,-0.13,0.83)$ & $(0.74,-0.56,0.38)$ \\ Observation\tablenotemark{b} & $(0.27^{+0.01}_{-0.01},0.90^{+0.02}_{-0.03},0.35^{+0.06}_{-0.07})$ & $(-0.18^{+0.03}_{-0.02},-0.31^{+0.06}_{-0.07},0.93^{+0.02}_{-0.02})$ & $(0.94^{+0.01}_{-0.00},-0.32^{+0.01}_{-0.01},0.08^{+0.02}_{-0.02})$\\ \enddata \tablenotetext{a}{The values for the 20\% most relaxed (RE) and unrelaxed (UR) clusters in the MUSIC sample. The classification is based on fit residuals to the NFW profile.} \tablenotetext{b}{For the plane obtained in the space of $(\log r_{200}, \log M_{200}, \log T_{\rm X})$ (see section~\ref{sec:200})} \end{deluxetable*} \clearpage
\section{Conclusion} In this paper, we have proposed a novel method for predicting the battery life of smartphones, which is built upon a longitudinal, comprehensive, and fine-grained real-world data set and state-of-the-art machine learning models. Our method is the first one which uses concordance index in survival analysis to address data missing problem in this context. This metric is practical to many real-world scenarios as the data missing problem is quite pervasive in data mining tasks. The results of the experiments indicate that the remaining battery life of a smartphone could be predicted through a comprehensive set of features and well designed methods. Our method successfully reduces the prediction errors by 33 minutes on average, and it produces significant improvements in both Kendall's Tau and concordance index. the improvement of the accuracy by 33 minutes is quite meaningful in practice. 30 minutes is sufficient for users to adjust their smartphone usage. For example, they can use this period of time to find a power resource, or make a few important phone calls or other critical actions before the phone goes offline. According to the literature~\cite{hu2017roaming}, the average length of a usage session of smartphones is less than 7 minutes. 33 minutes can be a gamechanger in reality, during which users can change the priority of the tasks and finish the most important ones. Among all the features, we find that system status at the query time are almost not helpful on top of the current battery level. However, if we take into account the past system status in the same session, the prediction accuracy is largely enhanced. Particularly, the battery's discharging history is the most predictive feature, indicating that the battery's discharging behavior itself is the most important factor. User-specific features also provide additional predictive power, indicating that there is room for personalized prediction of battery life. We find that the system status are more powerful when the discharging rate is stable. Otherwise, user-specific features will be more informative. The overall performance of tree-based models is observed to be better than the linear regression, and thus validates the hypothesis that tree-based models can outperform the linear regression model. It indicates that the battery lifetime does have some non-linear relationships between system status and users' usage behavior. These findings could be directly useful for related stakeholders as well as provide useful insights to other device models. Since the majority of the features used by our model (battery information, time, sensors, apps' running log, etc.) are quite general and can also be found on any modern smartphones, it is easy to generalize our model to any other smartphone, or even other related contexts such as wearable devices and electric vehicles. Although we cannot guarantee that our model can always produce the same results on different device models, the results presented in this paper can still help to build new prediction models on other device models by techniques such as transfer learning. In addition. It is because that our model follows standard machine learning pipelines, and anyone who has the similar data sets can entirely re-train the model to obtain new results for their own contexts. In the future, we plan to improve our work from two aspects. On the one hand, we would like to include more data dimensions, such as more sensors and more detailed app status. On the other hand, we will explore more advanced machine-learning models to achieve better prediction results. A particular plan is to explore models for survival analysis (e.g., Cox regression model, random survival trees, Tobit, and so on). \section{The Sherlock Data Set} This study is based on the Sherlock data set~\cite{mirsky2016sherlock}, which is a multi-year data collection maintained by the BGU Cyber Security Research Center. The incentive of this data set is to provide mobile security researchers with labeled data, but the data set itself could also be used by any project in mobile data analysis area. This data set is essentially a time-series including nearly \textbf{every software and hardware sensor} that can be got from a Samsung Galaxy S5 smartphone without root privileges. The Sherlock data set is collected through an Android app (named as ``agent'' in the rest of this paper), which was implemented based on Google Funf framework~\cite{aharony2011social}. To collect data, the authors recruited a group of volunteers, then provide each of them with a Samsung Galaxy S5 smartphone which pre-installed the agent. The volunteers are required to use this smartphone as their major device in their daily life, and their usage data will be recorded. Basically, the Sherlock data set has two kinds of data according to how the data are collected: ``PUSH'' data and ``PULL'' data. ``PUSH'' data are collected through event-based approaches, such as recording when an SMS arrives or when the screen is turned on. ``PULL'' data are collected periodically, such as periodically sampling the CPU utilization or the device's acceleration. ``PUSH'' data contain six groups: call log, SMS log, screen status, user presence, broadcast intents, and app packages. Most of these groups' content could be identified by their name. ``PULL'' data contain eight groups: Wi-Fi status, Bluetooth status, application status, and other 5 groups of system status and sensors. Except basic information such as the SDK version of the system, the sampling frequency of ``PULL'' data is at least once a minute, while it can be up to once per 5 seconds for some dimensions. In total, the Sherlock data set contains 553 data fields, and it has already published 21 months data (spanning from January, 2015 to September, 2016) of 51 participants. In conclusion, the Sherlock data set is not only comprehensive, but also longitudinal and fine-grained, which makes it a great material for mobile data analysis. More details about the data set could be found in the referred paper and on its official website\footnote{\url{http://bigdata.ise.bgu.ac.il/sherlock/\#/}}. \subsection{User Privacy} To protect the privacy of the volunteers, several concerns were addressed. First, all data are collected under the volunteers' permission. In addition, all the users' identifiers such as SSIDs, cell tower IDs, and MAC addresses have been hashed, and the phone numbers in text messages and call logs are also hashed as well. Each user is labelled as an non-meaningful string. Moreover, instead of reporting the exact geolocation of the volunteers, the Sherlock data set performs a K-Means clustering over the volunteers' positions, and then use the clustering results to represent users' geolocation. In this way, no user privacy will be leaked through the Sherlock data set. \section{A Descriptive Analysis} To demonstrate the representativeness of out data set and to better understand users' battery-usage pattern, we first make a descriptive analysis of our data set in this section. As we have mentioned previously, we take session as the elementary unit during the analysis. Therefore, we first introduce how to generate sessions out of the raw data. \subsection{Session Generation} \label{sec:session-generation} The battery level data belongs to ``PULL'' data of the Sherlock data set. The data-collection agent reads the battery level of Android OS for approximately every 5 seconds. Each entry of the battery level data contains four fields: 1) user index, 2) timestamp, 3) charging status, and 4) battery percentage. In this case, we can know whether the user's device is charging or discharging along with the battery percentage level at a specific time point. For example, a data entry ``$(0a50e09262, 1426245782, discharge, 54)$'' means that the battery of user ID \textit{0a50e09262} is discharging at the time \textit{1426245782}, and the current battery level is 54\%. To generate sessions, we first discard all charging entries, after which we can get a bunch of continuous series of discharging entries. Since the interval between two consecutive entries is only 5 seconds, it is reasonable to trust that the battery keeps discharging between two consecutive discharging entries, unless either of the following two conditions holds: \begin{enumerate} \item The interval between the entries is larger than a large threshold. Such a case could happen as some data are not recorded by the agent. In this case, it cannot be guaranteed that the battery keeps discharging during this period of time. To be more rigorous, we cut one session into two whenever this condition holds. In this work, we set this threshold to be 10 minutes. \item The battery level of the latter entry is higher than that of the former one. The explanation of such a phenomenon is that the user replaced a new battery, so the latter entry should be considered as the start of a new session. \end{enumerate} In this way, the original battery-level data could be transformed into some sessions. To make the battery life prediction model reliable and meaningful, we need to further filter out sessions whose lifecycle is too short. For simplicity, we take one hour as the threshold. We believe that sessions shorter than one hour are mostly temporary usage. Their usage pattern is more likely to have a big difference with normal usage, which will affect the prediction's accuracy. Finally, we obtained 37,088 sessions in total. \subsection{Distribution of Battery Usage} We then report the distributions that can be helpful to validate the representativeness of the data and to motivate the following studies. We start with the distribution of the duration time of the sessions, which is demonstrated in Figure~\ref{fig:cdf-session-duration}. The longest duration is about 71 hours, while the shortest duration is about one hour since we have filtered out sessions that are shorter than this threshold. We can also observe that most sessions are very short. More specifically, 90\% of sessions are shorter than 13 hours, while less than 2\% sessions are longer than one day. Indeed, these results are quite consistent with our common experience. \input{figures/cdf-session-duration.tex} Then, we investigate the distributions of battery usage within each session. The three figures in Figure~\ref{fig:cdf-battery} illustrate the distributions of the beginning battery level, the ending battery level, and the battery consumption, respectively. From Figure~\ref{fig:cdf-battery-beginning}, we can see that almost half of the sessions begin when the battery is totally full. This observation indicates that most users are used to completely charging their smartphones before they begin to use. For the rest of the sessions, the distribution of beginning battery level is close to uniform, indicating that users do not have any preferences on the time to begin their usage. The distribution of ending battery level is shown in Figure~\ref{fig:cdf-battery-ending}. This curve is pretty close to uniform distribution, too. Hence, we can know that users usually end their usage in different battery levels with similar possibilities. We then break down the two ends of the curve. As for the right end, we can see that about 10\% of the sessions end when the battery is completely full. We infer that these users prefer to keep their batteries fully charged at anytime, and they charge their smartphones whenever they can access available chargers, no matter the battery is full or not. On the other hand, 41\% of the sessions end when the battery level is lower than 20\%, and 5\% of the sessions ``die'', indicating that the battery totally runs out. Finally, we focus on the distribution of battery consumption demonstrated in Figure~\ref{fig:cdf-battery-usage}. Here, the battery consumption is defined as the difference between beginning battery level and ending battery level. Shown by the left bottom part of the figure, 10\% of the sessions do not consume any power. This part of sessions is almost the same group with the sessions that end at the 100\% full status. For the other 90\% of sessions, the distribution of battery consumption is still close to a uniform distribution. In conclusion, the battery consumption of sessions has a large variance. \input{figures/cdf-session-battery-level.tex} From the preceding analysis, almost all the observed distributions are consistent with our common-sense knowledge and can be interpreted, which demonstrates the validity of our data set. \section{Experiment Setup} Based on the definitions introduced in the last section, we then conduct a systematic experiment to demonstrate the predictive power of the features derived from our data set. In this section, we illustrate the workflow of the experiment. \subsection{Workflow Overview} The general workflow of our experiment is illustrated in Figure~\ref{fig:overview}. In general, the battery life prediction model is generated in an offline fashion. Therefore, the model is trained based on a fixed data set in advance, and responds to new query instantly. The model consists of four major phases: \begin{itemize} \item \textbf{Data Collection.} In the first phase, the model takes the usage data, system context, and the battery log from the Sherlock data set as input. The usage data includes system contexts, users' usage behavior, system events, etc. The battery log is the record of battery changes over time. \item \textbf{Data Formulation.} We then process the raw data from the Sherlock data set to formulated features. First, we extract sessions from the battery log. Then we randomly sample time points in each session to simulate the user's query. Finally, by combining the session, the sampled time point, and the usage data, we could generate features of every single simulated query, and build a vector in a multi-dimensional space. The feature generation relies on only the information that occurs before the simulated query, so that building our model never ``looks into the future''. \item \textbf{Model Training.} The model then uses a group of regression models to derive the correlations between the features with the battery life. In this work, we synthesize the linear regression and three tree-based machine learning models. These models can capture both linear and non-linear correlations between the features and the battery life. This phase eventually generate a derived prediction model. \item \textbf{Prediction.} Finally, for a given new query, the model extracts the features, and then the derived model predicts the remaining battery life. \end{itemize} \input{figures/approach-overview.tex} \subsection{Evaluation Metrics} In our experiment, we adopt three evaluation metrics: the Root Mean Square Error (RMSE), the Kendall's Tau, and the Concordance Index (C-idx). The measurement of these metrics and the reasons why we choose them are presented as follows. \subsubsection{Root Mean Square Error (RMSE)} The most critical issue in our experiment is the evaluation metric of the predicted outcome. The most straightforward way is calculating the absolute gap between the actual battery life and the predicted battery life. Then, by using standard statistical methods such as \textbf{\textit{Root Mean Square Error}} (RMSE), we can measure the prediction error. In practice, RMSE is widely used for regression problems, and it can provide an intuitive illustration of the absolute prediction error. Although RMSE is commonly used in regression problems, it inherently has some non-negligible limitations. For example, RMSE is quite sensitive to outliers, and it will be significantly influenced by the scale of data~\cite{armstrong2001evaluating}. More seriously, when applied to forecast problems, RMSE has the disadvantage that it puts a heavier penalty on positive errors than on negative errors. In other words, it is not symmetric for error evaluation~\cite{hyndman2006another}. Therefore, RMSE is not always reliable enough if we take RMSE as the only metric. \subsubsection{Kendall's Tau} To address the limitations mentioned above, we take into account the ranking-based methods to measure how much the ranking of the predicted life is consistent with the ranking of the actual life. Statistically, such consistency can be measured by a widely used metric namely \textbf{\textit{Kendall's Tau}}~\cite{manning2008introduction}. Kendall's Tau measures the difference between the number of normalized concordant pairs and the number of normalized discordant pairs in two ranking lists: \[\tau=\frac{\Sigma_{i,j}(\mathds{I}[(x_i-x_j)\cdot(y_i-y_j)>0]-\mathds{I}[(x_i-x_j)\cdot(y_i-y_j)<0])}{\Sigma_{i,j}(\mathds{I}[(x_i-x_j)\cdot(y_i-y_j)>0]+\mathds{I}[(x_i-x_j)\cdot(y_i-y_j)<0])}\] where $i,j$ are two sessions, $x_i, y_i$ are the orders of the two sessions into two ranking lists. $\mathds{I}[\cdot]$ is an indicator, which equals to 1 if the inside expression is true and 0 otherwise. $\tau$ shall be 1 if the two ranking lists perfectly match, -1 if they totally disagree with each other, and 0 if they are entirely independent. Since every session is considered equally, Kendall's Tau will not be very sensitive to extreme outliers, so it is a meaningful supplement to the RMSE. \subsubsection{Concordance Index (C-idx)} RMSE and Kendall's Tau can measure the predicting accuracy from different perspectives and they can complement each other. However, the basic precondition that these two metrics can be applied is both the actual and predicted battery life can be explicitly observed. Such a precondition is too strong to be always true. As we discussed in Section~\ref{sec:low-battery-event-and-battery-lifetime}, a low-battery event may not happen in all sessions. For sessions that end before reaching the threshold $L$, we can hardly know their actual battery life. In this case, either RMSE or Kendall's Tau does not work. From Figure~\ref{fig:cdf-battery-ending}, we can learn that most sessions' actual battery life cannot be known if $L$ is close to 0. In other words, some essential data is missing and we need to handle such a problem to ensure the completeness and correctness of our prediction task. We then try to partially address the data-missing problem by employing a metric called \textbf{\textit{Concordance Index}} (C-idx)~\cite{harrell1982evaluating}. C-idx is a widely used metric in \textbf{survival analysis}. The goal of survival analysis is to analyze the expected duration of time until one or more events happen\footnote{\url{https://en.wikipedia.org/wiki/Survival_analysis}}. For example, the expected survival time for a group of lung-cancer patients. In survival analysis, a subject is called \textbf{censored} if it does not have any event during the observation time. In the lung-cancer patients scenario, a patient is censored if the event (i.e., death) does not happen before they quits the experiment. C-idx can then deal with the data sets that contain censored data points. For each pair of subjects, C-idx estimates the probability that the predicted outcome is consistent with the ground truth. For example, if a patient A passes away in 3 months, and patient B is censored at 5 months, then we can be confident that B survives longer than A even if we do not know B's actual survival time. Hence, the probability can be explicitly obtained in this case. In another case, if A passes away in 5 months and B is censored at 3 months, then we can not clearly know which patient survives longer, and the probability is 0.5. The overall average of all pairs' probability is the final result of C-idx, whose value is 1 if the two lists are perfectly concordant and 0 when they are entirely anti-concordant. Particularly, C-idx is linearly equivalent to Kendall's Tau when all data points are not censored. Therefore, C-idx can be considered as a generalization of Kendall's Tau and can alleviate the data-missing problem. Inherently, our battery life prediction task is quite similar to a survival analysis problem, so we can employ C-idx as a promising metric for our problem. In conclusion, RMSE, Kendall's Tau, and C-idx could measure the prediction's accuracy from different perspectives. RMSE could measure the absolute error of the prediction so it can provide an intuitive insight of the accuracy. Kendall's Tau is rank-based and widely adopted, which could show the prediction accuracy on uncensored data. C-idx is used to demonstrate the model's predictive ability on both censored and uncensored data points. Therefore, when evaluating the models, we will take all these there metrics. To be specific, we apply RMSE and Kendall's Tau to observed sessions, and apply C-idx to all sessions. \subsection{Data Cleaning and Feature Selection} In this section, we describe how we parse the raw data and transform the raw data to the features that can be fed to the prediction model. \subsubsection{Query Simulation} We generate our experiment data from the 37,088 sessions mentioned in~\ref{sec:session-generation}. First of all, sessions whose beginning battery level is lower than 30\% are discarded. This is because these sessions are already in a low battery state when they begin, so predicting their battery life is not meaningful. Such a step filters out about 4\% sessions, and keeps 35,590 sessions left. We fit the threshold $L$ to 20\%, under which 13,825 sessions are observed ones and the rest 21,765 sessions are unobserved ones. For every single session, we assume that a user can issue a query of battery life at any time. Therefore, we randomly sample a time point $t_{query}$ that satisfies $t_{query}\in[t_{start}+2min, t_{event}-2min]$ for observed sessions and $t_{query}\in[t_{start}+2min, t_{end}-2min]$ for unobserved sessions. To make sure that there already exist some usage data before the prediction query, we add a 2-minute boarder at the beginning so that the sample time-points are too close to the beginning. Similarly, we also add a 2-minute boarder at the end to make sure that the sample time points are not too close to the end. We then sample 1/6 sessions from both observed sessions and unobserved sessions as our testing set. Other sessions are used for training the model. The summary of statistics of the data is listed in Table~\ref{tab:data-stats}. \input{tables/generated-data-stats.tex} \subsubsection{Feature Extraction} Since the Sherlock data set has a great number of dimensions, it is unnecessary and unrealistic for us to use all of them in the experiment. For simplicity, we use only the following four parts of the Sherlock data set to extract features: app usage data, sensor data, screen status, and broadcast record. We select these parts due to the following reasons. App usage data could reflect users' usage behavior, while sensor data could illustrate the context of users' usage, so it is natural to consider these two parts. As for screen status and broadcast, they are the most basic system events which can be easily recorded, and they are user perceivable. In addition, since other system events are too rare or have other quality problems, we choose only these two parts as a representation of the system events. The description of each part is listed as follows: \begin{itemize} \item \textbf{App usage data.} The app usage data are collected through periodical sampling. The agent collects apps' running information every 5 seconds. The raw data of app usage contains various fields. In our model, we use only the ``status'' fields, that is, we consider only the app's running status at a specific time point, such as running in the foreground, idle, and so on. \item \textbf{Sensor data.} According to the categorization of the Sherlock data set, sensors on the Samsung Galaxy S5 smartphones are categorized into 4 groups, named from T1 to T4. Due to the consideration of data completeness, we select 9 fields from group T1 and 150 fields from group T2 in our model. T1 and T2 are periodically sampled from the system once a minute and once every 15 seconds, respectively. \item \textbf{Screen status and broadcast record.} Unlike the previous 2 parts of data, screen status and broadcast record are collected through the event-base strategy. For screen status, each time the user turns screen on or off, the agent will record this event with its timestamp. Similarly, whenever the system sends a broadcast, the agent can record the timestamp and the type of the broadcast. \end{itemize} Based on the data above, we finally extract 21 groups of features, which are described in Table~\ref{tab:features}. The detailed explanations on these features will be introduced in the following section. To ensure that all features have similar scale, we add the standard normalization to each feature, that is, adjusting their mean to 0 and standard deviation to 1 through a linear transformation. We use the median of the valid values of every single data field to fill the missing values in this field. \subsection{Baseline: Ranking by Remaining Battery Volume} An intuitive and straightforward way to estimate the battery life is based on the current battery level. If the battery has more power, it should last longer in most cases. To demonstrate the predictive ability of this fashion, we first train the regression models based on only the battery level at $t_{query}$ (F1), and evaluate the models' performance on testing sets. We explore a group of standard, state-of-the-art machine-learning models for this problem, including the Linear Regression, the Random Forest Regression (RF)~\cite{breiman2001random}, the Gradient Boosted Regression Tree (GBRT)~\cite{friedman2002stochastic}, and the Extreme Gradient Boosting (XGBoost)~\cite{friedman2001greedy}. These models can capture both linear and non-linear correlations\footnote{We use the XGBoost package~\cite{chen2016xgboost} for XGBoost, and scikit-learn package~\cite{pedregosa2011scikit} for Linear Regression, RF, and GBRT. Both packages are implemented in Python. We use default parameters when training all the models. For example, \texttt{n\_estimators=100} and \texttt{learning\_rate=0.1} for GBRT and XGBoost, while \texttt{max\_features=''auto''} for RF}. We have also considered two additional models: SVM Regression and Decision Tree Regression. Their performance is inferior to the aforementioned models. For simplicity, we will focus on the four models in this paper. A smartphone is actually a computer system that contains numerous software and hardware components. The battery consuming rate is not likely to be affected by only linear combinations of these factors. From this point of view, we think that it is useful to capture inner correlations among system features, and non-linear correlations between system features and battery consuming rate. It is the reason why we adopt these tree-based machine learning models, and \textbf{we make the hypothesis that tree-based models can outperform the linear regression model}. Generally, the three tree-based models are state-of-the-art models that are all widely used. We will compare their performance when evaluating the prediction results. The results are presented in the first three rows of Table~\ref{tab:result-current}. These simple models yield a RMSE of 140.4 and a $\tau$ of 0.7442 on the 2,305 observed sessions. Results generated from all the four models are quite similar, which is reasonable because there is only one variable. The result of RMSE is not satisfying, implying that the estimated error of this simple model is about 140 minutes. Even though, it is surprising to see that the result of ranking does not seem that bad. The $\tau$ value is about 0.7 and means that there is a strong positive correlation between current battery level and battery life. Although the absolute error of this method is a bit high, the order of sessions according to the battery life is promising in most cases. When calculating the C-idx on all 5,933 testing sessions, the highest result is 0.9260. Such a result is quite similar to Kendall's Tau. The inconsistency between the RMSE and the ranking-based metrics can be informative: the current battery level is quite crucial to the battery life, but its actual predictive ability is not satisfying at all. We are motivated by this finding to figure out whether and how much the other system status and usage behavior can further improve the predicting accuracy. \section{Introduction} How many times were you expecting an important conference call but found only 20\% battery left on your iPhone? How many times were you in the middle of a city tour but felt nervous about turning on the direction service, with the fear of not having enough battery for the rest of the day? Should I find a restaurant to stop and recharge, or should I do it after that mountain hike? What if I tell you that your battery can still last for one hour? Ever since the introduction of the first iPhone in 2007, we have been witnessing the tremendous growth of smartphones and smartphone apps. Today, smartphones have been an indispensable component of our daily lives. The rich functionalities of a smartphone have expanded its role way beyond a communication tool and towards a pervasive computing device. As of 2017, there are over a hundred popular models of smartphone devices on the market, all enpowered with multiple core processors, large screens, RAMs with comparable sizes to personal computers, hundreds of Gigabytes of ROMs, and a variety of sensors\footnote{\url{https://oneplus.net/5}}. Meanwhile, there are more than 2,200,000 and 2,800,000 apps on marketplaces such as Apple Appstore and Google Play, respectively\footnote{\url{https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/}}. The co-growth of hardware and software makes smartphones more powerful than it has ever been. Unfortunately, the improvement of battery technology has not been able to keep pace with the rapid growth of the devices and apps. For most smartphones, the battery could last for at most one day, and the battery life drops rapidly when the usage is heavier. Short battery life has always been the bottleneck of a user's daily experience of smartphones. As a result, users often need to bring alternative power sources such as spare batteries or power banks when it is inconvenient to charge, or their smartphone activities have to be compromised due to battery limits. It is by all means critical to explore ways to ease the battery-caused pains of smartphone users. In literature, much effort has been done to approach this problem, such as to analyze and reduce energy consumption of a specific hardware component~\cite{balasubramanian2009energy, puustinen2011effect, rosen2015revisiting, shen2015enhancing}, to restrict unnecessary resource usage~\cite{he2015optimizing, chen2015smartphone, draa2015application}, and so on. Most of them attempt to extend the battery life by enhancing the efficiency of energy consumption. In practice, such approaches to extended battery life (e.g., the ``energy saving mode'') are usually at the risk of reducing the functionalities and compromising the user experience. Instead, an intriguing question to ask alternatively is how to optimize the experience of users under the battery capacity limits. Along this line, the very first and critical step is to let the user know how much longer the battery would still last before it has to be recharged, a metric that can be described as the \textit{remaining lifetime of the battery} or simply the \textit{battery life}. If the battery life can be accurately estimated at the real time, the user is able to plan their smartphone usage smartly, either to carry on the current activities, or to take actions to save the energy for an important activity scheduled. However, due to the complexity of the hardware and software of smartphones, predicting the remaining battery life in real time is not a trivial task. Indeed, it is almost infeasible to identify the energy drain of every currently running app and every hardware component. The expected battery life time, however, doesn't just depend on the current or past energy consumption status, but is also highly influenced by the various activities the user plans to perform next, and these activities themselves are hard to predict~\cite{li2015characterizing, falaki2010diversity}. Existing efforts on predicting battery life at real time are far from meeting these challenges. In fact, most of them appear to be too primitive and not practical due to the following reasons. First, the lack of fine-grained data has been a big obstacle to almost every existing study. Most data sets used in literature are collected from lab experiment, so they are short-term and usually do not represent the usage of smartphones in reality. Second, these data sets usually only collect a few surface data attributes at a coarse granularity (e.g., readings of battery levels at every a few minutes) instead of in-depth and fine-grained signals (e.g., sensor readings or screen statuses at seconds level). Due to the lack of rich and longitudinal signals, most existing work is only able to explore simple predictors rather than the much more powerful machine learning models. Moreover, none of the existing studies has been able to identify and handle a classical and severe data missing problem in this prediction task. To be specific, it is critical to distinguish the cases where a user charges their phone before the battery dies from the cases where the battery actually dies. Failing to treat the two cases appropriately may result in significant biases and compromised accuracy in the prediction task. We present the first exploration of the modern ``AI + Big Data'' approach to battery life prediction, based on state-of-the-art machine learning algorithms and comprehensive, fine-grained signals collected from real-world uses of smartphones. Our analysis is based on a data set~\cite{mirsky2016sherlock} that collected fine-grained traces of system statuses, system events, sensor readings, and app statuses from the daily usage of 51 smartphone users in 21 months. The data set contains \textbf{every software and hardware sensor} that can be obtained from a Samsung Galaxy S5 smartphone without root privileges. To the best of our knowledge, this is the most fine-grained and comprehensive data set that has ever been used for this purpose. This is also the first work that formally identifies and handles the data missing problem in the battery life prediction, and the first that systematically evaluates advanced machine learning models for this task. In summary, we make the following contributions in this paper: \begin{itemize} \item We conduct a descriptive analysis of how users consume the energy of their smartphones in daily uses. We find that almost half of usage sessions begin with not a full level of battery, and about 40\% of the usage sessions are exposed to the risk of running out of power. \item We present a systematic evaluation of how well the system statuses and user behaviors can join forces through state-of-the-art machine learning models to predict the battery life. Surprisingly, we find that the battery level and system statuses at the present are not sufficiently predictive for the expected battery life. Instead, the battery's discharging history, past system statuses in the session, and the user's historical usage patterns may significantly enhance the prediction accuracy. Our model successfully reduces the prediction error by more than 30 minutes on average, comparing to the baseline. \item We formally identify the \textbf{data missing} problem (i.e., users will not always consume all the energy) in battery life prediction and use a classical statistical metric, the \textbf{concordance index}, to address the issue. \item We present insights on the scenarios in which different factors are more predictive for the battery life. The experiments show that system statuses in the past perform the best when the energy consuming rate is stable, while user behaviors are more predictive in the opposite situation. \end{itemize} The results of our analysis can be easily applied to the real world. The prediction model allows a user to query their battery life at anytime they want, and it predicts how long the battery is expected to last before it needs to be recharged. Although our data set was collected from Samsung Galaxy S5 smartphones, we intentionally avoided using any device-specific feature. Therefore, the method is generalizable to other devices, as long as the devices have the mechanism to collect similar signals. In a long shot, our method and conclusions are not limited to smartphones, but can be applied to predicting the battery life for other smart devices, such as tablets, smart watches, and even electronic vehicles. The rest of the paper is organized as follows. We first present the related work in Section 2, followed by an introduction of the data set in Section 3. We formally define our problem in Section 4 and present a descriptive analysis of smartphone battery usage in Section 5. The setup and the results of our experiments are presented in Section 6 and Section 7 respectively. Finally, we discuss the potential limitation of the work in Section 8 and conclude the study in Section 9. \section{Limitations} As a prediction task, our approach inherently could have some limitations that can affect the generalizability of our results. The first potential threat is that the data set is collected from a single device model, i.e., Samsumg Galaxy S5. Some features are device-specific and may not be available on other device models. However, such type of features account for very little of all features, e.g., only some specific sensors. As a result, we believe that our prediction model itself can be generalized to most device models, as most of the features used in our model are can be collected from standard Android system, and can be even obtained on any similar devices (such as iPhone). In addition, our model follows the standard machine learning pipeline, so it could be applied to any data sets. Another possible limitation is that the users in our data set are mainly from a controlled user group from Israel. Therefore, some of our findings may not always hold for users from other regions. However, we regard that our findings are still meaningful because most features (especially features that have strong predicting power) rely on the information that can be collected at system-level rather than subjective user-specific behaviors. \section{Problem Formulation} One major goal of our study is how to predict battery life based on system status and user behavior. In this section, we first define related objects and their notations, then describe the problem definition. The summary of notations is listed in Table~\ref{tab:notation}. \input{tables/notation.tex} \subsection{Discharging Session and Battery Function} We define a \textit{discharging session} (\textbf{session} for short) as a duration spanning from the beginning of discharging to the end of discharging. In practice, a session corresponds to a continuous period of using time. For example, the time can range from unplugging the charger in the morning to plugging the adapter back before going to bed. In the following parts of this paper, we take session as the basic unit for further analysis. Formally, we use $[t_{start}, t_{end}]$ to denote a session, where $t_{start}$ and $t_{end}$ represent the beginning time and ending time of the session, respectively. Naturally, $t_{end}$ is always larger than $t_{start}$. In addition, we employ a function $b(t)$ to represent the battery level of current smartphone at a given time point $t$. In this case, the beginning and ending battery level of a session can be denoted as $b(t_{start})$ and $b(t_{end})$. It is easy to understand that the battery level never goes up within a discharging session, so $b(t)$ monotonically decreases along with the increasing $t$. \subsection{Low-Battery Event and Battery Life} \label{sec:low-battery-event-and-battery-lifetime} We define a session's \textbf{low-battery event} as the first time when the battery level degrades to a threshold $L$ ($0\leq L\leq 100$). Particularly, the low battery event refers to the ``run-out-of-power'' event when $L$ is zero. The time when a low-battery event happens is denoted as $t_{event}$. It is worth mentioning that a low-battery event may not happen if $b(t_{end})>L$, i.e., the session ends before the battery level reaches the threshold. Therefore, sessions can be labelled as \textbf{``observed''} or \textbf{``unobserved''} according to whether the low battery event can be observed within the session. The threshold $L$ could significantly influence the ratio between observed sessions and unobserved sessions. Note that how to handle the ``unobserved'' sessions is critical. Since these sessions do not have output labels, most existing work decided to exclude them from the prediction task. This treatment is risky and introduces a severe data missing problem, which not only introduces biases into the analysis but also makes the measure of success unreliable. Later in the paper, we will introduce a principled method to deal with the unobserved sessions. For observed sessions, the battery life is defined as the time duration from a given time $t$ to $t_{event}$. This can be denoted as a function $life(t)$, whose definition is $life(t)=t_{event}-t$. It should be noticed that $life(t)$ is meaningful only when $t$ is prior to $t_{event}$. We need to emphasize that the ``battery life'' defined here is more general than the ``physical'' battery life in common sense. According to our definition, a battery runs out of its ``life'' if the battery level degrades below a threshold $L$ (e.g., 10\% or 20\%), rather than the battery being completely drained. The duration to the state that the battery is completely drained is a special case when $L=0$. Intuitively, it is more straightforward to predict the time when the battery is completely empty (i.e. $L=0$). However, such a case does not frequently occur in real life as most people won't wait until then to recharge their phones. Predicting when the battery would completely die is not only less meaningful in practice, but also more difficult because of fewer training examples. A good selection of the threshold $L$ balances the difficulty and the usefulness of the prediction task. We will discuss more details in the following part of this paper. \subsection{A Regression Problem} Based on the definitions above, our goal is to predict $life(t)$ from a given time $t$. To be more specific, the prediction target is the remaining time till the battery is considered low (less than the given threshold). It is then natural to consider such a prediction task as a regression problem. More specifically, given any set of information of time $t$, we train a regression model that predicts $life(t)$ for the session. The inputs of the regression model contain system status, user's usage behavior, and user's usage history. More details will be discussed in the following sections. \section{Related Work} Battery is arguably one of the most important components on mobile devices such as smartphones and wearables, the capacity of which significantly affects user experience. A large body of literature has been trying to address problems related to battery optimization. Generally, existing studies can be partitioned into three categories: power modeling, power saving, and battery life prediction. One common step of smartphone battery optimization is to understand where and how the energy is consumed on a smartphone. However, it is not trivial to obtain such information directly from the system. Therefore, many studies focus on how to measure the energy drain of every single component of a smartphone, more specifically, through the so-called ``power modeling'' process. Currently, there are two major types of power models. The first one refers to the \textit{utilization-based models}. Power models of this kind are based on the assumption that the power state of a smartphone is relevant to the utilization of its hardware components. For example, Shye et al.~\cite{shye2009into} presented a regression-based power model that uses high-level system measurements to estimate smartphone power consumption. They took various statuses of the hardware (e.g., CPU frequency, RAM, and so on) as input and the power consuming rate as output, then used a linear regression model to derive their relationship. Dong et al.~\cite{dong2011self} implemented a power model which could measure battery consumption at a high rate. This model requires only the battery interface provided by the system, so it does not need any external power measurements. Zhang et al.~\cite{zhang2010accurate} developed a system-level power model that takes into account CPU, LCD, GPS, network modules, and audio components. They also introduced an automated technique to construct utilization-based power models. Min et al.~\cite{min2015sandra} claimed that the battery consumption of continuous sensing apps (CSA) will be strongly influenced by users' mobility (for example, walking or running). They set up a series of experiments to validate their hypotheses. Some other power models try to measure the energy usage of apps. For example, Min et al.~\cite{min2015powerforecaster} designed the PowerForecaster, which uses the trace-driven emulation to provide an instant and personalized power estimation of a sensing app at the pre-installation time. Dong et al.~\cite{dong2014rethink} regarded that energy accounting of apps should be formulated as a cooperative game problem. Following this principle, they provided a Shapley-value-based energy accounting method to measure apps' energy consumption. The second category of power models uses Finite-State-Machines (FSMs) to characterize the power consumption of wireless network components. For wireless network components, their power states are not only determined by their utilization, but also related to other, more detailed internal states. Therefore, FSMs are required to capture the power consumption behavior of these components. For example, Pathak et al.~\cite{pathak2011fine} observed that some system calls that do not imply utilization can still change power states. Based on this finding, they proposed an FSM that takes system calls as triggers to model the power consumption behavior of smartphones. The similar principle was also adopted by another energy consumption estimation tool called WattsOn~\cite{mittal2012empowering}. WattsOn introduced a protocol called the Power Save Mode~\cite{manweiler2011avoiding} to capture the power consumption behavior of Wi-Fi modules. Power modeling provides a foundation for power saving research. In a nutshell, the core idea of existing power-saving strategies is to restrict unnecessary hardware and software usage. For example, He et al.~\cite{he2015optimizing} proposed the Dynamic Resolution Scaling (DRS), which could dynamically adjust the user-interface resolution based on the viewing distance. In this way, DRS could reduce the power consumption caused by high-density displays without compromising user experience. Chen et al.~\cite{chen2015smartphone} presented a system called HUSH to identify unnecessary background activities during screen-off sessions. By killing these activities, HUSH could save screen-off energy by 15.7\% on average. Li et al.~\cite{li2014making} developed an method that can automatically rewrite web applications so as to generate more energy-efficient web pages for OLED screens. The key idea of this method is adjusting the background color of web pages to avoid inefficient display along with the possible energy drain. In general, all power-saving strategies need to find a balance between reduced energy consumption and compromised utility and user experience. As an alternative strategy, battery life prediction has also drawn much attention in recent years. An accurate battery life prediction model can provide users informative suggestions to opitmize the app usage under battery limits. Zhao et al.~\cite{zhao2011system} proposed a system context-aware approach for battery life prediction. The authors used a linear-regression model to calculate the device's discharging rate based on system contexts (CPU, screen, I/O, etc.), and took this discharging rate as an estimation of future discharging rate. In this way, the remaining battery life can be calculated. Kang et al.~\cite{kang2011personalized} proposed another method from the user's perspective. They divided users' usage behavior into some possible usage states according to apps' functionalities, e.g., browsing a webpage, sending a text message, making a voice call, etc. They simply assumed that the discharging rate under each state is nearly constant. Based on such an assumption, they used basic statistic methods to calculate the discharging rate and the percentage of time under each state and then used these two vectors to predict the battery life. Kim et al.~\cite{kim2016accurate} proposed a framework that can predict the available battery time for a specific app. For example, they aimed to tell users the remaining battery life if the users keep interacting with the devices such as watching videos or listening to music. The state division in this study is based on hardware status rather than the actual usage behaviors. The framework first detects the discharging rate under each state, and then estimates the percentage of battery time under each state while using a specific app. All these studies mentioned above made meaningful attempts for battery life prediction. The success is however limited by the data sets used in these studies. On the one hand, the data used in most existing studies were collected from either controlled lab experiments or small-scale field studies, usually in a short period of time. In addition, these data sets usually only collect limited types of smartphone usage and system status signals, at a coarse granularity. For example, some previous studies only adopt CPU frequency, Wi-Fi status (turned on or turned off), and screen brightness to predict battery life. These signals are not enough to form a comprehensive representation of the system status, so the prediction is unlikely to be accurate. With limited usable attributes, most existing studies can only construct simple statistical predictors and are unable to explore the much more powerful machine learning models. Besides the limitation of data, some existing studies also rely on potentially problematic assumptions. For example, the assumption that ``the discharging rate under a specific usage state is constant'' may not hold in practice, not to mention that the usage state itself is never a constant. Our work also addresses battery life prediction, but distinguishes from the existing studies in two folds. First, our study is built upon a comprehensive, longitudinal, and fine-grained data set, which collects the real-world smartphone usage traces of 51 users in a 21-month time span. Such a data set allows us to consider the readings from more than one hundred types of sensors, detailed information of system-level events, and various types of user activities. These signals were sampled with a frequency as high as every 5 seconds. Such a data set breaks down the battery usage at very fine granularity, supports the construction of the state-of-the-art machine learning predictors, and enables us to derive much more comprehensive insights. In addition, our approach does not rely on arbitrary assumptions, nor does it impose any restriction to the actual queries (for example, some existing work only allows a user to query the predictor when the battery begins to discharge). In this way, our method is more practical and can be applied to most of mobile devices. Comparing to existing work that adopted only basic statistics and linear predictors, we employ a portfolio of state-of-the-art machine learning models, which are more likely to capture complex, non-linear correlations among the signals. Rather than using only the present system statuses or user activities, our approach takes into account two new groups of information, i.e., the past statuses and activities within the same discharging session, and the historical usage behavior of a user. We demonstrate that the proposed approach effectively improves the prediction accuracy. Last but not the least, we makes the first step to identify and deal with a severe \textit{data-missing problem} in battery life prediction, by borrowing concepts from the classical ``survival analysis'' literature. Although our work follows a standard machine learning practice, it also make an interesting contribution to the machine learning community. That is, we first introduce the concept of concordance index from the survival analysis literature to address the data missing problem. Concordance index as a rigorous evaluation metric, may become a standard in prediction tasks of this kind. \section{Experiment Results} In this section, we present the predictive power of each group of feature, and whether the prediction accuracy could be enhanced through the combination of features. During this section, we will also give some discussions about the features' performance. The performance of some selected feature groups is demonstrated through barplots (Figure~\ref{fig:result-rmse}, Figure~\ref{fig:result-tau}, and Figure~\ref{fig:result-cidx}) and the complete results are organized in the tables. \input{tables/features.tex} \subsection{Query-time Feature} Beyond the battery level, the contexts of the query can also be used to predict the battery life. We extract four groups of features that could describe the contexts: current battery level (F1), current hour (F2), current weekday (F3), and T2 sensors (F4). We call these features \textbf{``query-time feature''} because they can only illustrate the information when the query occurs. F1 is what we used to build the baseline. F2 and F3 are the coarse-grained description of the current time. F4 can demonstrate the system status of the device. We first try to build regression models based on each single group of features, by which we finally got a set of terrible results. The best $\tau$ and RMSE are only 0.2791 and 190.2, respectively, which are much worse than the baseline. This conveys to us that the context itself cannot make accurate prediction alone. Due to this reason, we always bind other groups of sessions with F1 to train the model, to see if the baseline can be improved. We separately combine F2-F4 with F1 to train the model, and finally put all these four groups together to check the performance. All the results are shown in Table~\ref{tab:result-current}. Comparing to the baseline, adding query-time features almost has no improvement at all, even if putting all the features together. RMSE is improved from 140.4 to 132.8, but the other two metrics' improvements are too tiny. In conclusion, the context can slightly reduce the absolute error of the prediction, but it has no effect on the ranking of the sessions. In other words, the battery level itself is quite dominant if we only consider the information at the query time. \input{tables/result-current.tex} \subsection{Session Feature} The unsuccessful attempt of query-time features tells us the predicting power of query time's context is poor. Even though, this result is not out of our expectation, and the phenomenon is reasonable and easy to understand. The query-time features could only reflect the device's status at a single time point, but it cannot tell the usage behavior and the system status in the future at all, which is more determinant to the battery life. Therefore, it should be very helpful if we could predict the user's usage and the system status in the future. However, this task is complicated and beyond the scope of this study. We need to find other simple ways to estimate it. We have the hypothesis that users' usage will usually be stable. Their usage behavior will not significantly change within a single session. In this case, the usage behavior and system status before the query time can somehow reflect the usage pattern in the future, so it can help predicting the battery life. Motivated by the discussion above, we are eager to see how well the model can perform based on the usage history within the session. We call this part of features \textbf{``session feature''}. We make a comprehensive extraction of session features, and finally we get 14 groups (F5-F18 in Table~\ref{tab:features}). These features include the context when the session begins (F5-F7), the duration and power consuming in the past (F8-F12), app usage history and aggregated value of sensors (F13-F16), and system events occurred within the session (F17, F18). Similarly, we first separately combine each group of sessions with F1 to see whether they can improve the performance alone. The results are presented in the upper part of Table~\ref{tab:result-session}. \input{figures/result-rmse.tex} \input{figures/result-tau.tex} \input{figures/result-cidx.tex} \input{tables/result-session.tex} Compared to query-time features, some session features do have the significant predictive power. From Table~\ref{tab:result-session}, we can see that GBRT and XGB on F10 and F11 could enhance the predicting performance. F10 is the average battery consuming rate in the past of the session. For example, if the session has lasted for 2 hours and it consumes 40\% of battery, then F10 is equal to $40\%/2\ hours=20$. F11 is the naive prediction based on F10, which under the assumption that the battery consuming rate will always stay at F10. As described in Table~\ref{tab:features}, we have F11=F1/F10. These two features are quite useful even though they are simple. The best RMSE has a reduction of 16 minutes, while the best $\tau$ can be improved by 0.05. RF works worse than the other two tree-based regression models. It cannot effectively reduce the RMSE, however, it still can slightly increase the $\tau$. In other words, RF cannot capture the absolute error well, but it could help to make the right order of sessions based on F10 and F11. If we use the battery discharging information in a more detailed way, the results can be better. The most powerful group of session features is the past consuming rate (F12). The meaning of F12 is the average power consuming rate of the past 1\%-10\% of battery before the query time. For example, if it takes 50 minutes to consume the recent 5\% of battery, then the corresponding field is $50/10=10$ minutes. Except for the RMSE of the linear regression's result which is worse than the baseline, the performance of all models are significantly raised under all metrics. The best results of a single group so far are also generated by F12, which are RMSE\ $=112.6$, $\tau=0.8120$, and C-idx\ $=0.9530$. The more informative battery consumption history provides us with more insights about user's usage pattern, so it is more predictive than the coarse-grained ones. Except for F10, F11, and F12, other features are not informative enough. Tree-based methods can raise $\tau$ on age of the session (F8), app usage (F16), screen actions (F17), and broadcasts (F18), though the improvement is little. For other groups, there is no improvement at all. \textbf{Discussion.} According to the analysis, only the 3 groups of features related to battery discharging history have significantly predictive ability. Other features including context, usage history, and device status are almost not useful at all. This finding is interesting. An explanation is, no matter how users use the device and what the device status is, their influence on battery will finally be reflected through the discharging rate. The discharging pattern is the most fundamental and straightforward aspect. On the other hand, if comparing different regression models, we can find that linear regression almost has no predictive power. Therefore, the correlation between the features and the outcome should be non-linear, which can only be captured by tree-based methods. Another serious problem of linear regression is over-fitting. When applying it to F15, the RMSE of the outputs is non-sense large ($>1e5$) because the model is seriously over-fitting on this group of features. This is because F15 contains a large group of sensors (400 different indicators), and the variance of these features are small. \textbf{Putting together.} After checking the separate predictive power of each group, we put multiple groups together to see whether the performance could be further improved. The results are shown in the lower part of Table~\ref{tab:result-session}. We first put the three most useful groups (F10, F11, F12) together with F1, then we find that the result has almost no difference with only using F12. This indicates that F12 is already good enough to represent the battery's discharging pattern, while F10 and F11 only provide little help to it. Then, we put all session features (F5-F18) together with F1 to train the models. The result shows that the RMSE is reduced a little bit, indicating that session features other than F10-F12 could provide some information as a combination although they are not very meaningful individually. Another interesting result is, RF performs better than GBRT and XGB when putting all session features together, which has never happened in other cases. This might because that RF could work better when there are more features. \subsection{User-specific Feature} \input{tables/result-user.tex} The rationale of why session features can work is that users' usage has an inertia, so we can infer their usage pattern in the future based on their behavior in the past. This success motivates us to think wider on how to use historical information. Till now, the features we use are limited within the same session. However, users' may have their own usage habit. Therefore, users' usage in the future can be reflected by how they use the device in previous sessions to some degree. As the final step of our experiment, we try three groups of features that describe user's identity and usage in previous sessions: user index (F19), session history (F20), and screen history (F21). Their detailed explanations are: \begin{itemize} \item \textbf{User index (F19).} Each user is allocated one distinct number to identify her identity. Since we have 51 users in the data set, the user index is from 1 to 51. Since different users may have different usage habits, this value can help us better to distinguish users' usage pattern. \item \textbf{Session history (F20).} The stats of the average battery consuming rate of the user's previous sessions, both mean and medium are considered here. We add this group of features under the hypothesis that user's usage behavior has an inertia, so that their battery consuming rate before can have a correlation with the current consuming rate. Considering that user's usage may not be same in different weekdays and hours, we add some other filters: only taking into account sessions that begin in the same hour with the current one, in the same weekday with the current one, or both. Finally, we have 4*2=8 features in this group. \item \textbf{Screen history (F21).} F21 is the stats of the average percentage of screen-on time of the user's previous sessions. The calculating method is similar to F20. \end{itemize} F20 and F21 reflect users' previous usage from two aspects. The former one describes the usage's effect (battery consuming), while the latter one describes the usage state itself. We call these three groups \textbf{``user-specific feature''}. Although they are simple so far, we believe it is still a meaningful initial step to look into these three feature groups. The results are shown in Table~\ref{tab:result-user}. F19 and F20 can provide an improvement, though they are not competitive with F10-F12. This shows that user's battery consuming patterns have a weak correlation among different sessions. On the other hand, F21 is not helpful. That may be because this feature is not representative enough. When putting F19-F21 together, the results are keeping better, showing that user-specific features are useful. \subsection{Putting All Together} \input{tables/result-together.tex} After introducing all the features, we put all groups together to see how good the performance is. As listed in Table~\ref{tab:result-together}, the final result is consistent with what we have discussed above. Query-time features are not very informative. However, it has a big improvement if we add session features into the model. In addition, user-specific features make a slight improvement to the model. Finally, our model reduces RMSE from 140.4 to 106.7, raises $\tau$ from 0.7436 to 0.8266, and raises C-idx from 0.9260 to 0.9547. \subsection{Discussion} \subsubsection{Performance analysis} According to the aforementioned results, query-time features hardly make improvements to the prediction accuracy, but session features can substantially enhance the prediction performance. In addition, user-specific features can also provide some predictive power, though it is not as powerful as session features. To validate whether the results are reliable, we make a group of statistic tests to examine whether the improvements are exactly significant. Here we use the Bootstrap test and the shifted method introduced by Smucker et al.~\cite{smucker2007comparison}. To be more specific, when trying to test the significance of the difference between the performance of two models, we randomly draw cases with replacement from the original test set until we have drawn the same number of cases as in the experiment. In this case, we can calculate the performance of the two compared models under each metric on the new test set, and then get the difference between the two compared models. We repeat this process for 10,000 times to generate the bootstrap distribution, and then use the shifted method to test whether the improvement is significant based on the bootstrap distribution. The test results are presented in Table~\ref{tab:stat-individual}. We select the best results of every single feature group under each metric, and test whether it is significantly better than the baseline. From the table, we can see that query-time features can not significantly outperform the baseline in terms of the Tau and the C-idx, but it can produce significant improvements in terms of the RMSE. Session features and user-specific features can always bring significant improvements. Finally, we make the same tests on the combination of all features, and the results indicate that the best gained performance is also significantly better than the baseline. \input{tables/stat-individual.tex} The experiment results show that the battery consuming pattern itself is very effective to make an accurate prediction. We are very interested in why this simple and intuitive group of features could work so well. Ideally, the battery life could be perfectly predicted by only using the battery consuming rate in the past if the consuming rate is constant. Hence, the battery consuming pattern is more powerful when the battery consuming rate is more stable. Otherwise, the battery consuming pattern will lose its ability if the battery consuming rate during a session has a large variance. Let us suppose the following scenario: a user A goes to work every day and she always goes back home at 6 p.m.. She does not use her smartphone very much while in office, but she prefers to watch videos on her way home. Hence, the battery consuming rate under two states (at work \& on the way home) are extremely different. If the query occurs just at the transit between the two states, it would be very inaccurate to make the prediction only based on consuming pattern. However, this should be the situation that user-specific features can help. If we can use the information of A's previous sessions which at similar time, we will notice that her battery consuming rate is going to rapidly increase, which can greatly help the prediction. Having this hypothesis, we are eager to conduct a new experiment to check whether it is correct. The general idea of this experiment is splitting the training set into several groups according to their battery consuming stability, and to see different features effect on each group. So the first critical step is how to define the stability of a session. We take the following method: for each session, we calculate how much time does it take to consume each 1\% battery. For example, if a session begins at 80\% and ends at 10\%, then we calculate a list $(tb_{80}, tb_{79}, ..., tb_{11})$ to represent the time it takes to consume the battery from 80\% to 79\%, from 79\% to 78\%, and so on. Then, we calculate the variance of the mentioned list. Apparently, if a session's battery consuming rate is stable, the differences among $\vec{tb}$ should be small, and therefore the variance of the list would be small. We use this variance to demonstrate the stability of the sessions. After we get all sessions' variance, we split the sessions in the training set into 5 groups according to their variance, and then make a 5-fold experiment. Each time, we take out one session group as the validation set, and take the other 4 groups as the training set, to see how well can the regression models perform. We first train the model only based on query-time features, then add session features in, and finally involve all features. The result of $\tau$ is illustrated in Figure~\ref{fig:discussion}. Group 0 has the lowest variances while group 5 has the highest variances. Generally, the result is better if we use more features, which is consistent with our previous discussion. If we make a deeper comparison between the green line and the red line, something interesting happens. When adding user-specific features into the model, the performance on group 0 and group 1 decrease. This indicates that when the session's battery consuming rate is stable, the battery usage pattern is powerful, and the user-specific features even make the performance worse. However, if the variance is large, the user-specific features become useful, and it is getting more effective with the increasing of the variance. The improvements of group 2-4 are 0.008, 0.009, and 0.013. Our hypothesis is verified by the experiment result. \subsubsection{Survival Analysis Models} We have carefully considered the problem of censored data and that is why we used C-index as the evaluation metric. Ideally, a best performing prediction model should have been a machine learning model that directly handles censored data. There are such models in survival analysis, such as Cox regression~\cite{cox1992regression}, CoxBoost~\cite{cox1992regression}, Tobit~\cite{tobin1958estimation}, etc. However, during our experiments, we have tried various kinds of survival analysis models, but none of them have a good performance. Most of them simply failed to handle the data at our scale, especially when dealing with more than 1,000 features. For those which did not fail, the prediction accuracy is relatively poor. This is perhaps not surprising, as survival analysis for large-scale and high-dimensional data is an exploratory research direction and the current methods are not robust or scalable yet. Since the goal of our first study is rather demonstrating the feasibility of predicting battery lifetime than maximizing the prediction accuracy, we decided to use the well established and scalable machine learning algorithms. We do note that the prediction performance may be still underestimated and plan to systematically explore large-scale survival analysis in our future work. \input{figures/discussion.tex}
\section{Introduction} \label{sec:intro} Short-arc orbit determination is a very important step when an asteroid is first discovered. In these cases the timing is essential, because we are interested in a rapid follow-up of a possible imminent impactor, which is an asteroid impacting the Earth shortly after its discovery, within the same apparition (interval of observability). The observations are so few that the standard differential correction procedure \citep{milani:orbdet} to find an orbit by a least-squares minimization fails, and other methods need to be used to extract information on the orbit of the object. Several initial orbit computation methods have been developed in the last 25 years. For instance, \cite{muinonen93} define a Gaussian probability density on the orbital elements space using the Bayesian inversion theory. In particular, they determine asteroid orbital elements from optical astrometric observations using both a priori and a posteriori densities, the latter computed with a Monte Carlo method. The few observations in the short arc constrain the position of the object in the sky, but they leave almost unknown the distance from the observer (topocentric range) and the radial velocity (topocentric range-rate). Thus, ranging methods have been developed over the years to replace or refine the Monte Carlo approach in the short arc orbit determination. There are two alternative approaches to the ranging methods: the statistical and the systematic ones. The original statistical ranging method (\cite{virtanen2001}, \cite{muinonen2001}) starts from the selection of a pair of astrometric observations. Then, the the topocentric ranges at the epoch of the observations are randomly sampled. Candidate orbital elements are included in the sample of accepted elements if the $\chi^2$ value between the observed and computed observations is within a pre-defined threshold. \cite{oszkiewicz2009} improve the statistical ranging using the Markov-Chain Monte Carlo (MCMC) to sample the phase space. The MCMC orbital ranging method is based on a bi-variate Gaussian proposal PDF for the topocentric ranges. Then, \cite{muinonen2016} develop a random-walk ranging method in which the orbital-element space is uniformly sampled, up to a $\chi^2$ value, with the use of the MCMC method. The weights of each set of orbital elements are based on a posteriori probability density value and the MCMC rejection rate. They have developed this method for the ESA Gaia mission, in the framework of Gaia alerts on potentially new discovered objects by Gaia (see \cite{tanga2016}). On the other side, \cite{chesley2005} and \cite{farnocchia2015} introduce the so-called systematic ranging, which systematically explores a raster in the topocentric range and range-rate space $(\rho, \dot{\rho})$. This technique permits to describe the asteroid orbital elements as a function of range and range-rate. Then, the systematic ranging also allows one to determine the subset of the sampling orbits which leads to an impact with the Earth. In this paper we describe a new approach to the systematic ranging, based on the knowledge of the Admissible Region (AR) \citep{milani2004AR}, and a new method to scan the region. The process has some main advantages if compared to the other methods described above. \begin{enumerate} \item Our grid is more efficient, for two main reasons: \begin{itemize} \item[-] we discard all the objects that are not in the AR, saving CPU time and making the systematic ranging more accurate in finding the region in the $(\rho, \dot{\rho})$ space of the possible orbital solutions; \item[-] we use two different grids depending on the boundary of the AR. The first grid is larger and less dense, the second one is based on a refinement using the value of the post-fit $\chi^2$ of each point in the first grid (see Section~\ref{sec:adm_reg}). \end{itemize} \item The computation of the probability for the potential impactors is a rigorous probability propagation from the astrometric error model, without any assumption of a priori probability density function on the range/range-rate space (see Section~\ref{sec:PDF}). \end{enumerate} In Section~\ref{sec:adm_reg} we summarize the features of the AR, and describe the sampling of the $(\rho, \dot{\rho})$ space needed for the creation of the Manifold Of Variations (MOV), an extension of the Line Of Variations (LOV, \cite{milani2005multsol,milani:orbdet}). In Section~\ref{sec:cobweb} we present the so-called spider-web \citep{tommei:phd}, to be used when a nominal orbit is available. Section~\ref{sec:PDF} describes how to compute the impact probability when an impactor is found. In Section~\ref{sec:results} we apply our method to the well known cases $2008~TC_3$ and $2014~AA$, and we show other examples to explore the capabilities of the new method. Then in Section~\ref{sec:gaia} we test our method on new objects discovered by Gaia in the framework of the Gaia alerts, and we show the points of strength of this approach applied to Gaia observations. Section~\ref{sec:conclusions} contains our conclusions and comments. \section{Sampling of the topocentric range and range-rate space} \label{sec:sampling} \subsection{Admissible Region and systematic ranging} \label{sec:adm_reg} Even if the observations are too scarce, we can anyway compute the right ascension $\alpha$, the declination $\delta$, and their time derivatives $\dot{\alpha}$ and $\dot{\delta}$, by fitting both angular coordinates as a function of time with a polynomial model. This four quantities can be assembled together to form the attributable \citep{milani2005}: \begin{equation}\label{eq:attributable} \mathcal{A} = (\alpha, \delta, \dot{\alpha}, \dot{\delta}) \in \mathcal{S}^1 \times (-\pi/2, \pi/2) \times \mathbb{R}^2 \end{equation} at a chosen time $\bar t$, which could be the time of the first observation or the mean of the observation times. The information contained in the attributable leaves completely unknown the topocentric distance $\rho$ and the radial velocity $\dot{\rho}$. We would have a full description of the topocentric position and velocity of the asteroid in the attributable elements $(\alpha, \delta, \dot{\alpha}, \dot{\delta}, \rho, \dot{\rho})$, if $\rho$ and $\dot{\rho}$ were known. From now on, we will use $\mathbf{x}=(\mathcal A, \bm{\rho})$, where $\bm{\rho}=(\rho,\dot\rho)$, to describe the attributable elements. Given an attributable, we can define the AR as the set of all the possible couples $(\rho, \dot{\rho})$ satisfying the following conditions (see \cite{milani2004AR} for more mathematical details): \begin{enumerate} \item\label{cond:solsis} the object belongs to the Solar System, and it is not a too long period comet. We consider only the objects for which the value of the heliocentric energy is less than $-k^2/(2a_{max})$, where $a_{max}=100$~au and $k=0.01720209895$ is the Gauss' constant; \item\label{cond:earth} the corresponding object is not a satellite of the Earth, i.e. the orbit of the object has a non-negative geocentric energy when inside the sphere of influence of the Earth, whose radius is \[ R_{SI} = a_\Earth \sqrt[3]{\frac{\mu_\Earth}{3\mu_\Sun}} \simeq 0.010044\text{ au}. \] \end{enumerate} The AR is a compact set, and it can have at most two connected components, which means that it could be represented as the union of no more than two disjoint regions in the $(\rho,\dot{\rho})$ space. The AR has usually one component, and the case with two components indicates the possibility for the object to be distant (perihelion $q>28$ au). As shown in ~\cite{milani2004AR}, the number of connected components depends on the number of the roots of a polynomial resulting from condition number~\ref{cond:solsis}. This polynomial cannot have more than three distinct real positive roots: the AR has two connected components if the roots are three, and it has one component if there is only one root. It is worth noting that the region defined by condition number~\ref{cond:solsis} could contain points with arbitrarily small values of $\rho$. The boundary of the region given by condition~\ref{cond:earth} turns out to have two different shapes: it can be formed just by the line of geocentric energy equal to $0$ (if it is entirely contained in the region $0<\rho<R_{SI}$), or by a segment of the straight vertical line $\rho=R_{SI}$ and two arcs of the zero-curve of the geocentric energy (for $0<\rho<R_{SI}$). We also discard the orbits corresponding to meteors too small to be source of meteorites, using the condition $H\leq H_{max}$, where $H_{max} = 34.5$ is the \textit{shooting star limit}~\citep{milani2004AR}, and $H$ is the absolute magnitude. Given all these conditions, we can sample the AR with a finite number of points. If a nominal solution does not exist, we make use of the systematic ranging to scan the AR. We sample the AR in two different ways, depending on the number of connected components, and the values of the roots ($r_1$, $r_2$ and $r_3$, in ascending order). Table~\ref{tab:summary_AR} summarizes the conditions and the grids used in the $(\rho,\dot{\rho})$ space. In particular, we compute a rectangular grid in the range/range-rate space, with range as in Table~\ref{tab:summary_AR}, and range-rate controlled by the AR equations~\citep{milani2004AR}. Nevertheless, since the AR has a shape dictated by a polynomial equation and it is not a rectangle, we check the value of the heliocentric energy for each grid point, and we discard those not satisfying condition~\ref{cond:solsis}. Orbits not satisfying condition~\ref{cond:earth} are discarded as well, except when we compute the probability for the asteroid to be a satellite of the Earth\footnote{The object could be either an artificial satellite or an interplanetary orbit in a temporary Earth satellite capture~\citep{granvik2012}.}. \begin{table}[h] \begin{center} \caption{The table shows different methods we use to sample the AR in the $(\rho,\dot{\rho})$ space with respect to the values of the roots, and the connected components of the AR. The sampling in $\dot\rho$ is always uniform.} \resizebox{\columnwidth}{!}{\begin{tabular}{l|c|c|l} \hline \multirow{2}*{\textbf{Roots}} & \textbf{AR} & \multirow{2}*{\textbf{Grid}} & \multirow{2}*{\textbf{Sampling in} $\mathbf{\rho}$}\\ & \textbf{components} &\\ \hline $r_1 < \sqrt{10}$ au & 1 & $50\times 50$ & Unif. in $\log_{10}(\rho)$\\ $r_1 \ge \sqrt{10}$ au & 1 & $50\times 50$ & Unif. in $\rho$\\ $r_1 > 0$, $r_2 > 0$, $r_3 > 0$ & 2 & $100\times 100$ & Unif. in $\rho$\\ \hline \end{tabular}} \label{tab:summary_AR} \end{center} \end{table} The target function is defined by \[ Q(\mathbf{x}) = \frac{1}{m} \bm{\xi}(\mathbf x)^T W \bm{\xi}(\mathbf x), \] where $\mathbf{x}=(\mathcal A,\bm\rho)$ are the fit parameters, $m$ is the number of observations used in the least squares fit, $\bm{\xi}$ is the vector of the observed-computed debiased astrometric residuals\footnote{In case there is a bias in the observations~\citep{farnocchia:fcct}, the residuals are computed following the classical definition of the residuals as observed-computed, and also subtracting the biases vector.}, and $W$ is the weight matrix. The choice of the weights for each observatory is fundamental, and it has to take into account the debiasing of the star catalog systematic errors, unless the astrometric reduction has already been performed with an essentially bias-free star catalog, e.g. the Gaia DR1~\citep{gaia_astrometry_2016}. Given a subset $K$ of the AR, we define the Manifold Of Variations $\mathcal M$ as the set of the points $(\mathcal A^*(\bm\rho_0),\bm\rho_0)$ such that $\bm\rho_0\in K$ and $\mathcal A^*(\bm\rho_0)$ is the local minimum of the function $\left.Q\right|_{\bm\rho=\bm\rho_0}$. In addition, the value of the minimum RMS of the residuals is less than a given threshold $\Sigma$. In general, the MOV is a 2-dimensional manifold, such that the differential of the map from the sampling space to $\mathcal M$ has rank $2$. In the case of the systematic ranging, $K$ is the AR, scanned with a regular semi-logarithmic or uniform grid. For each sample point $\bm\rho_0=(\rho_0,\dot\rho_0)$ we fix $\rho=\rho_0$ and $\dot\rho=\dot\rho_0$ in the target function, and then we search $\mathcal A^*(\bm\rho_0)$ by means of an iterative procedure, the doubly constrained differential corrections. The normal equation is \[ C_{\mathcal A} \Delta \mathcal A = D_{\mathcal A}, \] where \[ C_{\mathcal A} = B_{\mathcal A}^T W B_{\mathcal A}\,,\quad D_{\mathcal A} = -B_{\mathcal A}^T W \bm{\xi}\,, \quad B_{\mathcal A} = \frac{\partial{\bm{\xi}}}{\partial{\mathcal A}}. \] We indicate as $K'$ the subset of $K$ on which the doubly constrained differential corrections converges. In this way, the sampling of the MOV is done over $K'$. For each point $\mathbf{x}$ on the MOV, we also compute a $\chi$ value \begin{equation}{\label{chimov}} \chi(\mathbf x) = \sqrt{m(Q(\mathbf x)- Q^*)}, \end{equation} where $Q^*$ is the minimum value of the target function: $Q(\mathbf{x}^*)$ if a reliable nominal solution exists, or the minimum value of $Q(\mathbf{x})$ over $K'$ otherwise. When a nominal solution does not exist, the systematic ranging is performed by a two-step procedure. The first iteration is to compute a grid following the conditions in Table~\ref{tab:summary_AR}. Once we obtain a first preliminary grid, we densify for a higher resolution. We select the minimum and the maximum value of $\rho$ and $\dot{\rho}$ among all the values of the points for which we have a convergence of the $4$-dimension differential correction, and the value of $\chi$ is less than $5$. We also compute the score with respect to the first grid, and we use the value to select the grid for the second step. The score gives us a first insight into the nature of the object, even when the asteroid is not a potential impactor. We define the score as a probability of the object to belong to different classes (NEO, MBO, DO, and SO), where each class is defined by the following conditions: \begin{itemize} \item \textbf{NEO}: Near Earth Object, an object with $q < 1.3$ au, where $q$ is the perihelion distance (in au). \item \textbf{MBO}: Main Belt Object, belonging either to the Main Belt or to the Jupiter Trojans. In particular we choose the conditions \[ \left\{\begin{array}{ll} 1.7\text{ au} < a < 4.5\text{ au}\\ e<0.4\end{array}\right. \quad\text{or}\quad \left\{\begin{array}{ll} 4.5\text{ au} < a < 5.5\text{ au}\\ e<0.3\end{array}\right. \] where $a$ is the semi-major axis (in au), and $e$ is the eccentricity. \item \textbf{DO}: Distant Object, characterized by $q > 28$ au (e.g. a Kuiper Belt Object (KBO)). \item \textbf{SO}: Scattered Object, not belonging to any of the previous classes. \end{itemize} If the object is close to be a NEO (the NEO-score is more than $50\%$), we use a uniform grid in $\log_{10}(\rho)$, otherwise we use a uniform grid in $\rho$. Then we compute again the Manifold Of Variations on the new and denser $100 \times 100$ grid. \subsection{Spider web} \label{sec:cobweb} Let us suppose that a nominal orbit has been obtained by unconstrained differential corrections, starting from a preliminary orbit as first guess (for instance using the Gauss' method, ~\citep{milani:orbdet}). Then, we can use the nominal solution as the center of the subset of the MOV we are interested in, and we can adopt a different procedure to scan the AR. If a nominal orbit exists, and the value of the geodesic curvature signal-to-noise ratio (SNR)~\citep{milani2008} is greater than $3$, instead of using a grid (Section~\ref{sec:adm_reg}), we compute a spider web sampling in a neighborhood of the nominal solution \citep{tommei:phd}. This is obtained by following the level curves of the quadratic approximation of the target function used to minimize the RMS of the observational residuals. The advantage of the use of the cobweb is that, firstly, it is faster than the systematic ranging, and secondly it is more accurate in the cases for which we have already a reliable nominal solution. Let $\mathbf{x}^*$ be the nominal solution with its uncertainty, represented by the $6\times 6$ covariance matrix $\Gamma$. In a neighborhood of $\mathbf{x}^*$, the target function can be well approximated by means of the quadratic form defined by the normal matrix $C=\Gamma^{-1}$. The matrix $C$ is positive definite, hence the level curves of the target function are concentric 5-dimensional ellipsoids in the 6-dimensional orbital elements space. The level curves on the $(\rho,\dot\rho)$ space are represented by the marginal ellipsoids, defined by the normal matrix \[ C^{\bm\rho\bm\rho}=\Gamma_{\bm\rho\bm\rho}^{-1}, \] where $\Gamma_{\bm\rho\bm\rho}$ is the restriction of $\Gamma$ to the $(\rho,\dot\rho)$ space. To sample these curves we choose the maximum value $\sigma_{max} = 5$ for the confidence parameter. Then, for each level curve within the confidence level $\sigma_{max}$, we select the points corresponding to some fixed directions. We initially create a regular grid of points in the space of polar elliptic coordinates $(R,\theta)$, where $0\leq \theta < 2\pi$ and $0\leq R \leq \sigma_{max}$\footnote{We assume that the nominal solution corresponds to the point $(0,0)$.}. Then we apply to each point of the grid the following transformation, depending on the covariance matrix of the nominal orbit and on the orbit itself: \begin{equation}\label{eq:cobweb} \begin{pmatrix} \rho \\ \dot{\rho} \end{pmatrix} = R \begin{pmatrix} \sqrt{\lambda_1} \cos{\theta} & -\sqrt{\lambda_2} \sin{\theta}\\ \sqrt{\lambda_2} \sin{\theta} & \phantom{-}\sqrt{\lambda_1} \cos{\theta} \end{pmatrix} \mathbf{v_1} + \begin{pmatrix} \rho^* \\ \dot{\rho}^* \end{pmatrix}, \end{equation} where $\lambda_1>\lambda_2$ are the eigenvalues of the $2 \times 2$ matrix $\Gamma_{\bm\rho\bm\rho}$, $\mathbf{v_1}$ is the eigenvector corresponding to the greatest eigenvalue $\lambda_1$, and $\rho^*$ and $\dot{\rho}^*$ are the range and range-rate values of the nominal solution. Figure \ref{fig:cobweb} shows an example of spider web sampling on the $(\rho,\dot\rho)$ plane. \begin{figure}[h] \centering \includegraphics[width=\columnwidth]{cobweb.pdf} \caption{The figure shows an example of spider web around the nominal solution $\bm \rho^*=(\rho^*,\dot\rho^*)$. The points follow concentric ellipses, corresponding to different values of the parameter $R$. For each fixed direction (identified by $\theta$), there is one point on each level curve.} \label{fig:cobweb} \end{figure} \section{Probability density computation} \label{sec:PDF} We obtain a probability distribution on the sampling space to be used for several applications, such as the computation of the impact probability or the score. We begin assuming that the residuals are a Gaussian random variable $\bm\Xi$, with zero mean and covariance $\Gamma_{\bm\xi}=W^{-1}$. Hence the probability density function on the residuals space is \begin{align}\label{eq:res_gauss} p_{\bm\Xi}(\bm \xi) &= N(\bm 0,\Gamma_{\bm \xi})(\bm \xi)= \frac{\sqrt{\det W}}{(2\pi)^{m/2}} \exp\left(-\frac{mQ(\bm\xi)}{2}\right)=\nonumber\\ &=\frac{\sqrt{\det W}}{(2\pi)^{m/2}} \exp\left(-\frac 12 \bm\xi^TW\bm\xi\right) \end{align} A possible approach to propagate the density \eqref{eq:res_gauss} to the sampling space uses the Bayesian theory to combine the density coming from the residuals with a prior distribution. The {\em a posteriori} probability density function for $(\rho, \dot{\rho})$ is given in \cite{muinonen93} as \begin{displaymath} p_{post}(\rho, \dot{\rho}) \propto p(\bm{\xi}(\rho, \dot{\rho})) \cdot p_{prior}(\rho, \dot{\rho}) \end{displaymath} where $p_{prior}$ is a prior distribution on the sampled space. Hereinafter we report some possible choices for the prior probability. \begin{itemize} \item \emph{Jeffreys' prior}. It has been used for the first time in \cite{muinonen2001}. It takes into account the partial derivatives of the vector of the residuals with respect to the coordinates $(\rho, \dot{\rho})$. Jeffreys' prior tends to favor orbits where the object is close to the observer, because of the sensitivity of the residuals for small topocentric distances. \cite{granvik2009} makes versions of the code (which utilizes Jeffreys' prior) publicly available for the first time. \item \emph{Prior based on a population model}. This approach requires the computation of the prior distribution as posterior of another prior, which is selected as proportional to $\rho^2$ by geometric considerations on the Cartesian space of position and velocity. \item \emph{Uniform distribution}. Uniform distribution in the $(\rho,\dot\rho)$ space. \end{itemize} \cite{farnocchia2015} gives a detailed description of all these different possible choices, and they also analyze how the impact probabilities change according to different prior distributions. They conclude that the uniform distribution is a good choice for an a priori probability density function, because it represents a good compromise between a simple approach and the identification of potential impactors. Hereinafter we propose a new method to propagate the probability density function $p_{\bm\Xi}(\bm\xi)$ back to the sampling space. This method is a rigorous propagation of the density function according to the probability theory, and it does not use any a priori assumption. The main idea is that we propagate the probability density function from the residual space to the orbital element space (more precisely, on the Manifold of Variations), and then to the sampling space, according to the Gaussian random variable transformation law. The main difference in using this approach instead of the uniform distribution, is that we compute the Jacobian determinant of the transformation and it is not equal to 1, which is the value chosen by \cite{farnocchia2015}. We define the following spaces: \begin{itemize} \item $S$ is the space of the sampling variables. It changes depending on the case we are considering: $S=\mathbb{R}^+ \times \mathbb{R}$ if the sampling is uniform in $\rho$, $S=\mathbb{R}^2$ if the sampling is uniform in $\log_{10}\rho$, and $S=\mathbb{R}^+ \times \mathcal S^1$ in the cobweb case. \item $K'$ is the subset of the points of the AR such that the doubly constrained differential corrections give a point on the MOV; \item $\mathcal M$ is the MOV, a 2-dimensional manifold in the six-dimensional orbital elements space $\mathcal{X}$; \item $\mathbb{R}^m$ is the residuals space. The residuals are a function of the fit parameters: $\bm \xi=F(\bold x)$, with $F:\mathcal{X}\rightarrow \mathbb{R}^m$ differentiable, and we define the manifold of possible residuals as $V=F(\mathcal{X})$ \citep[Section 5.7]{milani:orbdet}. \end{itemize} Without loss of generality, we can assume that \begin{equation}\label{eq:res_norm_gauss} p_{\bm\Xi}(\bm \xi) = N(\bm 0,I_m)(\bm \xi)= \frac 1{(2\pi)^{m/2}}\exp\left(-\frac 12 \bm\xi^T\bm\xi\right), \end{equation} where $I_m$ is the $m\times m$ identity matrix. As explained in \citet[Section 5.7]{milani:orbdet}, this is obtained by using the normalized residuals in place of the true residuals; biases due to star catalog can also be removed while forming the normalized residuals. With this technique, the probability density function becomes normalized to a standard normal distribution. Thus from now on, we will use $\bm\xi$ to indicate the normalized residuals, and the function $F$ maps the orbital elements space to the normalized residuals space. Then we consider the following chain of maps (defined in \ref{app:IPcomp}) \[ S \overset{f_\sigma}{\longrightarrow} \mathbb{R}^+\times \mathbb{R} \supseteq K' \overset{f_\mu}{\longrightarrow} \mathcal{X} \supseteq \mathcal M \xrightarrow{\left.F\right|_{\mathcal M}}V \] and we use their Jacobian matrices to compute the probability density function on $S$. Let $\mathbf{s}$ be the variable of the sampling space $S$, and let $\mathbf{S}$ be the corresponding random variable. We use the compact notation $\chi^2(\mathbf{s})$ to indicate $\chi^2(\mathbf{x}(\bm\rho(\mathbf{s})))$. The probability density function of $\mathbf{S}$ is \tiny \begin{equation}\label{eq:p_S} p_{\mathbf{S}}(\mathbf{s}) = \frac{\displaystyle \exp\left(-\frac{\chi^2(\mathbf{s})}{2}\right) \det M_\mu(\bm\rho(\mathbf{s}))\det M_\sigma(\bm\rho(\mathbf{s}))} {\displaystyle\int_{f_{\sigma}^{-1}(K')} \exp\left(-\frac{\chi^2(\mathbf{s})}{2}\right)\det M_\mu(\bm\rho(\mathbf{s}))\det M_\sigma(\bm\rho(\mathbf{s}))\,d\mathbf{s}} \end{equation} \normalsize where $M_\mu$ is the $2\times 2$ matrix associated to $f_\mu$ (considered as tangent map to the surface $\mathcal M$), and $M_\sigma$ is the $2\times 2$ Jacobian matrix of $f_\sigma$. The derivation of \eqref{eq:p_S} is given in \ref{app:IPcomp} (explicit expressions for the Jacobian determinants are provided in \ref{subsec:MOV-AR} and \ref{subsec:AR-S}, respectively). It is worth noting that we limit our analysis to Solar System orbits (condition number~\ref{cond:solsis} of Section~\ref{sec:adm_reg}), because interstellar objects are very rare. As a consequence, we use a Bayesian theory with a population limited to the Solar System, and all the probability computations we describe are actually conditional probabilities to the AR, which is even a subset of the Solar System. \subsection{Impact probability computation} Each point on the MOV can be thought as an orbit compatible with the observations, and we call it Virtual Asteroid (VA). We propagate the VAs into the future, currently for 30 days from the date of the observations, and we search for Virtual Impactors (VIs), which are connected sets of initial conditions leading to an impact \citep{milani:clomon2}. If a VI has been found on the Modified Target Plane (MTP, \cite{milani99}), it is associated to a subset $\mathcal V\subseteq S$ of the sampling space, and hence its probability is given by \tiny \begin{equation*} \mathbb P(\mathcal V) = \int_{\mathcal V} p_{\mathbf{S}}(\mathbf{s})\,d\mathbf{s}= \end{equation*} \begin{equation}\label{eq:IPcomp} =\frac{\displaystyle \int_{\mathcal V}\exp\left(-\frac{\chi^2(\mathbf{s})}{2}\right) \det M_\mu(\bm\rho(\mathbf{s}))\det M_\sigma(\bm\rho(\mathbf{s}))\,d\mathbf{s}} {\displaystyle\int_{f_{\sigma}^{-1}(K')} \exp\left(-\frac{\chi^2(\mathbf{s})}{2}\right)\det M_\mu(\bm\rho(\mathbf{s}))\det M_\sigma(\bm\rho(\mathbf{s}))\,d\mathbf{s}}. \end{equation} \normalsize If for a given object we find impacting solutions, we assign to the object an impact flag, which is an integer number related to the computation of the impact probability. It depends on the impact probability and on the arc curvature, as shown in Table~\ref{tab:impact_flag}. An arc has significant curvature if $\chi^2>10$, where $\chi$ is the chi-value of the geodesic curvature and the acceleration (as defined in \cite{milani2007}). The impact flag can take the integer values from $0$ to $4$: $0$ indicates a negligible chance of collision with the Earth, whereas the maximum value $4$ expresses an elevated impact risk ($\ge 1 \%$). It is conceived as a simple and direct communication tool to assess the importance of collision predictions, and to give the priority for the follow-up activities. \begin{table}[h] \begin{center} \caption{The table shows the conditions on the Impact Probability (IP) and on the arc quality to assign the impact flag to an object.} \small{ \bigskip \begin{tabular}{c|l} \hline {\textbf{Impact flag}} & \textbf{Condition} \\ \hline 0 & $IP\le 10^{-6}$\\ 1 & $10^{-6} < IP \le 10^{-3}$\\ 2 & $10^{-3} < IP \le 10^{-2}$\\ 3 & $IP > 10^{-2}$ and no significant curvature\\ 4 & $IP > 10^{-2}$ and significant curvature\\ \hline \end{tabular} } \label{tab:impact_flag} \end{center} \end{table} The goal for a system dedicated to imminent impactors is to detect all the possible VIs down to a probability level of about $10^{-3}$, called completeness level~\citep{delvigna2018}. To reach the completeness level of $10^{-3}$ for our system, we can neglect the terms which are of smaller order of magnitude in equation~\eqref{eq:IPcomp}. This allows us to consider the VAs with a $\chi$-value less than 5. If $\chi=5$ then $\exp(-\chi^2/2)\simeq 10^{-5.4}$, and the corresponding term is negligible. Moreover, the choice $\chi<5$ is valid for the score computation, because we are interested in a score accuracy of about $10^{-2}$. \section{Results} \label{sec:results} We are setting up a service dedicated to the scan of the Minor Planet Center NEO Confirmation Page\footnote{\url{http://www.minorplanetcenter.net/iau/NEO/toconfirm_tabular.html}} (NEOCP). The goal is to identify asteroids as NEOs, MBOs or distant objects to be confirmed or removed from the NEOCP, and to give early warning of imminent impactors, to trigger immediately follow-up observations. The software used to produce these results is a new version of the OrbFit Software version 5.0\footnote{\url{http://adams.dm.unipi.it/orbfit/}}. The service involves the following steps, based on the algorithm presented in Sections~\ref{sec:cobweb} and \ref{sec:PDF}. \begin{itemize} \item Scanning of the NEOCP every $2$ minutes. New cases or old cases just updated are immediately run. \item Computation and sampling of the AR using a $2$-dimensional representation in the $(\rho, \dot{\rho})$ plane with a either grid or a spider web. \item Computation of the MOV, obtaining a set of VAs. \item Propagation of the VAs in the future (currently for 30 days). \item Projection on the Modified Target Plane, searching for VIs. \item If VIs exist, computation of the Impact Probability. \item Computation of the score. \end{itemize} The time required to run one target strictly depend on the characteristics of the object, but usually it is between $15$ and $20$ minutes. When predicting possible imminent impacts, one of the most important requirements to fulfil is to minimize the number of unjustified alarms. We mark as non-significant cases the objects for which there are less than 3 observations or the arc length is less than 30 minutes (see also Sec.~\ref{sec:gaia}), unless there exists a nominal solution with a geodesic curvature SNR greater than 1. The classification of a case as non-significant does not mean we skip the computation: we anyway perform all the steps of the algorithm, and assign the score and the impact flag. Nevertheless, being non-significant automatically decreases the priority of the object in case of an alarm. Unfortunately, these techniques are not enough to remove all the spurious cases. They usually occur when the astrometry is either known to be erroneous or noisy, or anyway not reliable. We cannot solve this problem, and we acknowledge that the astrometric error models based on large number statistic are not enough to distinguish erroneous and accurate astrometry in a small sample (see comments in Section~\ref{sec:conclusions}). We test our algorithm on the two well known cases of NEAs that have impacted the Earth few hours after the discovery, namely $2008~TC_{3}$ and $2014~AA$. We have already pointed out that the choice of the weights is very important in these cases: to be able to compare the results with \cite{farnocchia2015}, we choose the same weights. Furthermore, we also select some cases among the objects that won't impact to also show the importance of the score computation. \subsection{Graphical representation of the results} \label{sec:results_graphical} We use plots showing the AR and its sampling to present our results. Hereinafter we describe the color code present in our figures. Concerning the AR, we make use of the following lines. \begin{itemize} \item The red solid line represents the level curve of the heliocentric energy equal to $-k^2/(2a_{max})$. Namely, it is the outer boundary of the AR, corresponding to the boundary of the region defined by condition~\ref{cond:solsis} in Section~\ref{sec:adm_reg}. \item The green dashed line shows where the geocentric energy is equal to $0$, also taking into account the condition about the radius of the Earth sphere of influence, as discussed in Section~\ref{sec:adm_reg} \item The magenta dashed line (which is parallel to the range-rate axis) represents the shooting star limit condition. \item The magenta solid lines (which are parallel to the range-rate axis) represent different values of the absolute magnitude. \end{itemize} We now provide a description of the colors used for the sampling points. No point is marked if the $4$-dimensional differential corrections does not converge, because the point does not belong to the MOV. \begin{itemize} \item The dots are blue if $\chi \le 2$, and green if $2<\chi\le5$. \item The dots are black if $\chi > 5$. \item In case a VI has been found, we mark with red circles the points representing possible impacting orbits. \item The orange star represents the point with the minimum $\chi^2$ value. \end{itemize} \subsection{Asteroid $2008~TC_{3}$} $2008~TC_{3}$ has been discovered by Richard A. Kowalski at the Catalina Sky Survey on October 7, 2008. The object was spotted 19 hours before the impact, and it is the first body to be observed and tracked prior to falling on the Earth. After the discovery, hundreds of astrometric observations were submitted to the Minor Planet Center (MPC) and these observations allowed the computation of the orbit and the prediction of the impact. We use the first tracklet composed by $4$ observations, and then the first two tracklets ($7$ observations) to ascertain whether we could predict the impact. We compute a uniform densified grid in $\log_{10}(\rho)$ (Fig.~\ref{fig:2008TC3_att}, top panel) where we consider only the first $4$ observations, while we are able to compute a reliable nominal orbit, and the consequent spider web using $7$ observations (Fig.~\ref{fig:2008TC3_att}, down panel). Table~\ref{tab:ip} shows that with $4$ observations and using the grid we are able to predict a possible impact of the object with the Earth with an impact probability of $\simeq 3.6\%$, and the score of the object to be classified as a NEA is $100\%$. This would have produced an alert for the observers that could have immediately followed-up the object. With $7$ observations we can confirm the certainty that the asteroid is a NEA (score $=100\%$), and the impact probability grows to $99.7\%$. \begin{figure}[t!] \hspace{-0.3cm} \subfloat{% \includegraphics[width=0.47\textwidth]{2008TC3_att_4obs.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.48\textwidth]{2008TC3_att_zoom.pdf}% }% \caption{Grid sample of the $(\rho,\dot{\rho})$ space for the first $4$ observations (top panel) and spider web for the first $7$ observations (down panel) of $2008~TC_3$.} \label{fig:2008TC3_att} \end{figure} \subsection{Asteroid $2014~AA$} $2014~AA$ has been discovered by Richard A. Kowalski at the Catalina Sky Survey on the new year's eve of $2014$. The object was discovered 21 hours before the impact, but it has not been followed-up as $2008~TC_3$ because of the exceptional night in which it has been spotted. We use first the first tracklet composed by $3$ observations, and then the whole set of $7$ observations to test whether we could have predicted the impact with our method. \begin{figure}[h!] \hspace{-0.3cm} \subfloat{% \includegraphics[width=0.47\textwidth]{2014AA_att_3obs.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.48\textwidth]{2014AA_att_zoom.pdf}% }% \caption{Grid sample of the $(\rho,\dot{\rho})$ space for the first $3$ observations (top panel) and spider web for the whole set of $7$ observations (down panel) of $2014~AA$.} \label{fig:2014AA_att} \end{figure} \begin{table}[h!] \begin{center} \caption{The table shows the results of the systematic ranging applied to $2008~TC_3$ and $2014~AA$. The columns contain the name of the object, the number of observations used, the time span covered by the observations, the characteristic of the sampling used to compute the MOV (grid or spider web), the score of the object (NEA, MBA or Distant), and the impact probability (IP).} \resizebox{\columnwidth}{!}{\begin{tabular}{l|c|c|c|rrr|r} \hline \multirow{2}*{\textbf{Name}} & \multirow{2}*{\textbf{$\#$ Obs.}} & \textbf{Time span}& \textbf{Sampling} & &\textbf{Score} & & \multirow{2}*{\textbf{IP}} \\ & & \textbf{(min)} & \textbf{Grid/Spider} & \textbf{NEO} &\textbf{MBO} & \textbf{DO} & \\ \hline $2008~TC_3$ & 4 & 43 & $\log_{10}(\rho)$ - grid & $100\%$ & 0 & 0 & $3.6\%$\\ $2008~TC_3$ & 7 & 99 & Spider & $100\%$ & 0 & 0 & $99.7\%$\\ $2014~AA$ & 3 & 28 & $\log_{10}(\rho)$ - grid & $100\%$ & 0 & 0 & $3.0\%$\\ $2014~AA$ & 7 & 28 & Spider & $100\%$ & 0 & 0 & $100.0\%$\\ \hline \end{tabular}} \label{tab:ip} \end{center} \end{table} These two examples have several analogies: we compute a uniform densified grid in $\log_{10}(\rho)$ with the first tracklet, that is only $3$ observations (Fig.~\ref{fig:2014AA_att}, top panel), and we are able to compute a reliable orbit and the consequent spider web only with $7$ observations (Fig.~\ref{fig:2014AA_att}, down panel). Table~\ref{tab:ip} shows that using the first tracklet only, we are able to predict a possible impact with the Earth with an impact probability of $\simeq 3.0\%$, and the NEA score of the object is $100\%$. Again, this would have produced an alert for the observers that could have immediately followed-up the object. As in the previous case, with the second tracklet we confirm both that the asteroid is a NEA (score $=100\%$) and the collision, since the impact probability grows up reaching the value of $100\%$. \subsection{Asteroid $2014~QF_{433}$} The previous examples show how the systematic ranging is capable of identifying imminent impactors. Although this is one of the most important applications of this technique, the systematic ranging is also essential in the first short arc orbit determination process. Asteroid $2014~QF_{433}$ has been discovered by F51 - Pan-STARRS 1, Haleakala on 2014 August 26. The first four observations have been posted on the NEO Confirmation Page, with the temporary designation TVPS7NV. It has been on the NEOCP until 2014 September 5. On that day (with 18 observations) it has been confirmed to be a distant object by the Minor Planet Center. \begin{figure}[t!] \hspace{-0.3cm} \subfloat{% \includegraphics[width=0.47\textwidth]{TVPS7NV_att.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.48\textwidth]{TVPS7NV_AR_zoom.pdf}% }% \caption{Grid sample of the $(\rho,\dot\rho)$ space for the first 4 observations of $2014~QF_{433}$ (top panel) and an enlargement of the second component (down panel). The black star in the second component represents the orbit of the object computed with all the available observations.} \label{fig:TVPS7NV} \end{figure} Figure~\ref{fig:TVPS7NV} shows the results of the systematic ranging on this asteroid, with the four discovery observations only, and 51 minutes of arc length. In this case the AR has two connected components, indicating the possibility for the object to be distant. The values of the three positive roots of equation of degree $6$ are $r_1=1.103$ au, $r_2=40.072$ au, and $r_3=59.786$ au. The attributable is \tiny \[ \mathcal A = (\alpha,\delta,\dot\alpha,\dot\delta)= (5.7358902, -0.3008327, -3.35275\cdot 10^{-4}, -9.94065\cdot 10^{-5}), \] \normalsize with $\alpha$ and $\delta$ in radians and $\dot\alpha$ and $\dot\delta$ in radians per day. The two plots in Figure~\ref{fig:TVPS7NV} clearly show that the object is distant, since almost all the grid points corresponding to the MOV lie in the second connected component. As a consequence, the cumulative score for the Distant and Scattered classes is $99\%$. As a further validation, we take the orbital elements of this asteroid from the AstDyS database\footnote{Asteroid Dynamics Site, available at \url{http://hamilton.dm.unipi.it/astdys/}}, and we compute the range and the range-rate at the epoch of the attributable. The result is shown in the down panel of Figure~\ref{fig:TVPS7NV}: the black star represents the orbit of $2014~QF_{433}$ computed with all the available observations, and it is in perfect agreement with the systematic ranging sampling. \subsection{Asteroid $2017~AE_{21}$} The case of $2017~AE_{21}$ shows the importance of the score computation. An object is worthy of attention and has to be followed-up even though it is not an impactor: for instance, it could be a potential NEA. Asteroid $2017~AE_{21}$ has been discovered by F51 - Pan-STARRS 1, Haleakala on 2017, January 3. It appeared on the NEOCP as a tracklet of 3 observations spanning 30 minutes, with the temporary designation P10yBuc. It has been confirmed to be a NEA on 2017 January 24, when it had 5 observations. With the first tracklet, our system produces an impact flag of 2, indicating a modest impact risk, with an impact probability $IP = 2\cdot 10^{-3}$. Moreover, the NEO score is $92\%$, encouraging some follow-up to confirm. The top panel of Figure~\ref{fig:P10yBuc} shows the result when using the first tracklet only. We do not have any reliable nominal orbit to use, and as a consequence we adopt the grid sampling. The portion of the grid corresponding to low $\chi$ values (blue points) is quite wide, indicating a great uncertainty in the orbit determination, and the uncertainty region contains also impacting solutions. With just two additional observations, the differential corrections still fail in computing a reliable nominal orbit, but now the good portion of the grid is located in a small subregion of the AR (see Figure~\ref{fig:P10yBuc}, down panel). In this case the uncertainty region does not contain impacting orbits, thus we get an impact flag of 0, with $IP = 0$, whereas the NEO score grows to $100\%$. As a consequence, the low probability VI has been contradicted by the new observation, but the follow-up suggestion coming from the high $98\%$ NEO score of the first run was reliable. \begin{figure}[t!] \hspace{-0.3cm} \subfloat{% \includegraphics[width=0.47\textwidth]{P10yBuc_3_att.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.48\textwidth]{P10yBuc_AR_zoom_5obs.pdf}% }% \caption{Grid sample of the $(\rho,\dot{\rho})$ space for the first $3$ observations (top panel) and for the whole set of $5$ observations (down panel) of $2017~AE_{21}$. In both cases we do not have any reliable nominal orbit to use, and as a consequence we adopt the grid sampling.} \label{fig:P10yBuc} \end{figure} \subsection{NEOCP object $P10vxCt$} As we stated in the introduction of this section, noisy astrometry can be the cause for unjustified alarms. In fact, if an object has a single tracklet of few observations and one of them is erroneous, the arc usually shows a significant curvature, implying that the object seems very close and fast moving. Most likely, it could be classified as an immediate impactor with very high impact probability. Object $P10vxCt$ has been spotted by F51 - Pan-STARRS, Haleakala on 2016 June 8. The first time it appeared on the NEOCP it had a tracklet with 3 observations spanning about 44 minutes (Table~\ref{tab:P10vxCt}, above). It has never been confirmed, but it is anyway an important example to show the risk posed by noisy astrometric data. With the first 3 observations, our system computes a nominal solution compatible with a very close orbit, resulting in a spider web sampling over a small subset of the AR (see Fig.~\ref{fig:P10vxCt}, top panel). A very large fraction of the MOV orbits are impacting solutions, and it results in an impact probability of 99.2\% and impact flag 4, considering the significance of the curvature. The second batch of observations consists of 4 positions: 3 of them are a remeasurement of the first tracklet obtained from the discovery images of the object, plus an additional observation. With this new astrometry, the impact has been ruled out and the object has been removed from the NEOCP. \begin{table}[t!] \begin{center} \caption{Astrometric data for NEOCP object $P10vxCt$. First tracklet with 3 observations (above), and remeasurement of the first tracklet from the discovery images (below).} \vspace{0.5cm} \resizebox{\columnwidth}{!}{\begin{tabular}{l c c c l} \hline \textbf{Date (UTC)} & $\alpha$ & $\delta$ & $R$ & \textbf{Code} \\ \hline 2016-06-08.29327 & 13 13 16.962 & $-20$ 25 56.90 & 21.0 & F51\\ 2016-06-08.30357 & 13 13 12.688 & $-20$ 28 31.36 & 20.9 & F51\\ 2016-06-08.32416 & 13 13 04.699 & $-20$ 33 46.35 & 21.0 & F51\\ \hline \end{tabular} \label{tab:P10vxCt} }\\ \vspace{0.5cm} \resizebox{\columnwidth}{!}{\begin{tabular}{l c c c l} \hline \textbf{Date (UTC)} & $\alpha$ & $\delta$ & $R$ & \textbf{Code} \\ \hline 2016-06-08.293273 & 13 13 16.963 & $-20$ 25 56.53 & 20.3 & F51\\ 2016-06-08.303571 & 13 13 12.856 & $-20$ 28 33.24 & 20.5 & F51\\ 2016-06-08.324159 & 13 13 04.683 & $-20$ 33 46.33 & 20.4 & F51\\ \hline \end{tabular}} \end{center} \end{table} \begin{figure}[t!] \subfloat{% \includegraphics[width=0.45\textwidth]{P10vxCt_3_zoom.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.44\textwidth]{P10vxCt_R_att.pdf}% }% \caption{Grid sample of the $(\rho,\dot{\rho})$ space for the first $3$ observations (top panel) and for their remeasurement (down panel) of $P10vxCt$.} \label{fig:P10vxCt} \end{figure} \begin{figure}[h] \centering \includegraphics[width=0.9\columnwidth]{P10vxCt_ra_dec.pdf} \caption{Plot of the two batches of observations reported in Table~\ref{tab:P10vxCt}, for NEOCP object $P10vxCt$. The red line represents the originally submitted tracklet, whereas the blue one the remeasured tracklet. The higher curvature of the first arc with respect to the second is clear.} \label{fig:curv_P10vxCt} \end{figure} To show the role of the remeasurements in the impact removal, we consider the 3 remeasured observations only (see Table~\ref{tab:P10vxCt}, below). The second observation in the first tracklet was badly determined, being off by about $3$ arcsec from the corresponding one in the second batch. The effect of this shift can be seen in the curvature parameters $\kappa$ (geodesic curvature) and $\dot\eta$ (acceleration). For the first tracklet we have \tiny \[ \kappa_1 = (0.0010073\pm 0.0001015)\quad\text{and}\quad \dot\eta_1 = (0.0003218\pm 0.0001013), \] \normalsize whereas for the remeasured tracklet \tiny \[ \kappa_2 = (0.0000649\pm 0.0006749)\quad\text{and}\quad \dot\eta_2 = (-0.0000430\pm 0.0006750), \] \normalsize both significantly lower than the first ones (see Fig.~\ref{fig:curv_P10vxCt} for a graphic representation of the two arcs). Moreover, as we can see from the curvature uncertainties, both curvature components are not significantly different from $0$. As a consequence, with the remeasured observations only, the impact solution is sharply downgraded: a nominal solution cannot be computed anymore, resulting in a grid sampling of the AR, and the impact orbits are a very small fraction of the MOV orbits (see Fig.~\ref{fig:P10vxCt}, right panel). Thus the impact probability lowers to about $IP = 7.5\cdot 10^{-5}$, with an impact flag of 1. Providing remeasured observations is not the only way to solve the problem caused by bad astrometry. The second observation is not as good as the other two, and let us suppose this information were provided along with the observation itself. In this case, we could have properly down-weighted the second observation to take into account the additional information, and the case would have been solved. To prove this claim, we assign a formal uncertainty of $3$ arcsec to both the right ascension and the declination of the second observation. With this choice, the impact solution still remain, but with an impact probability $IP=4.4\cdot 10^{-4}$. Until this additional metadata will be provided together with the observations, cases like the one presented here can be solved only by a manual intervention after all the computations (remeasurement) or by a fast follow-up (see Section~\ref{sec:conclusions} for general comments on this issue). \section{The ESA Gaia mission and short arc orbit determination} \label{sec:gaia} The ESA Gaia mission, currently surveying the sky from the Sun-Earth $L_2$ Lagrangian Point, is providing astrometry of stars and asteroids, at the sub-milliarcsec accuracy~\citep{prusti2012} down to magnitude $V=20.7$. The spin of the satellite is $6$ h, and it operates in a continuous scanning mode. It has two lines of sight, separated by an angle of $106.5^{\circ}$ in its scanning direction. The continuous mode of observation implies targets are not pointed at, but are rather passing in front of Gaia fields of view. Such crossings are called transits. Over $5$ years of nominal mission duration, the objects observed by Gaia will have a coverage of $80-100$ observations for an average direction ($60-70$ for the ecliptic~\citep{tanga2016}) Gaia focal plane is a large Giga-pixel array of 106 CCDs. The CCDs are organized as follows. \begin{itemize} \item The first two CCD strips are devoted to the source detection. This is the instrument called Sky Mapper (SM). \item The following 9 strips are astrometric CCDs (Astrometric Field, AF). \item Other CCD strips are devoted to low resolution spectro-photometry (red and blue photometry, RP/BP) and high resolution spectroscopy (RVS), which is not considered for asteroid studies. \end{itemize} Each Solar System Object (SSO) transit is composed, at most, by 10 astrometric observations (AF and SM instruments), distributed over 50 seconds. The Data Processing and Analysis Consortium (DPAC) has, as part of its activities, the source identification and further processing done on the ground. In this context, the Coordination Unit 4 (CU4) performs the analysis of objects deserving a specific treatment, as Solar System object (PI: P. Tanga). The DPAC CU4 has implemented two pipelines for Solar System processing ~\citep{tanga2007, mignard2007}: \begin{itemize} \item SSO-ST is the Solar System short-term processing, devoted to provide a first, approximate orbit for the recovery of objects potentially discovered by Gaia. A ground-based follow-up network (Gaia-FUN-SSO,~\cite{thuillot2016}) is currently operating, realizing follow-up observations of Gaia potential discoveries from the ground; \item SSO-LT is the Solar System long-term processing, which runs for the data releases, performing a more sophisticated data reduction with the best possible instrument calibration and astrometric solution. \end{itemize} \subsection{The short-term processing} \label{sec:Gaia_ST} The Solar System short-term processing is based on few transits of the object (at least $3$), covering a time span of few hours (at least six). At now, the astrometry for the alerts is based on a preliminary calibration, which is not the same used for the long-term processing. As a result, the error model required by these observations is not different from the one already used for the ground-based cases with the best astrometry. We uniformly weight ($0.1$ arcsec) both right ascension and declination. If the detected source is not successfully linked with a known solar system object, then it is potentially a discovery. It is thus crucial to predict a possible sample of orbits for the ground-based follow-up network to certify the discovery. In the framework of the CU4 data treatment, this is done by random-walk statistical ranging, which has been developed by \cite{muinonen2016}. This is the Java code which is currently producing the orbital data for Gaia alerts in the SSO-ST pipeline. We take the opportunity of the availability of the method presented in Sec.~\ref{sec:sampling} to validate independently the results of the SSO-ST pipeline. The impact probability computation, which is a key feature when we look for possible impactors, is not so essential when we have to deal with Gaia short-term observations. We expect indeed that among the objects that Gaia will discover, there will be a large fraction of Main Belt Asteroids, few Near Earth Asteroids, and it would be very surprising if it could discover even an imminent impactors~\citep{carry2014_gfs}. On the other side, the use of the double grid or of the cobweb is essential in this case. \subsection{Results} The same service presented in Section~\ref{sec:results} to scan the NEO Confirmation Page, has been ran on possible Gaia discoveries. The graphical representation of the results is identical to the one given in Section~\ref{sec:results_graphical}. We also use the same version of the OrbFit software cited in Sec.~\ref{sec:results}, adapted to deal with a different input given by Gaia observations. All the alerts are available at \url{https://gaiafunsso.imcce.fr/}, and hereinafter we present two particular objects, that at the time seemed to be possible Gaia discoveries, but then their observations have been linked to ground-based observations submitted earlier in time. The first object that could have been discovered by Gaia on 2016, December 29, is a Main Belt Asteroid. It has been identified as g0T015. It has four Gaia transits which cover a time span of $\simeq 16$ hours. We apply the systematic ranging (using the two grids) on the observations, and the results are summarized in Fig.~\ref{fig:g0T015_AR}. The object has been then followed-up by the Observatoire de Haute-Provence (OHP) for two consecutive nights (2017, January 3-4), and the observations have been reported to the Minor Planet Center. The object has been recognized as a Main Belt Object, and it obtained the provisional designation $2017~$AD$_{17}$. It could have been the first Gaia discovery, if it hasn't been linked to few observations from F51 Pan-STARSS submitted earlier (March 2014). \begin{figure}[t!] \subfloat{% \includegraphics[width=0.44\textwidth]{g0T015_AR.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.45\textwidth]{g0T015_AR_zoom.pdf}% }% \caption{Top panel: grid sample of the $(\rho,\dot{\rho})$ space for the Gaia object $g0T015$. Down panel: zoom of the second grid.} \label{fig:g0T015_AR} \end{figure} To be sure that the observed object was the same potentially discovered by Gaia, we consider as initial guess the elements corresponding to the point with the minimum value of $\chi^2$, and we perform an orbit determination process including the outlier rejection procedure~\citep{milani:orbdet}. \begin{center} \begin{figure}[h!] \includegraphics[width=\columnwidth]{g0T015_all_res.pdf} \caption{Residuals in right ascension and declination, in arcsec, obtained as a result of the orbit determination applied to the whole set of observations: Gaia (red points) and ground based (blue points) for the Gaia object $g0T015$ ($2017~$AD$_{17}$).} \label{fig:g0T015_res} \end{figure} \end{center} Figure~\ref{fig:g0T015_res} shows that follow-up observations from the OHP, and Gaia observations match together, according to the orbit selected as first guess. The residuals for the OHP (blue points) are way larger than the ones obtained from Gaia observations (red points), as expected. The weights used in this case are uniform in right ascension (RA) and declination (DEC), and correspond to $0.1$ arcsec. The result also shows a high correlation (close to 1) between RA and DEC, which is typical for Gaia observations due to its scanning law. The second Gaia object is $g1j0D7$, again a MBA. It has been observed by Gaia on 2017, September 2. It has $7$ transits, which cover a time span of $\sim 22$ hours. The object has follow-up observations from the Abastuman Observatory (MPC code $119$) the night between September 10 and September 11. It obtained the MPC preliminary designation $2017$~RW$_{16}$, but then it has been linked to the asteroid $2006$~UL$_189$ discovered by the Catalina Sky Survey on June 2005. Figure~\ref{fig:g1j0D7_AR} shows the result of the systematic ranging when we use only Gaia observations. Again, we choose the point with the minimum value of the $\chi^2$ as starting point, and we use it as preliminary point. We then perform a differential corrections least-squares fit, and we obtain the residuals (see Fig.~\ref{fig:g1j0D7_res}), as described in the previous case. \begin{figure}[t!] \hspace{-0.3cm} \subfloat{% \includegraphics[width=0.44\textwidth]{g1jD07_AR.pdf}% }% \hfill% \subfloat{% \includegraphics[width=0.45\textwidth]{g1jD07_AR_zoom.pdf}% }% \caption{Top panel: grid sample of the $(\rho,\dot{\rho})$ space for the Gaia object $g1j0D7$. Down panel: zoom of the second grid.} \label{fig:g1j0D7_AR} \end{figure} \begin{center} \begin{figure}[h!] \includegraphics[width=0.7\columnwidth]{g1j0D7_res.pdf} \caption{Residuals in right ascension and declination, in arcsec, obtained as a result of the orbit determination applied to the whole set of observations: Gaia (red points) and ground based (blue points) for the Gaia object $g1j0D7$.} \label{fig:g1j0D7_res} \end{figure} \end{center} \section{Future perspectives} Gaia alerts runs daily, and they need a large effort to collect follow-up observations from ground. With the method and the software described we have validated the already existing Java code written for the alert pipeline. Moreover, our approach can be also used to confirm the discoveries by computing an orbit using both Gaia and ground-based observations. Then, when the accuracy for the short term will improve, we will also be able to run the systematic ranging on less than three transits, given the correct error model to the observations. Here it is worth noting that the concept of short arc strongly depends on the concept of curvature (see Sections~\ref{sec:cobweb} and \ref{sec:results}), which is related not only to the time interval, but also to the accuracy of the observations themselves. The score computation represents a key feature in the Gaia frame (as already pointed out in Sec.~\ref{sec:Gaia_ST}), but it will also be very useful in future applications, like the ESA Euclid mission. Euclid is an ESA mission with the aim of mapping the geometry of the dark universe down to V$_{AB}$=24.5, with a launch scheduled for 2020. While conducting its primary goal survey, Euclid will also observe asteroids during his whole lifetime, and a Solar System Working Group has been created within the Euclid consortium. Euclid will observe at solar elongation $\sim 91^{\circ}$, and each SSO will be imaged $16$ times (more precisely, $95\%$ of them $12$ times, and $50-60 \%$ of them $16$ times) over $67$ minutes~\citep{carry_euclid}. With a Hubble-like angular resolution, astrometry will be quite good, at least at the same level of the best observatories on ground (like Mauna Kea), or as the short term accuracy of the Gaia alerts as it is now. The estimate accuracy is around $100$ mas. While the southern sky will be repeatedly covered to the same depth by LSST~\citep{lsst}, only Euclid will systematically cover high declinations, with a strong potential for discoveries. For each, having the score will be crucial to select the asteroid for which trigger or not follow-up observations. \section{Conclusions} \label{sec:conclusions} One of the main issue in the impact hazard assessment for imminent impactors is given by the computation of the impact probability. The main results of this article are a new algorithm to propagate the probability density function from the space of the astrometric residuals to the Manifold Of Variation, a geometric device to sample the set of possible orbits, available even after a very short observed arc. In previous works, this computation was supported with an a priori number density of asteroids. Our computation is complete, rigorous, and uses no a priori hypothesis. Does this new algorithm solve the problem of assessing the risk of imminent impacts from a freshly discovered asteroid, with observations limited to 1--2 tracklets? By using the AR and one of our grid sampling, we have shown how to approximate a probability integral on the portion of the MOV leading to an imminent impact, if it is found. However, to accept this integral as Impact Probability we need to check three conditions. First, the probability density on the space of residuals needs to be based upon a probabilistic model of the astrometric errors, taking into account the past performances of the observatories. Second, the observations used in the computation must be ``typical'' of the observatory: even the best astronomical program produces a comparatively small subset of ``faulty'' observations, with errors much larger than the usual ones. Third, we should assume that the small sample of observations has statistical properties, such as mean and standard deviation (STD), close to the ones of the full distribution. The first hypothesis is reasonable, in that a lot of work has been developed in the last 20 years to produce astrometric error models for asteroid observations (see \cite{carpino:outrej}, \cite{cbm10}, \cite{baer:err_mod}, \cite{farnocchia:fcct}). These models are not perfect, but they represent an increasingly reliable source of statistical information. The second hypothesis is not trivial: the current format for asteroid observations does not contain sufficient metadata to discriminate the ``weak observations'' from the good ones. The full adoption of the new Astrometric Data Exchange Standard (ADES\footnote{It is available at \url{http://minorplanetcenter.net/iau/info/IAU2015_ADES.pdf}.}), approved by the IAU in 2015, will provide information such as SNR, timing uncertainty, and so on, allowing to adapt the weighting of the individual observations. The example of $P10vxCt$ shows how just one lower quality observation can completely spoil the orbit results, generating a false impact alarm. This can be avoided either with remeasuring by the observer or by the orbit computer, provided such down-weighting is supported by the metadata. The third hypothesis is the most troublesome. Assuming that the probability density of an astrometric error model is a perfect statistical description, then by the law of large numbers a large enough sample of $N$ observations shall have approximately the same statistical properties of the model, with the differences going to zero for $N\to +\infty$ (law of large numbers). Unfortunately, $N=3,\ 4,\ 5$ is not large enough for the law of large numbers to apply. For instance, a tracklet with $N=3$ observations can have all the observations in one coordinate with errors $>2.5$ STD: this statistical fluke would be very rare, occurring in a little more than $1$ tracklet over $1$ million. Still, if a large asteroid survey submits to the MPC more than one million tracklets per year, such a fluke may occur about once a year, whereas the discovery of imminent impactors is currently more rare (2 in 10 years). Detection of a rare astronomical event cannot be a priori discriminated from rare statistical events. The tests on real cases discussed in this paper, and many more from the NEOCP, convinced us that our algorithm computes a reliable impact probability when the impact actually occurs. Nevertheless, we cannot show that our algorithm is immune from ``false'' alarms. They are not false in the sense of a wrong computation, or even worse a malicious disinformation, they are statistical flukes which cannot be avoided because of lack of information (hypothesis~2) and the need to use statistics on a small sample (hypothesis~3). The question is what should be done to mitigate the damage by these false alarms, given that we cannot avoid disseminating them: otherwise, how could we disseminate the alarm in the true case? The only answer is to have a follow-up chain which does not waste resources: the discoverers could themselves either remeasure or follow-up on the short term, like 1 hour after discovery, the cases announced as possible impactors. Other telescopes should be available to perform follow-up, to avoid improper use of survey telescopes for a less demanding task. The ideal solution should be the availability of a \textit{Wide Survey}, capable of covering the entire dark sky every night and of detecting, e.g., an asteroid with absolute magnitude $H=28$ at $0.03$ au distance (near opposition). Then the same asteroid would be recovered by the survey the next day, before the impact, and without the need for auxiliary follow-up. \section*{acknowledgements} This work has made use of data from the European Space Agency (ESA) mission Gaia (\url{http://www.cosmos.esa.int/gaia}), processed by the Gaia Data Processing and Analysis Consortium (DPAC, \url{http://www.cosmos.esa.int/web/gaia/dpac/consortium}). Funding for the DPAC has been provided by national institutions, in particular the institutions participating in the Gaia Multilateral Agreement. Part of this work is based on observations made at Observatoire de Haute Provence (CNRS), France. The authors would also like to acknowledge all the observers involved in the detection of the asteroids discovered by Gaia: for g0T015 they are E.~Saquet, M.~Dennefeld, D.~Gravallon, and for g1j0D7 they are R.~Y.~Inasaridze, V.~Ayvazian, T.~Mdzinarishvili, Y.~Krugly. F.~Spoto acknowledges support by the CNES post--doctoral program, and A.~Del Vigna acknowledges support by the company SpaceDyS.
\section{Introduction} A Fixed Field Alternating Gradient (FFAG) accelerator is a concept that was invented in the 1950s almost independently in the US, Japan and Russia \cite{symon}\cite{kolomensky}. Several electron machines were built in the US. However, it was not until the 1990s that the interest for FFAGs was revived in Japan. One main feature of FFAG and cyclotrons is that they both use fixed field combined function magnets in order to achieve a stable particle motion in the accelerator. Therefore, for heavy ion therapy accelerators requiring energies up to several 100 MeV/nucleon, they are the most viable option for a compact design that fits best into a hospital environment. In addition, with the recent advances in the superconducting magnet technology, the latter has become canonical for many applications. An FFAG accelerator has more design flexibility compared to other types of fixed field accelerators. Unlike cyclotrons where the main target is to achieve isochronism for all energies, the magnetic field of an FFAG can obey any radial or azimuthal dependence. Thus, with the worldwide interest many FFAG designs emerged tailored to areas ranging from industrial processes to medical \cite{misu}\cite{garland}\cite{sam}\cite{peach} and fundamental research \cite{machida1} \cite{berg} \cite{first_injection}. In the early days, almost all designs were based on highly symmetric rings to reduce the operating restrictions that may arise with systematic field errors. However, recently, several racetrack concepts were proposed \cite{carol}\cite{RCMS}. This is generally considered as a solution to practical issues such as the construction cost, the injection and extraction problem, as well as to accommodate and simplify the design of the RF cavity. Although recently built FFAGs demonstrated the concept, several problems remain. In \cite{malek2017} it is shown that small gradient field errors in a ring FFAG accelerator lead to a non-scaling of the orbits. The latter contributes to the change of the average horizontal restoring force as well as to the magnetic flutter and induces a variation of the betatron wave number leading to the crossing of transverse resonances during the acceleration cycle. For instance, a gradient field error of the order of $5\%$ yields a variation of the betatron wave number of the order of $7\%$ leading to the losses of the majority of the beam \cite{suzie_charac}. This is mainly due to the large fringing field caused by the yoke free magnets \cite{ishi_private} and to the slow acceleration, i.e. to the low energy gain per turn. The main challenge with optics correction in fixed field accelerators is that the beam moves outward radially during the acceleration. Therefore, a correction scheme should be implemented along the radius of the magnet to produce the desired field profile and is practically expensive and difficult to implement since it modifies simultaneously the bending as well as the focusing of the beam in both the horizontal and vertical plane. In addition, other errors may contribute as well to the beam losses such as misalignment errors. This letter shows that a racetrack FFAG configuration can achieve a fixed tune even in presence of field and alignment errors and thus overcome resonance crossings problem. The method is based on creating dispersion free straight sections where a time varying alternating gradient focusing structure is placed. The merit of this approach is that the time varying field structure can be programmed in a way to maximize the overall beam transmission of the built machine. The idea of creating a dispersion-free long insertion in an FFAG was first discussed by Meads in 1983 \cite{meads}. However, the design was not optimized and focused on using scaling FFAG type magnets to achieve a fixed tune machine. In addition, the sensitivity to misalignments as well as the correction of the optics were not discussed. The design discussed in this paper is greatly simplified with the use of both scaling and non-scaling type of magnets to create a racetrack and compact microtron-like configuration. As illustrated in Fig. \ref{racetrack}, a configuration with 4 identical radial sector magnets (m1) is privileged since it provides enough space between the magnets to place injection/extraction devices as well as other elements discussed below. In order to have the most compact design, no reverse bend is considered. Even though cyclotrons are the natural choice for high intensity applications due to their cw operation, the turn separation for outer orbits becomes small when the beam becomes more relativistic, thus posing a serious beam extraction issue. In general, it is considerated that 1 GeV is the energy limit for cyclotrons which justifies the development of synchrotron accelerators for heavy ion therapy requiring energies up to 450 MeV/nucleon. In this study, one privileges a different class of accelerator, an FFAG since the fixed field operation allows high repetition rate and eases the problem of extracting the beam. However, one main objective of medical heavy ion accelerators is to target tumors of various depths therefore requiring to tune the beam energy. This is particularly challenging with fixed field accelerators since the beam orbit moves radially outwards during the acceleration. For this reason, it is common to use a beam degrader instead. This reduces the energy of the output beam but also reduces its quality due to multiple scattering. Thus, activation due to beam losses is an issue that requires more shielding of the accelerator. Besides, the beam intensity becomes strongly dependent on the beam energy which complicates the heavy ion treatment \cite{schippers} and justifies once again the wide use of synchrotrons for this application. In order to remediate this problem and extract the beam at various energies, the idea is to transform the circular conventional FFAG into a racetrack configuration by replacing the 4-fold symmetry with a 2-fold symmetry machine: the main idea is to add a second magnet (m2) for each sector and optimize its field profile in order for the pair (m1+m2) to create a 90 degree bending angle for all energies. This is achieved using the beam dynamics tracking code ZGOUBI \cite{zgoubi}: a fitting method is employed which consists in tracking particles with different momenta and the same initial coordinates (point A in figure. \ref{racetrack}) to the screen where their final coordinates are recorded. The field along the radius of magnet (m2) is adjusted until all particles exit perpendicular to the screen. Once this is achieved, the ring is completed by creating mirror symmetries with respect to the screen and to the line passing by point A and perpendicular to the screen. A microtron-like racetrack FFAG configuration with dispersion-free straight sections is thus achieved. The advantages of the dispersion-free sections are numerous: first one can place a stripping foil at that location. Since the lattice is designed for a specific charge to mass ratio (in this case $q/A = 1/2$), in order to produce protons, one can inject $H2+$ ions instead, accelerate them to an intermediate energy and strip them into protons at the location of the straights. Since all heavy ions leaving the straight sections are on stable orbits, they can be accelerated again to the top energy corresponding to the top magnetic rigidity. In addition, the straight section can be used to dump the beam after tripping during the acceleration which helps reduce the activation of the accelerator components. This is a common problem for cyclotrons for instance. Furthermore, tight space for the RF cavity causes coupling with the leakage field of the main lattice magnets leading to closed orbit distortion issues \cite{cod}. The field profile for each magnet writes as a separable function in radial and azimuthal coordinates in the following way: $B(R,\theta)=\mathcal{R}(R)F(\theta)$ where $B$ is the vertical component of the magnetic field in the median plane, $R$ is the radial coordinate with respect to the center of the ring and $\theta$ is the azimuthal coordinate. The fringe field falloff of the magnets is represented by the Enge \mbox{model \cite{enge}.} For magnet (m1), the radial field profile obeys the law of a scaling FFAG, i.e. $\mathcal{R}(R)=B_0 (R/R_0)^k$ where $k$ is the average field index of the magnet and $B_0$ is the field at $R=R_0$. This guarantees a large transverse dynamic acceptance. \begin{figure}[htb] \centering \includegraphics*[width=9cm]{racetrack_FFAG.pdf} \caption{Vertical component of the magnetic field in the median plane of the accelerator with some of the closed orbits between injection and extraction energies (shown in dashed black curves). QF and QD refer to the focusing and defocusing trim quadrupoles respectively.} \label{racetrack} \end{figure} The first optimization step is to adjust the edge angle as well as the average field index $k$ of (m1) in order to ensure enough strong focusing and avoid the crossing of integer and half integer resonances. The main idea is that the bare lattice, i.e. without any added time-varying element, be stable in order to characterize its beam optics and to mitigate the associated risks as part of the construction process. The parameters of the test lattice are listed in \mbox{Table \ref{tab:table1}.} Note that only the exit edge angle of (m1) is optimized since it has the largest impact on reducing the tune excursion mainly in the vertical plane. \begin{table} \caption{\label{tab:table1}Main parameters of the test lattice.} \begin{ruledtabular} \begin{tabular}{lcr} Parameter&Value&Unit\\ \hline Charge to mass ratio & 1/2 & -\\ Circumference & 15 & m\\ Length of field-free straight section & 1 & m\\ Field index $k$ of m1 & 0.75 & - \\ Injection/extraction kinetic energy & 12/75 & MeV/nucleon\\ Maximum field & 8 & T \\ \end{tabular} \end{ruledtabular} \end{table} In summary, the transverse tunes of the optimized lattice are shown in Fig. \ref{tune} in red where one can see that the integer and half integer resonances are avoided. Next, one aims at reducing the tune excursion in order to avoid the crossing of any type of resonance, up to the 3rd order, known to be detrimental to the beam. For this, one constructs the one turn transfer map of the bare lattice. This is achieved by tracking particles with small displacements from each closed orbit, i.e. each different particle energy. Then, one adds the trim quadrupoles QF and QD in a way that maintains the 2-fold symmetry of the accelerator as shown in Fig. \ref{racetrack}. This is of particular importance in order not to increase the number of betatron resonances that may be driven. The transfer map of the time-varying lattice is thus re-calculated using a MATHEMATICA code and the gradients of the trim quadrupoles are determined for each particle energy in order to match the tunes of a chosen working point. The solution obtained is finally implemented in the tracking code ZGOUBI by adding the time-varying elements to the bare lattice. The results of the tune calculation from the accelerated orbit is shown in green in Fig. \ref{tune} where one proved that the resonance crossing problem is overcome. In summary, the time varying field of the trim quadrupoles compensates for the monotonic behavior of the tunes in the bare lattice. For instance, increasing simultaneously the gradients of QF and QD allows to increase both horizontal and vertical tunes. This applies to any bare lattice in the presence of field or misalignment errors of its main magnets. In addition, the working point of the lattice can be optimized in a way to heuristically maximize the overall beam transmission. This is of utmost importance for the study of the resonance crossing problem in fixed field accelerators. The main challenge for the implementation of such a method is to achieve the ramping rate of the trim quadrupoles. However, the technological challenge can be reduced by increasing the total length of the elements, therefore increasing the length of the straight sections. Witte and Berg already propsoed adequate design for rapid cycling quadrupole magnets \cite{holger}. \begin{figure}[htb] \centering \includegraphics*[width=7cm]{Tune_diagram.pdf} \caption{Betatron tunes from 12 to 75 MeV/nucleon (right to left). The solid lines in black show the resonance lines up to the 3rd order.} \label{tune} \end{figure} Next, one evaluates the Dynamic Aperture (DA) of the accelerator in presence of misalignment errors. The DA is defined here as the maximum initial horizontal normalized amplitude that the particle can have without any losses due to single particle dynamics effects over 30000 turns of the entire acceleration cycle. This is a fundamental criterion in order to determine the tolerance of the lattice to imperfections. Each of the 12 magnets is transversely (horizontally and vertically) offset randomly using a Gaussian distribution with a standard deviation $\sigma$ and a cutoff at $3\sigma$. For each error, 100 different patterns are tested and an initial normalized vertical displacement at 20 mm.mrad is chosen. The effect of the misalignment on the DA is shown in Fig. \ref{da} where one can see that with reasonable alignment errors ($\sigma \approx 100 \mu m$) the DA is essentially unchanged. However, the DA of the lattice with trim quadrupoles is almost 3 times larger than the DA of the bare lattice. This is mainly due to the third integer resonance crossing problem with the bare lattice, i.e. $Q_x=1/3$. As expected the lattice with the optimized working point has the largest DA. \begin{figure}[htb] \centering \includegraphics*[width=8cm]{Misalign.pdf} \caption{The DA as a function of the horizontal and vertical cell misalignment errors with a Gaussian distribution of \mbox{width $\sigma$.}} \label{da} \end{figure} Since one of the main objectives of this design is to achieve a variable energy extraction, one decided to calculate the maximum deviation of the accelerated orbit from the ideal one at the location of the extraction device during the entire acceleration cycle and in presence of misalignment errors as described above. In general, the maximum is reached near the injection cycle due to the adiabatic damping of the amplitude of particle oscillations with the momentum. The accelerated maximum rms orbit distortion for various misalignment errors is shown in Fig. \ref{cod}. \begin{figure}[htb] \centering \includegraphics*[width=8cm]{COD.pdf} \caption{The horizontal and vertical RMS accelerated orbit distortion with various misalignment errors: the solid lines show the minimum chi-squared fit to the data while the dashed lines show the RMS value of the maximum orbit distortion. The mean amplification factors for the orbit distortion (obtained from the fitted data) in the horizontal and vertical planes are 7.5 and 18.7 respectively.} \label{cod} \end{figure} It can be seen that the vertical plane is the limiting problem for the variable energy extraction. However, this is still acceptable with a reasonable alignment error of the order of $\sigma \approx 100 \mu m$ corresponding to a maximum average orbit distortion of 1.8 mm. In this paper, a novel concept of compact racetrack FFAG accelerator with dispersion free straight sections was proposed. It was shown that this is of particular interest for a heavy ion accelerator with variable energy extraction and enables dual acceleration of carbon ions as well as protons through stripping. In addition, one demonstrated for the first time that it is possible to overcome the problem of resonance crossings by timely-varying the field of the trim quadrupoles during the acceleration cycle. This is of particular interest for high intensity applications and is a step further towards designing a tunable FFAG accelerator with minimum beam losses. The study of the dynamics of this concept were investigated In addition, the sensitivity to random misalignment errors of the magnets was explored and it was found that the mean DA is almost insensitive to the alignment error.
\section{Introduction} The uncertainties on the measurements for the cosmic abundances of the lightest elements have improved considerably in the last decades, posing stringent constraints on the thermal history of the very early Universe. The observed abundances of protium, deuterium, ${}^3$He, ${}^4$He and Lithium, besides well agreeing with the predictions of the standard Big Bang Nucleosynthesis~\cite{Wagoner:1972jh}, allow to deduce the value of the baryon to photon ratio today, \begin{equation} \eta_B\equiv\dfrac{N_B-N_{\bar{B}}}{N_\gamma}\,, \end{equation} where $N_{B,\bar{B},\gamma}$ are the number densities of baryons, anti-baryons and photons, respectively. An independent determination of $\eta_B$ is provided by the CMB measurements ~\cite{Ade:2015xua} that agrees with the value extracted from the lightest element abundances: \begin{equation} \eta_B=(6.11 \pm 0.04) \times 10^{-10}\,. \label{ExpBAU} \end{equation} Despite being so tiny, this non-vanishing value poses one of the most relevant unsolved questions in particle physics and cosmology today: why are there more baryons than anti-baryons in the present Universe? In 1967, Sakharov first suggested that the baryon asymmetry of the Universe (BAU) might not represent some sort of initial condition, but could be understood in terms of microphysical laws that fulfil the following three conditions~\cite{Sakharov:1967dj}: \begin{itemize} \item[-] Baryon number violation \item[-] C and CP violation \item[-] Departure from Thermal Equilibrium. \end{itemize} Although Standard Model (SM) interactions satisfy all these three requirements, there is not enough CP violation to produce the measured value of BAU~\cite{Jarlskog:1985ht,Kuzmin:1985mm}. Several alternative mechanisms have been proposed, typically extending the SM spectrum and/or its symmetries: GUT Baryogenesis, Electroweak (EW) Baryogenesis, the Affleck-Dine mechanism, Leptogenesis. The latter will be the focus in this paper as Baryogenesis through Leptogenesis~\cite{Fukugita:1986hr} (see Refs.~\cite{Dev:2017trv,Drewes:2017zyw,Dev:2017wwc,Biondini:2017rpb,Chun:2017spz,Hagedorn:2017wjy} for update reviews on the subject), besides being promising in a large part of the associated parameter space, represents a framework where also other open problems of the SM of particle physics may find a solution: on the one hand the origin of neutrino masses and on the other hand the Flavour problem. The small, but non-vanishing, masses of the light active neutrinos represent an experimental evidence of the incompleteness of the SM. The introduction of right-handed (RH) neutrinos {\it \`a la} type I Seesaw mechanism~\cite{Minkowski:1977sc,GellMann:1980vs,Yanagida:1980xy,Schechter:1980gr,Mohapatra:1980yp} is an elegant approach that explains the smallness of the active neutrino masses through the largeness of the masses of their RH counterparts. This mechanism provides the ingredients to explain the present amount of BAU: there is a leptonic source of CP violation and a source of Lepton number violation; RH neutrino decays may occur out-of-equilibrium, when the temperature drops below their masses. In consequence, out-of-equilibrium decays of the RH neutrinos might produce a lepton asymmetry that is then partially converted into BAU through non-perturbative sphaleron effects~\cite{Buchmuller:2005eh}: in the SM context, \begin{equation} B=-\dfrac{c_s}{1-c_s}L\qquad\text{with}\qquad c_s\equiv\dfrac{8N_F+4}{22N_F+13}<1\,, \label{cs} \end{equation} with $N_F$ the number of flavour species considered. It follows that the more anti-leptons are produced, the more baryons are generated, with a rate that is approximately close to $1/3$. The basic quantity in Leptogenesis is the parameter $\varepsilon$ that measures the amount of CP asymmetry generated in the decays of the RH neutrinos $\nu_R$~\cite{Fukugita:1986hr}: indicating with $\Gamma$ and $\bar\Gamma$ the decay rates of $\nu_R$ into leptons and antileptons respectively, \begin{equation} \begin{aligned} \Gamma_{a\alpha}&\equiv \Gamma\left(\nu_{Ra}\to\ell_{L\alpha}\phi^*\right)\\ \bar\Gamma_{a\alpha}&\equiv \Gamma\left(\nu_{Ra}\to\bar\ell_{L\alpha}\phi\right)\,, \end{aligned} \end{equation} where $\ell_L$, and $\phi$ stand for the $SU(2)_L$-doublet left-handed (LH) leptons and the $SU(2)_L$-doublet Higgs field, the CP asymmetry parameter is given by \begin{equation} \varepsilon^{(a)}\equiv\dfrac{\sum_\alpha\Gamma_{a\alpha}-\bar{\Gamma}_{a\alpha}}{\sum_\alpha\Gamma_{a\alpha}+\bar{\Gamma}_{a\alpha}}\,, \end{equation} with $\alpha$ ($a$) the flavour (RH neutrino mass) index. The analytic expression of the CP parameter $\varepsilon$ depends on the product $\lambda^\dag \lambda$, with $\lambda$ the Dirac neutrino Yukawa coupling in the mass basis for the RH neutrinos and for the charged leptons. In the convention where the active neutrino mass term is defined by \begin{equation} -\mathscr{L}\supset \dfrac{1}{2}\bar{\nu}_L^c\,m_\nu\,\nu_L+\text{h.c.}\,, \end{equation} where the mass matrix is diagonalised by the PMNS matrix $U$ according to \begin{equation} \hat{m}_\nu=U^T\,m_\nu\,U\,, \end{equation} (the ``$\string^$'' symbol is adopted here and in the following to refer to diagonal matrices), $\lambda$ is a matrix in flavour space that can be written in the Casas-Ibarra parametrisation as follows~\cite{Casas:2001sr}: \begin{equation} \lambda=\dfrac{\sqrt{2}}{v}U\hat{m}_\nu^{1/2}R\hat{M}^{1/2}\,, \label{lambdanuhat} \end{equation} where $v=246\;\text{GeV}$ is the EW vacuum expectation value (VEV), $R$ a complex orthogonal matrix, and $\hat{M}$ the diagonal mass matrix of the RH neutrinos. This expression depends on 9 low-energy parameters, i.e. 3 active neutrino masses, 3 mixing angles, 1 CP violating Dirac phase and 2 CP violating Majorana phases, and on 9 high-energy ones, corresponding to the 3 RH neutrino masses and the 6 parameters of the matrix $R$. The latter is typically independent from the low-energy quantities and its parameters are arbitrary. In general, this prevents to uniquely determine the parameter $\varepsilon$ in terms of low-energy observables and the RH neutrino masses. The use of flavour symmetries helps improving the predictivity in this scenario: as a flavour symmetry rules the interactions among the different fermion generations, the $R$ matrix might be (partially) fixed, allowing to predict the value of $\varepsilon$ (almost) just in function of neutrino masses, mixings and phases. Some examples can be found in Refs.~\cite{Branco:2001pq,Branco:2002kt,Pascoli:2006ie,Mohapatra:2006se,Pascoli:2006ci,Engelhard:2007kf, Molinaro:2007uv,Molinaro:2008rg,Jenkins:2008rb,Bertuzzo:2009im,AristizabalSierra:2009ex,Deppisch:2010fr} (see also Refs.~\cite{Hernandez:2015wna,Hernandez:2016kel} for predictive scenario not involving flavour symmetries). The aim of the present paper is to investigate on a specific scenario where a continuous non-Abelian group is implemented in the Lagrangian as a global flavour symmetry, providing an exceptionally predictive framework for both Leptogenesis and low-energy observables. The symmetry under consideration is the one of the so-called Minimal Flavour Violation (MFV) in the lepton sector (MLFV), considering the type I Seesaw mechanism with three RH neutrinos. The MFV ansatz~\cite{Chivukula:1987py} consists in assuming that any source of flavour and CP violation in any theory Beyond the SM (BSM) is the one in the SM, i.e. the Yukawa couplings. This concept has been technically formulated in terms of the flavour symmetry of the fermion kinetic terms of a given Lagrangian~\cite{DAmbrosio:2002vsn}: the flavour group is a product of a $U(3)$ factor for each fermion in the spectrum, and it is $U(3)^6$~\cite{Cirigliano:2005ck,Cirigliano:2006su,Davidson:2006bd,Gavela:2009cd,Alonso:2011jd} for the type I Seesaw mechanism with 3 RH neutrinos. The Yukawa interactions are the only terms of the renormalisable Lagrangian that are not invariant under the flavour symmetry, unless the Yukawa couplings are promoted to be fields, dubbed spurions, transforming non-trivially under $U(3)^6$. In the original proposal~\cite{DAmbrosio:2002vsn}, the Yukawa spurions are dimensionless, non-dynamical fields that acquire background values (they could be interpreted as VEVs if the spurions were promoted to be dynamical fields~\cite{Alonso:2011yg,Alonso:2012fy,Alonso:2013mca,Alonso:2013nca}), breaking explicitly the flavour symmetry, and reproducing the measured values of fermion masses and PMNS angles and phases. In the quark sector, any non-renormalisable operator containing fermion fields is, eventually, made invariant under the flavour symmetry by the insertion of suitable powers of the Yukawa spurions. Once the latter acquire their background values, the strength of the effects induced by such effective operators is suppressed by specific combinations of quark masses, mixing angles and CP violating phase. In consequence, the cut-off scale that suppresses any non-renormalisable operator can be of the order of a few TeV~\cite{DAmbrosio:2002vsn,Grinstein:2006cg,Hurth:2008jc,Kagan:2009bn,Grinstein:2010ve,Feldmann:2010yp,Guadagnoli:2011id,Buras:2011zb,Buras:2011wi,Alonso:2012jc,Isidori:2012ts,Lopez-Honorez:2013wla,Bishara:2015mha,Lee:2015qra,Arias-Aragon:2017eww}, instead of hundreds of TeV as in the generic case~\cite{Isidori:2010kg}. In the lepton sector, with the addition of three RH neutrinos, the predictive power of the MLFV is lost in the most generic case. Indeed, three quantities, and not only two as in the quark case, need to be promoted to spurions, i.e. the charged lepton Yukawa, the neutrino Dirac Yukawa and the RH neutrino Majorana mass matrices. A simple parameter counting reveals that it is not possible to uniquely determine the three spurion backgrounds in terms of lepton masses and PMNS parameters. This prevents to link the coefficients of flavour changing operators with low-energy quantities, with the consequent loss of predictivity. A way out is to reduce the symmetry content: in Refs.~\cite{Cirigliano:2005ck,Davidson:2006bd} the non-Abelian part of the $U(3)$ symmetry associated to the RH neutrinos was substituted for a simpler $SO(3)$ plus the hypothesis of CP conservation; in Ref.~\cite{Alonso:2011jd}, instead, it was identified with the one of the lepton $SU(2)_L$ doublets, thus considering a vectorial $SU(3)_V$ flavour symmetry. Both approaches allow to reduce the number of spurions to two, restoring the predictivity of the models: the effects of any flavour changing effective operator can be described in terms of lepton masses and PMNS parameters~\cite{Cirigliano:2005ck,Cirigliano:2006su,Davidson:2006bd,Gavela:2009cd,Alonso:2011jd,Feldmann:2016hvo,Alonso:2016onw}. An updated phenomenological analysis of these two different MLFV realisations has been recently presented in Ref.~\cite{Dinh:2017smk}. A fundamental distinction between them is that the CP conservation hypothesis of the $SO(3)\times\text{CP}$ version is disfavoured by the recent indication of a CP non-conserving Dirac phase in the PNMS matrix~\cite{Forero:2014bxa,Blennow:2014sja,Capozzi:2013csa,Capozzi:2016rtj,Esteban:2016qun,Capozzi:2017ipn,deSalas:2017kay}. Leptogenesis in the MLFV context has already been investigated in Ref.~\cite{Cirigliano:2006nu} (see also Refs.~\cite{Branco:2006hz,Uhlig:2006xf,Cirigliano:2007hb,Pilaftsis:2015bja}), considering the $SO(3)\times\text{CP}$ version: in order to guarantee a leptonic source of CP violation necessary to explain the measured BAU, the CP conservation hypothesis has been relaxed; in consequence, the precise prediction of flavour effects at low-energy in terms of lepton masses, mixing and phases has been lost. The aim of this paper is to investigate Leptogenesis in the $SU(3)_{V}$ MLFV version introduced in Ref.~\cite{Alonso:2011jd}, where no additional hypothesis on CP is made and the present indication for the Dirac CP phase of the PMNS can be fulfilled. The rest of the paper is structured as follows. The $SU(3)_V$ MLFV scenario under consideration is described in Sect~\ref{Sect:MLFV}. The Leptogenesis CP asymmetry parameter $\varepsilon$ and the Boltzmann equations are discussed in Sect.~\ref{Sect:Lepto}. The numerical results are presented in Sect.~\ref{Sect:NumAna}, showing that a correct value for the BAU is achieved only in a part of the allowed parameter space, testable with (non-)observation of the neutrinoless double beta decay. Concluding remarks can be found in Sect.~\ref{Sect:Conc}. \boldmath \section{The Minimal Lepton Flavour Violation with Vectorial $SU(3)_V$} \label{Sect:MLFV} \unboldmath The use of flavour symmetries to explain the flavour puzzle in the SM goes back to 1978, when Froggatt and Nielsen~\cite{Froggatt:1978nt} first introduced a single $U(1)$ factor to describe the quark mass hierarchies and the CKM mixing matrix. Subsequent analyses also included the lepton sector~\cite{Altarelli:2000fu,Altarelli:2002sg,Chankowski:2005qp,Buchmuller:2011tm,Altarelli:2012ia,Bergstrom:2014owa}, where however a larger freedom is present due to the lack of knowledge of some neutrino parameters. At the beginning of this century, the use of flavour discrete symmetries became very popular due to the high predictive power in the lepton sector of this kind of models~\cite{Ma:2001dn,Babu:2002dz,Altarelli:2005yp,Altarelli:2005yx}. These constructions have been later extended to the quark sector, attempting to provide a unified explanation of the flavour puzzle~\cite{Feruglio:2007uu,Bazzocchi:2009pv,Bazzocchi:2009da,Altarelli:2009gn,Toorop:2010yh,Altarelli:2010gt,Toorop:2010yh,Varzielas:2010mp,Toorop:2011jn,Grimus:2011fk,deAdelhartToorop:2011re,King:2011ab,Altarelli:2012ss,Bazzocchi:2012st,King:2013eh}, and they have been shown to be contexts where flavour violating processes are under control with new physics at the TeV scale~\cite{Feruglio:2008ht,Feruglio:2009iu,Lin:2009sq,Feruglio:2009hu,Ishimori:2010au,Toorop:2010ex,Toorop:2010kt,Merlo:2011hw,Altarelli:2012bn}. Only in 2011, with the discovery of a non-vanishing and relatively large leptonic reactor angle~\cite{Abe:2011sj,Adamson:2011qu,Abe:2011fz,An:2012eh,Ahn:2012nd}, strong doubts raised on the goodness of non-Abelian discrete models to describe Nature. In this panorama, the idea of MFV\footnote{Despite being so predictive, the MFV only describes masses and mixings, but does not explain their origin: indeed, no justification is provided for the Yukawa spurion background. Improvements with this respect can be found in Refs.~\cite{Alonso:2011yg,Alonso:2012fy,Alonso:2013mca,Alonso:2013nca} (see also Refs.~\cite{Anselm:1996jm,Barbieri:1999km,Berezhiani:2001mh,Feldmann:2009dc,Nardi:2011st}).} experienced a new revival of interest: this context is more predictive than models based on the Froggatt-Nielsen $U(1)$ and escapes from the rigidity of the discrete constructions. This section will summarise the main aspects of the MLFV scenario presented in Ref.~\cite{Alonso:2011jd}, fixing at the same time the notation used throughout this paper. Considering the SM spectrum supplemented with three RH neutrinos, the flavour symmetry characterising the $SU(3)_V$ MLFV scenario is $\mathcal{G}_F^\text{NA}\times \mathcal{G}_F^\text{A}$ where \begin{equation} \begin{aligned} \mathcal{G}_F^\text{NA}&\equiv SU(3)_{V}\times SU(3)_{e_R}\\ \mathcal{G}_F^\text{A}&\equiv U(1)_Y\times U(1)_L \times U(1)_{e_R}\,. \end{aligned} \label{FlavourSymmetries} \end{equation} The distinction between Abelian and non-Abelian terms reflects the fact that the non-Abelian symmetry factors deal exclusively with the inter-generation hierarchies~\cite{Alonso:2011yg,Alonso:2012fy,Alonso:2013mca,Alonso:2013nca}, while the Abelian ones may explain the hierarchies between the third generation fermions, such as the ratio $m_\tau/m_t$. The choice of $\mathcal{G}_F^\text{A}$ in Eq.~(\ref{FlavourSymmetries}) is the result of using the freedom of rearranging the $U(1)$ factors in order to identify the hypercharge, the Lepton number and transformations that act globally on the RH charged lepton fields only. The part of the Lagrangian containing the kinetic terms is invariant under $\mathcal{G}_F^\text{NA}\times \mathcal{G}_F^\text{A}$ with the lepton field transformations under $\mathcal{G}_F^\text{NA}\times U(1)_L \times U(1)_{e_R}$ as \begin{equation} \ell_L\sim ({\bf3},\,1)_{(1,0)}\qquad e_R\sim(1,\,{\bf3})_{(1,1)}\qquad \nu_R\sim({\bf3},\,1)_{(1,0)}\,, \label{TransformationsLeptons} \end{equation} where $e_R$ are the RH charged leptons. Instead, this is not the case for the part describing the lepton masses. The Type I Seesaw Lagrangian, which can be written as~\cite{Alonso:2011jd} \begin{equation} -\mathscr{L}=\epsilon_e \ov{\ell}_L\phi Y_e e_R+\ov{\ell}_L\widetilde\phi Y_\nu \nu_R +\dfrac12\mu_L \bar{\nu}_R^c Y_M \nu_R+\text{h.c.}\,, \label{YukawaLagrangian} \end{equation} describes the light active neutrino masses at low-energy through the so-called Weinberg operator~\cite{Weinberg:1979sa}, \begin{equation} \mathcal{O}_5=\dfrac{1}{2}\left(\bar{\ell}_L\tilde\phi\right)Y_\nu\dfrac{Y_M^{-1}}{\mu_L}Y_\nu^T\left(\tilde\phi^T\ell^c_L\right)+\text{h.c.}\,, \end{equation} where $\widetilde\phi\equiv i\sigma_2\phi^*$, $Y_e$, $Y_\nu$ and $Y_M$ are $3\times3$ matrices in the flavour space, $\mu_L$ is the scale of lepton number violation and $\epsilon_e$ is a constant that will be associated to the breaking of the $U(1)_{e_R}$ symmetry. By the first Shur's lemma, as $\ell_L$ and $\nu_R$ transform as triplets under the same symmetry factor, $Y_\nu$ is necessarily a unitary matrix and can be redefined away with a $SU(3)_V$ transformation~\cite{Bertuzzo:2009im,Alonso:2011jd}: this Dirac Yukawa term is then invariant under $\mathcal{G}_F^\text{NA}\times\mathcal{G}_F^\text{A}$. On the contrary, the charged lepton Yukawa interactions break $\mathcal{G}_F^\text{NA}\times U(1)_{e_R}$ and the RH neutrino masses break $SU(3)_V\times U(1)_L$. A way-out to recover the invariance of the whole mass Lagrangian is to promote the two Yukawa matrices $Y_e$ and $Y_M$, and the two parameters $\epsilon_e$ and $\mu_L$ to be spurion fields, i.e. non-dynamical fields that transform non-trivially under $\mathcal{G}_F^\text{NA}\times \mathcal{G}_F^\text{A}$. Selecting the spurion transformations under $\mathcal{G}_F^\text{NA}$ as \begin{equation} Y_e\sim({\bf3},\,{\bf\ov3})\qquad\qquad Y_M\sim({\bf\ov6},\,1) \label{NonAbelianSpurions} \end{equation} and under $U(1)_L \times U(1)_{e_R}$ as \begin{equation} \mu_L\sim(-2,\,0) \qquad\qquad \epsilon_e\sim(0,\,-1)\,, \label{AbelianSpurions} \end{equation} the mass Lagrangian is formally invariant under the entire flavour symmetry. Lepton masses and mixings arise only once the spurion fields acquire background values, breaking explicitly the flavour symmetry: in the charged lepton mass basis, \begin{equation} \begin{aligned} \hat{Y}_e&=\dfrac{\sqrt2}{\epsilon_e v}\mathtt{diag}(m_e,\,m_\mu,\,m_\tau)\\ Y_M&=\dfrac{v^2}{2\mu_L}U^* \hat{m}_\nu^{-1}U^\dag\,, \end{aligned} \label{NonAbelianSpurionsBG} \end{equation} where $\epsilon_e$ and $\mu_L$ are respectively a dimensionless quantity and a mass. Notice that the same symbols have been used for the couplings in Eq.~(\ref{YukawaLagrangian}), for the spurions in Eqs.~(\ref{NonAbelianSpurions}) and (\ref{AbelianSpurions}), and for their background values in Eq.~(\ref{NonAbelianSpurionsBG}): it will be clear which is the meaning associated to each symbol in the formulae that follow. An estimate of $\epsilon_e$ and of $\mu_L$ follows by assuming that the largest eigenvalues of $Y_e$ and of $Y_M$ are $\lesssim1$~\footnote{Considering values larger than 1 would imply that multiple products of Yukawa spurions would be more relevant than the single spurions themselves, and then they should be treated in a non-perturbative approach~\cite{Kagan:2009bn}.}: then \begin{equation} \begin{aligned} \epsilon_e\sim&\dfrac{\sqrt2 m_\tau}{v}\approx0.01\\ \mu_L\gtrsim&\dfrac{v^2}{2\sqrt{\Delta m^2_\text{atm}}}\approx6\times 10^{14}\;\text{GeV}\,, \end{aligned} \label{BoundsE_eMu_L} \end{equation} where $\Delta m^2_\text{atm}\approx 2.5\times 10^{-3}\;\text{eV}^2$~\cite{Esteban:2016qun,Capozzi:2017ipn} is the atmospheric squared mass difference of the light active neutrinos and the ``$\gtrsim$'' symbol reflects the fact that the absolute neutrino mass scale is still unknown. Within this setup, the expected mass scale of the RH neutrinos is of order $\mu_L$. In the spirit of the MLFV, any non-renormalisable operator can be made invariant under the flavour symmetry by inserting suitable combinations of the spurions. Once the latter acquire background values, the strength of each operator gets suppressed by a combination of lepton masses and PMNS parameters. These extra suppressions allow to predict the rates for rare radiative lepton decays and lepton conversion in nuclei in agreement with present data with a new physics scale that suppresses the effective operators as low as the TeV (see Ref.~\cite{Dinh:2017smk} for a recent update). Spurion insertions can be introduced not only in effective operators, but also in the renormalisable terms of the Lagrangian~\footnote{Some operators that are non-renormalisable in the description considered here appear in the list of the renormalisable ones if a non-SM Higgs field is considered, as described in the so-called Higgs Effective Field Theory~\cite{Feruglio:1992wf,Grinstein:2007iv,Contino:2010mh,Alonso:2012px,Alonso:2012pz,Buchalla:2013rka,Brivio:2013pma,Gavela:2014vra,Alonso:2014wta,Hierro:2015nna,Gavela:2014uta,Gavela:2016bzc,Eboli:2016kko,Brivio:2016fzo,deFlorian:2016spz,Merlo:2016prs}. As shown in Ref.~\cite{Alonso:2012pz,Brivio:2013pma,Brivio:2014pfa,Gavela:2014vra,Brivio:2015kia,Brivio:2016fzo,Brivio:2017ije,Hernandez-Leon:2017kea,Merlo:2017sun}, a different phenomenology is expected with a non-SM Higgs in the spectrum. In the present paper, however, the standard formulation with a $SU(2)_L$-doublet Higgs is retained.}. In particular, the introduction of spurions in the Dirac Yukawa term will be shown to be necessary in order to achieve successful Leptogenesis. Considering only the most relevant contributions, the Dirac Yukawa term can be written as \begin{equation} \ov{\ell}_L\widetilde\phi \left(\mathbbm{1}+c_1 \hat{Y}_e \hat{Y}_e^\dag +c_2 Y_M^\dag Y_M\right) \nu_R\,, \end{equation} where $c_{1,2}$ are dimensionless real parameters that are taken to be smaller than 1 in order to enforce a perturbative approach\footnote{In Ref.~\cite{Branco:2006hz}, considering the $SO(3)\times CP$ version of MLFV, the equivalent of the coefficients $c_{1,2}$ have been shown to be generated by radiative corrections during the evolution of the Lagrangian parameters.}. Within this hypothesis, the expression for $Y_M$ in Eq.~(\ref{NonAbelianSpurionsBG}) holds in first approximation. \subsection{A Suitable Basis for Leptogenesis} The explicit computation of the $\varepsilon$ parameter that controls the amount of CP asymmetry generated in the RH neutrino decays is typically performed in the mass basis for charged leptons and for RH neutrinos. The mass Lagrangian in this basis reads \begin{equation} -\mathscr{L}=\epsilon_e \ov{\ell}_L\phi \hat{Y}_e e_R+\ov{\ell}_L\widetilde\phi\, \lambda\, \nu_R +\dfrac12\mu_L \bar{\nu}_R^c \hat{Y}_M \nu_R+\text{h.c.}\,, \label{YukawaLagrangianRedef} \end{equation} where $\lambda$ is the Dirac neutrino Yukawa in this basis. Considering the background values of the spurions in Eq.~(\ref{NonAbelianSpurionsBG}), $\lambda$ reads \begin{equation} \lambda=U\left(\mathbbm{1}+c_1 U^\dag\hat{Y}^2_e U + c_2 \hat{Y}_M^2\right)\,, \label{lambda} \end{equation} where $\hat{Y}_e$ is defined in Eq.~(\ref{NonAbelianSpurionsBG}), while \begin{equation} \hat{Y}_M=\dfrac{v^2\hat{m}^{-1}_\nu}{2\mu_L}\,. \label{BackgroundYM} \end{equation} The two parameters $c_1$ and $c_2$ control the complex contributions coming from the PMNS matrix and the real contributions coming from the diagonal RH neutrino mass matrix, respectively. They are expected to be of the same order of magnitude and they will be taken equal to each other in what follows in order to simplify the study of the parameter space. It will be shown {\it a posteriori} that relaxing this condition has not relevant impact on the results as far as they are taken of the same order of magnitude. The relevance of the spurion insertions becomes evident computing the value of three specific weak-base invariants~\cite{Branco:2001pq}, related to the CP violation responsible for Leptogenesis: \begin{equation} \begin{aligned} \mathcal{I}_1=&\text{Im}\left({\rm Tr}\left[\lambda^\dag\lambda \hat{Y}_M^3\lambda^T\lambda^*\hat{Y}_M\right]\right)\\ \mathcal{I}_2=&\text{Im}\left({\rm Tr}\left[\lambda^\dag\lambda \hat{Y}_M^5\lambda^T\lambda^*\hat{Y}_M\right]\right)\\ \mathcal{I}_3=&\text{Im}\left({\rm Tr}\left[\lambda^\dag\lambda \hat{Y}_M^5\lambda^T\lambda^*\hat{Y}_M^3\right]\right)\,.\\ \end{aligned} \end{equation} It is straightforward to show that the three invariants depend on the combinations $\text{Im}\left[\left(\lambda^\dag\lambda\lambda^\dag\lambda\right)_{\alpha\neq \beta}\right]$: if $\lambda$ was taken without the spurions insertions, then $\lambda=U$ and the three invariants together with the parameter $\varepsilon$ would vanish. \section{Baryogenesis trough Leptogenesis} \label{Sect:Lepto} The prediction for the baryon asymmetry in the Universe requires to compute the CP asymmetry parameter $\varepsilon$ and to take into consideration its evolution during the expansion of the Universe, which depends on the interactions that are in thermal equilibrium at different temperatures. With this respect, the value of the RH neutrino mass scale $\mu_L$ is a fundamental parameter as it identifies different flavour regimes~\cite{Barbieri:1999ma,Pilaftsis:2005rv,Abada:2006fw,Nardi:2006fx,Underwood:2006xs,Abada:2006ea,Blanchet:2006be}: the lower $\mu_L$ is, the more relevant the flavour composition of the charged leptons produced in the RH neutrino decays is. For the $SU(3)_V$ MLFV framework, $\mu_L\gtrsim10^{14}\;\text{GeV}$ and it corresponds to the so-called unflavoured regime, where the charged lepton flavour does not play any role. Indeed, the only relevant interactions at these energies are the Yukawa ones, which induce RH neutrino decays, and the gauge ones that are flavour blind: lepton and anti-lepton quantum states propagate coherently between the production in decays and the later absorption from inverse decays. In addition, the scale $\mu_L$ identifies the reheating temperature necessary for the thermal production of the RH neutrinos~\cite{Giudice:2003jh,Buchmuller:2004nz}: once the temperature drops below $M_a$, the thermal production of the corresponding RH neutrino $N_a$ becomes irrelevant. This allows to identify a lower bound on the reheating temperature at about $10^{13\div14}\;\text{GeV}$ in the MLFV scenario under consideration. The usually quoted upper bound of $10^{6\div10}\;\text{GeV}$ does not apply as it is exclusively connected to the so-called gravitino problem in supersymmetry~\cite{Khlopov:1984pf,Ellis:1984eq,Kohri:2005wn}. Besides $\mu_L$, the splitting between the RH neutrino masses is also relevant: when the spectrum is highly hierarchical then the asymmetries produced by the heaviest states are typically (partially) washed out by the inverse decay of the lightest states (i.e. $\ell_{L\alpha}(\bar\ell_{L\alpha})+\phi^\ast (\phi)\to \nu_{Ra}$) and by the $2\leftrightarrow2$ scattering mediated by the lightest states (i.e. $\ell_{L\alpha}+\phi^\ast\leftrightarrow\bar{\ell}_{L\alpha}+\phi$); when instead the spectrum is degenerate, a resonance in the decay rate is present~\cite{Liu:1993tg,Flanz:1994yx,Flanz:1996fb,Covi:1996wh,Covi:1996fm,Pilaftsis:1997jf,Buchmuller:1997yu,Pilaftsis:2003gt}, which, however, is diluted due to the washout effects of all the three RH neutrinos. In the framework under consideration, depending on the mass of the lightest active neutrino, the spectrum varies from hierarchical to degenerate and therefore the computation of $\eta_B$ is not straightforward. In particular, when the heavier RH neutrinos also contribute to the final asymmetry, the flavour composition of the three RH neutrinos is relevant and need to be taken into consideration~\cite{Barbieri:1999ma,Engelhard:2006yg,Bertuzzo:2009im,Antusch:2010ms,Blanchet:2011xq}: part of the asymmetry generated by a heavier RH neutrino may escape the washout from a lighter one; moreover, part of the final asymmetry may not come from the production in the RH neutrino decays, but from the dilution effects. The density matrix formalism~\cite{Barbieri:1999ma,Abada:2006fw,Blanchet:2006ch,DeSimone:2006nrs,Blanchet:2011xq,Blanchet:2012bk} (see Ref.~\cite{Dev:2014laa} for an alternative flavour-covariant formalism) turns out to be extremely effective in these cases, and thus for the MLFV framework under discussion: it allows to calculate the asymmetry not only in the well definite regimes with a hierarchical or degenerate RH neutrino spectrum, but also in the intermediate cases, describing together the lepton quantum states and the thermal bath. In the rest of this section, the density matrix approach will be adopted following Ref.~\cite{Blanchet:2011xq}, fixing the notation and illustrating the procedure to follow, while in the next section the results of the numerical simulation will be presented. In the present analysis several contributions will not be considered, as their impact is not relevant for the results presented here: they are due to $\Delta L=1$ scatterings~\cite{Luty:1992un,Plumacher:1996kc,Buchmuller:2000as,HahnWoernle:2009qn}, thermal corrections~\cite{Kiessig:2010pr,Giudice:2003jh}, momentum dependence~\cite{Basboll:2006yx,HahnWoernle:2009qn}, and quantum kinetic effects~\cite{DeSimone:2007gkc,Beneke:2010wd,Anisimov:2010dk,Dev:2014wsa}.\\ The baryon-to-photon number ratio at recombination, whose best experimental determination is reported in Eq.~(\ref{ExpBAU}), can be written in terms of the final $B-L$ asymmetry density $N_{B-L}^f$ as \begin{equation} \eta_B=c_s\dfrac{N_{B-L}^f}{N_\gamma^\text{rec}}\simeq0.0096\, N_{B-L}^f\,, \end{equation} with $c_s=28/79$ defined in Eq.~(\ref{cs}) for $N_F=3$, and $N_\gamma^\text{rec}\simeq37$ the photon number density at recombination. The final $B-L$ asymmetry results from the sum of the asymmetries generated by the three RH neutrinos, in case partially washed out by the inverse decays~\cite{Barbieri:1999ma,Strumia:2006qk}. It can be calculated solving the following system of four differential equations: \begin{equation} \hspace{-5mm} \begin{aligned} \frac{\mathrm{d} (N_{B-L})_{\alpha \beta}}{\mathrm{d} z} =& \varepsilon_{\alpha \beta}^{(a)}\mathscr{D}_a[z]\left(N_{N_a}-N_{N_a}^\text{eq}\right)-\frac{\mathscr{W}_a[z]}{2}\left\lbrace \mathcal{P}^{(a)0},\, N_{B-L}\right\rbrace _{\alpha \beta}\\ \frac{\mathrm{d} N_{N_a}}{\mathrm{d} z} =& -\mathscr{D}_a[z]\left(N_{N_a}-N_{N_a}^\text{eq}\right)\qquad (a=1,2,3)\,. \end{aligned} \label{BEs} \end{equation} The parameter $z$ is the ratio between the lightest RH neutrino mass $M_\text{light}$ and the temperature of the bath, i.e. $z\equiv M_\text{light}/T$. $N_X$ is any particle number or asymmetry $X$ calculated in a portion of co-moving volume containing one RH neutrino in ultra-relativistic thermal equilibrium, that is $N_{N_a}^\text{eq}[z\ll1]=1$. The expression for $N_{N_a}^\text{eq}[z_a]$ at a $z_a\equiv \sqrt{x_a}z$, with $x_a=M_a^2/M^2_\text{light}$, is given by~\cite{Buchmuller:2004nz,Blanchet:2011xq} \begin{equation} N_{N_a}^\text{eq}[z_a]=\dfrac12 z_a^2\,\mathscr{K}_2[z_a]\,, \end{equation} where $\mathscr{K}_n[z_a]$ is a modified Bessel function, satisfying to \begin{equation} z_a^2\, y^{\prime\prime}+z_a\,y^\prime-(z_a^2+n^2)y=0\,. \end{equation} The $\mathscr{D}_a[z]$ terms are the RH neutrino decay factors~\cite{Kolb:1990vq} \begin{equation} \mathscr{D}_a[z]\equiv\dfrac{\Gamma^\mathscr{D}_a[z_a]}{H[z_a]\, z}=K_a \, x_a\,z\,\dfrac{\mathscr{K}_1[z_a]}{\mathscr{K}_2[z_a]}\,, \label{DecayFactors} \end{equation} where the total decay rates $\Gamma^\mathscr{D}_a[z_a]$ read~\cite{Kolb:1979qa} \begin{equation} \Gamma^\mathscr{D}_a[z_a]\equiv \left(\sum_\alpha\Gamma_{a\alpha}+\bar{\Gamma}_{a\alpha}\right)\dfrac{\mathscr{K}_1[z_a]}{\mathscr{K}_2[z_a]}\,, \end{equation} where $\mathscr{K}_1[z_a]$ is also a modified Bessel function, and $H[z_a]$ is the Hubble expansion rate of the Universe given by \begin{equation} H[z_a]\equiv\sqrt{\dfrac{8\pi^3g_\star}{90}}\dfrac{M_a^2}{M_\text{Pl}}\dfrac{1}{z_a^2}\,, \end{equation} where $g_\star=g_\text{SM}=106.75$ is the total number of degrees of freedom and $M_{Pl}=1.22\times 10^{19}\;\text{GeV}$ the Planck mass. The second expression on the right-hand side of Eq.~(\ref{DecayFactors}) contains the total decay parameters $K_a$ that measure the strength of the washout: they are defined as the ratio between the total decay widths of the RH neutrinos calculated at a temperature much smaller than $M_a$ and the Hubble parameter at $T=M_a$, when the RH neutrinos start to become non-relativistic: explicitly, \begin{equation} K_a\equiv \dfrac{\left(\Gamma_a+\bar{\Gamma}_a\right)_{z_a\gg1}}{H[z_a=1]}\,, \end{equation} where \begin{equation} \Gamma_a\equiv \sum_\alpha \Gamma_{a\alpha}\qquad\qquad \bar\Gamma_a\equiv \sum_\alpha \bar\Gamma_{a\alpha}\,. \end{equation} For $K_a\gg1$ the RH neutrinos decay and inverse-decay many times before entering the non-relativistic regime: in consequence their abundance is close to the equilibrium distribution and this case is dubbed strong washout regime. On the other side, for $K_a\ll1$, called weak washout regime, the majority of the RH neutrinos decay completely out-of-equilibrium, already in the non-relativist regime, and therefore their equilibrium abundance is exponentially suppressed by the Boltzmann factor. Introducing the notation of the so-called effective washout parameter~\cite{Plumacher:1996kc} and of the equilibrium neutrino mass~\cite{Nezri:2000pb,Buchmuller:2003gz,Buchmuller:2004tu}, \begin{equation} \begin{aligned} \widetilde{m}_a&\equiv \dfrac{v^2}{2}\dfrac{(\lambda^\dag \lambda)_{aa}}{M_a}\,,\\ m_\star&=\dfrac{16\pi^{5/2}\sqrt{g_\star}}{3\sqrt5}\dfrac{v^2}{2M_{Pl}}\simeq1.07\times 10^{-3}\;\text{eV}\,, \end{aligned} \end{equation} the total decay parameter can be written as \begin{equation} K_a=\dfrac{\widetilde{m}_a}{m_\star}\,. \end{equation} The $\mathscr{W}_a[z]$ terms are the washout factors due to inverse decays~\cite{Kolb:1979qa,Dolgov:1981hv,Giudice:2003jh} and $\Delta L=2$ processes~\cite{Dolgov:1981hv,Kolb:1979qa,Giudice:2003jh}, which provide the two relevant effects for these values of the RH neutrino masses: \begin{equation} \mathscr{W}_a[z]\equiv \mathscr{W}^{ID}_a[z] + \Delta \mathscr{W}_a[z]\,, \end{equation} where the two factors are defined as \begin{equation} \begin{aligned} \mathscr{W}^{ID}_a[z]&=\dfrac14\, K_a\,\mathscr{K}_1[z_a]\,z_a^3\\ \Delta \mathscr{W}_a[z]&\simeq \dfrac{\alpha}{z_a^2}\,M_a\,\widetilde{m}_a^2\qquad\text{for}\qquad z_a\gg1\,, \end{aligned} \end{equation} with $\alpha$ given by~\cite{Bertuzzo:2009im} \begin{equation} \alpha=\dfrac{3\sqrt5 M_{Pl}}{\zeta(3)\pi^{9/2}v^4\sqrt{g_\star}}\,, \label{alphaexpression} \end{equation} being $\zeta(3)\approx1.202$ the Ap\'ery constant. The inverse decay processes are relevant when they are in equilibrium, i.e. $\mathscr{W}_a[z]\gtrsim1$, and this occurs only in the strong washout regime for $K_a>3$. Instead, in the weak washout regime, $\mathscr{W}_a[z]<1$ and the inverse decays are always irrelevant. On the other side, the $\Delta L=2$ processes have a relevant effect only for $z\gtrsim z_\Delta\gg1$, where $z_\Delta$ is determined by \begin{equation} \mathscr{W}^{ID}_a[z_\Delta]=\Delta \mathscr{W}_a[z_\Delta]\,. \label{zDelta} \end{equation} The $\mathcal{P}^{(a)0}$ factors are the flavour projectors along the $\ell_a$ direction defined by \begin{equation} \mathcal{P}^{(a)0}_{\alpha\beta}=\dfrac{\lambda^\ast_{\beta a}\lambda_{\alpha a}}{\left(\lambda^\dag\lambda\right)_{aa}}\,, \end{equation} where $\lambda$ is the Dirac Yukawa in Eq.~(\ref{lambda}). The suffix ``$0$'' indicates that only the leading terms are considered. Finally, the flavoured CP asymmetry parameters $\varepsilon_{\alpha \beta}^{(a)}$ are given by~\cite{Covi:1996wh,Liu:1993tg,Flanz:1994yx,Flanz:1996fb,Covi:1996wh,Covi:1996fm,Pilaftsis:1997jf,Buchmuller:1997yu,Pilaftsis:2003gt} \begin{widetext} \begin{equation} \hspace{-2cm} \begin{split} \epsilon_{\alpha \beta}^{(a)} = \frac{i}{16\pi (\lambda^{\dagger}\lambda)_{aa}} \sum_{b\neq a}& \left\{\left[\lambda_{\alpha a}\lambda_{\beta b}^*(\lambda^{\dagger}\lambda)_{ba} - \lambda^*_{\beta a}\lambda_{\alpha b} (\lambda^{\dagger}\lambda)_{ab}\right] \frac{M_b}{M_a} \left[\left(1+\frac{M_b^2}{M_a^2}\right)\ln \left(1+\frac{M_a^2}{M_b^2}\right)-\frac{M_a^2(M_a^2-M_b^2)}{(M_a^2-M_b^2)^2+\left(M_a\Gamma_a+M_b\Gamma_b\right)^2}-1\right]+\right.\\ &\hspace{5mm} \left.-\left[\lambda_{\alpha a}\lambda_{\beta b}^*(\lambda^{\dagger}\lambda)_{ab}-\lambda^*_{\beta a}\lambda_{\alpha b}(\lambda^{\dagger}\lambda)_{ba}\right]\frac{M_a^2(M_a^2-M_b^2)}{(M_a^2-M_b^2)^2+\left(M_a\Gamma_a+M_b\Gamma_b\right)^2}\right\}\,, \end{split} \label{newepsilon} \end{equation} \end{widetext} where the Kadanoff-Bayn regulator~\cite{Garny:2011hg}, that is the term in the denominator containing the RH neutrino decay rates $\Gamma_a$, plays an important role when the spectrum is almost degenerate. Different regulators can be considered, depending on the formalism chosen: the one used in the previous expression prevents the arising of any divergence in the doubly degenerate limit $M_a\to M_b$ and $\Gamma_a\to \Gamma_b$, which instead occurs within the classical Boltzmann approach. \section{Numerical Analysis} \label{Sect:NumAna} This section contains the results of the numerical analysis first focussing on the baryon asymmetry and then on the neutrinoless double beta decay. The input data used are the PDG values for the charged lepton masses~\cite{Olive:2016xmw} \begin{equation} \begin{aligned} m_e=&0.51\;\text{MeV}\,,\\ m_\mu=&105.66\;\text{MeV}\,,\\ m_\tau=&1776.86\pm0.12\;\text{MeV}\,, \end{aligned} \end{equation} where the electron and muon masses are shown without errors as the sensitivities are completely negligible, and the results of the neutrino oscillation fit from Ref.~\cite{Esteban:2016qun} (see also Ref.~\cite{Capozzi:2017ipn,deSalas:2017kay}) reported in Table~\ref{TableOscFit}. In the analysis that follows, all these input parameters have been taken at their central values. \begin{table}[htp] \begin{center} \begin{tabular}{l|c|c|} & Normal Ordering & Inverted Ordering \\[1mm] \hline &&\\ $\sin^2\theta_{12}$ & $0.307^{+0.013}_{-0.012}$ & $0.307^{+0.013}_{-0.012}$ \\[3mm] $\sin^2\theta_{23}$ & $0.565^{+0.025}_{-0.120}$ & $0.572^{+0.021}_{-0.028}$ \\[3mm] $\sin^2\theta_{13}$ & $0.02195^{+0.00075}_{-0.00074}$ & $0.02212^{+0.00074}_{-0.00073}$\\[3mm] $\delta^\ell_{CP}/^\circ$ & $228^{+51}_{-33}$ & $281^{+30}_{-33}$\\[3mm] $\Delta m^2_{sol}/10^{-5}\;\text{eV}^2$ & $7.40^{+0.21}_{-0.20}$ & $7.40^{+0.21}_{-0.20}$\\[3mm] $\Delta m^2_{atm}/10^{-3}\;\text{eV}^2$ & $2.515\pm0.035$ & $2.483^{+0.034}_{-0.035}$\\[3mm] \hline \end{tabular} \end{center} \caption{\footnotesize\it Three-flavour oscillation parameters from the global fit in Ref.~\cite{Esteban:2016qun}. The second and third columns refer to the NO and IO, respectively. The notation chosen is $\Delta m^2_\text{sol}\equiv m^2_{\nu_2}- m^2_{\nu_1}$ and $\Delta m^2_\text{atm}\equiv m^2_{\nu_3}-m^2_{\nu_1}$ for NO and $\Delta m^2_\text{atm}\equiv m^2_{\nu_2}-m^2_{\nu_3}$ for IO. The errors reported correspond to the $1\sigma$ uncertainties.} \label{TableOscFit} \end{table Tab.~\ref{TableOscFit} reports the value of the mixing angles and of the Dirac CP phase according to the PDG parametrisation of the PMNS matrix, \begin{equation} U=\mathscr{R}_{23}(\theta_{23})\,\mathscr{R}_{13}(\theta_{13},\,\delta^\ell_{CP})\,\mathscr{R}_{12}(\theta_{12})\,\mathscr{P}\,, \end{equation} where $\mathscr{R}_{ij}$ is a $3\times 3$ rotation in the flavour space in the $ij$ sector of an angle $\theta_{ij}$ and $\mathscr{P}$ is the diagonal matrix containing the Majorana CP phases defined by \begin{equation} \mathscr{P}=\mathtt{diag}\left(1,\,e^{i\frac{\alpha_{21}}{2}},\,e^{i\frac{\alpha_{31}}{2}}\right)\,. \end{equation} Tab.~\ref{TableOscFit} also contains the neutrino mass square differences, while the value of the lightest neutrino mass is presently unknown. Moreover, it is still an open issue the ordering of the neutrino mass eigenstates: the so-called Normal Ordering (NO) refers to the case when $m_{\nu_1}<m_{\nu_2}\ll m_{\nu_3}$ while the Inverse Ordering (IO) to the case when $m_{\nu_3}\ll m_{\nu_1}<m_{\nu_2}$. The labelling of the three $\nu_i$ is determined by the flavour content of each mass eigenstate: $\nu_1$ is the state with the largest contamination of $\nu_e$; $\nu_2$ is the one with an almost equally composition of the three flavours; $\nu_3$ is the one almost exclusively defined as a equal mixture of $\nu_\mu$ and $\nu_\tau$. The diagonal active neutrino mass matrix can thus be written in terms of the lightest neutrino mass as follows: for the NO and IO respectively, \begin{equation} \hspace{-3mm} \begin{aligned} \hat{m}^\text{NO}_\nu&= \left(\begin{array}{ccc} m_{\nu_1} & 0 & 0 \\ 0 & \sqrt{m^2_{\nu_1}+\Delta m^2_\text{sol}} & 0 \\ 0 & 0 & \sqrt{m^2_{\nu_1}+\Delta m^2_\text{atm}} \\ \end{array}\right)\\ \hat{m}^\text{IO}_\nu&= \left(\begin{array}{ccc} \sqrt{m^2_{\nu_3}+\Delta m^2_\text{atm}-\Delta m^2_\text{sol}} & 0 & 0 \\ 0 & \sqrt{m^3_{\nu_3}+\Delta m^2_\text{atm}} & 0 \\ 0 & 0 & m_{\nu_3} \\ \end{array}\right)\,. \end{aligned} \end{equation} To match with the notation typically adopted in Leptogenesis, a different convention is chosen for the labelling of the RH neutrino mass eigenstates. For both NO and IO, $N_1$ always refers to the lightest eigenstate, $N_2$ to the next to lightest and the $N_3$ to the heaviest. In consequence, $\hat Y_M$ in Eq.~(\ref{BackgroundYM}) takes a different definition in terms of the three RH neutrino masses depending on the ordering of the spectrum: for the NO and IO respectively, \begin{equation} \begin{aligned} \mu_L\hat{Y}^\text{NO}_M&\equiv\mathtt{diag}(M_3,\,M_2,\,M_1)\\ \mu_L\hat{Y}^\text{IO}_M&\equiv\mathtt{diag}(M_2,\,M_1,\,M_3)\,. \end{aligned} \label{RHNeutrinosMassOrdering} \end{equation} The lepton number violation scale $\mu_L$, the spurion background value $\hat Y_M$ and the active neutrino masses are linked together by Eq.~(\ref{BackgroundYM}). In consequence it is possible to identify a range of values for the lightest neutrino mass, given a value for the scale $\mu_L$ and requiring that the largest entry of $\hat Y_M$ is of order 1, according to the MLFV construction illustrated in Sect.~\ref{Sect:MLFV}. Fig.~\ref{Fig.RH-ActiveMasses} shows the profiles of the RH neutrino masses as a function of the lightest active neutrino mass $m_\text{light}$ for a NO spectrum. The plot for the IO case is very similar: the only difference is that the line corresponding to the next-to-lightest RH neutrino (in red) almost overlaps with the one of the lightest (in blue). The horizontal lines represent different values for the $\mu_L$ scale, $\mu_L=10^{15},\,10^{16},\,10^{17}\;\text{GeV}$, and their crossing with the line of the heaviest RH neutrino mass (in green) identifies the lowest value that $m_\text{light}$ can take satisfying $(\hat Y_M)_{ii}\leq1$. \begin{figure}[h!] \includegraphics[width=0.45\textwidth]{Masses} \caption{\footnotesize\it Profiles of the RH neutrino masses as a function of the lightest active neutrino mass $m_\text{light}$. The blue (red) [green] continuous line corresponds to the lightest (next-to-lightest) [heaviest] RH neutrino. The horizontal lines represent different values for the lepton number violation scale: the dashed one refers to $\mu=10^{15}\;\text{GeV}$, while the dotted to $\mu=10^{16}\;\text{GeV}$, and the dot-dashed to $\mu=10^{17}\;\text{GeV}$. The shaded areas are regions where the condition $(\hat Y_M)_{ii}\leq1$ does not hold: three specific cases are illustrated for $\mu_L=10^{15}\;\text{GeV}$, $10^{16}\;\text{GeV}$, $10^{17}\;\text{GeV}$.} \label{Fig.RH-ActiveMasses} \end{figure} Fig.~\ref{Fig.RH-ActiveMasses} shows that the lower bound on $\mu_L$ reported in Eq.~(\ref{BoundsE_eMu_L}) corresponds to the lightest RH neutrino line (in blue) for $m_\text{light}\lesssim0.03\;\text{eV}$. An upper bound on $\mu_L$ can be taken, in full generality, to be at the Planck scale. However, such a large $\mu_L$ is not consistent with the hypothesis of thermal production of RH neutrinos, as the temperature of the Universe should be at least of the same order of magnitude as their masses. In the numerical analysis that follows, the lepton number violation scale is taken at $\mu_L=10^{16}\;\text{GeV}$: the corresponding heaviest RH neutrino mass satisfies $M_3<10^{16}\;\text{GeV}$ and the range of values for the lightest active neutrino mass is $m_\text{light}\in[0.003,\,0.2]\;\text{eV}$. In consequence, as shown in Fig.~\ref{Fig.RH-ActiveMasses}, all the three RH neutrinos may contribute to the baryon asymmetry. Further discussion on the maximal temperature of the Universe and on the thermal production of the RH neutrinos will follow at the end of next section. \subsection{Baryon asymmetry in the Universe} This subsection is devoted to illustrate the results of the numerical analysis on the baryon asymmetry in the Universe. Under the assumption that the reheating temperature is close to the maximal temperature $T_\text{max}$ at a given instant, and solving the Boltzmann equations in Eq.~(\ref{BEs}) with the initial condition on $z=M_\text{lightest}/T_\text{max}\gtrsim 0.06$, the lepton asymmetry due to the out-of-equilibrium decay of the three RH neutrinos is partially washed out by inverse decays and $\Delta L=2$ processes. \begin{figure}[h!] \hspace{-5mm} \includegraphics[width=0.45\textwidth]{Washouts_16_0003_NO} \caption{\footnotesize\em Profiles $\mathscr{W}_a^{ID}$ (continuos lines) and $\Delta\mathscr{W}_a$ (dashed lines) as a function of $z_a$. The colours refer to the RH neutrino mass eigenstate in the NO case: the blue (red) [green] continuous line corresponds to the lightest (next-to-lightest) [heaviest] RH neutrino. The lepton number violation scale is fixed to $\mu_L=10^{16}\;\text{GeV}$, the lightest active neutrino mass to $m_\text{light}=0.003\;\text{eV}$, which corresponds to $z_\text{in}=0.06$, and the coefficients $c_1=c_2=0.01$.} \label{Fig.Washout} \end{figure} Fig.~\ref{Fig.Washout} shows the profiles of $\mathscr{W}_a^{ID}$ (continuos lines) and $\Delta\mathscr{W}_a$ (dashed lines) as a function of $z_a$: the value for $z_a$ at which continuos and dashed lines cross is $z_\Delta\approx10$ and it corresponds to the temperature at which the washout due to inverse decays starts to be less relevant than the dilution effect due to the $\Delta L=2$ processes. The $\Delta\mathscr{W}_a$ lines start from $z_a=5$, satisfying the condition $z_a\gg1$ as discussed below Eq.~(\ref{alphaexpression}). The profiles in Fig.~\ref{Fig.Washout} correspond to a specific choice for the lepton number violation scale, $\mu_L=10^{16}\;\text{GeV}$, the lightest active neutrino mass, $m_\text{light}=0.003\;\text{eV}$, and the coefficients $c_1=c_2=0.01$, and it refers to the NO spectrum. Considering the IO spectrum, the main difference resides in that the lines corresponding to the lightest and the next-to-lightest neutrinos (blue and red) almost overlap. Lowering $\mu_L$, taking larger values for $m_\text{light}$ or taking different values for $c_{1,2}$, but still smaller than $0.1$, does not change substantially the plot. Instead, for values $c_{1,2}\sim1$, the washout effects of the heaviest neutrino become more relevant, although not changing the global picture. It follows from the fact that so large $c_{1,2}$ values induce large off-diagonal entries in $\lambda$ in Eq.~(\ref{lambda}) and then the RH neutrino flavour directions have larger overlap. \begin{figure}[h!] \hspace{-5mm} \includegraphics[width=0.45\textwidth]{etaBzNOIO} \caption{\footnotesize\em $\eta_B$ as a function of $z\in[0.06,\,100]$ for three benchmark points in the parameter space: the green line corresponds to $\alpha_{21}=\pi$ and $\alpha_{31}=\pi/4$; the blue line corresponds to $\alpha_{21}=7\pi/4$ and $\alpha_{31}=\pi/2$; the red line to $\alpha_{21}=3\pi/4$ and $\alpha_{31}=5\pi/4$. Continuous (dashed) lines correspond to the NO (IO) case. The mass of the lightest active neutrino is fixed to $m_\text{light}=0.02\;\text{eV}$, while the remaining input parameters have been taken at their central values as reported in Tab.~\ref{TableOscFit}. } \label{Fig.EtaB_z_max} \end{figure} The standard procedure consists in solving the Boltzmann equations with a final value $z_a=+\infty$, even if this not effective from a computational point a view. However, it is possible to identify a value $z_\text{max}$ such that $\eta_B$ is practically constant for $z_a>z_\text{max}$. The profile of $\eta_B$ as a function of $z_a$ is shown in Fig.~\ref{Fig.EtaB_z_max} for three distinct benchmark points in the parameter space: in a good approximation $z_\text{max}=20$ and this value will be adopted in the rest of the analysis. \begin{figure}[h!] \centering \subfloat[$\eta_B$ {\it vs} $m_\text{light}$ for the NO case] {\includegraphics[width=0.45\textwidth]{etaBvsmlightNO}} \hfil \subfloat[$\eta_B$ {\it vs} $m_\text{light}$ for the IO case] {\includegraphics[width=0.45\textwidth]{etaBvsmlightIO}} \caption{\footnotesize\em $\eta_B$ as a function of the lightest neutrino mass for the NO on the top and IO on the bottom. In black the points where $\eta_B$ falls inside its experimental determination at $3\sigma$ error. Charged lepton masses and neutrino oscillation parameters have been taken at their central value as in Tab.~\ref{TableOscFit}, $0.01\lesssim z<20$, $c_1=c_2=0.01$ and the Majorana CP phases randomly vary in their dominium.} \label{fig:EtaB} \end{figure} Moreover, Fig.~\ref{Fig.EtaB_z_max} leads to the conclusion that $\eta_B$ strongly depends on the specific benchmark point chosen and in consequence one may expect that only a small percentage of points in the whole parameter space accommodates the current determination of $\eta_B$. This is reflected in the scatter plots in Fig.~\ref{fig:EtaB} that show $\eta_B$ as a function of the lightest active neutrino mass, for $c_1=c_2=0.01$ (details on the input parameters can be found in the caption): values for $\eta_B$ consistent with data, represented by the black points in the plots, can be found for $m_\text{lightest}\in[0.003,\,0.04]\;\text{eV}$ in the NO case and for $m_\text{lightest}\in[0.004,\,0.012]\;\text{eV}$ in the IO case. $\eta_B$ cannot take values in the white region above the coloured ones, while any arbitrary smaller value is not excluded, although much smaller ones would correspond to fine-tuned situations where cancellations between the final contributions to $\eta_B$ occur. The cuspids at $m_\text{light}\sim0.008\;\text{eV}$ in the NO and at $m_\text{light}\sim0.012\;\text{eV}$ in the IO do not correspond to any cancellation in the $\varepsilon_{\alpha\beta}$ parameters, but they arise as a numerical output during the resolution of the Boltzmann equations. \begin{figure*} \centering \subfloat[$\alpha_{21}$ {\it vs} $m_\text{light}$ for the NO case\label{fig:CorrelationMajoranaa}] {\includegraphics[width=0.45\textwidth]{maj1vsmlightNO}} \hfil \subfloat[$\alpha_{21}$ {\it vs} $m_\text{light}$ for the IO case \label{fig:CorrelationMajoranab}] {\includegraphics[width=0.45\textwidth]{maj1vsmlightIO}}\\ \subfloat[$\alpha_{31}$ {\it vs} $m_\text{light}$ for the IO case \label{fig:CorrelationMajoranac}] {\includegraphics[width=0.45\textwidth]{maj2vsmlightIO}} \hfil \subfloat[$\alpha_{31}$ {\it vs} $\alpha_{21}$ for the IO case \label{fig:CorrelationMajoranad}] {\includegraphics[width=0.45\textwidth]{maj2vsmaj1IO}} \caption{\footnotesize\em Correlation plots for the Majorana CP phases and the lightest active neutrino mass for the only points that satisfy $\eta_B$ within its experimental determination at $3\sigma$ error. } \label{fig:CorrelationMajorana} \end{figure*} Fig.~\ref{fig:CorrelationMajorana} shows the correlations existing between the Majorana CP phases and the lightest active neutrino mass for the NO case in \ref{fig:CorrelationMajoranaa} and for the IO in \ref{fig:CorrelationMajoranab} and \ref{fig:CorrelationMajoranac}, and between the two Majorana phases for the only IO case in \ref{fig:CorrelationMajoranad}. The $\alpha_{31}$ phase does not manifest any relevant correlation for the NO case. The plots suggest the presence of specific regions of the parameter space corresponding to a successful baryogenesis. For the NO case, one may conclude that $\alpha_{21}$ and $m_\text{light}$ are highly correlated and, for a given value of $m_\text{light}$, $\alpha_{21}$ varies only inside a small interval. This is not the case for the Majorana phases in the IO case, where the allowed parameter space is much wider; however, the strong correlation between them in Fig.~\ref{fig:CorrelationMajoranad} identifies specific regions of values where $\eta_B$ agrees with data at $3\sigma$.\\ The scatter plots shown in Figs.~\ref{fig:EtaB} and \ref{fig:CorrelationMajorana} are obtained with the Dirac CP phase within its $1\sigma$ confidence level, that nowadays is a large interval of $\sim60^\circ$ and $\sim80^\circ$ for the NO and IO respectively. These results have a very mild dependence on the value of this phase: by comparing the specific predictions for distinct fixed values of $\delta^\ell_{CP}$, no relevant differences can be appreciated. On the other hand, these plots highly depend on the values of $c_1=c_2$: for smaller values, for example $c_1=c_2=0.001$, $\eta_B$ is predicted to be smaller than its experimental determination at $3\sigma$ in the whole range for $m_\text{light}$ and for both NO and IO; for larger values, for example $c_1=c_2=0.1$, points with $\eta_B=6\times 10^{-10}$ can be found for any value of $m_\text{light}$ and in both NO and IO, but no correlation between Majorana phases and $m_\text{light}$ are present. In the latter case, a successful description of BAU is the result of an occasional cancellation between the contributions to $\eta_B$ obtained solving the density matrix equations in Eq.~(\ref{BEs}). The subjacent hypothesis to the numerical result shown above is that the maximal temperature of the Universe is $T_\text{max}=\mu_L=10^{16}\;\text{GeV}$, implying that the three RH neutrinos are thermally produced and contribute to the final value of $\eta_B$. If a lower value for $T_\text{max}$ is taken, then the heaviest neutrinos may not be thermally produced and their contributions would be negligible. Fig.~\ref{fig:CorrelationEtaB} shows the effect on the final value of $\eta_B$ of lowering the value of $T_\text{max}$, for a normal hierarchical active neutrino spectrum on the left, for an inverse hierarchical one in the middle, and for a degenerate spectrum on the right. The axes represent the final value of $\eta_B$ considering $T_\text{max}=10^{16}\;\text{GeV}$ and $T_\text{max}=10^{15}\;\text{GeV}$. The two parameters $c_1$ and $c_2$ have been fixed at $0.01$, while two values for $m_\text{light}$ have been considered, $m_\text{light}=0.006\;\text{eV}$ for the first two plots and $m_\text{light}=0.2\;\text{eV}$ for the one on the right. Each point in the plots corresponds to a given random choice of the rest of parameters: in this way, it is possible to clearly identify on the final value of $\eta_B$ the impact of the temperature dependence and therefore the impact of the heavier sterile neutrinos. The diagonal red line drives the eye to tell when $\eta_B$ is larger for $T_\text{max}=10^{16}\;\text{GeV}$ or for $T_\text{max}=10^{15}\;\text{GeV}$: if the points align along the diagonal, then either the heaviest sterile neutrino would not contribute to the final value of $\eta_B$ or the three of them are thermally produced even considering the lowest temperature case; if all the points cover the region on the right of the diagonal, then the heaviest sterile neutrino does have an impact and its contribution sums constructively with the ones from the lightest states; in the opposite case, i.e. all the points on the left of the diagonal, its contribution sums destructively with the other ones. \begin{figure*} \centering \subfloat[Normal Hierarchical case] {\includegraphics[width=0.32\textwidth]{TreNOH}} \hfil \subfloat[Inverse Hierarchical case] {\includegraphics[width=0.32\textwidth]{TreIOH}} \hfil \subfloat[Degenerate case] {\includegraphics[width=0.32\textwidth]{TreDeg}} \caption{\footnotesize\em Correlation plots of $\eta_B$ with different $T_\text{max}$. In the axis of the abscissas $\eta_B$ with $T_\text{max}=10^{16}\;\text{GeV}$, while in the one of the ordinates $\eta_B$ with $T_\text{max}=10^{15}\;\text{GeV}$. On the left the normal hierarchical case, in the center the inverse hierarchical one, and on the right the degenerate spectrum case. The red dashed line represents the diagonal to easier drive the eye on the values when the two computed $\eta_B$ have the same value. The black continuous lines delimit the $3\sigma$ value for the experimental determination of $\eta_B$. The two parameters $c_1$ and $c_2$ have been fixed at $0.01$, while two values for $m_\text{light}$ have been considered, $m_\text{light}=0.006\;\text{eV}$ for the first two plots and $m_\text{light}=0.2\;\text{eV}$ for the one on the right. Each point in the plots corresponds to a given random choice of the rest of parameters.} \label{fig:CorrelationEtaB} \end{figure*} Focussing first on the normal hierarchical case (plot on the left), the points cover an area along the diagonal, with a small preference for $\eta_B$ at $T_\text{max}=10^{16}\;\text{GeV}$. Any fixed value of $\eta_B$ at $T_\text{max}=10^{16}\;\text{GeV}$ corresponds to the same values of $\eta_B$ at $T_\text{max}=10^{15}\;\text{GeV}$, whiting a factor $2\div3$. Moreover, there are points where the $\eta_B$ matches with the experimentally allowed regiones (inside the parallel continuous black lines) and many others where this does not occurs. This lets conclude that the value of $\eta_B$ strongly depends on the specific set of parameters, especially Majorana phases, considered, as already pointed out in Fig.~\ref{fig:EtaB}. Moreover, the value for $\eta_B$ with $T_\text{max}=10^{16}\;\text{GeV}$, where all the three sterile neutrinos contribute, are within a factor $2\div3$ similar to the ones for $\eta_B$ with $T_\text{max}=10^{15}\;\text{GeV}$, where only the lightest ones are relevant. The small preference for the region where $\eta_B$ with $T_\text{max}=10^{16}\;\text{GeV}$ indicates that the impact of the heaviest sterile neutrino is often not negligible and slightly increases the final value of $\eta_B$. It follows that Fig.~\ref{fig:EtaB}(a), where the points show that $\eta_B$ spans a few order of magnitudes, is a good representative for this scenario with $T_\text{max}=10^{16\div15}\;\text{GeV}$ and for a hierarchical spectrum. For the inverse hierarchical case (plot in the middle), the largest majority of the points cover the region for $\eta_B$ with $T_\text{max}=10^{16}\;\text{GeV}$, indicating that the heaviest sterile neutrino typically contributes to the final value of $\eta_B$, increasing its value. Moreover, only for $T_\text{max}=10^{16}\;\text{GeV}$, $\eta_B$ reaches the experimentally allowed region, indicating that the heaviest sterile neutrino contributions are necessary. As a result, Fig.~\ref{fig:EtaB}(b) fairly represents only the case with $T_\text{max}=10^{16}\;\text{GeV}$. Finally, focussing to the degenerate spectrum (plot on the right), all the points strictly align with the diagonal, indicating that $\eta_B$ does not change for $T_\text{max}=10^{15}\;\text{GeV}$ or $10^{16}\;\text{GeV}$. This was expected because for $m_\text{light}=0.2\;\text{eV}$ all the three sterile neutrinos have masses below $T_\text{max}=10^{15}\;\text{GeV}$ and therefore are the three of them thermally generated. Both the plots in Fig.~\ref{fig:EtaB} well represent this scenario with $T_\text{max}=10^{16\div15}\;\text{GeV}$ for the degenerate spectrum. The plots equivalent to those in Figs.~\ref{fig:EtaB} and \ref{fig:CorrelationMajorana}(a) for $T_\text{max}=10^{15}\;\text{GeV}$ can be found in App.~\ref{APPENDIX}. As can be seen, the NO case is essentially unaffected by the change of the temperature, while the IO one presents a difference for small values of $m_\text{light}$ where $\eta_B$ does not reach the experimental band. \subsection{Low-energy phenomenology} The reduction of the allowed parameter space for the Majorana phases in the $c_1=c_2=0.01$ case, Fig.~\ref{fig:CorrelationMajorana}, has an impact on the predictions for the neutrinoless double beta decay effective mass $m_{ee}$, defined by \begin{equation} \hspace{-0.5cm} \left|m_{ee}\right|=\left|c_{13}^2\,c_{12}^2\,m_{\nu_1}+c_{13}^2\,s_{12}^2\,m_{\nu_2}\,e^{i\alpha_{21}}+s_{13}^2\,m_{\nu_3}\,e^{i(\alpha_{31}-2\delta_\text{CP}^\ell)}\right|\,, \end{equation} where $c_{ij}$ and $s_{ij}$ stand for $\cos\theta_{ij}$ and $\sin\theta_{ij}$, respectively. The investigation on this decay has received a strong impulse in the last decades and numerous experiments are currently competing to probe the existence of this process, as its observation would automatically infer that neutrinos have (at least partly) Majorana nature~\cite{Schechter:1981bd}. Tab.~\ref{tab:0nu2betaExp} reports the lower bounds on $|m_{ee}|$ sensitivity for near future $0\nu2\beta$ experiments that will be considered in the following. \begin{table}[h!] \begin{center} \begin{tabular}{l|c|c|} Experiment & Isotope & $|m_{ee}|\,[\;\text{eV}]$ \\[1mm] \hline &&\\[-2mm] CUORE~\cite{Artusa:2014lgv} & ${}^{130}$Te & $0.073\pm0.008$ \\[1mm] GERDA-II~\cite{Brugnera:2013xma} & ${}^{76}$Ge & $0.11\pm0.01$ \\[1mm] LUCIFER~\cite{Pattavina:2016kqn} & ${}^{82}$Se & $0.20\pm0.02$ \\[1mm] MAJORANA D.~\cite{Abgrall:2013rze} & ${}^{76}$Ge & $0.13\pm0.01$ \\[1mm] NEXT~\cite{Laing:2016puy} & ${}^{136}$Xe & $0.12\pm0.01$ \\[1mm] AMoRE~\cite{Jo:2017jod} & ${}^{100}$Mo & $0.084\pm0.008$ \\[1mm] nEXO~\cite{Pocar:2015ota} & ${}^{136}$Xe & $0.011\pm0.001$ \\[1mm] PandaX-III~\cite{Chen:2016qcd} & ${}^{136}$Xe & $0.082\pm0.009$ \\[1mm] SNO+~\cite{Andringa:2015tza} & ${}^{130}$Te & $0.076\pm0.007$ \\[1mm] SuperNEMO~\cite{Arnold:2015wpy} & ${}^{82}$Se & $0.084\pm0.008$ \\[1mm] \hline \end{tabular} \end{center} \caption{\footnotesize\it Lower bounds for $|m_{ee}|$ for the next future sensitivities and/or experiments on $0\nu2\beta$ decay.} \label{tab:0nu2betaExp} \end{table} \begin{figure*} \centering \subfloat[$|m_{ee}|$ {\it vs} $m_\text{light}$ for the NO case \label{fig:LowEnergyMeea}] {\includegraphics[width=0.45\textwidth]{meevsmlightNO}} \hfil \subfloat[$|m_{ee}|$ {\it vs} $m_\text{light}$ for the IO case \label{fig:LowEnergyMeeb}] {\includegraphics[width=0.45\textwidth]{meevsmlightIO}}\\ \subfloat[$|m_{ee}|$ {\it vs} $\alpha_{21}$ for the NO case \label{fig:LowEnergyMeec}] {\includegraphics[width=0.45\textwidth]{meevsmaj1NO}}\\ \subfloat[$|m_{ee}|$ {\it vs} $\alpha_{21}$ for the IO case \label{fig:LowEnergyMeed}] {\includegraphics[width=0.45\textwidth]{meevsmaj1IO}} \hfil \subfloat[$|m_{ee}|$ {\it vs} $\alpha_{31}$ for the IO case \label{fig:LowEnergyMeee}] {\includegraphics[width=0.45\textwidth]{meevsmaj2IO}} \caption{\footnotesize\em $|m_{ee}|$ as a function of $m_\text{light}$ in a) for the NO case and in b) for the IO one. $|m_{ee}|$ as a function of the Majorana phases for the NO case in c) and for the IO one in d) and e).} \label{fig:LowEnergyMee} \end{figure*} Fig.~\ref{fig:LowEnergyMee} shows the profile of $|m_{ee}|$ as a function of the lightest active neutrino mass $m_\text{light}$ in \ref{fig:LowEnergyMeea} for the NO and in \ref{fig:LowEnergyMeeb} for the IO, while as a function of the Majorana phases in \ref{fig:LowEnergyMeec} for the NO and in \ref{fig:LowEnergyMeed} and \ref{fig:LowEnergyMeee} for the IO. For both the mass orderings, describing successfully the amount of BAU leaves viable only the hierarchical regime. For the NO, Fig.~\ref{fig:LowEnergyMeea}, $|m_{ee}|$ can take values only below $0.04\;\text{eV}$, while a lower bound at about $4\times 10^{-4}\;\text{eV}$ seems plausible, as confirmed in Fig.~\ref{fig:LowEnergyMeec}, although the point density is poor in this region: interestingly, it appears a region precluded for $0.0095\;\text{eV}\lesssimm_\text{light}\lesssim0.035\;\text{eV}$. For the IO, Fig.~\ref{fig:LowEnergyMeeb}, the parameter space corresponding to $\eta_B$ inside its experimental determination at $3\sigma$ is confined in a well-defined region between $0.005\;\text{eV}\lesssimm_\text{light}\lesssim0.01\;\text{eV}$ and $0.018\;\text{eV}\lesssim|m_{ee}|\lesssim0.05\;\text{eV}$. Complementary information can be extracted in the plots with $|m_{ee}|$ as a function of the Majorana phases. For the NO, Fig.~\ref{fig:LowEnergyMeec}, only $|m_{ee}|$ {\em vs} $\alpha_{21}$ shows a correlation: only values for $\alpha_{21}$ in the interval $~[\pi/8,\,3\pi/4]$ leads to larger values of $|m_{ee}|$, while smaller values may be described for almost any $\alpha_{21}$. For the IO, Figs.~\ref{fig:LowEnergyMeed} and \ref{fig:LowEnergyMeee}, a correlation between $|m_{ee}|$ and both the Majorana phases is present and the allowed parameter space is limited in relatively small regions. An observation of the neutrinoless double beta decay in the present experiments, if fully interpreted in terms of Majorana neutrino exchange, would be crucial to determine the values of the Majorna phases for which a successful BAU occurs. Once determined the ordering of the active neutrino mass spectrum, a larger value for $|m_{ee}|$ would favour values of $\alpha_{21}$ in the interval $\sim[\pi/8,\,3\pi/4]$ for the NO and $\sim[-\pi/2,\,\pi/2]$ in the IO, and values of $\alpha_{31}$ in the interval $\sim[\pi/8,\,\pi]$ in the only IO. The determination of the value for the lightest active neutrino mass would help reducing these interval: if $m_\text{light}$ is found relatively large, then only the NO scenario would be compatible with a successful explanation of the BAU, while the IO case would be then excluded. \section{Conclusions} \label{Sect:Conc} The MFV ansatz works extraordinary well in the quark sector accommodating a huge amount of experimental measurements. If an underlying dynamics is the reason behind this hypothesis, then it is natural to expect a similar mechanism at work also in the lepton sector. Two distinct versions of the MLFV can be considered when the SM spectrum is extended by the three RH neutrinos: only if the latter transform under the same symmetry of the lepton electroweak doublets~\cite{Alonso:2013mca}, $SU(3)_{\ell_L}\times SU(3)_{N_R}\to SU(3)_V$, then violation of the CP symmetry can be described according to the recent experimental indication. The presence of non-vanishing CP violating phases in the leptonic mixing may be the missing ingredient in the SM to successfully describe the baryon asymmetry in the Universe. In this paper, baryogenesis through Leptogenesis has been considered for the first time within the context of the $SU(3)_V$ MLFV framework, resulting in a very predictive setup where the $\varepsilon$ parameter that describes the amount of CP violation in Leptogenesis only depends on low-energy parameters: charged lepton and active neutrino masses, PMNS parameters and two parameters of the low-energy effective description. Fixing the two effective parameters at their natural value $0.01$, when a baryon to photon ratio today agrees with its experimental determination at $3\sigma$ then correlations between the Majorana phases and the lightest active neutrino mass arise. The latter can be analysed considering the impact in the neutrinoless double beta decay observable: only selected regions of the whole $|m_{ee}|$ {\it vs} $m_\text{light}$ parameter space correspond to values that are consistent with a successful baryogenesis. In the NO case, only upper bounds on $|m_{ee}|$ and $m_\text{light}$ can be identified: $|m_{ee}|\lesssim0.04\;\text{eV}$ and $m_\text{light}\lesssim0.04\;\text{eV}$. Instead, in the IO case, $|m_{ee}|$ can take values only inside a much smaller interval $[0.02,\,0.05]\;\text{eV}$ corresponding to a narrow interval for $m_\text{light}$ that is $[0.004,\,0.012]\;\text{eV}$. These regions will be tested only in several years as the sensitivity required is of the order of that one expected by the nEXO experiment. \vspace{1.3cm} \begin{center} \rule{5cm}{0.4pt} \end{center} \acknowledgments The authors warmly thank Pasquale di Bari, Mattias Blennow, Enrique Fern\'andez Mart\'inez, Pilar Hern\'andez, Olga Mena and Nuria Rius for discussions and suggestions. They also thank the HPC-Hydra cluster at IFT. L.M. thanks the department of Physics and Astronomy of the Universit\`a degli Studi di Padova and the Fermilab Theory Division for hospitality during the writing up of the paper. L.M. acknowledges partial financial support by the Spanish MINECO through the ``Ram\'on y Cajal'' programme (RYC-2015-17173), by the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreements No 690575 and No 674896, and by the Spanish ``Agencia Estatal de Investigaci\'on'' (AEI) and the EU ``Fondo Europeo de Desarrollo Regional'' (FEDER) through the project FPA2016-78645-P, and through the Centro de excelencia Severo Ochoa Program under grant SEV-2016-0597.
\section{Introduction} \label{section_intro} Galton--Watson processes with immigration have been frequently used for modeling the sizes of a population over time, so a delicate description of their tail behavior is an important question. In this paper we focus on regularly varying not necessarily stationary Galton--Watson processes with immigration, complementing the results of Basrak et al. \cite{BasKulPal} for the stationary case. By a Galton--Watson process with immigration, we mean a stochastic process \ $(X_n)_{n\geq0}$ \ given by \begin{equation}\label{GWI} X_n = \sum_{i=1}^{X_{n-1}} \xi_{n,i} + \vare_n , \qquad n \geq 1 , \end{equation} where \ $\bigl\{X_0, \, \xi_{n,i}, \, \vare_n : n, i \geq 1 \bigr\}$ \ are supposed to be independent non-negative integer-valued random variables, \ $\{\xi_{n,i} : n, i \geq 1\}$ \ and \ $\{\vare_n : n \geq 1\}$ \ are supposed to consist of identically distributed random variables, respectively, and \ $\sum_{i=1}^0 := 0$. \ If \ $\vare_n = 0$, \ $n \geq 1$, \ then we say that \ $(X_n)_{n\geq0}$ \ is a Galton--Watson process (without immigration). Basrak et al.\ \cite{BasKulPal} studied stationary Galton--Watson processes with immigration and gave conditions under which the stationary distribution is regularly varying. In the special case of \ $\PP(\xi_{1,1} = \varrho) = 1$ \ with some non-negative integer \ $\varrho$, \ $(X_n)_{n\geq 0}$ \ is nothing else but a first order autoregressive process having the form \ $X_n = \varrho X_{n-1} + \vare_n$, \ $n \geq 1$. \ There is a vast literature on the tail behavior of weighted sums of independent and identically distributed regularly varying random variables, especially, of first order autoregressive processes with regularly varying noises, see, e.g., Embrechts et al.\ \cite[Appendix A3.3]{EmbKluMik}. For instance, in the special case mentioned before, Proposition \ref{GWI_vare} with \ $\PP(X_0 = 0) = 1$ \ gives the result of Lemma A3.26 in Embrechts et al. \cite{EmbKluMik}, since then \ $X_n = \sum_{i=1}^n \varrho^{n-i} \vare_i$, \ $n \geq 1$. In Section \ref{section_GWI}, we present conditions on the initial, offspring and immigration distributions under which the distribution of a not necessarily stationary Galton--Watson process with immigration is regularly varying at any fixed time describing the precise tail behavior of the distribution in question as well. The proofs are delicate applications of Fa\"y et al.\ \cite[Proposition 4.3]{GilGAMikSam} (see Proposition \ref{FGAMS}), Robert and Segers \cite[Theorem 3.2]{RobSeg} (see Proposition \ref{RS}) and Denisov et al.\ \cite[Theorems 1 and 7]{DenFosKor} (see Propositions \ref{DFK0} and \ref{DFK}). We close the paper with four appendicies: in Appendix \ref{section_prel} we recall representations of Galton--Watson process without or with immigration; Appendix \ref{App_moments} is devoted to higher moments of Galton--Watson processes; in Appendix \ref{App1} we collect some properties of regularly varying functions and distributions used in the paper; and in Appendix \ref{App_rvrs} we recall the results of Fa\"y et al.\ \cite[Proposition 4.3]{GilGAMikSam}, Robert and Segers \cite[Theorem 3.2]{RobSeg}, Denisov et al.\ \cite[Theorems 1 and 7]{DenFosKor} and some of their consequences. Later on, one may also investigate other tail properties such as intermediate regular variation. Motivated by Bloznelis \cite{Blo}, one may study the asymptotic behavior of the so called local probabilities \ $\PP(X_n = \ell)$ \ as \ $\ell \to \infty$ \ for any fixed \ $n \in \NN$. \section{Tail behavior of Galton--Watson processes with immigration} \label{section_GWI} Let \ $\ZZ_+$, \ $\NN$, \ $\RR$, \ $\RR_+$ \ and \ $\RR_{++}$ \ denote the set of non-negative integers, positive integers, real numbers, non-negative real numbers and positive real numbers, respectively. For \ $x, y \in \RR$, \ we will use the notations \ $x \land y := \min(x, y)$ \ and \ $x \lor y := \max(x, y)$. \ For functions \ $f : \RR_{++} \to \RR_{++}$ \ and \ $g : \RR_{++} \to \RR_{++}$, \ by the notation \ $f(x) \sim g(x)$, \ $f(x) = \oo(g(x))$ \ and \ $f(x) = \OO(g(x))$ \ as \ $x \to \infty$, \ we mean that \ $\lim_{x\to\infty} \frac{f(x)}{g(x)} = 1$, \ $\lim_{x\to\infty} \frac{f(x)}{g(x)} = 0$ \ and \ $\limsup_{x\to\infty} \frac{f(x)}{g(x)} < \infty$, \ respectively. Every random variable will be defined on a probability space \ $(\Omega, \cA, \PP)$. \ Equality in distribution of random variables is denoted by \ $\distre$. \ For notational convenience, let \ $\xi$ \ and \ $\vare$ \ be random variables such that \ $\xi \distre \xi_{1,1}$ \ and \ $\vare \distre \vare_1$, and put \ $m_\xi := \EE(\xi) \in [0, \infty]$ \ and \ $m_\vare := \EE(\vare) \in [0, \infty]$. First, we consider the case of regularly varying offspring distribution. \begin{Pro}\label{GWI_xi} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $\xi$ \ is regularly varying with index \ $\alpha \in [1, \infty)$ \ and there exists \ $r \in (\alpha, \infty)$ \ with \ $\EE(X_0^r) < \infty$ \ and \ $\EE(\vare^r) < \infty$. \ Suppose that \ $\PP(X_0 = 0) < 1$ \ or \ $\PP(\vare = 0) < 1$. \ In case of \ $\alpha = 1$, \ assume additionally that \ $m_\xi \in \RR_{++}$. \ Then for each \ $n \in \NN$, \ we have \[ \PP(X_n > x) \sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\alpha-1)} \PP(\xi > x) + m_\vare \sum_{i=1}^{n-1} m_\xi^{n-i-1} \sum_{j=0}^{n-i-1} m_\xi^{j(\alpha-1)} \PP(\xi > x) \] as \ $x \to \infty$, \ and hence \ $X_n$ \ is also regularly varying with index \ $\alpha$. \end{Pro} \noindent{\bf Proof.} Note that we always have \ $\EE(X_0) \in \RR_+$, \ $m_\xi \in \RR_{++}$ \ and \ $m_\vare \in \RR_+$. \ We use the representation \eqref{GWI_additive}. Recall that \ $\bigl\{V^{(n)}(X_0), V_i^{(n-i)}(\vare_i) : i \in \{1, \ldots, n\}\bigr\}$ \ are independent random variables such that \ $V^{(n)}(X_0)$ \ represents the number of individuals alive at time \ $n$, \ resulting from the initial individuals \ $X_0$ \ at time \ $0$, \ and for each \ $i \in \{1, \ldots, n\}$, \ $V_i^{(n-i)}(\vare_i)$ \ represents the number of individuals alive at time \ $n$, \ resulting from the immigration \ $\vare_i$ \ at time \ $i$. \ If \ $\PP(X_0 = 0) = 1$, \ then \ $\PP(V^{(n)}(X_0) = 0) = 1$, \ otherwise, by Proposition \ref{DFK_corr0}, we obtain \[ \PP(V^{(n)}(X_0) > x) \sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\alpha-1)} \PP(\xi > x) \qquad \text{as \ $x \to \infty$} \] once we show \begin{equation}\label{GW_VV} \PP(V_n > x) \sim m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\alpha-1)} \PP(\xi > x) \qquad \text{as \ $x \to \infty$,} \end{equation} where \ $(V_k)_{k\in\ZZ_+}$ \ is a Galton--Watson process (without immigration) with initial value \ $V_0 = 1$ \ and with the same offspring distribution as \ $(X_k)_{k\in\ZZ_+}$. \ We proceed by induction on \ $n$. \ For \ $n = 1$, \ \eqref{GW_VV} follows readily, since \ $V_1 = \xi_{1,1} \distre \xi$. \ Now let us assume that \eqref{GW_VV} holds for \ $1, \ldots, n - 1$, \ where \ $n \geq 2$. \ Since \ $(V_k)_{k\in\ZZ_+}$ \ is a time homogeneous Markov process with \ $V_1 = \xi_{1,1}$, \ we have \ $V_n \distre V^{(n-1)}(\xi_{1,1})$, \ where \ $(V^{(k)}(\xi_{1,1}))_{k\in\ZZ_+}$ \ is a Galton--Watson process (without immigration) with initial value \ $V^{(0)}(\xi_{1,1}) = \xi_{1,1}$ \ and with the same offspring distribution as \ $(X_k)_{k\in\ZZ_+}$. \ Applying again the additive property \eqref{GW_additive}, we obtain \[ V_n \distre V^{(n-1)}(\xi_{1,1}) \distre \sum_{i=1}^{\xi_{1,1}} \zeta_i^{(n-1)} , \] where \ $\{\zeta_i^{(n-1)} : i \in \NN\}$ \ are independent copies of \ $V_{n-1}$ \ such that \ $\{\xi_{1,1}, \zeta_i^{(n-1)} : i \in \NN\}$ \ are independent. First note that \ $\PP(\zeta_1^{(n-1)} > x) = \OO(\PP(\xi > x))$ \ as \ $x \to \infty$. \ Indeed, using the induction hypothesis, we obtain \[ \limsup_{x\to\infty} \frac{\PP(\zeta_1^{(n-1)} > x)}{\PP(\xi > x)} = \limsup_{x\to\infty} \frac{\PP(V_{n-1} > x)}{\PP(\xi > x)} = m_\xi^{n-2} \sum_{i=0}^{n-2} m_\xi^{i(\alpha-1)} < \infty . \] Now we can apply Proposition \ref{DFK_corr}, and we obtain \begin{align*} \PP(V_n > x) = \PP\left(\sum_{i=1}^{\xi_{1,1}} \zeta_i^{(n-1)} > x\right) &\sim \EE(\xi_{1,1}) \PP(\zeta_1^{(n-1)} > x) + (\EE(\zeta_1^{(n-1)}))^\alpha \PP(\xi_{1,1} > x) \\ &\sim m_\xi \PP(V_{n-1} > x) + m_\xi^{(n-1)\alpha} \PP(\xi > x) \end{align*} as \ $x \to \infty$, \ since, by \eqref{GWI_EX}, \ $\EE(\zeta_1^{(n-1)}) = m_\xi^{n-1} \in \RR_{++}$. \ Using the induction hypothesis and \ $m_\xi^{(n-1)\alpha} = m_\xi^{n-1} m_\xi^{(n-1)(\alpha-1)}$, \ we conclude \eqref{GW_VV}. If \ $\PP(\vare = 0) = 1$, \ then for each \ $i \in \{1, \ldots, n\}$, \ $\PP(V_i^{(n-i)}(\vare_i) = 0) = 1$. \ Otherwise, for each \ $i \in \{1, \ldots, n - 1\}$, \ by \eqref{GW_VV} and Proposition \ref{DFK_corr0}, we obtain \ $\PP(V_i^{(n-i)}(\vare_i) > x) \sim m_\vare \PP(V_{n-i} > x)$ \ as \ $x \to \infty$, \ and \ $V_n^{(0)}(\vare_n) = \vare_n$. Applying the convolution property in Lemma \ref{Lem_conv} and \eqref{GW_VV}, we conclude the statement. \proofend The result of Proposition \ref{GWI_xi} in the special case of \ $\PP(X_0 = 1) = 1$, \ $\alpha \in (1, 2)$, \ $m_\xi \in (0, 1)$ \ and \ $\PP(\vare = 0) = 1$ \ has already been derived by Basrak et al.\ \cite[page 426]{BasKulPal} written it in an equivalent form \[ \PP(X_n > x) \sim m_\xi^{(n-1)\alpha} \sum_{i=0}^{n-1} m_\xi^{i(1-\alpha)} \PP(\xi > x) \qquad \text{as \ $x \to \infty$} \] for all \ $n \in \NN$. Note that Denisov et al.\ \cite[Corollary 2]{DenFosKor} proved that \[ \PP(X_2 > x) \sim m_\xi \PP(\xi > x) + \PP\biggl(\xi > \frac{x}{m_\xi}\biggr) \qquad \text{as \ $x \to \infty$} \] if \ $(X_n)_{n\in\ZZ_+}$ \ is a Galton--Watson process (without immigration) such that \ $X_0 = 1$, \ $\xi$ \ is intermediate regularly varying \ and \ $m_\xi \in \RR_{++}$, \ and, by induction arguments, for each \ $n \in \NN$, \ $\PP(X_n > x) \sim n \PP(\xi > x)$ \ if, in addition, \ $m_\xi = 1$. \ Further, Wachtel et al.\ \cite[formula (5.1)]{WacDenKor} mentioned that for each \ $n \in \NN$, \begin{equation}\label{WDK(5.1)} \PP\biggl(\frac{X_n}{m_\xi^n} > x\biggr) \sim \sum_{i=0}^{n-1} m_\xi^i \PP(\xi > m_\xi^{i+1} x) \qquad \text{as \ $x \to \infty$} \end{equation} if \ $(X_n)_{n\in\ZZ_+}$ \ is a Galton--Watson process (without immigration) such that \ $X_0 = 1$, \ $\xi$ \ is intermediate regularly varying \ and \ $m_\xi > 1$. \ These results for regularly varying \ $\xi$ \ are consequences of Proposition \ref{GWI_xi}. In fact, Wachtel et al.\ \cite[Theorem 1]{WacDenKor} showed that \eqref{WDK(5.1)} holds uniformly in \ $n$, \ and, in particular, \[ \PP\biggl(\frac{X_n}{m_\xi^n} > x\biggr) \sim \sum_{i=0}^\infty m_\xi^i \PP(\xi > m_\xi^{i+1} x) \qquad \text{as \ $x, n \to \infty$.} \] Next, we consider the case of regularly varying initial distribution. \begin{Pro}\label{GWI_X_0} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $X_0$ \ is regularly varying with index \ $\beta \in \RR_+$, \ $\PP(\xi = 0) < 1$ \ and there exists \ $r \in (1 \lor \beta, \infty)$ \ with \ $\EE(\xi^r) < \infty$ \ and \ $\EE(\vare^r) < \infty$. \ Then for each \ $n \in \NN$, \ we have \[ \PP(X_n > x) \sim m_\xi^{n\beta} \PP(X_0 > x) \qquad \text{as \ $x \to \infty$,} \] and hence \ $X_n$ \ is also regularly varying with index \ $\beta$. \end{Pro} \noindent{\bf Proof.} Let us fix \ $n \in \NN$. \ We use the representation \eqref{GWI_additive}. In view of the convolution property in Lemma \ref{Lem_conv}, it is enough to prove \[ \PP(V^{(n)}(X_0) > x) \sim m_\xi^{n\beta} \PP(X_0 > x) \qquad \text{as \ $x \to \infty$,} \] since by Lemma \ref{Lem_seged_momentr}, for each \ $i \in \{1, \ldots, n\}$, \ we have \ $\EE((V_i^{(n-i)}(\vare_i))^r) < \infty$ \ yielding \ $\EE((\sum_{i=1}^n V_i^{(n-i)}(\vare_i))^r) < \infty$. \ By the additive property \eqref{GW_additive}, we have \ $V^{(n)}(X_0) \distre \sum_{i=1}^{X_0} \zeta_i^{(n)}$. \ By \eqref{GWI_EX}, \ $\EE(\zeta_1^{(n)}) = m_\xi^n \in \RR_{++}$, \ and by Lemma \ref{Lem_seged_momentr}, we have \ $\EE((\zeta_1^{(n)})^r) < \infty$. \ The statement is a consequence of Proposition \ref{FGAMSRS}. \proofend \begin{Pro}\label{GWI_X_0_xi} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $X_0$ \ and \ $\xi$ \ are regularly varying with index \ $\beta \in [1, \infty)$ \ and \ $\PP(\xi > x) = \OO(\PP(X_0 > x))$ \ as \ $x \to \infty$ \ and there exists \ $r \in (\beta, \infty)$ \ such that \ $\EE(\vare^r) < \infty$. \ In case of \ $\beta = 1$, \ assume additionally that \ $\EE(X_0) \in \RR_{++}$ \ and \ $m_\xi \in \RR_{++}$. \ Then for each \ $n \in \NN$, \ we have \begin{align*} \PP(X_n > x) &\sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\beta-1)} \PP(\xi > x) + m_\xi^{n\beta} \PP(X_0 > x) \\ &\quad + m_\vare \sum_{i=1}^{n-1} m_\xi^{n-i-1} \sum_{j=0}^{n-i-1} m_\xi^{j(\beta-1)} \PP(\xi > x) \end{align*} as \ $x \to \infty$, \ and hence \ $X_n$ \ is also regularly varying with index \ $\beta$. \end{Pro} \noindent{\bf Proof.} Let us fix \ $n \in \NN$. \ Note that we always have \ $\EE(X_0) \in \RR_{++}$ \ and \ $m_\xi \in \RR_{++}$. \ We use the representation \eqref{GWI_additive}. By \eqref{GW_VV}, \ $V_n$ \ is regularly varying with index \ $\beta$. \ By the assumption \ $\PP(\xi > x) = \OO(\PP(X_0 > x))$ \ as \ $x \to \infty$ \ and \eqref{GW_VV}, we conclude \ $\PP(V_n > x) = \OO(\PP(X_0 > x))$ \ as \ $x \to \infty$. \ By Proposition \ref{DFK_corr} and \ $\EE(V_n) = m_\xi^n \in \RR_{++}$, \ we obtain \[ \PP(V^{(n)}(X_0) > x) \sim \EE(X_0) \PP(V_n > x) + (\EE(V_n))^\beta \PP(X_0 > x) \qquad \text{as \ $x \to \infty$.} \] If \ $\PP(\vare = 0) = 1$, \ then for each \ $i \in \{1, \ldots, n\}$, \ $\PP(V_i^{(n-i)}(\vare_i) = 0) = 1$. \ Otherwise, for each \ $i \in \{1, \ldots, n - 1\}$, \ by \eqref{GW_VV} and Proposition \ref{DFK_corr0}, we obtain \ $\PP(V_i^{(n-i)}(\vare_i) > x) \sim m_\vare \PP(V_{n-i} > x)$ \ as \ $x \to \infty$, \ and \ $V_n^{(0)}(\vare_n) = \vare_n$. \ Applying \eqref{GW_VV} and the convolution property, we conclude the statement. \proofend Now, we consider the case of regularly varying immigration distribution. \begin{Pro}\label{GWI_vare} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $\vare$ \ is regularly varying with index \ $\gamma \in \RR_+$, \ $\PP(\xi = 0) < 1$ \ and there exists \ $r \in (1 \lor \gamma, \infty)$ \ with \ $\EE(\xi^r) < \infty$ \ and \ $\EE(X_0^r) < \infty$. \ Then for each \ $n \in \NN$, \ we have \[ \PP(X_n > x) \sim \sum_{i=1}^n m_\xi^{(n-i)\gamma} \PP(\vare > x) \qquad \text{as \ $x \to \infty$,} \] and hence \ $X_n$ \ is also regularly varying with index \ $\gamma$. \end{Pro} \noindent{\bf Proof.} Let us fix \ $n \in \NN$. \ We use the representation \eqref{GWI_additive}. By Lemma \ref{Lem_seged_momentr}, we have \ $\EE((V^{(n)}(X_0))^r) < \infty$. \ For each \ $i \in \{1, \ldots, n\}$, \ applying Proposition \ref{GWI_X_0} with \ initial distribution \ $\vare$ \ and without immigration, we obtain \[ \PP(V_i^{(n-i)}(\vare_i) > x) \sim m_\xi^{(n-i)\gamma} \PP(\vare > x) \qquad \text{as \ $x \to \infty$.} \] By the convolution property in Lemma \ref{Lem_conv}, we conclude the statement. \proofend \begin{Pro}\label{GWI_xi_vare} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $\xi$ \ and \ $\vare$ \ are regularly varying with index \ $\gamma \in [1, \infty)$, \ $\PP(\xi > x) = \OO(\PP(\vare > x))$ \ as \ $x \to \infty$ \ and there exists \ $r \in (\gamma, \infty)$ \ with \ $\EE(X_0^r) < \infty$. \ In case of \ $\gamma = 1$, \ assume additionally that \ $m_\xi \in \RR_{++}$ \ and \ $m_\vare \in \RR_{++}$. \ Then for each \ $n \in \NN$, \ we have \begin{align*} \PP(X_n > x) &\sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\gamma-1)} \PP(\xi > x) \\ &\quad + m_\vare \sum_{j=1}^{n-1} m_\xi^{n-j-1} \sum_{i=0}^{n-j-1} m_\xi^{i(\gamma-1)} \PP(\xi > x) + \sum_{j=1}^n m_\xi^{(n-j)\gamma} \PP(\vare > x) \end{align*} as \ $x \to \infty$, \ and hence \ $X_n$ \ is also regularly varying with index \ $\gamma$. \end{Pro} \noindent{\bf Proof.} Let us fix \ $n \in \NN$. \ Note that we always have \ $\EE(X_0) \in \RR_+$, \ $m_\xi \in \RR_{++}$ \ and \ $m_\vare \in \RR_{++}$. \ We use the representation \eqref{GWI_additive}. If \ $\PP(X_0 = 0) = 1$, \ then \ $\PP(V^{(n)}(X_0) = 0) = 1$, \ otherwise, applying Proposition \ref{GWI_xi} without immigration, we obtain \[ \PP(V^{(n)}(X_0) > x) \sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\gamma-1)} \PP(\xi > x) \qquad \text{as \ $x \to \infty$.} \] For each \ $i \in \{1, 2, \ldots, n - 1\}$, \ by \eqref{GW_VV}, \ $V_{n-i}$ \ is regularly varying with index \ $\gamma$, \ and hence, by Proposition \ref{DFK_corr}, we get \[ \PP(V^{(n-i)}_i(\vare_i) > x) \sim m_\vare \PP(V_{n-i} > x) + (\EE(V_{n-i}))^\gamma \PP(\vare > x) \qquad \text{as \ $x \to \infty$.} \] Since \ $V^{(0)}_n(\vare_n) = \vare_n$ \ and \ $V_0 = 1$, \ the above asymptotics is valid for \ $i = n$ \ as well. Applying again \eqref{GW_VV} and the convolution property in Lemma \ref{Lem_conv} together with the fact that \ $\EE(V_{n-i}) = m_\xi^{n-i}$ \ for all \ $i \in \{1, 2, \ldots, n\}$, \ we conclude the statement. \proofend \begin{Pro}\label{GWI_X_0_vare} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $X_0$ \ and \ $\vare$ \ are regularly varying with index \ $\gamma \in \RR_+$, \ $\PP(\xi = 0) < 1$ \ and there exists \ $r \in (1 \lor \gamma, \infty)$ \ with \ $\EE(\xi^r) < \infty$. \ Then for each \ $n \in \NN$, \ we have \[ \PP(X_n > x) \sim m_\xi^{n\gamma} \PP(X_0 > x) + \sum_{i=1}^n m_\xi^{(n-i)\gamma} \PP(\vare > x) \qquad \text{as \ $x \to \infty$,} \] and hence \ $X_n$ \ is also regularly varying with index \ $\gamma$. \end{Pro} \noindent{\bf Proof.} We use the representation \eqref{GWI_additive}. Applying Proposition \ref{GWI_X_0} first with \ $X_0$ \ and then with \ $X_0 \distre \vare$ \ (in both cases without immigration), then the convolution property in Lemma \ref{Lem_conv}, we conclude the statement. \proofend \begin{Pro}\label{GWI_X_0_xi_vare_3} Let \ $(X_n)_{n\in\ZZ_+}$ \ be a Galton--Watson process with immigration such that \ $X_0$, \ $\xi$ \ and \ $\vare$ \ are regularly varying with index \ $\beta \in [1, \infty)$, \ $\PP(\xi > x) = \OO(\PP(X_0 > x))$ \ as \ $x \to \infty$ \ and \ $\PP(\xi > x) = \OO(\PP(\vare > x))$ \ as \ $x \to \infty$. \ In case of \ $\beta = 1$, \ assume additionally that \ $\EE(X_0) \in \RR_{++}$, \ $m_\xi \in \RR_{++}$ \ and \ $m_\vare \in \RR_+$. \ Then for each \ $n \in \NN$, \ we have \begin{align*} \PP(X_n > x) &\sim \EE(X_0) m_\xi^{n-1} \sum_{i=0}^{n-1} m_\xi^{i(\beta-1)} \PP(\xi > x) + m_\xi^{n\beta} \PP(X_0 > x) \\ &\quad + m_\vare \sum_{j=1}^{n-1} m_\xi^{n-j-1} \sum_{i=0}^{n-j-1} m_\xi^{i(\beta-1)} \PP(\xi > x) + \sum_{j=1}^n m_\xi^{(n-j)\beta} \PP(\vare > x) \end{align*} as \ $x \to \infty$, \ and hence \ $X_n$ \ is also regularly varying with index \ $\beta$. \end{Pro} \noindent{\bf Proof.} Let us fix \ $n \in \NN$. \ We use the representation \eqref{GWI_additive}. Applying Proposition \ref{GWI_X_0_xi} first with \ $X_0$ \ and then with \ $X_0 \distre \vare$ \ (in both cases without immigration), and then the convolution property in Lemma \ref{Lem_conv}, we conclude the statement. \proofend \begin{Rem} Note that the situation when \ $(X_n)_{n\in\ZZ_+}$ \ is a Galton--Watson process with immigration such that \ $\xi$ \ is regularly varying with index \ $\alpha \in [1, \infty)$, \ $X_0$ \ is regularly varying with index \ $\beta \in (\alpha, \infty)$, \ $\PP(\xi = 0) < 1$ \ and there exists an \ $r \in (\beta, \infty)$ \ such that \ $\EE(\vare^r) < \infty$ \ is covered by Proposition \ref{GWI_xi}, since then \ $\EE(X_0^\tr) < \infty$ \ for all \ $\tr \in (\alpha, \beta)$. \ Moreover, the situation when \ $(X_n)_{n\in\ZZ_+}$ \ is a Galton--Watson process with immigration such that \ $X_0$ \ is regularly varying with index \ $\beta \in \RR_+$, \ $\xi$ \ is regularly varying with index \ $\alpha \in (1 \lor \beta, \infty)$ \ and there exists \ $r \in (1 \lor \beta, \infty)$ \ with \ $\EE(\vare^r) < \infty$ \ is covered by Proposition \ref{GWI_X_0}, since then \ $\PP(\xi = 0) < 1$ \ and \ $\EE(\xi^\tr) < \infty$ \ for all \ $\tr \in (1 \lor \beta, \alpha)$. \ The case of \ $\alpha = \beta$ \ is considered in Proposition \ref{GWI_X_0_xi}. One could formulate other special cases of our results. \proofend \end{Rem}
\section*{Acknowledgements} We thank Tim Willemse and John Fearnley for their helpful comments and Jaco van de Pol for the use of their computer cluster. \section{Introduction} \label{sec:introduction} \input{intro} \section{Preliminaries} \label{sec:preliminaries} \input{preliminaries} \section{Oink} \label{sec:oink} \input{theoink} \section{Strategy Improvement} \label{sec:si} \input{si} \section{Progress Measures} \label{sec:pm} \input{spm} \section{Zielonka's Recursive Algorithm} \label{sec:zielonka} \input{zielonka} \section{Priority Promotion} \label{sec:prioritypromotion} \input{prioprom} \section{Conclusions} \label{sec:conclusions} \input{conclusions} \clearpage \bibliographystyle{splncs03} \subsection{Solvers} We briefly introduce several approaches to solving parity games. These approaches can be roughly divided into two categories. \emph{First}, several algorithms iteratively perform local updates to vertices until a fixed point is reached. Each vertex is equipped with some measure which records the best game either player knows that they can play from that vertex so far. By updating measures based on the successors, they play the game backwards. The final measures indicate the winning player of each vertex and typically a winning strategy for one or both players. The \emph{strategy improvement} algorithm (Sec.~\ref{sec:si}) and the \emph{progress measures} algorithms (Sec.~\ref{sec:pm}) fall into this category. \emph{Second}, several algorithms employ attractor computation to partition the game into regions that share a certain property. This partition is refined until the winners of some or all vertices can be identified, as well as the strategy for the winning player(s). The \emph{recursive Zielonka} algorithm (Sec.~\ref{sec:zielonka}) and the recently proposed \emph{priority promotion} algorithms (Sec.~\ref{sec:prioritypromotion}) fall into this category. \subsection{Empirical evaluation} \label{sec:design} Our goal in the empirical study is three-fold. \emph{First}, we aim to compare modern algorithms and treat them fairly. We therefore need to establish that our implementation is competitive with existing work. \emph{Second}, we compare the algorithms that are implemented in Oink directly. \emph{Third}, as two algorithms have a parallel implementation, we also study the obtained parallel speedup and the parallel overhead when going from a sequential to a multi-core implementation. We use the parity game benchmarks from model checking and equivalence checking proposed by Keiren~\cite{DBLP:conf/fsen/Keiren15} that are publicly available online. This is a total of $313$ model checking and $216$ equivalence checking games. We also consider different classes of random games, in part because the literature on parity games tends to favor studying the behavior of algorithms on random games. We include three classes of self-loop-free random games generated using PGSolver with a fixed number of vertices: \begin{itemize} \item low out-degree random games (\texttt{randomgame N N 1 2 x}) \\ $N \in \{\, 100, 200, 500, 1000, 2000, 5000, 10000, 20000 \,\}$ \item fully random games (\texttt{randomgame N N 1 N x}) \\ $N \in \{\, 100, 500, 1000, 2000, 4000 \,\}$ \item low-degree steady games (\texttt{steadygame N 1 4 1 4})\\ $N \in \{\, 100, 200, 500, 1000, 2000, 5000, 10000, 20000 \,\}$ \end{itemize} We generate $20$ games for each parameter $N$, in total $420$ random games. We include low-degree games, since the solvers may behave differently on games where all vertices have few edges. We present the evaluation in two ways. We compare runtimes of algorithms and penalize algorithms that do not finish on time (with a timeout of $15$ minutes) by a factor $2\times$ (PAR2), i.e., we assume that their runtime is $2\times$ the timeout. This may still be quite optimistic. Compared to a timeout of $10$ minutes, only few more games could be solved in $15$ minutes. We also generate so-called \emph{cactus plots} (often used to compare solvers in the SAT community) that show that a solver solved $X$ models within $Y$ seconds individually. All experimental scripts and log files are available online via \url{http://www.github.com/trolando/oink-experiments}. The experiments were performed on a cluster of Dell PowerEdge M610 servers with two Xeon E5520 processors and 24GB internal memory each. The tools were compiled with gcc 5.4.0. \subsubsection{Empirical Evaluation} \begin{table}[t] \begin{tabu} to \linewidth {X[2]X[2r]X[c]X[2r]X[c]X[2r]X[c]X[2r]X[c]} \toprule & \multicolumn{2}{c}{Model checking} & \multicolumn{2}{c}{Equiv checking} & \multicolumn{2}{c}{Random games} & \multicolumn{2}{c}{Total} \\ \midrule \input{R/pp} \bottomrule \end{tabu} \vspace{.5em} \caption{Runtimes in sec. (PAR2) and number of timeouts (15 minutes) of the five priority promotion solvers in Oink.} \label{tbl:pp} \end{table} We compare our implementation of five variations of priority promotion in Oink. As we do not compare with other solvers, we enable the optional preprocessors that solve single parity games, remove self-loops and solve winner-controlled winning cycles. See Table~\ref{tbl:pp}. Overall, we see that the simplest solver \texttt{pp} performs just as good as the more complex solvers. The motivation for the variations is based on crafted families that require an exponential number of promotions. The \texttt{pp} solver may be most vulnerable to these crafted families, but on practical games and random games there is no significant difference. \subsubsection{Empirical evaluation} \begin{table}[t] \begin{tabu} to \linewidth {X[2]X[2r]X[c]X[2r]X[c]X[2r]X[c]X[2r]X[c]} \toprule & \multicolumn{2}{c}{Model checking} & \multicolumn{2}{c}{Equiv checking} & \multicolumn{2}{c}{Random games} & \multicolumn{2}{c}{Total} \\ \midrule \input{R/psi} \bottomrule \end{tabu} \vspace{.5em} \caption{Runtimes in sec. (PAR2) and number of timeouts (15 minutes) of the three solvers PGSolver (\texttt{pgsi}), the solver by Fearnley~\cite{DBLP:conf/cav/Fearnley17} with sequential (\texttt{parsi-seq}) and multi-core variants, and Oink with sequential (\texttt{psi}) and multi-core variants.} \label{tbl:psi} \end{table} We compare the performance of Oink with the sequential and parallel solvers ($1$ or $8$ threads) by Fearnley~\cite{DBLP:conf/cav/Fearnley17} and the ``optstratimprov'' solver in PGSolver. We disable optional preprocessing in all solvers. We only consider games without winner-controlled winning cycles, which are $289$ model checking, $182$ equivalence checking and $279$ random games, in total $750$ games. See Table~\ref{tbl:psi}. We observe that PGSolver is vastly outperformed by Oink and the sequential solver of Fearnley. PGSolver timed out for $160$ games, whereas \texttt{psi} and \texttt{parsi-seq} only timed out for $1$ and $5$ models, respectively. We observe similar parallel speedup for the parallel solvers, although Fearnley's solver has more overhead from sequential to parallel with $1$ thread. This might be due to the extra work to produce the Euler tour and to perform list ranking. The speedup we obtain with Oink is not very impressive, but the vast majority of the games are solved within $1$ second already. Furthermore, \texttt{psi} and \texttt{parsi-seq} are fairly close in performance. This is not a surprise, as their implementations are similar; the main difference is that Fearnley uses a forward search and we use a backward search. Hence, Oink is faster, but not by a large margin. Finally, we remark that Fearnley reports excellent results for list ranking on GPUs, whereas our algorithm is designed for a multi-core architecture. \subsection{Small progress measures} The original small progress measures algorithm is due to Jurdziński~\cite{DBLP:conf/stacs/Jurdzinski00}. We rely on the operational interpretation by Gazda and Willemse~\cite{DBLP:journals/corr/GazdaW15} and propose the \emph{cap-and-carryover} mechanism to further understand the algorithm. Progress measures record how favorable the game is for one of the players. W.l.o.g. we assume \emph{even} progress measures. Given the highest priority $d$, define $\mathbb{M}^\diamond \subseteq \mathbb{N}^d\cup\{\top\}$ to be the largest set containing $\top$ ($\top \notin \mathbb{N}^d$) and only those $d$-tuples with $0$ (denoted as $\_$) on \emph{odd} positions. An even progress measure $m\in\mathbb{N}^d$ essentially records for a vertex $v$ how often each even priority $p$ is encountered along the most optimal play (starting at $v$) so far, until a higher priority is encountered, i.e., until $p$ no longer dominates. Such a prefix of the play is called a $p$-dominated stretch. Suppose that the sequence of priorities for a given play $\pi$ is \underline{0}\underline{0}10\underline{2}1\underline{2}0\underline{2}321\underline{4}2\underline{6}5\underline{6}201, then $m=\{\, 2 \_ 3 \_ 1 \_ 2 \,\}$, since the play starts with a $0$-dominated stretch containing two $0$s, with a $2$-dominated stretch containing three $2$s, with a $4$-dominated stretch containing one $4$, and with a $6$-dominated stretch containing two $6$s. Furthermore, the special measure $\top$ represents that the vertex can be won by player Even. A total order $\sqsubset$ compares measures as follows. For non-$\top$ measures $m_1$ and $m_2$, $m_1 \sqsubset m_2$ iff there exists a highest priority $z = \max \,\{\, z \mid m_1(z) \neq m_2(z) \,\}$ and $m_1(z)<m_2(z)$. Furthermore, $m\sqsubset\top$ for all $m\neq\top$. We define a derived ordering $\sqsubset_p$ by restricting $z$ to priorities $\geq p$. Examples: \begin{center} \begin{tabu} to 0.7\linewidth {X[8r]X[l]X[8l]} $\{ 1 \_ 1 \_ 1 \}$ & $\sqsubset_0$ & $\{ 0 \_ 0 \_ 2 \}$ \\ $\{ 3 \_ 2 \_ 1 \}$ & $\sqsubset_0$ & $\{ 0 \_ 3 \_ 1 \}$ \\ $\{ 1 \_ 2 \_ 1 \}$ & $\sqsubseteq_1$ & $\{ 0 \_ 2 \_ 1 \}$ \\ $\{ 3 \_ 3 \_ 1 \}$ & $\sqsubseteq_4$ & $\{ 0 \_ 0 \_ 1 \}$ \\ \end{tabu} \end{center} To compute the progress measure for vertex $v$ when playing to vertex $w$, given current measures $\rho\colon V\to \mathbb{M}^\diamond$, we define $\text{Prog}(\rho, v, w)$ as follows: $$\text{Prog}(\rho, v, w) := \begin{cases} \min \{\, m \in \mathbb{M}^{\diamond} \mid m \sqsupset_{\textsf{pr}(v)} \rho(w) \,\} & \quad \textsf{pr}(v)\text{ is even} \\ \min \{\, m \in \mathbb{M}^{\diamond} \mid m \sqsupseteq_{\textsf{pr}(v)} \rho(w) \,\} & \quad \textsf{pr}(v)\text{ is odd} \\ \end{cases} $$ Prog computes the measure of the play obtained by playing from $v$ to the play recorded in $\rho(w)$. By choosing the lowest measure $m$ according to $\sqsupseteq_{\textsf{pr}(v)}$, we ensure that all $m(p)$ for $p <\textsf{pr}(v)$ are set to $0$. The inequality is strict for even priorities $\textsf{pr}(v)$ to ensure that $m(\textsf{pr}(v))$ increases. Player Even wants to achieve the highest measure, whereas player Odd wants to achieve the lowest measure. We define $\text{Lift}(\rho, v)$ as follows: $$\text{Lift}(\rho, v) = \begin{cases} \rho \,[\,{v \mapsto \max \{\, \rho(v), \max \{\, \text{Prog}(\rho, v, w) \;|\; v \rightarrow w \,\} \,\} }\,] & \quad \text{if } v \in V_{\Even} \\ \rho \,[\,{v \mapsto \max \{\, \rho(v), \min \{\, \text{Prog}(\rho, v, w) \;|\; v \rightarrow w \,\} \,\} }\,] & \quad \text{if } v \in V_{\Odd} \\ \end{cases} $$ By definition, the Lift operation increases measures monotonically. For the specific algorithm described here, we also observe that $\text{Prog}(\rho,v,w)\sqsupseteq_{\textsf{pr}(v)}\rho(w)$ and therefore Lift would even monotonically increase $\rho$ without taking the maximum of the current measure and the best updated successor measure in a lifting procedure that starts with $\rho=V\mapsto 0$. If we iteratively lift vertices from $\rho=V\mapsto 0$ using $\mathrm{Lift}$, eventually some vertex may have a measure $m$ such that $m(p)$ for some $p$ is higher than the number of vertices with priority $p$, i.e., $m(p) > \left\lvert V_p \right\rvert$. In this case, we know that $m$ represents a play that visits at least one vertex with priority $p$ twice and thus contains a cycle dominated by $p$. Furthermore, player Odd cannot escape from this cycle unless by playing to a higher losing priority. This follows from the fact that if player Odd could escape from the cycle, then it would not lift to this measure. The option to play to the higher losing priority is not considered because a measure to a higher priority is $\sqsupset$ a measure that records a cycle. We need a mechanism to let player Odd play to the next higher priority if it is forced into a cycle. However, we cannot let just any vertex play to a higher priority when its measure records a cycle, since some other vertex may escape to a lower higher priority. Therefore we need a mechanism that finds the lowest escape for player Odd. Small progress measures achieves this using a \emph{cap-and-carryover} mechanism. $\mathbb{M}^\diamond$ is restricted such that values for each even priority $p$ may not be higher than $\left\lvert V_p \right\rvert$. When this cap is reached, $\text{Prog}$ will naturally find a next higher $m$ by increasing the value of higher priorities and eventually reach $\top$. For example, if we have two vertices of priority 2 and two vertices of priority 4 in a game and there is a self-loop of priority 2, measures increase as follows: $\{ 0 \_ 2 \_ 0 \}$, $\{ 0 \_ 0 \_ 1 \}$, $\{ 0 \_ 1 \_ 1 \}$, $\{ 0 \_ 2 \_ 1 \}$, $\{ 0 \_ 0 \_ 2 \}$, $\{ 0 \_ 1 \_ 2 \}$, $\{ 0 \_ 2 \_ 2 \}$, $\top$. Thus all vertices involved in a cycle will find their measures slowly rising until the measure of some vertex controlled by Odd becomes equal to the measure when playing to a vertex that is not rising. This is the lowest escape. If no such escape is found, then the measures rise until $\top$ and these vertices are won by player Even. The slowly increasing measures no longer follow the operational interpretation described above, but can be understood as player Odd looking for the lowest escape. We refer to~\cite{DBLP:conf/stacs/Jurdzinski00} for the proof that the fixed point of applying the above lifting operation solves the parity game, such that vertices with measure $\top$ are won by player Even and all other vertices are won by player Odd with a strategy that chooses the successor for which $\text{Prog}(\rho, v, w)$ is the lowest. We implement three known improvements. Improvements~2 and~3 are also implemented by PGSolver~\cite{DBLP:conf/atva/FriedmannL09}. \begin{enumerate} \item When a vertex with some even priority $p$ is raised to $\top$, the cap of $p$ may be lowered. The reason is that if a play records priority $p$ $\left\lvert V_p \right\rvert$ times, it either contains a vertex now won by player Even or a cycle of priority $p$~\cite{Verver2013}. \item Small progress measures only computes the strategy for player Odd according to measures for player Even. We compute both \emph{even} and \emph{odd} measures simultaneously to compute the strategy for both players. \item In addition, we occasionally halt the lifting procedure to perform an attractor computation for player Even to the set of \emph{even}-liftable vertices. Any vertices not in this set are won by player Odd. We can immediately lift these vertices to $\top$ in the \emph{odd} measures. We perform this analysis also for \emph{odd}-liftable measures to potentially lift vertices to $\top$ in the \emph{even} measures. \end{enumerate} \subsection{Quasi-polynomial progress measures} \label{sec:qpt} Different types of progress measures were introduced after the recent breakthrough of a quasi-polynomial time algorithm due to Calude et al.~\cite{DBLP:conf/stoc/CaludeJKL017}, which resulted in the progress measures algorithms by Jurdziński et al.~\cite{DBLP:conf/lics/JurdzinskiL17} and by Fearnley et al.~\cite{DBLP:conf/spin/FearnleyJS0W17}. We only briefly and informally describe the idea of~\cite{DBLP:conf/spin/FearnleyJS0W17}. (Even) measures are $k$-tuples $M\colon (\mathbb{N}\cup\{\bot\})^k\cup\{\top\}$, which record that the optimal play consists of consecutive stretches that are dominated by vertices with even priority. For example, in the path $1\underline{2}131\underline{4}23\underline{2}15\underline{6}3\underline{2}1\underline{2}$, all vertices are dominated by each pair of underlined vertices of even priority. $k$ is such that there are fewer than $2^k$ vertices with even priority in the game. An $8$-tuple $\{\, 2 \; 2\; 4\; \bot\; 5\; \bot\; 6\; \bot \,\}$ denotes a game with consecutive stretches of $1$, $2$, $4$, $16$ and $64$ even vertices, where the first dominating vertex has priority $M(i)$ and may actually be \emph{odd} instead of even. If the first dominating vertex has an {odd} priority, then player Even must reach a higher priority before continuing to build a play where they have more dominating even vertices than are in the game. If player Even can visit more dominating even vertices than are in the game, then at least one of these is visited twice and therefore player Even knows that they can win and lifts to $\top$. \subsection{Empirical evaluation} \begin{table}[t] \begin{tabu} to \linewidth {X[2]X[2r]X[c]X[2r]X[c]X[2r]X[c]X[2r]X[c]} \toprule & \multicolumn{2}{c}{Model checking} & \multicolumn{2}{c}{Equiv checking} & \multicolumn{2}{c}{Random games} & \multicolumn{2}{c}{Total} \\ \midrule \input{R/pm} \bottomrule \end{tabu} \vspace{.5em} \caption{Runtimes in sec. (PAR2) and number of timeouts (15 minutes) of PGSolver (\texttt{pgspm}), pbespgsolve (\texttt{pbesspm}) and the implementations \texttt{spm} and \texttt{qpt} in Oink.} \label{tbl:pm} \end{table} We compare our implemention of small progress measures and quasi-polynomial progress measures to the small progress measures implementation of pbespgsolve that comes with the mCRL2 model checker~\cite{DBLP:conf/tacas/CranenGKSVWW13,Verver2013} and the implementation of small progress measures in PGSolver~\cite{DBLP:conf/atva/FriedmannL09}. Unfortunately, the solver used in~\cite{DBLP:conf/spin/FearnleyJS0W17} contains proprietary source code and cannot be compiled and compared. For this comparison, we disabled optional preprocessing, i.e., removing self-loops, winner-controlled winning cycles and solving single-parity games. See Table~\ref{tbl:pm}. Although Fearnley et al.~\cite{DBLP:conf/spin/FearnleyJS0W17} say that the QPT solver is mainly interesting for the theoretical result rather than practical performance, we observe that \texttt{qpt} outperforms the other solvers for random games. Oink is faster than PGSolver, especially for model checking and equivalence checking. \subsubsection{Empirical Evaluation} \begin{table}[t] \begin{tabu} to \linewidth {X[2]X[2r]X[c]X[2r]X[c]X[2r]X[c]X[2r]X[c]} \toprule & \multicolumn{2}{c}{Model checking} & \multicolumn{2}{c}{Equiv checking} & \multicolumn{2}{c}{Random games} & \multicolumn{2}{c}{Total} \\ \midrule \input{R/zlk} \bottomrule \end{tabu} \vspace{.5em} \caption{Runtimes in sec. (PAR2) and number of timeouts (15 minutes) of the four solvers PGSolver (\texttt{pgzlk}), SPGSolver (\texttt{spg}), pbespgsolve (\texttt{pbeszlk}) and Oink (sequential \texttt{zlk}, multi-core \texttt{zlk-1} and \texttt{zlk-8}, unoptimized \texttt{uzlk}).} \label{tbl:zlk} \end{table} We compare our implementation of Zielonka's recursive algorithm with and without the optimizations of Alg.~\ref{alg:zielonka} to PGSolver, to Verver's implementation pbespgsolve~\cite{DBLP:conf/tacas/CranenGKSVWW13,Verver2013} and to SPGSolver~\cite{DBLP:conf/iccS/ArcucciMMS17,DBLP:conf/facs2/StasioMPS14}. Unfortunately, the Java version of SPGSolver (all three variations) suffers from severe performance degradation for unknown reasons. They also provide a C++ implementation in their online repository, which we used instead. The multi-core version of the SPGSolver tool relies on \texttt{async} tasks provided by C++11. Similar to the previous sections, we disable the optional preprocessors that solve single parity games, remove self-loops and solve winner-controlled winning cycles. See Table~\ref{tbl:zlk}. The results show that the implementation in Oink outperforms PGSolver by several orders of magnitude on all benchmark types. PGSolver timed out for $83$ of all $949$ games. The solvers \texttt{spg-seq} and \texttt{pbeszlk} are faster than Oink on the model checking and equivalence checking games, but are significantly outperformed on random games. We also observe severe performance degradation for \texttt{spg-mc} on random games. It appears that our parallel implementation of Zielonka's algorithm also does not scale well. Finally, there seems to be no significant difference between the optimized and unoptimized versions of Zielonka's algorithm, except for random games.
\section{Introduction} \input{sec-intro.tex} \section{Repositioning in RMFS} \input{sec-problem.tex} \section{Computational results} \input{sec-results.tex} \section{Conclusion} \input{sec-conclusion.tex} \bibliographystyle{plain}
\section{Introduction} Structures in protoplanetary disks are often used to predict the possible properties of planets that may be responsible for their origin. Once a planetary core has gained sufficient mass to undergo run-away gas accretion, it may interact strongly with the protoplanetary disk, driving large-scale disk structures, such as gaps (e.g., \citealt{Jang-Condell2012}, \citealt{Jang-Condell2013}, and \citealt{Dong2015a}), vortices (e.g., \citealt{Hammer2017}), and spiral density waves (e.g., \Citealt{Zhu2015}, \citealt{Dong2015b}). These interactions contribute to the disk evolution and may significantly alter the environment of planet formation. Recently, near-infrared (NIR) scattered light imaging has revealed such structures in a number of disks in unprecedented detail (e.g., \citealt{Muto2012}, \citealt{Grady2013}, \citealt{Benisty2015}, \citealt{Wagner2015}, \citealt{Akiyama2016}). However, the hypothesized companions responsible for these disk features are rarely seen themselves, leading to ambiguity in the origin of the structures. In this work we focus on ``grand design" spiral protoplanetary disks, those with a global two-armed spiral structure, which have recently been detected in a few protoplanetary disks (SAO 206462: \citealt{Muto2012}, MWC~758: \citealt{Grady2013}, and HD~100453: \citealt{Wagner2015}). Currently there exist more alternate hypotheses for the generation of these features than there exists sources to test their predictions. Most models include a massive perturbing companion (either a planet or a low mass star, e.g., \citealt{Dong2015b} and \citealt{Zhu2015}), though notably some do not require the presence of any companion (e.g. \citealt{Montesinos2016}, \citealt{Kama2016}, \citealt{Benisty2017}). In \cite{Wagner2015}, we presented the discovery of a two-armed spiral structure in the disk of the 10$\pm$2 Myr old Herbig Ae star HD 100453A (d=103$\pm$3 pc, \citealt{GAIA1}; $M_{\star}$=1.7M$_{\odot}$, \citealt{Dominik2003}). The primary A-star hosts an M-dwarf companion with a mass of $\sim$0.2$M_{\odot}$ and an angular separation of 1$\farcs$05, corresponding to a projected physical separation of $\sim$108 au if the orbit is seen close to face-on (\citealt{Chen2006}, \citealt{Collins2009}, and Figure 1). Assuming a near face-on and circular orbit of HD 100453AB, \cite{Dong2016a} showed that the spiral structures are reproduced in three-dimensional hydrodynamic and radiative transfer simulations with a remarkable resemblance to the scattered light images of the disk. \begin{figure}[htpb] \figurenum{1} \epsscale{0.7} \plotone{Figure-1.pdf} \caption{\footnotesize Schematic diagram of the HD 100453 system constructed from the SPHERE data in \cite{Wagner2015}. The primary A-star hosts an M-dwarf companion and a spiral protoplanetary disk. The disk also hosts a gap comparable in size to Uranus's orbit about the Sun ($R\sim$20 au). The actual details inside of the gap are obscured by the coronagraph and subtraction residuals, and should not be physically interpreted from this image. The brightness of the stars with respect to the disk and to each other have been reduced for clarity, and the image colors of red, green, blue are composed of $Y-$, $J-$, and $H$-bands, respectively.} \end{figure} To our knowledge, no effort has been undertaken to fit the orbit of the binary, which is necessary to accurately model the effects of HD 100453B on the disk, and to test whether this body may be responsible for the spiral structure. Indeed, \cite{Montesinos2016} provide an alternate mechanism for generating the spiral structure in this disk (further discussed in \citealt{Benisty2017}) without invoking the gravitational perturbations from the companion, which may be the case if it is in fact on a much wider orbit. Thus, knowledge of the binary's true orbit may be used to discriminate between these hypotheses for the generation of the spiral arms, thereby providing constraints on the dynamics and evolution of this disk and, potentially, provide more general insights into disks with two-armed spiral structures. If the arms are induced by the companion, then any other effects, such as the influence of potentially embedded planets, disk photoevaporation, gravitational instability, or shadow-induced density variations, are not necessary to explain the origin of the spiral arms, and furthermore must not be strong enough to significantly alter their morphology. In this paper we present a fourteen-year baseline of astrometric measurements from adaptive optics imaging with the \textit{Very Large Telescope} Nasmyth Adaptive Optics System and Near-Infrared Imager (VLT/NACO), Spectro-Polarimetric High Contrast Exoplanet Research instrument (VLT/SPHERE), and \textit{Magellan} Adaptive Optics (MagAO) system. We use these data to provide the first orbital analysis of the HD 100453AB system. We also present disk kinematic modelling of publicly available \textit{Atacama Large Millimeter/Sub-millimeter Array} (ALMA) CO data to measure the inclination of the disk around HD 100453A, and combine these in our analysis with other disk inclination values from the literature. We explore the resultant disk structure through hydrodynamic and radiative transfer modelling. Finally, we assemble the known information on the system to provide the first complete picture of the geometry in the HD 100453 system, and discuss how this fits into the framework of the system's evolution. The datasets used in this work and data reductions are described in $\S$2. The disk and orbital modelling methodologies are described in $\S$3. The results are shown in $\S$4, and our interpretation is discussed in $\S$5. Finally, we include a brief summary and concluding remarks in $\S$6. \section{Observations and Data Reduction} \subsection{VLT/SPHERE Observations} We observed HD 100453 with VLT/SPHERE \citep{Beuzit2008} under program ID: 095.C-0389 (PI: Apai). We obtained data on three separate nights during 2015 and 2016 in IRDIFS and IRDIFS-Extended modes, providing simultaneous dual-band imaging with the IRDIS camera \citep{Vigan2010} and integral field spectroscopy (IFS, \citealt{Claudi2008}). HD 100453B is present only in the IRDIS images due to the limited field of view of the IFS. The companion is easily seen in the individual (8 second) SPHERE exposures, though each observing sequence was typically longer (about 30 minutes) to enable imaging of the disk structure closer to the primary star (presented in \citealt{Wagner2015}). We processed the data using the SPHERE data reduction pipeline \citep{Pavlov2008} to correct bad pixels, subtract dark current, and divide by the instrument flat field image. The remainder of our data reduction was done using custom IDL scripts, building upon those described in \cite{Wagner2015}, \cite{Apai2016}, and \cite{Wagner2016}. We corrected the images for 0.6\% anamorphic distortion by up-scaling along the vertical of the detector \citep{Maire2016}. We then computed the star center (obscurred by the coronagraph) utilizing the position of the satellite spots generated by applying a sinusoidal pattern to SPHERE's deformable mirror in the first few frames. The centers of the four satellite spots were determined by fitting a two-dimensional Gaussian to each spot, and the intersection of the lines connecting centers of opposite spots was calculated and used as the star center. The majority of the frames (those without satellite spots) were aligned via cross-correlation and bi-linear interpolation for the sub-pixel shifts. The frames were rotated to share a common orientation of North up and East to the left by applying a clock-wise rotation of 1.75$^{\circ}$ along with a frame-by-frame determined correction (typically $\leq$0.1$^{\circ}$) due to the internal time synchronization error between the telescope and SPHERE's derotator, as described in \citep{Maire2016}. The plate scale of 12.255$\pm$0.009 mas/pixel was also obtained from \citep{Maire2016}. Finally, the images were median-combined, and then $H2$ and $H3$ ($K1$ and $K2$) were summed to form the $H23$ ($K12$) images shown in Figure 2. These observations resulted in the detection of the companion at a signal to noise ratio (SNR) of $\sim$130 in $H23$ (2016-01-21) and $\sim$100 in each $K12$ epoch (2015-04-10 and 2016-01-23), where the noise is estimated as the mean of the absolute values of flux measurements in all non-overlapping apertures at the radius of HD 100453B. \begin{figure}[htpb] \figurenum{2} \epsscale{1.} \plotone{all-new-images.pdf} \caption{Images of HD 100453 taken with SPHERE/IRDIS and MagAO/Clio2. The images are adjusted to a common plate scale and orientation, while the image stretch is arbitrarily adjusted in each panel to reveal the position of HD 100453B. Each of the SPHERE observations utilized a coronagraph, while the MagAO data were taken in direct mode (without a coronagraph). HD 100453B is clearly detected in each image, as well as the spiral disk in each of the SPHERE images. No effort has been made to subtract the PSF of HD 100453A from these images. } \end{figure} \subsection{Magellan/MagAO Observations} We observed HD 100453 on February 17, 2017 using the Magellan Adaptive Optics System \citep{Close2012a} on the 6.5-meter \textit{Magellan Clay Telescope} at Las Campanas Observatory, Chile. We used the Clio-2 camera (\citealt{Morzinski2013}) operating in the $L^{\prime}$ (3.76 $\mu$m) filter. We obtained a total exposure time of 92 minutes with Clio-2 and 54$^\circ$ of field rotation. The airmass varied from 1.12 to 1.48 and the seeing was excellent with an average of $\sim$0$\farcs$5. We utilized a ten arcsecond nodding sequence in RA every four minutes to maintain consistent sky and source coverage. Detector integration times were kept short (0.5 sec) to keep the counts linear everywhere but the saturated PSF core. This strategy keeps the core of HD 100453B within the detector's linear response regime, allowing us to use its PSF as a photometric calibration. We corrected the images for distortion by utilizing the solution given in \cite{Morzinski2015} and verified the accuracy of the correction by applying the same step to observations of an astrometric field observed in the same night (Theta Ori B) compared to previous observations with LBT/PISCES \citep{Close2012b}. We also used these same data to determine the plate scale and instrument true North orientation post-distortion correction (15.85$\pm$1.20 mas/pixel and $2.11^\circ \pm0.16^\circ$ counter-clockwise, respectively). We processed the data using custom IDL routines to correct bad pixels, subtract the thermal background (estimated as the mean of the detector background levels before and after each nod sequence), and then aligned the images via cross-correlation and a rotational-based centering algorithm.\footnote{The centering procedure is similar to that used in \citealt{Morzinski2015}, which utilizes the rotational symmetry of the PSF along with differential imaging to find its precise center. } The images were rotated to a common orientation of North up and East left, and median-combined to create the image in the bottom right panel of Figure 2. \subsection{Published VLT/NACO Data} We utilize two epochs of previously published data in our astrometric dataset. The first measurement was obtained with VLT/NACO in 2003 under program ID: 071.C-0507 (PI: Mouillet) and presented in \cite{Chen2006}. These data were reprocessed, along with an additional epoch from the same telescope/instrument in 2006 (program ID: 077.C-0570, PI: van Boekel) and presented in \cite{Collins2009}. We utilize these published separation and position angle measurements in our astrometric catalog (see \S5.1) and refer interested readers to these respective publications for the details of the data acquisition and processing. Since explicit detail on the astrometric calibrations of the NACO data are not included in the publications, we obtained additional information from Collins et al. through private communication. The NACO observations were obtained in field-tracking mode, and the individual image exposure times were kept short (0.35s) to limit saturation of the primary star. The positions of both HD 100453A and B were obtained by fitting Gaussian functions to their PSFs in the narrow-band Br$\gamma$ images. A true North orientation of 0$^\circ$ (up on the detector) and a platescale of 27.15 mas/pixel were obtained from the image headers. The true North orientation\footnote{Defined such that counter-clockwise in the E-left N-up plane is the positive rotation direction.} and platescale of the detector are measured to be stable at -0.04$\pm$0.14$^{\circ}$ and 27.012$\pm$0.004 mas/pixel, respectively, throughout the period of observations (\citealt{Chauvin2010}). These are slightly different than the values assumed in \cite{Collins2009}. While these are minor differences, to maintain the highest possible degree of astrometric accuracy we have adjusted the values used in our study accordingly with the aforementioned calibrations. This results in a $\sim$1$\sigma$ change for both separation measurements (-6 mas and -5 mas for the 2003 and 2006 measurements, respectively), and a negligible $\sim$0.1$\sigma$ change in position angle measurements. We have also adopted a slightly larger measurement uncertainty after combining the uncertainties listed in \cite{Collins2009} and those on the platescale and true North orientation by summing uncertainties in quadrature. \subsection{Astrometric Error Budget} Since only a small fraction of the orbit of HD 100453AB has been observed, the precision in our orbit fitting is heavily reliant on the precision of our astrometric measurements. In this section we describe the uncertainties and error budget of the new astrometric measurements used in the proceeding work, which are summarized in Table 1. The primary components that enter into the final (combined) uncertainty are 1) uncertainty in the position of the primary star that is either saturated or obscurred by a coronagraph; 2) uncertainty in the measurement of the position of HD 100453B; and 3) uncertainty in the plate scale and orientation of the detector. The location of the primary star is obtained via satellite spot centering (for SPHERE data) and via rotational centering (for MagAO), described in \S 2.1 and \S 2.2, respectively, which are typically accurate to $\lesssim$0.25 pixels (\citealt{Mesa2015}, \citealt{Morzinski2015}). For both datasets, the position of HD 100453B is measured by fitting a 2D Gaussian to the source. The measurement uncertainties (1$\sigma$) are estimated as the FWHM divided by the SNR. Both instrumental PSFs are super-Nyquist sampled (3$-$4.5 pixel FWHM for SPHERE $H$ and $K$, and 7.5 pixels for MagAO $L^{\prime}$), and the source is detected at relatively high SNR in each dataset (SNR $>$ 100 for SPHERE, and $>$ 30 for MagAO), allowing for sub-pixel accuracy in the measurement of the position of HD 100453B. \begin{deluxetable}{cccccc} \tabletypesize{\scriptsize} \tablecaption{Astrometric Measurements and Error Budget} \tablewidth{0pt} \tablehead{ \colhead{Date} & \colhead{Separation \&} & \colhead{HD 100453B} & \colhead{HD 100453A} & \colhead{Plate Scale \&} & \colhead{Combined} \\ \colhead{Facility-Filter} & \colhead{Position Angle} & \colhead{Uncertainty} & \colhead{Uncertainty} & \colhead{Field Orient. Unc.} &\colhead{Uncertainty} } \startdata\ \\ 2003-06-02 & 1$\farcs$049 & \multicolumn{2}{c}{0$\farcs$007} & 0.004 mas & 0$\farcs$0070 \\ NACO-Br$\gamma$ & 127.23$^{\circ}$ & \multicolumn{2}{c}{0.30$^\circ$} &0.14$^{\circ}$& 0.33$^{\circ}$\\ \\ 2006-06-22 & 1$\farcs$042 & \multicolumn{2}{c}{0$\farcs$005} & 0.004 mas & 0$\farcs$0050 \\ NACO-Br$\gamma$ & 128.26$^{\circ}$ & \multicolumn{2}{c}{0.27$^\circ$} &0.14$^{\circ}$& 0.30$^{\circ}$\\ \\ 2015-04-10 & 1$\farcs$047 & 0$\farcs$00057 & 0$\farcs$003 & 0.09 mas & 0$\farcs$0031 \\ SPHERE-K12 & 131.63$^{\circ}$ & 0.031$^{\circ}$ & 0.17$^{\circ}$ &0.08$^{\circ}$& 0.19$^{\circ}$\\ \\ 2016-01-21 & 1$\farcs$056 & 0$\farcs$00034 & 0$\farcs$003 & 0.09 mas & 0$\farcs$0030 \\ SPHERE-H23 & 131.95$^{\circ}$ & 0.018$^{\circ}$ & 0.17$^{\circ}$ &0.08$^{\circ}$& 0.19$^{\circ}$\\ \\ 2016-01-23 & 1$\farcs$053 & 0$\farcs$00054 & 0$\farcs$003 & 0.09 mas & 0$\farcs$0030 \\ SPHERE-K12 & 131.95$^{\circ}$ & 0.029$^{\circ}$ & 0.17$^{\circ}$ &0.08$^{\circ}$& 0.19$^{\circ}$\\ \\ 2017-02-17 & 1$\farcs$056 & 0$\farcs$0032 & 0$\farcs$004 & 1.8 mas & 0$\farcs$0054 \\ MagAO-L$^{\prime}$ & 132.32$^{\circ}$ & 0.18$^{\circ}$ & 0.22$^{\circ}$& 0.34$^{\circ}$ & 0.44$^{\circ}$\\ \enddata \tablecomments{Table 1: Astrometric uncertainties for observations of HD 100453AB. The SPHERE plate scale and field orientation calibrations were obtained from \cite{Maire2016}. The MagAO plate scale and field orientation uncertainty represents the combined uncertainty from our calibrations and also the uncertainty in the fiducial plate scale and field rotation calibrations utilized in \cite{Close2012b}. The NACO data were obtained from \cite{Collins2009} and adjusted according to the platescale and true North orientation of \cite{Chauvin2010}. Since uncertainties on the positions of the two stars in \cite{Collins2009} are already combined into separation and position angle, only one value is listed for their combination. The individual uncertainties (reported here as 1$\sigma$) were combined in quadrature for the final combined uncertainties.} \end{deluxetable} \subsection{ALMA $^{12}$CO Observations} HD 100453 was observed on 2016 April 23 with ALMA Band 6 during Cycle 3 (Program Code: 2015.1.00192.S, PI: van der Plas).\footnote{These data are part of an on-going campaign, and the higher resolution component of the dataset will be presented in an upcoming paper (van der Plas et al, in prep.).} During the observations forty-two 12 meter antennas were available, with baselines ranging from 12--460 meters. The Band 6 receiver was configured for $^{12}$CO 2--1 observations, with a baseband of 1,920 channels centered at 230.529 GHz with 61 kHz channel widths (0.16~km/s~velocity resolution; Hanning smoothed). J1107-4449 was used as the bandpass and flux calibrator, and J1132-5606 was used as the the gain calibrator. The on-source time was $\sim$13 minutes. \begin{figure}[htpb] \figurenum{3} \epsscale{1.0} \plotone{Line_image.pdf} \caption{Channel maps of $^{12}$CO 2--1 emission in the disk surrounding HD 100453A from ALMA observations taken on 2016 April 23. The contours represent integer multiples of the $3\sigma$ detection limit ($\sigma$=8.1 mJy/beam).} \end{figure} The data were calibrated using the ALMA pipeline in the \texttt{CASA} package. Following calibration, we imaged the $^{12}$CO 2--1 data using the CLEAN routine. Imaging was done in 0.2~km/s channels using natural weighting to enhance sensitivity in the channel maps. The CO channel maps (Figure 3) has a beam size of $0\farcs94 \times 0\farcs65$ with PA of $-67.8^{\circ}$, and a mean rms of 8.1 mJy beam$^{-1}$ in signal-free channels. The data show a clear red- and blue-shift pattern for the NW and SE sides of the disk, respectively, which is characteristic of a moderately inclined disk. Combined with the images in \cite{Benisty2017} showing scattered light to the SW from the bottom side of the disk, we can infer a counter-clockwise rotation of the disk in the plane of the sky. We note that the disk and binary are both orbiting in the same direction. In \S3.2 and \S4.3.2 we present a model representative of these data to investigate the disk kinematics and physical properties. \section{Modelling Methodologies} \subsection{Orbital Modelling} We employ the grid-search and bootstrapping method of orbit-fitting presented in \cite{Wagner2016}. This technique uses the method in \cite{Meeus1998} to calculate the position angle (PA) and separation of a binary system as a function of time and the seven Keplerian orbital parameters. We constructed a grid of models and performed a chi-squared minimization to find the best-fit model, while keeping the mass of the system fixed at 1.9 M$_{\odot}$. Each trial performed seven iterations of parameter searches for a total of of 46,656 combinations of the six orbital parameters (with period and semi-major axis linked through mass). At each iteration the grid range and spacing were reduced by 50\%. The distribution of orbital parameters shown in \S 4.2 were assembled by repeating the procedure for 25,265 trials, during each of which the data points were modulated by adding Gaussian noise drawn from a distribution with mean of zero and standard deviation of unity, multiplied by the 1$\sigma$ measurement uncertainties \subsection{CO 2--1 Modelling} We follow the modelling procedure outlined in \cite{Wu2017} to fit our ALMA channel maps with synthetic channel maps produced from radiative transfer models, and thereby constrain the bulk disk structure. We describe the procedure briefly here, but additional details can be found in \cite{Wu2017}. We construct a simple model of the disk, aimed at constraining the inclination of the bulk of the gas in the spiral-arm hosting outer disk. We assume that the $^{12}$CO (2--1) emission comes from a flared accretion disk that is in vertical hydrostatic equilibrium. We use a power law in radius to parameterize the temperature profile of the disk, and assume that the disk is vertically isothermal. Finally, we assume that rotation in the disk is Keplerian and that the disk is in the same plane throughout. While there is a known warp in the inner dust disk (\citealt{Benisty2017}, \citealt{Long2017}), the CO data are not of sufficient resolution to reveal whether the gas follows this same structure. Thus, our simple model mostly reflects the conditions of the outer disk, which contains the majority of disk surface area and (presumably) CO emission. Under these assumptions, the equations that govern the disk structure are: \begin{equation} \rho(R,z) = \frac{\Sigma(R)}{\sqrt{2\pi} \, h(R)} \, \exp\left[-\frac{1}{2}\left(\frac{z}{h(R)}\right)^2\right], \end{equation} \begin{equation} \Sigma = \Sigma_0 \, \left(\frac{R}{r_c}\right)^{-\gamma} \, \exp\left[-\left(\frac{R}{r_c}\right)^{2-\gamma}\right] \end{equation} \begin{equation} N_{\rm CO}(R) = \frac{X_{\rm CO} \, \Sigma(R)}{\mu \, m_{\rm H}}, \end{equation} \begin{equation} T(R) = T_0 \, \left(\frac{R}{1~{\rm AU}}\right)^{-q}, \end{equation} \begin{equation} h(R) = \left( \frac{k_b \, R^3 \, T(R)}{G \, M_* \, \mu \, m_{\rm H}} \right)^{1/2}, \end{equation} \begin{equation} v_k = \sqrt{\frac{G \, M_*}{r}}. \end{equation} where $R$ and $z$ are defined in cylindrical coordinates, $\Sigma(R)$ and $h(R)$ are the surface density and disk scale height, respectively. Here we fix the stellar mass to a value of $M_* = 1.7$ $M_{\odot}$ and the distance to a value of $d = 103$ pc based on previous estimates of HD 100453's mass \citep{Dominik2003} and distance \citep{GAIA1}. $X_{\rm CO} = 1 \times 10^{-4}$ is the CO mass abundance fraction, and $\mu = 2.37$ is the mean molecular weight. The disk is truncated at an inner radius of 0.1 AU. We also include microturbulent line broadening, which we assume is uniform throughout the disk, with a value of $\xi$ in units of km/s. Finally, we allow the star to have a systemic velocity, $v_{sys}$, which Doppler shifts the velocity center away from zero. In all, the density, temperature, and velocity structure of the system are described by the following parameters: $M_{\rm disk}$, $r_{\rm c}$, $\gamma$, $T_0$, $q$, $\xi$, and $v_{sys}$. We also allow the viewing geometry of the system, the inclination and position angle to vary in our fit. We use the 3D radiative transfer modelling package \texttt{RADMC-3D} \citep{Dullemond2012} to calculate the molecular level populations in each cell and produce synthetic ${}^{12}$CO (2--1) channel maps for a given set of model parameters. Those synthetic channel maps are Fourier Transformed and fit directly to the visibilities using the MCMC fitting package \texttt{emcee} \citep{FM13}, with uniform priors for all parameters. \subsection{Hydrodynamic and Near-Infrared Radiative Transfer Modelling} To investigate the structures induced by the companion on the disk around the primary star, we utilize combined hydrodynamic and radiative transfer simulations, following the strategy in \cite{Dong2016b}. We utilize the three-dimensional hydrodynamic package, \texttt{PEnGUIn} \citep{Fung2015} and the radiative transfer package, \texttt{HOCHUNK3D} \citep{Whitney2013} to compute the time-dependent density evolution of the disk and its resulting appearance in near-infrared scattered light. We compute synthetic H-band (1.65 $\mu$m) images assuming that the disk is composed of primarily interstellar medium grains \citep{Kim1994}. These grains contain silicate, graphite, and amorphous carbon, and their size distribution is represented by a smooth power law distribution in the range of 0.02$-$0.25 $\mu$m followed by an exponential cut off beyond 0.25 $\mu$m. The anisotropic scattering phase function is approximated using the Henyey-Greenstein function \citep{Henyey1941}. The optical properties can be found in Dong et al. (2012, Figure 2).\footnote{While a better match to the observed scattered light profile of the disk may be achieved by fine-tuning the dust constituents and anisotropic scattering properties, such work is beyond the scope of this study that is aimed only at a first-order qualitative match to the observed disk structure.} In the hydrodynamic model, the companion is orbiting in the same direction and plane as the disk on a circular orbit with a semi-major axis of 100 AU, which is consistent with our derived orbital parameters (\S4.2). The three-dimensional disk density profile was computed for one-hundred companion orbits, and the final density distribution was input into the radiative transfer software to simulate how the disk would appear in $H$-band scattered light (1.65 $\mu$m). We reproduce the model three times with an inclination of $25^\circ, 30^\circ$, and $35^\circ$ from face-on, to show the resulting disk structures as viewed across the range of plausible disk inclinations. We note that the companion-to-star mass ratio has been lowered from 1:6 as in our previous study \citep{Dong2016a} to 1:10, as we now adopt $M_{\rm HD~100435B}=0.2M_\odot$ (Collins et al. 2009) instead of $0.3M_\odot$ (Chen et al. 2006). \section{Results} \subsection{Astrometric Catalog from 2003-2017} We provide an astrometric catalog of six epochs spread over fourteen years of high-contrast adaptive optics observations with VLT/NACO, VLT/SPHERE, and MagAO/Clio-2 (Table 2). These measurements constitute all of the high-fidelity astrometry on HD 100453B that is known to us. Notably, other observations exist from these and other facilities throughout this timespan, but are excluded from our catalog due to their lack of extened baseline and poorer astrometric quality. Here we briefly summarize the other available data known to us. \cite{Collins2009} provide an additional measurement with HST/ACS that is consistent with the NACO measurements, although the astrometric uncertainties are 4-5$\times$ larger. Other publicly available data from NACO exists as well, however, these observations were carried out with a coronagraph\footnote{Without the benefit of satellite spots, similar to coronagraphic SPHERE calibrations.}, and thus suffer from uncertainty in determining the location of the primary star behind the coronagraph. Thus, we have chosen to exclude these measurements from our catalog and proceeding analysis. \begin{deluxetable}{ccccc} \tabletypesize{\scriptsize} \tablecaption{HD 100453AB Astrometric Catalog} \tablewidth{0pt} \tablehead{ \colhead{Date} & \colhead{Facility} & \colhead{Separation} & \colhead{PA} & \colhead{Reference} } \startdata 2003-06-02 & VLT/NACO & 1$\farcs$049$\pm$0$\farcs$0070 & 127.23$^\circ\pm$0.33$^\circ$ & a \\ 2006-06-22 & VLT/NACO & 1$\farcs$042$\pm$0$\farcs$0050 & 128.26$^\circ\pm$0.30$^\circ$ & a \\ 2015-04-10 & VLT/SPHERE & 1$\farcs$047$\pm$0$\farcs$0031 & 131.63$^\circ\pm$0.19$^\circ$ & This work \\ 2016-01-21 & VLT/SPHERE & 1$\farcs$056$\pm$0$\farcs$0030 & 131.95$^\circ\pm$0.19$^\circ$ & This work \\ 2016-01-23 & VLT/SPHERE & 1$\farcs$053$\pm$0$\farcs$0030 & 131.95$^\circ\pm$0.19$^\circ$ & This work \\ 2017-02-17 & MagAO/Clio-2 & 1$\farcs$056$\pm$0$\farcs$0054 & 132.32$^\circ\pm$0.44$^\circ$ & This work \\ \enddata \tablenotetext{a}{Data from \cite{Collins2009} adjusted according to the astrometric calibrations in \cite{Chauvin2010}. } \end{deluxetable} \subsection{Orbital Parameters of HD 100453AB} The main focus of this work is to establish the orbital parameters of the HD 100453AB binary, and to relate these to the probable mechanism behind the spiral arms in the disk. The results of our orbit fitting (described in \S 3.1) are shown in Figures 4 \& 5. The histograms of remaining orbital parameters (node, longitude of periastron, and time of periastron passage) are shown in in Appendix A. We note that our six-parameter model\footnote{With the seventh parameter, the orbital period, linked to semi-major axis by mass.} is over-fitting our six available data points $-$ i.e. the best-fit model is not necessarily representative of the true orbit, but likely represents the particular noise realization in the data. While this remains a limitation of our model, the problem is mitigated by our bootstrapping method of parameter retrievals, which randomizes the noise in the data while assembling a large volume of orbital parameter retrievals. This method results in useful constraints on the semi-major axis, eccentricity, and inclination, while leaving the node and longitude of periastron relatively unconstrained (see Appendix A). In other words, with the data at hand we are able to place sufficient constraints on the orbital geometry, while leaving the exact orbit within this parameter space unconstrained. \begin{figure}[htpb] \figurenum{4} \epsscale{1.} \plotone{Orbit-fit.pdf} \caption{Results from our orbit fit for HD 100453AB. The blue curves show the best fit orbit while those plotted in gray represent one hundred orbits drawn at random from 25,265 trials to show the range of plausible orbits. In the bottom left panel, the scattered light image of the disk from \cite{Wagner2015} is shown as an inset (dashed region) to illustrate the proximity of the companion's orbit to the disk. Since the true location of the system's barycenter is unknown, the motions of the system are shown with the A-star as a common central reference point.} \end{figure} We establish 1$\sigma$ confidence intervals\footnote{Given by the mean and standard deviation of our complete set of retrieved orbital parameters.} on the orbital parameters \textit{a}=1$\farcs$06$\pm0\farcs09$, \textit{e}$=0.17\pm0.07$, and \textit{i}=$32.5^{\circ}\pm6.5^\circ$. Notably, the mechanisms proposed to generate spiral arms without a strong influence from the companion depend on parameters of the disk physics that are not well constrained (e.g., cooling timescales in the case of shadow-generated spiral arms, as in \citealt{Benisty2017}). However, the effects due to gravity, in the case of a companion on a relatively close orbit, cannot be ignored. Conversely, if the orbit is oriented such that it is masking a larger pericenter, then the gravitational effects of the binary may be negligible. Consistent with the former scenario, we find that the companion is on an orbit that is at most mildly eccentric and with a semi-major axis that is similar to the measured projected separation (a$\sim$105 au). The inclination of the companion's orbit is co-planar with the disk to within measurable limits. The effects of this orbital configuration on the disk structures are discussed in \S 5.1. \begin{figure}[htpb] \figurenum{5} \epsscale{1.} \plotone{histograms-2d.pdf} \caption{\footnotesize One$-$ and two-dimensional histogram densities from our orbital parameter retrievals. In the top left panel (semi-major axis) the solid black line corresponds to the projected separation of the companion, while the dashed line corresponds to the predicted orbital semi-major axis of the companion, assuming a strictly co-planar and circular orbit from classical tidal truncation theory (e.g., \citealt{Holman1999}). In the top right panel (inclination), the dashed lines represent estimates of the disk inclination from near-infrared scattered light images, and the solid line represents the inclination derived by our ALMA $^{12}$CO $J$=2-1 kinematic modelling.} \end{figure} \subsection{Disk Inclination} \subsubsection{NIR Images and Radiative Transfer SED Modelling} To understand the effects of HD 100453B on the disk, it is first necessary to establish the mutual inclinations in the system. The inclination of the disk has been previously explored through fitting an oval to the ring of emission and assuming a circular geometry (zero eccentricity) to estimate the degree of inclination. Using this strategy, \cite{Wagner2015} found a disk inclination of $\sim$34$^\circ$ from face-on. In agreement with this value, \cite{Benisty2017} utilized a similar method on their polarimetric data and found a disk inclination of $\sim$38$^\circ$ from face-on. However, these estimates do not take into account the fact that the disk has a non-negligible scale height and a wall-like structure at the radius of the ring, and that scattering effeciency depends on the scattering angle which is different for the opposing sides, and hence the brightest region of the far-side of the disk will in fact be the directly illuminated edge of the gap, not the upper region of the disk as seen on the near-side. \cite{Long2017} take this into account via modelling the disk to fit both the SED and the images, repeating the inclination estimate on radiative transfer images from their models convolved to the same angular resolution of VLT/SPHERE. They find a somewhat smaller (though broadly consistent) inclination of 25$\pm$10$^\circ$ from face-on. \subsubsection{ALMA Disk Kinematic Modelling} Following the modelling described in \S3.2, we derive the general disk properties for our assumed model geometry $-$ i.e. a circular, flaring disk with a radial power-law distribution for the disk surface density and an exponential vertical cutoff. Given that the disk is poorly resolved, our model mostly reflects the properties of the outer disk, since this region contains the bulk of the disk surface area and CO emission. The inclination obtained from ALMA for the outer disk around HD 100453A ($\sim$28$^{\circ}$) is consistent with the independent measurements from the NIR images (Figure 5). The best-fit model parameters and uncertainties are shown in Table 3. The channel 0 and channel 1 moment maps for the data and model are shown in Figure 6, while the model channel maps and residuals from the model-data fit are shown in Appendix B. \begin{deluxetable}{ccc} \tabletypesize{\scriptsize} \tablecaption{Model Parameters} \tablewidth{0pt} \tablehead{ \colhead{Parameter} & \colhead{Value} & \colhead{Uncertainty} } \startdata $M_{Disk}$ (M$_{\odot}$)& 7.0$\times 10^{-6}$ & 1.0$\times 10^{-6}$ \\ $r_{c}$ (AU) & 27 & 1\\ $T_{0}$ (K) & 511 & 72\\ $a_{turb}$ (km/s) & 0.92 & 0.03\\ $v_{sys}$ (km/s) & 5.25 & 0.01\\ $i_{Disk}$ ($^{\circ}$) & 27.6 & 0.2\\ $PA$ ($^{\circ}$) & 55.0 & 0.5\\ $q$ & 0.37 & 0.07\\ \enddata \tablecomments{The quoted uncertainties do not take into account the uncertainty inherent in the model assumptions.} \end{deluxetable} Given the complexity of the inner structures in HD 100453, our simple model cannot capture all of the disk features that result in the observed CO emission profile. The disk ring has two dips at relatively symmetric positions that are most likely shadows produced by a highly misaligned inner disk, as in the case of HD 142527 \citep{Marino2015}. The presence of such an inner disk can alter the rotation pattern in the gas by introducing a distinctive “twist” in the moment 1 map (\citealt{Casassus2015}, \citealt{Facchini2017}). While the ALMA dataset used in this work does not have the angular resolution to clearly reveal such a pattern, it may well be present in the data, and cause the moment 1 map to deviate from the typical “butterfly” pattern from a co-planer, inclined disk. Detailed modeling of the ALMA data taking this effect into account, which is beyond the scope of this paper, is needed to more accurately pin down the disk parameters. Also, while a better match to the outer extent of the disk may be achieved through more detailed modeling, namely through a more selective prior distribution for $r_{c}$, the presence of the spiral arms complicates such a selection. Since our study is not primarily concerned with this property of the disk, we have not made an attempt to generate such a model. A more detailed model of the disk will be presented in van der Plas et al, in prep. \begin{figure}[htpb] \figurenum{6} \epsscale{1.} \plotone{moment_image.pdf} \caption{ALMA CO moment zeroth and first moment maps for the data taken on 2016 April 23 (left) and our model disk (right). The beam size is shown as the inset grey region, and the synthetic beam size of the model image is identical. The cause of the mismatch between the size of the disk and the model is likely two-fold: due to lower noise in the model image, and due to its lack of spiral arms. This is acceptable for our purposes, as we are primarily interested in the inclination of the disk and not its exact spatial extent. } \end{figure} \subsection{Hydrodynamic + Radiative Transfer Simulations} \begin{figure}[htpb] \figurenum{7} \epsscale{1.} \plotone{Models-new.pdf} \caption{VLT/SPHERE NIR scattered light image of HD 100453 (top left) and hydrodynamic + radiative transfer simulations covering the range of possible inclinations. The simulations exhibit a prominent two armed spiral structure induced by the companion, suggesting a similar origin for the actual structures in HD 100453. The intensity of the images is shown on a logarithmic scale (arbitrary units) for clarity in the faint features. The gap interior to 20 AU and the warp in the inner disk are not included in the models.} \end{figure} Motivated by the new constraints provided by the orbital fit and ALMA gas kinematics, we utilized combined hydrodynamic and radiative transfer simulations (\S3.3) to compute the three-dimensional disk density evolution of an initially axial-symmetric disk perturbed by an outer companion for one hundred orbits. We then generated synthetic NIR scattered light images to be compared to the observations. The images from our three simulations, in which we varied the system inclination throughout a plausible range of 25-35$^{\circ}$, are shown in Figure 7. The model images are rotated such that the companion is at its known PA=135$^\circ$. Throughout the plausible range of inclinations we find that the companion induces a prominent two-armed spiral structure that is qualitatively similar to the observed spirals in HD 100453. We find the best match to the data arising from the models with a system inclination of 25-30$^{\circ}$, consistent with estimates on the disk inclination from our ALMA CO modelling and from our orbital fit, both of which suggest a common inclination for the outer disk and companion of $\sim$30$^{o}$. The separation of the spiral arms from one another, their pitch angle, and originating locations among the disk ring are reproduced by the model. Similar to the observations, the primary arm is pointed toward the companion, with the secondary arm opposite. The bottom side of the disk is also visible to the Southwest (see Appendix C), which is consistent with the polarized intensity imaging of \cite{Benisty2017}. The implications and limitations of these results are discussed further in \S5.1. \section{Discussion} \subsection{Effects on the Disk Structure from HD 100453B} Our primary goal in this work is to investigate the orbit of the HD 100453AB binary and its resulting effects on the protoplanetary disk structure. With our fourteen year baseline of astrometry, we are able to provide the first fit to the orbit of these stars. We combine this with estimates on the disk geometry from the literature and with our analysis of public ALMA data to constrain the inclination and major axis of the disk. We find that the binary's orbit is roughly co-planar with the disk, and at most mildly eccentric (e$\lesssim$0.3). Furthermore, the companion's orbital semi-major axis is 3-4$\times$ greater than the observed outer disk radius ($\sim$40 au). This is, as expected, consistent with the classical disk truncation scenario (e.g., \citealt{Artymowicz1994}, \citealt{Holman1999}). The former study calculated the size of the circumprimary disk as it is dynamically truncated by a 1:10 mass-ratio companion on a variety of orbits. Their results suggested that for disk scale height and viscosity plausible for protoplanetary disks, such a companion on an e=0.2 orbit could truncate the circumprimary disk to 30-40\% of the binary semi-major axis. This is in excellent agreement with the detected disk size of HD 100453, and combined with the atypical small size of the disk, is strong evidence that it is indeed dynamically sculpted by the companion. We find that the pair of spiral arms generated by the companion in our simulations are qualitatively well-matched to the spiral arms in the observed disk structure, and thus we suggest that any additional effects (e.g. differential thermal and radiation pressure in the shadowed regions) are not necessary to explain their origin. The implications of this result for the other two ``grand-design" (two-armed) spiral protoplanetary disks are discussed in \S5.2. We note that comparing with the observation, the disk size in our simulation (Figure 7) appears to be $\sim$30\% larger. This is probably caused by two factors. First, due to the high computational cost, we only evolve the simulation for 100 companion orbits. In contrast, HD 100453AB is 10$\pm$2 Myr old (\citealt{Collins2009}), corresponding to 12,000 orbits. While 100 orbits is sufficient to truncate the bulk part of the disk, it will be further truncated by a small amount between 100 and 10,000 orbits, thus achieving a better agreement with the observation. Second, \cite{Artymowicz1994} showed that the truncation radius modestly depends on the scale height (h/r) and viscosity ($\alpha$) in the disk. In our simulation we parametrized the disk to have $h/r$ = 0.15 and $\alpha$ = 10$^{-3}$, which are not expected to be in exact agreement with the scale height and viscosity in HD 100453. Therefore, we do not expect an exact reproduction of the observed disk morphology with our simulation. Finally, we note that our modelling approach has several other limitations, which we briefly discuss here. First, we do not include the possible small inclination of the companion relative to the disk ($\leq 10^{\circ}$ with $1\sigma$ confidence; or $\leq 20^{\circ}$ with $2\sigma$ confidence), as well as its small eccentricity (0.15$\pm$0.7 within 1$\sigma$, or $\lesssim 0.3$ within 2$\sigma$). However, we do not expect these to result in any major differences in disk structure of the models. Indeed, this choice is justified since due to tidal dissipation within the viscous disk we expect the binary to be on a relatively circular orbit and to be co-aligned with the disk (e.g., \citealt{Pap1995}, \citealt{Bate2000}, \citealt{Lubow2000}). These dynamical effects are discussed further in \S5.3. Finally, the scattering phase functions of the grains in the model and grains in the real disk bear noticeable differences, notably in the forward scattering of the near (Southwest) side of the disk. While more realistic grain populations and scattering properties could improve the quantitative match of the disk flux and contrast of the spiral arms, such work is beyond the scope of this current study. \subsection{Implications for Other Disks} While it appears clear that the ``grand-design" spiral arms in HD 100453 are driven by the low-mass stellar companion, the nature of the other such spiral disks (SAO~206462: \citealt{Muto2012}, MWC~758: \citealt{Grady2013}, LkH$\alpha$ 330: \citealt{Akiyama2016}) remains unclear. Binary companions as massive as HD 100453B would have been detected in these systems, if they were present. Therefore, if these spiral structures are generated in the same way as those in HD 100453, then the companions must be of sufficiently low mass to avoid detection in direct imaging ($\lesssim$ 2$-$4 $M_{J}$ at $\geq$0$\farcs$6 for SAO 206462 assuming hot-start models, \citealt{Maire2017}). If such low-mass companions are responsible for the observed spiral structures, then they must be on the lower end of masses predicted to be capable of this feat \citep{Fung2015b}. Alternatively, it is possible that the hot-start evolutionary tracks over-predict the luminosity of young giant planets, which would explain the non-detection of planets at the hot-start mass-luminosity predictions for the bodies driving the spiral arms in SAO 206462 and MWC 758. \subsection{The Distribution of Angular Moment in HD 100453: Evidence for a Primordial Alignment} While the orbit of the binary appears to be closely co-planar with the outer disk, in which it drives spiral density waves, an additional disk component with apparently distinct morphology exists closer in to the primary star. This inner disk is highly misaligned ($\sim$45-70$^{\circ}$) with respect to the plane of the outer disk (and binary), as evidenced by the prominent shadows cast by this feature on the outer disk (\citealt{Benisty2017}, \citealt{Long2017}), similar to the shadows cast by the misaligned inner disk in HD 142527 \citep{Marino2015}. The origin of this misalignment is presently unknown, though a possible scenario involves a companion orbiting within the gap and generating the misalignment, similar to the observed configuration of HD 142527 \citep{Close2014}. However, since HD 100453B is on an orbit that is altering the structure of the outer disk, it is reasonable to speculate that it may have also altered the inclination of the outer disk to more closely resemble that of its present orbit. In this case, the orientation of the inner disk and the rotational plane of the primary star, which may be relatively unaffected by the binary, may preserve the direction of the original angular momentum of the parent cloud which formed the HD 100453 system. Indeed, presuming that the disk and binary shared some initial significantly non-zero mutual inclination, simulations predict that given the age of the system, we should expect the outer disk and binary to be co-aligned due to tidal and viscous dissipation within the disk (e.g., \citealt{Pap1995}, \citealt{Bate2000}, \citealt{Lubow2000}). If the mutual inclination is larger than the disk opening angle, then due to hydrodynamic instabilities the alignment timescale is comparable to the disk precession timescale, which for typical protostellar disk parameters is on the order of $\sim$20 binary orbits \citep{Bate2000}, or $\sim$10$^{4}$ years. This is much smaller than the system's age of 10 Myr, and thus the mutual inclination should be less than the disk opening angle. In this case, the timescale for further alignment is on the order of the disk viscous timescale. Assuming conservative estimates for the viscosity parameter, $\alpha$=0.001, and disk aspect ratio, $h/r$=0.05, the viscous timescale is $\sim$10 Myr, which is comparable to the age of the system. Thus, the disk around HD 100453A should have had sufficient time to align itself to the orbital plane of the binary, and thus possibly does not represent its initial direction of angular moment (e.g., if HD 100453B did not form in the system, and was subsequently captured during close passage). To test whether there may have been an initial misalignment of the disk around HD 100453A and the orbit of HD 100453B, we consider the obliquity of HD 100453A from its measured rate of rotation. If its angular momentum is aligned with the binary (and thus the outer disk), then we postulate that the system likely formed from the same parent cloud and inherited a common direction of angular momentum. On the other hand, if the primary star's rotational plane is significantly misaligned with respect to these outer components, as is the inner disk, then perhaps these inner components represent the initial angular momentum of the cloud that formed HD 100453A and its disk, leaving the misalignment of the companion to require further explanation. \cite{Guimaraes2006} measured the rotation of HD 100453A, $v~sini = 48\pm 2$ km/s. For comparison, \cite{Zorec2012} found that the distribution of equatorial velocities for stars between 1.6-2.0 M$_{\odot}$ peaks at $\sim$150 km/s with a 1$\sigma$ spread of $\sim$50 km/s. Assuming an equatorial velocity for HD 100453A of 100, 150, and 200 km/s, the measured $v~sini $ corresponds to an inclination of 15$^{\circ}$, 20$^{\circ}$, and 30$^{\circ}$ from face-on, respectively, which more closely resembles the inclination of the outer disk and companion. Thus, we suggest that the inner disk, and not the outer disk, is the misaligned body in the system, and that the primary star's rotation, the orbit of the outer disk, and the orbit of the companion likely reflect the initial angular momentum of the parent body that formed the system. \section{Summary and Conclusions} We have obtained new VLT/SPHERE and Magellan/MagAO observations of HD 100453 in $H23$, $K12$, and $L^{\prime}$ filters (\S 2.1 \& \S 2.2). These data establish a fourteen year baseline with previous VLT/NACO adaptive optics imaging, and enable the first Keplerian orbital fit to the stellar motions. We fit the six epochs of astrometric data to a grid of models and find a best fit with orbital parameters of \textit{a}=1$\farcs$08 (111 au @ 103 pc),\textit{ e}=0.12, and \textit{i}=32.6$^{\circ}$. From 25,265 parameter retrievals with our bootstrapping method, we establish 1$\sigma$ confidence intervals on the orbital parameters \textit{a}=1$\farcs$06$\pm0\farcs09$, \textit{e}$=0.17\pm0.07$, and \textit{i}=$32.5^{\circ}\pm6.5^\circ$. We utilize publicly available ALMA $^{12}$CO observations to model the outer disk properties, and find a best-fit with an outer disk inclination of $\sim$28$^{\circ}$ from face-on. With the combined knowledge that the companion is on a near-circular orbit that is 3-4$\times$ larger than the disk, to which it is also co-planar, we find that HD 100453 represents a classical scenario of a circumstellar disk that is truncated by an external companion (e.g., \citealt{Artymowicz1994}, \citealt{Holman1999}). The full range of retrieved orbital parameters (Figure 5 and \S 4.2), and disk geometry (\S 2.5 \& \S 4.3.2), are fully consistent with this scenario, which is further supported by the atypical small size of the disk around HD 100453A. We utilized hydrodynamic and radiative transfer simulations to model the disk structures induced by the system's binary nature (\S 4.4). We find that the companion generates a two-armed spiral structure in the simulated disk that is well-matched to the observed general properties of the spiral arms in HD 100453, consistent with preliminary findings of \cite{Dong2016a} . Thus, any dynamical model of the disk structure must include the effects of the companion's gravitational perturbations in order to accurately match the dynamics of the system. We suggest that the other proposed spiral-arm-producing mechanisms (e.g., \citealt{Montesinos2016}, \citealt{Kama2016}) are not responsible for the ``grand-design" spiral structure of HD 100453. Finally, we note that the inclinations of the various system components, with the exception of the inner disk, are consistent with a co-planar system. Future work is required to elucidate the system configuration close to the primary star, including the presently enigmatic origin of the gap and the misaligned inner disk, which will further help to reveal the system's rich and complex dynamical history. \section{Acknowledgments} The authors wish to express their gratitude toward Kaitlin Kratter and Myriam Benisty for useful conversations and feedback on this manuscript, as well as toward the anonymous referee who provided numerous helpful suggestions and improvements, and to Karen Collins, Roy van Boekel, and Xuepeng Chen for providing additional information on the astrometric calibrations of the previously published NACO data. The results reported herein benefited from collaborations and/or information exchange within NASA's Nexus for Exoplanet System Science (NExSS) research coordination network sponsored by NASA's Science Mission Directorate. This paper makes use of the following ALMA data: ADS/JAO.ALMA\#2015.1.00192.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), NSC and ASIAA (Taiwan), and KASI (Republic of Korea), in cooperation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI/NRAO, and NAOJ. The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc. This paper includes data gathered with the 6.5 meter Magellan Telescopes located at Las Campanas Observatory, Chile. Based on observations made with ESO Telescopes at the La Silla Paranal Observatory under programme ID 095.C-0389(A). KRW is supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. 2015209499. KMM's and LMC's work is supported by the NASA Exoplanets Research Program (XRP) by cooperative agreement NNX16AD44G.
\section{Introduction} A surface embedded in the 4-sphere is said to be \textit{unknotted} if it bounds a handlebody. Regarding the 3-sphere $S^3$ as the equator of the 4-sphere, a knot $K\subset S^3$ is said to be \textit{smoothly doubly slice} if it is the intersection of an unknotted $S^2$ (smoothly embedded in $S^4$) with the equator $S^3$. Obviously not every knot is doubly slice, for there exists knots which are not even \textit{slice} (i.e.\ bounding properly embedded disks in the 4-ball $D^4$). However, not every slice knot is doubly slice. In fact, about five decades ago Fox posed a challenging question: determine which slice knots are doubly slice (cf.\ Problem 39 of \cite{Fox62}). Since then this question has been the center of the study of double sliceness, and many obstructions to double sliceness were found (e.g.\ \cite{Ste04, GL83, Kim06, LM15, Mei15, Ors17, Sum71}). While early attention to doubly slice knots are restricted to slice knots, recently Livingston and Meier introduced a notion called the \textit{double slice genus} of a knot, and this allows one to consider this topic in larger context \cite{LM15}. Here we recall the precise definition. \begin{defn} Given a knot $K\subset S^3$, its double slice genus is defined as \begin{displaymath} g_{ds}(K)=\min_{\mathcal{S}} \{ g(\mathcal{S})\\ | \\ \mathcal{S}\cap S^3 = K\}, \end{displaymath} where $S^3$ is the equator 3-sphere, and $\mathcal{S}$ is an unknotted surface in $S^4$, intersecting the equator transversally at the knot $K$. \end{defn} Note $g_{ds}(K)$ is well-defined, for a surface $\mathcal{S}$ satisfying the above requirements always exists. In fact, if we let $F$ be a surface obtained by pushing the interior of some Seifert surface of $K$ into the four-ball, then the double of $F$ clearly bounds a 3-manifold homeomorphic to $F\times I$. Furthermore, this also implies the double slice genus is bounded above by the Seifert genus. On the other hand, it is straightforward to see $g_{ds}(K)$ is bounded below by the slice genus of $K$. In summary, we have \begin{displaymath} 2g_4(K) \leq g_{ds}(K) \leq 2g_3(K). \end{displaymath} Much like the desire to tell sliceness and double sliceness apart, a natural question in this context is: are there knots with $g_{ds}-2g_4$ growing arbitrarily large? Answering this question requires a lower bound for the double slice genus. Note while many knot invariants give lower bounds for $g_4$, there previously are no algebraic invariants that improve on the lower bound $2g_4$ for $g_{ds}$. By using Casson-Gordon invariants of the two-fold branched cover in conjunction with another algebraic invariant that we define, we develop the first such lower bound in this paper (see Definition \ref{definition for theta}). As a primary application, we prove \begin{thm}\label{thm1} There exist ribbon knots $K_n$, $n\in \mathbb{N}$, such that $$\lim_{n\rightarrow \infty} g_{ds}(K_n)=\infty$$ \end{thm} Closely related to the double sliceness is a notion called supersliceness. Recall that a knot $K$ is called superslice if there is a slice disk $D$ whose double along $K$ produces an unknotted 2-sphere in $S^4$. As an analogue to the double slice genus, we define the superslice genus of a knot. \begin{defn} Given a knot $K\subset S^3$, its superslice genus is defined as \begin{displaymath} \begin{aligned} g^{s}(K)=\min_{F} \{ g(F)\, | \,F\,\text{is properly smoothly embedded in}\,D^4, \partial F= K\,\\ \text{and the double of\,}F\,\text{bounds a handlebody in\,}S^4 \}. \end{aligned} \end{displaymath} \end{defn} It is easy to see $g_{ds}(K)\leq 2g^s(K)$, and hence the lower bounds for the double slice genus hold for the superslice genus as well. However, greater rigidity encoded in the definition of the superslice genus compared to that of the double slice genus allows us to obtain a much more accessible bound. In this case, one no longer needs to apply Casson-Gordon invariants. More concretely, we have \begin{thm}\label{superslice lower bound} Let $K$ be a knot in $S^3$ and $\Sigma$ be the two-fold branched cover of $S^3$ along $K$. Then the minimum number of generators of $H_1(\Sigma)$ is a lower bound for $2 g^s(K)$. \end{thm} In fact, the idea contained in the proof of Theorem \ref{superslice lower bound} may serve as a prototype for the construction of the lower bound for the double slice genus. Compare Subsection 2.1 and Subsection 3.1. In addition to lower bounds, it is also natural to ask if one can give upper bounds for $g^s$ (or $g_{ds}$). In this paper, we pursue this direction in the topological category, i.e., we allow the surfaces used in the definition of superslice (resp.\ double slice) genus to be locally flat and topologically embedded. We use the notation $g^s_{top}(K)$ (resp.\ $g_{ds}^{top}$) when working in the topological category. We remark that the topological category and the smooth category are different \cite{Mei15, Rub16}, and the lower bounds constructed in this paper also hold in the topological category. The upper bound we offer comes from the Alexander polynomial. It is well known that if a knot has trivial Alexander polynomial, then it is topologically slice \cite{Fre82}. Recently, this theorem was generalized by Feller, who proved the degree of the Alexander polynomial is an upper bound for the topological slice genus \cite{Fel16}. In the context of superslice genus, Livingston and Meier proved that knots with trivial Alexander polynomial are topologically superslice \cite{LM15}. So it is natural to wonder if one can bound the topological superslice genus by the degree of the Alexander polynomial. Indeed, we have \begin{thm}\label{superslcie upper bound} The degree of the Alexander polynomial $\Delta_K(t)$ is an upper bound for the topological superslice genus. \end{thm} This theorem has the following corollary. \begin{cor}\label{superslice genus for knots with alex of deg 1} If the degree of the Alexander polynomial $\Delta_K(t)$ is $1$, then $g^s_{top}(K)=1$. \end{cor} The proof of Theorem \ref{superslcie upper bound} also implies the following. \begin{cor}\label{upper bound of top double slice genus for ribbon knot} If $K$ is ribbon, then the degree of the Alexander polynomial $\Delta_K(t)$ is an upper bound for $g^{top}_{ds}(K)$. \end{cor} \noindent\textbf{Organization.} The construction of the lower bounds for the double slice genus is detailed in the first three subsections of Section 2. Theorem \ref{thm1} is proved in Subsection 2.4, with the proof of a technical lemma postponed into the appendix. Theorem \ref{superslice lower bound} is proved in Subsection 3.1. Theorem \ref{superslcie upper bound} and its corollaries are proved in Subsection 3.2. \noindent\textbf{Acknowledgment:} I would like to thank Matt Hedden, Kristen Hendricks, Effie Kalfagianni and Chuck Livingston for their help and interest. Especially, Matt Hedden sacrificed his personal time discussing superslice genus with me during his very busy days, and Kristen Hendricks kindly provided extremely detailed feedback after reading an earlier version of this paper. \section{Construction of the lower bound} In this section, we will establish a lower bound for the double slice genus of a knot $K\subset S^3$. This bound comes from studying $\Sigma(K)$, the two-fold branched cover of $S^3$ along $K$, and we expect similar bounds can be defined using $n$-fold branched cover for a general $n$. More concretely, we first derive a lower bound by examining the singular homology of $\Sigma(K)$ in Subsection 2.1. After that, in Subsection 2.2 we study the Casson-Gordon invariants of $\Sigma(K)$, leading to other lower bounds. However, as it will be clear, these lower bounds are always trivial when applied independently. Nevetheless, they can be combined to give a nontrivial lower bound for the double slice genus. Finally, we prove Theorem \ref{thm1} in Subsection 2.4. \subsection{Double slice genus and the singular homology of $\Sigma(K)$} Regard $S^3$ as the equator of $S^4=D^4_1\cup_{S^3} D^4_2$, where the spaces $D_i^4$'s are two copies of the 4-ball. Let $K$ be a knot in $S^3$ and let $F_{i}$ be properly embedded surfaces in $D^4_{i}$ such that $\partial F_{i}=K$, $i=1,2$, and $F=F_1\cup F_2$ bounds a handlebody in $S^4$. Let $g_i=g(F_{i})$ denote the genus of $F_i$, $g=g_1+g_2$ and $W_i$ be the two-fold branched cover of $D_i^4$ along $F_i$, $i=1,2$. Then $\partial W_1=-\partial W_2=\Sigma(K)$, and $W=W_1\cup_{\Sigma(K)} W_2$ is diffeomorphic to $\#_{g}S^2\times S^2$, the $g$-fold connected sum of $S^2\times S^2$. Note that $b_2(W_i)=2g_i$. In this setting, there are various long exact sequences relating the singular homology groups of these spaces. Hence one might hope to study $b_2(W_i)$ using the homology groups of $\Sigma(K)$. For convenience, we write $\Sigma$ for $\Sigma(K)$ hereafter. Through out this paper we use integer coefficient for the singular homology groups unless otherwise specified. Note $\Sigma$ is a rational homology sphere. From the Mayer-Vietoris sequence for $W_1\cup_{\Sigma} W_2$, we have \begin{equation}\label{longexactsequence1} 0\rightarrow H_2(W_1)\oplus H_2(W_2)\rightarrow H_2(W) \rightarrow H_1(\Sigma) \rightarrow H_1(W_1)\oplus H_1(W_2) \rightarrow 0 \end{equation} The long exact sequence for the pair $(W, \Sigma)$ gives rise to \begin{equation}\label{longexactsequence2} 0\rightarrow H_2(W) \rightarrow H_2(W,\Sigma) \rightarrow H_1(\Sigma) \rightarrow 0 \end{equation} From the long exact sequence for $(W_i, \Sigma)$, $i=1,2$, we obtain \begin{equation}\label{longexactsequence3} 0\rightarrow H_2(W_i) \rightarrow H_2(W_i,\Sigma) \rightarrow H_1(\Sigma) \rightarrow H_1(W_i) \rightarrow 0, \end{equation} where surjectivity of the map $H_1(\Sigma) \rightarrow H_1(W_i)$ is derived from (\ref{longexactsequence1}). Finally, the long exact sequence for $(W, W_i)$, $i=1,2$ shows \begin{equation}\label{longexactsequence4} 0\rightarrow H_2(W_i) \rightarrow H_2(W) \rightarrow H_2(W,W_i) \rightarrow H_1(W_i) \rightarrow 0 \end{equation} Correspondingly, we can deduce the following properties of the homology groups involved in the above exact sequences. \begin{prop}\label{extendability} In the notation established above, we have \begin{enumerate}[(i)] \item $H_2(W_i)=\mathbb{Z}^{2g_i}$, $i=1,2$.\\ \item $|H_2(W_i)|^2 \big| |H_2(\Sigma)|$, $i=1,2$.\\ \item There exists $a^i_j \in H_1(W_i)\oplus\mathbb{Z}^{2g_i}$, $i=1,2$ and $j=1,2,...,2g$ such that \begin{enumerate} \item $\frac{ H_1(W_i)\oplus \oplus_{2g_i}\mathbb{Z}}{ \langle \{a^i_j |, j=1,...,2g \} \rangle }\cong H_1(W_{i+1})$, where $i$ is counted mod $2$. \item $\frac{ (H_1(W_1)\oplus\mathbb{Z}^{2g_1})\oplus (H_1(W_2)\oplus\mathbb{Z}^{2g_2} )} {\langle \{ (a^1_j,a^2_j)|, j=1,...,2g\} \rangle}\cong H_1(\Sigma)$. \end{enumerate} Here $\langle \{a^i_j |, j=1,...,2g \} \rangle$ stands for the subgroup generated by the set $\{a^i_j |, j=1,...,2g \}$. \item $H_1(W_1)\oplus H_1(W_2)$ is a quotient group of $H_1(\Sigma)$. \end{enumerate} \end{prop} \begin{proof} \begin{enumerate}[(i)] \item The long exact sequence (\ref{longexactsequence1}) implies $H_2(W_i)$ is free abelian, since it is mapped injectively into $H_2(W)=\mathbb{Z}^{2g}$. Recall $b_2(W_i)=2g_i$, hence $H_2(W_i)=\mathbb{Z}^{2g_i}$, $i=1,2$. \item Consider the long exact sequence (\ref{longexactsequence3}). First we claim $| \coker \{H_2(W_i) \rightarrow H_2(W_i,\Sigma)\} |$ is divisible by $|H_1(W_i)|$. To see the claim, note $H_2(W_i,\Sigma)\cong H^2(W_i)\cong H_2(W_i)\oplus H_1(W_i)$ by Poinc\'{a}re duality and the universal coefficient theorem. Assume $H_1(W_i)=\mathbb{Z}_{m_1}\oplus ...\oplus \mathbb{Z}_{m_k}$. Then $H_2(W_i)\oplus H_1(W_i)$ has a representation matrix of the form $$\begin{bmatrix} m_1 & 0 & 0 & 0 & \dots & 0 \\ \vdots & \ddots & \vdots & \vdots & \ddots &\vdots\\ 0 & 0 & m_k & 0 & \dots & 0 \end{bmatrix}$$ Then $\coker \{H_2(W_i) \rightarrow H_2(W_i,\Sigma)\}$ has a representation matrix $$\begin{bmatrix} m_1 & 0 & 0 & 0 & \dots & 0 \\ \vdots & \ddots & \vdots & \vdots & \ddots &\vdots\\ 0 & 0 & m_k & 0 & \dots & 0\\ * & * & * & * & \dots & * \\ \vdots & \ddots & \vdots & \vdots & \ddots &\vdots\\ * & * & * & * & \dots & * \end{bmatrix}$$ Note $|\coker \{H_2(W_i) \rightarrow H_2(W_i,\Sigma)\}|$ is equal to the absolute value of the determinant of the above matrix, and hence is divisible by $m_1m_2...m_k=|H_1(W_i)|$. With this claim at mind, the statement then follows easily from (\ref{longexactsequence3}). \item Note there are isomorphisms $$H_2(W,W_i)\cong H_2(W_{i+1},\Sigma)\cong H_2(W_{i+1})\oplus H_1(W_{i+1}) \cong H_1(W_{i+1})\oplus \mathbb{Z}^{2g_{i+1}}$$ and $$H_2(W,\Sigma)\cong H_2(W_1,\Sigma)\oplus H_2(W_2,\Sigma)\cong H_1(W_1)\oplus \mathbb{Z}^{2g_1} \oplus H_1(W_2)\oplus \mathbb{Z}^{2g_2}$$ With this in mind, the statements follow from long exact sequences (\ref{longexactsequence4}) and (\ref{longexactsequence2}) in a straightforward way. \item This clearly follows from the long exact sequence (\ref{longexactsequence1}). It is worth pointing out this also follows from (iii), i.e., the statement in (iii) automatically gives rise to a quotient map from $H_1(\Sigma)$ to $H_1(W_1)\oplus H_1(W_2)$. \end{enumerate} \end{proof} These observations motivate the following definitions. \begin{defn}\label{definition1} Let $G$ be a finite abelian group. \begin{enumerate}[(a)] \item Consider triples $(G_1,G_2, \iota)$ in which $G_1$ and $G_2$ are finite abelian groups and $\iota\in \Hom(G,G_1\oplus G_2)$, then such a triple is said to be admissible for $G$ if \begin{enumerate}[(i)] \item $|G_i|^2 \big| |G|$, $i=1,2$. \item $\exists n_1, n_2 \in \mathbb{N}$, and $a^i_j \in G_i\oplus\mathbb{Z}^{2n_i}$, $i=1,2$ and $j=1,2,...,2(n_1+n_2)$ such that \begin{enumerate}[1.] \item $\frac{G_i\oplus \mathbb{Z}^{2n_i}}{\langle \{ a^i_j|, j=1,...,2(n_1+n_2)\} \rangle} \cong G_{i+1}$ \item $\frac{(G_1\oplus \mathbb{Z}^{2n_1})\oplus(G_2\oplus \mathbb{Z}^{2n_2})}{\langle \{ (a^1_j,a^2_j)|, j=1,...,2(n_1+n_2)\} \rangle} \cong G$ \end{enumerate} \item $\iota$ is the quotient map induced by condition (ii). \end{enumerate} \item A pair of abelian groups $(G_1,G_2)$ is said to be extendable for $G$ if there exists $\iota\in \Hom(G,G_1\oplus G_2)$ such that $(G_1,G_2,\iota)$ is admissible. \end{enumerate} \end{defn} \begin{defn} Let $G$ be a finite abelian group and $(G_1,G_2)$ be an extendable pair for $G$. We define a numerical invariant $$\theta_1(G,G_1,G_2)=\min_{(G_1,G_2,\iota)} \{n_1+n_2 \mid n_1,\, n_2 \,\text{are as in Definition \ref{definition1}} \},$$ where the minimum is taken over all possible extensions $(G_1,G_2,\iota)$ of $(G_1,G_2)$. \end{defn} It clearly follows from Proposition \ref{extendability} that $$\theta_1(H_1(\Sigma),H_1(W_1),H_1(W_2))\leq g_{ds}(K).$$ However, $\theta_1$ has an apparent drawback in that $H_1(W_i)$ cannot be inferred from the knot $K$, and taking a further minimum over all possible extendable pairs would lead to rather trivial bounds. Fortunately, we are able to remedy this by using Casson-Gordon invariants in the next subsection. \subsection{Double slice genus and Casson-Gordon invariants} In this subsection, we use Casson-Gordon invariants to construct a lower bound for the double slice genus. First we recall the relevant facts about Casson-Gordon invariants below. Detailed information may be found in \cite{CG86, Gil81, Rub83}. We begin with recalling the definition of Casson-Gordon invariants. Let $M$ be an oriented three manifold equipped with a character $\phi: H_1(M)\rightarrow \mathbb{Z}_d$, where $d$ is a non-negative integer. By bordism theory, there exists some positive integer $r$ such that $r\cdot (M,\phi)=\partial (V,\phi')$, where $V$ is a 4-manifold and $\phi': H_1(V)\rightarrow \mathbb{Z}_d$ is a character that restricts to $\phi$ on the boundary. $\phi'$ determines a cyclic cover $\tilde{V}\rightarrow V$ with a preferred covering transformation $T \colon \tilde{V}\rightarrow \tilde{V}$. Let $T_* \colon H_2(\tilde{V};\mathbb{C})\rightarrow H_2(\tilde{V};\mathbb{C})$ be the induced automorphism and $\bar{H}_2(V,\phi')=\omega=e^{2\pi i/d}-\text{eigenspace of }T_*$. Note that the intersection form on $H_2(\tilde{V};\mathbb{Z})$ extends naturally to a Hermitian pairing $\langle\, , \, \rangle$ on $H_2(\tilde{V};\mathbb{C})=H_2(\tilde{V};\mathbb{Z})\otimes \mathbb{C}$. Let $\bar{\sigma}(V,\phi')$ denote the signature of this Hermitian pairing restricted to $\bar{H}_2(V,\phi')$. Then define the Casson-Gordon invariant associated to $(M,\phi)$ as $$\sigma(M,\phi)=\frac{1}{r}(\bar{\sigma}(V,\phi')-\sigma(V)).$$ Here $\sigma(V)$ denotes the usual signature invariant of a 4-manifold. The key fact that we use to relate Casson-Gordon invariants and the double slice genus is the following proposition due to Gilmer. \begin{prop}[Proposition 1.4 of \cite{Gil81}]\label{smiththeory} If $\phi'$ is of prime power order, i.e., $d=p^n$, let $\bar{b}_2(V):=\dim_\mathbb{C} \bar{H}_2(V,\phi')$ and $b_2(V,\mathbb{Z}_p):=\dim_{\mathbb{Z}_p} H_2(V;\mathbb{Z}_p)$. Then $$ \bar{b}_2(V) \leq b_2(V,\mathbb{Z}_p).$$ \end{prop} With the above preparation on Casson-Gordon invariants, we are ready to return to the double slice genus. Let $K$, $W_i$ for $i=1,2$, $W$ and $\Sigma$ be as in Subsection 2.1. Let $p$ be a prime integer, and for a finite abelian group $G$, define $\xi_p(G):=\dim_{\mathbb{Z}_p}G\otimes \mathbb{Z}_p$. \begin{thm}\label{lowerbound by CG} Let $d=p^n$ and $\phi_i: H_1(\Sigma)\rightarrow \mathbb{Z}_d$ be a character that factors through $H_1(W_i)$ along the inclusion induced homomorphism $\iota_i: H_1(\Sigma)\rightarrow H_1(W_i)$, $i=1,2$. Then \begin{enumerate}[(i)] \item $|\sigma(\Sigma,\phi_1)-\sigma(\Sigma,\phi_2)|-\xi_p(H_1(W_1)\oplus H_1(W_2))\leq 2g_{ds}(K).$ \item $|\sigma(\Sigma,\phi_i)+\sigma(K)|-\xi_p(H_1(W_i))\leq 2g_i.$ \end{enumerate} \end{thm} \begin{proof} \begin{enumerate}[(i)] \item Note $\Sigma=\partial W_1=-\partial W_2$, hence \begin{displaymath} \begin{aligned} |\sigma(\Sigma,\phi_1)-\sigma(\Sigma,\phi_2)|&=|\bar{\sigma}(W_1,\phi_1)+\bar{\sigma}(W_2,\phi_2)-\sigma(W_1)-\sigma(W_2)|\\ &=|\bar{\sigma}(W_1,\phi_1)+\bar{\sigma}(W_2,\phi_2)-\sigma(W)|\\ &=|\bar{\sigma}(W_1,\phi_1)+\bar{\sigma}(W_2,\phi_2)|\\ &\leq \bar{b}_2(W_1)+\bar{b}_2(W_2)\\ &\leq b_2(W_1;\mathbb{Z}_p)+b_2(W_1;\mathbb{Z}_p)\\ &=2g_1+\xi_p(H_1(W_1))+2g_2+\xi_p(H_1(W_2)) \end{aligned} \end{displaymath} Note $g_{ds}(K)=g_1+g_2$ and $\xi_p(H_1(W_1)\oplus H_1(W_2))=\xi_p(H_1(W_1))+\xi_p(H_1(W_2))$, hence the statement. \item Note that $\sigma(K)=\sigma(W_1)=-\sigma(W_2)$ by Theorem 3.1 of \cite{KT76}. Then a nearly verbatim argument as in (i) produces a proof. \end{enumerate} \end{proof} Let $G$ be a finite abelian group and $(G_1,G_2,\iota)$ be an admissible triple for $G$, then $\iota$ induces $\iota_i:G\rightarrow G_i$ by composing $\iota$ with the canonical projection, $i=1,2$. The following definition is motivated by the above theorem, similar to the definition of $\theta_1$. \begin{defn} Let $(G_1,G_2)$ be an extendable pair for $H_1(\Sigma)$, define $$ \begin{aligned} \theta_2&(\Sigma,G_1,G_2)=\\ \frac{1}{2}&\min_{(G_1,G_2,\iota)}\max_{\phi_1,\phi_2,p}\{|\sigma(\Sigma,\phi_1)-\sigma(\Sigma,\phi_2)|-\xi_p(G_1\oplus G_2)\, \big| \, \phi_i\, \text{factors through}\, G_i \\ & \text{\,\,\,\, and is of prime power order}\} \end{aligned} $$ and $$ \begin{aligned} \theta_3&(K,G_1,G_2)=\\ \frac{1}{2}&\min_{(G_1,G_2,\iota)}\max_{\phi_1,\phi_2,p}\{\max(0, |\sigma(\Sigma,\phi_1)+\sigma(K)|-\xi_p(G_1))+\\ &\max(0,|\sigma(\Sigma,\phi_2)+\sigma(K)|-\xi_p(G_2))\,\big| \, \\ &\phi_i\, \text{factors through}\, G_i \text{\, and is of prime power order}\} \end{aligned} $$ \end{defn} In view of Theorem \ref{lowerbound by CG} we clearly have $\theta_2(\Sigma,H_1(W_1),H_1(W_2))\leq g_{ds}(K)$ and $ \theta_3(K,H_1(W_1),H_1(W_2))\leq g_{ds}(K)$. However, like $\theta_1$, these invariants are difficult to utilize since one have little control of $H_1(W_i)$ for $i=1,2$. \subsection{Combining $\theta_i$} So far we have defined various $\theta_i$'s, all of which require the input of an extendable pair that cannot be deduced from the knot. One obvious remedy is to take a minimum over all the extendable pairs, which unfortunately does not lead to a useful lower bound if one uses a single $\theta_i$. However, this can be overcame by combining these invariants. First note that $\theta_1$ and $\theta_2$ are well defined if we replace $\Sigma$ with an arbitrary rational homology sphere. This allows us to make the following definition. \begin{defn} \begin{enumerate}[(i)] \item Given a rational homology $3$-sphere $Y$, define $$\Theta(Y)=\min_{(G_1,G_2)}\max\{\theta_1(H_1(Y),G_1,G_2), \theta_2(Y,G_1,G_2)\}.$$ Here the minimum is taken over all extendable pairs $(G_1,G_2)$ for $H_1(Y)$. \item Let $K$ be a knot in $S^3$, and $\Sigma$ be the two-fold branched cover of $S^3$ along $K$. Define $$\Theta(K)=\Theta(\Sigma).$$ \end{enumerate} \end{defn} In view of the discussion of the previous subsections, it is clear that $\Theta(K)$ is a lower bound for $g_{ds}(K)$. In fact, we can relate $\Theta(Y)$ and the \textit{embedding number}. Recall every orientable $3$-manifold $Y$ embeds in $\#_n S^2\times S^2$ for sufficiently large $n$, and the minimum such $n$ is defined to be the embedding number $\epsilon(Y)$ \cite{AGL17}. It is easy to see $\epsilon(\Sigma(K))\leq g_{ds}(K)$. Moreover, we have \begin{thm} Let $Y$ be a rational homology 3-sphere. Then $$\Theta(Y)\leq \epsilon(Y).$$ \end{thm} \begin{proof} Embedding $Y$ in $\#_n S^2\times S^2$ separates $\#_n S^2\times S^2$ into two manifolds $V_1$ and $V_2$. The proofs of Theorem \ref{extendability} and Theorem \ref{lowerbound by CG} carry over verbatim with $\Sigma$, $W_1$ and $W_2$ replaced by $Y$, $V_1$ and $V_2$. \end{proof} When only interested in knots, we can use $\theta_3$ instead of $\theta_2$ to give a better lower bound for the double slice genus. \begin{defn}\label{definition for theta} Let $K$ be a knot in the 3-sphere. Define $$\theta(K)=\min_{(G_1,G_2)}\max\{\theta_1(H_1(\Sigma(K)),G_1,G_2), \theta_3(K,G_1,G_2)\}.$$ Here the minimum is taken over all extendable pairs $(G_1,G_2)$ for $H_1(\Sigma(K))$. \end{defn} Clearly $\theta(K)\leq g_{ds}(K)$. \subsection{Proof of Theorem \ref{thm1}} In this subsection we prove Theorem \ref{thm1} using the $\theta$-invariant of Definition \ref{definition for theta}. We begin by constructing the knots. Take $J$ to be the two-bridge knot corresponding to $\frac{9}{4}$, which is known to be ribbon (e.g. see \cite{CG86}). Let $K_n=\overbrace{J\#\cdots\#J}^{n}$. Note $\Sigma(J)=L(9,4)$ and hence $\Sigma(K_n)=\overbrace{L(9,4)\#\cdots \#L(9,4)}^{n}$. To estimate $\theta(K_n)$, we will need to understand the behavior of Casson-Gordon invariants of $\Sigma(K_n)$. This is addressed in the following technical proposition. \begin{prop}\label{technicalproposition} Let $m$ be a nonnegative integer and $s: H_1(\Sigma(K_n))\rightarrow \overbrace{\mathbb{Z}_9\oplus\cdots\oplus \mathbb{Z}_9}^{m}$ be a surjective map, then there exists a map $j:\overbrace{\mathbb{Z}_9\oplus\cdots\oplus \mathbb{Z}_9}^{m}\rightarrow \mathbb{Z}_9$ such that $\sigma(\Sigma(K_n), j \circ s)\geq \frac{10}{9}m$. \end{prop} The proof of this proposition appears in Appendix A. Clearly Theorem \ref{thm1} will follow from the next theorem. \begin{thm}\label{small thm1} $\theta(K_{110n}) \geq n$, and hence $g_{ds}(K_{110n}) \geq n$. \end{thm} \begin{proof} Let $(G_1, G_2)$ be an extendable pair for $H_1(\Sigma(K_{110n}))$. Since $G_1\oplus G_2$ is a quotient group of $H_1(\Sigma(K_{110n}))=\oplus_{110n}\mathbb{Z}_9$, we may write $G_1\oplus G_2=\overbrace{\mathbb{Z}_9\oplus\cdots\oplus\mathbb{Z}_9}^{l}\oplus\mathbb{Z}_3\oplus\cdots\oplus\mathbb{Z}_3$ for some $l$. We will prove $\theta(K_{110n})\geq n$ by considering the possible values of $l$ in two cases. First, if $110n-l\geq 2n$, then we must have $\theta_1(H_1(\Sigma),G_1,G_2)\geq n$ in view of Condition 2 of part (a)-(ii) of Definition \ref{definition1}, since one must employ at least another $110n-l$ elements of order $9$ to get to $H_1(\Sigma)$. Second, if $110n-l<2n$, then $l>108n$. Then at least one of $G_i$, say $G_1$, has $l'$ many $\mathbb{Z}_9$ summands with $l'\geq 54n$. Then by Proposition \ref{technicalproposition} we may find a character $\phi_1:H_1(\Sigma(K_{110n}))\rightarrow \mathbb{Z}_9$ that factors through $\iota_1: H_1(\Sigma(K_{110n}))\rightarrow G_1$, such that $\sigma(\Sigma(K_{110n}),\phi_1)\geq \frac{10}{9}l' .$ Also note that $\xi_3(G_1)\leq l'+110n-l$ and $\sigma(K_{110n})=0$. Therefore, $$ \begin{aligned} \theta_3(K_{110n},G_1,G_2) \geq& \frac{1}{2}(\frac{10}{9}l'-(l'+110n-l))\\ \geq& \frac{1}{2}(\frac{l'}{9}-2n)\\ \geq& \frac{1}{2}(\frac{54n}{9}-2n)\\ =& n \end{aligned} $$ Therefore, $\theta(K)\geq n$ in either case. \end{proof} \begin{rmk} For any given nonnegative integer $m$, one can similarly prove there is a family of knots whose slice genera are all equal to $m$ and double slice genera grow arbitrarily large. In fact, taking connected sum of $m$ copies of the trefoil knot and $K_n$ as above would provide such examples. \end{rmk} However, the author is not able to prove the embedding numbers of $\Sigma(K_n)$ grow arbitrarily large by the $\Theta$-invariant defined in Subsection 2.3. Techniques from \cite{AGL17} give lower bounds for the 2-nd betti number of spin 4-manifolds with boundary being a given 3-manifold, and hence cannot be applied here since our 3-manifolds bound rational homology balls. It seems natural to ask \begin{que} Can one find a family of rational homology spheres that are boundaries of spin rational homology balls and whose embedding numbers can grow arbitrarily large? \end{que} Moreover, the author wonder if one can find examples so that the $\Theta$-invariant can be applied to answer the above question. \section{Bounds for the superslice genus} \subsection{A lower bound for the superslice genus} In this subsection, we will prove Theorem \ref{superslice lower bound}. As a preparation we begin with two lemmas. \begin{lem}\label{lemma, trivial surface complement has cyclic fundamental group} Let $F$ be a surface properly embedded in $D^4$ whose double bounds a handlebody in $S^4$. Then $\pi_1(D^4-F)\cong \mathbb{Z}$. \end{lem} \begin{proof} Write the double of $F$ as $F_+\cup F_-$. Since $F_+\cup F_-$ bounds a handlebody in $S^4$, $\pi_1(S^4-(F_+\cup F_-))\cong \mathbb{Z}$. Applying Van Kampen's theorem, we have the following pushout diagram. Using the universal property we see there is a surjective map $\pi_1(S^4-(F_+\cup F_-))\cong \mathbb{Z}\rightarrow \pi_1(D^4-F)$. Therefore $\pi_1(D^4-F)$ is a cyclic group and must be isomorphic to $\mathbb{Z}$, since $H_1(D^4-F)\cong\mathbb{Z}$ by Alexander duality. \begin{center} \begin{tikzpicture}[% >=stealth, shorten >=2pt, shorten <=2pt, auto, node distance=1.4cm ] \node (a) {$\pi_1(S^3-K)$}; \node (c) [node distance=1.4 cm, right of=a, above of=a] {$\pi_1(D^4-F_+)$}; \node (b) [node distance=3.2 cm, right of=a] {$\pi_1(S^4-(F_+\cup F_-))$}; \node (d) [node distance=1.4 cm, right of=a, below of=a] {$\pi_1(D^4-F_-)$}; \node (f) [node distance=4.5cm, right of=b]{$\pi_1(D^4-F)$}; \path[->] (a) edge (c); \path[->] (a) edge (d); \path[->] (c) edge (b); \path[->] (d) edge (b); \path[->] (c) edge node (i) {$Id$} (f); \path[->] (d) edge node[swap] (ii) {$Id$} (f); \path[->,dashed] (b) edge (f); \end{tikzpicture} \end{center} \end{proof} \begin{lem} Let $F$ be as in the previous lemma, and $W$ be the two-fold branched cover of $D^4$ along $F$, then $H_1(W)=0$. \end{lem} \begin{proof} Let $\tilde{F}\subset W$ be the lift of $F$. Then from the previous lemma, we know $\pi_1(W-\tilde{F})\cong \mathbb{Z}$. Therefore $H_1(W-\tilde{F}) \cong \mathbb{Z}$, generated by the homology class of a meridian of $\tilde{F}$. Gluing $\tilde{F}$ back annihilates this and hence $H_1(W)=0$. \end{proof} \begin{proof}[Proof of Theorem \ref{superslice lower bound}] Assume $F$ is a surface achieving the minimal superslice genus of the knot $K$, and $W$ is the two-fold branched cover of $D^4$ along $F$. Furthermore, let $\Sigma=\partial W$ denote the two-fold branched cover of $S^3$ along $K$. Note that $H_2(\Sigma)=0$, and $H_1(W)=0$ by the previous lemma. Then the long exact sequence associated to the pair $(W,\Sigma)$ gives $$ 0\rightarrow H_2(W)\rightarrow H_2(W,\Sigma)\rightarrow H_1(\Sigma)\rightarrow 0. $$ Note $H_2(W,\Sigma)=H^2(W)$, and one can see $H^2(W)$ is free abelian by the universal coefficient theorem and the fact that $H_1(W)=0$. Since $b_2(W)=2g^s(K)$, we have a presentation for $H_1(\Sigma)$ $$ 0\rightarrow \mathbb{Z}^{2g^s(K)}\rightarrow \mathbb{Z}^{2g^s(K)} \rightarrow H_1(\Sigma)\rightarrow 0. $$ Hence the theorem follows. \end{proof} \subsection{An upper bound for the topological superslice genus} In this subsection we prove Theorem \ref{superslcie upper bound}, which depends on the following three nontrivial results. The first one is due to Freedman. \begin{thm}[Theorem 1.13 of \cite{Fre82}]\label{freedman disk theorem} Let $K$ be a knot in $S^3$ such that $\Delta_K(t)=1$, then $K$ bounds a locally flat, topologically embedded disk $D\subset D^4$ such that $\pi_1(D^4-D)\cong \mathbb{Z}$. \end{thm} The second result is the key Proposition proved in \cite{Fel16}, which is utilized in conjunction with the previous theorem to show the degree of the Alexander polynomial is an upper bound for the topological slice genus. \begin{prop}[\cite{Fel16}]\label{feller's proposition} Let $K$ be a knot. Every Seifert surface $F$ of $K$ contains a separating simple closed curve $L$ such that: \begin{enumerate}[(i)] \item The Alexander polynomial of $L$ is trivial. \item The connected component $C$ of $F - L$ that does not contain $K$ is a Seifert surface for L with $g (C) = g (F) -\text{deg}(\Delta_K(t))$. \end{enumerate} \end{prop} \begin{rmk} In \cite{Fel16} Feller uses $\text{deg}(\Delta_K(t))$ to stand for the breadth of of $\Delta_K(t)$, while we use this notation to stand for the highest degree of the symmetric Alexander polynomial. \end{rmk} The third result we need is the unknotting theorem proved by Hillman and Kawauchi, which characterizes when a surface bounds a handbody in $S^4$ in terms of the fundamental group of the surface complement. \begin{thm}[\cite{HK95}]\label{Hillman and Kawauchi} Let $\mathcal{S}$ be a locally flat, topologically embedded closed surface in $S^4$. Then $\mathcal{S}$ bounds a handlebody in $S^4$ if and only if $\pi_1(S^4-\mathcal{S})\cong \mathbb{Z}$. \end{thm} With these preparations at hand, we are ready to prove Theorem \ref{superslcie upper bound}. \begin{proof}[Proof of Theorem \ref{superslcie upper bound}] Start with a Seifert surface $F$ for $K$, and let $L$ and $C$ be as in Proposition \ref{feller's proposition}. Treat $D^4$ as $S^3\times [0,1] \cup_{S^3\times \{1\}} B^4$, where $B^4$ is just the four ball with different notation to avoid confusion. Construct a surface $\hat{F}$ by pushing the interior of $F$ into $D^4$ such that $(F-C) $ is pushed into $S^3\times [0,1]$, and $C$ is pushed into $B^4$, denoted by $\hat{C}$. It is easy to see $\pi_1(D^4-\hat{F})\cong \mathbb{Z}$ and $\pi_1(B^4-\hat{C})\cong \mathbb{Z}$. By Theorem \ref{freedman disk theorem}, $L$ bounds a disk $D$ whose complement also has cyclic fundamental group. Let $\tilde{F}$ be obtained from $\hat{F}$ by replacing $\hat{C}$ in $B^4$ by $D$, then $g(\tilde{F})=\text{deg}(\Delta_K(t))$. By Van Kampen's theorem, one sees $\pi_1(D^4-\tilde{F})\cong \mathbb{Z}$. Again by Van Kampen's theorem we see the double of $\tilde{F}$ has complement with cyclic fundamental group, and hence by Theorem \ref{Hillman and Kawauchi} we know it bounds a handlebody. Therefore, $g^s_{top}(K)\leq \deg(\Delta_K(t))$. \end{proof} As we mentioned in the introduction, this theorem has the following immediate corollaries. The first one is Corollary \ref{superslice genus for knots with alex of deg 1}, which says $\deg(\Delta_K(t))=1$ implies $g^s_{top}(K)=1$. \begin{proof}[Proof of Corollary \ref{superslice genus for knots with alex of deg 1}] It is understood $g^s_{top}(K)=0$ if and only if $\Delta_K(t)=1$ (\cite{LM15} \cite{GS75}). Therefore $\deg(\Delta_K(t))=1$ implies $g^s_{top}(K)>0$. In view of Theorem \ref{superslcie upper bound}, $g^s_{top}(K)\leq 1$. Hence we have $g^s_{top}(K)=1$. \end{proof} The next one is Corollary \ref{upper bound of top double slice genus for ribbon knot}, which concerns the double slice genus instead of the superslice genus. Recall it says if $K$ is ribbon, then $g_{ds}^{top} \leq \deg(\Delta_K(t))$. \begin{proof}[Proof of Corollary \ref{upper bound of top double slice genus for ribbon knot}] Let $\tilde{F}$ be a surface as constructed in the proof of Theorem \ref{superslcie upper bound}. We already observed that $\pi_1(D^4-\tilde{F})\cong \mathbb{Z}$. Let $D$ be a ribbon disk for $K$. It is known that the inclusion induced homomorphism $\pi_1(S^3-K)\rightarrow \pi_1(D^4-D)$ is surjective (e.g. Lemma 1 of \cite{CG86}). Hence by Van Kampen's theorem, one easily sees $\pi_1(S^4-(D\cup\tilde{F}))\cong \mathbb{Z}$. Therefore, by Theorem \ref{Hillman and Kawauchi} we know $D\cup\tilde{F}$ bounds a handlebody. \end{proof}
\section{Introduction} \label{sec:introduction} \par The majority of galaxies in the local Universe do not evolve in isolation but instead inhabit dense environments such as groups and clusters \citep[e.g.][]{geller1983, eke2005}. In addition to internal processes (e.g.\ AGN feedback, \citealt{dubois2013, gurkan2015, mullaney2015, bongiorno2016}; bar-driven evolution, \citealt{knapen1995, kormendy2004, sheth2005}; morphological quenching, \citealt{martig2009}; virial gas heating, \citealt{birnboim2003, cattaneo2006, gabor2015}; etc.), interactions with local environments play a significant role in shaping the observed properties of galaxies. For example, mechanisms acting in dense environments such as ram-pressure stripping \citep[e.g.][]{gunn1972} and starvation \citep[e.g.][]{larson1980, peng2015} can remove the cold and hot gas components from galaxies, respectively. Galaxy interactions, such as mergers and impulsive high-speed encounters, can drive gas to the central regions and induce star-burst events which may exhaust a galaxies gas reserves \citep[e.g.][]{mihos1994a, mihos1994b, ellison2008, davies2015}. These interactions can also influence galaxy morphology through the growth of a strong bulge component, and the end products of major mergers tend to be bulge dominated galaxies with classical de Vaucouleurs profiles \citep[e.g.][]{barnes1989}. Finally, tidal interactions can also influence gas content through direct stripping or by transporting gas outwards allowing it to be more easily stripped by other mechanisms \citep[e.g.][]{mayer2006, chung2007}. It's generally accepted that these mechanisms can act on galaxies in dense environments, though the relative balance between different mechanisms in different environments remains an outstanding question. \par Understanding the influence of environment is contingent on being able to identify and quantify galaxy environments. Common environmental measures include the projected number density of galaxies out to the $Nth$ nearest neighbour, the halo mass of a host group or cluster, or the projected separation from the centre of a group or cluster. Star formation and morphology of galaxies correlate well with these environment proxies, with galaxies in high densities regions (or alternatively, high halo mass or small group/cluster-centric radius) being preferentially red, passive, and early type \citep{dressler1980, goto2003, poggianti2008, kimm2009, li2009, wetzel2012, wilman2012, fasano2015, haines2015}. An alternative way to parametrize the environment of a host group or cluster, is to classify the degree to which a system is dynamically relaxed. A relaxed, dynamically old group or cluster should be characterized by a central galaxy which is the brightest (most massive) member by a significant margin \citep[e.g][]{khosroshahi2007, dariush2010, smith2010} and is located near the minimum of the potential well (e.g.\ \citealt{george2012, zitrin2012}, however also see \citealt{skibba2011}), satellite galaxies which are distributed in velocity space according to a Gaussian profile \citep[e.g.][]{yahil1977, bird1993, hou2009, martinez2012}, and diffuse X-ray emission which is symmetric about the group/cluster centre \citep[e.g.][]{rasia2013, weissmann2013, parekh2015}. The dynamical state of clusters is related to the age of the halo and the time since infall for member galaxies, which simulations have shown is an important quantity in determining the degree to which galaxy properties are affected by environment \citep[e.g.][]{wetzel2013, oman2016, joshi2017}. Unrelaxed groups and clusters are systems which formed more recently or which have recently experienced a significant merger event, and in either case it would be expected that the time-since-infall onto the current halo for member galaxies will be relatively short. Therefore galaxies in unrelaxed groups may have properties which have been less influenced by environment compared to galaxies in more relaxed systems. \par Recent studies have attempted to determine the degree to which galaxy properties depend on the ``relaxedness'' of a given group or cluster. It has been shown that galaxies in relaxed groups tend to be redder than counterparts in unrelaxed systems, using relaxation definitions based on the presence of a well-defined central galaxy \citep[e.g.][]{carollo2013} as well as the shape of the satellite velocity distribution \citep[e.g.][]{ribeiro2010, ribeiro2013a}. Previously, we have shown that low-mass galaxies in the inner regions of Gaussian (G) groups have reduced star-forming fractions relative to non-Gaussian (NG) groups \citep{roberts2017}. We have also shown that star-forming and disc fractions for low mass galaxies are enhanced in X-ray underluminous (XRW) groups, and show that galaxies XRW groups have velocity distributions consistent with being unrelaxed systems (at least relative to X-ray strong groups, \citealt{roberts2016}). \par Building from our recent work, here we aim to further investigate the connection between X-ray and optical measures of group relaxedness. The shape of the diffuse X-ray component of a group or cluster is among the most direct probes of the degree to which a group/cluster is relaxed or recently disturbed. The downside, however, is that measuring this morphology requires deep, high-quality X-ray observations which are not available for large surveys containing thousands of groups and clusters. To address this challenge, we use a sample of galaxy clusters with existing X-ray observations to investigate the relationship between the X-ray relaxation and three previously used optical probes of relaxation: the shape of the satellite velocity distribution, the stellar mass gap between the most-massive and second-most-massive group galaxy, and the offset between the position of the most-massive galaxy and the luminosity-weighted centre of the group. We determine the effectiveness of these optical relaxation measures (which are applicable to large redshift surveys) by comparing them to measured X-ray morphology, a more direct probe of relaxation. \par The outline of this paper is as follows. In Section 2 we describe the optical group catalogue as well as the archival X-ray data used in this work. In Section 3 we outline the cluster relaxation estimators, both optical and X-ray, that we consider. In Section 4 we present the main results, comparing optical and X-ray cluster relaxation measures. In Section 5 we discuss these results and provide a summary in Section 6. \par This paper assumes a flat $\mathrm{\Lambda}$ cold dark matter cosmology with $\Omega_\mathrm{M} = 0.3$, $\Omega_\mathrm{\Lambda} = 0.7$, and $H_0 = 70\,\mathrm{km}\,\mathrm{s^{-1}}\,\mathrm{Mpc^{-1}}$. The $h$-dependence of important calculated properties are: $M_\mathrm{halo} \sim h^{-1}$, $M_\mathrm{\star} \sim h^{-2}$, $R_{500} \sim h^{-1}$. \section{Data} \label{sec:data} \begin{figure} \centering \includegraphics[width=0.85\columnwidth]{z_mh.pdf} \caption{Cluster halo mass versus redshift for Yang clusters. Stars correspond to the X-ray matched clusters used in this work, coloured by the number of galaxies identified in each system. Gray contours show the distribution for the parent sample of N > 10 Yang clusters.} \label{fig:z_mh} \end{figure} \subsection{Optically identified galaxy clusters} We use galaxy clusters identified from the seventh release of the Sloan Digital Sky Survey (SDSS DR7; \citealt{abazajian2009}) by \citet{yang2005, yang2007} who construct a group sample using a ``halo-based" group finder which aims to improve upon the classic friends-of-friends (FoF) algorithm \citep[e.g.][]{huchra1982, press1982}. For a full description of the algorithm see \citet{yang2005, yang2007}, however in short, the groups are initially populated by connecting galaxies through a standard FoF approach (with very small linking lengths) and group memberships are iteritively updated under the assumption that the distribution of galaxies in phase space follows that of a spherical NFW profile \citep{navarro1997}. Each iteration yields an updated estimate of the group mass, size, and velocity dispersion and iterations continue until memberships stabilize. Final group halo masses ($M_\mathrm{halo}$) obtained via abundance matching are given in the Yang catalogue (in particular, we use the sample III); we use galaxy stellar masses ($M_\star$) given in the New York University Value-Added Galaxy Catalogue (NYU-VAGC; \citealt{blanton2005a}) determined using fits to the galaxy spectra and broad-band photometric measurements following the procedure of \citet{blanton2007}. We note that the Yang catalogue contains a mixture of what would generally be considered groups ($M_\mathrm{halo} < 10^{14}\,\mathrm{M_{\sun}}$) as well as galaxy clusters ($M_\mathrm{halo} \ge 10^{14}\,\mathrm{M_{\sun}}$), for the sake of brevity we will refer to all systems as clusters regardless of halo mass as the majority of the systems we consider have $M_\mathrm{halo} \ge 10^{14}\,\mathrm{M_{\sun}}$. \par Cluster-centric radii are computed for galaxies using the redshift and the angular separation between the galaxy position and the luminosity-weighted centre of the cluster. We normalize all cluster-centric radii by $R_{500}$ (the radius at which the average interior density is 500 times the critical density of the Universe) of each cluster which we compute as \begin{equation} R_{500} = R_{200m} / 2.7, \end{equation} \noindent where, \begin{equation} R_{200m} = 1.61\,\mathrm{Mpc} \left(\frac{M_\mathrm{halo}}{10^{14}\,\,\mathrm{M_{\sun}}}\right)^{1/3} (1 + z_\mathrm{group})^{-1} \end{equation} \noindent is the radius at which the average interior density is equal to 200 times the critical mass density of the Universe \citep{yang2007, tinker2008}, and we have assumed an NFW density profile \citep{navarro1997} with a concentration given by the concentration-mass relation of \citet{maccio2007} \citep{wang2014}. Our sample of galaxy clusters is a subset of the Yang catalogue including only clusters with ten or more member galaxies (2559 clusters). The cut-off in membership is chosen in order to be able to classify the shape of the velocity profile for each cluster with relative accuracy \citep{hou2009}. Fig.~\ref{fig:z_mh} shows the $M_\mathrm{halo}$ - redshift distribution for the parent sample (gray contours) with the 58 X-ray matched clusters (see Section~\ref{sec:X-ray_match}) overplotted as stars colour-coded by the number of galaxies identified in each cluster. As expected, at fixed redshift the observed cluster richness increases with halo mass and at fixed halo mass the observed cluster richness decreases with redshift. The latter is a selection effect due to increasing incompleteness at higher redshift. To check whether this incompleteness may be biasing our results we repeat our analysis on ``low-z'' ($z < 0.10$) and ``high-z'' ($z \ge 0.10$) subsamples (results not shown) and find no difference between the conclusions drawn from either redshift subsample. Therefore moving forward, we consider the entire redshift range. \subsection{X-ray matched clusters} \label{sec:X-ray_match} \begin{figure} \centering \includegraphics[width=\columnwidth]{offset_texp.pdf} \caption{Distribution of the offset between the X-ray peak and cluster luminosity-weighted centre (left) and X-ray exposure time (right) for the clusters in our sample, for \textit{Chandra} (gray) and \textit{XMM-Newton} (white).} \label{fig:offset_texp} \end{figure} In order to make connections between optical measures of cluster relaxedness and the shape of the cluster extended X-ray profile we searched the \textit{Chandra} and \textit{XMM-Newton} science archives at the positions of the luminosity-weighted centres of each of the 2559 $N > 10$ Yang clusters. Using a search radius of $5\arcmin$ we matched observations of extended X-ray emission to the corresponding optically identified cluster, only including observations with clean exposure times $\ge 10\,\mathrm{ks}$. We also exclude systems where multiple Yang (N > 10) clusters are matched to the same X-ray observation to avoid the potential overlap of X-ray emission from physically distinct systems in projection (this was only the case for $<5$ per cent of matches). This matching results in 58 Yang clusters with X-ray coverage. Fig.~\ref{fig:offset_texp}a shows the projected separation between the luminosity-weighted centre and the X-ray centre of each Yang cluster for \textit{Chandra} (gray) and \textit{XMM-Newton} (white), whereas Fig.~\ref{fig:offset_texp}b shows the respective filtered exposure times for the observations. X-ray centres are calculated as the position of the brightest pixel in the X-ray image after smoothing using a Gaussian kernel with a bandwidth of $40\,\mathrm{kpc}$ (as in \citealt{nurgaliev2013}). As shown in Fig.~\ref{fig:offset_texp}a, the offset between the optical and X-ray centres is far smaller than the virial radius for all systems. \par \textit{Chandra} observations were reprocessed, cleaned, and calibrated using the latest version of \textsc{ciao} (\textsc{ciao} version 4.9, \textsc{caldb} version 4.7.5). Charge transfer inefficiency and time-dependent gain corrections were applied and observations were filtered for background flares using the \textsc{lc\_clean} script with a $3\sigma$ threshold. Exposure corrected images are then created using exposure maps generated at an energy of $1.5\,\mathrm{keV}$, the average peak emission of our sample. Images were created in the $0.5-5\,\mathrm{keV}$ energy band to maximize the ratio between cluster and background flux \citep{nurgaliev2013}. Point sources are identified using the \textsc{wavdetect} script and are filled with local poisson noise using \textsc{dmfilth}, blank sky background images are generated for each observation using the \textsc{blanksky} and \textsc{blanksky\_image} scripts. All observations are then checked by eye to ensure that no obvious point sources were missed by the algorithm. For systems with multiple observations, combined images and exposure maps were generated with the \textsc{merge\_obs} script and blank sky background images were combined using \textsc{reproject\_image}. \par Data reduction for \textit{XMM-Newton} observations was done using the Extended Source Analysis Software (\textsc{esas}) within the \textit{XMM-Newton} Science Analysis System (\textsc{sas}, version 16.0.0). Calibrated event files were generated using the \textsc{emchain} script, and filtered event lists were generated using \textsc{mos-filter}. Exposure corrected images were created in the $0.5-5\,\mathrm{keV}$ band, and point sources were identified with the \textsc{cheese} script and subsequently filled with local poisson noise using the \textsc{ciao} script \textsc{dmfilth}. Again, images are checked by eye to ensure no obvious point sources are missed. For \textit{XMM-Newton} observations we only use the MOS exposures to avoid the complications of the many chip gaps on the PN detector. MOS exposures are combined using the \textsc{comb} script to give merged images, exposure maps, and background images. For systems with multiple observations, images, exposure maps, and background images are merged with the \textsc{ciao} script \textsc{reproject\_image}. \par The pixel scale of the resulting images is $0.5\arcsec$ for \textit{Chandra} and $2.5\arcsec$ for \textit{XMM-Newton}. We calculate X-ray asymmetries and centroid shifts at these native resolutions to avoid losing information from the higher resolution \textit{Chandra} images, however we note that binning the \textit{Chandra} images to the \textit{XMM-Newton} resolution does not alter the results. Furthermore, when we compare asymmetries and centroid shifts computed for systems which are observed by both \textit{Chandra} and \textit{XMM-Newton}, we see no bias introduced by the resolution difference. \section{Cluster relaxation measures} \label{sec:relax_param} \subsection{Optical} In this study we implement three previously used optical measures to parameterize the relaxation of clusters: the Anderson-Darling statistic, the stellar mass ratio between the second most-massive and the most-massive cluster galaxy ($M_2 / M_1$), and the offset between the position of the MMG and the luminosity-weighted centre of the cluster (MMG offset). \subsubsection{Anderson-Darling statistic} The Anderson-Darling (AD) test is a statistical normality test which measures the ``distance" between the cumulative distribution functions (CDFs) corresponding to the data as well as the ideal case of a normal distribution \citep{anderson1952}. The distance between the CDFs is parameterized by the AD statistic ($A^2$), in the sense that large values of this statistic correspond to larger deviations from normality. The AD statistic, $A^2$ is given by \begin{equation} A^2 = -n - \frac{1}{n} \sum_{i=1}^n [2i - 1][\ln \Phi(x_i) + \ln(1 - \Phi(x_{n+1-i}))], \end{equation} \noindent where $x_i$ are the length-$n$ ordered data and $\Phi(x_i)$ is the CDF of the hypothetical underlying distribution (Gaussian in this application). \par In the context of cluster evolution, it is expected that galaxies in evolved, dynamically old clusters should display projected velocity profiles which are well fit by a normal distribution; conversely more unrelaxed clusters will show larger deviations from normality \citep{yahil1977, bird1993, ribeiro2013a}. The AD test can therefore be applied to the velocity distributions of member galaxies to discriminate between relaxed and unrelaxed clusters \citep[e.g.][]{hou2009}. In this work we use the AD statistic as a proxy for cluster relaxedness, where increasing values of $A^2$ are indicative of progressively more unrelaxed clusters. It is also common in the literature to use the p-value associated with the AD statistic to define a dichotomy between Gaussian and non-Gaussian clusters \citep[e.g][]{hou2009, martinez2012, roberts2017}, which we consider in Section~\ref{sec:G_NG}. \subsubsection{Stellar mass gap} The second optical parameter we use to classify the relaxation of galaxy clusters is the stellar mass ratio between the second most-massive and most-massive galaxies in a given cluster. Since the MMG should sit near the centre of the cluster potential, it will progressively grow in stellar mass by dominating gas accretion within the cluster, and more importantly, by cannibalizing galaxies through minor mergers \citep[e.g.][]{delucia2007, ruszkowski2009,lin2013, mcdonald2016}. This MMG mass growth will therefore drive down $M_2/M_1$ in dynamically old clusters, whereas more unrelaxed systems will have had less time to establish a dominant MMG. \par The reliability of $M_2/M_1$ is contingent on correctly identifying both the MMG and $M_2$. A particular concern when using SDSS data is the potential for galaxies missing spectra due to fibre collisions; this has an increasing impact in the dense inner regions of groups and clusters where one would expect to find the MMG and $M_2$. In an attempt to mitigate the effects of fibre collisions we use sample III from the Yang group catalogue which corrects for fibre collisions by assigning fibre collision galaxies the redshift of the galaxy they ``collide'' with. While this procedure accounts for fibre collisions it also introduces potential impurities to the group catalogue (some fibre collision galaxies will have redshifts which are catastrophically different from the one they are assigned), we delay a more detailed discussion of these effects until Section~\ref{sec:mmg_discussion} though we urge the reader to keep these caveats in mind when interpretting results in Section~\ref{sec:xray_opt_corr}. \subsubsection{MMG offset} The final optical relaxation parameter we consider is the projected offset between the MMG and the luminosity-weighted cluster centre, $\delta R_{MMG}$. There is currently no consensus regarding the best observational definition of group centre, with the position of the MMG, the position of the X-ray peak, and the luminosity or mass-weighted centre all being popular choices \citep[e.g.][]{george2012}. For relaxed clusters it is expected that all of the aforementioned centre definitions will be relatively consistent with one another, however more unrelaxed clusters may show significant offsets between different cluster centre choices. In particular, many unrelaxed clusters host MMGs with large offsets from other cluster centre definitions \citep[e.g.][]{katayama2003, sanderson2009, carollo2013, khosroshahi2017}, therefore the offset between MMG position and luminosity-weighted centre can be a useful measure of cluster relaxation. \par As with the stellar mass gap, there are potential complications with regards to interpretting the MMG offset as a relaxation probe. For example, it is based on the assumption that in a relatively relaxed systems the MMG (or brightest galaxy) will be located at rest at the centre of the dark matter potential well -- the so-called central galaxy paradigm (CGP). However, some recent studies have called into question whether or not the CGP is valid in all systems \citep{vandenbosch2005, coziol2009, skibba2011, sehgal2013, lauer2014, hoshino2015}. Additionally, even in relaxed systems the MMG may oscillate about the centre of a cored dark-matter potential \citep[e.g.][]{harvey2017} further complicating the interpretation of the radial offset of the central galaxy. Yet again, we will defer a full discussion of these effects to Section~\ref{sec:mmg_discussion}. \subsection{X-ray} \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{opt_ann_var.pdf} \caption{``Optimal annuli" positions (constant cluster counts) for each cluster in the X-ray matched sample. For four annuli, this amounts to two fixed end points (black) and three inner boundaries with variable positions (teal circles, maroon squares, gray triangles). Dashed lines correspond to the median value for each annulus boundary (values of the boundaries are also printed at the top of the figure), which we take to be our final annuli positions when computing asymmetries. Hatched areas denote radial regions not included in the aymmetry calculation (see Section~\ref{sec:photon_asym}) and shaded regions show the $1\sigma$ scatter for each annuli position.} \label{fig:opt_ann} \end{figure*} To measure the degree of cluster relaxedness from X-ray observations we consider two relaxation proxies: the photon asymmetry ($A_\mathrm{phot}$) and the centroid shift ($w$). \subsubsection{Photon Asymmetry} \label{sec:photon_asym} Photon asymmetry is a novel technique to measure the asymmetry of X-ray profiles which is model-independent and robust across a wide range in X-ray counts and background level \citep{nurgaliev2013}. In this work we will give a brief discussion of the photon asymmetry computation, however for a complete description, including tests of robustness, we direct the reader to \citet{nurgaliev2013}. \par The photon asymmetry measures the degree to which the count profile of an X-ray observation is axisymmetric around the X-ray peak, or phrased alternatively, the degree to which the polar angles of X-ray counts are distributed uniformly over the range $0 \le \phi \le 2\pi$. This is accomplished quantitatively using Watson's U2 test which compares the polar angle CDF for observed counts to a uniform CDF corresponding to an idealized axisymmetric profile \citep{watson1961}. In a given radial annulus, the distance between the observed count distribution and a uniform distribution is given by \begin{equation} \hat{d}_{N,C} = \frac{N}{C^2} \left(U_N^2 - \frac{1}{12} \right), \end{equation} \noindent where $N$ is the total number of counts within the annulus, $C$ is the number of counts intrinsic to the cluster (ie.\ above the background) within the annulus, and $U_N^2$ is Watson's statistic. We follow \citet{nurgaliev2013} and compute Watson's statistic using the following relation (see \citealt{watson1961}) \begin{equation} U_N^2(\phi_0) = \frac{1}{12N} + \sum_{i=0}^{N-1} \left(\frac{2i + 1}{2N} - F(\phi_i) \right)^2 - N \left(\frac{1}{2} - \frac{1}{N} \sum_{i=0}^{N-1} F(\phi_i) \right)^2, \end{equation} \noindent where $\phi_i$ are the observed count polar angles, $\phi_0$ is the origin polar angle on the circle, and $F$ is the uniform CDF. To obtain the final value for $U_N^2$ we minimize the statistic over all origin angles on the circle \begin{equation} U_N^2 = \min_{\mathrm{origin\;on\;circle},\, \phi_0} U_N^2(\phi_0). \end{equation} \noindent The final value for the photon asymmetry, $A_\mathrm{phot}$, is given by the cluster count weighted average of $\hat{d}_{N,C}$ in each radial annulus, namely \begin{equation} A_\mathrm{phot} = 100 \left. \sum_{k=1}^{N_\mathrm{ann}} C_k \hat{d}_{N_k,C_k} \middle/ \sum_{k=1}^{N_\mathrm{ann}} C_k \right.. \end{equation} We assume a uniform background which we estimate from blank-sky images for each observation and subsequently compute the number of cluster counts, $C$, by subtracting the expected number of background counts within the annulus from the total number of observed counts. Following \citet{nurgaliev2013} we compute $\hat{d}_{N,C}$ in four radial annuli, which in this work range between $0.05\,\mathrm{R_{500}}$ and $0.5\,\mathrm{R_{500}}$. This choice of four annuli ensures that we will obtain at least hundreds of cluster counts in each annulus for the low-count observations ($\sim$ a few thousand counts). Optimal annuli are selected by requiring an approximately constant number of cluster counts within each annulus. We define the annuli radii as those which minimize the variance in cluster counts across each of the annuli. In Fig.~\ref{fig:opt_ann} we show the optimal annuli positions for each of the 58 clusters in the X-ray matched sample. We note that while there is some variation in optimal annuli from cluster to cluster, in general the scatter is relatively small and there is no overlap between the $1\sigma$ scatter of neighbouring annuli. The final annuli edges are taken to be the median values across all of the clusters, which corresponds to $\{0.05, 0.13, 0.23, 0.34, 0.50\}\times \mathrm{R_{500}}$. The inner boundary of $0.05\,\mathrm{R_{500}}$ is set to aviod pixelation artifacts at small radii \citep{nurgaliev2013}, and the outer boundary of $0.5\,\mathrm{R_{500}}$ is chosen to enclose the majority of the emission while still ensuring chip coverage. The large angular sizes of some of the high-mass, low-redshift systems ($R_{500} \sim 15 - 20 \arcmin$) prevents us from computing $A_\mathrm{phot}$ out to a full $\mathrm{R_{500}}$ since they extend beyond the edge of the detector. \par Statistical uncertainties on $A_\mathrm{phot}$ are estimated following \citet{nurgaliev2013} by randomly resampling half of the observed counts 500 times and recalculating $A_\mathrm{phot}$ for each iteration. For clusters with both \textit{Chandra} and \textit{XMM-Newton} observations, we compute $A_\mathrm{phot}$ for the \textit{Chandra} and \textit{XMM} data separately and then combine them as a count-weighted average. \subsubsection{Centroid shift} \label{sec:centroid_shift} A commonly used X-ray relaxation proxy is the centroid shift, $w$, which measures the shift of the X-ray surface brightness centroid in different radial apertures. For a system in dynamical equilibrium, the centre of mass of the ICM (ie.\ the centroid) should be independent of scale, whereas an unrelaxed system with substructure can have a centre of mass which depends on radius \citep[e.g.][]{mohr1993}. To compute centroid shifts we use the following relation \citep[e.g.][]{boehringer2010} \begin{equation} w = \left[\frac{1}{N - 1}\sum_i (\Delta_i - \langle \Delta \rangle)^2 \right]^{1/2} \times \frac{1}{R_\mathrm{max}}, \end{equation} \noindent where $\Delta_i$ is the offset between the X-ray peak and the centroid position within the $i$th aperture, $N$ is the number of apertures, and $R_\mathrm{max}$ is the radius of the largest aperture. Centroids are determined from the moments of the exposure-corrected X-ray images\footnote{http://photutils.readthedocs.io/en/stable/photutils/centroids.html}, and the X-ray peak is considered to be the position of the brightest pixel after smoothing using a Gaussian kernel with a bandwidth of $40\,\mathrm{kpc}$. The smallest aperture that we consider is $R < 0.1\,\mathrm{R_{500}}$ and we progressively increase the aperture radius by $0.05\,\mathrm{R_{500}}$ out to a maximum of $0.5\,\mathrm{R_{500}}$, for a total of 9 apertures. These aperture choices are motivated by previous studies \citep{boehringer2010, nurgaliev2013, rasia2013, weissmann2013} as well as ensuring chip coverage as was done to measure $A_\mathrm{phot}$ in Section~\ref{sec:photon_asym}. \par As with $A_\mathrm{phot}$, uncertainties for the centroid shift are determined from randomly resampling the X-ray images and recalculating $w$, and for clusters with observations from \textit{Chandra} and \textit{XMM-Newton} $w$ is computed as a count-weighted average. \section{Results} \label{sec:results} \subsection{Relationship between X-ray and optical relaxation proxies} \label{sec:xray_opt_corr} To explore the consistency between group relaxation measures in the X-ray and optical, we measure the correlations between photon asymmetry and centroid shifts and the three optical relaxation parameters ($A^2$, $M_2/M_1$, $\delta R_{MMG}$). To quantify the correlations between these parameters, we use two different methods: \begin{enumerate} \item We fit a simple power-law to each relationship and derive uncertainties on the slope and normalization with bootstrap resampling. \item We compute Spearman's rank correlation coefficient, $r_s$, (which is preferred over the Pearson correlation due to its non-parametric nature) for each relationship to quantify the percentile at which the data are consistent with a correlation. \end{enumerate} \subsubsection{Photon Asymmetry} \label{sec:Aphot_corr} \begin{figure*} \centering \includegraphics[width=\textwidth]{asymCX_ad_m12_offset-wfit.pdf} \caption{Photon asymmetry versus optical relaxation parameters ($A^2$, $M_2/M_1$, $\delta R_{MMG}$), error bars are $1\sigma$ resampling uncertainties. The solid line is the best-fit power-law relationship and the shaded regions correspond to the 68 and 95 per cent bootstrap confidence intervals. The Spearman correlation coefficient, $r_S$, and the best-fit power-law slope, $\alpha$, are indicated in the upper region of each panel.} \label{fig:asym_ad_m12_offset} \end{figure*} In Figs~\ref{fig:asym_ad_m12_offset}a-c we show the relationship between photon asymmetry and the three optical relaxation proxies. The $A_\mathrm{phot} - A^2$ relationship shows a significant correlation as measured by both the power-law fit and by the Spearman test. The best-fit power law has a positive slope at $3.5\sigma$ and the Spearman test gives a positive correlation at the $>99.9$ per cent level. The $A_\mathrm{phot} - M_2 / M_1$ relationship shows a weaker (but still significant) correlation with a positive slope at $2.9\sigma$ and a Spearman correlation at the $96$ per cent level. In contrast, the $A_\mathrm{phot} - \delta R_{MMG}$ relationship does not display a significant correlation by either measure, with a power law slope consistent with zero and a Spearman p-value of 0.23. \subsubsection{Centroid shift} \label{sec:w_corr} \begin{figure*} \centering \includegraphics[width=\textwidth]{centshiftCX_ad_m12_offset.pdf} \caption{Same as Fig.~\ref{fig:asym_ad_m12_offset} however for the centroid shift instead of photon asymmetry.} \label{fig:centshift} \end{figure*} In Figs~\ref{fig:centshift}a-c we now show the relationship between the optical relaxation parameters and the centroid shift as the X-ray relaxation proxy. The results in Fig.~\ref{fig:centshift} are very similar to those in Fig.~\ref{fig:asym_ad_m12_offset}, with the optical relaxation proxies tracing the centroid shift analagously to photon asymmetry. The $w - A^2$ relationship has a best-fit positive slope at $2.8\sigma$ and the Spearman test gives a positive correlation at the 99.9 per cent level. The $w - M_2/M_1$ again shows a significant correlation as well with a positive slope at $3.6\sigma$ and a positive Spearman correlation at the 97 per cent level. Finally, we find no evidence for a correlation between the centroid shift and the MMG offset, with a power-law slope consistent with zero and a Spearman p-value of 0.62 . \par Based on the results from this section we conclude that Anderson-Darling statistic provides the best correlation with X-ray asymmetry among the three optical relaxation measures, as it shows the strongest Spearman correlations with the X-ray relaxation proxies, and the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships have positive power-law slopes at $\gtrsim 3\sigma$. Modulo scatter, this correlation lends credence to the use of the Anderson-Darling test to quantify cluster relaxation for a large sample, as the shape of the diffuse X-ray profile is an independent (and arguably more direct) probe of the degree to which groups are unrelaxed/disturbed. Therefore, for the remainder of this paper we will focus on the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships. In the next section, we extend this analysis by investgating the halo mass dependence of the $A_\mathrm{phot} - A^2$ and $w - A^2$ relations. \subsection{Halo mass dependence of X-ray-optical relations} \label{sec:halo_mass} In Section~\ref{sec:xray_opt_corr} we presented a significant correlation between the AD statistic for a given cluster and X-ray relaxation parameters (the photon asymmetry and the centroid shift). In this section we further divide the sample into systems with small halo masses and those with large halo masses to investigate if the $A_\mathrm{phot} - A^2$ and $w - A^2$ correlations vary with cluster halo mass. We choose the median halo mass of our cluster sample, $M_{\mathrm{halo},\,\mathrm{med}} = 10^{14.5}\,\mathrm{M_{\sun}}$, to make this division. \subsubsection{Photon Asymmetry} \label{sec:mh_aphot} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{asymCX_ad_mhMed.pdf} \caption{68 and 95 per cent confidence ellipses for the photon asymmetry vs. AD statistic best-fit power law parameters for low-mass halos ($M_\mathrm{halo} < 10^{14.5}\,\mathrm{M_{\sun}}$, dot-dashed), high-mass halos ($M_\mathrm{halo} > 10^{14.5}\,\mathrm{M_{\sun}}$, dashed), and the total sample (solid). Spearman correlation coefficients are denoted for each sample.} \label{fig:asym_mh} \end{figure} In Fig.~\ref{fig:asym_mh} we show the confidence ellipses (68 and 95 per cent levels) corresponding to the power-law fit results to the $A_\mathrm{phot} - A^2$ relationship for high-mass and low-mass halos (as well as the total sample). The separation between the high- and low-mass ellipses suggests that high- and low-mass clusters follow somewhat different scaling relations between $A_\mathrm{phot}$ and $A^2$. For high-mass halos a significant correlation is still seen, with a best-fit slope of $1.15_{-0.39}^{+0.42}$ and a Spearman correlation significant at the 99.4 per cent level. For low-mass halos the correlation is somewhat weaker with a best-fit power law slope of $0.61_{-0.33}^{+0.44}$ and a Spearman correlation significant at the 94 per cent level. The best-fit slopes for the low- and high-mass halos are equal within uncertainties, however the normalization is larger for high-mass halos at the $> 2\sigma$ level. Additionally, we find that high-mass halos have a slightly larger median $A_\mathrm{phot}$ ($0.08 \pm 0.03$ ) than low-mass halos ($0.04 \pm 0.01$ ). \subsubsection{Centroid shift} \label{sec:mh_cs} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{centshiftCX_ad_mhMed.pdf} \caption{Same as Fig.~\ref{fig:asym_mh} however for the centroid shift instead of photon asymmetry.} \label{fig:cs_mh} \end{figure} In Fig.~\ref{fig:cs_mh} we now show the power-law fit results to the $w - A^2$ relationship for the two halo mass subsamples. We find qualitatively similar results when considering centroid shift instead of photon asymmetry, with the high-mass halos displaying a clear correlation (slope: $0.86_{-0.24}^{+0.27}$ , Spearman p-value: 0.005 ) whereas the correlation for low-mass halos is marginal and not statistically significant (slope: $0.24_{-0.30}^{+0.35}$, Spearman p-value: 0.19 ). We also find that the median centroid shift is larger for high-mass halos ($0.015 \pm 0.002$ ) than low-mass halos ($0.007 \pm 0.001$). \subsection{The discrete case: X-ray asymmetry of Gaussian and non-Gaussian groups} \label{sec:G_NG} Thus far we have treated the shape of the velocity distribution in a continuous fashion with the AD statistic, though it is commonplace in the literature to define a dichotomy between ``Gaussian'' and ``non-Gaussian'' clusters \citep{hou2009, ribeiro2013a, roberts2017, decarvalho2017}. We use the AD test and choose a critical p-value of 0.10 to define G and NG groups -- where G groups have $p_{AD} \ge 0.10$ and NG groups have $p_{AD} < 0.10$ (though our results are not sensitive to the precise p-value chosen over a reasonable range). \par To quantify the relationship between photon asymmetry and whether a cluster is classified as G or NG we employ the method of logistic regression \citep[e.g.][]{cox1958}. Logistic regression is a classification tool used to estimate the probability of a binary response as a function of one (or many) independent variables, which may be numeric or categorical. For this application, a galaxy cluster is classified as either G or NG (the boolean, dependent variable) and we are interested in the probability of a galaxy cluster being NG as a function of photon asymmetry or centroid shift (the numeric, independent variable). The estimated probability is then \begin{equation} \label{eq:log_curve} \hat{p} = \frac{e^{\beta_1 x + \beta_0}}{1 + e^{\beta_1 x + \beta_0}}, \end{equation} \noindent where $\beta_0$ and $\beta_1$ are parameters of the fit, and for this work we have $\hat{p} = \hat{p}(\mathrm{NG})$ and $x = \log A_\mathrm{phot}\;\mathrm{or}\; \log w$. \subsubsection{Photon asymmetry} \label{sec:G_NG_aphot} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{log_reg.pdf} \caption{Estimated probability of a cluster being non-Gaussian as a function of photon asymmetry. Photon asymmetry data points are shown for Gaussian (0, green) and non-Gaussian (1, purple) clusters and the black line shows the best-fit logistic curve. Shaded vertical lines show the median asymmetry and $1\sigma$ standard error for Gaussian and non-Gaussian groups.} \label{fig:log_reg} \end{figure} In Fig.~\ref{fig:log_reg} we show the photon asymmetry for G (0, green) and NG (1, purple) clusters along with the best-fitting logistic curve (black line, equation~\ref{eq:log_curve}) describing the probability of being classified as NG as a function of $A_\mathrm{phot}$. It is clear from Fig.~\ref{fig:log_reg} that the probability of a cluster being NG increases with photon asymmetry, we obtain a best-fit coefficient of $\beta_1 = 2.1 \pm 0.8$ indicating a significant correlation at $2.6\sigma$. According to our logistic model, the $A_\mathrm{phot}$ value where the probability of being a NG cluster reaches 50 per cent is $A_\mathrm{phot} = 0.14$ and the asymmetry where the probability reaches 75 per cent is $A_\mathrm{phot} = 0.46$. Additionally in Fig.~\ref{fig:log_reg} we show the median photon asymmetry and the $1\sigma$ standard error for G and NG clusters, NG clusters have a larger median asymmetry of $0.13 \pm 0.03$ compared to $0.05 \pm 0.02$ for G clusters. \subsubsection{Centroid shift} \label{sec:G_NG_cs} \begin{figure} \centering \includegraphics[width=0.9\columnwidth]{log_reg_w.pdf} \caption{Same as Fig.~\ref{fig:log_reg} however for the centroid shift instead of photon asymmetry.} \label{fig:log_reg_w} \end{figure} In Fig.~\ref{fig:log_reg_w} we show an analagous logistic regression to Fig.~\ref{fig:log_reg}, with the centroid shift as the numeric variable. Examining Fig.~\ref{fig:log_reg_w} it is clear that the distinction between G and NG clusters is not as strong as it was with photon asymmetry. From the fit we obtain a best-fit coefficient of $\beta_1 = 1.2 \pm 0.8$, indicating only a marginal correlation at $1.5\sigma$. From this fit the value of $w$ where $\hat{p}(\mathrm{NG})$ reaches 50 per cent is $w = 0.04$. We also show the median value for $w$ for G (green) and NG (purple) clusters, and find that while the median centroid shift is slightly larger for NG clusters, this difference is not significant (G: $0.009 \pm 0.001$, NG: $0.012 \pm 0.003$). \section{Discussion} \label{sec:discussion} \subsection{The Anderson-Darling test as a relaxation proxy} The primary result from this paper is the strong correlation detected between X-ray relaxation measures and both the AD statistic for a given cluster (Fig.~\ref{fig:asym_ad_m12_offset}a and Fig.~\ref{fig:centshift}a), as well as the probability of a system being NG when considering the dichotomy of G and NG clusters (at least for $A_\mathrm{phot}$, Fig.~\ref{fig:log_reg}). We argue that this is an important confirmation of the usefulness of the AD test to quantitatively identify unrelaxed/disturbed systems. This, however, is only true in the statistical sense as there is still significant scatter around the $A_\mathrm{phot} - A^2$ and $w - A^2$ relations. The AD test may or may not accurately classify the dynamical state of an individual cluster, but applied to a large statistical sample it is a useful tool to identify systems which are on average relaxed or unrelaxed. It is also worth considering whether the group finder preferentially selects G or NG clusters. The \citeauthor{yang2005} group finder constructs clusters assuming that the galaxy phase-space distribution follows a spherical NFW profile, which could bias the group finder in favour of G clusters (ie.\ assuming a spherical, symmetric distribution). The analysis presented here does not account for any such bias, but since the clusters are all selected with the same algorithm the correlations found are robust for this sample. \par The AD test has become a relatively common tool used to identify unrelaxed systems from large redshift surveys \citep[e.g.][]{hou2009, ribeiro2010, martinez2012, hou2013, ribeiro2013a, roberts2017}, though its efficacy has only been tested in detail using Monte Carlo simulations sampling from idealized parent distributions (both Gaussian and non-Gaussian, \citealt{hou2009, ribeiro2013a}). These tests have provided useful insight into the strengths and limitations of the AD test, but it is also important to test this technique in a more physical setting. The comparision to diffuse X-ray morphology in this work provides one such test in an astronomical context. In an upcoming paper we perform a detailed analysis on the AD test applied to groups and clusters in large, cosmological, N-body simulations. This will allow us to explore things such as the false-positive rate, as well as potential differences in satellite time-since-infall or halo age for G and NG systems in a cosmological context. \par The results of Section~\ref{sec:G_NG} can also be used to constrain the dividing line between relaxed and unrelaxed clusters. Based on the logistic regression model, the value of $A_\mathrm{phot}$ above which the probability of being a NG cluster exceeds 50 per cent is $A_\mathrm{phot} = 0.14$ and the value above which the probability exceeds 75 per cent is $A_\mathrm{phot} = 0.46$. Correspondingly, the median $A_\mathrm{phot}$ for NG clusters of $0.13 \pm 0.03$, suggesting that $A_\mathrm{phot} \gtrsim 0.10 - 0.50$ may be a useful dividing line between relaxed and unrelaxed clusters, depending on the desired level of purity. In \citet{mcdonald2017} a threshold of $A_\mathrm{phot} < 0.10$ is chosen to identify relaxed clusters, while this threshold was chosen arbitrarily we've shown here that this is a reasonable choice based on cluster velocity distribution measurements. The threshold used to identify unrelaxed clusters in \citet{mcdonald2017} is $A_\mathrm{phot} > 0.50$, which also shows excellent agreement with the dividing lines that we derive from velocity measurements. The choice of $A_\mathrm{phot} > 0.50$ is motivated by simulations of cluster major mergers from \citet{nurgaliev2017} who suggest that $A_\mathrm{phot} \gtrsim 0.2 - 0.6$ is a useful threshold to identify disturbed clusters, again corresponding very closely to the range we determine in this work. This shows that using the AD test (in this case with a p-value of 0.10) to identify relaxed and unrelaxed clusters corresponds very closely to previous results using X-ray techniques. \par When using the centroid shift, $w$, instead of photon asymmetry, the logistic regression model does not seperate G and NG clusters as distinctly, however we can still use the model to constrain a dividing line. In particular, the regression model suggests that the probability of being a NG cluster reaches 50 per cent at $w = 0.040$. This is larger by a factor of a few than the boundary between regular and disturbed objects in previous X-ray analyses, which ranges between $w \simeq 0.01$ and $w \simeq 0.02$ \citep{ohara2006, cassano2010, weissmann2013}. Given that the logistic regression only detects a marginal correlation between $\hat{p}(\mathrm{NG})$ and $w$, the dividing line that we derive here is likely not be well constrained. \par We can also contrast the two different X-ray relaxation proxies by highlighting any differences in the photon asymmetry and centroid shift relationships with the AD statistic. When considering the continuous case in Section~\ref{sec:xray_opt_corr} we see very similar behaviour in the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships, consistent with the fact that photon asymmetry and centroid shift have been shown to correlate strongly \citep{nurgaliev2013}. However the discrete case in Section~\ref{sec:G_NG} shows that G and NG clusters are more clearly segregated in terms of photon asymmetry than centroid shift, perhaps suggesting that photon asymmetry is a slightly stronger identifier of dynamically unrelaxed clusters, though a larger sample is required to robustly determine this. \par Finally, in Section~\ref{sec:halo_mass} we explored the halo mass dependence of the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships by separating the sample into subsamples of low-mass ($M_\mathrm{halo} < 10^{14.5}\,\mathrm{M_{\sun}}$) and high-mass clusters ($M_\mathrm{halo} \ge 10^{14.5}\,\mathrm{M_{\sun}}$). We find small differences between the low-mass and high-mass relations, namely, both the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships for high-mass clusters have larger normalizations, whereas the slopes are consistent between the high- and low-mass samples. In addition, the median values for $A_\mathrm{phot}$ and $w$ are slightly larger for high-mass clusters compared to low-mass clusters. \citet{nurgaliev2013} show that the $A_\mathrm{phot}$ and $w$ statistics are robust against varying numbers of X-ray counts above $\sim 2000$ counts ($A_\mathrm{phot}$ is robust even below 2000 counts). All of the systems in this work have $N_\mathrm{counts} > 2000$, therefore it is unlikely that these differences in asymmetry and centroid shift are being driven by the relatively high-count observations of massive systems. This result hints that low-mass and high-mass clusters may follow slightly different scaling relations when it comes to $A_\mathrm{phot}$ or $w$ versus $A^2$, though a larger sample is necessary to build up the statistics required to conclude this with high confidence. In principle, this difference could be explained through simple hierarchical growth where low-mass halos are on average more virialized than higher-mass clusters at the present day. High-mass clusters will be more recently formed through mergers and accretion which can in turn increase $A_\mathrm{phot}$ and $w$ \citep[e.g.][]{cassano2010, nurgaliev2017}. From the optical perspective, we also find that high-mass clusters have velocity distributions which are less Gaussian than low-mass systems, in agreement with previous studies \citep{roberts2017, decarvalho2017}. Although it is important to note that it is easier to statistically identify departures from normality for high-mass systems with many members. \subsection{Interpreting MMG-based relaxation parameters} \label{sec:mmg_discussion} The second optical relaxation proxy that shows a significant correlation with X-ray relaxation proxies is the stellar mass gap between the two most-massive cluster galaxies (see Section~\ref{sec:Aphot_corr} and Section~\ref{sec:w_corr}). The correlations between X-ray relaxation proxies and $M_2 / M_1$ are found to be weaker than for $A^2$ (especially as measured by the Spearman correlation), potentially suggesting that $M_2 / M_1$ is a poorer (though still useful) tracer of diffuse X-ray morphology. This may be expected given that satellite galaxies (i.e.\ the velocity distribution) and the diffuse hot gas profile should both trace the larger-scale cluster potential relatively directly, whereas central galaxy growth is governed more by dynamical interactions and gas accretion at the cluster centre. It is also possible that the $A_\mathrm{phot} - M_2 / M_1$ and $w - M_2 / M_1$ trends are being affected by selection effects related to the difficulty indentifying the true MMG (and second most massive galaxy) in these clusters. A particular concern regarding the SDSS is the impact of fibre collisions in the dense inner regions of clusters, as it has been estimated that up to 30 per cent of clusters may be missing a spectra for the true BCG \citep{vonderlinden2007}. In an attempt to mitigate the effect of fibre collisions we use the systems from sample III in the Yang group catalogue which attaches redshifts to galaxies that lack spectra due to fibre collisions by assigning these galaxies the redshift of the galaxy it ``collided'' with. While this procedure allows the group finder to include galaxies which otherwise would be missed due to fibre collisions, the trade-off is uncertainty regarding whether the added galaxies are true group members. $\sim 60$ per cent of fibre collision galaxies have redshifts within $500\,\mathrm{km}\,\mathrm{s^{-1}}$ of the estimated value \citep{zehavi2002}, though this still leaves a significant number of fibre collision galaxies which may have true redshifts that differ substantially from the assigned value. To ensure that our results are not being affected by the inclusion of these fibre collision galaxies we re-test the $A_\mathrm{phot} - M_2 / M_1$, $w - M_2 / M_1$ and $A_\mathrm{phot} - \delta R_{MMG}$, $w - \delta R_{MMG}$ relationships for correlations, now removing any systems where the MMG (and in the case of $M_2 / M_1$, the second-most-massive galaxy as well) is a fibre collision galaxy. 26 per cent of the clusters in the sample have an MMG which is a fibre collision galaxy and 39 per cent of the sample have either the MMG or the second-most-massive galaxy as a fibre collision galaxy. Re-testing these relationships for correlations leaves the Spearman correlation coefficient virtually unchanged from Sections~\ref{sec:Aphot_corr} and \ref{sec:w_corr}, suggesting that fibre collision galaxies are not biasing the results. \par In Section~\ref{sec:Aphot_corr} we find no evidence for a correlation between $A_\mathrm{phot}$ or $w$ and $\delta R_{MMG}$, which suggests that the MMG offset is not a reliable tracer of cluster relaxation. One caveat which is important to consider is the assumptions made to justify the use of $M_2 / M_1$ and $\delta R_{MMG}$ as relaxation proxies, in particular that for relaxed systems the MMG (or brightest galaxy) resides at rest at the centre of the dark matter potential -- the so-called central galaxy paradigm (CGP). For example, if the MMG is instead a satellite galaxy then the use of $M_2 / M_1$ as a relaxation measure may not be valid as it is predicated on the MMG being the central and growing through accretion and mergers at the centre of the potential well. Similarly, if the MMG is a satellite then its offset from the luminosity-weighted centre would not be expected to trace cluster relaxation. Many recent studies have called into question the ubiquity of the CGP by highlighting the fact that a substantial fraction of brightest cluster galaxies (BCGs) are significantly offset from the cluster centroid, both in terms of projected distance and velocity \citep{vandenbosch2005, coziol2009, skibba2011, sehgal2013, lauer2014, hoshino2015}. In particular, \citet{skibba2011} find that the fraction of halos where the brightest galaxy is in fact a satellite ($f_\mathrm{BNC}$) ranges from $\sim 25$ per cent in low-mass halos ($10^{12}\,h^{-1} \le M \lesssim 2 \times 10^{13}\,h^{-1}\,\mathrm{M_{\sun}}$) to $\sim 40$ per cent in high-mass halos ($M \gtrsim 5 \times 10^{13}\,h^{-1}\,\mathrm{M_{\sun}}$). Furthermore, \citet{hoshino2015} find $f_\mathrm{BNC} \sim 20 - 30$ per cent for galaxies in redMaPPer clusters, and in terms of velocity \citet{coziol2009} show that the median peculiar velocity for BCGs in a sample of Abell clusters is $\sim$ one third of the cluster velocity dispersion. It is plausible that systems where the CGP is not valid are diluting stronger trends between $A_\mathrm{phot}$ or $w$ and $M_2/M_1$, or perhaps masking trends between $A_\mathrm{phot}$ or $w$ and $\delta R_{MMG}$. Unfortunately, identifying systems where the CGP is violated is difficult on a case-by-case basis, limited by observing in projection, and is generally done in the statistical sense for large samples (ie.\ thousands) of groups and clusters \citep[e.g.][]{vandenbosch2005, skibba2011}. Therefore we continue to argue that the AD test (or some other measure of the velocity distribution shape, see e.g. \citealt{ribeiro2013a}) is a better optical relaxation proxy as it is not complicated by CGP assumptions. \section{Summary} \label{sec:summary} In this paper we present a comparison between diffuse X-ray morphology and cluster relaxation proxies based on optical measures. Using the \citet{yang2007} SDSS group catalogue we match optically identified clusters with $N \ge 10$ members to X-ray observations from both the \textit{Chandra} and \textit{XMM-Newton} X-ray observatories. With a sample of 58 X-ray matched clusters we compare X-ray asymmetry and centroid shift to three different optical relaxation probes: the Anderson-Darling statistic, the stellar mass gap, and the MMG offset. The main conclusions of this work are as follows: \begin{enumerate} \item We detect a significant positive correlation between X-ray relaxation proxies (photon asymmetry, centroid shift) and Anderson-Darling statistic at $\sim 3-4\sigma$ as measured by both a power-law fit and by the Spearman correlation test, and a weaker correlation ($\sim 2-3 \sigma$) between X-ray relaxation proxies and stellar mass gap (between two most-massive cluster galaxies). \item We do not detect a significant correlation between X-ray asymmetry or centroid shift and the MMG offset. \item We find that the $A_\mathrm{phot} - A^2$ and $w - A^2$ relationships vary somewhat for low-mass ($M_\mathrm{halo} < 10^{14.5}\,\mathrm{M_{\sun}}$) and high-mass ($M_\mathrm{halo} \ge 10^{14.5}\,\mathrm{M_{\sun}}$) clusters. Specifically, high-mass clusters have a best-fit relationship with a larger normalization, and the median asymmetry and centroid shift is larger in high-mass systems. However, a definitive measure of the halo mass dependence awaits a larger sample. \item When considering a dichotomy between Gaussian ($p_{AD} \ge 0.10$) and non-Gaussian ($p_{AD} < 0.10$) clusters we find that the probability of being a non-Gaussian system (as measured by a logistic regression) correlates clearly with X-ray asymmetry. Additionally, the median asymmetry of non-Gaussian clusters is larger than that of Gaussian clusters. When using the centroid shift as the X-ray relaxation proxy the correlation is marginal. \end{enumerate} \noindent Though the scatter in the above mentioned relations limit the reliability of this approach on a case-by-case basis, these results confirm the effectiveness of the shape of the projected velocity distribution as a proxy for cluster relaxation, when applied to a large sample. \section*{Acknowledgments} \label{sec:acknowledgments} We thank the Natural Sciences and Engineering Research Council of Canada for funding. This work made use of many open-source software packages, such as: \textsc{AstroPy} \citep{astropy2013}, \textsc{Matplotlib} \citep{hunter2007}, \textsc{NumPy} \citep{vanderwalt2011}, \textsc{Pandas} \citep{mckinney2010}, \textsc{Photutils} \citep{bradley2016}, \textsc{SciPy} \citep{jones2001}, \textsc{Statsmodels} \citep{seabold2010}, and \textsc{Topcat} \citep{taylor2005}. \par Funding for the Sloan Digital Sky Survey IV has been provided by the Alfred P. Sloan Foundation, the U.S. Department of Energy Office of Science, and the Participating Institutions. SDSS-IV acknowledges support and resources from the Center for High-Performance Computing at the University of Utah. The SDSS web site is www.sdss.org. \par SDSS-IV is managed by the Astrophysical Research Consortium for the Participating Institutions of the SDSS Collaboration including the Brazilian Participation Group, the Carnegie Institution for Science, Carnegie Mellon University, the Chilean Participation Group, the French Participation Group, Harvard-Smithsonian Center for Astrophysics, Instituto de Astrof\'isica de Canarias, The Johns Hopkins University, Kavli Institute for the Physics and Mathematics of the Universe (IPMU) / University of Tokyo, Lawrence Berkeley National Laboratory, Leibniz Institut f\"ur Astrophysik Potsdam (AIP), Max-Planck-Institut f\"ur Astronomie (MPIA Heidelberg), Max-Planck-Institut f\"ur Astrophysik (MPA Garching), Max-Planck-Institut f\"ur Extraterrestrische Physik (MPE), National Astronomical Observatories of China, New Mexico State University, New York University, University of Notre Dame, Observat\'ario Nacional / MCTI, The Ohio State University, Pennsylvania State University, Shanghai Astronomical Observatory, United Kingdom Participation Group, Universidad Nacional Aut\'onoma de M\'exico, University of Arizona, University of Colorado Boulder, University of Oxford, University of Portsmouth, University of Utah, University of Virginia, University of Washington, University of Wisconsin, Vanderbilt University, and Yale University. \bibliographystyle{mnras}
\section{Introduction}\label{sec:introduction} Latent variable models, like factor analysis and ``deeper'' versions such as the variational autoencoder (VAE, \citealt*{kingma-welling-14,rezende-mohamed-wierstra-14}) and generative adversarial networks (GANs, \citealt*{goodfellow-etal-14}), are a compelling approach to modelling structure in complex high-dimensional data such as images. One important use case of such models is when some part of the observable data is missing---such as when some part of an image is not observed. In this case we would like to use the latent variable model to ``inpaint'' the missing data. Another example is modelling 3-D volumetric data---we may have observations of an object from one viewpoint, and wish to make inferences about the whole 3-D object. The VAE is composed of two parts, an \emph{encoder} (or recognition) network that predicts the distribution of the latent variables given the data, and a \emph{decoder} (or generative) model that maps from the latent variables to the visible variables. However, if some part of the visible data is missing, how can we make use of the encoder network---what can be done about the missing entries? One simple fix is to replace the missing value with a constant such as zero (see e.g.\ \citealt*{pathak-krahenbuhl-donahue-darrell-16}, \citealt*{nazabal-olmos-ghahramani-valera18}) or ``mean imputation'', i.e.\ filling in the missing value with the unconditional mean of that variable. However, these are not principled solutions, and do not maintain uncertainty about the missing values. \citet{rezende-mohamed-wierstra-14} have shown that one can construct a Markov chain Monte Carlo (MCMC) method to sample from the posterior over the missing data for a VAE, but this is an iterative technique that has the obvious disadvantage of taking a long time (and much computation) for the chain to converge. This paper is concerned with inference for the latent variables given a particular pre-trained generative model. The issue of learning a model in the presence of missing data is a different issue; for PCA a survey of methods is given e.g.\ in \cite{dray-josse-15}. The non-linear encoder and decoder networks of the VAE make an exact analysis of missing-data inference techniques challenging. As such we focus on the factor analysis (FA) model as an example autoencoder (with linear encoder and decoder networks) for which analytic inference techniques can be derived. In this paper we show that for the FA model one can carry out exact (non-iterative) inference for the latent variables in a single feedforward pass. However, the parameters of the required linear feedforward model depend non-trivially on the missingness pattern of the data, requiring a different matrix inversion for each pattern. Below we consider three approximations to exact inference, including a ``denoising encoder'' approach to the problem, inspired by the denoising autoencoder of \cite{vincent-etal-08}. Experiments compare the effectiveness of various approaches to filling in the missing data. \section{Theory} We focus on generative models which have latent variables associated with each datapoint. We assume that such a model has been trained on fully visible data, and that the task is to perform inference of the latent variables in the presence of missing data, and reconstruction of the missing input data. Consider a generative latent-variable model that consists of a prior distribution $p(\vec{z})$ over latent variables $\vec{z}$ of dimension $K$, and a conditional distribution over data variables given latents $p(\vec{x} | \vec{z})$. When there is missing data, the data variables $\vec{x}$ can be separated into the visible variables $\vec{x}_v$ and missing variables $\vec{x}_m$. $\vec{m}$ is a missing-data indicator function such that $m_j = 1$ if $x_j$ has been observed, and $m_j = 0$ if $x_j$ is missing. Let $\vec{x}$ have dimension $D$, with $D_v$ visible and $D_m$ missing variables. Given a datapoint $ [\vec{x}_v, \vec{m}]$ we would like to be able to obtain a latent posterior conditioned on the visible variables $p(\vec{z} | \vec{x}_v, \vec{m})$. We assume below that the missing data is \emph{missing at random} (MAR, see \citealt*{little-rubin-87} for further details), i.e.\ that the missingness mechanism does not depend on $\vec{z}$. One can carry out exact inference for linear subspace models such as factor analysis and its special case probabilistic principal components analysis (PPCA, \citealt*{tipping-bishop-99}). Let $p(\vec{z}) \sim N(0,I_K)$ and $p(\vec{x}|\vec{z}) \sim N(W \vec{z} + \bm{\mu}, \Psi)$ where $W$ is the $D \times K$ factor loadings matrix, $\bm{\mu}$ is the mean (offset) vector in the data space, and $\Psi$ is a $D$-dimensional diagonal covariance matrix. In these models the general form of the posterior is $p(\vec{z} | \vec{x}_v, \vec{m}) = \mathcal{N}(\vec{z} | \bm{\mu}_{\vec{z} | \vec{x}_v}, {\Sigma}_{\vec{z} | \vec{x}_v})$, where \begin{align} {\Sigma}_{\vec{z} | \vec{x}_v} &= \left( {I}_K + {W}^{\intercal}_{v} {\Psi}^{-1}_{v} {W}_{v}\right)^{-1}, \label{eq:covv}\\ \bm{\mu}_{\vec{z} | \vec{x}_v} &= {\Sigma}_{\vec{z} | \vec{x}_v} {W}^{\intercal}_{v} {\Psi}_{v}^{-1}(\vec{x}_v - \bm{\mu}_v) , \label{eq:meanv} \end{align} see e.g.\ \cite[sec.\ 12.2]{bishop-06}, where $W_v$ denotes the submatrix of $W$ relating to the visible variables, and similarly for $\Psi_v$. These equations are simply the standard form for a FA model when the missing variables have been marginalized out. The expression for ${\Sigma}_{\vec{z} | \vec{x}_v}$ can be re-written as \begin{equation} {\Sigma}_{\vec{z} | \vec{x}_v} = (I_K + W^T M \Psi^{-1} M W)^{-1} , \label{eq:covv2} \end{equation} where $M$ is a diagonal matrix the $j$th entry being $m_j$\footnote{Given that $M$ is idempotent i.e.\ $M^2 = M$, one does not need to make use of the usual $M^{1/2}$ construction on either side of $\Psi^{-1}$.}. This means that the diagonal elements in $M \Psi^{-1} M$ will be be $m_j \psi^{-1}_{jj}$: if $m_j = 1$ (so $x_j$ is visible) then $x_j$ is observed with variance $\psi_{jj}$, but for missing data dimensions $m_j = 0$ implies an effective infinite variance for $\psi_{jj}$, meaning that any data value for this missing dimension will be ignored. Note also that an information-theoretic argument that conditioning on additional variables never increases entropy shows that ${\Sigma}_{\vec{z} | \vec{x}}$ will have a determinant no larger than ${\Sigma}_{\vec{z} | \vec{x}_v}$\footnote{The entropy argument strictly applies when taking expectations over $\vec{x}$ or $\vec{x}_v$, but for Gaussian distributions the predictive uncertainty is independent of the value of $\vec{x}$ or $\vec{x}_v$, so it does imply the desired conclusion.}. Equation \ref{eq:covv2} can be rewritten in an interesting way. Let $\vec{v}_j^{\intercal} = (w_{j1}, \ldots, w_{jK})$ denote the $j$th \emph{row} of $W$. Then \begin{equation} \Sigma^{-1}_{\vec{z} | \vec{x}_v} = I_K + W^{\intercal} M {\Psi}^{-1} M W = I_K + \sum_{j=1}^D m_j \psi^{-1}_{jj} \vec{v}_j \vec{v}_j^{\intercal}, \label{eq:rank1sum} \end{equation} i.e.\ where the second term on the RHS is a sum of rank-1 matrices. This arises from the fact that $p(\vec{z}|\vec{x}) \propto p(\vec{z}, \vec{x}) = p(\vec{z}) \prod_{j=1}^D p(x_j|\vec{z})$, and can be related to the product of Gaussian experts construction \cite{williams-agakov-02}. Similarly the mean $\bm{\mu}_{\vec{z} | \vec{x}_v}$ has the form \begin{equation} \bm{\mu}_{\vec{z} | \vec{x}_v} = \Sigma_{\vec{z}|\vec{x}_v} \sum_{j=1}^D m_j \psi^{-1}_{jj} (x_j - \mu_j) \vec{v}_j . \label{eq:rank1mean} \end{equation} Again note how each observed dimension contributes one non-zero term to the sum on the RHS. The non-identifiability of the FA model due to ``rotation of factors'' (see e.g.\ \citealt*[sec.~9.6]{mardia-kent-bibby-79}) means one can transform $W$ with an orthogonal matrix $U$ so that $p(\vec{z}|\vec{x})$ is a diagonal Gaussian. If $\Sigma_{\vec{z}|\vec{x}}= U \Lambda U^T$, then setting $\tilde{W} = W U$ makes the corresponding $\tilde{\Sigma} $ be diagonal. \citet[sec.~2]{vedantam-fischer-huang-murphy-18} suggest that for a VAE with missing data, one can combine together \emph{diagonal} Gaussians in $\vec{z}$-space from each observed data dimension to obtain a posterior $p(\vec{z}|\vec{x}_v)$ using a product of Gaussian experts construction. However, our analysis above shows that this cannot be exact: even if we are in the basis where $p(\vec{z}|\vec{x})$ is a diagonal Gaussian, we note from eq.\ \ref{eq:rank1sum} that the contribution of each observed dimension is a rank-1 update to $\Sigma^{-1}_{\vec{z} | \vec{x}_v}$, and thus there will in general be no basis in which all of these updates will be diagonal. However, note that a rank-1 update involves the same number of entries ($K$) as a diagonal update. \begin{figure*}[t] \centering \includegraphics[width=6in]{example_imputations.png} \caption{Illustration of the seven reconstruction methods on a specific image (leftmost) with the top left quarter missing. Top row: second column shows the original quarter, columns 3-7 show the corresponding imputations. The bottom row shows the pixelwise squared error. \label{fig:freyex}} \end{figure*} \begin{figure*}[t] \centering \includegraphics[width=6.25in]{progressive_imputation} \caption{% Figure illustrating how the posterior means and standard deviations for unobserved pixels change as the amount of missing data decreases. Data above the red line is present, below it is missing and is imputed with exact inference. \label{fig:freyvar}} \end{figure*} If the $\vec{x}$ data does not contain missing values, it is straightforward to build a ``recognition network'' that predicts $\bm{\mu}_{\vec{z} | \vec{x}}$ and ${\Sigma}_{\vec{z} | \vec{x}}$ from $\vec{x}$ using only matrix-vector multiplies, as per equations \ref{eq:covv} and \ref{eq:meanv} without the $v$ subscripts, as the matrix inverse can be computed once and stored. However, if there is missing data then there is a different ${\Sigma}_{\vec{z} | \vec{x}_v}$ for each of the $2^D -1$ non-trivial patterns of missingness, and thus exact inference cannot be carried out efficiently in a single feedforward inference network. This leads to a number of approximations: \vspace*{2mm} \paragraph{Approximation 1: Full Covariance Approximation (FCA)} If we carry out mean imputation for $\vec{x}_m$ and replace those entries with $\bm{\mu}_m$ to give $\vec{x}^{mi}$, then we can rewrite eq.\ \ref{eq:meanv} as \begin{equation} \bm{\mu}_{\vec{z} | \vec{x}_v} = \Sigma_{\vec{z}|\vec{x}_v} {W}^{\intercal} {\Psi}^{-1}(\vec{x}^{mi} - \bm{\mu}), \label{eq:meanmi} \end{equation} as the missing data slots in $\vec{x}^{mi} -\bm{\mu}$ will be filled in by zeros and have no effect on the calculation. However, note that ${\Sigma}_{\vec{z} | \vec{x}_v}$ \emph{does} depend on the pattern of missingness $\vec{m}$ as per eq.\ \ref{eq:covv2}. A simple approximation is to replace it with ${\Sigma}_{\vec{z} | \vec{x}}$ which would apply when $\vec{x}$ is fully observed; we term this the \emph{full covariance approximation}, as it uses the covariance relating to a \emph{fully observed} $\vec{x}$. We denote this approximation as $\bm{\mu}^{FCA}_{\vec{z} | \vec{x}_v}$, as written in eq.\ \ref{eq:FCAapprox}: \begin{equation} \bm{\mu}^{FCA}_{\vec{z} | \vec{x}_v} = \Sigma_{\vec{z} | \vec{x}} {W}^{\intercal} {\Psi}^{-1}(\vec{x}^{mi} - \bm{\mu}) . \label{eq:FCAapprox} \end{equation} \vspace*{2mm} \paragraph{Approximation 2: Scaled Covariance Approximation (SCA)} When no data is observed, we have that the posterior covariance is equal to the prior, $I_K$. When there is complete data, then \begin{equation} \Sigma^{-1}_{\vec{z}|\vec{x}} {\stackrel{def}{=}} P_{\vec{z}|\vec{x}} = I_K + \sum_{j=1}^D P_j \label{eq:SCAapprox} \end{equation} where $P_j = \psi^{-1}_{jj} \vec{v}_j \vec{v}_j^{\intercal}$, making use of eq.\ \ref{eq:rank1sum}. Although as we have seen the $P_j$'s are all different, a simple approximation would be to assume they are all equal, and thus rearrange eq.\ \ref{eq:SCAapprox} to obtain $\tilde{P}_j = (P_{\vec{z}|\vec{x}} - I_K)/D$ for $j = 1, \ldots, D$.\footnote{A slightly more general decomposition would be to set $\tilde{P}_j = \alpha_j (P_{\vec{z}|\vec{x}} - I_K)$ with $\sum_j \alpha_j = 1$, but then it would be more difficult to decide how to set the $\alpha_j$s; this could e.g.\ be learned for a given missingness mechanism.} This would give the approximation \begin{equation} \Sigma^{-1}_{\vec{z}|\vec{x}_v} \simeq I_K + \frac{\sum_j m_j}{D} (P_{\vec{z}|\vec{x}} - I_K) = \frac{D_m}{D} I_K + \frac{D_v}{D} P_{\vec{z}|\vec{x}} , \label{eq:sca} \end{equation} which linearly interpolates between $I_K$ and $P_{\vec{z}|\vec{x}}$ depending on the amount of missing data. Using this approximation instead of $\Sigma_{\vec{z}|\vec{x}}$ in eq.\ \ref{eq:FCAapprox} yields the \emph{scaled covariance approximation} (SCA). The inversion of the RHS of eq.\ \ref{eq:sca} can be carried out simply and analytically if $P_{\vec{z}|\vec{x}}$ is diagonal, as per the rotation-of-factors discussion above. \vspace*{3mm} \paragraph{Approximation 3: Denoising Encoder (DE)} \citet{vincent-etal-08} introduced the \emph{denoising autoencoder} (DAE), where the goal is to train an autoencoder to take a corrupted data point as input, and predict the original, uncorrupted data point as its output. In \cite{vincent-etal-08} the stochastic corruption process sets a randomly-chosen set of the inputs to zero; the goal is then to reconstruct the corrupted inputs from the non-corrupted ones. As we have seen above, if the data is centered, then setting input values to zero is equivalent to mean imputation. Despite this, the motivation for denoising autoencoders was not so much to handle missing data, but to more robustly learn about the structure of the underlying data manifold. Also, as seen from our results above, a simple feedforward net that ignores the pattern of missingness (as in the DAE) cannot perform exact inference even for the factor analysis case. However, we can develop ideas relating to the DAE to create a \emph{denoising encoder} (DE). In our situation we have complete training data (i.e.\ without missingness). Thus for each $\vec{x}$ we can obtain the corresponding posterior for $\vec{z}$ (as per eqs.\ \ref{eq:covv} and \ref{eq:meanv} without any missing data). We then create a pattern of missingness and apply it to $\vec{x}$ to obtain $\vec{x}^{mi}$. One can then train a regression model from $\vec{x}^{mi}$ to the corresponding posterior mean of $\vec{z}$. Note that this \emph{averages} over the patterns of missingness, rather than handling each one separately. The \emph{decoder} for the DE is the exact solution $p(\vec{x}|\vec{z}) \sim N(W \vec{z} + \bm{\mu}, \Psi)$. A limitation of the DE is that to train it we need examples of the patterns of missingness that occur in the data, which is not the case for the exact or approximate methods described above. \section{Experiments} \newcommand{21mm}{21mm} \begin{table*} \caption{\small Mean squared imputation error ($\times 10^{2}$) with standard errors for various imputation methods on PPCA generated data with random (R) and quarters (Q) patterns of missingness. For a particular data example the squared imputation error is the average error over imputed values for that example. Denoising encoder$^*$ is trained on random patterns of missingness, whereas Denoising encoder is trained on the same type of missingness patterns as it is tested on. For the Denoising encoder and Denoising encoder$^*$ on the Random data, note that the performance is identical as the training and testing data are the same in each case. This is indicated with brackets. \label{tab:ppca-frey}} \centering \scriptsize \begin{tabular}{llp{21mm}p{21mm}p{21mm}p{21mm}p{21mm}p{21mm}} \toprule & Mean \mbox{imputation} & Full-covariance \mbox{approx.} & Scaled-covariance \mbox{approx.} & Denoising \mbox{encoder} & Denoising \mbox{encoder*} & Exact \mbox{inference} \\ \midrule R & $4.5323 \pm 0.0047$ & $1.8675 \pm 0.0017$ & $0.9783 \pm 0.0007$ & $1.0330 \pm 0.0006$ & ($1.0330 \pm 0.0006$) & $0.5913 \pm 0.0001$ \\ Q & $4.4642 \pm 0.0065$ & $2.5732 \pm 0.0045$ & $2.2671 \pm 0.0041$ & $1.0043 \pm 0.0011$ & $1.6863 \pm 0.0021$ & $0.6998 \pm 0.0005$ \\ \bottomrule \end{tabular} \end{table*} \begin{table*} \caption{\small Mean squared imputation error ($\times 10^{2}$) with standard errors for various imputation methods on the real Frey faces dataset. The details are as in Table \ref{tab:ppca-frey}. \label{tab:frey}} \centering \scriptsize \label{my-label} \begin{tabular}{llp{21mm}p{21mm}p{21mm}p{21mm}p{21mm}p{21mm}} \toprule & & Mean \mbox{imputation} & Full-covariance \mbox{approx.} & Scaled-covariance \mbox{approx.} & Denoising \mbox{encoder} & Denoising \mbox{encoder*} & Exact \mbox{inference} \\ \midrule \multirow{2}{*}{R} & Train & $4.6390 \pm 0.0013$ & $1.9339 \pm 0.0006$ & $1.0433 \pm 0.0004$ & $0.7161 \pm 0.0002$ & ($0.7161 \pm 0.0002$) & $0.6583 \pm 0.0002$ \\ & Test & $4.6218 \pm 0.0054$ & $1.9531 \pm 0.0026$ & $1.0878 \pm 0.0018$ & $1.1450 \pm 0.0022$ & ($1.1450 \pm 0.0022$) & $0.7165 \pm 0.0016$ \\ \rule{0pt}{4ex}\multirow{2}{*}{Q} & Train & $4.6002 \pm 0.0017$ & $2.7613 \pm 0.0012$ & $2.4820 \pm 0.0011$ & $0.7262 \pm 0.0003$ & $1.8731 \pm 0.0009$ & $1.2507 \pm 0.0007$ \\ & Test & $4.4886 \pm 0.0066$ & $2.7124 \pm 0.0044$ & $2.4496 \pm 0.0040$ & $1.2220 \pm 0.0036$ & $1.8883 \pm 0.0036$ & $1.3677 \pm 0.0035$ \\ \bottomrule \end{tabular} \end{table*} We trained a PPCA model on the Frey faces dataset\footnote{Available from \url{https://cs.nyu.edu/~roweis/data/frey_rawface.mat}.}, which consists of 1965 frames of a greyscale video sequence with resolution $20 \times 28$ pixels. Pixel intensities were rescaled to lie between -1 and 1. We used 43 latent components for the model, explaining $90\%$ of the data variability. $80\%$ of the data frames were randomly selected as a training set, and the remainder were held out as a test set. We estimate the parameters $W, \bm{\mu}, \sigma^2$ of the model using maximum likelihood, and obtain the analytic solutions as in \cite{tipping-bishop-99}. In the case of the denoising encoder, we create one missingness-corrupted pattern $\vec{x}^{mi}$ for each training example when estimating the regression model. Given a trained PPCA model we investigate various approaches for handling missing data with a data imputation task. Given a partially observed data example, the task is to predict the values of the missing data variables using the trained model. We consider two patterns of missing data. In the first setting each data variable is independently dropped out with probability $0.5$. In the second setting one of the four image quarters is dropped out in each example (see Fig.\ \ref{fig:freyex}). We consider five approaches to handling missing data. The first method is simply to inpaint the missing variables with their training set means, without using the latent variable model at all. This is denoted by ``mean imputation''. The second approach is to use FCA, and the third SCA. For the fourth method we train a denoising encoder as described above, using a linear regression model. The final method is to use exact inference as per eqs.\ \ref{eq:covv} and \ref{eq:meanv}. \subsection{Results} We present two sets of results, firstly for data generated from the PPCA model fitted to the Frey data (denoted PPCA-Frey data), and secondly for the Frey data itself. For the {\bf PPCA-Frey data}, the mean squared imputation error results are shown in Table \ref{tab:ppca-frey}. In this case 400 test cases are generated from the PPCA model. For the DE case, 1600 training cases are also generated to train the DE model. For the denoising autoencoder on the quarters data, we train it either on data with missing quarters, or on data with pixels with a random pattern of missingness---the latter is denoted as Denoising encoder$^*$ in the tables. In Table \ref{tab:ppca-frey} we see that FCA improves over mean imputation, and that SCA improves over FCA. Training the denoising autoencoder (which uses the same input $\vec{x}^{mi}$ as FCA and SCA) gives a further improvement for the quarters data, but is very similar to SCA for the random missingness pattern. Note that on the quarters data, the Denoising encoder$^*$ results are quite a lot worse than the DE which had been trained on missing-quarters training data. For both the random and quarters data, the exact inference method is the best, as expected. For the {\bf Frey data} the mean-squared imputation error results are shown in Table \ref{tab:frey}, and a comparison on a specific image is shown in Figure \ref{fig:freyex}. For the random missingness data, mean imputation is the worst and exact inference the best, with FCA, DE and SCA falling in between (from worst to best). Exact inference significantly outperforms the denoising encoder on the test set. For the quarters dataset, we see a similar pattern of performance, except for slightly better performance of the denoising encoder than exact inference on the test set. Notice also that when using the Denoising encoder$^*$ (training using random patterns of missingness) the performance is significantly worse. The slight performance gain of the DE on the quarters data over exact inference may be due to the fact that exact inference applies to the PPCA model, but as the Frey data was not generated from this model there can be some room for improvement over the ``exact'' method. Also note that for the quarters data only four patterns of missingness are used, so the DE network is likely to be able to learn about this more easily than random missingness. There are noticeable differences between the training and test set errors for the DE model. This can be at least partially explained by noting that on the training set the DE model has access to the posterior for $\vec{z}$ based on the \emph{complete} data, so it is not surprising that it does better here. Figure \ref{fig:freyvar} illustrates how the posterior means and standard deviations of unobserved pixels change as the amount of missing data decreases, using exact inference. As would be expected the uncertainty decreases as the amount of visible data increases, but notice how some regions like the mouth retain higher uncertainty until observed. \section{Conclusions} Above we have discussed various approaches to handling missing data with probabilistic autoencoders. We have shown how to calculate exactly the latent posterior distribution for the factor analysis (FA) model in the presence of missing data. This solution exhibits a non-trivial dependence on the pattern of missingness, requiring a different matrix inversion for each pattern. We have also described three approximate inference methods (FCA, SCA and DE). Our experimental results show the relative effectiveness of these methods on the Frey faces dataset with random or structured missingness. A limitation of the DE method is that the structure of the missingness needs to be known at training time---our results demonstrate that performance deteriorates markedly when the missingness assumptions at train and test time differ. Possible future directions include the use of nonlinear DE models, and the development of methods to handle missing data in nonlinear autoencoders. \section*{Acknowledgements} CW and AN would like to acknowledge the funding provided by the UK Government's Defence \& Security Programme in support of the Alan Turing Institute. The work of CW is supported in part by EPSRC grant EP/N510129/1 to the Alan Turing Institute. CN is supported by a PhD studentship from the EPSRC CDT in Data Science EP/L016427/1. CW thanks Kevin Murphy for a useful email discussion. \bibliographystyle{apalike}
\section{Introduction} \label{sec:introduction} We are crossing the gates into a new era in astronomy research, the era of multi-messenger observations, big data and extremely detailed numerical simulations. In this promising scenario, the field of galactic archaeology is in an extraordinary position thanks to the arrival of the satellite {\it Gaia} \citep[see][]{2001A&A...369..339P,2008IAUS..248..529L}. A first glimpse at the extraordinary quality of the full 6-dimensional phase space catalog that {\it Gaia} will provide throughout its lifetime has already been publicly released \citep{2015A&A...574A.115M,2016A&A...595A...4L}. Several studies based on these early-stage data have already pushed the boundaries on the characterization of the extended solar neighbourhood phase space structure and its relation to the Galaxy's formation history \citep{2017ApJ...845..101B,2017MNRAS.470.1360B,2017arXiv170703833I,2017MNRAS.466L.113M, 2017arXiv171206616S}. According to the $\Lambda$ cold dark matter ($\Lambda$CDM) cosmological model, galaxies increase their mass through merger and accretion of smaller systems. These accretion events are expected to play a very important role in shaping the present-day chemical distribution \citep{2014SAAS...37..145M} and morphological and kinematical structure of the host galaxy \citep[see][for a complete review on near-field cosmology]{2014SAAS...37....1B}. Stellar haloes of large galaxies such as our own are believed to be primarily formed as a result of the accumulation of tidal debris associated with ancient as well as recent and ongoing accretion events \citep{2008A&ARv..15..145H}. Galactic discs are also strongly affected by such interactions. In addition to heating and thickening pre-existing discs, satellites can generate substructure in both chemical abundance and phase space, as well as induce secular phenomena such as bars, spiral arms, and warps \citep[see, e.g.][]{2009MNRAS.397.1599Q,2012MNRAS.419.2163G,2012MNRAS.423.3727G,2013MNRAS.429..159G,2014ApJ...781L..20M,2015MNRAS.450..266W,2016MNRAS.456.2779G,2017MNRAS.465.3446G,2017arXiv171002538L,2018MNRAS.473.1218L}. Signatures of these accretion events can provide strong constraints on the formation history of galaxies \citep[see][and references therein, for a recent and comprehensive discussion on the subject]{2016ASSL..420.....N}, such as our own Milky Way \citep[MW,][]{2002ARA&A..40..487F}. Thus, much effort has been devoted to develop methods and tools to efficiently identify and quantify substructure in different Galactic distributions. To first order, the stellar halo can be approximated as a collisionless component \citep{1987gady.book.....B} and, thus, retains its dynamical memory providing an ideal place to search for signatures of accretion events. Studies based on numerical models have predicted that a few hundred kinematically cold stellar streams should be currently crossing our solar neighbourhood \citep{1999MNRAS.307..495H,2003MNRAS.339..834H,2008A&ARv..15..145H}. However, due to limitations of studies based on pre-{\it Gaia} astrometric catalogues \citep[e.g. with][]{1997ESASP1200.....E,2000AJ....120.1579Y,2006AJ....131.1163S,2006ChJAA...6..265Z,2008AJ....136..421Z}, only a handful of stellar streams were identified \citep[e.g.][]{1999MNRAS.307..495H,1999Natur.402...53H,2006MNRAS.365.1309H}. Furthermore, studies based on {\it Gaia} first data release, DR1, have already revealed more substructures in our stellar halo \citep[e.g.][]{2017A&A...598A..58H,2017A&A...608A..73K}, but the number of identified substructures is still far from the few hundred streams predicted by the models. Only with the arrival of {\it Gaia} second data release, DR2, we will be able to provide a more robust quantification of the ammount of substructure in the solar neighbourhood. A valid concern regarding our ability to identify signatures from old accretion events relates to the longevity of cold kinematical structures. It is well known that dark matter (DM) haloes of MW-like galaxies are expected to be triaxial \citep{2002ApJ...574..538J,2006MNRAS.367.1781A,2011MNRAS.416.1377V}, and that a fraction of the orbits hosted by the corresponding triaxial potentials will exhibit chaotic behaviour \citep[see e.g.][]{1993ApJ...409..563S,1996ApJ...460..136M,1996ApJ...471...82M,2000MNRAS.319...43S,2002MNRAS.337..619V,2003MNRAS.345..727K,2004A&A...428..905K,2005CeMDA..91..173M,2007LNP...729..297E}. As shown by \citet{1999MNRAS.307..495H,2008MNRAS.385..236V,2013MNRAS.436.3602G} and \citet[][hereinafter \citetalias{2015MNRAS.453.2830M}]{2015MNRAS.453.2830M}, the density of a stellar stream on a chaotic orbit decays exponentially with time, as opposed to the power-law decay associated with regular orbits. As a consequence, the identification of stellar streams on chaotic orbits is extremely challenging as they can quickly blend with the background stellar distribution, even in velocity space. More importantly, within relevant time-scales, strong chaotic behaviour can lead to diffusion in the space of pseudo-integrals of motion, such as energy and angular momentum \citep{1992IAUS..149..471P,1997A&A...319..796S,2013ApJ...767...93V}. As a result, signatures of stellar streams can be effectively erased, hindering our hopes of constraining our Galactic accretion history through the identification and quantification of substructures in phase space \citep[for a comprehensive review on chaos in galaxies, see the book by][and references therein]{2002ocda.book.....C}. In \citetalias{2015MNRAS.453.2830M} we tackled this problem by characterizing the orbital distribution of star particles located within solar neighbourhood-like volumes extracted from stellar halo models based on DM-only simulations \citep[][]{2008Natur.456...73S,2008MNRAS.391.1685S,2010MNRAS.406..744C}. Our results showed that $\sim70$~per cent of these orbits, evolving within strongly triaxial potentials, could be classified as chaotic. However, only $\la20$~per cent of these particles revealed their chaotic nature within a Hubble time. The remaining orbits classified as chaotic ($\sim50$~per cent of the total), revealed their chaotic behaviour only after a Hubble time. These orbits, dubbed as ``sticky'' \citep[see][and \citetalias{2015MNRAS.453.2830M} and references therein for further details]{2000CSF....11.2281T}, are particularly important. They have an intrinsically chaotic nature. However, for halo stars moving on such orbits, chaotic mixing will not have enough time to act. Furthermore, an analysis based on first order expansions of the underlying potentials demonstrated that diffusion in phase space is not significant on any realistic time-scale \citep[in agreement with previous works, see for instance:][]{2004A&A...423..745G,2006A&A...455..499C,2014PhyD..266...49C}, even for those orbits that revealed their chaotic nature within a Hubble time. Although chaotic mixing is non-negligible \citep[e.g.][]{2015ApJ...799...28P,2016MNRAS.460..497H,2017MNRAS.470...60E} and might be strongly relevant for the morphological structure of very cold streams \citep[see for instance][]{2016MNRAS.455.1079P,2016ApJ...824..104P}, our results suggested that it is not efficient at erasing signatures of accretion events. However, as mentioned before, this study was based on stellar halo models extracted from DM-only simulations. Due to the lack of a baryon component, the overall galactic potentials were clearly a poor representation of the true Galactic potential, especially within the inner Galactic regions. The addition of baryons does not only modify the potential through their additional mass distribution, but also significantly alters the density profile of the DM halo within which the baryons are embedded \citep[e.g.][]{2004ApJ...616...16G,2016MNRAS.457.1931S,2016MNRAS.458.1559Z}. Previous studies based on cosmological hydrodynamical simulations have shown that, when baryons are taken into account, DM haloes present a significantly more oblate distribution in the inner regions \citep[for instance:][]{1994ApJ...431..617D,2006PhRvD..74l3522G,2008ApJ...681.1076D,2010MNRAS.407..435A}, thus enhancing the asymmetry within the inner and the outer galactic regions. In this work, we take a step forward on this matter by characterizing the effects of chaotic mixing in solar neighbourhood-like volumes extracted from fully cosmological hydrodynamical simulations of the formation of MW-like galaxies \citep[][]{2014MNRAS.437.1750M,2017MNRAS.467..179G}. These simulations naturally account for the effects associated with the gravitational potential of the baryonic components (such as the bulge and disc), and thus can be used to characterize the efficiency of chaotic mixing in a more realistic scenario. The paper is organized as follows: in Section~\ref{sec:methodology} we briefly introduce the simulations, models and techniques used in the present study. Our results on the actual relevance of chaos in erasing kinematic signatures of accretion events in the local stellar halo are presented in Sections~\ref{sec:relevance} and~\ref{sec:diffusion} and, finally, we discuss and summarise our results in Section~\ref{sec:discussion}. \section{Methodology} \label{sec:methodology} In this section we briefly describe the simulations and numerical tools used to characterize and quantify chaotic behaviour within solar neighbourhood-like phase space volumes. \subsection{Simulations} \label{subsec:meth-sim} In this study we focus on a set of seven fully cosmological hydrodynamic zoom-in simulations of MW-like galaxies, extracted from \citet{2014MNRAS.437.1750M} and \citet{2017MNRAS.467..179G}. The simulations were carried out using the $N$-body + moving-mesh, magnetohydrodynamic code {\sc arepo} \citep{2010MNRAS.401..791S,2016MNRAS.455.1134P}. A standard $\Lambda$CDM cosmology was adopted in both cases. The values chosen for the different cosmological parameters are very similar and can be found on the corresponding papers. The baryonic physics model implemented in {\sc arepo} follows a number of processes that play a key role in the formation of late-type galaxies, such as gas cooling/heating, star formation, mass return and metal enrichment from stellar evolution, the growth of supermassive black holes, magnetic fields \citep{2013MNRAS.432..176P,2017MNRAS.469.3185P} and feedback both from stellar sources and from black hole accretion. The parameters that regulate the efficiency of each physical process were chosen by comparing the results obtained in simulations of cosmologically representative volumes to a wide range of observations of the galaxy population \citep{2013MNRAS.436.3031V,2014MNRAS.437.1750M,2016MNRAS.459..199G}. In order to contrast our results with those presented in \citetalias{2015MNRAS.453.2830M}, first we use a hydrodynamic re-simulation of one of the haloes from the {\it Aquarius Project} \citep{2008Natur.456...73S,2008MNRAS.391.1685S}, also run with the code {\sc arepo}. This simulation, namely Aq-C4 (for simulation Aq-C at the resolution level 4), was first introduced in \citet{2014MNRAS.437.1750M}. However, most of the simulations used in this work are taken from the {\it Auriga Project}. This suite is composed of 30 high-resolution cosmological zoom-in simulations of the formation of late-type galaxies within MW-sized DM haloes. The haloes were selected from a lower resolution DM-only simulation from the {\it Eagle Project} \citep{2015MNRAS.446..521S}, a periodic box of side 100 Mpc. Each halo was chosen to have, at $z=0$, a virial mass in the range of $10^{12}$ -- $2 \times 10^{12}~ {\rm M}_{\odot}$ and to be more distant than nine times the virial radius from any other halo of mass more than $3$~per cent of its own mass. The typical DM particle and gas cell mass resolutions for the simulations used in this work (Aq-C4 and {\it Auriga}, also resolution level 4) are $\sim 3\times 10^{5}~{\rm M}_{\odot}$ and $\sim 6 \times 10^{4}~{\rm M}_{\odot}$, respectively. The gravitational softening length used for DM and stars grows with scale factor up to a maximum of 369 pc, after which it is kept constant in physical units. The softening length of gas cells scales with the mean radius of the cell, but is never allowed to drop below the stellar softening length. A resolution study across three resolution levels \citep{2017MNRAS.467..179G} shows that many galaxy properties, such as surface density profiles, orbital circularity distributions, star formation histories and disc vertical structures are already well converged at the resolution level used in this work. We will refer to the {\it Auriga} simulations as \textquotedblleft Au-i'', with \textquotedblleft i'' enumerating the different initial conditions, as in \citet{2017MNRAS.467..179G}. The main properties of each simulation at $z=0$ are listed in Table~\ref{table:t1}. A detailed description of how these parameters were obtained is given in \citet{2014MNRAS.437.1750M} and \citet{2017MNRAS.467..179G}. \begin{table} \centering \caption{Main properties of the Aq-C4 and the six {\it Auriga} simulations (resolution level 4) at $z=0$ from \citet{2014MNRAS.437.1750M} and \citet{2017MNRAS.467..179G}, respectively. The first column labels the simulation. From left to right, the columns give the virial radius, $r_{200}$; the concentration parameter $c_{\rm NFW}$ of the underlying DM haloes; the DM mass $M_{200}$, and the stellar mass $M_\star$ inside the virial radius.} \label{table:t1} \begin{tabular}{@{}lcccc} \hline Name & $r_{200}$ & $c_{{\rm NFW}}$ & $M_{200}$ & $M_\star$\\ & [kpc] & & [$10^{10}$~M$_{\odot}$] & [$10^{10}$~M$_{\odot}$] \\ \hline \\ Aq-C4 & $234.4$ & 16.03 & $145.71$ & $5.31$\\ Au-3 & $239.02$ & 15.6 & $145.78$ & $7.75$\\ Au-6 & $213.83$ & 11 & $104.39$ & $4.75$\\ Au-15 & $225.4$ & 7.9 & $122.25$ & $3.93$\\ Au-16 & $241.48$ & 9.3 & $150.33$ & $5.41$\\ Au-19 & $224.57$ & 8.3 & $120.9$ & $5.32$\\ Au-21 & $238.65$ & 14.2 & $145.09$ & $7.72$\\ \hline \end{tabular} \end{table} Finally, it is important to highlight that, as discussed below, our analytic Galactic potentials do not account for the effect of Galactic bars. Thus, the simulations used in this work were chosen so that they do not present strong Galactic bars at $z=0$. Note that, even though the time varying potential associated with a bar can enhance the strength of chaotic diffusion in the very inner galactic region \citep{2001A&A...373..511F,2003AJ....125..785Q,2007A&A...467..145C,2008A&A...488..161C,2011ApJ...733...39S}, it is unlikely to play a significant role in erasing signatures of past and ongoing Galactic accretion events within the solar neighbourhood and beyond. Though, we defer the detailed study of this aspect to future work (Maffione et al., in preparation). \subsection{The galactic potential} \label{subsec:meth-pot} In order to characterize the dynamics of MW-like stellar haloes by recourse to the chaos indicator (hereinafter CI) used in the present effort, the high-precision numerical integration of both the equations of motion and their first variational equations is required (see Section~\ref{subsec:meth-ind-OFLI} for further details). Indeed, the variational equations are needed to track the temporal evolution of the separation between initially nearby orbits in phase space (see the Appendix in \citetalias{2015MNRAS.453.2830M} for details). Therefore, as an analytic representation of the underlying galactic potential is in order, we describe the potential of each simulated galaxy by a superposition of suitable analytic and static models representing the different galactic components. Other approximations, based on series expansion of the underlying potential can be very accurate \citep[i.e.][]{1973Ap&SS..23...55C,1992ApJ...386..375H,1999AJ....117..629W,2008MNRAS.383..971K,2011MNRAS.416.2697L,2013MNRAS.434.3174V,2014ApJ...792...98M}. However, a rather large number of terms should be considered, thus rendering unfeasible the derivation of the first variational equations (for further discussion see \citetalias{2015MNRAS.453.2830M}). Our analytic Galactic potential contains four different contributions corresponding to the central nuclear region, the bulge, the disc and the DM halo: \begin{equation} \Phi_{\rm MW}=\Phi_{\rm nuc}+\Phi_{\rm bul}+\Phi_{\rm disc}+\Phi_{\rm DM2}. \label{eq:mw} \end{equation} The values of the parameters that describe each Galactic component are directly extracted from the numerical simulations, presented in last section, as described in \citet{2014MNRAS.437.1750M} and \citet{2017MNRAS.467..179G}. The concentration and virial radius that describe each DM halo are obtained by fitting a Navarro, Frenk \& White profile \citep{1996ApJ...462..563N,1997ApJ...490..493N} to the corresponding DM particle distribution, and are listed on Table~\ref{table:t1}. For the stellar component, a decomposition of the surface density profile into an exponential disc and a S{\'e}rsic profile is performed to obtain disc scalelengths and bulge effective radii, as well as their relative mass contributions. Masses are slightly re-calibrated by fitting our analytic models to the total circular velocity curves extracted from the simulations, as illustrated in Fig.~\ref{fig:3c}. Note that, through this process, the total stellar mass is kept constant. Resulting values are listed on Table \ref{table:t2}. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig1.png} \end{tabular} \end{center} \caption{Total circular velocity curves $V_{\rm cir}$ as a function of galactocentric distance $R$ for one of our analytic and static representations of the MW (red solid line) and its simulated MW-like galaxy counterpart taken from a cosmological hydrodynamic simulation (blue points). The resemblance, particularly in the solar neighbourhood-like volume (i.e. $5\la {\rm R [kpc]}\la11$), is reassuring.} \label{fig:3c} \end{figure} We highlight that, as in \citetalias{2015MNRAS.453.2830M}, the cosmological simulations considered in this work are only used to extract the parameters that characterize the underlying potentials, and to obtain realistic models of the phase space distributions of solar neighbourhood-like volumes (see next section). Our goal is not to accurately characterize the impact of chaos in the Aq-C4 or {\it Auriga} local stellar haloes themselves. Instead, we aim to obtain reasonable descriptions of these numerically simulated galaxies to reflect in our results the expected variations in the galactic potential associated with the galaxy formation process. Sampling initial conditions from a self-consistent model and later evolving them in a slightly different potential should increase the fraction of chaotic orbits in the sample \citep{2012MNRAS.419.1951V}. Thus, under the approximation of our static potentials, the fraction of chaotic orbits within the phase space volumes analyzed here will likely be overestimated with respect to that associated to the best possible analytical representation of the underlying potential. We acknowledge that, despite the benefits of dealing with analytic and static representations of the galactic potentials, these models have their own strong limitations. For example, we are not accounting for how substructure as well as time-dependance could enhance the efficiency of diffusion in phase space \citep[see][and Section~\ref{sec:discussion} for further discussion]{2013MNRAS.433.2576P}. These issues will be tackle in a forthcoming paper. In what follows, we describe each galactic component. \subsubsection{The central nuclear region} The presence of a supermassive black hole and a nuclear star cluster in the inner galactic regions \citep{2002A&A...384..112L} can significantly amplify the amount of chaos as their mass profiles contribute to a cuspy shape \citep[see for instance][]{1998ApJ...506..686V,2001PhRvE..64e6209K}. In our analysis, this component is particularly important for box orbits that are currently crossing our simulated solar neighbourhood-like volumes. Therefore, to model such a component, which dominates the mass distribution within the inner $\sim30$ pc, we use a Plummer sphere \citep{1911MNRAS..71..460P}: \begin{equation} \Phi_{\rm nuc}=-\frac{B}{\sqrt{r^2+\left(\epsilon^{\rm s}_{\rm nuc}\right)^2}}\ , \end{equation} where the constant $B$ is defined as $B=G\,M_{\rm nuc}$, with $G$ the gravitational constant, $M_{\rm nuc}$ the estimated mass enclosed in the central region, $r=\sqrt{x^2+y^2+z^2}$ the usual galactocentric distance and $\epsilon^{\rm s}_{\rm nuc}$ the radial scalelength. All the values of the parameters for MW model C4 are obtained from simulation Aq-C4 \citep{2014MNRAS.437.1750M}, except for $\epsilon^{\rm s}_{{\rm nuc}}$ which is taken from \citet{2002A&A...384..112L}. The nuclear region has the same values of the parameters for all of our MW models and it is not included in Table~\ref{table:t2} for the sake of brevity: the mass being $M_{\rm nuc}=2\times10^{8}$ M$_{\odot}$, and the scalelength radius, $\epsilon^{\rm s}_{\rm nuc}=0.03$~kpc. \subsubsection{The bulge} The stellar bulge is the dominant component within $\sim 1$~kpc \citep{2002A&A...384..112L}. In this case, we use a Hernquist profile \citep{1990ApJ...356..359H} with a scalelength, $\epsilon^{\rm s}_{\rm bul}$: \begin{equation} \Phi_{\rm bul}=-\frac{C}{r+\epsilon^{\rm s}_{\rm bul}}\ , \end{equation} where $C$ is a constant defined as $C=G\,M_{\rm bul}$, with $M_{\rm bul}$ its total mass. \subsubsection{The disc} To model a stellar disc with a double exponential density profile we follow the procedure described by \citet{2015MNRAS.448.2934S}. The idea behind this method is to approximate an exponential profile by the superposition of three different Miyamoto \& Nagai (MN) profiles \citep{1975PASJ...27..533M}. In our case, the mass distribution of the resulting models deviates from the radial mass distribution of a pure exponential disc by $< 1$~per cent out to four disc scalelengths, and by $< 6$ per cent out to ten disc scalelengths. \citet{2015MNRAS.448.2934S} provides a user-friendly online web-form that computes the best-fitting parameters for an exponential disc\footnote{\url{http://astronomy.swin.edu.au/~cflynn/expmaker.php}}, \begin{equation} \rho(R, z) = \rho_{0} \exp(-R/\epsilon^{\rm s}_{\rm disc})\exp(-|z|/\epsilon^{\rm h}_{\rm disc})\ , \end{equation} with $\rho(R, z)$ the axysimmetric density, $R=\sqrt{r^2-z^2}$ the projected galactocentric distance, $\rho_0$ the central density and when the desired total mass $M_{\rm disc}$, scalelength $\epsilon^{\rm s}_{\rm disc}$ and scaleheight $\epsilon^{\rm h}_{\rm disc}$ are provided. Let us remind the reader that the potential of a single MN disc obeys the following expression: \begin{equation} \label{eq:discMN} \Phi^{\rm MN}_{\rm disc}=-\frac{D}{\sqrt{R^2+\left[\epsilon^{\rm s\, MN}_{\rm disc}+\sqrt{z^2+\left(\epsilon^{\rm h}_{\rm disc}\right)^2}\right]^2}}\ , \end{equation} where $\epsilon^{\rm s\, MN}_{\rm disc}$ and $\epsilon^{\rm h}_{\rm disc}$ are the scalelength and scaleheight of the MN disc, respectively (it should be noticed that $\epsilon^{\rm h}_{\rm disc}$ is the same for the exponential and the three MN discs). Furthermore, $D$ is a constant defined as $D=G\,M^{\rm MN}_{\rm disc}$ with $M^{\rm MN}_{\rm disc}$, its mass. The experiments performed in this work consider the double exponential approximation described above. \subsubsection{The dark matter halo} \label{subsubsec:dmcomp} \citet{1996ApJ...462..563N,1997ApJ...490..493N} introduced a universal spherical density profile (NFW profile) that provides a reasonable fitting to the mass distribution of DM haloes of galaxies over a very wide range of mass and redshift. It has been shown since, however, that DM haloes are not spherical as assumed by this potential. In the absence of baryons, fully cosmological simulations have shown that DM haloes are strongly triaxial, with their shape varying as a function of galactocentric distance \citep[see e.g.][]{2006MNRAS.367.1781A,2011MNRAS.416.1377V}. To model this behaviour, \citetalias{2015MNRAS.453.2830M} uses a triaxial extension of the NFW profile \citep[introduced in][]{2008MNRAS.385..236V}, \begin{equation} \label{eq:nfw_tri} \Phi_{\rm DM}=-\frac{A}{r_p}\ln \left( 1+\frac{r_p}{r_s}\right)\ , \end{equation} where $A$ is a constant defined as: \begin{equation} A=\frac{G\,M_{200}}{\ln\left(1+c_{\rm NFW}\right)-c_{\rm NFW}/\left(1+c_{\rm NFW}\right)}\ , \end{equation} with $M_{200}$ being the virial mass of the DM halo and $c_{\rm NFW}$ the concentration parameter; $r_s=r_{200}/c_{\rm NFW}$ is a scale radius with $r_{200}$ the virial radius. The triaxiality of this potential is introduced through $r_p$, \begin{equation} r_p=\frac{(r_s+r)r_i}{r_s+r_i}\ , \end{equation} where $r_i$ is an ellipsoidal radius for the inner parts defined as: \begin{equation} r_i=\sqrt{\left(\frac{x}{a}\right)^2 + \left(\frac{y}{b}\right)^2 + \left(\frac{z}{c}\right)^2}\ . \end{equation} The quantities $b/a$ and $c/a$ represent the intermediate-to-major and the minor-to-major principal axes ratios and are defined such that $a^{2} + b^{2} + c^{2} = 3$. Note that the potential shape changes from ellipsoidal in the inner regions to near spherical at the scale radius, $r_{s}$. Thus, for $r \ll r_{\rm s}$, $r_{\rm p} \simeq r_{\rm i}$ and for $r \gg r_{s}$, $r_{p} \simeq r$ \citep{2008MNRAS.385..236V}. The addition of baryons, however, significantly alters the DM phase space distribution. As a result of the central accumulation of baryons, DM haloes in cosmological hydrodynamic simulations are found to be more oblate than triaxial in the inner parts \citep[e.g.][]{2014MNRAS.437.1750M,2017MNRAS.467..179G}. To account for this, we introduce a \textquotedblleft bi-triaxial'' extension of the NFW profile by defining a new parameter: \begin{equation} r'_p=\frac{(r_s+r_o)r_i}{r_s+r_i}\ , \label{rpp} \end{equation} where a second ellipsoidal radius, $r_o$, is defined as: \begin{equation} r_o=\sqrt{\left(\frac{x}{a'}\right)^2 + \left(\frac{y}{b'}\right)^2 + \left(\frac{z}{c'}\right)^2}\ , \end{equation} with $a'^2+b'^2+c'^2=3$, while $(b/a,c/a)$ and $(b'/a',c'/a')$ denote the principal axes ratios of the DM halo in the inner and outer regions, respectively, with a smooth transition taking place at $r_{s}$. Thus, the new potential is simply $\Phi_{\rm DM2}=\Phi_{\rm DM}(r'_p)$. Fig.~\ref{fig:isopot} shows an example of isopotentials in the outer and inner parts of $\Phi_{\rm DM2}$. The transition from mildly triaxial to a more oblate shape can clearly be seen as the centre is approached \citep[compare Fig.~\ref{fig:isopot} with Fig. 10 of][]{2008MNRAS.385..236V}. Note, however, that our models have less exaggerated (and more realistic) axes ratios (see Table~\ref{table:t2} in Section~\ref{subsec:relevance-dist}) than those considered in the example, and the transition is not so evident. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig2.png}\\ \hspace{-5mm}\includegraphics[width=1\linewidth]{fig3.png} \end{tabular} \end{center} \caption{Isopotentials for the outer (top panel) and inner parts (bottom panel) of our \textquotedblleft bi-triaxial'' extension of the NFW profile. The potential becomes more oblate as the centre is approached.} \label{fig:isopot} \end{figure} \subsection{Cosmologically motivated initial conditions} \label{subsec:meth-init} To investigate the efficiency of chaotic mixing associated with the galactic potential described in Section~\ref{subsec:meth-pot}, Eq.~\eqref{eq:mw}, we first need to model the distribution of tracer particles in phase space. Rather than stochastically sampling the associated phase space distribution, we select particles from the different simulated galaxies as described below. To characterize how the efficiency of chaotic mixing varies as a function of galactocentric radius, we first select stellar particles located within a $15^{\circ}$ wedge, whose axis coincides with the disc semi-major axis. For these experiments we will focus only on the simulation dubbed Aq-C4. To increase the numerical resolutions we include stellar particles located within diametrically opposed wedges. Within these wedges, with vertex in the galactic center, we consider star particles with $0.5 \lid r \lid 50.5$~kpc, where $r$ represents the galactocentric distance. Note that here we consider stellar particles born both in-situ and in accreted satellites. In addition, and to compare with the results presented in \citetalias{2015MNRAS.453.2830M}, we also select all DM particles that are located within a sphere of $2.5$~kpc radius, centred at $8$~kpc along the semi-major axis of the DM halo in the Aq-C4 simulation. Note that the disc scalelength in this simulation is similar to that of the MW. Thus, this region can be regarded as a solar neighbourhood-like volume. The larger number of DM particles, with respect to their stellar counterparts, allow us to characterize more robustly the efficiency of chaotic mixing within this relatively small volume. In Section \ref{subsubsec:relevance-6Au} we analyse the {\it Auriga} simulations to characterize how the stochasticity inherent to the process of galaxy formation can affect the fraction of chaotic orbits in solar neighbourhood analogs. Stellar particles located within a sphere of $5$~kpc radius are selected on each simulation. Note that the final scalelengths of our simulated galactic discs show a great diversity. Thus, in order to select regions with the same density contrast, the spheres are centred at galactocentric distances of $2.65\times\epsilon^{\rm s}_{\rm Au-i}$, where $2.65$ is the ratio between the Sun's galactocentric distance ($\sim 8$~kpc) and the scalelength of the MW disc ($\sim 3$~kpc), and $\epsilon^{\rm s}_{\rm Au-i}$ being the $\epsilon^{\rm s}_{{\rm disc}}$ for the simulated galaxy in simulation Au-i. \subsection{Chaos Indicator: The Orthogonal Fast Lyapunov Indicator} \label{subsec:meth-ind-OFLI} In this work we use the Orthogonal Fast Lyapunov Indicator, OFLI \citep[][]{2002CeMDA..83..205F}, to quantify and characterize the fraction of chaotic orbits within different phase space volumes. Here we briefly describe the method and refer the reader to \citetalias[][and references therein,]{2015MNRAS.453.2830M} for further details\footnote{Note that this study is supported by similar results based on other CI, the MEGNO \citep[see for instance][]{2000A&AS..147..205C,2003PhyD..182..151C,2005ApJ...619.1084G,2012CeMDA.112...75C,2016LNP...915..93C}. The orbital classification obtained with the approximate galactic potential, described in Section~\ref{subsec:meth-pot}, is thus robust. Nonetheless, for the sake of brevity, the results based on the MEGNO are not included. For a thorough discussion on the advantages and disadvantages of the most popular CIs found in the literature we refer the reader to \citet{2011IJNLM..46...23M,2011CeMDA.111..285M,2012IJBC...2230033D,2013MNRAS.429.2700M,2016LNP..915.....S} and references therein.}. The basic idea behind the OFLI is to track the time evolution of the distortion of an initially infinitesimal local phase space volume surrounding any given orbital initial condition. The rate at which this volume expands along the direction of maximum distortion can be used to identify chaos. In practice, we follow the time evolution of a unit deviation vector $\mathbf{\hat{w}}(t)$, evolving on an $N$-dimensional Hamiltonian $\mathcal{H}$ along a given solution of the equations of motion (i.e. the orbit) $\gamma(t)$. The vector $\mathbf{\hat{w}}(t)$ is initially chosen normal to the energy surface \citep[in order to avoid spurious structures, see][]{2016LNP...915..55B} and, as it evolves, we take its orthogonal component to the flow, $\hat{w}(t)^{\perp}\in\mathbb{R}$. Its largest value ($\sup$, or minimum upper bound) between an initial time $t_0$ and a stopping time $t_f$ is retained. The OFLI is then defined as: \begin{equation} \mathrm{OFLI}^{\gamma}(t_f)=\sup_{t_0<t<t_f}\left[\hat{w}(t)^{\perp}\right]\ , \end{equation} for the orbit $\gamma$. For both chaotic and non-periodic regular orbits, the value of the $\mathrm{OFLI}^{\gamma}$ tends to infinity as time increases. However, on a logarithmic time-scale, the $\mathrm{OFLI}^{\gamma}$ presents and exponential growth for chaotic orbits , while it is linear for resonant and non-resonant regular orbits (with different rates). In the case of periodic orbits, it oscillates around a constant value \citep[for further details we refer the reader to][]{2002CeMDA..83..205F}. From now on, we integrate the orbits and compute the preferred CI using the {\sc lp-vicode} code \citep[see][]{2014A&C.....5...19C}. The numerical integrator conserves energy to an accuracy of one part in $10^{-12}$ or less for all the experiments throughout the paper. \subsection{Orbital classification} \label{orbitalclassification} As discussed in \citetalias{2015MNRAS.453.2830M}, the local spatial density of a star moving on a chaotic orbit decreases exponentially with time. Stellar streams moving on these orbits experience a rapid phase space mixing process, thus eroding signatures of past accretion events. In contrast, the local density of a star moving on a regular orbit falls with time as a power law, with an exponent less than or equal to $3$ \citep[a significantly lower rate,][]{1999MNRAS.307..495H,2008MNRAS.385..236V,2013MNRAS.436.3602G}. The chances of finding stellar streams in the solar neighbourhood are thus higher if they are evolving on regular orbits. In \citetalias{2015MNRAS.453.2830M} we presented an analysis that highlighted the very strong connection between the time evolution of the local (stream) density around a given particle and the time evolution of the corresponding OFLI. More precisely, we showed that if the OFLI grows linearly (i.e. regular behaviour), then the associated local density decreases as a power law, with index less than or equal to $3$. An exponential growth of the OFLI, instead, reflects an exponential decay of the corresponding local density. To characterize the impact of chaotic mixing on the different local phase space distributions, we proceed as in \citetalias{2015MNRAS.453.2830M}. We examine two central aspects associated with chaotic mixing efficiency: {\it (i)} the distribution of chaos onset times, i.e. the time at which a given orbit starts to showcase its chaotic behaviour, and {\it (ii)} the chaotic mixing diffusion rate, a mechanism that can lead to a significant drift in the integrals of motion space. To tackle {\it (i)}, we compute the time evolution of the OFLI of stellar and DM particles located within different local volumes (see Section~\ref{subsec:meth-init}), by integrated the orbits for a maximum period of 1000~Gyr. We use such a long timespan to identify very sticky orbits reliably (see below). We then classify as chaotic orbits those that show chaos onset times smaller than 10~Gyr; i.e. approximately within a Hubble time. Orbits that showcase their chaotic behaviour on time-scales larger than a Hubble time are classified as sticky orbits. Note that the later should not be associated with the concept of weakly chaotic orbits. Sticky orbits are orbits that behave as regular for long periods of time, with their associated local stream densities evolving as a power-law until they reach the chaotic sea. Instead, weakly chaotic orbits behave like chaotic orbits right from the beginning, with local stream densities evolving exponentially, albeit with a very small exponent. Orbits that never showcase chaotic behaviour are classified as regular. These threshold-dependent definitions are arbitrary. However, based on them it is possible to isolate orbits which are likely to showcase chaotic behaviour within relevant and physical periods of time from those in which chaos is clearly irrelevant (see \citetalias{2015MNRAS.453.2830M} for further details). To address {\it (ii)}, we quantify the diffusion of pseudo-integrals of motion for large ensembles of initially nearby test particles in phase space. \section{The actual relevance of chaos in multicomponent triaxial potentials} \label{sec:relevance} The OFLI allow us to robustly characterize the time evolution of the local (stream) density around any stellar particle (as shown in \citetalias{2015MNRAS.453.2830M}). In what follows, we use this tool to quantify the fraction of particles, located within different volumes, that are moving on regular, sticky and chaotic orbits. A large fraction of chaotic orbits would indicate that substructure in phase-space, specially those associated with the oldest accretion events, may have been efficiently erased due to chaotic mixing. This is especially relevant for the inner galactic regions, such as the solar neighbourhood, due to the much shorter dynamical time-scales associated with the corresponding orbits. \subsection{The distribution of chaos onset times as a function of galactocentric distance} \label{subsec:relevance-dist} In this section we focus on the stellar particles located within $15^{\circ}$ wedges (see Section~\ref{subsec:meth-init}), extracted from the simulation Aq-C4. The corresponding distribution of initial conditions is dissected in bins of different galactocentric distances. Each bin covers a different (non-overlapping) galactocentric distance range of 5~kpc and contains at least of the order of 500 stellar particles. In order to compute the OFLI, we integrate the equations of motion together with the first variational equations (see the Appendix in \citetalias{2015MNRAS.453.2830M}), assuming an analytic and static MW potential of the form given by Eq.~\eqref{eq:mw}, i.e.: \begin{equation} \Phi_{\rm MW}^{\rm C4} = \Phi_{\rm nuc}+\Phi_{\rm bul}+\Phi_{\rm disc}+\Phi_{\rm DM2}\ , \label{eq:aqc4a} \end{equation} denoted as model C4 (see Section~\ref{subsec:meth-pot} for further descriptions of each component). The values of the parameters are given in Tables~\ref{table:t1} and~\ref{table:t2}. To describe the shape of this potential, we use the triaxiality parameter \citep[][]{1991ApJ...383..112F}, \begin{equation} T=\frac{1-(b/a)^2}{1-(c/a)^2}\ . \end{equation} The shape of the DM halo can be characterized as mainly oblate for values of $0\lid T < 0.333$, strongly triaxial for $0.333\lid T\lid 0.666$, and mainly prolate for $0.666 < T\lid 1$. The principal axes ratios in the inner parts ($r\la r_s$) of the corresponding DM halo are computed using DM particles located within the first 10~kpc. Then, the triaxiality of the Aq-C4 halo in the inner regions is $T_{\rm inner} \sim 0.227$ (an oblate shape). For the outer parts ($r\gg r_s$) the principal axes ratios are computed using DM particles located within 40 and 70~kpc. The triaxiality parameter here is $T_{\rm outer} \sim 0.681$ (a mildly prolate shape). \begin{table*} \centering \caption{Parameters of the components for the C4 and the six {\it Auriga} MW models. The first column labels the model. From left to right, the columns give: the mass, $M_{\rm bul}$, and the scalelength radius, $\epsilon^{\rm s}_{\rm bul}$, of the bulge; the mass, $M_{\rm disc}$, the scalelength radius, $\epsilon^{\rm s}_{\rm disc}$, and the scaleheight radius, $\epsilon^{\rm h}_{\rm disc}$, of the disc; the distance from the Galactic centre where the solar neighbourhood-like sphere is located, $R_{\rm sph}$ ($2.65\times\epsilon^{\rm s}_{\rm disc}$); the intermediate-to-major, $b/a$, and the minor-to-major, $c/a$, principal axes ratios in the inner parts as well as $b'/a'$ and $c'/a'$, the corresponding principal axes ratios in the outer parts; the triaxiality parameter for the inner ($T_{\rm inner}$) and the outer ($T_{\rm outer}$) regions.} \label{table:t2} \begin{tabular}{@{}lcccccccccccc} \hline Name & $M_{\rm bul}$ & $\epsilon^{\rm s}_{\rm bul}$ & $M_{\rm disc}$ & $\epsilon^{\rm s}_{\rm disc}$ & $\epsilon^{\rm h}_{\rm disc}$ & $R_{\rm sph}$ & $b/a$ & $c/a$ & $b'/a'$ & $c'/a'$ & $T_{\rm inner}$ & $T_{\rm outer}$\\ & [$10^{10}$~M$_{\odot}$] & [kpc] & [$10^{10}$~M$_{\odot}$] & [kpc] & [kpc] & [kpc] &&&&&&\\ \hline C4 & 0.47 & 0.84 & 5.96 & 3.12 & 0.3 & 8 & 0.99 & 0.94 & 0.92 & 0.88 & 0.227 & 0.681\\ Au-3 & 4.10 & 1.51 & 4.29 & 7.50 & 0.3 & 19.875 & 0.998 & 0.926 & 0.976 & 0.935 & 0.022 & 0.379\\ Au-6 & 1.37 & 1.30 & 3.22 & 4.53 & 0.3 & 12.005 & 0.996 & 0.922 & 0.953 & 0.899 & 0.055 & 0.477\\ Au-15 & 0.79 & 0.90 & 2.74 & 4 & 0.3 & 10.06 & 0.996 & 0.93 & 0.976 & 0.94 & 0.057 & 0.419\\ Au-16 & 2.20 & 1.56 & 3.57 & 7.84 & 0.3 & 20.776 & 0.999 & 0.944 & 0.999 & 0.949 & 0.023 & 0.021\\ Au-19 & 2.02 & 1.02 & 2.88 & 4.31 & 0.3 & 11.422 & 0.989 & 0.931 & 0.964 & 0.907 & 0.160 & 0.399\\ Au-21 & 3.48 & 1.36 & 3.86 & 4.93 & 0.3 & 13.065 & 0.995 & 0.943 & 0.99 & 0.961 & 0.083 & 0.251\\ \hline \end{tabular} \end{table*} The orbits of the stellar particles are integrated over a 1000~Gyr timespan, with a timestep of $1$ Myr\footnote{An integration timestep of $10^{-2}$ Myr for a total integration time of $10$~Gyr was also used in order to check numerical convergence: no changes were found in the results.}. The orbits of the particles are then classified according to the shape of their OFLI time evolution curves following the procedure presented in \citetalias{2015MNRAS.453.2830M} and revisited below. As an example, and to demonstrate our method, we first show in Fig.~\ref{fig:3} the time evolution of the OFLI for a subset of 4410 DM particles located within a solar neighbourhood-like volume (the same subset will be use in next section)\footnote{We advise the readers affected with the common form of red-green color blindness to convert the paper in a grayscale format to distinguish the chaotic from the sticky components in the figures thorough the manuscript.}. It is clear that, for some orbits, the OFLI quickly diverges exponentially, whereas for others it continues to grow slowly following a power-law in time. For large samples of orbits, such as those shown in Fig.~\ref{fig:3}, individually inspecting each curve to estimate the chaos onset times (time at which the OFLI starts to diverge exponentially) becomes unfeasible. We address this by introducing a time evolving threshold value, which essentially is an upper limit for the typical linear behaviour of the OFLI seen in regular orbits. This threshold, indicated with a blue solid line in Fig.~\ref{fig:3}, evolves linearly with time and envelopes all the curves that present a linear behaviour. Particles are classified as either sticky or chaotic as soon as their corresponding OFLI crosses this threshold. Note that threshold crossings within the first Gyr of evolution are neglected as this period corresponds to the typical transient stage of the indicator. Chaotic orbits are defined as those which cross the threshold within the first 10~Gyr of their evolution. This 10~Gyr {\it barrier} is depicted in Fig.~\ref{fig:3} by a vertical dashed blue line. In a handful of cases we find that, even though the OFLI crossed the threshold at an early stage, it later continued to evolve linearly with time. Thus, the fraction of chaotic orbits within each volume may be slightly overestimated. In other words, our procedure provides conservative estimates. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig4.png}\\ \end{tabular} \end{center} \caption{Time evolution of the OFLI for 4410 DM particles considered for the MW model C4 and within an interval of time long enough to identify very sticky orbits (1000~Gyr). The upper limit used as a threshold for regular motion is shown with a blue solid line. The 10~Gyr threshold used to isolate sticky from chaotic orbits is shown with a vertical dashed-blue line. The three orbital components, i.e. regular, sticky and chaotic, can be clearly distinguished by using the OFLI with both simple thresholds. Notice the logarithmic time-scale.} \label{fig:3} \end{figure} The results of this procedure are presented in Fig.~\ref{fig:adeterminar}, where we show the fraction of regular (black solid squares), sticky (green open squares) and chaotic (red open dots) orbits, as a function of the mean galactocentric distance of the corresponding bin. We find that the fraction of regular orbits shows a very mild decrease as we move from the inner to the outer galactic regions, with orbital fractions in between $\sim37$ and $\sim53$~per cent. A more significant galactocentric distance dependence is shown by sticky and chaotic orbits, with orbital fractions varying from $20$ to $55$~per cent and $30$ to $5$~per cent, respectively. Note that sticky and chaotic orbits show approximately a specular behaviour. Due to the longer dynamical time-scales associated with the outer galactic regions, clearly the fraction of chaotic orbits that exhibits their chaotic behaviour within a Hubble time becomes progressively smaller. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig5.pdf}\\ \end{tabular} \end{center} \caption{Orbital type distribution as a function of the bin mean galactocentric distance value for MW model C4. Stellar particles on chaotic orbits remain bounded under $\sim27.45$~per cent at all galactocentric distances and below $\sim17.51$~per cent if the innermost bin is removed.} \label{fig:adeterminar} \end{figure} Mainly, we find that, at all galactocentric distances $\approx 70$ -- $95$~per cent of the orbits show a regular behaviour within a Hubble time (i.e. regular + sticky orbits by our definitions), with associated local stream densities that decrease as a power law rather than the much faster exponential decay associated with chaos. At the location of the Sun (bin enclosed between 5.5 and 10.5~kpc, i.e. centered at 8~kpc), this fraction takes a value of $\gtrsim 80$~per cent. Comparison with the results presented in \citetalias{2015MNRAS.453.2830M} (where only $\la20$~per cent of orbits could experience chaotic mixing) suggest that considering a multicomponent potential, including a central super massive black hole, a bulge, an axisymmetric disc and a double triaxial DM halo, does not significantly enhance the relevance of chaos within a Hubble time. We will further explore this in the following sections. \subsection{The relevance of baryons} \label{subsubsec:relevance-C45} In the previous section we have shown that, under the particular set up used for the multicomponent Galactic potential, the fraction of orbits exhibiting chaotic behaviour within a Hubble time is small in a solar neighbourhood-like volume ($\la$ 20~per cent). In this section we will explore whether different configurations of the baryonic components affect this result. To increase the numerical resolution, in these experiments we will analyse the orbits of the $\approx 4400$ DM particles enclosed within a 2.5~kpc sphere centred 8~kpc from the Galactic center of the C4 model (see Sec. \ref{subsec:meth-init}) The orbits of this subset of DM particles are first integrated in a Galactic potential that only considers the double triaxial DM halo, i.e., \begin{equation} \Phi^{\rm C4}_{\rm MW}=\Phi_{\rm DM2}\ . \end{equation} We will use this result as a reference to contrast against the results obtained when the different baryonic components of the potential are introduced. Recall that, as discussed in Section~\ref{subsec:meth-pot}, the fraction of chaotic orbits expected after integrating initial conditions that are not self-consistent with the Galactic potential are larger than what would be obtained from the corresponding self-consistent model\footnote{Note that this holds true as long as the number of isolating integrals of motion in the non self-consistent potential is the same as in the self-consistent case.}. The fraction of regular, sticky and chaotic orbits in this experiment are $76$, $23.4$ and $0.6$~per cent, respectively. It is evident that the fraction of chaotic orbits within a Hubble time is negligible for this potential. In \citetalias{2015MNRAS.453.2830M} we estimated the fraction of chaotic orbits within solar neighbourhood-like volumes extracted from the {\it Aquarius} DM-only simulations. In particular, for the DM-only version of the simulation analysed in this section, the fraction of regular, sticky and chaotic orbits found were $31.6$, $46.6$ and $21.8$~per cent, respectively. It is clear that the inclusion of baryons in the Aq-C4 simulation resulted in a significant reduction of the chaotic orbits within solar neighbourhood-like volumes. As can be seen from \citet[figure 8]{2016MNRAS.458.1559Z}, where the shape of the main DM halo of the DM-only and hydro simulations are compared as a function of galactocentric distance, the addition of baryons strongly reduces the triaxiality within the inner galactic regions. We now integrate the same subset of orbits, now including in the Galactic potential the two main baryonic components, i.e., \begin{equation} \Phi^{\rm C4}_{\rm MW}=\Phi_{\rm bul}+\Phi_{\rm disc}+\Phi_{\rm DM2}\ . \label{eq:aqc4b-3} \end{equation} The fractions of regular, sticky and chaotic orbits are $50.5$, $34.1$ and $15.4$~per cent, respectively. Note that the fraction of chaotic orbits has significantly increased with the inclusion of these two components. This result shows that, while the asymmetry of the DM halo inner parts is the source of chaos for stellar halo particles in this solar neighbourhood-like volume, the bulge-disc pair plays a significant role in amplifying the occurrence of chaotic motion. As we show in what follows, this is due to a significant enhancement of the asymmetry between the inner and outer Galactic potential. To study the impact of these chaos amplifiers, we repeat the latter experiment, now varying the masses of both baryonic components while keeping the total mass of the pair constant. The results are shown in Fig.~\ref{fig:bd_frac}, where $D/T$ is the disc to total baryonic mass fraction. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig6.pdf}\\ \end{tabular} \end{center} \caption{Orbital type distribution as a function of the disc to total baryonic mass fraction ($D/T$). The fraction of DM particles on chaotic orbits is always smaller than $\sim16$~per cent.} \label{fig:bd_frac} \end{figure} Comparison with the result obtained considering the potential given by Eq.~\eqref{eq:aqc4b-3}, shows that associating all the baryonic mass to the galactic bulge ($D/T=0$) results in a reduction of the fraction of sticky and chaotic orbits; $11.6$ and $3.5$~per cent, respectively. The addition of this massive spherical bulge component, which dominates the potential in the inner Galactic region, reduces the impact of the inner triaxial shape of the underlying DM halo on the orbital distribution. Interestingly, as the values of $D/T$ increase, both chaotic and, more strongly, sticky orbital fractions increase. While the fraction of chaotic orbits reaches a maximum of $\sim 16$~per cent for values of $D/T \gtrsim 0.3$, the fraction of sticky orbits continues to grow to values of $\sim35$ percent at $D/T=1$ (all the baryonic mass is associated to the disc). As opposed to the spherical bulge, the disc strongly amplifies the effects of this mild oblateness of the inner triaxial DM halo potential. The minimum fraction of regular orbits is found for values of $D/T = 1$, i.e. $50.4$~per cent. None the less, it is important to highlight that, despite the redistribution of the baryonic mass in the pair bulge-disc, the fraction of orbits that exhibits a chaotic behaviour within a Hubble time is always smaller than $\sim16$~per cent. In the next section we characterize the impact that different galactic formation histories may have on our chaotic orbital fraction estimates. \subsection{The impact of formation history} \label{subsubsec:relevance-6Au} In the previous section we showed that, even though the inclusion of the baryonic component in our simulated Galaxy results in a reduction of the triaxiality of the inner DM halo, the addition of the disc enhances the asymmetry between the inner ($r \la r_{s}$) and the outer overall Galactic potential $(r > r_{s})$. As a consequence, the fraction of chaotic orbits remains consistent with that obtained from strongly triaxial DM potentials associated with DM-only simulations. Our results were based on a single numerical model, namely C4. Thus, in this section we will explore whether differences in shapes and masses of the different galactic components, originating as a consequence of different formation histories, have an effect on our previous results. As discussed in Section~\ref{subsec:meth-sim}, here we consider a subset of six simulations from the {\it Auriga project}. Recall that our analytic Galactic potentials do not account for the effect of Galactic bars. Thus, these simulations were selected to not show strong bars at $z = 0$. The Galactic potential of each {\it Auriga} galaxy is modelled considering Eq~\ref{eq:mw}. The values of the parameters that describe the potentials are given in Tables~\ref{table:t1} and~\ref{table:t2}. With these parameter sets, a good agreement between the analytic and the numerical velocity curves of the models is obtained. Comparison between the triaxiality of the inner and outer DM haloes reveals a significant diversity in the asymmetric shape of this Galactic component. From each simulated Galaxy, stellar particles located within a sphere of 5~kpc radius centred at a distance of $2.65\times\epsilon^{\rm s}_{\rm Au-i}$ are selected (see Sec.~\ref{subsec:meth-init}). Since we are interested in studying the efficiency of chaotic mixing in erasing local signatures of accretion events, in this section we will only consider accreted stellar particles (i.e. stellar particles that were born within the potential wells of accreted satellite galaxies). Note however that our results are not significantly modified when in-situ stellar populations are taken into account. As before, orbits are integrated for 1000~Gyr, with an integration timestep of $1$ Myr. The results of this analysis are summarized in Fig.~\ref{fig:auriga_frac} where we show with a normalized histogram and for each {\it Auriga} Galaxy model, the fraction of regular (black), sticky (green) and chaotic (red) orbits. The model with the smallest fraction of regular orbits is Au-19 ($\sim 53.2$~per cent). Interestingly, this model contains the most triaxial DM halo among the {\it Auriga} galaxies, with inner and outer triaxiality parameters (defined using the inner and outer principal axial ratios) of $T_{\rm inner} = 0.160$ and $T_{\rm outer} = 0.399$, respectively. On the other hand, the {\it Auriga} model with clearly the largest fraction of regular orbits is Au-16. Its associated DM halo potential has a nearly perfect oblate shape, with triaxiality parameter values in the inner and outer regions of $T_{\rm inner} \sim T_{\rm outer} \sim 0.02$. \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig7.pdf}\\ \end{tabular} \end{center} \caption{Orbital type distribution for the six {\it Auriga} models. The fraction of accreted stellar particles on chaotic orbits is highest for model Au-19, $\sim16.6$~per cent.} \label{fig:auriga_frac} \end{figure} As expected, the fraction of regular orbits in each potential shows a dependence on the degree of asymmetry of the corresponding DM halo. This is more clearly seen in Fig.~\ref{fig:tri_frac}, where we show the fraction of regular (black solid squares), sticky (green open squares) and chaotic (red open dots) orbits in each {\it Auriga} model, as a function of an average triaxiality parameter, $T_{\rm mean} = (T_{\rm inner} + T_{\rm outer}) / 2$. Notice how the fraction of regular orbits steadily decreases as $T_{\rm mean}$ increases. This highlights that once the bulge-disc pair is taken into account, for values of $D/T \gtrsim 0.3$, the dominant factor determining the fraction of regular orbits is the overall triaxiality of the underlying DM halo. \emph{None the less, in all cases, and independently of the properties of the analysed potential models, we find that the fraction of orbits exhibiting a chaotic behaviour within a Hubble time is smaller than $17$~per cent. } \begin{figure} \begin{center} \begin{tabular}{c} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig8.pdf}\\ \end{tabular} \end{center} \caption{Orbital type distribution as a function of an average triaxiality parameter ($T_{\rm mean}$). The fraction of stellar particles on chaotic orbits is always smaller than $17$~per cent.} \label{fig:tri_frac} \end{figure} \section{Global dynamics and diffusion} \label{sec:diffusion} As shown in the previous section, a small but non-negligible fraction of stellar halo particles in solar neighbourhood-like volumes could indeed exhibit chaotic mixing. This fraction is comparable to the one found in \citetalias{2015MNRAS.453.2830M}, but now taking into account the contribution from both the DM and baryonic components to the overall galactic potentials. In what follows we will discuss the extent to which such mixing can erase kinematic signatures of early accretion events within galactic regions such as the solar neighbourhood and physically relevant periods of time. In this direction, we give a theoretical framework and approximate the potential model as a near-integrable one, i.e. a fully integrable one plus a \textquotedblleft small'' perturbation in order to gain some insight on the expected result. Thus, by chaotic diffusion, roughly speaking, we mean the time variation of the prime integrals of the integrable potential when it is acted upon by a small non-integrable perturbation. \subsection{Approximating the galactic potential within solar neighbourhood-like regions} The potential $\Phi_{\mathrm{DM2}}$ given in Eq.~\eqref{eq:nfw_tri} in terms of the \textquotedblleft bi-triaxial'' radius defined in Eq.~\eqref{rpp} admits, for $r'_p<r_s$ (both quantities introduced in Section~\ref{subsubsec:dmcomp}), the power series expansion: \begin{equation} \Phi_{\mathrm{DM2}}=-\frac{A}{r'_s}\sum_{n=1}^{\infty}\frac{{(-1)}^{n+1}}{n} \left(\frac{r'_p}{r_s}\right)^{n-1}\ , \label{expansion} \end{equation} so it is analytic everywhere, and the condition $r'_p<r_s$ implies that $r < r_s$, which holds for local volumes around the Sun. Under the above assumption, the ratio $r'_p/r_s$ could be expanded as a power series and, retaining terms up to $r_i^2/r_s^2$ and $r_i\,r_o/r_s^2$, it can be written as: \begin{equation} \frac{r'_p}{r_s}\approx\frac{r_i}{r_s} \left(1+\frac{r_o-r_i}{r_s}\right)\ . \end{equation} Again, the relationship between these radii follows from their definitions given in Section~\ref{subsubsec:dmcomp}. Taking into account the values of the ratios of the principal axes describing the ellipsoidal inner and outer regions of the DM halo (MW model C4 in Table~\ref{table:t2}), we introduce the small parameters: \begin{align} \varepsilon_1 = \frac{a^2}{b^2}-1, &\quad \varepsilon'_1 = \frac{a'^2}{b'^2}-1\ ,\label{epsilon}\\ \varepsilon_2 = \frac{a^2}{c^2}-1, &\quad \varepsilon'_2 = \frac{a'^2}{c'^2}-1\ .\nonumber \end{align} Recalling that $a'\approx a\approx 1$ (1.07 and 1.02 respectively), introducing spherical coordinates $(r,\vartheta,\varphi)$, retaining terms up to $r'_p/r_s$ in Eq.~\eqref{expansion} and neglecting those of second order in the parameters defined in Eq.~\eqref{epsilon}, the quadrupolar approximation to Eq.~\eqref{expansion} takes the form: \begin{multline} \Phi_{\mathrm{DM2}}\approx \phi_{\mathrm{DM2}}^0(r) + V(r)\,\{\alpha_1(r)\cos2\vartheta+\alpha_2(r)\,[\,\cos2\varphi-\\ 0.5 \cos2(\vartheta+\varphi)- 0.5 \cos2(\vartheta-\varphi)\,]\}\ , \end{multline} where \begin{eqnarray} \Phi_{\rm DM2}^0(r)&=&\frac{Ar}{2r^2_s}\left[1+\frac{\varepsilon_1}{8}+\frac{\varepsilon_2}{4}+ \frac{r}{4r_s}\left(\frac{\delta\varepsilon_1}{2}+\delta\varepsilon_2\right)\right],\\ V(r)&=&\frac{Ar}{8r_s^2}\ ,\\ \alpha_1(r)&=&\varepsilon_2-\frac{\varepsilon_1}{2}+\frac{r}{r_s}\left(\delta\varepsilon_2-\frac{\delta\varepsilon_1}{2}\right)\ ,\\ \alpha_2(r)&=&-\frac{1}{2}\left(\varepsilon_1+\frac{r}{r_s}\delta\varepsilon_1\right)\ , \end{eqnarray} with $\delta\varepsilon_i=\varepsilon'_i-\varepsilon_i$, the amplitudes $\alpha_s$ are then assumed to be small. As far as our analysis concerned, the contribution of the disc component, Eq.~\eqref{eq:discMN}, to the overall potential is essentially spherical due to the smallness of the $z$-values around the position of the Sun. Then, neglecting terms of $\mathcal{O}(z^2/r^2)$, it can be well approximated by the expression: \begin{equation} \Phi_{\rm disc}^0(r)=-\frac{D}{\sqrt{r^2+\left(\epsilon^{\rm s}_{\rm disc}+\epsilon^{\rm h}_{\rm disc}\right)^2}}\ . \end{equation} As we have already mentioned (Section~\ref{subsec:meth-pot}), the exponential disc is approximated with the superposition of three different MN models, so the above approximation still holds in case of an exponential profile. Summarizing, the central part of the Galactic potential can be written as: \begin{equation} \Phi_{\rm MW}^0=\Phi_{\rm nuc}+\Phi_{\rm bul}+\Phi_{\rm disc}^0+\Phi_{\rm DM2}^0\ , \end{equation} which yields the following expression for the total (approximated) potential: \begin{multline} \Phi_{\rm MW}(r,\vartheta, \varphi) \approx \Phi_{\rm MW}^0(r)+ V(r)\{\alpha_1(r)\cos2\vartheta+\alpha_2(r)\,[\cos2\varphi-\\ 0.5 \cos2(\vartheta+\varphi)-0.5 \cos2(\vartheta+\varphi)]\}\ . \label{phi_app} \end{multline} In Eq.~\eqref{phi_app} the angular dependence of the potential, at this order, only comes from the DM halo. In \citetalias{2015MNRAS.453.2830M} we have already provided a theoretical background for chaotic diffusion, so here we restrict the discussion to this model. The Hamiltonian associated to Eq.~\eqref{phi_app} can be written as: \begin{equation} \mathcal{H}(\mathbf{p},\mathbf{r})=\mathcal{H}_0(\mathbf{p},r,\vartheta)+\hat{\Phi}_1(\mathbf{r})\ , \end{equation} with \begin{equation} \mathcal{H}_0(\mathbf{p},r,\theta)=\frac{p_r^2}{2}+\frac{p_{\vartheta}^2}{2r^2}+\frac{p_{\varphi}^2}{2r^2\sin^2\vartheta}+\Phi_{\rm MW}^0(r)\ , \end{equation} and \begin{multline} \hat{\Phi}_1(\mathbf{r}) = V(r)\{\alpha_1(r)\cos2\vartheta+\alpha_2(r)\,[\cos2\varphi-\\ 0.5\cos2(\vartheta+\varphi)-0.5 \cos2(\vartheta+\varphi)]\}\ , \end{multline} where \begin{equation} p_r=\dot{r},\qquad p_{\vartheta}=r^2\dot{\vartheta}\ ,\qquad p_{\varphi}=r^2\dot{\varphi}\sin^2\vartheta\ . \end{equation} Therefore, $\mathcal{H}_0$ is an integrable Hamiltonian, since: \begin{equation} \mathcal{H}_0=\mathrm{E}_0\ ,\qquad L_z= p_{\varphi}\ ,\qquad L^2=p_{\vartheta}^2+p_{\varphi}^2\csc^2\vartheta\ , \end{equation} are the three global integrals, while $\hat{\Phi}_1$ can be considered as a {small} perturbation. The terms in $\hat{\Phi}_1$ that depend on $(\vartheta, \varphi)$ break the spherical symmetry leading to variations in the modulus of the total angular momentum and its $z$-component: \begin{eqnarray} \frac{dL^2}{dt}&=&[L^2,\mathcal{H}]= -2p_{\vartheta}\frac{\partial \hat{\Phi}_1}{\partial\vartheta}-\frac{2p_{\varphi}}{\sin^2\vartheta}\frac{\partial \hat{\Phi}_1}{\partial\varphi}\ ,\\ \frac{dL_{z}}{dt}&=&[L_z,\mathcal{H}]= -\frac{\partial\hat{\Phi}_1}{\partial\varphi}\ , \end{eqnarray} which are of order $\alpha_s$. These small variations of $|L|$ and $L_z$ within chaotic domains would lead to chaotic diffusion. For instance, in those regions where stickiness is strong, the changes $\Delta |L|$, $\Delta L_z$ over a given timespan $T$ would be very small and thus, though the dynamics is chaotic, almost stability can be assumed for time-scales $\tau\sim T$. Instead, in other domains of phase space, large values of $\Delta |L|$ and $\Delta L_z$ could be observed over the same timespan, diffusion becoming significantly faster so that chaotic mixing would be efficient over $\tau\la T$. In other words, chaos is a necessary but not sufficient condition for diffusion. Therefore, diffusion experiments would be required to obtain reliable information about the stable/unstable character of the motion within chaotic domains, as shown, for instance, in \citetalias{2015MNRAS.453.2830M} and in \cite{2016MNRAS.460.1094M}, for the case of planetary dynamics. Notice that the approximation to the galactic potential given by Eq.~\eqref{phi_app} is derived and used just for the theoretical discussion regarding chaotic diffusion delivered in the next section. \subsection{The actual relevance of chaotic diffusion} \label{subsec2:diffusion} In this direction, we accomplish a global picture of the dynamics in the angular momentum space by computing a dynamical indicator for a large set of initial conditions around the position vector of the Sun $\mathbf{x}_{\odot}$ and on a given energy surface. For this purpose, and adopting $(x_\odot,y_\odot,z_\odot)=(8,0,0)$~kpc, we take the mean value of the energy distribution of the $1171$ stellar particles located within a $15^{\circ}$ wedge, oriented along the disc semi-major axis and with galactocentric distances between 5.5 and 10.5~kpc (second bin, centered at 8~kpc in Fig.~\ref{fig:adeterminar}) in the Aq-C4 simulation (see also Section~\ref{subsec:meth-init} for further details on the initial distribution of the conditions), namely $\langle \mathrm{E}\rangle = h\simeq -164803$ km$^2$ s$^{-2}$ (such energy surface is computed with our analytic and static representation of the galactic potential). Then we sample a domain in the $(|L|,L_z)$ plane with a grid chosen such that, in both dimensions, nearly $80$~per cent of the corresponding stellar particles are encompassed (notice that actually, for the sake of symmetry, only the $\approx 40$~per cent in the $L_z$-direction needs to be accounted for). Fig.~\ref{fig:angular-momentum} displays in red the region on the $(|L|,L_z)$ plane considered for the current dynamical study, and also shows, as black dots, the values corresponding to the Aq-C4 stellar particles. \begin{figure} \begin{center} \hspace{-5mm}\includegraphics[width=1\linewidth]{fig9.png} \end{center} \caption{Ranges in $|L|$ and $L_z$ for the whole set of $1171$ stellar particles (black dots) of the Aq-C4 simulation. In red, we highlight the areas of the plane considered in the experiments.} \label{fig:angular-momentum} \end{figure} The left panel of Fig.~\ref{fig:404} displays an OFLI map for a grid of $121224$ equidistant initial conditions in the plane $(\log(L^2),L_z)$ which have been integrated over a timespan of $10$~Gyr in order to obtain the concomitant value of the chaos indicator. The solid black line in the colour bar shows the threshold used to distinguish regular from chaotic motion. In general, cool colours represent regular motion whereas warmer ones indicate chaotic motion. \begin{figure*} \begin{center} \begin{tabular}{cc} \hspace{-5mm}\includegraphics[width=0.5\linewidth]{fig10.png}& \includegraphics[width=0.5\linewidth]{fig11.png} \end{tabular} \end{center} \caption{OFLI maps for $10$ (left panel) and $100$ (right panel) Gyr for the C4 MW model for $(x_\odot, y_\odot,z_\odot)=(8,0,0)$ and $\hat{h}\simeq -164803$ km$^2$ s$^{-2}$. The solid black lines in the colour bars show the threshold used to distinguish regular from chaotic motion. Warm colours indicate chaotic motion while cool colours represent regular motion. The Arnold web is mostly unveiled and, as we can see from the warm colours on the right panel, it covers a considerable domain in phase space.} \label{fig:404} \end{figure*} The resulting global dynamical portrait for this time-scale reveals the prevailing regular character of the motion in the angular momentum space. In fact, just a few invariant manifolds and narrow resonances are detected. Let us recall that the most relevant invariant manifolds separate different orbital families, the large resonance domains. Indeed, the region with smaller values of $|L|$ and $L_z$ corresponds to the box family while the tube orbital family has $|L|\gtrsim 1750\,\mathrm{kpc\,km\,s^{-1}}, L_z\gtrsim 1000\, \mathrm{kpc\,km\,s^{-1}}$. The light blue arc arising from $|L|\approx 1750\,\mathrm{kpc\,km\,s^{-1}},\, L_z = 0$ corresponds to the separatrix (actually the chaotic layer), that separates both orbital families. Meanwhile, rather small high-order resonances show up as thin channels all over the angular momentum space. This web of resonances is known as the Arnold web. In sum, notice should be taken that the phase space is mainly covered by regular orbits for the considered timespan. Consequently, chaos is almost irrelevant after an evolution of 10~Gyr, even though the perturbation is not negligible for the C4 MW model, being $\alpha_1\sim 0.1,\,\alpha_2\sim -0.03$ for local solar neighbourhood-like volumes. In this case, as already mentioned, the fraction of phase space corresponding to chaotic motion is small but non-negligible and amounts to $\simeq 25.57$~per cent. In order to detect any diffusive phenomena or chaotic mixing in the present model, a larger time-scale should be considered. Therefore, though without direct physical significance, we obtained the OFLI map corresponding to 100~Gyr, which is displayed in the right panel of Fig.~\ref{fig:404}. Such a map discloses chaotic motion that still appeared as regular at 10~Gyr, mainly due to stickiness. Indeed, the map reveals that the thin chaotic layer separating box and tube families already discussed, now at 100~Gyr appears wider with large OFLI values, depicted in red. Moreover other resonances also show up as highly chaotic and the Arnold web is seen to occupy a considerable region in phase space which amounts to almost $60$~per cent of the integrated orbits. The presence of a connected chaotic region of noticeable size would forecast a secular variation of the unperturbed integrals $(|L|, L_z)$, which would lead to the uprising of fast diffusion. Let us say that we are also interested in determining the time-scale for chaotic diffusion to take place. Therefore, following a similar approach to that presented in \citetalias{2015MNRAS.453.2830M}, we investigate diffusion over the ($|L|,\, L_z$) plane, for a given energy surface, $\hat{h}$, within a small sphere in configuration space, $|\mathbf{x}-\mathbf{x}_{\odot}|<\delta$. In this way we reduce the motion to an almost two dimensional section defined by: \begin{equation} \mathcal{S}=\left\{(|L|,\, L_z)\,:\, |\mathbf{x}-\mathbf{x}_{\odot}|<\delta,\,\, \mathcal{H} = \hat{h}\right\}\ . \end{equation} For our diffusion studies, we take ensembles of $N_p=10^6$ tracer particles sampled uniformly in boxes of size $\sim10^{-6}$ in both $|L|$ and $L_z$. The centres of these boxes, whose highly chaotic nature has been revealed by the OFLI indicator are listed in Table~\ref{table:ens}. We integrate the equations of motion for each initial condition taking into account the full potential given by Eq.~\eqref{eq:aqc4a} over some timespan $T$, and every time the orbits of the ensemble intersect $\mathcal{S}$, we retain the corresponding values of $|L|(t)$ and $\, L_z(t)$. For ensembles located in stable regions both unperturbed integrals slightly vary, being $|\Delta |L|(t)|,\, |\Delta L_z(t)|\ll 1$, so that practically no evolution in the angular momentum plane should be observed. In fact, the small variations in $|L|,\, L_z$ arise as a consequence of the system being no longer spherical. For ensembles immersed in chaotic domains instead, if no barriers to diffusion are present, both unperturbed integrals are expected to change with time and the trajectory over $\mathcal{S}$ would provide an indication of actual diffusion. \begin{table} \centering \caption{Ensembles of $10^6$ initial conditions sampled uniformly in boxes of size $\sim10^{-6}$ in both $|L|$ and $L_z$, whose centres, given in the table, correspond to chaotic orbits. The units in $L$ and $L_z$ are $\mathrm{kpc\,km\,s^{-1}}$.} \label{table:ens} \begin{tabular}{@{}cll} \hline Ensemble & $|L|$ & $L_z$\\\hline (i) & $562$ & 500 \\ (ii) & $1122$ & 900 \\ (iii) & $1820$ & 50 \\ (iv) & $861$ & 50 \\ (v) & $1413$ & 700 \\ \hline \end{tabular} \end{table} Further, let us remark that the number of intersections of a given trajectory with $\mathcal{S}$ strongly depends on the stability of the motion. In fact, in the case of stable regular motion, since the orbit lies in a three dimensional torus, $\mathcal{S}$ is a slice of it and thus many crossings would occur. On the other hand, in the case of an unstable chaotic orbit, no tori structure exists and thus only a few intersections with $\mathcal{S}$ are expected. So much that in the considered ensembles, which correspond to highly chaotic motion, no crossings are observed during the first $20$~Gyr. Moreover, taking into account the sticky character of most orbits, long timespans should be considered. Indeed, such stickiness could vary for slightly different values of the model parameters, thus leading to rather different results. Therefore, in order to overcome the possible effect of sticky phenomena, long-term diffusion experiments have been carried out, which are described straight away. The top left panel of Fig.~\ref{fig:reg1_40} shows how ensemble (i) evolves with time in action space. Diffusion is seen to proceed along the stochastic layer separating box from tube orbits. Let us point out the geometrical resemblance of the observed diffusion with the one that would be expected from the Arnold's theoretical conjecture, which forecasts that diffusion would proceed through phase space along the chaotic layers of the full resonance web. However, and since the perturbation is not sufficiently small, the detected diffusion should be interpreted as a consequence of the resonances' overlap. Even though fast diffusion could take place in such a scenario, this event does not occur at all, as follows from our numerical experiments. \begin{figure*} \begin{center} \begin{tabular}{cc} \hspace{-5mm}\includegraphics[width=0.5\linewidth]{fig12.png}& \includegraphics[width=0.5\linewidth]{fig13.png}\\ \hspace{-5mm}\includegraphics[width=0.5\linewidth]{fig14.png}& \includegraphics[width=0.5\linewidth]{fig15.png}\\ \hspace{-5mm}\includegraphics[width=0.5\linewidth]{fig16.png}& \end{tabular} \end{center} \caption{Top left panel: diffusion over $40$~Gyr for ensemble (i) of initial conditions (depicted in green) superimposed on the Arnold web. Top right panel: diffusion over $40$~Gyr for ensemble (ii) of initial conditions (also depicted in green) superimposed on the Arnold web. The unperturbed integrals remain confined to a rather small domain, revealing that diffusion turns out to be mostly inefficient. Middle left panel: long-term diffusion over $70$~Gyr for ensemble (iii) of initial conditions (in green) overplotted on the Arnold web. Middle right panel: drift of the unperturbed integrals over $40$~Gyr for ensemble (iv) of initial conditions (in green) superimposed on the Arnold web. Bottom panel: long-term diffusion over $70$~Gyr for ensemble (v) of initial conditions (in green) overplotted on the Arnold web.} \label{fig:reg1_40} \end{figure*} To stress this fact we turn to the time evolution of ensemble (ii) shown in the top right panel of the same figure during $40$~Gyr. Therein, we recognize that the unperturbed integrals remain confined to a very small domain, even for a rather large timespan, diffusion neatly spreading over the unperturbed separatrix discriminating box from tube orbits. This still applies when far larger time-scales are considered. The wandering onto the resonance web of the unperturbed actions, $|L|$ and $L_z$ corresponding to the third ensemble is displayed in the middle left panel of Fig.~\ref{fig:reg1_40}. In this particular case, only three intersections with $\mathcal{S}$ are observed up to $40$~Gyr so that a larger timespan needs to be covered. Indeed, after $70$~Gyr we notice that diffusion advances along the outermost edge of the stochastic layer, near the bottom of the figure, and climbs up over the entangled assemblage of stable/unstable manifolds associated to different high order resonances. For ensemble (iv) instead, already at $40$~Gyr some variation of the unperturbed integrals is seen to occur, as the middle right panel of Fig.~\ref{fig:reg1_40} displays. For an even larger time-scale, say $70$~Gyr, the ramble in action space breaks through the innermost region of the resonance interweave. The bottom panel of Fig.~\ref{fig:reg1_40} shows how diffusion proceeds for the ensemble (v). The successive intersections of the trajectories with the section $\mathcal{S}$ in action space adroitly diffuse along the layer discriminating box from tube orbits, also after a rather long time-scale since up to $\sim 40$~Gyr no crossings take place. We should note that the considered ensembles, except for the one denoted by (iv), were picked up very close to the main unstable region, that is the chaotic layer that separates box from tube families. From the above results, it turns out that the largest variation of the integrals corresponds to ensemble (v), being $\Delta |L|\lesssim 800\, \mathrm{kpc\,km\,s^{-1}}$ over $\tau = 70$~Gyr so that a mean rate of variation could be estimated as $\Delta |{L}|/\tau \lesssim 11.5 \,\mathrm{kpc\,km\,Gyr^{-1}\,s^{-1}}$, which is actually rather small \citep[for instance, on the left panel of Fig.~7 in][a resolved stream is shown with a typical extension of more than $500\, \mathrm{kpc\,km\,s^{-1}}$ in $L_z$]{2013MNRAS.436.3602G}. \section{Discussion and conclusions} \label{sec:discussion} Stellar streams are the living records of galactic accretion events. Therefore, their identification as kinematically cold substructures is of key importance for galactic archaeology. Much effort has been devoted to locate such fossil signatures in the outer stellar halo, where typical dynamical time-scales are long enough to preserve this structure in a spatially coherent fashion. Several streams have indeed been identified and studied in great detail within these regions \citep{1994Natur.370..194I,2001ApJ...547L.133I,2001ApJ...551..294I,2001ApJ...548L.165O,2003MNRAS.340L..21I,2003ApJ...599.1082M,2006ApJ...637L..29B,2006ApJ...642L.137B,2007ApJ...658..337B,2007ApJ...668L.123M}\footnote{For a recent and very complete list of stellar streams in the Galactic halo we refer the reader to \citet[table 4.1]{2016ASSL..420...87G}.}. On the other hand, in the inner stellar halo, and particularly around the solar neighbourhood \citep[where information about the most ancient accretion events is expected to be stored,][]{2000MNRAS.319..657H,2008ApJ...689..936J,2010MNRAS.408..935G}, identifications of stellar streams are far less numerous, even though theoretical models predict hundreds of them \citep{1999MNRAS.307..495H,1999Natur.402...53H,2003MNRAS.339..834H,2006MNRAS.365.1309H}. Furthermore, the extragalactic origin of some of these substructures has not been proved conclusively yet \citep[see][for a full discussion and references therein]{2016ASSL..420..113S}. The ammount of substructure present in the solar neighbourhood's phase space distribution is subject to several factors. It has been often argued that the low identification rate may be mainly due to the lack of an accurate and large enough full phase space stellar catalog. Within 2018 {\it Gaia}--DR2 will be released and a robust quantification of substructure within the extended solar neighbourhood will become feasible for the first time. In addition to the previous astrometric limitations, another relevant factor playing a role for the quantification of stellar streams are the active sources of chaos, which can trigger chaotic mixing within relevant time-scales. As discussed in \citetalias{2015MNRAS.453.2830M}, thanks to the asymmetric nature of the underlying gravitational potential, a fraction of the local stellar streams is expected to be evolving on chaotic orbits. Chaos, in the Lyapunov sense, indicates exponential divergence of initially nearby orbits in phase space. Dynamical time-scales in the inner regions of the Galaxy are relatively short. Thus, a group of initially close-by stars in phase space, evolving on chaotic orbits, would experience a very rapid mixing. More importantly, regions filled with chaotic orbits can foster chaotic diffusion, which effectively erases the `dynamical memory' imprinted in all phase space and results in a smooth distribution function. The detection of stellar streams could be seriously threatened if such chaotic orbit are indeed very common \citep{2003ApJ...592L..63G,2015ApJ...799...28P,2016MNRAS.460..497H,2016MNRAS.455.1079P,2016ApJ...824..104P,2017MNRAS.470...60E}. In \citetalias{2015MNRAS.453.2830M} we explored whether chaos could indeed be playing a significant role in eroding substructure in the solar neighborhood phase space distribution. The experiments carried out in that work strongly suggested that this would not be the case. Only a very small fraction of the orbits within solar neighbourhood-like volumes exhibit chaotic behaviour within a Hubble time. Diffusion did not have enough time, even in those cases. However, that study was based on dark matter only simulations, which completely neglected the role of the baryonic component. In this second paper we re-examined the problem using a significantly more realistic set up to model the Galactic stellar halo. We used a suite of seven state of the art fully cosmological hydrodynamic zoom-in simulations of the formation of Milky Way-like galaxies (Section~\ref{subsec:meth-sim}), to extract values of the parameters that describe our analytic potential models and to sample realistic phase space distributions of different volumes. The Galactic potential was modelled with a new analytic and static representation: a multicomponent model that accounts for the effect of both the baryonic and dark matter components (Section~\ref{subsec:meth-pot}). We integrated the equations of motion, coupled with the first variational equations, using the different sets of cosmologically motivated initial conditions (Section~\ref{subsec:meth-init}) and computed, for each orbit, the Orthogonal Fast Lyapunov Indicator, OFLI (Section~\ref{subsec:meth-ind-OFLI}). This chaos indicator allowed us to robustly classify the orbits of our stellar and dark matter particles into three different components: regular, sticky and chaotic (Section~\ref{orbitalclassification}). Their distinction is of pivotal importance due to the fact that the time evolution of the rate at which the local (stream) density around such a given particle decreases is completely different. In case of regular orbits, they are associated with a rate that follows a power law in time, while chaotic orbits have an exponential one \citep[][and \citetalias{2015MNRAS.453.2830M}]{1999MNRAS.307..495H,2008MNRAS.385..236V,2013MNRAS.436.3602G}. Sticky orbits, on the other hand, are not so easily defined. They behave as regular orbits for a given period of time to change their orbital character afterwards. Following \citetalias{2015MNRAS.453.2830M}, we used an arbitrary but physically relevant period of time threshold to differentiate between sticky and chaotic orbits: 10~Gyr (roughly a Hubble time). Our results show that, at all galactocentric distances, $\approx 70 - 95$~per cent of the orbits considered show a regular behaviour within a Hubble time. In particular, around the location of the Sun this fraction takes an average value of $\gtrsim 80$~per cent (Section~\ref{subsec:relevance-dist} for details). This holds true independently of the way the total baryonic mass is re-distributed within the bulge-disc pair (Section~\ref{subsubsec:relevance-C45}) and, more importantly, the galactic formation history (Section~\ref{subsubsec:relevance-6Au}). The lowest percentages of chaotic orbits is obtained for models Au-16 and Au-21 ($\sim 2$ and $\sim9$~per cent, respectively), where the shape of the dark matter haloes is oblate across all their extension. We performed a detailed study of the efficiency of chaotic diffusion based on first order perturbation theory. The numerical experiments presented in Section~\ref{subsec2:diffusion} showed that diffusion, the most critical mixing process, has a time-scale that by far surpasses the Hubble time. As we find from our most diffusive experiments, the largest measure of the relative diffusion rate barely amounts to $\sim 0.01 \mathrm{Gyr}^{-1}$. Comparison with the results presented in \citetalias{2015MNRAS.453.2830M} suggests that considering a multicomponent representation of the galactic potential does not significantly enhance the relevance of chaos or chaotic diffusion in local halo stars within a Hubble time. Instead, we find evidence that there is a direct connection between the amount of chaos found in the local stellar halo and the triaxiality of the underlying dark matter halo. It remains to be studied whether an accurate estimation of the amount of chaotic motion in halo stars could be used to constrain the shape of the underling dark matter halo potential. Our results reinforce the idea that chaotic mixing is not a significant factor in erasing local signatures of accretion events, which is in very good agreement with previous theoretical predictions. However, fundamental caveats still persist and should be addressed in follow-up works. For instance, our models are a superposition of not only smooth but also static potentials, and substructure \citep[such as dark matter subhaloes:][]{2002MNRAS.332..915I,2009ApJ...705L.223C,2011ApJ...731...58Y,2015ApJ...808...15C,2015MNRAS.450.1136E,2015MNRAS.454.3542E,2016MNRAS.463..102E,2016ApJ...818..194N,2017MNRAS.470...60E} as well as time-dependence \citep[][and references therein]{2013JPhA...46y4017M,2014MNRAS.438.2201M,2016MNRAS.460..497H,2016MNRAS.458.3578M,2016MNRAS.461.3835M,2016ApJ...824..104P,2017MNRAS.470...60E,2017NatAs...1..633P} could enhance the efficiency of diffusion in phase space \citep{2013MNRAS.433.2576P}. It is worth noticing that sources of noise, such as scattering by short-scale irregularities, or periodic driving given by external coupling can, indeed, enhance the diffusion rate of sticky orbits \citep[see][and references therein]{1997ApJ...480..155H,2000MNRAS.311..719K,2000MNRAS.319...43S,2003ApJ...585..244K,2003MNRAS.345..727K}. Nevertheless, within the local sphere, previous studies that focus on evaluating the degree of substructure in solar neighbourhood like volumes, considering the evolution of the Galactic potential in a cosmological context, have suggested that this variation may not be responsible for any major substructure erosion \citep[e.g.][]{2013MNRAS.436.3602G}. Furthermore, as previously discussed in \citetalias{2015MNRAS.453.2830M}, it is unlikely that the inner parts of the Galactic potential have changed significantly during the last $\sim 8$~Gyr. The validity of these assumptions will be explored in detail in our forthcoming work. \section*{Acknowledgements} This work was started during a brief research visit to the Max-Planck-Institut f\"ur Astrophysik. NPM wish to thank their hospitality, particularly to Simon White and the people from the Galaxy Formation Group. We wish to thank David Campbell and Adrian Jenkins for generating the initial conditions and selecting the sample of the {\it Auriga} galaxies. We are grateful to the anonymous referee for detailed comments provided, which help us to greatly improve the manuscript. NPM, PMC and CMG were supported with grants from the Consejo Nacional de Investigaciones Cient\'ificas y T\'ecnicas (CONICET) de la Rep\'ublica Argentina and the Universidad Nacional de R\'io Negro (Sede Andina UNRN) and the Universidad Nacional de La Plata (FCAG UNLP). RG, RP, CMS and VS acknowledge support by the European Research Council under ERC-StG grant EXAGAL-308037, the SFB-881 'The Milky Way System' of the German Science Foundation and by the Klaus Tschira Foundation. \bibliographystyle{mnras}
\section{Introduction} Undulations, i.e., static spatially periodic modulations of some physical quantity, are ubiquitous in experiments involving a flow over an obstacle. They have been studied, for instance, in water currents~\cite{byatt-smith_1971, Lee85, Lawrence87, wu87, johnson_1997, 2004nlin.....12060E, 2005Chaos..15c7102E, chapman_vanden-broeck_2006, Binder2006, Coutant:2012mf, Euve:2015vml} and in Bose-Einstein condensates flowing faster than the Landau critical velocity~\cite{pitaevskii2003bose}. Roughly speaking, such modulations can be seen as macroscopic superpositions of low-frequency linear waves. As such, small perturbations propagating over them can be strongly affected via $n$-wave mixing, with $n \geq 3$, provided some resonance conditions are satisfied. These modulations are particularly relevant for the study of analogue white-hole flows, i.e., flows going from supercritical to subcritical along the direction of the fluid velocity~\cite{Macher:2009tw,Mayoral11,Busch:2014hla}. As was shown by William Unruh~\cite{Unruh:1980cg}, there exists a mathematical correspondence between the behavior of sound waves close to the point where the flow velocity crosses the speed of low-frequency waves in the fluid frame and that of scalar fields around the horizon of a black hole. This correspondence being independent of the sign of the flow velocity, it therefore also holds for its time-reversed version, known as a white hole. The original model of~\cite{Unruh:1980cg} was then extended to a variety of different systems like gravity waves in water~\cite{Schutzhold:2002rf}, cold atoms~\cite{Garay:1999sk}, polaritons~\cite{Gerace:2012a}, light in a nonlinear optical fiber~\cite{Philbin1367}, ``slow'' sound~\cite{Aregan:2015a,Auregan:2015uva}, and magnetohydrodynamics~\cite{Noda:2016pva}, prompting theoretical studies of the link with Hawking radiation (HR) and experimental realizations aimed at detecting its condensed matter analogue~\cite{Weinfurtner:2010nu,Steinhauer:2015saa,Euve:2015vml}. An account of the main advances in this field can be found in~\cite{Barcelo:2005fc} and references therein. The majority of these works use the assumption that the flow is homogeneous far from the (analogue) horizon, which is necessary for the corresponding space-time to be asymptotically flat. However, experimental setups involving white-hole flows generically have undulations extending far from the near-horizon region and whose effect on the scattering of linear waves, used to probe the Hawking effect, remains unclear. The main objective of the present work is to tackle this problem and determine, in the case of gravity waves on water, how the presence of an undulation affects the scattering coefficients. When considering white-hole flows of ideal fluids, the dispersion relation in the asymptotic downstream (e.g. for surface water waves) or upstream (e.g. for Bose-Einstein condensates) region generically leads to the emission of a wave with zero frequency and nonvanishing wave vector. There are then two known mechanisms for such an emission. The first one, discussed in~\cite{Whitham_LaNW, Lighthill_WiF} for water waves and in~\cite{pitaevskii2003bose} and Appendix~C of~\cite{Busch:2014hla} for Bose-Einstein condensates, is due to the fact that, given an obstacle and parameters for the upstream flow, the amplitude of the periodic wave is generally nonzero unless these parameters are precisely fine-tuned to suppress it. (A procedure to design an obstacle shape reducing the undulation amplitude in water waves was proposed in~\cite{Michel:2014zsa} and applied in~\cite{Euve:2015vml}. Another procedure was used in~\cite{Mayoral11} in the context of flowing atomic Bose condensates.) The second mechanism is the amplification of incoming low-frequency perturbations by the analogue Hawking effect~\cite{Coutant:2012mf}, exhibiting a close relation between this effect and undulations. Moreover, in the experiment~\cite{Euve:2015vml} the undulation seems to play an important role in the wave conversion, which cannot be unambiguously separated from the contribution of the flow gradient localized above the obstacle. These observations, calling for a better understanding of the scattering in the presence of an undulation, are the main motivations for the present work. The effect of an undulation on the analogue HR was addressed numerically in the context of Bose-Einstein condensates in~\cite{Busch:2014hla}. It was shown that a sufficiently long undulation can significantly modify the effective temperature. Importantly, it was found to be reduced when the undulation has a phase close to that of a nonlinear solution of the field equations. This study raises two important questions. The first one concerns the analytical description of the reduction, which was so far obtained only numerically. Second, it is not completely clear from the numerical results whether the effective temperature goes to zero in the limit of a long undulation or saturates to a finite value -- nor, in the latter case, how this value depends on the undulation amplitude. We here aim at answering these two questions by computing analytically the effective temperature in the presence of an undulation in a transcritical flow. In the main text we use a simple model based on the Korteweg-de Vries (KdV) equation to describe surface waves on a two-dimensional flow of an ideal fluid. Although idealized, it has the advantage of showing the main features in a transparent way, keeping technicalities to a minimum. In Appendix~\ref{app:UCP}, the same analysis is carried out in a more involved model fully taking into account the dispersion relation of water waves obtained when neglecting viscosity, surface tension, and vorticity. We believe that the similarities between the results of our two models and the generality of the arguments used to motivate them indicate they should be only weakly affected when including these three effects. In Appendix~\ref{app:sub} we briefly discuss the case of subcritical flows (see also Refs.~\cite{Michel:2014zsa,Robertson:2016ocv,Coutant:2016vsf,Coutant:2017qnz}) to be closer to the experiments of~\cite{Euve:2014aga,Euve:2015vml}. This paper is organized as follows. Section~\ref{sec:KdV_tuned} is devoted to the computation of the modes over a long undulation. We show in which sense it may be thought of as the zero-frequency limit of a three-wave resonance and exhibits the specific features of this limit. These results are applied to white-hole-like flows in Section~\ref{sec:WH}, where the implications of a small undulation for the analogue Hawking radiation are determined. We conclude in Section~\ref{sec:concl}. In Appendix~\ref{app:detuned} we consider the resonant scattering on a ``detuned'' undulation, i.e., a region where some external parameter varies periodically, in the case there is a resonance at finite frequency. We take the opportunity to detail two points which are also relevant to the case studied in the main text, namely the Lagrangian description of the KdV equation and the relation between the transfer and scattering matrices. Appendix~\ref{app:lingrowmodes} relates the properties of the modes to the nonlinear solutions of the KdV equation. Appendix~\ref{app:UCP} generalizes the main results to a more realistic model of water waves, assuming incompressibility, irrotationality, no viscosity, and no surface tension, but keeping terms of all orders in the wave vector. Finally, in appendix~\ref{app:sub} we briefly comment on the case of a subcritical flow. \section{Modes over an infinite undulation} \label{sec:KdV_tuned} The aim of this section is to exhibit the general properties of low-frequency modes over an undulation. This is a preliminary step to the calculation of the spectrum in analogue white-hole flows done in Section~\ref{sec:WH}. In Appendix~\ref{app:detuned}, the interested reader will find a complete treatment of the case of a ``detuned'' undulation, corresponding to an externally imposed modulation of some parameter with an arbitrary period. There, we find that the behavior of resonant modes depends on the relative signs of the energies and momenta of the two waves involved in the resonant scattering: the resonant modes are exponentially growing in time (respectively in space) if their energies (respectively energy currents) have opposite signs, and bounded if they have the same sign. Here instead, we consider the effects of ``tuned'' undulations which are themselves static solutions of the KdV equation. As we shall see, this introduces a qualitative difference: the resonance now involves modes with a vanishing energy, leading to a linear, instead of exponential, growth in space or time. In Appendix~\ref{app:lingrowmodes}, we show that this behavior can be directly related to variations of the nonlinear solutions. We work with the one-dimensional KdV equation: \begin{equation} \label{eq:KdV} \ensuremath{\partial}_t \eta + \w \, \ensuremath{\partial}_x \eta + \ensuremath{\partial}_x^3 \eta + 6 \, \eta \, \ensuremath{\partial}_x \eta = 0, \end{equation} where $\w > 0$. (See appendix~\ref{app:detuned} and Refs.~\cite{Shen1993,Hereman2013}.) To study linear perturbations, we write $\eta = \eta^{(0)} + \delta\mkern-1.mu \eta$ where $\eta^{(0)}$ is an exact stationary solution of \eq{eq:KdV} and $\delta\mkern-1.mu \eta$ is a ``small'' perturbation. Neglecting terms quadratic in $\delta\mkern-1.mu \eta$, one obtains the linearized KdV equation: \begin{equation} \label{eq:KdV-linearized} \ensuremath{\partial}_t \delta\mkern-1.mu \eta + \ensuremath{\partial}_x \ensuremath{\left(} \ensuremath{\left(} \w + 6 \, \eta^{(0)} \ensuremath{\right)} \delta\mkern-1.mu \eta \ensuremath{\right)} + \ensuremath{\partial}_x^3 \delta\mkern-1.mu \eta = 0. \end{equation} In the following we first review a few properties of this linear equation which will play an important role in the scattering over an undulation. We generalize Equation~\eqref{eq:KdV-linearized}, replacing the factor $\w + 6 \nobreak\hspace{.08em plus .04em} \eta^{(0)}$ by an arbitrary differentiable function of $x$, so that the same formalism can be applied to ``detuned'' undulations. Applying it to \eq{eq:KdV-linearized} allows us to determine the form of the resonant modes as well as the leading terms in the transfer matrix at low frequencies, which will be used in Section~\ref{sec:WH} to determine the corrections to the emission spectrum of a white-hole flow. The analysis presented in this section is extended to a more realistic model of water waves in Appendix~\ref{app:UCP}. \subsection{The linearized KdV equation} \label{sub:linKdV} In this subsection we consider the mathematical description of periodic variations of some parameter entering the field equation. These might be ``detuned'' (see Appendix~\ref{app:KdV_detuned} for a fuller treatment), corresponding to local variations of some external potential or, in the case of water waves, to the height of the obstacle put at the bottom of the flume. However, in the main body of this paper we shall restrict our attention to ``tuned'' undulations, which are themselves static nonlinear solutions of the KdV equation. To this end, we consider the following generalized form of Equation~\eqref{eq:KdV-linearized}: \begin{equation} \label{eq:linKdV} \ensuremath{\partial}_t \delta\mkern-1.mu \eta(t,x) + \ensuremath{\partial}_x \ensuremath{\left(} \bar{\w}(x) \, \delta\mkern-1.mu \eta(t,x) \ensuremath{\right)} + \ensuremath{\partial}_x^3 \delta\mkern-1.mu \eta(t,x) = 0, \end{equation} where $\bar{\w} \in C^0 (\mathbb{R})$ is a nonconstant periodic function of $x$. The relation between \eq{eq:linKdV} and the forced KdV equation used to model water waves~\cite{Shen1993} is discussed in appendix~\ref{app:lag_lin_KdV}. In the case of ``tuned'' undulations considered here, the undulation is a solution $\eta^{(0)}$ of the KdV equation, and enters \eq{eq:linKdV} through the relation $\bar{\w} = \w + 6 \nobreak\hspace{.08em plus .04em} \eta^{(0)}$. Let us call $\ensuremath{\lambda}_\w$ the fundamental period of $\bar{\w}$ and define $k_\w \equiv 2 \pi / \ensuremath{\lambda}_\w$. For all $n \in \mathbb{Z}$, we define \begin{equation} \w_n \equiv \frac{1}{\ensuremath{\lambda}_\w} \int_0^{\ensuremath{\lambda}_\w} \bar{\w}(x) \, \ensuremath{\mathrm{e}}^{- \ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} n \nobreak\hspace{.08em plus .04em} k_\w \nobreak\hspace{.08em plus .04em} x} \ensuremath{\mathrm{d}} x. \label{eq:def_w_n} \end{equation} Then, for any $x \in \mathbb{R}$, \begin{equation} \label{eq:expv} \bar{\w}(x) = \sum_{n \in \mathbb{Z}} \w_n \, \ensuremath{\mathrm{e}}^{\ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} n \nobreak\hspace{.08em plus .04em} k_\w \nobreak\hspace{.08em plus .04em} x}. \end{equation} Since $\bar{\w}$ is real valued, $\w_{-n} = \w_n^*$ for all $n \in \mathbb{Z}$. To determine the scattering coefficients analytically, we work perturbatively in the variations of $\bar{\w}$. More precisely, we define a small parameter $\epsilon > 0$, $\epsilon \ll 1$, and assume the coefficients $\w_n$ scale as \begin{equation} \label{eq:exp_eps} \forall \, n \in \mathbb{Z}, \; \frac{\w_n}{\w_0} = O \big( \ensuremath{\epsilon}^\abs{n} \big). \end{equation} The calculation can then be performed to any given order in $\epsilon$ by expanding Equation~\eqref{eq:linKdV} in this parameter. (This justifies a posteriori the scaling in \eq{eq:exp_eps}.) It is of value to first recall some properties of the solutions in the case $\ensuremath{\epsilon} = 0$. Then, Equation~\eqref{eq:linKdV} becomes \begin{equation} \label{eq:linKdV0} [ \ensuremath{\partial}_t + \w_0 \, \ensuremath{\partial}_x + \ensuremath{\partial}_x^3 ] \delta\mkern-1.mu \eta(t,x) = 0. \end{equation} The constant $\w_0$, chosen here to be positive, is equal to $c_0 + v_0$, where $c_0$ is the low-frequency group velocity in the fluid frame, and $v_0 < 0$ is the flow speed. With these choices, Equation~\eqref{eq:linKdV0} describes small-amplitude counterpropagating waves over a (subcritical) flow to the left, i.e., waves whose group velocities in the reference frame of the fluid are all positive. As this equation has no explicit space or time dependence, there exists a continuous basis of bounded solutions of the form \begin{equation} \label{eq:planew} \delta\mkern-1.mu \eta_{\ensuremath{\omega}, k}: (t,x) \mapsto \ensuremath{\mathrm{e}}^{\ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} k \nobreak\hspace{.08em plus .04em} x - \ensuremath{\omega} \nobreak\hspace{.08em plus .04em} t \ensuremath{\right)}}, \end{equation} where $(\ensuremath{\omega}, k) \in \mathbb{R}^2$. Using Equation~\eqref{eq:linKdV0}, one finds Equation~\eqref{eq:planew} is a solution if and only if the dispersion relation $\ensuremath{\omega} = \ensuremath{\omega}_0(k)$ is satisfied, where \begin{equation} \label{eq:DR} \ensuremath{\omega}_0 (k) = \w_0 \, k - k^3. \end{equation} It is shown in Figure~\ref{fig:DR_KdV}. At fixed value of $\ensuremath{\omega}$, the dispersion relation has three complex roots in $k$. For $\ensuremath{\omega} \in \mathbb{R}$, the number of real ones depends on whether $\abs{\ensuremath{\omega}}$ is larger or smaller than a critical value \begin{equation}\label{eq:ommax} \ensuremath{\omega}_\mathrm{max} = 2 \ensuremath{\left(} \frac{\w_0}{3} \ensuremath{\right)}^{3/2}: \end{equation} \begin{itemize} \item If $\abs{\ensuremath{\omega}} < \ensuremath{\omega}_\mathrm{max}$, the three roots are real. We denote them as $k_\ensuremath{\omega}^{(i)}$, $i \in \ensuremath{\left\lbrace} 1, 2, 3 \ensuremath{\right\rbrace}$, with $k_\ensuremath{\omega}^{(1)} < k_\ensuremath{\omega}^{(2)} < k_\ensuremath{\omega}^{(3)}$. The second one, $k_\ensuremath{\omega}^{(2)}$, corresponds to a right-moving wave, whose group velocity $\ensuremath{\left(} \ensuremath{\mathrm{d}} k_\ensuremath{\omega}^{(2)} / \ensuremath{\mathrm{d}} \ensuremath{\omega} \ensuremath{\right)}^{-1}$ is positive. The two other roots correspond to left-moving waves, with negative group velocities. For $\ensuremath{\omega} > 0$ , we also have $k_\ensuremath{\omega}^{(1)} < 0$ and $k_\ensuremath{\omega}^{(3)} > k_\ensuremath{\omega}^{(2)} > 0$. So, the quantity $k_\ensuremath{\omega}^{(i)} \, \ensuremath{\mathrm{d}} k_\ensuremath{\omega}^{(i)} / \ensuremath{\mathrm{d}} \ensuremath{\omega}$, which will play an important role in the following, is strictly positive for $i \in \ensuremath{\left\lbrace} 1, 2 \ensuremath{\right\rbrace}$ and strictly negative for $i = 3$. In the low-frequency limit $\ensuremath{\omega} = 0$, one finds $k_\ensuremath{\omega}^{(2)} = 0$ and $k_\ensuremath{\omega}^{(3)} = - k_\ensuremath{\omega}^{(1)} = k_u$, where $k_u \equiv \sqrt{\w_0}$ is the wave vector of the ``tuned'' undulation $\eta^{(0)}$. \item If $\abs{\ensuremath{\omega}} > \ensuremath{\omega}_\mathrm{max}$, only one real root remains: $k_\ensuremath{\omega}^{(1)}$ for $\ensuremath{\omega} > 0$ and $k_\ensuremath{\omega}^{(3)}$ for $\ensuremath{\omega} < 0$. The two other roots are complex conjugates with nonvanishing imaginary parts. \end{itemize} As shown in appendix~\ref{app:lag_lin_KdV}, the sign of the energy of a wave is given by $\ensuremath{\omega} \, k$. It is indicated in the figure by the style of the curve: continuous for positive-energy modes and dashed for negative-energy ones. In the following we concentrate on modes with $0 < \ensuremath{\omega} < \ensuremath{\omega}_\mathrm{max}$. Those with $- \ensuremath{\omega}_\mathrm{max} < \ensuremath{\omega} < 0$ are simply their complex conjugates, so there is no need to study them separately. The modes with $i \in \ensuremath{\left\lbrace} 2, 3 \ensuremath{\right\rbrace}$ then have positive energies while the mode with $i = 1$ has a negative energy. A resonance can occur if there exists $(i,j) \in \ensuremath{\left\lbrace} 1, 2, 3 \ensuremath{\right\rbrace}^2$ and $n_r \in \mathbb{N} \, \backslash \ensuremath{\left\lbrace} 0 \ensuremath{\right\rbrace}$ such that $k_\ensuremath{\omega}^{(i)} - k_\ensuremath{\omega}^{(j)} = n_r \, k_\w$, where $k_\w$ is defined above Equation~\eqref{eq:def_w_n}. \begin{figure} \begin{center} \includegraphics[width = 0.49 \linewidth]{DRlinKdV_2.pdf} \end{center} \caption{Dispersion relation $\omega$ versus $k$ for the linear KdV equation \eqref{eq:linKdV0} with $\w_0 = 2.5$. The (subsonic) flow velocity $v_0 < 0 $ is to the left, and $\w_0 = c_0 + v_0$ where $c_0$ is the low-frequency group velocity of linear waves. The style of the line gives the sign of the energy of the corresponding mode: continuous for positive energies and dashed for negative ones. The horizontal dot-dashed line shows $\ensuremath{\omega} = \ensuremath{\omega}_\mathrm{max}$ of \eq{eq:ommax}. The large dot shows the wave vector $k_u$ of the ``tuned'' undulation. The black dotted line materializes a constant value of $\omega$ strictly between $0$ and $\omega_\mathrm{max}$. Its intersection points with the blue curve give the three wave vectors $k_{\omega}^{(i)}$ at that frequency. } \label{fig:DR_KdV} \end{figure} Scattering on a ``detuned'' undulation is studied in appendix~\ref{app:detuned}. The main result is that, when there is a three-wave resonance, i.e., two linear waves interacting resonantly with the undulation, the corresponding modes are either bounded or exponentially increasing in one direction depending on the relative signs of the energy and energy flux of the two interacting waves. If they have energies with the same sign, then the mode is bounded in time; otherwise the mode grows or decays exponentially as $t \to \infty$. Similarly, it is spatially bounded if their energy fluxes have the same sign, and exponentially increasing or decreasing as $\abs{x} \to \infty$ otherwise. As we will see in the following, in the limit of a ``tuned'' undulation, which is itself a static solution of the KdV equation, this exponential behavior is replaced by a linear growth. \subsection{Periodic static solutions of the (nonlinear) KdV equation} \label{sub:persol} As our analysis will rely on the structure of the stationary (nonlinear) solutions of \eq{eq:KdV}, we now review their most relevant properties. A more detailed account can be found in the textbook~\cite{Kamchatnov}. Setting $\ensuremath{\partial}_t \eta = 0$ in \eq{eq:KdV}, one obtains the stationary KdV equation \begin{equation} \ensuremath{\partial}_x \ensuremath{\left(} \w \, \eta + \ensuremath{\partial}_x^2 \eta + 3 \nobreak\hspace{.08em plus .04em} \eta^2 \ensuremath{\right)} = 0. \end{equation} Integration over $x$ gives \begin{equation} \label{eq:KdV_stat_int1} \w \, \eta + \ensuremath{\partial}_x^2 \eta + 3 \nobreak\hspace{.08em plus .04em} \eta^2 = C, \end{equation} where $C$ is an integration constant, see the left panel of Fig.~\ref{fig:KdV_unduls} for four solutions with $\w = 1$ and $C = 0$. We assume $\w^2 + 12 \nobreak\hspace{.08em plus .04em} C > 0$.~\footnote{This condition is equivalent to the existence of real homogeneous solutions, given by $\eta = \ensuremath{\left(} \pm \sqrt{\w^2 + 12 \nobreak\hspace{.08em plus .04em} C} - \w \ensuremath{\right)} \big/ 6$.} Let $\eta_0 \equiv \ensuremath{\left(} \sqrt{\w^2 + 12 \, C} - \w \ensuremath{\right)} \big/ 6$ and $\Delta\mkern-1.mu \eta \equiv \eta - \eta_0$. Equation~\eqref{eq:KdV_stat_int1} becomes \begin{equation} \ensuremath{\left(} \w + 6 \nobreak\hspace{.08em plus .04em} \eta_0 \ensuremath{\right)} \, \Delta\mkern-1.mu \eta + \ensuremath{\partial}_x^2 \Delta\mkern-1.mu \eta + 3 \, \Delta\mkern-1.mu \eta^2 = 0. \end{equation} Multiplication by $\ensuremath{\partial}_x \Delta\mkern-1.mu \eta$ gives \begin{equation} \ensuremath{\partial}_x \ensuremath{\left(} \frac{\w + 6 \nobreak\hspace{.08em plus .04em} \eta_0}{2} \, \Delta\mkern-1.mu \eta^2 + \frac{1}{2} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \ensuremath{\partial}_x \Delta\mkern-1.mu \eta \ensuremath{\right)}^2 + \Delta\mkern-1.mu \eta^3 \ensuremath{\right)} = 0, \end{equation} which can be integrated over $x$, giving \begin{equation} \ensuremath{\left(} \ensuremath{\partial}_x \Delta\mkern-1.mu \eta \ensuremath{\right)}^2 = - 2 \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \Delta\mkern-1.mu \eta - \eta_1 \ensuremath{\right)} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \Delta\mkern-1.mu \eta - \eta_2 \ensuremath{\right)} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \Delta\mkern-1.mu \eta - \eta_3 \ensuremath{\right)}, \end{equation} where $\ensuremath{\left(} \eta_1, \eta_2, \eta_3 \ensuremath{\right)} \in \mathbb{C}^3$ satisfies \begin{equation} \ensuremath{\left\lbrace} \begin{aligned} & \eta_1 + \eta_2 + \eta_3 = - \frac{\w + 6 \nobreak\hspace{.08em plus .04em} \eta_0}{2} \\ & \eta_1 \nobreak\hspace{.08em plus .04em} \eta_2 + \eta_2 \nobreak\hspace{.08em plus .04em} \eta_3 + \eta_3 \nobreak\hspace{.08em plus .04em} \eta_1 = 0 \end{aligned} \right. , \end{equation} and $\eta_1 \nobreak\hspace{.08em plus .04em} \eta_2 \nobreak\hspace{.08em plus .04em} \eta_3$ is another free integration constant. Spatially bounded solutions exist if and only if $\ensuremath{\left(} \eta_1, \eta_2, \eta_3 \ensuremath{\right)} \in \mathbb{R}^3$. Ordering these three numbers as $\eta_1 \leq \eta_2 \leq \eta_3$, the bounded solutions are periodic if $\eta_2 \neq \eta_1$, with $\eta$ oscillating between $\eta_2$ and $\eta_3$. The wavelength $\ensuremath{\lambda}$ is: \begin{equation} \label{eq:KdV_la} \ensuremath{\lambda} = \frac{2 \nobreak\hspace{.08em plus .04em} \sqrt{2}}{\sqrt{\eta_3 - \eta_1}} \, K \ensuremath{\left(} \sqrt{\frac{\eta_3 - \eta_2}{\eta_3 - \eta_1}} \ensuremath{\right)} = 4 \int_0^{\pi / 2} \frac{\ensuremath{\mathrm{d}} \theta}{\sqrt{\sqrt{\bar{\w}^2 - 3 \, \ensuremath{\left(} \eta_3 - \eta_2 \ensuremath{\right)}^2} + \ensuremath{\left(} \eta_3 - \eta_2 \ensuremath{\right)} \, \cos \ensuremath{\left(} 2 \nobreak\hspace{.08em plus .04em} \theta \ensuremath{\right)}}}, \end{equation} where $K$ is the complete elliptic integral of the first kind and $\bar{\w} \equiv \w + 6 \nobreak\hspace{.08em plus .04em} \eta_0$. The wavelength $\ensuremath{\lambda}$ diverges in the limit $\eta_2 \to \eta_1$. In the following, it will be convenient to use the wave vector $k_u \equiv 2 \pi / \ensuremath{\lambda}$, whose dependence on the amplitude is shown in \fig{fig:KdV_unduls}, right panel. \begin{figure} \includegraphics[width = 0.49 \linewidth]{plot_unduls_KdV.pdf} \includegraphics[width = 0.49 \linewidth]{ku_vs_Au.pdf} \caption{\textit{Left panel:} Plots of four different periodic nonlinear solutions of Eq.~(\ref{eq:KdV_stat_int1}) with different amplitudes, for $\w = 1$ and $C = 0$. \textit{Right panel:} Wave vector $k_u$ as a function of the amplitude $A_u$, defined as half the difference between the maximum and minimum values reached by $\eta$.} \label{fig:KdV_unduls} \end{figure} We concentrate on small-amplitude undulations, i.e., with $\eta_2 \approx \eta_3$. In this limit, the wave vector $k_u$ tends to $\sqrt{\bar{\w}}$, the strictly positive zero-frequency root of the dispersion relation over the solution $\eta = \eta_0$, see Fig.~\ref{fig:DR_KdV}. This is an important point: the wavelength of the undulation is, to lowest order, always equal to that of a zero-frequency solution of the linearized equation. This property, also found in the model of Appendix~\ref{app:UCP}, is the reason why the undulation has an important effect on the scattering at low frequencies. To next order in $\eta_3 - \eta_2$, a straightforward calculation using \eq{eq:KdV_la} gives \begin{equation} \label{eq:KdV_ku} k_u = \sqrt{\bar{\w}} \, \ensuremath{\left(} 1 - \frac{15}{4 \bar{\w}^2} A_u^2 + \ord{A_u^3} \ensuremath{\right)}, \end{equation} where $A_u = (\eta_3 - \eta_2) / 2$ is the amplitude of the undulation. The solution takes the form \begin{equation} \label{eq:KdV-undul-sols} \eta_u (x) = \eta_0 + A_u \cos \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - x_u \ensuremath{\right)} \ensuremath{\right)} - \frac{3 A_u^2}{2 \bar{\w}} + \frac{A_u^2}{2 \bar{\w}} \cos \ensuremath{\left(} 2 \nobreak\hspace{.08em plus .04em} k_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - x_u \ensuremath{\right)} \ensuremath{\right)} + \frac{3 A_u^3}{16 \nobreak\hspace{.08em plus .04em} \bar{\w}^2} \cos \ensuremath{\left(} 3 \nobreak\hspace{.08em plus .04em} k_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - x_u \ensuremath{\right)} \ensuremath{\right)} + \ord{A_u^4}, \end{equation} where $x_u \in \mathbb{R}$ determines the phase at $x = 0$. The main result to keep in mind is that the spatially bounded solutions are labeled by three continuous parameters: $\eta_0$, giving the mean value of $\eta$ to leading order, the amplitude of the oscillations $A_u$, and $x_u$, giving (on multiplication by $k_u$) the phase at the origin $x = 0$. \subsection{Modes over the undulation and transfer matrix} \label{subsec:tuned_mat} Let us now determine the low-frequency modes over the undulation from a linear calculation. An alternative derivation in the zero-frequency limit is given in Appendix~\ref{app:lingrowmodes}. Denoting by $k_\ensuremath{\omega}^{(i)}, \, i \in \ensuremath{\left\lbrace} 1, 2, 3 \ensuremath{\right\rbrace}$ the solutions of the dispersion relation~\eqref{eq:DR} at fixed angular frequency $\ensuremath{\omega}$, ordered as $k_\ensuremath{\omega}^{(1)} < k_\ensuremath{\omega}^{(2)} < k_\ensuremath{\omega}^{(3)}$ for $\abs{\ensuremath{\omega}} < \ensuremath{\omega}_\mathrm{max}$, we have for $\ensuremath{\omega} = 0$: \begin{equation*} k_0^{(1)} = - k_u, \; k_0^{(2)} = 0, \; \text{and} \; k_0^{(3)} = k_u. \end{equation*} There are thus two resonances involving two linear waves and the undulation: \begin{itemize} \item a first-order resonance due to $k_0^{(3)} - k_0^{(2)} = k_0^{(2)} - k_0^{(1)} = k_u$, giving a contribution linear in $A_u$, \item a second-order resonance due to $k_0^{(3)} - k_0^{(1)} = 2 k_u$, whose contribution is of order $A_u^2$. \end{itemize} To obtain the corresponding resonant modes, we solve \eq{eq:KdV-linearized} in a background $\eta^{(0)} = \eta_u$ given by \eq{eq:KdV-undul-sols}. Since the coefficients of the differential equation~\eqref{eq:KdV-linearized} are independent of $t$ and periodic in $x$ with period $2 \pi / k_u$, one can look for Bloch wave solutions~\cite{Kittel79}: \begin{equation} \label{eq:KdV:etaexp} \delta\mkern-1.mu \eta: (t,x) \mapsto \ensuremath{\mathrm{e}}^{- \ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} \ensuremath{\omega} \nobreak\hspace{.08em plus .04em} t + \ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} k \nobreak\hspace{.08em plus .04em} x} \rho(x), \end{equation} where $\ensuremath{\omega}$ and $k$ are two complex numbers giving respectively the angular frequency and the quasimomentum of the solution $\delta\mkern-1.mu \eta$, and where $\rho \in C^3 \ensuremath{\left(} \mathbb{R}, \mathbb{C} \ensuremath{\right)}$ is periodic with period $2 \pi / k_u$. Let $(\rho_n)_{n \in \mathbb{Z}}$ be the coefficients of its Fourier expansion, defined so that \begin{equation} \label{eq:KdV:rhoexp} \rho(x) = \sum_{n \in \mathbb{Z}} \rho_n \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{e}}^{\ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} n \nobreak\hspace{.08em plus .04em} k_u \nobreak\hspace{.08em plus .04em} x}. \end{equation} The mode is normalized with respect to the inner product~\eqref{eq:innerprod} if $\rho_0$ is chosen such that \begin{equation} 2 \nobreak\hspace{.08em plus .04em} \pi \nobreak\hspace{.08em plus .04em} \abs{\frac{\ensuremath{\mathrm{d}} k}{\ensuremath{\mathrm{d}} \ensuremath{\omega}}}^{-1} \nobreak\hspace{.08em plus .04em} \abs{\sum_{n \in \mathbb{Z}} \frac{\abs{\rho_n}^2}{k + n \nobreak\hspace{.08em plus .04em} k_u}} = 1, \end{equation} and the sign of its energy is \begin{equation} \mathrm{sgn} \ensuremath{\left(} \ensuremath{\left(} \frac{\ensuremath{\mathrm{d}} k}{\ensuremath{\mathrm{d}} \ensuremath{\omega}} \ensuremath{\right)}^{-1} \nobreak\hspace{.08em plus .04em} \sum_{n \in \mathbb{Z}} \frac{\abs{\rho_n}^2}{k + n \nobreak\hspace{.08em plus .04em} k_u} \ensuremath{\right)} . \end{equation} Similarly, $\eta_u$ can be expanded as \begin{equation} \label{eq:KdV:etauexp} \eta_u (x) = \sum_{n \in \mathbb{Z}} \eta_n \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{e}}^{\ensuremath{\mathrm{i}} \nobreak\hspace{.08em plus .04em} n \nobreak\hspace{.08em plus .04em} k_u \nobreak\hspace{.08em plus .04em} x}, \end{equation} where $\ensuremath{\left(} \eta_n \ensuremath{\right)}_{n \in \mathbb{Z}} \in \mathbb{C}^\mathbb{Z}$. Plugging \eq{eq:KdV:etaexp} in \eq{eq:KdV-linearized} and using Equations~(\ref{eq:KdV:rhoexp}) and~(\ref{eq:KdV:etauexp}) gives the recursion relation: \begin{equation} \label{eq:KdV:recrel} \forall \, n \in \mathbb{Z}, \; \ensuremath{\left(} \ensuremath{\omega} - \ensuremath{\omega}_0 \ensuremath{\left(} k + n \nobreak\hspace{.08em plus .04em} k_u \ensuremath{\right)} \ensuremath{\right)} \rho_n - 6 \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} k + n \nobreak\hspace{.08em plus .04em} k_u \ensuremath{\right)} \sum_{l \in \mathbb{Z}^*} \eta_l \nobreak\hspace{.08em plus .04em} \rho_{n-l} = 0, \end{equation} where \begin{equation} \label{eq:KdV:DR_hom_sol} \ensuremath{\omega}_0 (k) = \bar{\w} \, k - k^3 \end{equation} gives the relation between $\ensuremath{\omega}$ and $k$ on a homogeneous solution $\eta = \eta_0$. We define a small parameter $\ensuremath{\epsilon}$ and solve \eq{eq:KdV:recrel} perturbatively in $\ensuremath{\epsilon}$, assuming the following scalings: \begin{equation} \ensuremath{\omega} = \orde{}; \; \; \forall \, n \in \mathbb{Z}, \; \eta_n = O \big( \ensuremath{\epsilon}^\abs{n} \big); \; \; \text{and} \; \; \forall \, n \in \mathbb{Z}, \; \rho_n = O \big( \ensuremath{\epsilon}^{\textrm{max}(\abs{n}-1,0)} \big). \end{equation} As for the previous expansion \eq{eq:exp_eps} in the detuned case, the KdV equation can then be solved order by order in $\ensuremath{\epsilon}$. As could be expected from the unperturbed dispersion relation, we find three modes: two dispersive ones $\delta\mkern-1.mu \eta_\ensuremath{\omega}^{(\pm)}$ whose group velocities go to $\ensuremath{\omega}_0' \ensuremath{\left(} k_u \ensuremath{\right)}$ in the limit $\ensuremath{\epsilon} \to 0$, and a hydrodynamic one $\delta\mkern-1.mu \eta_\ensuremath{\omega}^{(h)}$ whose group velocity tends to $\ensuremath{\omega}_0'(0)$. The former are given by \begin{equation} \label{eq:modes_d} \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(s)}: \left\lbrace \begin{aligned} & \rho_0 = - \frac{2 \nobreak\hspace{.08em plus .04em} \ensuremath{\omega}}{k_u^2} \nobreak\hspace{.08em plus .04em} \rho_c + \orde{2} \\ & \rho_{\pm 1} = \ensuremath{\left(} \frac{\ensuremath{\omega}}{A_u} \mp s \sqrt{\frac{\ensuremath{\omega}^2}{A_u^2} + 4 \nobreak\hspace{.08em plus .04em} k_u^2 + \orde{3}} \ensuremath{\right)} \rho_c + \orde{} \\ & \rho_{\pm 2} = \ensuremath{\left(} 1 \pm \frac{\ensuremath{\omega}}{2 \nobreak\hspace{.08em plus .04em} k_u^3} \ensuremath{\right)} \frac{A_u}{k_u^2} \nobreak\hspace{.08em plus .04em} \rho_{\pm 1} + \orde{3} \\ & \rho_{\pm 3} = \frac{9 \nobreak\hspace{.08em plus .04em} A_u^2}{16 \nobreak\hspace{.08em plus .04em} k_u^4} \nobreak\hspace{.08em plus .04em} \rho_{\pm 1} + \orde{3} \end{aligned} \right. , \end{equation} where $s \in \ensuremath{\left\lbrace} -1, +1 \ensuremath{\right\rbrace}$ and $\rho_c$ is a constant. The corresponding quasimomenta are \begin{equation} k = - \frac{\ensuremath{\omega}}{2 \nobreak\hspace{.08em plus .04em} k_u^2} + s \nobreak\hspace{.08em plus .04em} \delta k_d, \end{equation} where \begin{equation} \delta k_d \equiv \frac{3}{8 \nobreak\hspace{.08em plus .04em} k_u^4} \nobreak\hspace{.08em plus .04em} \mathrm{sgn}(\ensuremath{\omega}) \sqrt{\frac{\ensuremath{\omega}^4}{k_u^2} + 4 \nobreak\hspace{.08em plus .04em} \ensuremath{\omega}^2 \nobreak\hspace{.08em plus .04em} A_u^2 + \orde{5}} . \end{equation} The hydrodynamic mode is given by \begin{equation} \label{eq:mode_h} \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(h)} : \left\lbrace \begin{aligned} & \rho_0 = \frac{\ensuremath{\omega}}{A_u \nobreak\hspace{.08em plus .04em} k_u} \nobreak\hspace{.08em plus .04em} \rho_c + \orde{2} \\ & \rho_{\pm 1} = \pm \rho_c + \orde{} \\ & \rho_{\pm 2} = \pm \frac{A_u}{k_u^2} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} 1 \mp \frac{\ensuremath{\omega}}{k_u^2} \ensuremath{\right)} \rho_c + \orde{3} \\ & \rho_{\pm 3} = \pm \frac{9 \nobreak\hspace{.08em plus .04em} A_u^2}{16 \nobreak\hspace{.08em plus .04em} k_u^4} \nobreak\hspace{.08em plus .04em} \rho_c + \orde{3} \end{aligned} \right. . \end{equation} Its quasimomentum satisfies $\ensuremath{\omega}_0(k) = \ensuremath{\omega} + \orde{3}$, i.e., is unchanged to this order. The stationary modes obtained by variations of the nonlinear solution of the KdV equation, $\ensuremath{\partial}_{x_u} \eta_u$, $\ensuremath{\partial}_{\eta_0} \eta_u$, and $\ensuremath{\partial}_{A_u} \eta_u$ (see Eqs.~(\ref{KdV_statmode1})--(\ref{KdV_statmode3})), can be obtained as the limit $\ensuremath{\omega} \to 0$ of the three modes of Equations~(\ref{eq:modes_d}) and~(\ref{eq:mode_h}). Indeed, a straightforward calculation shows that (up to a global factor) $\delta\mkern-1.mu \eta_\ensuremath{\omega}^{(h)}$ and $\delta\mkern-1.mu \eta_\ensuremath{\omega}^{(\pm)}$ converge uniformly toward $\ensuremath{\partial}_{x_u} \eta_u$ in the limit $\ensuremath{\omega} \to 0$, while the two other modes are obtained through \begin{equation} \frac{A_u}{4 \nobreak\hspace{.08em plus .04em} \ensuremath{\omega} \nobreak\hspace{.08em plus .04em} \rho_c} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(+)} + \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(-)} \ensuremath{\right)} \mathop{\longrightarrow}_{\ensuremath{\omega} \to 0} \ensuremath{\partial}_{A_u} \eta_u + 2 \nobreak\hspace{.08em plus .04em} \frac{A_u}{\w} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} 1 - \frac{9 \nobreak\hspace{.08em plus .04em} A_u^2}{\w^2} \ensuremath{\right)} \ensuremath{\partial}_{\eta_0} \eta_u \end{equation} and \begin{equation} \frac{A_u \nobreak\hspace{.08em plus .04em} k_u}{\ensuremath{\omega} \nobreak\hspace{.08em plus .04em} \rho_c} \nobreak\hspace{.08em plus .04em} \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(h)} + \frac{A_u}{4 \nobreak\hspace{.08em plus .04em} \ensuremath{\omega} \nobreak\hspace{.08em plus .04em} \rho_c} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(+)} - \delta\mkern-1.mu \eta_\ensuremath{\omega}^{(-)} \ensuremath{\right)} \mathop{\longrightarrow}_{\ensuremath{\omega} \to 0} \ensuremath{\left(} 1 - \frac{9 \nobreak\hspace{.08em plus .04em} A_u^2}{\w^2} \ensuremath{\right)} \nobreak\hspace{.08em plus .04em} \ensuremath{\partial}_{\eta_0} \eta_u. \end{equation} (In these expressions, the convergence is uniform on any bounded domain of $\mathbb{R}^2$.) One can compute the transfer matrix $T$ at zero frequency over a damped undulation of the form \begin{equation} \label{eq:offundul} \eta_{u,d} (x) = \frac{\eta_u(x)}{2} \nobreak\hspace{.08em plus .04em} \left[ 1 - \tanh \ensuremath{\left(} \sigma_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - L_u / 2 \ensuremath{\right)} \ensuremath{\right)} \tanh \ensuremath{\left(} \sigma_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x + L_u / 2 \ensuremath{\right)} \ensuremath{\right)} \right], \end{equation} where $\sigma_u$ and $L_u$ are two strictly positive numbers. One example is shown in \fig{fig:offundul}. Following the notation adopted in Fig.~\ref{fig:DR_KdV}, let us denote with an index $2$ the hydrodynamic wave with vanishing wave vector while indices $1$ and $3$ denote the dispersive waves with wave vectors going to $\pm \sqrt{\bar{\w}}$ for $\ensuremath{\omega} \to 0$. To simplify the expressions, we here give the results for modes normalized to have a single plane wave with unit amplitude on the left or on the right of the undulation. Taking the double limit $A_u \to 0$, $L_u \to \infty$ at fixed $A_u \nobreak\hspace{.08em plus .04em} L$, the results become independent of $\sigma_u$. Retaining only the leading terms gives \begin{equation} \label{eq:KdV_T_main} \begin{aligned} & \abs{T_{2,1}} \sim \abs{T_{2,3}} \sim \frac{3 \, A_u}{2 \, \sqrt{\w}} \, L_u, \\ & \abs{T_{1,1} - 1} \sim \abs{T_{1,3}} \sim \abs{T_{3,1}} \sim \abs{T_{3,3} - 1} \sim \frac{15 \, A_u^2}{4 \, \w^{3/2}} \, L_u . \end{aligned} \end{equation} The transfer coefficients $T_{2,2}-1$, $T_{1,2}$, and $T_{3,2}$ go to zero faster than $A_u$ in this limit. The behavior of the coefficients $T_{2,1}$ and $T_{1,1}$ is compared with results from a numerical resolution of the KdV equation in \fig{fig:KdV_T}. The important point is that imposing a hydrodynamic wave with an amplitude of order $1$ on one side will generate dispersive waves with amplitudes linear in $A_u \nobreak\hspace{.08em plus .04em} L_u$ on the other side, while the coefficients relating two dispersive waves are in $A_u^2 \nobreak\hspace{.08em plus .04em} L_u$. As will be shown in Section~\ref{sec:WH}, this is crucial to understand the effect of the undulation on the scattering in a white-hole-like flow. Moreover, this scaling is preserved in the more realistic model of appendix~\ref{app:UCP_tuned}, showing that the results obtained with the KdV equation qualitatively extend to that model. \begin{figure} \begin{center} \includegraphics[width = 0.49 \linewidth]{offundul.pdf} \end{center} \caption{Asymptotically turned-off undulation (see~\eq{eq:offundul}) for $L_u = 100$, $A_u \approx 0.1$, and $\sigma_u = 0.1$.} \label{fig:offundul} \end{figure} \begin{figure} \begin{center} \includegraphics[width = 0.49 \linewidth]{KdV_T12.pdf} \includegraphics[width = 0.49 \linewidth]{KdV_T22.pdf} \includegraphics[width = 0.49 \linewidth]{KdV_T12_bis.pdf} \includegraphics[width = 0.49 \linewidth]{KdV_T11_bis.pdf} \end{center} \caption{Plots of the absolute values of the coefficients $T_{2,1}$ (left panels) and $T_{1,1}$ (right panels) as functions of the length $L$ of an undulation of the form~\eqref{eq:offundul}, for $A_u \approx 0.05$, $\w = 1$, and for $\sigma_u = 1$ (top panels) and $\sigma_u = 0.1$ (bottom panels). Blue, continuous lines show numerical results, while the green, dashed lines show the analytical approximation~\eqref{eq:KdV_T_main}. The difference between the average slopes is due to higher-order effects, and the oscillations visible on the top plots seem due to the sharp variation of the amplitude at both ends of the undulation.} \label{fig:KdV_T} \end{figure} In this section we have thus obtained the low-frequency modes over a small-amplitude undulation and determined the corresponding transfer matrix. To study the scattering of water waves in the presence of undulation, there remains to determine which linear combination of these modes enters the incoming mode in a given configuration. This is done in Section~\ref{sec:WH} for a ``white-hole'' flow. \section{White-hole-like flows} \label{sec:WH} \subsection{Setup and general idea} As mentioned in the introduction, one motivation for studying water waves in the context of analogue gravity is the possibility to realize ``white hole'' flows with an analogue horizon. For definiteness, we work with flows oriented to the left. To fix the ideas, we here define a white-hole flow by the five properties: \begin{enumerate} \item The flow velocity $v$ and speed of long-wavelength perturbations in the fluid frame $c$ are piecewise-continuous functions of $x$ such that $c$ is positive and $v$ does not change sign; \item \label{ite:1} $v(x)$ and $c(x)$ are asymptotically uniform in the limits $x \to \pm \infty$; \item \label{ite:2} The flow is subcritical in the downstream region: \begin{equation} \lim_{x \to - \infty} \abs{\frac{v(x)}{c(x)}} < 1; \end{equation} \item It is supercritical in the upstream region: \begin{equation} \lim_{x \to + \infty} \abs{\frac{v(x)}{c(x)}} > 1; \end{equation} \item \label{ite:4} There exists only one point $x_h \in \mathbb{R}$ such that \begin{equation} \lim_{x \to x_h^-} \abs{\frac{v(x)}{c(x)}} \leq 1 \; \; \text{and} \; \; \lim_{x \to x_h^+} \abs{\frac{v(x)}{c(x)}} \geq 1. \end{equation} The point $x_h$ is the analogue horizon.~\footnote{Assuming $v / c$ is continuous, this condition simplifies to: there exists only one $x_h \in \mathbb{R}$ such that $\abs{v(x_h) / c(x_h)} = 1$.} \end{enumerate} Such setups have been extensively studied, see for instance Refs.~\cite{Macher:2009tw,Coutant:2011in,Coutant:2012mf,Coutant:2014cwa,Michel:2014zsa,Robertson:2016ocv}. One important result, related to the Hawking effect in astrophysical black holes, is the divergence of the scattering coefficient $\beta_\ensuremath{\omega}$ relating the incoming counterpropagating mode (corresponding to a wave sent from the downstream region upward) to the outgoing negative-energy wave. (An analytical proof is given in~\cite{Coutant:2017qnz}.) More precisely, $\beta_\ensuremath{\omega}$ gives the amplitude of the normalized (in the sense of \eq{eq:normom}, see Appendix~\ref{app:lag_lin_KdV} for details) negative-energy wave obtained when sending from the left a normalized counterpropagating incident wave with angular frequency $\ensuremath{\omega}$. The crucial point is that $\abs{\ensuremath{\omega} \nobreak\hspace{.08em plus .04em} \beta_\ensuremath{\omega}^2}$ has a finite limit as $\ensuremath{\omega} \to 0$, which is interpreted as the effective temperature $T_\mathrm{eff}$ of the analogue horizon.~\footnote{In quantum fluids, choosing units in which the Boltzmann and Planck constants are equal to $1$, $T_\mathrm{eff}$ is the low-frequency temperature of the ensemble of quasiparticles spontaneously produced by the analogue Hawking effect. In general, the effective temperatures defined using the various incoming modes will differ due to the coupling between co- and counterpropagating modes in the rest frame of the fluid~\cite{Macher:2009tw}. However, when using the KdV equation there are only two independent incoming modes over a transcritical flow, and conservation of the inner product~\eqref{eq:innerprod} ensures their effective temperatures are equal. } The effective temperature can be determined from the zero-frequency limits of the amplitudes of the plane waves in the asymptotic downstream region. Let us denote by $A_\mathrm{in}$ that of the incident wave and $A_\mathrm{neg}$ that of the negative-energy one. Using \eq{eq:norm_homo} to relate them to normalized waves and the dispersion relation~\eqref{eq:DR} to relate the wave vectors to the angular frequency $\ensuremath{\omega}$, one finds \begin{equation} \label{eq:effTeff} T_\mathrm{eff} = 2 \nobreak\hspace{.08em plus .04em} \bar{\w}(-\infty)^{3/2} \nobreak\hspace{.08em plus .04em} \abs{\frac{A_\mathrm{neg}}{A_\mathrm{in}}}^2. \end{equation} For sufficiently smooth white-hole flows, one can show~\cite{Coutant:2011in} that $T_\mathrm{eff} \approx \kappa / (2 \nobreak\hspace{.08em plus .04em} \pi)$, where $\kappa \equiv \abs{\ensuremath{\partial}_x \ensuremath{\left(} v + c \ensuremath{\right)}_{x = x_h}}$ is the analogue of the surface gravity. However, as also mentioned in the Introduction, flows realized in experiments generally have an undulation in the downstream region. To avoid ambiguity, we shall refer to them as ``white-hole-like'' flows, for which the conditions~\ref{ite:1} and~\ref{ite:2} above are replaced, respectively, by \begin{enumerate} \item[2'.] $v(x)$ and $c(x)$ are asymptotically uniform in the limit $x \to + \infty$ and periodic at $x \to - \infty$; \item[3'.] The flow is subcritical in the downstream region: \begin{equation} \exists \, x_M \in \mathbb{R}, \; \forall \nobreak\hspace{.08em plus .04em} x \in \mathbb{R}, \; x < x_M \Rightarrow \abs{v(x) / c(x)} < 1. \end{equation} \end{enumerate} Our aim in this section is to understand the effects of a small-amplitude undulation on $T_\mathrm{eff}$. To this end, we determine the wave content of the relevant mode as a function of $x$, which may be thought of as the position of a detector measuring the local wave amplitudes using a WKB approximation (or, equivalently, as the total length of the undulation if the measurement is performed in the flat asymptotic downstream region). As we shall see, because of the resonance discussed in Section~\ref{sec:KdV_tuned}, their amplitudes change significantly even when going far away from the horizon, which affects the effective temperature. When decreasing $x$ from $x_h$ toward $-\infty$, one obtains two limit regimes: \begin{itemize} \item Close to the horizon (more precisely, for small values of $A_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x_h - x \ensuremath{\right)}$), in the limit $A_u \ll 1$, the contribution from the undulation is negligible and one recovers the temperature $T_\mathrm{eff}^{(0)}$ of a white-hole flow without undulation; \item For $x_h - x \gg A_u^{-2}$, the wave content is dominated by the linearly growing terms over the undulation: $\beta_\ensuremath{\omega}$ then becomes proportional to $A_u$ and the effective temperature scales like $A_u^2$. \end{itemize} For this reason, and as will be shown more precisely below, the two limits $A_u \to 0$ (small undulation) and $x \to -\infty$ (long undulation) do not commute: sending first $A_u$ to $0$ and then $x$ to $-\infty$ gives $T_\mathrm{eff} = T_\mathrm{eff}^{(0)}$, while taking first $x \to -\infty$ and then $A_u \ll 1$ gives a different effective temperature $T_\mathrm{eff}^{(u)}$, determined by the behavior of the modes of Section~\ref{sec:KdV_tuned} over the undulation. In Section~\ref{KdV_WH:2} we consider a toy model in which $T_\mathrm{eff}^{(0)}$ and $T_\mathrm{eff}^{(u)}$ can be computed explicitly as well as the interpolation between them when decreasing $x$. In Section~\ref{KdV_WH:3} we generalize the calculation of $T_\mathrm{eff}^{(u)}$ using a forced KdV equation. \subsection{Low-frequency effective temperature: An explicit calculation} \label{KdV_WH:2} Let us consider the KdV equation with variable coefficient: \begin{equation} \label{eq:varKdV} \ensuremath{\partial}_t \eta + \ensuremath{\partial}_x \ensuremath{\left(} \w \nobreak\hspace{.08em plus .04em} \eta \ensuremath{\right)} + \ensuremath{\partial}_x^3 \eta + 6 \nobreak\hspace{.08em plus .04em} \eta \nobreak\hspace{.08em plus .04em} \ensuremath{\partial}_x \eta = 0, \end{equation} where $\w$ is a given function of $x$. We focus on time-independent solutions. Integrating \eq{eq:varKdV} over $x$ gives \begin{equation} \w \nobreak\hspace{.08em plus .04em} \eta + \ensuremath{\partial}_x^2 \eta + 3 \nobreak\hspace{.08em plus .04em} \eta^2 = C, \end{equation} where $C$ is a real constant. To be specific, let us assume that $\w$ has a steplike profile: \begin{equation} \label{eq:step} \w (x) = \ensuremath{\left\lbrace} \begin{aligned} & \w_- & & x < 0 \\ & \w_+ & & x > 0 \end{aligned} \right. \end{equation} for some real numbers $\w_- > 0$ and $\w_+ < 0$. The trivial solution $\eta = 0$ then corresponds to a white-hole flow with negative velocity. Stationary perturbations in the downstream region $x < 0$ are given by Eqs.~(\ref{eq:KdV_ku},\ref{eq:KdV-undul-sols}) with $\bar{\w}$ replaced by $\sqrt{\w_-^2 + 12 \nobreak\hspace{.08em plus .04em} C}$ and with $\eta_0 = (k_u^2 - \w_-)/6$. A similar procedure can be used to find the stationary solutions in the upstream region $x > 0$. At fixed $C$, they are described by a single parameter $A_d \in \mathbb{R}$: \begin{equation} \label{eq:dec_sol} \eta_d (x) = - \frac{\w_+ + k_d^2}{6} + A_d \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{e}}^{- k_d \nobreak\hspace{.08em plus .04em} x} - \frac{A_d^2}{k_d^2} \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{e}}^{- 2 \nobreak\hspace{.08em plus .04em} k_d \nobreak\hspace{.08em plus .04em} x} + \frac{3 \nobreak\hspace{.08em plus .04em} A_d^3}{4 \nobreak\hspace{.08em plus .04em} k_d^4} \ensuremath{\mathrm{e}}^{- 3 \nobreak\hspace{.08em plus .04em} k_d \nobreak\hspace{.08em plus .04em} x} + \ord{A_d^4}, \end{equation} where $k_d \equiv \ensuremath{\left(} \w_+^2 + 12 \nobreak\hspace{.08em plus .04em} C \ensuremath{\right)}^{1/4}$ is the decay rate of the perturbation to linear order. The general global solution is then given by \eq{eq:dec_sol} for $x > 0$ and by \eq{eq:KdV-undul-sols} for $x < 0$, with amplitude $A_u$ and phase $k_u \nobreak\hspace{.08em plus .04em} x_u$ related to $A_d$ by the requirement that $\eta$ be continuous and differentiable at $x = 0$. To leading order in $A_d$, these two requirements become \begin{equation} \sin \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x_u \ensuremath{\right)} \approx - \frac{k_d \nobreak\hspace{.08em plus .04em} A_d}{k_u \nobreak\hspace{.08em plus .04em} A_u} \end{equation} and \begin{equation} \label{eq:AuAd} A_u \approx \sqrt{\ensuremath{\left(} \frac{k_d^2 + k_u^2 + \w_+ - \w_-}{6} - A_d \ensuremath{\right)}^2 + \frac{k_d^2}{k_u^2} \nobreak\hspace{.08em plus .04em} A_d^2}. \end{equation} We now wish to compute the incoming, counterpropagating mode $\phi^{(\mathrm{in})}_\ensuremath{\omega}$ and its derivative $\delta\mkern-1.mu \eta^{(\mathrm{in})}_\ensuremath{\omega} \equiv \ensuremath{\partial}_x \phi_\ensuremath{\omega}^{(\mathrm{in})}$ at low frequency.~\footnote{The field $\phi$ is defined as the integral of $\delta\mkern-1.mu \eta$ over $x$. As is shown in appendix~\ref{app:lag_lin_KdV}, $\phi$ is the field appearing in the Lagrangian formulation of the KdV equation, and the natural quantity to define normalized modes.} We consider two cases: \begin{enumerate} \item As a warm-up exercise, we compute it over the homogeneous solution $\eta^{(0)} = 0$ and determine the corresponding effective temperature $T_\mathrm{eff}^{(0)}$; \item We then turn to the case $A_d \neq 0$, and thus $A_u \neq 0$, to see the effects of the undulation. \end{enumerate} \noindent \textbf{\\ Low-frequency effective temperature on the homogeneous solution $\eta = 0$: \\ \phantom{0}} \noindent To compute the effective temperature, one needs the structure of the incoming counterpropagating mode $\delta\mkern-1.mu \eta_\ensuremath{\omega}^{(\mathrm{in})}$, which corresponds to sending a wave from the left, in the low-frequency limit. We first notice that the waves with real wave vectors in the region $x > 0$ are incoming, with group velocities $v \pm c < 0$, and are thus absent in the mode we are interested in.~\footnote{In the derivation of the KdV equation, the limit $\abs{v / c} \to 1$ is taken. As a result, $v-c$ is not well defined and copropagating waves are uniform. Their group velocity is thus undefined. However, when using a more refined model such as that of Appendix~\ref{app:UCP_undul}, one finds that their group velocity is negative. The interested reader may also notice that this degeneracy is related to the constraint mentioned in footnote~\ref{foot:cons}.} This mode thus must be exponentially decreasing for $x \to \infty$. Second, we note that at zero frequency any stationary mode is an infinitesimal difference between two nonlinear stationary solutions. (See Section~\ref{subsec:tuned_mat} and appendix~\ref{app:lingrowmodes}.) In our case, the relevant stationary solution depends on the two parameters $C$ and $A_d$, giving two possible asymptotically bounded modes. However, as can be seen from \eq{eq:dec_sol}, $\ensuremath{\partial}_{A_d} \eta_d$ is exponentially decreasing as $x \to + \infty$ while $\ensuremath{\partial}_C \eta_d$ goes to a finite constant $-1 / \w_+$. In the low-frequency limit, we thus have \begin{equation} \delta\mkern-1.mu \eta^{(\mathrm{in})}_\ensuremath{\omega} \propto \ensuremath{\left(} \ensuremath{\partial}_{A_d} \eta^{(0)} \ensuremath{\right)}_{A_d = C = 0}. \end{equation} Evaluating the derivative and using the matching conditions at $x = 0$ gives \begin{equation} \delta\mkern-1.mu \eta^{(\mathrm{in})}_\ensuremath{\omega} \propto \ensuremath{\left\lbrace} \begin{aligned} & \ensuremath{\mathrm{e}}^{- k_d \nobreak\hspace{.08em plus .04em} x} & & x > 0 \\ & \cos \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)} - \frac{k_d}{k_u} \sin \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)} & & x < 0 \end{aligned} \right. . \end{equation} Integrating over $x$, one obtains: \begin{equation} \phi^{(\mathrm{in})}_\ensuremath{\omega} \propto \ensuremath{\left\lbrace} \begin{aligned} & \ensuremath{\mathrm{e}}^{- k_d \nobreak\hspace{.08em plus .04em} x} & & x > 0 \\ & 1 + \frac{k_d^2}{k_u^2} - \frac{k_d}{k_u} \sin \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)} - \frac{k_d^2}{k_u^2} \cos \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)} & & x < 0 \end{aligned} \right. . \end{equation} The effective temperature can then be determined using \eq{eq:effTeff}: the amplitude of the incoming wave, which is uniform in the limit $\ensuremath{\omega} \to 0$, goes to $1 + k_d^2 / k_u^2$ while that of the negative-energy wave, with wave vector $- k_u$ for $\ensuremath{\omega} = 0^+$, goes to $(k_d / (2 \nobreak\hspace{.08em plus .04em} k_u)) \nobreak\hspace{.08em plus .04em} \sqrt{1 + k_d^2 / k_u^2}$, giving \begin{equation}\label{eq:Teff0} T_\mathrm{eff}^{(0)} = \frac{\w_-^{3/2}}{2} \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} 1 + \abs{\frac{\w_-}{\w_+}} \ensuremath{\right)}^{-1}. \end{equation} Recalling from Equation~\eqref{eq:ommax} that $\omega_{\rm max} \propto \w_-^{3/2}$, this expression is of the same form as those found in the steplike regime of Bogoliubov-de Gennes~\cite{Finazzi:2012iu} and the quartic dispersion relation considered in~\cite{Robertson:2012ku}. \noindent \textbf{\\ Low-frequency effective temperature on a white-hole-like flow with undulation: \\ \phantom{0}} \noindent We now consider the case $A_d \neq 0$, and thus $A_u \neq 0$, keeping for simplicity $C = 0$ for the background flow. (This hypothesis will be relaxed below.) The idea of the calculation is the same as above. Since the background solution goes to zero exponentially in the limit $x \to + \infty$, the structure of the modes in this region is unaffected and $\phi_0^{(\mathrm{in})}$ must still be exponentially decreasing, which implies $\eta^{(\mathrm{in})}_0 \propto \ensuremath{\partial}_{A_d} \eta^{(0)}$. However, the additional terms in Equation~\eqref{eq:KdV-undul-sols} give linearly growing ones in $\phi_0^{(\mathrm{in})}$ in the limit $x \to - \infty$, represented in \fig{fig:KdV_backgs_ccmodes}. For sufficiently large values of $-x$ and small amplitudes $A_u$, the relative variations of the amplitudes of the waves over a distance $2 \nobreak\hspace{.08em plus .04em} \pi / k_u$ becomes negligible. Using a WKB approximation, the amplitudes of the incident and negative-energy waves for $\ensuremath{\omega} = 0^+$ can thus be locally evaluated unambiguously. \begin{figure} \centering \includegraphics[width=0.49\linewidth]{KdV_backg_3.pdf} \includegraphics[width=0.49\linewidth]{KdV_varphi_in_1_3.pdf} \caption{\textit{Left panel:} Plot of the homogeneous solution $\eta = 0$ (green) and of a modulated solution (blue) of the KdV equation with variable coefficient~\eqref{eq:varKdV}. The function $\w$ has a hyperbolic tangent profile $\w(x) = A + B \tanh (\sigma \nobreak\hspace{.08em plus .04em} x)$ with $\sigma = 100$ and $(A,B) \in \mathbb{R}^2$ chosen so that $\w(-\infty) = 0.8$ and $\w(+\infty) = -1.5$. \textit{Right panel :} Incoming, counterpropagating mode over the modulated solution (blue) and over the homogeneous solution $\eta = 0$ (green). (The normalization is arbitrary.)} \label{fig:KdV_backgs_ccmodes} \end{figure} An interesting point is that, when focusing on the limit $x \to - \infty$, one does not need to know the relationship between $(A_u, x_u)$ and $A_d$. Indeed, assuming $\ensuremath{\partial}_{A_d} A_u \neq 0$ (which can be verified explicitly using \eq{eq:AuAd}), and keeping only the constant term (which gives a linearly growing contribution to $\phi_0^{(\mathrm{in})}$ after integration over $x$) and the linearly growing one, we obtain \begin{equation} \delta\mkern-1.mu \eta_0^{(\mathrm{in})} \propto \ensuremath{\left(} - \frac{3 \nobreak\hspace{.08em plus .04em} A_u}{k_u^2} + \frac{15 \nobreak\hspace{.08em plus .04em} A_u^2}{2 \nobreak\hspace{.08em plus .04em} \w_-^{3/2}} \nobreak\hspace{.08em plus .04em} x \sin \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - x_u \ensuremath{\right)} \ensuremath{\right)} \ensuremath{\right)} \ensuremath{\partial}_{A_d} A_u + \cdots, \end{equation} where the neglected terms give finite contributions to $\phi_0^{(\mathrm{in})}$ in the limit $x \to - \infty$ or grow linearly with coefficients of higher order in $A_u$. Integrating over $x$ gives \begin{equation} \phi_0^{(\mathrm{in})} \propto - \ensuremath{\left(} \frac{3 \nobreak\hspace{.08em plus .04em} A_u}{k_u^2} + \frac{15 \nobreak\hspace{.08em plus .04em} A_u^2}{2 \nobreak\hspace{.08em plus .04em} \w_-^2} \cos \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} x - x_u \ensuremath{\right)} \ensuremath{\right)} \ensuremath{\right)} x \nobreak\hspace{.08em plus .04em} \ensuremath{\partial}_{A_d} A_u + \cdots \end{equation} Using again \eq{eq:effTeff}, one obtains the effective temperature: \begin{equation}\label{eq:Teff1} T_\mathrm{eff}^{(u)} \approx \frac{25 \nobreak\hspace{.08em plus .04em} A_u^2}{8 \nobreak\hspace{.08em plus .04em} \sqrt{\w_-}}. \end{equation} Equation~\eqref{eq:Teff1} (along with its generalization given later in~\eqref{Teffinftygen}) is the main result of this work. They show that an undulation with an arbitrarily small amplitude will, if extending over a sufficiently long domain (this condition is made more precise below), efficiently suppress the scattering, replacing the effective temperature $T_\mathrm{eff}^{(0)}$ of \eq{eq:Teff0} by $T_\mathrm{eff}^{(u)}$ of \eq{eq:Teff1}. Moreover, this new effective temperature goes to zero like $A_u^2$ for $A_u \to 0$. Although the above calculation is done in a very specific case, it is clear from the derivation that this scaling only depends on the properties of the periodic, stationary solutions for $x \to - \infty$ and thus applies much more generally. In particular, Equation~\eqref{eq:Teff1}, whose derivation involves only the properties of the flow in the asymptotic regions $x \to \pm \infty$, remains valid when replacing the steplike profile for $\mu$ with a smooth one. Below we consider two generalizations: in Section~\ref{KdV_WH:3} we use white-hole-like flows of the forced KdV equation and show that \eq{eq:Teff1} is recovered up to adding a constant to $\w_-$ accounting for the different mean background flow. In Appendix~\ref{app:UCP_tuned}, we use a more realistic model of water waves and find the same scaling between the effective temperature computed far from the horizon and the amplitude of the undulation. Before that, it is useful to consider the effective temperature $T_\mathrm{eff}(x)$ obtained when doing the measurement at a finite (negative) value of $x$. Redoing the above calculation while keeping the leading terms of constant amplitude in $\phi_0^{(\mathrm{in})}$ gives~\footnote{ If $A_d > 0$, \eq{eq:Teff_x} has a divergence for a finite negative value of $x$. This does not seem to indicate anything dramatic: it is only the consequence of a local cancellation between the wave with low wave vector present in the absence of undulation and the linearly growing part due to the latter, so that the amplitude of the incoming mode as measured there would vanish.} \begin{equation} \label{eq:Teff_x} T_\mathrm{eff}(x) \approx \frac{\w_-^{3/2}}{2} \nobreak\hspace{.08em plus .04em} \frac{1 + \frac{225 \nobreak\hspace{.08em plus .04em} A_u^4}{4 \nobreak\hspace{.08em plus .04em} \w_-^3} \nobreak\hspace{.08em plus .04em} x^2} {\ensuremath{\left(} \sqrt{1 - \frac{\w_-}{\w_+}} + \mathrm{sgn}(A_d) \frac{3 \nobreak\hspace{.08em plus .04em} \abs{A_u}}{\sqrt{\w_-}} \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)}^2}. \end{equation} This is represented in \fig{fig:KdV_T_x}. Three regimes can be distinguished: \begin{itemize} \item For $0 < - x \ll \sqrt{\w_- - \w_-^2 / \w_+} / (3 \nobreak\hspace{.08em plus .04em} \abs{A_u})$, the terms linear in $x$ are negligible and one recovers $T_\mathrm{eff}(x) \approx T_\mathrm{eff}^{(0)}$; \item For $- x \gg 2 \w_-^{3/2} / (15 \nobreak\hspace{.08em plus .04em} A_u^2)$, they become dominant and the effective temperature becomes $T_\mathrm{eff}(x) \approx T_\mathrm{eff}^{(u)}$; \item For $\sqrt{\w_- - \w_-^2 / \w_+} / (3 \nobreak\hspace{.08em plus .04em} \abs{A_u}) \ll - x \ll 2 \w_-^{3/2} / (15 \nobreak\hspace{.08em plus .04em} A_u^2)$, one finds an intermediate regime with \begin{equation} T_\mathrm{eff}(x) \approx \frac{\w_-^{5/2}}{18 \nobreak\hspace{.08em plus .04em} A_u^2 \nobreak\hspace{.08em plus .04em} x^2}. \end{equation} This regime is interesting as it shows how the temperature goes from the value $T^{(0)}_\mathrm{eff}$ to the (under our hypotheses) much smaller value $T^{(u)}_\mathrm{eff}$ when increasing the length of the undulation. In particular, one sees that the main parameter describing this transition is the product $A_u \nobreak\hspace{.08em plus .04em} x$ of the amplitude of the undulation and the length $x$ separating the point where the measurement is made from the analogue horizon. \end{itemize} \begin{figure} \centering \includegraphics[width=0.47\linewidth]{comptemp.pdf} \caption{Square root of the effective temperature computed numerically over a finite-length undulation with sharp cutoff (which causes the rapid oscillations with small amplitude) with $A_d = -0.03$, $\w_+ = 1$, and $\w_- = -1$, as a function of the cutoff position $x$. The temperature is adimensionalized by $T_\mathrm{eff}^{(0)}$ of \eq{eq:Teff0}. The green curve shows the numerical result. The blue, dotted one shows the approximation from \eq{eq:Teff_x} and the red, dashed line its limit $T_\mathrm{eff}^{(u)}$ of Equation~\eqref{eq:Teff1} for $x \to - \infty$. } \label{fig:KdV_T_x} \end{figure} As a consistency check, we compare in the right panel of the figure results from \eq{eq:Teff_x} to those from a numerical calculation of the effective temperature with a cutoff undulation. This finite undulation is defined by multiplying the background solution $\eta^{(0)}$ by $\theta(x - x_0)$, where $\theta$ is Heaviside's step function and $x_0 < 0$, so that the flow is asymptotically homogeneous and the scattering coefficients can be computed in the usual way~\cite{Macher:2009tw,Michel:2014zsa}. Apart from small oscillations coming from higher-order effects, whose relative amplitude seems linear in $A_u$, we observe a good agreement between the numerical and analytical results. Before moving on, let us pause to make a qualitative summary. As mentioned above, there are two resonances at zero frequency: a first-order one involving the ``hydrodynamic'' root $k = 0$ and one dispersive root, and a second-order one involving the two dispersive roots. The first resonance is responsible for the term linear in $x$.~\footnote{More precisely, it gives a finite constant to $\delta\mkern-1.mu \eta$, which after integration yields a linear term in $\phi$.} The second-order one yields the term in $x \cos (k_u \nobreak\hspace{.08em plus .04em} x)$. When moving away from $x = 0$, in the negative-$x$ direction, both the hydrodynamic and dispersive waves thus have amplitudes growing linearly in $\abs{x}$, with coefficients of orders $A_u$ and $A_u^2$, respectively. For sufficiently long undulations, these linearly growing terms dominate over the constant ones coming from the scattering in the region $x \approx 0$, giving values of $\beta_{\ensuremath{\omega} \approx 0}$ proportional to $A_u$, and thus a temperature proportional to $A_u^2$. We briefly investigated numerically the case of a finite slope of $u$ near the sonic horizon and found that: first, the qualitative behavior of $T_{\mathrm{eff}}(x)$ is similar to that in Figure~\ref{fig:KdV_T_x}; and second, the asymptotic value of $T_{\mathrm{eff}}(x)$ as $x \to -\infty$ is still given by Equation~(\ref{eq:Teff1}), as expected from the above analysis. \noindent \textbf{\\ Effect of a damped undulation: \\ \phantom{0}} \noindent A more physical way to send the amplitude of the undulation to zero at spatial infinity is to add a small dissipative term to the KdV equation. Focusing on stationary solutions, we work with the equation \begin{equation} \label{eq:KdV_dis} \ensuremath{\partial}_x^2 \eta + \w \nobreak\hspace{.08em plus .04em} \eta + 3 \nobreak\hspace{.08em plus .04em} \eta^2 - \nu \nobreak\hspace{.08em plus .04em} \ensuremath{\partial}_x \eta = 0, \end{equation} where $\nu \ll k_d, k_u$ is a small positive number. This equation may be written as \begin{equation} \ensuremath{\partial}_x \ensuremath{\left(} \frac{1}{2} \ensuremath{\left(} \ensuremath{\partial}_x \eta \ensuremath{\right)}^2 + \frac{\w}{2} \nobreak\hspace{.08em plus .04em} \eta^2 + \eta^3 \ensuremath{\right)} = \nu \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \ensuremath{\partial}_x \eta \ensuremath{\right)}^2. \end{equation} To leading order, the evolution of the amplitude $A_u$ of the undulation is thus given by \begin{equation} \ensuremath{\partial}_x \ensuremath{\left(} A_u^2 \ensuremath{\right)} \approx 2 \nobreak\hspace{.08em plus .04em} \nu \sin^2 \ensuremath{\left(} k_u \nobreak\hspace{.08em plus .04em} x \ensuremath{\right)} A_u^2. \end{equation} Since $\nu \ll k_u$, one can average this equation over a few wavelengths, leading to \begin{equation} A_u \propto \ensuremath{\mathrm{e}}^{\nu \nobreak\hspace{.08em plus .04em} x / 2} \end{equation} for $x < 0$. The effects of this damped undulation on the scattering can be estimated as follows. Locally, if $\nu$ is sufficiently small, the modes of Equation~\eqref{eq:KdV-linearized} have the same form as above, with $A_u$ now slowly varying with $x$. In particular, over an interval of length $\delta x$ centered on $x$ and such that $\nu \nobreak\hspace{.08em plus .04em} \abs{\delta x} \ll 1$, the nonoscillating part of $\phi^{(\mathrm{in})}_0$ will grow by a quantity proportional to $A_u(x) \nobreak\hspace{.08em plus .04em} \delta x$ and the oscillating part by a quantity proportional to $A_u(x)^2 \nobreak\hspace{.08em plus .04em} \delta x$. When computing their ratio for $x \to - \infty$ , $A_u$ should thus be replaced by \begin{equation} \frac{\int_{-\infty}^0 A_u(x)^2 \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{d}} x}{\int_{-\infty}^0 A_u(x) \nobreak\hspace{.08em plus .04em} \ensuremath{\mathrm{d}} x} = \frac{A_u(0)}{2}. \end{equation} For a given value of $A_u(0)$, one thus expects that the effective temperature $T_\mathrm{eff}^{(\mathrm{d})}$ measured at $x \to - \infty$ over a slowly damped undulation is $4$ times smaller than the result obtained without damping: \begin{equation}\label{eq:Td} T_\mathrm{eff}^{(\mathrm{d})} \approx \frac{25 \nobreak\hspace{.08em plus .04em} A_u(0)^2}{32 \nobreak\hspace{.08em plus .04em} \sqrt{\w_-}}. \end{equation} To illustrate this result, we show in \fig{fig:varphi5} the evolution of the effective temperature with $\nu$, computed numerically for different values of $x$. As expected from the above calculation, the two limits $x \to - \infty$ and $\nu \to 0^+$ do not commute: \begin{itemize} \item When sending $\nu$ to $0^+$ at fixed $x$ and then $x$ to $- \infty$, one recovers the effective temperature $T_\mathrm{eff}^{(u)}$ computed for $\nu = 0$; \item When sending first $x$ to $- \infty$ and then $\nu$ to $0^+$, the effective temperature we obtain is $4$ times smaller, in accordance with \eq{eq:Td}. \end{itemize} \begin{figure} \centering \includegraphics[width=0.49\linewidth]{eta0damped.pdf} \includegraphics[width=0.49\linewidth]{varphiindamped.pdf} \includegraphics[width=0.5\linewidth]{T_damp.pdf} \caption{\textit{Top:} A damped undulation solution of \eq{eq:KdV_dis} (left) and the incoming counterpropagating mode over this solution (right). The parameters are the same as in the right panel of \fig{fig:KdV_backgs_ccmodes}, and $\nu$ is set to $0.01$. \textit{Bottom:} Variation of the effective temperature with $\nu$, for relatively small values of this parameter. The value of $-x$, is multiplied by $2$ between each curve, from blue to green, with minimum value $-x_{\mathrm{max}} = 2000$. The dashed line materializes the value $1/4$.} \label{fig:varphi5} \end{figure} \subsection{Low-frequency effective temperature: Generalization} \label{KdV_WH:3} We now wish to generalize the main result of the above analysis, i.e., Equation~\eqref{eq:Teff1}, to a wider class of white-hole-like flows. Let us consider the forced KdV equation \begin{equation} \label{eq:fKdV} \ensuremath{\partial}_t \eta + \ensuremath{\partial}_x \ensuremath{\left(} \w \nobreak\hspace{.08em plus .04em} \eta \ensuremath{\right)} + \ensuremath{\partial}_x^3 \eta + 6 \nobreak\hspace{.08em plus .04em} \eta \nobreak\hspace{.08em plus .04em} \ensuremath{\partial}_x \eta = f, \end{equation} where $\w$ and $f$ are two smooth functions of $x$. We assume $\w$ has finite limits $\w_\pm$ as $x \to \pm \infty$ and that $f$ is integrable over $\mathbb{R}$. We denote as $h$ a primitive of $f$, and by $h_\pm$ its limits $x \to \pm \infty$. When looking for stationary solutions, \eq{eq:fKdV} can be integrated over $x$, giving \begin{equation} \w \nobreak\hspace{.08em plus .04em} \eta + \ensuremath{\partial}_x^2 \eta + 3 \nobreak\hspace{.08em plus .04em} \eta^2 = h + C, \end{equation} where $C$ is an integration constant. Locally, the properties of the solutions are identical to those obtained for $f = 0$, with $C$ shifted by $h$. In particular, if $\w$ and $h$ are homogeneous we have two uniform solutions $\eta(x) = (- \w \pm \sqrt{\w^2 + 12 \nobreak\hspace{.08em plus .04em} (C + h)}) / 6$, the one with the $+$ sign being subcritical while that with the $-$ sign is supercritical. We assume that $\w$ and $f$ are such that there exists a value $C_0$ of $C$ for which there is a white-hole solution, i.e., a solution going to $(- \w_\pm \mp \sqrt{\w_\pm^2 + 12 \nobreak\hspace{.08em plus .04em} (C_0 + h_\pm)}) / 6$ as $x \to \pm \infty$.~\footnote{This hypothesis should be satisfied without the need to fine-tune the functions $\w$ and $f$, as explained in~\cite{Michel:2014zsa}. Indeed, since the KdV equation is of order $3$, the general solution has three parameters. The condition that it is asymptotically uniform in the subcritical region gives two constraints to linear order while the same condition in the supercritical region gives only one constraint since one of the waves is exponentially decreasing. The number of constraints is thus equal to that of degrees of freedom, so one generally expects to find a discrete set of solutions.} Stationary solutions close to this white-hole flow are given \begin{itemize} \item in the limit $x \to + \infty$, by \eq{eq:dec_sol} with $C$ replaced by $C + h_+$, \item in the limit $x \to - \infty$, by Eqs.~(\ref{eq:KdV_ku},\ref{eq:KdV-undul-sols}) with $\w$ replaced by $\sqrt{\w_-^2 + 12 \nobreak\hspace{.08em plus .04em} (C+h_-)}$ and with $\eta_0 = (k_u^2 - \w_-)/6$. \end{itemize} As in the previous case, they depend on the two parameters $A_d$ and $C$, the quantities $A_u$ and $x_u$ being fixed by solving \eq{eq:fKdV}. As above also, the incoming counterpropagating mode must go to zero as $x \to +\infty$, which tells us that $\delta\mkern-1.mu \eta_0^{(\mathrm{in})} \propto \ensuremath{\partial}_{A_d} \eta$ at fixed $C$. Using Eqs.~(\ref{eq:KdV_ku},\ref{eq:KdV-undul-sols}) to determine the behavior of $\delta\mkern-1.mu \eta_0^{(\mathrm{in})}$ for $x \to - \infty$, integrating over $x$ to obtain $\phi_0^{(\mathrm{in})}$, and extracting the effective temperature using Equation~\eqref{eq:effTeff} gives, to leading order in $A_u$ and assuming $A_u \neq 0$, \begin{equation}\label{Teffinftygen} T_\mathrm{eff}^{(u)} \approx \frac{25 \nobreak\hspace{.08em plus .04em} A_u^2}{8 \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} \w_-^2 + 12 \nobreak\hspace{.08em plus .04em} \ensuremath{\left(} C + h_- \ensuremath{\right)} \ensuremath{\right)}^{1/4}}. \end{equation} The other results of the previous subsection also extend qualitatively to the present case. In particular, one still finds the three regimes: assuming the origin of $x$ is chosen close to the analogue horizon, and up to coefficients depending on the profiles of $\w$ and $f$, \begin{itemize} \item for $-x \ll A_u^{-1}$, $T_\mathrm{eff}(x)$ is close to that computed without the undulation; \item for $-x \gg A_u^{-2}$, $T_\mathrm{eff}(x) \approx T_\mathrm{eff}^{(u)}$; \item in the intermediate range $A_u^{-1} \ll -x \ll A_u^{-2}$, $T_\mathrm{eff}(x)$ scales like $1 / (A_u^2 x^2)$. \end{itemize} The reasoning leading to \eq{eq:Td} also remains valid up to minor modifications, showing that adding a small dissipative term will reduce the effective temperature as measured at infinity by a factor $4$ with respect to \eq{Teffinftygen}. \section{Conclusions} \label{sec:concl} We have studied the propagation of linear waves in spatially modulated water flows. In the main text we used a simple model based on the KdV equation, which shows the generic features in a relatively transparent way. The same problem is addressed in a more realistic model of water waves in Appendix~\ref{app:UCP}. In Appendix~\ref{app:detuned} we focus on the simpler case of a ``detuned'' undulation, whose wavelength is different from that of the low-frequency dispersive waves and which may be understood as a modulation of some external parameter such as, for instance, the height of an obstacle. In that case the resonance occurs when the wave number of the modulation, or an integer multiple of it, is equal to the difference between two roots of the dispersion relation at the same frequency. We considered waves propagating over stationary inhomogeneous solutions of the nonlinear KdV equation and found a low-frequency resonance with peculiar features. In particular, two modes grow linearly in space, which can be understood as the limit of the usual exponential behavior when the energy carried by each wave, and thus the growth rate, goes to zero. We show in appendix~\ref{app:lingrowmodes} that the linear modes are closely related to the structure of the nearby nonlinear solutions. Applying these results to white-hole-like flows with the analogue of a Killing horizon and a modulated free surface, we found that the latter can drastically modify the analogue Hawking emission provided it extends far enough from the horizon. For a sufficiently small amplitude (such that $T_{\rm eff}^{u} < T_{\rm eff}^{(0)}$), we analytically determined three regimes, depending on the length $L$ and amplitude $A$ of the undulation: a regime of ``short'' undulation where the latter hardly affects the scattering, one of ``long'' undulation where it completely fixes the effective temperature $T_\mathrm{eff} \propto A^2$, and an intermediate one where $T_\mathrm{eff} \propto 1/(A^2 L^2)$. These scaling laws constitute the main result of our work. Their derivation shows that they arise directly from the structure of the solutions close to asymptotically homogeneous white-hole ones, and we thus expect them to be fairly general. The analysis of Appendix~\ref{app:UCP} confirms that they also hold in the case of a more refined model of water waves. Finally, we considered the effect of a long undulation in the presence of a dissipative term sending its amplitude to zero at infinity. We found that, in the limit of small dissipation, the effective temperature is divided by $4$ with respect to the nondissipative result. These results were verified numerically by solving the KdV equation. These findings raise two important questions which we hope to address in future works. The first and, in principle, most straightforward one is to consider the same problem in other analogue gravity systems such as cold atoms or quantum fluids of light. While the similarities between the nonlinear solutions of the Gross-Pitaevskii and KdV equations seem to indicate that similar results will hold, it would be interesting to verify this explicitly and to determine the coefficients of the linearly growing terms in different systems. The second question concerns their application to experiments. Considering for instance the realization of~\cite{Euve:2015vml}, two elements prevent our results from being directly applicable. First, the experimental setup was slightly different from the one considered here, consisting of a subcritical water flow over a localized obstacle (briefly discussed in Appendix~\ref{app:sub}). Second, the undulation amplitude varied significantly over a few wavelengths. It is thus not clear to what extent the present analysis, based on the assumption of a slowly varying amplitude, can be trusted in this regime. We expect, however, that low-frequency resonances still play an important role. It would be of interest to obtain experimental data with a transcritical flow to be able to compare them with our results: the former could point to physical effects not included in the above analysis while the latter could help disentangle the contribution from the scattering on the undulation and from the analogue Hawking effect. As they stand, the main results of this article can already be used for estimating the parameter range in which the Hawking effect should dominate, which we hope will help guide the design of future analogue gravity experiments. \vspace*{2em} {\centering \bfseries \fontsize{12pt}{14pt}\selectfont Acknowledgments \par} \vspace*{0.5em} \noindent We thank Antonin Coutant, Silke Weinfurtner, and Vincent Pagneux for interesting discussions while preparing this work. We also thank Simone Speziale and our anonymous referee for bringing our attention to the Dirac procedure when handling the Hamiltonian formulation of the KdV equation and Roger Grimshaw for pointing out that some of our results may be recovered using Whitham’s modulation theory. We are also grateful to Antonin Coutant for his useful remarks on a previous version of this paper. F.~M. thanks the LPT Orsay, where part of this work was done, for its hospitality. This work was supported by the French National Research Agency through the Grant No. ANR-15-CE30-0017-04 associated with the project HARALAB. F.~M. is supported by the Leverhulme grant RPG-2016-233. This research was supported in part by Perimeter Institute for Theoretical Physics. Research at Perimeter Institute is supported by the Government of Canada through the Department of Innovation, Science and Economic Development and by the Province of Ontario through the Ministry of Research and Innovation. \titleformat{\section}{\large\bfseries}{
\section{Introduction} We consider second order partial differential equations of Kolmogorov-Fokker-Planck type in the form \begin{equation} \label{eq-4-autori-detailed} \begin{split} \partial_t u(v,x,t) + \sum_{j=1}^{n} v_{j} \partial_{x_j} u(v,x,t) = & \sum_{j,k=1}^{n} \partial_{v_j} \left( a_{jk}(v,x,t) \partial_{v_k} u(v,x,t) \right) \\ + & \, \sum_{j=1}^{n} b_{j}(v,x,t) \partial_{v_j} u(v,x,t) + f(v,x,t), \qquad (v,x,t) \in \Omega, \end{split} \end{equation} where: \begin{description} \item [{\it i)}] $\Omega$ is an open subset of $\mathbb{R}^{2n+1}$; \item [{\it ii)}] $A = \left(a_{jk}\right)_{j,k=1, \dots, n}$ is a symmetric matrix with real measurable entries. Moreover, there exist two positive constants $\lambda, \Lambda$ such that \begin{equation*} \lambda | \xi |^2 \le \langle A(v,x,t) \xi, \xi \rangle \le \Lambda | \xi |^2, \qquad \forall (v,x,t) \in \Omega, \quad \forall \xi \in \mathbb{R}^n; \end{equation*} \item [{\it iii)}] $b = \left( b_1, \dots, b_n \right)$ is a vector of $\mathbb{R}^n$ with bounded measurable coefficients; \item [{\it iv)}] $f \in L^{\infty}(\Omega)$. \end{description} As the coefficients of the operator $\mathscr{L}$ are measurable, we need to consider \emph{weak solutions} of $\mathscr{L} u = f$ in the following sense. Consider any open subset ${\Omega}$ of ${\mathbb {R}}^{2n+1}$. A weak solution to \eqref{eq-4-autori-detailed} is a function $u \in L^{2}_{\text{loc}}({\Omega})$ such that $\partial_{v_1} u, \dots, \partial_{v_n} u$ and the directional derivative $\partial_t u + \langle v, \nabla_x u \rangle$ belong to $L^{2}_{\text{loc}}({\Omega})$, and moreover \begin{equation*} \int_{{\Omega}} (\partial_t u + \langle v, \nabla_x u \rangle - \langle b, \nabla_v u \rangle) {\varphi} dv \, dx \, dt + \int_{{\Omega}} \langle A \nabla_v u, \nabla_v {\varphi} \rangle dv \, dx \, dt = \int_{{\Omega}} f {\varphi} dv \, dx \, dt, \end{equation*} for every $\forall {\varphi}\in C_{0}^{\infty}({\Omega})$. In the sequel of this note the equation \eqref{eq-4-autori-detailed} will be understood in the weak sense and will be written in the short form, $\mathscr{L} u = f$, where \begin{equation} \label{eq-4-autori} \mathscr{L} u =: \partial_t u + \langle v, \nabla_x u \rangle - {\rm div}_v (A \nabla_v u) - \langle b, \nabla_v u \rangle, \qquad (v,x,t) \in \Omega. \end{equation} \medskip The motivation for studying equation \eqref{eq-4-autori} comes from the Stochastic theory and from its applications to several research fields. Indeed, the operator $\mathscr{L}_0$ defined as \begin{equation} \label{eq-Kolmo} \mathscr{L}_0 u := \partial_t u + \langle v, \nabla_x u \rangle - \tfrac12 \, {\rm div}_v \left( \nabla_v u \right), \end{equation} was considered by Kolmogorov in \cite{Kolmogorov} to describe the probability density of a system with $2n$ degrees of freedom. Precisely, the fundamental solution $\Gamma = \Gamma(v,x,t; v_0, x_0, t_0)$ of \eqref{eq-Kolmo} is the density of the stochastic process \begin{equation} \label{eq-langevin} \begin{cases} V_t = v_0 + W_{t-t_0}, \\ X_t = x_0 + \int_{t_0}^t V_s ds, \qquad t > t_0, \end{cases} \end{equation} which is a solution to the Langevin equation $dV_t = dW_t, dX_t = V_t dt$. Here $(W_t)_{t>0}$ denotes a Wiener process. Note that $\mathscr{L}_0$ is a particular case of the differential operator appearing in \eqref{eq-4-autori}, as we choose $A$ equal to the $n \times n$ identity matrix $I_n$, multiplied by $\frac12$, and $b = 0$. Other applications of the operator in \eqref{eq-Kolmo} arise in the kinetic theory of gases. In this setting $\mathscr{L}$ takes the following general form \begin{equation} \label{eq-kinetic} Y u = \mathcal{Q} [u], \end{equation} where $Y$ denotes the \emph{total derivative} with respect to the time in the phase space $(v,x) \in \mathbb{R}^n\times \mathbb{R}^n$ \begin{equation} Y u := \partial_t u + \langle v, \nabla_x u \rangle, \end{equation} while $\mathcal{Q}$ is a collision operator, which can occur in the form of a second order differential operator, acting on the velocity variable $v$, that can appear either in linear or in nonlinear form. In the Fokker-Planck-Landau model $\mathcal{Q}$ depends on the variable $v$ and on the unknown solution $u$ through some integral expressions. For the description of the stochastic processes and kinetic models leading to equations of the type \eqref{eq-4-autori}, we refer to the classical monographs \cite{Chandresekhar}, \cite{DudMart} and \cite{ChapCow}. We also mention that equations similar to \eqref{eq-4-autori} appear in Finance. For instance the equation \begin{equation} \partial_t + \tfrac{1}{2} \sigma^2 S^2 \partial_S^2 V + S \partial_A V + r ( S \partial_S V- V) = 0 \end{equation} occurs in the Black \& Scholes framework when considering the problem of pricing Asian options. We refer to \cite{Alziary, BarraquandPudet, BarucciPolidoroVespri}, and \cite{Pascucci-book} for a more detailed discussion of this topic. \medskip The main theoretical interest in the operator $\mathscr{L}_0$ relies on its regularity properties, first noticed by Kolmogorov. Indeed, Kolmogorov writes in \cite{Kolmogorov} the explicit expression of the fundamental solution $\Gamma$ of \eqref{eq-Kolmo}, and points out the remarkable fact that it is a $C^\infty$ smooth function, despite the strong degeneracy of its characteristic form. Later, H\"ormander in \cite{Hormander} considers $\mathscr{L}_0$ as the prototype of a wide family of \emph{degenerate hypoelliptic operators}, with the following meaning. \emph{Let $\Omega$ be an open subset of $\mathbb{R}^{2n+1}$. We say that $\mathscr{L}_0$ is {\sc hypoelliptic} in ${\Omega}$ if, for every measurable function $u: \Omega \to \mathbb{R}$ which solves the equation $\mathscr{L}_0 u = f$ in the distributional sense, we have} \begin{equation} \label{eq-hypoellipticity} f \in C^\infty(\Omega) \quad \Rightarrow \quad u \in C^\infty(\Omega). \end{equation} In Section 2 we recall some known results about $\mathscr{L}_0$ and about more general linear second order differential operators, that in the sequel will be denoted by ${K_0}} %{\mathbf{K}$ (see \eqref{eq-Kolmo-RN} below), satisfying the H\"ormander's hypoellipticity condition introduced in \cite{Hormander}. Since the works by Folland \cite{Folland}, Rotschild and Stein \cite{RothschildStein}, Nagel, Stein and Wainger \cite{NagelSteinWainger} concerning operators satisfying the H\"ormarder's condition, it is known that the natural framework for the regularity of that operators is the analysis on Lie groups. The first study of the \emph{non-Euclidean} translation group related to the degenerate Kolmogorov operators ${K_0}} %{\mathbf{K}$ has been performed by Lanconelli and one of the authors in \cite{LP94}. This non-commutative structure underlying $\mathscr{L}_0$ has replaced the usual \emph{Euclidean translations} and the \emph{parabolic dilations} in the study of operators $\mathscr{L}$ with variable coefficients $a_{jk}$'s and $b_j$'s. The development of the regularity theory for operators $\mathscr{L}$ has been achieved in several steps, paralleling the history of the uniformly parabolic equations. In particular, several interesting results have been obtained as the definition of {\it H\"older continuous functions} is given in terms of the Lie group relevant to $\mathscr{L}_0$. We refer to Weber \cite{Weber}, Il'in \cite{Il'in}, Eidelman et al. \cite{Eidelman-et-al}, Polidoro \cite{Polidoro2}, Delarue and Menozzi \cite{DelarueMenozzi} for the construction of a fundamental solution based on the \emph{parametrix method}. We quote \cite{Polidoro2}, \cite{Polidoro1} for the proof of the upper and lower bounds for the fundamental solution, of mean value formulas and Harnack inequalities for the non-negative solutions $u$ of $\mathscr{L} u = 0$. Schauder type estimates have been proved by Satyro \cite{Satyro}, Lunardi \cite{Lunardi}, Manfredini \cite{Manfredini}. Analogous results have been proven in a more general context by Morbidelli \cite{Morbidelli}, Di Francesco and Pascucci \cite{DiFrancescoPascucci}, and Di Francesco and Polidoro \cite{DiFrancescoPolidoro}. The study of the operator $\mathscr{L}$ with {\it measurable coefficients} has required some tools for the construction of a functional analysis on the Lie group relevant to $\mathscr{L}_0$. In the work by Pascucci and Polidoro \cite{PP04}, the classical iterative method introduced by Moser (\cite{Moser3}, \cite{Moser3bis}), which in turn relies on the combination of a Caccioppoli inequality with a Sobolev inequality, have been used to obtain a $L^\infty$ upper bound for the weak solutions of $\mathscr{L} u = 0$. The Sobolev inequality has been obtained in \cite{PP04} by using the fundamental solution $\Gamma$ of $\mathscr{L}_0$ and its invariance with respect to the Lie group related to $\mathscr{L}_0$. The methods and the results of \cite{PP04} have been then extended to Kolmogorov type operators on non-homogeneous Lie groups by Cinti, Pascucci and Polidoro \cite{CintiPascucciPolidoro}; we also recall \cite{CintiPolidoro} and \cite{LP17} where similar techniques have been adapted to the non-Euclidean setting to prove $L^\infty$ local estimates for the solutions. A further important step in the functional analysis for operators $\mathscr{L}$ and for its regularity theory has been done by Wang and Zhang \cite{WangZhang1, WangZhang2}, who have proven a weak form of the Poincar\'e inequality and the H\"older continuity of the weak solutions $u$ of $\mathscr{L} u = 0$. More recently, Golse, Imbert, Mouhot and Vasseur \cite{4authors} provide us with an alternative proof of the H\"older continuity of the solutions and prove an invariant Harnack inequality for the positive solutions of $\mathscr{L} u = 0$. Based on the Harnack inequality of \cite{4authors}, Lanconelli, Pascucci and Polidoro prove in \cite{LPP} Gaussian upper and lower bounds for the fundamental solution of $\mathscr{L}$ (see also \cite{LP17}). \medskip In this note we prove a geometric version of the Harnack inequality proved in \cite{4authors}, whose statement is recalled in Theorem \ref{harnack} below, after some preliminary notation. In the unit box of ${\mathbb {R}}^{2n+1}$: \begin{equation} \label{eq-unitbox} Q \hspace{1mm} = \hspace{1mm} ]-1,1[^n \times ]-1,1[^n \times ]-1,0[, \end{equation} it reads as the usual parabolic Harnack inequality: there exist two \emph{small} boxes $Q^+$ and $Q^-$ contained in $Q$, with $Q^+$ located \emph{above} $Q^-$ with respect to the time variable, and a positive constant $M$, such that \[ \sup_{Q^{-}} u \le M (\inf_{Q^{+}} u + \left\| f \right\|_{L^{\infty} (Q)}) \] for every non-negative solution $u$ of $\mathscr{L} u = f$ in $Q$, with $f \in L^\infty(Q)$. \begin{center} \begin{pspicture*}(-8,-3)(8,3) \pcline[linecolor=dgrey](-3,0)(1,-1)% \pcline[linecolor=dgrey](-3,-2)(1,-3)% \pcline[linecolor=dgrey](3,0)(-1,1)% \pcline[linecolor=dgrey, linestyle=dashed](3,-2)(-1,-1)% \pcline[linecolor=dgrey](3,0)(3,-2)% \pcline[linecolor=dgrey](-3,0)(-3,-2)% \pcline[linecolor=dgrey](1,-1)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-1,1)(-1,-1)% \pcline[linecolor=dgrey](3,0)(1,-1)% \pcline[linecolor=dgrey](-3,0)(-1,1)% \pcline[linecolor=dgrey](3,-2)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-1,-1)(-3,-2) \pcline[linecolor=dgrey](0,-2)(0,1.4 \pcline[linecolor=dgrey](0,1.4)(-.05,1.2)% \pcline[linecolor=dgrey](0,1.4)(.05,1.2)% \uput[0](0,1.4){$t$} \pspolygon[fillstyle=solid,fillcolor=lgrey](0.8,-0.12)(0.6,-0.22)(-0.8,0.12)(-0.6,0.22) \pspolygon[fillstyle=solid,fillcolor=lgrey](-0.8,0.12)(-0.8,-0.43)(0.6,-0.77)(0.6,-0.22) \pspolygon[fillstyle=solid,fillcolor=lgrey](0.8,-0.12)(0.6,-0.22)(0.6,-0.77)(0.8,-0.67) \pspolygon[fillstyle=solid,fillcolor=lgrey](0.8,-1.12)(0.6,-1.22)(-0.8,-0.88)(-0.6,-0.78) \pspolygon[fillstyle=solid,fillcolor=lgrey](-0.8,-0.88)(-0.8,-1.43)(0.6,-1.77)(0.6,-1.22) \pspolygon[fillstyle=solid,fillcolor=lgrey](0.8,-1.12)(0.6,-1.22)(0.6,-1.77)(0.8,-1.67) \pcline[linecolor=dgrey,linestyle=dashed](0,-2)(0,1.4 \pcline[linecolor=dgrey](-4,1)(4,-1)% \pcline[linecolor=dgrey](4,-1)(3.8,-1)% \pcline[linecolor=dgrey](4,-1)(3.9,-.9)% \uput[0](4,-1){$v$} \pcline[linecolor=dgrey](2,1)(-2,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.8,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.9,-.9)% \uput[180](-2,-1){$x$} \uput[90](-1.8,0.8){$Q$} \uput[60](0.8,-0.25){$Q^+$} \uput[300](-1,-1.5){$Q^-$} \end{pspicture*} \end{center} \begin{center} {\scriptsize \sc Fig. 1 - Harnack inequality.} \end{center} \medskip We recall that, in the classical statement of the Harnack inequality for uniformly parabolic operators with measurable coefficients, the size of the boxes $Q^+$ and $Q^-$, and the gap between the lower basis of $Q^+$ and upper basis of $Q^-$ can be arbitrarily chosen (see Theorem of \cite{Moser3}). On the contrary, in the statement of the Harnack inequality for the operator $\mathscr{L}$ given in \cite{4authors}, neither the size of the boxes $Q^+$ and $Q^-$, nor their \emph{position} in $Q$ is characterized. Actually, as we will see in the sequel, it is known that the Harnack inequality does not hold for any choice of the boxes $Q^+$ and $Q^-$. This fact was previously noticed by Cinti, Nystr\"om and Polidoro in \cite{CNP10}, where classical solutions of $\mathscr{L}_0 u = 0$ are considered, and by Kogoj and Polidoro in \cite{KogojPolidoro}. We give here a sufficient condition for the validity of the Harnack inequality. For its precise statement we refer to the notion of \emph{attainable set} ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} }$ given in Definition \ref{prop-set} below. In the sequel ${\rm int}\big({ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } \big)$ denotes the interior of ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} }$. \begin{theorem} \label{mainthe} Let ${\Omega}$ be an open subset of ${\mathbb {R}}^{2n+1}$ and let $f \in L^{\infty} ({\Omega})$. For every $(v_{0}, x_{0}, t_{0}) \in {\Omega}$, and for any compact set $K \subseteq {\rm int} \big({ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } \big)$, there exists a positive constant $C_{K}$, only dependent on ${\Omega}$, $(v_{0}, x_{0}, t_{0})$, $K$ and on the operator $\mathscr{L}$, such that \begin{equation*} \sup_{K} u \le C_{K} \left( u(v_{0}, x_{0}, t_{0}) + \|f\|_{L^{\infty}({\Omega})} \right), \end{equation*} for every non-negative solution to $\mathscr{L} u = f$. \end{theorem} We note that any weak solution $u$ of $\mathscr{L} u = f$ is H\"older continuous (see \cite{WangZhang1, WangZhang2} for the equation $\mathscr{L} u = 0$, and Theorem 2 in \cite{4authors} for $\mathscr{L} u = f$ with $f \in L^\infty$), then $u(v_{0}, x_{0}, t_{0})$ is well defined. As we will see in the Definition \ref{prop-set}, the attainable set ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} }$ depends on the geometry of ${\Omega}$, and it can be easily described. For instance, when it agrees with the unit box $Q$ in \eqref{eq-unitbox} we have that \begin{equation} \label{eq-prop-set} \mathscr{A}_{(0,0,0)} = \Big\{ (v,x,t) \in Q \mid |x_j| \le |t|, j=1, \dots, n \Big\}. \end{equation} The proof of this fact can be seen in \cite{CNP10}, Proposition 4.5, p.$353$. \begin{center} \begin{pspicture*}(-8,-3)(8,3) \pcline[linecolor=dgrey](0,-2)(0,1.4 \pcline[linecolor=dgrey](0,1.4)(-.05,1.2)% \pcline[linecolor=dgrey](0,1.4)(.05,1.2)% \uput[0](0,1.4){$t$} \pcline[linecolor=dgrey](-4,1)(4,-1)% \pcline[linecolor=dgrey](4,-1)(3.8,-1)% \pcline[linecolor=dgrey](4,-1)(3.9,-.9)% \uput[0](4,-1){$v$} \pcline[linecolor=dgrey](2,1)(-2,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.8,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.9,-.9)% \uput[180](-2,-1){$x$} \pcline[linecolor=dgrey](-3,0)(1,-1)% \pcline[linecolor=dgrey](-3,-2)(1,-3)% \pcline[linecolor=dgrey](3,0)(-1,1)% \pcline[linecolor=dgrey, linestyle=dashed](3,-2)(-1,-1)% \pcline[linecolor=dgrey](3,0)(3,-2)% \pcline[linecolor=dgrey](-3,0)(-3,-2)% \pcline[linecolor=dgrey](1,-1)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-1,1)(-1,-1)% \pcline[linecolor=dgrey](3,0)(1,-1)% \pcline[linecolor=dgrey](-3,0)(-1,1)% \pcline[linecolor=dgrey](3,-2)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-3,-2)(-1,-1)% \pcline[linecolor=dgrey](-2,.5)(2,-.5)% \pcline[linecolor=dgrey, linestyle=dashed](0,0)(0,-2)% \pcline[linecolor=dgrey](2,-.5)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-2,.5)(-1,-1)% \pspolygon[fillstyle=solid,fillcolor=lgrey](-2,.5)(2,-.5)(1,-3)(-3,-2) \pspolygon[fillstyle=solid,fillcolor=grey](2,-.5)(3,-2)(1,-3) \pcline[linecolor=dgrey](2,1)(-2,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.8,-1)% \pcline[linecolor=dgrey](-2,-1)(-1.9,-.9)% \uput[180](-2,-1){$x$} \uput[90](-1.8,0.8){$Q$} \pcline[linecolor=dgrey](-3,0)(1,-1)% \pcline[linecolor=dgrey](-3,-2)(1,-3)% \pcline[linecolor=dgrey](3,0)(-1,1)% \pcline[linecolor=dgrey, linestyle=dashed](3,-2)(-1,-1)% \pcline[linecolor=dgrey](3,0)(3,-2)% \pcline[linecolor=dgrey](-3,0)(-3,-2)% \pcline[linecolor=dgrey](1,-1)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-1,1)(-1,-1)% \pcline[linecolor=dgrey](3,0)(1,-1)% \pcline[linecolor=dgrey](-3,0)(-1,1)% \pcline[linecolor=dgrey](3,-2)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-3,-2)(-1,-1)% \pcline[linecolor=dgrey](-2,.5)(2,-.5)% \pcline[linecolor=dgrey, linestyle=dashed](0,0)(0,-2)% \pcline[linecolor=dgrey](2,-.5)(1,-3)% \pcline[linecolor=dgrey, linestyle=dashed](-2,.5)(-1,-1)% \dotnode(0,0,0){O} \uput[115](0.16,0){$(0,0,0)$} \end{pspicture*} \end{center} \begin{center} {\scriptsize \sc Fig. 2 - $\mathscr{A}_{(0,0,0)}(Q)$.} \end{center} \medskip A direct consequence of our main result inequality is the following strong maximum principle. \begin{theorem} \label{maincor} Let ${\Omega}$ be an open subset of ${\mathbb {R}}^{2n+1}$, and let $u$ be a non-negative solution to $\mathscr{L} u = 0$. If $u(v_{0}, x_{0}, t_{0})=0$ for some $(v_{0}, x_{0}, t_{0}) \in {\Omega}$, then $u(v,x,t) = 0$ for every $(v,x,t) \in \overline{{ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} }}$. \end{theorem} Note that the Theorem \ref{maincor} extends to weak solution to $\mathscr{L} u = 0$ the well known Bony's strong maximum principle \cite{Bony69} for classical solutions of degenerate hypoelliptic Partial Differential Equations with smooth coefficients. We also recall the work of Amano \cite{Amano79}, where differential operators with continuous coefficients are considered. We also note that the Theorem \ref{maincor} is somehow optimal. Indeed, in Proposition 4.5 of \cite{CNP10} it is shown that there exists a non-negative solution $u$ to $\mathscr{L}_0 u = 0$ in $Q$ such that $u(v,x,t) = 0$ for every $(v,x,t) \in \overline{\mathscr{A}_{(0,0,0)}}$, and $u(v,x,t) > 0$ for every $(v,x,t) \in Q \backslash \overline{\mathscr{A}_{(0,0,0)}}$. \medskip This article is organized as follows. Section 2 contains some preliminary results and known facts about the regularity properties of the operator $\mathscr{L}_0$ and on its invariance with respect to a non-Euclidean group structure on ${\mathbb {R}}^{2n+1}$. It also contains a short discussion of the controllability problem related to $\mathscr{L}_0$ and the Definition of the Attainable set. In Section 3 we recall the Harnack inequality given in \cite{4authors} and we prove a dilation-invariant version of it. In Section 4 we prove our main results. \section{Preliminaries} \setcounter{equation}{0} In this Section we recall some known facts on the equation \eqref{eq-4-autori}, and on its prototype \eqref{eq-Kolmo}, that will play an important role in our study. We first recall that \eqref{eq-Kolmo} belongs to the more general class of differential operators considered in \cite{LP94}. Specifically, in \cite{LP94} have been studied operators in the following form \begin{equation} \label{eq-Kolmo-RN} {K_0}} %{\mathbf{K} u : = \sum_{i,j = 1}^{N} a_{i,j} \partial_{y_i y_j} u + \sum_{i,j = 1}^{N} b_{i,j} y_j \partial_{y_i} u + \partial_{t} u, \qquad (y,t) \in \mathbb{R}^{N+1}, \end{equation} where $\widetilde A=(a_{i,j})_{i,j=1,\ldots,N}$ and $B=(b_{i,j})_{i,j=1,\ldots,N}$ are constant matrices, with $\widetilde A$ symmetric and non-negative. We can choose, as it is not restrictive, a basis of $ \mathbb{R}^N$ such that $\widetilde A$ takes the following form \begin{equation*} \widetilde A = \begin{pmatrix} A & 0 \\ 0 & 0 \end{pmatrix}, \end{equation*} with the constant matrix $A=(a_{i,j})_{i,j=1,\ldots,m_0}$ strictly positive. Clearly, as $m_0 < N$ the operator ${K_0}} %{\mathbf{K}$ is strongly degenerate. The regularity properties of ${K_0}} %{\mathbf{K}$ depend on its first order part \begin{equation}\label{eq-Y} Y = \langle B y, \nabla \rangle + \partial_{t}. \end{equation} In order to clarify this assertion, we introduce some further notation. Let $C = (c_{i,j})_{i,j=1,\ldots,N}$ denote the \emph{square root of $\widetilde A$}, that is the unique positive symmetric matrix such that $C^2 = \widetilde A$. Then ${K_0}} %{\mathbf{K}$ can be written as \begin{equation}\label{eq-KK} {K_0}} %{\mathbf{K} = \sum_{j=1}^{m_0} X_{i}^2+ Y, \end{equation} with \begin{equation}\label{eq-VFK} X_{i}=\sum_{j=1}^{N}c_{ij}\partial_{y_{j}}, \quad i=1, \dots, m_{0}. \end{equation} With the above notation, the following statements are equivalent: \begin{description} \item [{$(H_1)$}] there exists a basis of ${\mathbb {R}}^{N}$ such that $B$ has the form \begin{equation}\label{eq-B} \left( \begin{array}{ccccc} \ast & \ast & \ldots & \ast & \ast \\ B_1 & \ast & \ldots & \ast & \ast \\ 0 & B_2 & \ldots & \ast & \ast \\ \vdots & \vdots & \ddots & \vdots & \vdots \\ 0 & 0 & \ldots & B_\kappa & \ast \end{array} \right), \end{equation} where $B_j$ is a matrix $m_{j} \times m_{j-1}$ of rank $m_j$, with $$ m_0 \geq m_1 \geq \ldots \geq m_\kappa \geq 1, \hspace{1.5cm} m_0 + m_1 + \ldots + m_\kappa = N, $$ while $\ast$ are constant and arbitrary blocks; \item [{$(H_2)$}] H\"{o}rmarder's condition: \begin{equation}\label{eq-rank} \text{rank\ Lie}\left(X_{1},\dots,X_{m_{0}},Y\right)=N+1, \quad \text{at every point of}\ {\mathbb {R}}^{N+1}; \end{equation} \item [{$(H_3)$}] Kalman's controllability condition: \begin{equation} \label{eq-Kal} \text{rank} \big( C, B C, \dots, B^{N-1} C \big) = N, \end{equation} (see \cite{LeeMarkus}, Theorem 5, p. 81). \end{description} For the equivalence of the above conditions we refer to \cite{LP94}. In the sequel, we assume that the basis of ${\mathbb {R}}^{N}$ is as in $(H_1)$. \medskip We note that the regularity properties of the differential operator ${K_0}} %{\mathbf{K}$ are related to some differential properties of the vector fields $X_{1},\dots,X_{m_{0}}, Y$. As we said in the Introduction, this fact was the starting point of the regularity theory for degenerate H\"ormander operators developed in \cite{Hormander, Folland, RothschildStein,NagelSteinWainger}. For this reason we will recall some basic facts about the Lie groups related to ${K_0}} %{\mathbf{K}$. It is known that every operator ${K_0}} %{\mathbf{K}$ is invariant with respect to a \emph{non-Euclidean} translation defined as follows. For every $(y_0, t_0), (y,t) \in {\mathbb {R}}^{N+1}$ we set \begin{equation}\label{eq-LieGR} (y_0, t_0) \circ (y,t) :=(y +\exp(t B) y_0,t+t_0). \end{equation} If $u$ is a solution of the equation $ {K_0}} %{\mathbf{K} u = f$ in some open set ${\Omega} \subset {\mathbb {R}}^{N+1}$, then the function $v(y,t) := u \left( (y_0, t_0) \circ (y,t) \right)$ is solution to ${K_0}} %{\mathbf{K} v = g$, where $g(y,t) := f \left( (y_0, t_0) \circ (y,t) \right)$ in the set $\big\{ (y,t) \in {\mathbb {R}}^{N+1} \mid (y_0, t_0) \circ (y,t) \in {\Omega} \big\}$. It is known that ${\mathbb {R}}^{N+1}$ with the operation ``$\circ$'' is a non commutative group, with identity $(0,0)$. The inverse of $(y,t)$ is \begin{equation}\label{eq-inverse} (y, t)^{-1} =(- \exp(- t B) y,-t). \end{equation} Moreover, if (and only if) all the $*$-block in \eqref{eq-B} are null, then ${K_0}} %{\mathbf{K}$ is homogeneous of degree two with respect to the family of the following dilatations, \begin{equation}\label{eq-dilGR} d_r := \text{\rm diag}\left(r I_{m_{0}},r^{3} I_{m_{1}},\dots,r^{2\kappa+1} I_{m_{\kappa}},r^{2}\right), \end{equation} ($I_{m_{j}}$ denotes the $m_{j}\times m_{j}$ identity matrix). In this case the following \emph{distributive property} of the dilation holds \begin{equation*} \big( d_r (y_0, t_0) \big) \circ \big( d_r (y,t) \big) = d_r \big( (y_0, t_0) \circ (y,t) \big), \end{equation*} for every $(y_0, t_0), (y,t) \in {\mathbb {R}}^{N+1}$ and for every $r>0$. In literature the structure \begin{equation} \label{eq-LieGroup} \mathbb{L} := \big( {\mathbb {R}}^{N+1}, \circ , (d_r)_{r>0} \big), \end{equation} is usually referred to as \emph{homogeneous Lie group}. We quote \cite{LP94} for the main properties of the Lie group $\mathbb{L}$ defined by \eqref{eq-LieGR}, \eqref{eq-dilGR}. \medskip We now introduce some basic notions of the Control Theory in order to describe the set where the Harnack inequality holds for the non-negative solutions of $\mathscr{L} u = f$ . As noticed above, the link between the Regularity Theory for linear PDEs and the Control Theory is not surprising, as the hypoellipticity of ${K_0}} %{\mathbf{K}$ is equivalent to the controllability condition $(H_3)$. The first notion we need is the $\mathscr{L}$-{\sc admissible curve}, the second one is that of {\sc attainable set}. For the precise statement of them we first consider the operator ${K_0}} %{\mathbf{K}$ in \eqref{eq-Kolmo-RN} and we recall the relevant notation \eqref{eq-KK}. We say that a curve $ {\gamma}: [0,T] \rightarrow {\mathbb {R}}^{N+1}$ is ${K_0}} %{\mathbf{K}$-{\sc admissible} if: \begin{itemize} \item it is absolutely continuous; \item $\dot{{\gamma}}(s) = \sum\limits_{k=1}^{m_0} \omega_k(s) X_k({\gamma}(s)) + Y(\gamma(s))$ a.e. in $[0,T]$, with ${\omega}_1, {\omega}_2, \dots, {\omega}_{m_0} \in L^{1}[0,T]$. \end{itemize} Moreover we say that ${\gamma}$ steers $ (y_{0}, t_{0})$ to $(y,t)$, for $t_0 > t$, if ${\gamma}(0) = (y_{0}, t_{0})$ and ${\gamma}(T) = (y, t)$. Note that $t(s) = t_0 - s$, then $T= t_0- t$ and $t_0 > t$. We denote by ${ \mathscr{A}_{(y_{0}, t_{0})} } ( {\Omega} )$ the following set: \begin{equation*} { \mathscr{A}_{(y_{0}, t_{0})} } ( {\Omega} ) = \begin{Bmatrix} (y,t) \in {\Omega} \mid \hspace{1mm} \text{\rm there exists a} \ {K_0}} %{\mathbf{K} - \text{\rm admissible curve} \ {\gamma} : [0,T] \rightarrow {\Omega} \hspace{1mm} \\ \hfill \text{\rm such that} \ {\gamma}(0) = (y_{0}, t_{0}) \hspace{1mm} {\rm and} \hspace{1mm} {\gamma}(T) = (y,t). \end{Bmatrix}. \end{equation*} We will refer to ${ \mathscr{A}_{(y_{0}, t_{0})} } ({\Omega})$ as {\sc attainable set}. \medskip In the sequel of this Section we focus on the equation \eqref{eq-Kolmo}, which writes in the form \eqref{eq-Kolmo-RN} if we choose $N= 2n, y = (v,x)$, \begin{equation*} A = I_n, \quad \text{and} \quad B = \begin{pmatrix} 0_n & 0_n \\ I_n & 0_n\end{pmatrix}. \end{equation*} Here $0_n$ and $I_n$ denote the zero and the identity $n \times n$ matrices, respectively. In particular, $\mathscr{L}_0$ satisfies the condition $(H_1)$ and is invariant with respect to a dilation of the form \eqref{eq-dilGR}. Moreover, if we identify any vector field $X =\sum_{j=1}^{2n}c_{j} \partial_{y_{j}}$ with the vector $\sum_{j=1}^{2n}c_{j}e_{j}$, being $e_j$ the the $j^{\rm th}$ vector of the canonical basis of ${\mathbb {R}}^{N}$, then $\mathscr{L}_0$ writes in the form \eqref{eq-KK} provided that we set \begin{equation*} Y = \langle v, \nabla_{x} \rangle + \partial_{t} \sim \begin{pmatrix} 0\\ \vdots\\ 0 \\ v_{1}\\ \vdots \\ v_{n}\\ 1 \end{pmatrix}, \qquad X_j = \partial_{v_{j}} \sim e_{j} = \begin{pmatrix} 0\\ \vdots\\ 1 \denoterow{1} \\ 0\\ \vdots\\ 0 \end{pmatrix} \hspace{15mm} {\rm for} \hspace{1mm} j=1, \ldots, n. \end{equation*} In this setting the Lie group $\mathbb{L}$ in \eqref{eq-LieGroup} is defined in terms of the following \emph{Galilean change of coordinate} in the Phase Space, \begin{equation} \label{eq-Gal-translation} (v_{0},x_{0},t_{0}) \circ (v,x,t) := (v + v_0, x_0 + x + t v_0, t_0 + t), \qquad (v_{0},x_{0},t_{0}), (v,x,t) \in {\mathbb {R}}^{2n+1}. \end{equation} Moreover, $\mathscr{L}_0$ is invariant with respect to the following \begin{equation} \label{eq-Gal-dilation} d_{r} (v,x,t) = (rv, r^{3}x, r^{2}t), \qquad (v,x,t) \in {\mathbb {R}}^{2n+1}, r>0. \end{equation} In the sequel we will denote by $\mathbb{G}$ the group defined in terms of \eqref{eq-Gal-translation} and \eqref{eq-Gal-dilation} \begin{equation} \label{eq-GalGroup} \mathbb{G} := \big( {\mathbb {R}}^{2n+1}, \circ , (d_r)_{r>0} \big), \end{equation} \medskip When we consider the operator ${K_0}} %{\mathbf{K} = \mathscr{L}_0$, the ${K_0}} %{\mathbf{K}$-admissible curves can be easily described. Indeed, if we denote \begin{equation*} {\gamma}(s) = (v(s), x(s), t(s)), \quad s \in [0,T], \end{equation*} then the problem \begin{equation*} \dot{{\gamma}}(s) = \sum_{k=1}^{m_0} \omega_k(s) X_k({\gamma}(s)) + Y(\gamma(s)), \quad {\gamma}(0) = (y, t), \ {\gamma}(T) = ({\eta}, {\tau}), \end{equation*} becomes \begin{equation} \label{eq-L-admissible} \dot v(s) = \omega(s), \quad \dot x(s) = v(s), \quad \dot t(s) = -1, \end{equation} and its solution is \begin{equation*} v(s) = v_{0} + \int_{0}^s \omega(\tau) d\, \tau, \quad x(s) = x_{0} + \int_{0}^sv(\tau) d\, \tau, \quad t(s) = t_0-s, \end{equation*} The controllability condition $(H_3)$ guarantees that, for every $(v,x,t) \in {\mathbb {R}}^{2n+1}$, with $t<t_0$, there is at least a \emph{control} $\omega =({\omega}_1, {\omega}_2, \dots, {\omega}_{n}) \in (\mathscr{L}^1 [0,T])^n$ such that the solution to \eqref{eq-L-admissible} satisfies $(v(T),x(T),t(T)) = (v,x,t)$. In the sequel we will use the following notation \begin{definition} \label{curva-amm} A curve $ {\gamma} = (v,x,t): [0,T] \rightarrow {\mathbb {R}}^{2n+1}$ is said to be $\mathscr{L}$-{\sc admissible} if it is absolutely continuous, and solves the equation \eqref{eq-L-admissible} for almost every $s \in [0,T]$, with ${\omega}_1, {\omega}_2, \dots, {\omega}_{n} \in L^{1}[0,T]$. Moreover we say that ${\gamma}$ steers $(v_0,x_0,t_0)$ to $(v,x,t)$, with $t_0 > t$, if ${\gamma}(0) = (v_0,x_0,t_0)$ and ${\gamma}(T) = (v,x,t)$. \end{definition} \medskip \begin{center} \begin{pspicture}(5,5) \label{gamma} \pcline[linecolor=dgrey](2,1)(2,4.8 \pcline[linecolor=dgrey](2,4.8)(1.95,4.6)% \pcline[linecolor=dgrey](2,4.8)(2.05,4.6)% \uput[0](2,4.8){$t$} \pcline[linecolor=dgrey](1.7,2.1)(5,1)% \pcline[linecolor=dgrey](5,1)(4.8,1)% \pcline[linecolor=dgrey](5,1)(4.9,1.1)% \uput[0](5,1){$v$} \pcline[linecolor=dgrey](2.2,2.1)(0,1)% \pcline[linecolor=dgrey](0,1)(0.1,1.1)% \pcline[linecolor=dgrey](0,1)(0.2,1)% \uput[180](0,1){$x$} \psbezier[linecolor=dgrey, linewidth=1pt] (0,2.5)(2,5)(4,1)(5,5) \uput[0](-3.25,2.5){$\gamma(T) = (v, x, t)$} \uput[0](5,5){$\gamma(0) = (v_0, x_0, t_0)$} \psset{linecolor=dgrey} \qdisk(0,2.5){2pt} \psset{linecolor=dgrey} \qdisk(5,5){2pt} \psline[linecolor=dgrey]{*->}(4,3.2)(5.2,2.9) \uput[90](5.5,2.9){$X = \partial_v$} \psline[linecolor=dgrey]{*->}(4,3.2)(2.8,3.5) \uput[90](3.4,3.3){$- X$} \psline[linecolor=dgrey]{*->}(4,3.2)(2.5,2.15) \uput[135](2.9,2.3){$\dot \gamma(s)$} \psline[linecolor=dgrey]{*->}(4,3.2)(3.3,1.9) \uput[0](3.5,2.1){$Y = v \partial_x - \partial_t$} \pcline[linecolor=dgrey, linestyle=dashed](2.5,2.15)(3.3,1.9) \pcline[linecolor=dgrey, linestyle=dashed](2.5,2.15)(3.2,3.4) \end{pspicture} \end{center} \begin{center} {\scriptsize \sc Fig. 3 - An $\mathscr{L}-$admissible curve steering $(v_{0}, x_{0}, t_{0})$ to $(v, x, t)$.} \end{center} \medskip \begin{definition} \label{prop-set} Let ${\Omega}$ be any open subset of ${\mathbb {R}}^{2n+1}$, and let $(v_0,x_0,t_0) \in {\Omega}$. We denote by ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } ( {\Omega} )$ the following set: \begin{equation*} { \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } ( {\Omega} ) = \begin{Bmatrix} (v,x,t) \in {\Omega} \mid \hspace{1mm} \text{\rm there exists an} \ \mathscr{L} - \text{\rm admissible curve} \ {\gamma} : [0,T] \rightarrow {\Omega} \hspace{1mm} \\ \hfill \text{\rm such that} \ {\gamma}(0) = (v_{0}, x_{0}, t_{0}) \hspace{1mm} {\rm and} \hspace{1mm} {\gamma}(T) = (v,x,t). \end{Bmatrix}. \end{equation*} We will refer to ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } ({\Omega})$ as {\sc attainable set}. We will use the notation ${ \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } = { \mathscr{A}_{(v_{0}, x_{0}, t_{0})} } ( {\Omega} )$ whenever there is no ambiguity on the choice of the set ${\Omega}$ . \end{definition} \section{Harnack inequalities} \setcounter{equation}{0} In this Section we recall the Harnack inequality for equation $\mathscr{L} u = f$ due to Golse, Imbert, Mouhot and Vasseur (see Theorem 3 in \cite{4authors}), then we prove some preliminary results useful for the proof of our Theorem \ref{mainthe}. Let $Q = ]-1,1[^{2n} \times ]-1,0[$ be the \emph{unit box} introduced in \eqref{eq-unitbox}. Based on the dilation \eqref{eq-Gal-dilation} and on the Galilean translation \eqref{eq-Gal-translation}, for every positive $r$ and for every $(v_{0}, x_{0}, t_{0})$ we define the sets \begin{equation*} \begin{split} & Q_{r} := d_r Q = \big\{d_r (v,x,t) \mid (v,x,t) \in Q \big\},\\ & Q_{r}(v_{0}, x_{0}, t_{0}) := (v_{0}, x_{0}, t_{0}) \circ d_r Q = \\ & \qquad \qquad \qquad \big\{ (v_{0}, x_{0}, t_{0}) \circ d_r (v,x,t) \mid (v,x,t) \in Q \big\}. \end{split} \end{equation*} A direct computation shows that \begin{equation*} \begin{split} Q_{r} \hspace{1mm} = \hspace{1mm} ]-r,r[^n & \times ]-r^{3},r^{3}[^n \times ]-r^{2},0[, \\ Q_{r}(v_{0}, x_{0}, t_{0}) = & \Big\{ (v,x,t) \in {\mathbb {R}}^{2n+1} \mid |(v - v_{0})_j| < r, \\ & |(x- x_{0} - (t - t_{0}) v_{0})_j | < r^{3}, j=1, \dots, n, t_{0}- r^2 < t < t_{0} \Big\}. \end{split} \end{equation*} With the above notation, the following result holds. \begin{theorem} \label{harnack}{\rm (Theorem 2 in \cite{4authors})} There exist three constants $M > 1, R >0, {\Delta} >0$, with $0 < R^{2} < {\Delta} < {\Delta} + R^{2} < 1$, such that \begin{equation*} \sup_{Q^{-}} u \le M (\inf_{Q^{+}} u + \left\| f \right\|_{L^{\infty} (Q))}) \end{equation*} for every non-negative weak solution $u$ to the equation $\mathscr{L} u = f$ on $Q$, with $f \in L^\infty(Q)$. The constants $M, R$ and ${\Delta}$ only depend on the dimension $n$ and on the ellipticity constants ${\lambda}$ and ${\Lambda}$. Moreover $Q^{+}, Q^{-}$ are defined as follows \begin{equation*} Q^{+} = Q_{R} \hspace{2mm} {\rm with} \hspace{2mm} 0 < R^{2} < {\Delta} < {\Delta} + R^{2} < 1, \hspace{8mm} Q^{-} = Q_{R}(0, 0, -{\Delta}). \end{equation*} \end{theorem} As Golse, Imbert, Mouhot and Vasseur notice in Remark 4 in \cite{4authors}, ``using the transformation \eqref{eq-Gal-translation}, we get a Harnack inequality for cylinders centered at an arbitrary point $(v_0, x_0,t_0)$''. We next give a precise meaning to this assertion and we improve it by also using the dilation \eqref{eq-Gal-dilation}. \begin{theorem} \label{harnack-inv} Let $(v_{0}, x_{0}, t_{0})$ be any point of ${\mathbb {R}}^{2n+1}$ and let $r$ be a positive number. There exist three constants $M > 1, R >0, {\Delta} >0$, with $0 < R^{2} < {\Delta} < {\Delta} + R^{2} < 1$, such that \begin{equation*} \sup_{Q^{-}_{r}(v_{0}, x_{0}, t_{0})} u \le M (\inf_{Q^{+}_{r}(v_{0}, x_{0}, t_{0})} u + \left\| f \right\|_{L^{\infty} (Q_{r}(v_{0}, x_{0}, t_{0})}) \end{equation*} for every non-negative weak solution $u$ to the equation $\mathscr{L} u = f$ on $Q_{r}(v_{0}, x_{0}, t_{0})$, with $f \in L^\infty(Q_{r}(v_{0}, x_{0}, t_{0}))$. The constants $M, R$ and ${\Delta}$ only depend on the dimension $n$ and on the ellipticity constants ${\lambda}$ and ${\Lambda}$. Moreover $Q^{+}_{r}(v_{0}, x_{0}, t_{0}), ^{-}Q_{r}(v_{0}, x_{0}, t_{0})$ are defined as follows \begin{equation*} Q^{+}_{r}(v_{0}, x_{0}, t_{0}) = (v_{0}, x_{0}, t_{0}) \circ d_r Q^{+}, \qquad Q^{-}_{r}(v_{0}, x_{0}, t_{0}) = (v_{0}, x_{0}, t_{0}) \circ d_r Q^{-}. \end{equation*} \end{theorem} \begin{proof} We rely on the invariance of the operator $\mathscr{L}_0$ with respect to the group \eqref{eq-GalGroup}. If $u$ is a non-negative solution to $\mathscr{L} u = f$ in $Q_{r}(v_{0}, x_{0}, t_{0})$, then the function $\widetilde u (v,x,t) := u \left( d_{1/r} \big((v_0, x_0, t_0)^{-1} \circ (v,x,t) \big) \right)$ is a solution in the unit box $Q$ to the following equation \begin{equation*} \widetilde \mathscr{L} \widetilde u =: \partial_t \widetilde u + \langle v, \nabla_x \widetilde u \rangle - {\rm div}_v (\widetilde A \nabla_v \widetilde u) - \langle \widetilde b, \nabla_v \widetilde u \rangle = \widetilde f. \end{equation*} Here $\widetilde A (v,x,t) := A \left( d_{1/r} \big( (v_0, x_0, t_0)^{-1} \circ (v,x,t) \big) \right)$, $\widetilde b (v,x,t) := b \left( d_{1/r} \big( (v_0, x_0, t_0)^{-1} \circ (v,x,t) \big) \right)$ and $\widetilde f (v,x,t) := f \left( d_{1/r} \big( (v_0, x_0, t_0)^{-1} \circ (v,x,t) \big) \right)$. Moreover $(v_0, x_0, t_0)^{-1}$ is defined in \eqref{eq-inverse}. Even though $\widetilde \mathscr{L}$ does not agree with $\mathscr{L}$, it satisfies the hypotheses of Theorem \ref{harnack} with the same structural constants $n$, ${\lambda}$ and ${\Lambda}$. We then apply Theorem \ref{harnack} to the function $\widetilde u$ and we plainly obtain our claim for $u$. \end{proof} An useful tool in the proof of our main theorem is the following lemma (Lemma 2.2 in \cite{BP07}). To give here its statement we introduce a further notation. We choose any $S \in ]0,R[$ and we set \begin{equation*} K^- = [ - S, S ]^n \times \left[ - S^3, S^3 \right]^n \times \big\{ - \left( \Delta + R^2/2 \right) \big\}. \end{equation*} Moreover, for every $(v,x,t) \in {\mathbb {R}}^{2n+1}$ and $r>0$ we let \begin{equation*} K^-_r(v,x,t) = (v,x,t) \circ d_r (K^-). \end{equation*} We have that \begin{lemma} \label{lemma2.2} Let ${\gamma}: [0,T] \rightarrow {\mathbb {R}}^{2n+1}$ be an $\mathscr{L}-$admissible path and let $a, b$ be two constants s.t. $0 \le a < b \le T$. Then there exists a positive constant $h$, only depending on $\mathscr{L}$, such that \begin{equation*} \int_{a}^{b} |{\omega} ({\tau})|^{2} {\delta}{\tau} \le h \hspace{4mm} \implies \hspace{4mm} {\gamma}(b) \in K^{-}_{r}({\gamma}(a)), \hspace{2mm} {\rm with} \hspace{2mm} r = \sqrt{ \frac{b - a}{({\Delta} + 1/2)}}. \end{equation*} \end{lemma} \begin{remark} \label{rem-l22} Note that $K^-_r(v,x,t)$ is a compact subset of $Q^-_r(v,x,t)$ for every $(v,x,t) \in {\mathbb {R}}^{2n+1}$ and for any $r>0$. As a consequence of Lemma \ref{lemma2.2}, $K^{-}_{r}({\gamma}(a))$ is an open neighborhood of ${\gamma}(b)$. \end{remark} \section{Proof of the main results} \setcounter{equation}{0} An useful notion in the proof of our main result is that of {\sc Harnack chain}. \begin{definition} \label{def-chain} We say that $\{ z_{0}, \ldots, z_{k} \} \subseteq {\Omega}$ is a Harnack chain connecting $z_{0}$ to $z_{k}$ if there exist $k$ positive constants $C_{1}, \ldots, C_{k}$ such that \[ u(z_{j}) \le C_{j} u(z_{j-1})) \hspace{5mm} j = 1, \ldots, k \] for every non-negative solution $u$ of $\mathscr{L} u = f$ in ${\Omega}$. \end{definition} Our first result of this Section is a local version of Theorem \ref{mainthe}. \begin{proposition} \label{proposition} For every $(v, x, t) \in {\rm int} \big( \mathscr{A}_{(v_{0}, x_{0}, t_{0})} \big)$ there exist an open neighborhood $U_{(v,x,t)}$ of $(v, x, t)$ and a positive constant $C_{(v, x, t)}$ such that \begin{equation*} \sup_{U_{(v,x,t)}} u \le C_{(v, x, t)} \hspace{1mm} \left( u(v_{0},x_{0},t_{0}) \hspace{1mm} + \hspace{1mm} \left\| f \right\|_{L^{\infty}({\Omega})} \right), \end{equation*} for every non-negative solution to $\mathscr{L} u = f$, with $f \in L^{\infty}({\Omega})$. \end{proposition} \begin{proof} Let $(v,x,t)$ be any point of ${\rm int} \big( \mathscr{A}_{(v_{0}, x_{0}, t_{0})} \big)$. We plan to prove our claim by constructing a finite Harnack chain connecting $(v, x, t)$ to $(v_{0}, x_{0}, t_{0})$. Because of the very definition of $\mathscr{A}_{(v_{0}, x_{0}, t_{0})}$, there exists a $\mathscr{L}-$admissible curve ${\gamma} : [0, T] \rightarrow {\Omega}$ steering $(v_{0}, x_{0}, t_{0})$ to $(v,x,t)$. Our Harnack chain will be a finite subset of ${\gamma}([0,T])$. In order to construct our Harnack chain, we introduce a further notation. Let $\widetilde Q := ]-1,1[^{2n+1}$ and note that it is an open neighborhood of the origin of ${\mathbb {R}}^{2n+1}$. Because of the continuity of the Galilean change of variable ``$\circ$'' and of the dilation $\left( d_r \right)_{r>0}$, for every $(v',x',t') \in {\mathbb {R}}^{2n+1}$, the family \begin{equation} \left( \widetilde Q_r(v',x',t') \right)_{r>0}, \qquad \widetilde Q_r(v',x',t') := (v',x',t') \circ d_r \widetilde Q, \end{equation} is a neighborhood basis of the point $(v',x',t')$. Then, again because of the continuity of ``$\circ$'' and $\left( d_r \right)_{r>0}$, for every $s \in [0,T]$ there exists a positive $r$ such that $\widetilde Q_{r}({\gamma}(s)) \subseteq {\Omega}$. Thus we can define \begin{equation} \label{rs} r(s) \hspace{1mm} := \hspace{1mm} \sup \left\{ r > 0 \hspace{1mm} : \hspace{1mm} \widetilde Q_{r}({\gamma}(s)) \subseteq {\Omega} \right\}. \end{equation} Note that the function \eqref{rs} is continuous, then it is well defined the positive number \begin{equation} \label{r} r_0 \hspace{1mm} := \hspace{1mm} \min_{s \in [0,T]} r(s). \end{equation} As $Q_{r}({\gamma}(s)) \subset \widetilde Q_{r}({\gamma}(s))$, we conclude that \begin{equation} \label{Qr} Q_{r}({\gamma}(s)) \subseteq {\Omega} \quad \text{for every} \ s \in [0,T] \quad \text{and} \ r \in ]0, r_0]. \end{equation} On the other hand, we notice that the function \begin{equation} I(s) \hspace{1mm} := \hspace{1mm} \int_{0}^{s} | {\omega} ({\tau})|^{2} dt, \end{equation} is (uniformly) continuous in $[0,T]$, then there exists a positive $\delta_0$ such that $\delta_0 \le ({\Delta} + R^{2}/2) r_0$ and that \begin{equation} \label{delta} \int_{a}^{b} | {\omega} ({\tau})|^{2} dt \le h \qquad \text{for every} \ a,b \in [0,T], \quad \text{such that} \ 0 < a-b \le {\delta}_0, \end{equation} where $h$ is constant appearing in Lemma \ref{lemma2.2}. We are now ready to construct our Harnack chain. Let $k$ be the unique positive integer such that $(k-1) {\delta}_0 < T$, and $k {\delta}_0 \ge T$. We define $\{ s_{j} \}_{j \in \{ 0, 1, \ldots, k \}} \in [0,T]$ as follows: $s_j = j {\delta}_0$ for $j=0,1, \dots, k-1$, and $s_k =T$. As noticed before, the equation \eqref{delta} allows us to apply Lemma \ref{lemma2.2}. We then obtain \begin{equation} \label{propsuccessione} {\gamma}(s_{j+1}) \in Q^{-}_{{r_0}} ({\gamma}(s_{j})) \hspace{5mm} j=0, \ldots, k-2, \qquad {\gamma}(s_k) \in Q^{-}_{{r_1}} ({\gamma}(s_{k-1})), \end{equation} for some $r_1 \in ]0, r_0]$. We next show that $\left( {\gamma}(s_{j}) \right)_{j=0,1, \dots,k}$ is a Harnack chain and we conclude the proof. We proceed by induction. For every $j = 1, \ldots, k-2$ we have that ${\gamma} (s_{j+1}) \in Q^{-}_{{r_0}} ({\gamma}(s_{j}))$. From \eqref{Qr} we know that $Q_{{r_0}} ({\gamma}(s_{j})) \subseteq \Omega$, then we apply Theorem \ref{harnack} and we find \begin{align*} u({\gamma}(s_{j+1})) \le \sup_{Q^{-}_{{r_0}}({\gamma} (s_{j}))} u \le \ M \Big( \inf_{Q^{+}_{{r_0}}({\gamma} (s_{j}))} u + & \ \left\| f \right\|_{L^{\infty} (Q ({\gamma} (s_{j})))} \Big) \\ & \ \le M \Big( u({\gamma} (s_{j})) + \left\| f \right\|_{L^{\infty} (\Omega)} \Big). \end{align*} Here we rely on the fact that $u$ is a continuous function. As a consequence we obtain \begin{align*} u({\gamma} (s_{k-1})) &\le M ( u({\gamma}(s_{k-2})) + \left\| f \right\|_{L^{\infty} ({\Omega}) }) \\ &\le M ( M ( u({\gamma}(s_{k-3})) + \left\| f \right\|_{L^{\infty} ({\Omega})}) + \left\| f \right\|_{L^{\infty} ({\Omega}) }) \\ &\setbox0\hbox{=}\mathrel{\makebox[\wd0]{\hfil\vdots\hfil}} \\ &\le M^{k-1} u({\gamma}(0)) + \left\| f \right\|_{L^{\infty} ({\Omega}) } \sum_{i=1}^{k-1} M^{i}. \end{align*} We eventually apply Theorem \ref{harnack} to the set $Q_{{r_1}} ({\gamma}(s_{k-1})) \subseteq \Omega$ and we obtain \begin{equation*} \sup_{U_{(v,x,t)}} u \le C_{(v, x, t)} \hspace{1mm} \left( u(v_{0},x_{0},t_{0}) \hspace{1mm} + \hspace{1mm} \left\| f \right\|_{L^{\infty}({\Omega})} \right), \end{equation*} where $C_{(v, x, t)} = \sum_{i=1}^{k} M^{i}$ and $U_{(v,x,t)} = Q^{-}_{{r_1}} ({\gamma}(s_{k-1}))$. As we noticed in Remark \ref{rem-l22}, $Q^{-}_{{r_1}} ({\gamma}(s_{k-1}))$ is an open neighborhood of ${\gamma}(T)$. This concludes the Proof of Proposition \ref{proposition}. \end{proof} \medskip \noindent {\sc Proof of Theorem \ref{mainthe}}. Let $K$ be any compact subset of ${\rm int} \left( \mathscr{A}_{(v_{0}, x_{0}, t_{0})} \right)$. For every $(v,x,t) \in K$ we consider the open set $U_{(v,x,t)}$. Clearly we have \begin{equation*} K \hspace{1mm} \subseteq \hspace{1mm} \bigcup_{(v,x,t) \in K} \hspace{1mm} U_{(v,x,t)}. \end{equation*} Because of its compactness, there exists a finite covering of $K$ \begin{equation*} K \hspace{1mm} \subseteq \hspace{1mm} \bigcup_{j=1, \ldots, m_{K}} \hspace{1mm} U_{(v_{j},x_{j},t_{j})}, \end{equation*} and Proposition \ref{proposition} yields we \begin{equation*} \sup_{U_{(v_{j},x_{j},t_{j})}} u \le C_{(v_{j},x_{j},t_{j})} \hspace{1mm} \left( u(v_{0},x_{0},t_{0}) \hspace{1mm} + \hspace{1mm} \left\| f \right\|_{L^{\infty} ({\Omega})} \right) \hspace{8mm} j=1, \ldots, m_{K}. \end{equation*} This concludes the proof of Theorem \ref{mainthe}, if we choose \begin{equation*} C_{K} \hspace{1mm} = \hspace{1mm} \max_{j=1, \ldots, m_{K}} C_{(v_{j}, x_{j}, t_{j})}. \end{equation*} \hfill $\square$ \medskip \noindent {\sc Proof of Theorem \ref{maincor}}. If $u$ is a non-negative solution to $\mathscr{L} u = 0$ in $\Omega$ and $K$ is a compact subset of $\mathscr{A}$, then $\sup_{K} u \le C_{K} u(v_{0}, x_{0}, t_{0})$. If moreover $u(v_{0}, x_{0}, t_{0}) = 0$, we have $u(v,x,t) = 0$ for every $(v,x,t) \in K$ and, thus, $u(v,x,t) = 0$ for every $(v,x,t) \in { \mathscr{A}_{(v_{0}, x_{0}, t_{0})} }$. The conclusion of the proof then follows from the continuity of $u$. \hfill $\square$
\section*{Acknowledgment} The authors would like to thank the anonymous reviewers for their valuable comments. Moreover, we would like to thank Michael Brengel for his feedback during the writing process of the paper. This work was supported by the German Federal Ministry of Education and Research (BMBF) through funding for the Center for IT-Security, Privacy and Accountability (CISPA) and for the BMBF project 13N13250. \section{Appendix} \begin{figure}[h] \centering \begin{subfigure}{.33\columnwidth} \centering \includegraphics[width=1.0\linewidth]{data/all_overheads_skylake.pdf} \caption{Skylake} \label{fig:all_overheads_skylake} \end{subfigure}% \begin{subfigure}{.33\columnwidth} \centering \includegraphics[width=1.0\linewidth]{data/all_overheads_haswell.pdf} \caption{Haswell} \label{fig:all_overheads_haswell} \end{subfigure}% \begin{subfigure}{.33\columnwidth} \centering \includegraphics[width=1.0\linewidth]{data/all_overheads_sandy.pdf} \caption{Sandy Bridge} \label{fig:all_overheads_sandy} \end{subfigure}\\% \begin{subfigure}{.33\columnwidth} \centering \includegraphics[width=1.0\linewidth]{data/all_overheads_nehalem.pdf} \caption{Nehalem} \label{fig:all_overheads_nehalem} \end{subfigure}% \begin{subfigure}{.33\columnwidth} \centering \includegraphics[width=1.0\linewidth]{data/all_overheads_prescott.pdf} \caption{Prescott} \label{fig:all_overheads_prescott} \end{subfigure}% \caption{Results of the flushing side channel. If left (mapped) and right (not mapped) deviate, feedback is reliable.} \label{fig:2ndfeedback} \end{figure} \subsection{Flushing-Based Side Channel Analysis} \label{appendix:2ndfeedback} This section details evaluation results of our flushing-based side channel. In \Cref{sec:evaluation}, we measured and compared the minimum number of cycles for cache accesses. We cannot directly apply the same methodology to the execution time side channel. First, we cannot wrap our timing measurements in two serializing instructions such as \asm{cpuid}, as this would allow the sequence of \asm{imul} instructions to complete---avoiding speculation. Therefore, we removed the first call to \asm{cpuid}, and also included the entire speculative execution block in our measurements (instead of access to a memory address). Second, we found that the flushing execution time differs significantly between repeated executions, frequently not showing any difference in the condition (e.g., page mapped or not). This implies that the minimum execution time among several (again, we used 1000) executions cannot be used to leak a condition, but instead we have to inspect the value distributions, averages or median values. To allow for a fair comparison between the feedback channels, we provide the flushing-based feedback measurement results for architectures in \Cref{fig:2ndfeedback}. For two architectures, Prescott and Skylake, there is no significant measurable timing difference between the page being mapped or not. We believe that Prescott fails for the same reason as for the other feedback channels. But also Skylake, the most recent architecture in our measurements, does not yield a measurable difference in our concrete instantiation of instruction flushing. While improved side channels of similar methodology (e.g., other instructions than \asm{hlt}) might still exist, this indicates that recent Intel CPUs have more stable execution times regardless of speculation. The other three architectures, however, show significant differences that can reliably be confirmed when repeating the experiment. To our surprise the results were not as coherent as expected. Haswell (\Cref{fig:all_overheads_haswell}) and Nehalem (\Cref{fig:all_overheads_nehalem}), on average, showed faster executions for mapped pages. In contrast, Sandy Bridge (\Cref{fig:all_overheads_sandy}) slows down executions (median) accessing mapped pages. We cannot explain this deviation in detail, but speculate that the inner workings of the CPU's pipeline engine and its different branch prediction rollback algorithms lead to such characteristic behavior. \section{Threat Model} This section details our threat model and assumptions we make about the attack environment. Our threat model assumes a local attacker and is in accordance with the threat model of other attacks against KASLR~\cite{kaslr_break_tsx,kaslr_break_prefetch,kaslr_break_branchpredictor,kaslr_break_practicaltiming}. More specifically, we envision the following scenario: \begin{enumerate} \item An attacker can already execute arbitrary code on the victim's system in \emph{user mode} without elevated privileges. This means that either the attacker is running her own executable as a local user on the machine, or can inject arbitrary code in an already running user program. \item The attacker knows an exploitable kernel vulnerability and aims to abuse this vulnerability to elevate her privileges. For example, a vulnerability could allow her to hijack the kernel process's control flow (if the attacker knows the precise memory location of the kernel). \item We assume the OS deploys KASLR that mitigates such exploitation attempts by randomizing the kernel's image base address. This implies that there is no other way to leak address space information from the kernel that would otherwise undermine KASLR. \item Given that a na\"ive trial-and-error search would crash the kernel, we assume that the attacker cannot just brute-force kernel addresses. \end{enumerate} \section{Potential Abuses of Speculative Execution} \label{sec:attack} A key observation of our analysis in \Cref{sec:background} is that in case of a branch misprediction, the CPU has been executing the set of instructions that it was actually not supposed to execute. We will now outline techniques where an attacker can abuse speculative execution to leak certain information (e.g., memory content, mapped pages), ultimately compromising fundamental assumptions of KASLR in Linux and Windows. First, we will provide an overview of the basic approach and show several code patterns that allow abuse of speculative execution as a potential side channel. We will then discuss how an attacker could use these techniques to identify the memory region of a KASLR-protected kernel. \subsection{Enforced Speculative Execution} If we trick the CPU into a branch misprediction, it will speculatively execute code that was not actually meant to be executed. But: \emph{How can we force the CPU to enter code parts that we want to execute speculatively?} To execute a piece of code speculatively, we first have to ensure that the branch condition takes ``long'' to evaluate, and in the meanwhile code after the conditional jump is executed in parallel. To slow down branch condition computation, we propose to fill up a port of the CPU with many computations that the condition has to wait for before it can evaluate. For the remainder of this paper, we will use integer multiplications (\asm{imul reg32,imm32}) to compute an input for a conditional branch. The \asm{imul} instruction multiplies register \asm{reg} by immediate \asm{imm} and stores the result in \asm{reg}. In our example, several (we use 2048 in the remainder of this paper) subsequent \asm{imul} will fill the multiplication port. In addition, we have to make sure that the condition and the speculated code are not scheduled on the same execution ports. Otherwise, there will be no free execution units to run the speculated code. For example, if we want to use memory reads (\asm{mov reg32,mem32}) within speculative execution, these instructions will be scheduled on memory load ports (5 \& 6 in Haswell). While ports may slightly differ between architectures, they (and thus the described procedure) are relatively stable and well-documented in vendor manuals~\cite{intel_optimization}. \begin{asmcode}[label=lst:simple-speculation,caption=Code pattern to trigger speculative execution via static prediction (BTFNT) of the conditional jump in line~5] imul r9, 3 ; Repeat imul to fill ... ; the ALU's queue imul r9, 3 ; cmp r9b, 3 ; Requires imul result je C1True ; and has to speculate << ... >> ; Code that is executed << ... >> ; speculatively jmp Exit C1True: << ... >> Exit: \end{asmcode} \Cref{lst:simple-speculation} outlines the basic idea. We first fill a port with many \asm{imul} instructions that depend upon each other (lines~\#1--\#3). The compare instruction (line~\#4) has to wait for the result of this multiplication chain, while the CPU speculates that the conditional forward jump (line~\#5) is not taken. This code pattern thus allows us to (speculatively) execute arbitrary code (placeholders in lines \#6--\#7) that would have never been executed without speculation. In all our experiments, the initial value of \asm{r9} is 3. Therefore, after multiplying it 2048 times by 3, the least significant byte of \asm{r9} will be $3^{2048+1} $ mod $256 = 3$, i.e., the outcome of the conditional jump (line~\#4) was mispredicted. When executing this code several times, the dynamic branch predictor will kick in and correctly predict the outcome. To avoid this we use ASLR, i.e., we re-run the program after each execution, which will re-randomize the base address of the executable and thus the address for which the prediction is stored. This forces the static predictor to make decisions again. If an OS does not randomize the base address (either lack of ASLR, or ASLR randomization as boot time, such as in Windows), we have to search for alternative solutions. One (that we will use later) is writing a larger probe program that runs several speculative executions in batch and thus just needs to be called once. This leaves dynamic prediction no chance, but allows executing long code speculatively. Another solution would be to manually unlearn the prediction result. This could, e.g., be done by running the program with inverted conditionals for several times before calling it with the actual conditionals---thereby enforcing the dynamic predictor to mispredict. \subsection{Feedback Channel from Speculation} \label{sec:backreport} While we explained speculative execution can now be enforced, we will now discuss how any computations done in speculation can feed back data to the outside (non-speculated) execution. We face a natural challenge. As soon as the CPU would identify a misprediction, it would flush (revert) the mispredicted branch and would thus not commit its result. That is, without special care, the outside world could not see any effects from speculative execution. That means that we have to find a feedback channel for the data we want to leak during speculative execution. That is, to reason about the outcome of the speculated code, we need to communicate back from the speculative execution to the non-speculated execution flow of the program. Although ideally it is not supposed to, we find that speculative execution \emph{modifies} the CPU state in such a way that it becomes measurable in non-speculated execution. This allows us to leak data from within speculation, although the explicit results of the speculated code have been flushed and are not observable. As direct communication from speculative to regular execution is unfeasible, we have to think of potential side channels. We describe two exemplary feedback channels that we can use for these goals in the following. \subsubsection{Caching Side Channel Feedback} \label{sec:caching_feedback} Our first feedback channel reads memory inside speculative execution. Such reads store the memory content in the L1 data cache, which can be detected by measuring its subsequent access time from normal execution. This technique can be used to leak a single bit of information per cached line. In the remainder of this paper, we mainly use this approach, as shown in \Cref{lst:caching-feedback}. \begin{asmcode}[label=lst:caching-feedback,caption=Code fragment for caching feedback channel] << ... >> ; slow condition -> ZF=1 jz C1True mov rbx, [rax] ; cache memory at rax jmp Exit C1True: << ... >> ; real execution Exit: << measure [rax] access time >> << fast when cached, slow otherwise >> \end{asmcode} \subsubsection{Conditional Flushing Slowdown Feedback} Our second feedback channel measures the time it takes to recover from mispredicted branches. The core observation here is that the recovery time will depend on the state of the pipeline when flushing occurs. For example, if we consider the code in \Cref{lst:flushing-feedback}, the time it takes to flush the pipeline will be less if we stop the execution (\asm{hlt}) from inside the speculative execution. This is true even if the executed instructions are simple \asm{nop}s. Note that, as we use caching as our main source of feedback channel, we have not investigated all possible types of such side-effect-incurring instructions. \begin{asmcode}[label=lst:flushing-feedback,caption=Code for conditional flushing slowdown channel] << ... >> ; slow condition -> ZF=1 << Start Measurement >> jz C1True nop ; repeat ... ; nops nop ; 128 times [hlt] ; halt the execution jmp Exit C1True: << ... >> ; real execution Exit: << End Measurement >> \end{asmcode} \subsection{Detecting Static Predictor Behavior} \label{sec:detect_predictor} We have described in \Cref{sec:background} that there are multiple strategies for static predictors. The code mentioned in \Cref{lst:simple-speculation}, for example, assumes that the CPU statically predicts that forward jumps are not taken. In the following, we outline two tests to reveal the forward jump prediction strategy for a specific CPU. The first test aims to find out if the forward jumps are predicted to be taken or not. The code in \Cref{lst:detect-predictor-FWD-NT} checks if forward jumps are predicted to be \emph{not} taken: \begin{asmcode}[label=lst:detect-predictor-FWD-NT,caption=Detect forward-not-taken predictor] << ... >> ; slow condition->ZF=1 je C1True ; Condition is true C1False: mov rsi, [r11] ; r11 user address jmp Exit C1True: jmp Exit Exit: << measure [r11] access time >> \end{asmcode} In the above listed code, the conditional branch (line \#2) will eventually evaluate to true, i.e., it will jump to \texttt{C1True}. That is, the repetition of \texttt{imul} before (line \#1) will fill the port such that the condition is not known and speculative execution will be started. If the branch was predicted not to take the forward jump, then the memory read (line \#4) will be speculated, caching the value at \asm{r11}. Checking the access time of memory at \asm{r11} (line \#9) reveals the decision, i.e., if access to \asm{r11} is faster than non-cached access, the predictor uses the fall-through case for forward jumps. On the other hand, to check if forward jumps are predicted as taken, we can invert the above listed code by inverting the condition of the conditional jump: \begin{asmcode} << ... >> ; slow condition->ZF=1 jne C1True ; Condition false C1False: jmp Exit C1True: mov rsi, [r11] ; r11 user address jmp Exit Exit: << measure [r11] access time >> \end{asmcode} Out of the CPUs that we tested, only the Sandy Bridge microarchitecture seems to be predicting forward jumps as taken. Others speculate the fall-through case, which is the expected outcome. Note that the prediction behavior is independent from the condition, e.g., both \asm{je} and \asm{jne} will be predicted the same (either both jump, or both fall through). For simplicity, all following examples will assume that fall-through cases are speculated. In our experiments (e.g., on Sandy Bridge), we will adjust the branch behavior accordingly. \subsection{Arbitrary Memory Read} \label{sec:arbitrary-memory-read} We now try to abuse speculative execution to read arbitrary memory that should not be accessible during normal (committed) execution. The basic idea is as follows: in speculative execution we check the memory content at a specified address, and report the result back using one of the feedback channels described in \Cref{sec:backreport}. To leak an arbitrary byte in memory, we use several \asm{test} instructions to leak a byte bit-by-bit, i.e., it takes 8 checks to read a byte from memory. \begin{asmcode}[label=lst:double-spec,caption=Arbitrary memory read via nested speculation] << ... >> ; slow condition->ZF=1 je C1True ; Taken C1False: ; --- START of SPECULATION --- mov r10b, BYTE PTR[r10] test r10b, 1 ; test 1st bit jz C2True C2False: ; 1st bit is 1 jmp Exit ; Lvl2 Speculation C2True: ; 1st bit is 0 mov rsi, [r11] ; cache mem @ r11 jmp Exit ; --- END of SPECULATION --- C1True: << ... >> Exit: ; if [r11] is cached ; 1st bit of [r10] = 1 ; else ; 1st bit of [r10] = 0 \end{asmcode} \Cref{lst:double-spec} shows the code listing that we can use to read one bit of arbitrary memory. In this example, we want to read a value that is located at address \asm{r10}: While the multiplication results are being evaluated (line \#1), \texttt{C1False} is executed speculatively. Inside, we read a byte stored at the target address (\asm{r10}) into register \asm{r10b} (line~\#5). Based on the least significant bit of the read value, we make the decision to either jump to \texttt{C2False} or \texttt{C2True}. Until the memory at \asm{r10} (line \#5) is read, \texttt{C2False} (line \#8) will be run in \emph{nested} speculation---regardless of the pending test result (line \#6). Assuming that the memory read (condition for second-level speculation) is faster than the sequence of multiplications (condition for first-level speculation)\footnote{We verify this assumption as part of our experiments.}, the outcome of the second branch condition will be known sooner than the first one. Once the test result and thus the condition of the second conditional jump (line \#7) is known, the second-level speculation will be flushed. The CPU would then start to execute the \emph{correct} jump target (line \#10). Note that this does not flush the first-level speculation (that started in line \#3). Therefore, \texttt{C2True}, which caches the feedback address \asm{r11} (line \#11), is executed only in the case that the read memory has 0 for its least significant bit. The side effects of caching \asm{r11} can be easily detected from outside the speculative execution (line~\#16), when the multiplication result is finally known and the speculated paths are flushed. By repeating this code snippet with different bit offsets to test, we can leak entire bytes or memory ranges. Technically, we need to flush the feedback address \asm{r11} from the cache so that we can start fresh measurements, e.g., using \asm{clflush}. \subsection{Arbitrary Kernel-Space Memory Read (But...)} \label{sec:double-speculation-kernel} Being able to read arbitrary user memory might have some interesting use cases, even for local attackers which seemingly already can read arbitrary code (for discussion see \Cref{sec:discussion}). Following our threat model of a user-space attacker, the immediate follow-up question is now: \emph{Can we even read memory in regions for which we do not have privileges?} In our second experiment we thus aim to read privileged memory in kernel-land as an unprivileged user. In other words, we want to check if privilege separation between user and kernel was taken into account also during speculative execution. To this end, we ran the code from \Cref{lst:double-spec} with probe address pointing to a kernel address. After running the code against various microarchitectures, much to our surprise, we saw that the code was being executed and the kernel memory was read. However, the values that we read were \emph{not} the true values we expected. More specifically, we observed that instead of getting the actual content of the memory, we would read 0s for all read kernel addresses. This is good news in that an arbitrary kernel memory read is not possible from user space, which would be a complete disaster for security. \begin{asmcode}[label=lst:double-speculation-kernel,caption=Checking if address \texttt{K} is mapped] << ... >> ; slow condition->ZF=1 je C1True C1False: ; --- START of SPECULATION --- cmp [r10], 0 ; r10 = K jz C2True C2False: ; page is not mapped jmp Exit C2True: ; page is mapped mov rsi, [r11] ; r11 user address jmp Exit ; --- END of SPECULATION --- C1True: jmp Exit Exit: << measure [r11] access time >> \end{asmcode} Interestingly, however, our measurement results differed completely when we tried to read the values of kernel-land virtual addresses that did not map to any physical page. In such a case, the execution of the corresponding micro-OP would stop, together with the micro-OPs that use the value read from it. For example, if we read a non-mapped value into a register \asm{rax}, using \asm{rax} anywhere in subsequent instructions as a source operand will stall its execution. This leads to a clear distinction between an access violation that results in a 0 being read, while in the case of a page fault (e.g., when the memory page is not mapped) the entire execution stalls. An attacker can use this side channel to distinguish between mapped and unmapped kernel pages. If a byte read from kernel is 0, the page was mapped; otherwise the page was not mapped. To check if a kernel address \texttt{K} is mapped or not, we use the code from \Cref{lst:double-spec} with the exception that now we check for the memory content to be 0. The assembly code for it is displayed in \Cref{lst:double-speculation-kernel} (\asm{r10} is \texttt{K}). \noindent We can further simplify this code by removing the second level conditional as shown in \Cref{lst:dependency-load-kernel}. The observation here is that whenever we read something from a mapped kernel page we get a 0 back, and whenever the page is not mapped execution stalls. Therefore, we can use the read value as an offset in a memory access that is caching the user-space address (line~\#6). The offset in \asm{rax} is 0 in the case of a GPF and thus \asm{r11} will be cached. In the case of a non-mapped page, the execution stalls after line~\#5. Note that removing the register offset would remove the dependency between lines \#5 and \#6 and thus allow for instruction reordering, destroying the side channel. \begin{asmcode}[label=lst:dependency-load-kernel,caption=Checking mapped pages via load dependency] << ... >> ; slow condition->ZF=1 je C1True C1False: ; --- START of SPECULATION --- mov rax, [r10] ; r10 = K mov rsi, [r11+rax] ; r11 user address jmp Exit ; --- END of SPECULATION --- C1True: jmp Exit Exit: << measure [r11] access time >> \end{asmcode} \subsection{Reasoning About the Observed Side Channel} \label{sec:buffer-exhaustion} Having this side channel at hand, it is not hard to see that schemes like KASLR that try to hide the presence of kernel pages are severely threatened. One immediate question that came to our mind was: \emph{Why does the CPU proceed with speculative execution in the case of access violations (thereby creating this side channel)?} We expected the CPU to stall the execution whenever any fault occurs, be it either insufficient privileges or a page fault. In practice, however, we see a clear difference. In the following, we try to explain the underlying process in these two scenarios. Due to the lack of documented details on CPU internals, this explanation has to be taken with a grain of salt. The core problem is caused by the fact that faults cannot be handled by the memory unit during speculative execution, i.e., they are only dealt with at the commit stage. In the case of kernel memory accesses, we have two types of faults. A general protection fault (GPF) occurs if memory is mapped, but we do not have sufficient access rights to read it. Second, a page fault (PF) occurs when memory is not mapped at all. Given that memory units cannot handle faults speculatively (until later at commit stage), there are two different scenarios how these two faulty memory accesses are serviced. In the case of GPF, the memory access is actually still carried out by the L1 data cache. However, because of a privilege fault, the actual data is not put into a load buffer entry; instead the entry is marked as faulty to be handled later at commit stage. Remember that each memory access allocates a new load buffer entry, which remains allocated until the micro-OP is not committed. The observed value 0 in such cases can either be a default load buffer value when it is reserved for the micro-OP, or a value used by the L1 cache for faulty accesses. In contrast, for PF, we have a cache miss that will never be resolved as the page is not mapped. Therefore, the L1 data cache cannot return any value to the load buffer (because it does not have any), and it cannot finish the request (because it cannot handle faults while speculating). Note that the L1 data cache has a limited number of entries for handling ongoing cache misses. This means that the entry for handling the memory read will remain allocated for the entire speculation. This will additionally stall the load buffer entry that waits for the result and any instructions that depend on the read value. \subsection{Kernel-Probing Specific Feedback Channel} \label{sec:probing-feedback} We can leverage the fact that page faults stall the execution engine to design an even easier and faster way to determine whether a page is mapped. For this we use the following observation: for non-mapped pages the bottleneck of the number of memory accesses is the size of ongoing loads in the L1 data cache (e.g., 32 in Haswell). For mapped addresses, the bottleneck is the number of load buffer entries (e.g., 72 in Haswell). This means that, if we have a non-mapped address \texttt{K}, doing \asm{mov rax,[K]} 32 times will stall the execution of following load instructions. However, if address \texttt{K} is mapped, then the execution of loads will only stall after the CPU runs out of load buffer entries, i.e., after executing \asm{mov rax,[K]} 72 times in Haswell. Therefore, any number of loads (\asm{mov rax,[K]}) between 32 and 71, followed by reading a user-space feedback address \texttt{U} (\asm{mov rsi,[U]}), will result in caching \texttt{U} if the page at address \texttt{K} is mapped. \section{Analysis of Speculative Execution in x86} \label{sec:background} In this section, we first provide an overview of the basic x86 architecture in general. We then introduce the concept of speculative execution and its implementation details in the recent x86 microarchitectures such as Haswell and Skylake. To understand the inner workings of speculative execution, this section also describes the details of branch prediction techniques that are used by modern processors. These inner details allow for an attack that abuses speculative execution to break kernel-level Address Space Layout Randomization (KASLR). This section therefore also introduces KASLR, an in-kernel defense mechanism, deployed in most modern operating systems. To add an emphasis the importance of KASLR, we will show a wide range of kernel attacks that are possible in the absence of KASLR. Later, in \Cref{sec:attack}, we will combine branch prediction and speculative execution to anticipate the speculatively executed path after a conditional branch. This will be a key to executing arbitrary code speculatively, which we will use in our attack to remove the randomness introduced by KASLR. \subsection{Generic x86 architecture} Despite being a CISC (Complex Instruction Set Computing) architecture, x86\footnote{Note that we will refer to both IA-32 (32-bit CPUs) and AMD64/Intel 64 (64-bit CPUs) as x86 for simplicity.} constitutes \emph{the} prevalent architecture used for desktop and server environments. Extensive optimizations are among the reasons for x86's popularity. Realizing the benefits of RISC (Reduced Instruction Set Computing) architectures, both Intel and AMD have switched to RISC-like architecture under the hood. That is, although still providing a complex instruction set to programmers, internally they are translated into sequences of simpler RISC-like instructions. These high-level and low-level instructions are usually called macro-OPs and micro-OPs, respectively. This construction brings all the benefits of RISC architecture and allows for simpler constructions and better optimizations, while programmers can still use a rich CISC instruction set. An example of translating macro-OP into micro-OP is shown in the following: \begin{asmcode} load t1, [rax] add [rax], 1 => add t1, 1 store [rax], t1 \end{asmcode} Using micro-OPs requires way less circuitry in the CPU for their implementation. For example, similar micro-OPs can be grouped together into execution units (also called ports). Such ports allow micro-OPs from different groups to be executed in parallel, given that one does not depend on the results of another. The following is an example that can trivially be run in parallel once converted into micro-OPs: \begin{asmcode} mov [rax], 1 add rbx, 2 \end{asmcode} Both instructions can be executed in parallel. Whereas instruction \#1 is executed in the CPU's memory unit, instruction \#2 is computed in the CPU's Arithmetic Logic Unit (ALU)---effectively increasing the throughput of the CPU. Based on the availability of their corresponding execution ports and the source data, each of these instructions could also be executed out of order. In the previous example, the CPU could easily swap the order of addition and memory read, as there are no dependencies between them. Such reordering frequently allows optimizing a sequence of instructions for speed and data locality. Given the possibility of data dependencies in general, an execution cannot be done entirely out-of-order, though. Otherwise, such reordering would create data hazards and possibly even result in entirely different executions that do not reflect the macro-OP specification. To capture the complexity of such reordering, CPUs include another unit that maintains the consistency of the executed instructions. \begin{figure}[t] \includegraphics[trim=100 60 0 0,width=1.13\columnwidth]{Haswell_Simple2.pdf} \captionsetup{justification=centering} \caption{CPU Core Pipeline Functionality of the Haswell Microarchitecture~\cite{intel_optimization}.}\label{fig:haswell_simple} \end{figure} \subsubsection{Execution Units in Modern x86 CPUs} As software changes over time, the underlying logic and hardware setup of CPUs is also subject to change. CPU vendors usually maintain microarchitectures to summarize various CPUs of the same generation, possibly varying in terms of clock speeds or number of cores. We will now describe the basic x86 CPU architecture based on the example of the Haswell microarchitecture, which is a recent Intel x86 microarchitecture and one of the microarchitectures that we will use in our experiments. Although the inner details differ from one microarchitecture to another, the basic building blocks (especially the ones that we use) remain mostly the same. In \Cref{fig:haswell_simple}, we outline the most important parts of CPU's pipeline, based on the Haswell microarchitecture~\cite{intel_optimization}. We split the whole pipeline into three parts: (i) Instruction fetch/decode, (ii) Execution, and (iii) Memory. \textbf{Fetch/Decode Unit:} The fetch/decode unit is responsible for fetching the forthcoming (i.e., to-be-executed) instructions and preparing them for execution. There are different places where these instructions might be coming from. The fastest of these places is a micro-OP cache, which is a storage of instructions that are already decoded into their corresponding micro-OPs. If there is a miss in this cache, then the instruction has to be retrieved from one of the caches in the hierarchy (L1-I, L2, L3, L4), or ultimately, if none of the caches contain the data, from main memory. The fetched instructions are then decoded and passed to the execution unit as well as to the micro-OP cache. The details of how this is handled are not important for the remainder of our paper and we refer the interested reader to the respective CPU vendor documentation~\cite{intel_optimization}. One crucial part to note, though, is that the address of the next instruction to fetch is controlled by the Branch Prediction Unit (BPU). \textbf{Execution:} After decoding the instruction into the corresponding micro-OPs, they are put on the instruction dispatch queue to prepare for execution. Micro-OPs on the queue are checked for dependencies, and the ones with all source operands resolved are scheduled to one of 8 (in Haswell; varies in other architectures) execution ports. Further, the scheduled micro-OPs are added to the reorder buffer (ROB), which contains the sequentially consistent view of all executed instructions. Abstracting away from its details, it is sufficient for us to imagine the ROB as a unit that keeps micro-OPs in order while executing them out of order. Usually, the ROB is implemented as a ring buffer, with its head pointing to the newest micro-OP and its tail to the oldest not-yet-committed operation. \emph{Committing} a micro-OP means to reflect the changes that it made to the machine state. Committing micro-OPs is done in order, i.e., a micro-OP can be committed only after it is done executing and all instructions before it are already committed. In contrast, however, finishing the computation does not directly mean that the micro-OP can be committed. A relevant example in our case is speculative execution, in which case a micro-OP can only be committed after the outcome of the speculation is known (i.e., after knowing that the speculated path was correctly predicted). This implies that CPUs have to maintain micro-OPs uncommitted until they can be committed. CPUs typically employ a maximum number of uncommitted/speculated instructions which aligns to the number of ROB entries (192 in Haswell). This limit might be further reduced by the availability of other resources, such as physical registers or available execution ports. \textbf{Memory Unit:} The third part of the execution pipeline, the memory unit, is used for micro-OPs that access memory. Being the bottleneck in most executions, CPU designers pay special attention to this unit to improve its efficiency. That is the reason why in modern architectures we have a hierarchy of memory caches, each containing different sizes of buffers with varying access speeds. Haswell's memory hierarchy, for example, comprises Load and Store Buffers (72 and 42 entries in Haswell, respectively), followed by various levels of caches (L1-I/L1-D, L2, L3, L4), and finally the main memory. Each load operation is done in the following way: \begin{enumerate} \item When a \texttt{load} micro-OP is scheduled, a load buffer entry is allocated that will hold the loaded data until it is committed. \item To retrieve the data, the L1 data cache is queried. In case of a cache hit, the data will be loaded into the load buffer entry of the corresponding micro-OP. \item In the case of an L1 cache miss, the data will be queried from the higher cache hierarchies or, ultimately, from the main memory. \end{enumerate} Executing a memory load involves two buffers. First, a load buffer entry is allocated which will be tied to the corresponding \texttt{load} micro-OP, and will hold the loaded data after it is returned from the L1 data cache. Second, in the case of a cache miss, the L1 data cache has to load the missing data from the higher memory hierarchy. To service multiple cache misses in parallel, the L1 data cache has its own buffer consisting of memory accesses that have to be resolved. Haswell, e.g., has a 32-entry buffer and can handle 32 cache misses\footnote{Note that in reality even cache hits will allocate entries in the buffer; however, as cache hits are serviced instantaneously, they can be ignored.} in parallel. Executing \texttt{load} micro-OPs speculatively means that new load buffer entries will be allocated for each of them; however, they will not be freed until the CPU is done speculating. As commits are not carried out until the result of speculation are known, the loaded data cannot reach the architectural register and cannot be discarded yet. This means that while speculating, the maximum number of load instructions that can be executed is limited by the size of the load buffer. After reaching the limit, the execution of subsequent load micro-OPs will be stalled. Given the generous sizes of load buffers in recent microarchitectures (72 entries in Haswell), for most programs this will not be an issue. However, we will use this limitation as an advantage when measuring the access times of mapped/unmapped memory accesses in \Cref{sec:buffer-exhaustion}. Also worth noting here is the case of cache misses in the L1 data cache. As we previously mentioned, there is a limited number of ongoing cache misses that can be handled by the L1 data cache (32 in Haswell). This, combined with the fact that faults cannot be handled speculatively, means that after having 32 faulty cache misses (e.g., cache miss resulting in page fault), all the subsequent memory operations will be stalled. \subsubsection{Speculative Execution} Speculative execution is an important optimization carried out by most CPU architectures. Programs, generally, have many conditional branches. Evaluating the condition in a conditional branch might take some time (e.g., reading data from memory, which can take hundreds of cycles if it comes from main memory. Instead of waiting for a branch condition to be evaluated, the CPU speculates on the outcome and starts speculatively executing the more likely execution path. Once the condition for the branch can be evaluated, this results in two possible scenarios: \begin{enumerate} \item The prediction was correct $\rightarrow$ The speculatively executed instructions were correct and thus will now be committed. \item The prediction was wrong $\rightarrow$ The speculatively executed instructions are flushed and the correct path is executed from the beginning (non-speculatively). \end{enumerate} Optimizing the correctness of branch prediction is thus of utmost importance for performance. Perfect prediction means that the CPU never has to wait for slow branches and will always execute the correct path. In contrast, mispredictions penalize the execution by forcing the CPU to flush all the progress it has made since the speculation and start over from scratch. \subsection{Branch Prediction} \label{sec:branch-brediction} As the efficacy of branch predictors directly influences the performance of CPUs, hardware vendors have improved predictors over time. Therefore, branch predictors not only differ from vendor to vendor, but also between different generations of microarchitectures (e.g., Haswell vs, Skylake). The basic principle is the same: branch predictors try to foresee the outcome of conditional branches. There are generally two types of predictors, static and dynamic. When a CPU sees a conditional branch for the first time, it has to resort to a static predictor to guess the outcome based on simple expert-knowledge heuristics. In contrast, if the branch has been executed previously, a dynamic predictor can make more informed decisions by looking at previous branch outcomes. The simplest example of a static predictor can be predicting any branch to be either always taken or never taken. However, intuitively, these predictors are not highly precise. The most widely used static predictor, that also exists in most modern CPUs, is called BTFNT (backwards taken forwards not taken). As its name suggests, this static predictor predicts forward branches not to be taken and backwards to be taken. The reasoning is that loops (i.e., backward jumps) are usually taken more than once, and the first case of conditionals (i.e., fall-through cases of forward jumps) are more likely to be taken. The success rate of the predictor can be further improved by the compiler, which aligns the cases of conditionals according to the static predictions of the underlying hardware. The simplest example of a dynamic branch predictor is a one-bit history predictor, which stores a single bit for each branch instruction. This bit denotes whether the branch was taken or not in the previous execution. Most CPUs are believed to\footnote{Branch predictor details are not part of official vendor documentation.} have 2-bit predictors (also called 2-bit saturating counters)~\cite{branch_prediction_stragegies}. These two bits represent a counter that is incremented every time the branch is taken and decremented otherwise. To decide the outcome of the predictor, the values of the counter \{0, 1, 2, 3\} are mapped to decisions \{strongly not-taken, weakly not-taken, weakly taken, strongly taken\}. Apart from simple history matching, dynamic predictors can also detect cycles or nested branches, e.g., by using local or global history bits or even combining them together. However, dynamic branch predictors are out of scope of this paper and therefore, we will not go into more detail here. In the following, we will use static predictors, as they show a relatively coherent behavior across different CPUs, making it possible to reliably anticipate their outcome. For example, if a CPU sees a branch at address \asm{A} with a forward conditional branch for the first time, the static branch predictor will predict the branch to be not taken (according to BTFNT). In principle, the same thing can also be done on dynamic predictors by training them at the beginning and then taking the opposite branch of what the \textit{trained} predictor expects. \subsection{Kernel ASLR} \label{sec:background-KASLR} With this basic CPU knowledge, we now turn to ASLR, a defense mechanism whose underlying assumptions an adversary can undermine with speculative execution. Address Space Layout Randomization (ASLR)~\cite{pax:aslr} is a widely deployed defense technique against code-reuse attacks. In user space, ASLR randomizes the base addresses of the program's memory segments, thus preventing the attacker from knowing or predicting the addresses of gadgets that she needs for code-reuse attacks. ASLR is applied to a program at load-time and whenever a program requests a new memory allocation. ASLR raises the bar for adversaries in doing successful exploitation, and thus is supported by all modern operating systems. The recent increase of attack targets towards the kernel side~\cite{return-oriented-rootkits,pikit,ret2dir_rethink_kernel_isolation, rowhammer, dirty-cow} motivated the operating system developers to create similar countermeasures against code-reuse attacks for kernel code. This resulted in creating KASLR (Kernel ASLR), which is an ASLR implementation for the kernel, i.e., randomizing the kernel's image base address as well as its loaded modules/drivers and allocated data. While historically the kernel image was loaded at a fixed address (e.g., \texttt{0xffffffff80000000} in Linux), with KASLR, the kernel is placed at a different address at boot time. KASLR is supported by all major operating systems, Windows (from Vista), OSX (from Mountain Lion 10.8) and Linux (from 3.14, and enabled by default from 4.12). KASLR is meant to (1) protect against remote attackers, and (2) as a defense against privilege escalation attacks from local adversaries. In our KASLR derandomization attack, we assume the latter case, i.e., when the attacker tries to reveal the location of critical kernel functions in order to use this in a subsequent exploitation. \textbf{Windows KASLR:} KASLR implementations differ between OSes, or even among different versions of the same OS. In general, at every boot, the kernel image and the loaded modules/drivers are allocated at random addresses. In Windows~10 (version 1709), there is a dedicated kernel memory region in the range from \texttt{0xfffff8\textbf{00000}00000} to \texttt{0xfffff8\textbf{80000}00000}, containing allocation slots of 2MiB each (i.e., large pages). KASLR will then randomly assign these slots to the kernel image and to the loaded modules, resulting in ‭262144‬ possible slots where the kernel image can reside, i.e., 18 bits of randomness. \textbf{Linux KASLR:} In Linux, KASLR randomly chooses any page from which to start loading the image. By default, the size of this page is 2MiB, and the range in which the randomization can happen is from \texttt{0xffffffff\textbf{800}00000} to \texttt{0xffffffff\textbf{c00}00000}. This gives at most 512 possible kernel base image start pages (minus the image size itself), i.e., 9 bits of randomness. The dedicated memory range of the kernel image is followed by a memory region for kernel modules. It starts at \texttt{0xffffffff\textbf{c0000}000} and can go as far as \texttt{0xffffffff\textbf{fd200}000}. However, only the load offset is randomized, i.e., the first loaded module will be loaded at a randomly chosen 4KiB page from the range [1,1024]. All consecutively loaded modules will then follow the first one, giving in total 10 bits of randomness. \section{Conclusion} \label{sec:conclusion} Speculative execution has long been ignored by the security community, although it bares critical threats that undermine important assumptions of existing defensive schemes. We are the first to provide a comprehensive overview of the security implications. Such an understanding is crucial for security researchers to understand the guarantees of existing solutions. Our adversarial setting may seem contrived compared to usual threat models, as we assume that the attacker has influence on the code. However, we argue that the proposed side channels will highly influence existing defenses, such as conditionals that constrain unsafe code to certain memory regions---especially in the realm of JIT compilation like in browsers. The recent rise of KASLR techniques demonstrates that abusing speculative execution is clearly a novel type of attack class that needs further considerations. \section{Potential Countermeasures} \section{Discussion} \label{sec:discussion} \subsection{Security Implications of Speculative Execution} \label{sec:usermode} We believe that showing how one can derandomize KASLR is just the tip of the iceberg of security implications that speculative execution may have. Executing arbitrary code on the CPU without consequences (such as segmentation faults), and being able to report results back is a powerful tool, which could have many different use cases. One such case is using the arbitrary memory read technique (\Cref{sec:arbitrary-memory-read}) from inside a restricted environment that sandboxes memory accesses using bounds checking. For example, consider a JavaScript execution environment in Web browsers that checks if memory accesses in attacker-controlled code target outside of a well-defined safe region (and thus should be rejected). Given that the majority of modern browsers compile JavaScript into native code, executing arbitrary code on a CPU is feasible even from web applications. Therefore, to gain arbitrary memory reads from inside JavaScript, one has to generate native code similar to that described in \Cref{sec:arbitrary-memory-read}. Such an attack could be simplified by using WebAssembly, which allows compilation of C/C++ programs into a WebAssembly byte code, which itself will be compiled into native code by browsers. We leave an evaluation of such attacks open for future work and hope that our analysis on speculative execution will foster new research to understand the full scope of the problem. \subsection{Possible Mitigations} We now turn to possible mitigation techniques that can be applied to make systems resistant to our attack. \textbf{Hardware Modifications:} First, we discuss approaches that require hardware modifications. The naive approach would disable speculative execution altogether, which, however, would drastically reduce the performance of the CPU---every branch instruction would stall the execution pipeline. A more reasonable approach would be to stall the execution when a privilege fault occurs. This successfully removes the information leak that we use to distinguish between mapped and non-mapped pages. However, this technique does not get rid of the general problem of side channels in speculative execution. We have already provided two feedback channels in \Cref{sec:backreport}: (i) measuring the complete execution time and detecting difference of rollback complexity in case of mispredictions, (ii) and caching user-space memory. To defeat the former feedback channel, one would need to unify execution times for micro-OPs. Disabling the latter would require forbidding memory loads in speculative execution. However, given that memory accesses are already a bottleneck for modern CPUs, blocking their speculation will incur a significant slowdown. Note that merely disabling \emph{nested} speculation would not remedy the problem, as one could cache two different memory pages based on the value to leak in first-level speculation. Summarizing, while mitigation in hardware is possible, added rigorous security would imply significant performance degradation. \textbf{Attack-Specific Defenses:} Although the problem originates from hardware, some attack-specific mitigations can also be applied in software. One such mitigation against our KASLR attack is stronger kernel/user space isolation, which has been proposed multiple times~\cite{shadow_kernels,tale_of_two_kernels,ret2dir_rethink_kernel_isolation,netsted_kernels}. The basic idea is to separate kernel and user address spaces into different virtual spaces. This would remove kernel addresses entirely from user-level page tables, thus making them inaccessible. The downside to this approach is the overhead caused by flushing translation lookaside buffers (TLBs) on every context switch from user to kernel mode. Alternatively, one could try to increase the entropy of KASLR, which however would only slow down the attack, and efficient binary search techniques would reduce the search effort to logarithmic complexity. Also, while any of this would mitigate leaks from kernel into user mode, as we have discussed in the previous subsection, even pure user-mode attacks can be of concern. It seems more promising to hide the kernel content rather than just its existence. One such solution was recently implemented in OpenBSD and is dubbed Kernel Address Randomized Link (KARL). Instead of randomizing the base address of the kernel image, KARL randomizes the kernel's content (similar to proposed fine-grained randomization schemes in user space~\cite{ASLP,STG,STIR}). At every system startup a new kernel image will be linked together by combining object files in a random order. Having a completely different layout at each boot forbids the attacker to predict the addresses of required code or data pieces. KARL thus withstands our proposed derandomization attack, as an attacker can only learn where the kernel is mapped, but not how it is laid out. \textbf{Compiler-Assisted Solutions:} An interesting defense opens up in a setting where the attacker does not control the compiler that generates the measurement code. For example, consider a setting where an adversary can specify code that WebAssembly ultimately compiles into a byte code. Assume the attacker aims to read beyond a critical memory check via speculative execution. The compiler, assuming knowledge of such critical conditionals (e.g., by code annotations) could then create specific branches that are \emph{guarded} against misuse. \Cref{lst:guarded-if} shows an example of such a guarded conditional in a BTFNT setting for the compiled code snippet \texttt{if (rax == somevar) \{...\} else \{...\}}. To prevent speculative execution, a guard injects a backward jump that is \emph{never} taken (line~\#4) in normal execution, but will be predicted---effectively creating an infinite loop executed in speculative execution. This way an attacker has no possibility to inject code in the fall-through case that is executed speculatively. \begin{asmcode}[label=lst:guarded-if,caption={A guarded conditional hinders static misprediction, assuming BTFNT in this example.}] cmp rax, [somevar] je Equal FallThrough1: je FallThrough1 ; GUARD: backward jump ; that is taken in BTFNT ... ; code in else {} branch jmp Exit Equal: ... ; code in if {} branch \end{asmcode} \subsection{Future Work} \textbf{Affected Vendors and ISAs}: The focus of our experiments was Intel x86 CPUs. We have not tried to apply our speculative execution-based attacks against other architectures, but also have not seen any fundamental reasons why this should not be possible. For example, the CPUs of other CISC vendors like AMD also offer speculative execution engines that would open up similar side channels. In principle, even RISC processors like ARM-based CPUs feature speculative execution, such as Cortex-R processors~\cite{cortex-R7-tech-ref} or the Cortex-A57 in LG Nexus 5X smartphone~\cite{cortex-A57-nexus5x-spec-exec}. Having said this, the inner workings of CPUs might differ significantly. For example, if a CPU does not feature nested speculation, the presented side channels require adaptations. With this work, we have proposed several automated tests that identify whether a certain CPU is susceptible to speculation-based side channels. Using this test suite, we aim to broaden our analyses to other architectures in the future. \textbf{User-Mode Attacks}: We have already conceptually described that user mode processes might also be at risk due to speculative execution (\Cref{sec:usermode}). In immediate future work, we plan to test whether sandboxed environments that allow attacker-controlled code to be JIT-compiled (in particular browsers) can be abused to read out-of-bounds. Such a proof-of-concept will be a significant research and engineering effort on its own and is thus out of scope for this paper. \section{Evaluation} \label{sec:evaluation} We will now perform the described analyses on five x86 microarchitectures. Each microarchitecture is a different iteration of implementation of CPU circuitry, thus affecting the execution process while still keeping the high-level semantics mostly the same. To see how inner workings of CPUs may have changed, we gathered a wide selection of Intel CPUs with architectures ranging from the year 2004 to a recent one from 2015. The complete list of the microarchitectures used in our experiments is shown in \Cref{tbl:uarchs-tested}. Throughout the remaining paper, we will refer to each of the CPUs by its microarchitecture codename. \subsection{Revealing Microarchitecture Details} As a first experiment, we applied several tests described in \Cref{sec:attack} to reveal the inner workings of the different architectures. That is, we experimentally reveal the static prediction strategy, the number of load buffer entries, and the maximum number of parallel cache misses. \Cref{tbl:uarchs-properties} summarizes the outcomes of those measurements, showing that the various Intel architectures differ in their characteristics. The general trend is that both the number of load buffer entries and parallel loads increased over the years. For the static prediction pattern, there is a more coherent pattern: all microarchitectures except Sandy Bridge fall through forward jumps. We will use these architecture-dependent results to adapt the code snippets used in the following experiments, especially regarding prediction expectation and load buffer usage. \input{tables/march-table} For Kernel ASLR derandomization we use both our attack techniques from \Cref{sec:double-speculation-kernel} and \Cref{sec:buffer-exhaustion}. In the following section we will present our findings. \subsection{Measuring the Execution Time} \label{sec:measure-mem-acccess-time} In \Cref{sec:attack} we have described ways to identify whether a page is mapped or not. All feedback channels we presented relied on timing differences due to memory caching. To measure such time differences between cached and non-cached memory accesses, we use hardware timestamp counters (\asm{rdtsc} and \asm{rdtscp}). Such counters deliver higher than nanosecond precision and are sufficient to differentiate the two cases. However, as these instructions could be reordered during the execution on a CPU, care needs to be taken to get the measurements as precise as possible. To this end, we resort to serializing instructions that avoid instruction reordering (in particular, we use \asm{cpuid}). The code for measuring a memory access at address \texttt{U} is shown below: \begin{asmcode}[label=lst:measure-mem-acc-rdtscp,caption=Measuring access time via timestamp counters.] cpuid ; serializing point rdtsc ; start measuring mov r11, rax ; store measurement mov rax, [U] ; access memory rdtscp ; end measuring mov r12, rax ; store measurement cpuid ; serializing point sub r12, r11 ; r12 - time tiff \end{asmcode} \noindent The code in \Cref{lst:measure-mem-acc-rdtscp} performs the following steps (by line): \begin{enumerate} \item \asm{cpuid} waits for all preceding instructions to finish before it gets executed. This introduces a serializing point to ensure that no instruction before it will get executed after. \item \asm{rdtsc} reads the initial counter value, which will be returned in \asm{rax:rdx} register pair. \item We are interested in smaller values that can fit in 32 bits and thus only store the lower part of it, i.e., \asm{eax}, in \asm{r11}. \item We read the data at address \asm{U}. This is the access for which we want to measure the time. \item For the second measurement, we use the \asm{rdtscp} instruction to get the final timestamp counter. \asm{rdtscp} is specially designed to read the timestamp counter only after all memory operations before it are done, which exactly matches our needs. \item We store the new counter value into \asm{r12}. \item To be sure that no consecutive instructions will be scheduled together with \asm{rdtscp} instruction, we use another serializing point (\asm{cpuid}). \item Using the two timestamp values in \asm{r12} and \asm{r11}, we subtract them to get the difference. \end{enumerate} This code allows us to measure only the time needed for memory access, without adding too much noise. For older CPUs that do not support \asm{rdtscp} yet, we resort to using \asm{rdtsc} for the second measurement as well and additionally preceding it with \asm{cpuid}, so that \asm{rdtsc} is not scheduled together with the memory access that we want to measure. By doing so we introduce another instruction (\asm{cpuid}) in between two measurement points. This will add some overhead to the returned values. Nevertheless, the overhead will be included in both cached and non-cached memory accesses, and thus the difference will remain the same. \input{tables/march-props} \subsection{Differentiating Between Mapped/Unmapped Kernel Pages} \begin{figure*}[ht] \begin{subfigure}{.2\textwidth} \centering \includegraphics[width=1.0\linewidth]{data/cache_timings_skylake.pdf} \caption{Skylake} \label{fig:boxplot_skylake} \end{subfigure}% \begin{subfigure}{.2\textwidth} \centering \includegraphics[width=1.0\linewidth]{data/cache_timings_haswell.pdf} \caption{Haswell} \label{fig:boxplot_haswell} \end{subfigure}% \begin{subfigure}{.2\textwidth} \centering \includegraphics[width=1.0\linewidth]{data/cache_timings_sandy.pdf} \caption{Sandy Bridge} \label{fig:boxplot_sandy} \end{subfigure}% \begin{subfigure}{.2\textwidth} \centering \includegraphics[width=1.0\linewidth]{data/cache_timings_nehalem.pdf} \caption{Nehalem} \label{fig:boxplot_nehalem} \end{subfigure}% \begin{subfigure}{.2\textwidth} \centering \includegraphics[width=1.0\linewidth]{data/cache_timings_prescott.pdf} \caption{Prescott} \label{fig:boxplot_prescott} \end{subfigure}% \caption{Results of the caching side channel. If left (mapped) and right (not mapped) deviate, feedback is reliable.} \label{fig:march-cache-timings} \end{figure*} At this point we have all the prerequisites to measure timing differences accurately. We will now use this methodology to evaluate the feedback channels as proposed in \Cref{sec:backreport} and \Cref{sec:probing-feedback}. We will first focus on the two feedback channels that cache a specific user-mode memory address. Given lack of conceptual differences, we will treat them equally in this section and benchmark the timing differences between accessing a cached (mapped kernel page) and non-cached (non-mapped kernel page) address using the two-level speculation method proposed in \Cref{sec:caching_feedback}. \Cref{fig:march-cache-timings} summarizes the timings, more specifically their minimum, median, and average values over 1000 runs. Given that we use \asm{rdtsc} for measurements, the timings approximate the number of cycles\footnote{http://www.forwardscattering.org/post/15} for corresponding memory accesses. As we want to see whether memory is cached or not, we will later resort to the more reliable minimum values. \Cref{fig:march-cache-timings} clearly shows timing differences between mapped and non-mapped pages for most architectures. Two architectures are worth mentioning in particular, as their behavior differed from the others. In Nehalem, accessing a non-mapped memory page does not stall the dependent instructions in the pipeline; instead it would also return 0 as a value. Therefore, the technique defined in \Cref{sec:double-speculation-kernel} (two-level speculation in \Cref{lst:double-speculation-kernel} or dependent load in \Cref{lst:dependency-load-kernel}) will not work there. However, resource exhaustion of architectural buffers (\Cref{sec:buffer-exhaustion}) works seamlessly and we report these numbers instead. In particular, following \Cref{tbl:uarchs-properties}, we used between 11 and 47 load instructions to the probed address followed by a caching instruction, as Nehalem features 11 parallel cache miss and 47 load buffer entries, respectively. Prescott also prevents the first approach, as both faulting addresses stall the pipeline and therefore the caching instruction is not executed at all. Similarly, the resource exhaustion technique (\Cref{sec:buffer-exhaustion}) also fails. Regardless of the type of fault (i.e., page fault or access violation), consecutive load instructions are stalled after 19 faulty ones. The flushing-based feedback channel turned out to be less reliable than caching-based feedback, as the minimum measurements did not show any measurable difference regardless of the branch condition. In the following, we will thus rely on the caching-based feedback channels that have shown to be accurate. Having said this, we observed significant timing differences between confirmed-but-halted speculative execution (via \asm{hlt}) and mispredicted execution. For example, on Sandy Bridge, the median of 1000 measurements differed in 16 cycles, and also the average execution time on Nehalem was significantly slower for non-mapped pages. We refer the interested reader to \Cref{appendix:2ndfeedback} to see how and on which architectures one could use flushing-based feedback. \subsection{Breaking Linux KASLR} \label{sec:find-kernel-image} By now, we can successfully identify whether a single kernel address space memory page is mapped, using any of our proposed approaches with equal success. The dependent load technique (as shown in \Cref{lst:dependency-load-kernel}) is by far the simplest means of doing so, considering that it uses only two instructions. We will thus use this test to derandomize KASLR on 64-bit Linux (Ubuntu 16.04 LTS; kernel 4.13.0) running on a 4-core Haswell CPU with 32GB RAM. Kernel ASLR is enabled in the OS by default, which, as described in \Cref{sec:background-KASLR}, randomizes the location of the kernel image in the range from \texttt{0xffffffff\textbf{800}00000} to \texttt{0xffffffff\textbf{c00}00000}. Given that the starting address of the image is aligned to 2MiB pages this results in 9 bits of randomness. For the derandomization attack, we created an executable, which takes the probe address as an input and outputs the time it takes to access the user-mode memory address (i.e., the one that is being cached in the case of the mapped kernel page). To reduce the possible noise, we run the program twice per probed address and look at the minimum duration of the two runs. We use a single-threaded process to run the experiment. Increasing the number of parallel processes is possible, but would introduce noise because of hyper-threading, which would require more than two tests per probed address. According to our experiments, a single process running each probe twice showed the best compromise between efficiency and accuracy. Using the program as an oracle, we probe each possible address in the KASLR memory range with 2MiB increments (which corresponds to Linux KASLR's alignment size). In principle, this could be further improved with larger increments that take into account the size of the kernel image, or by using a binary (instead of linear) search. That is, note that we did not strive towards decreasing the search time, in order to find a generic solution that works with any kernel image size (even small ones). Still, using this na\"ive search, we reliably find every mapped 2MiB kernel page in 2.63 seconds on average. We use the same approach to search for kernel modules, but modified the search area, given that the possible start address of modules is between \texttt{0xffffffffc0\textbf{000}000} and \texttt{0xffffffffc0\textbf{c00}000} (page-aligned). This gives us 3072 possible places where modules can be allocated ($\sim$11 bits of entropy). Running the above experiment for modules with the modified parameters found all allocated pages for modules reliably in 14.70 seconds on average. To evaluate the accuracy of this scheme, we ran the program 1000 times. We use the list of kernel pages in \texttt{/sys/kernel/debug/kernel\_page\_tables} as a ground truth to detect possible false positives and false negatives. Out of 1000 runs, our program always correctly identified 11 out of 11 kernel image pages. As for detecting loaded modules, our program successfully identified all 1316 mapped module pages in 968 out of 1000 runs. For the remaining 32 runs it only missed a single mapped page. Throughout the test run, our program did not report any false positives. \subsection{Breaking Linux KASLR in a VM} \label{sec:virtual-derandomize-kaslr} So far we have constrained the proposed attacks to physical hardware, yet an attacker might be interested to abuse similar techniques in a virtualized environments. A core driver for the recent increase of virtualization was the CPUs' virtualization support, which made the execution more efficient. One of the features that hardware support nowadays is extended page tables (EPT), which adds another layer of translation to page tables in order to translate guest physical addresses into host physical pages. Requiring no hypervisor intervention to translate virtual addresses, we can use EPTs to mount our attack even on a VM. In our next experiment, we carry out our measurements on virtualized 64-bit Linux (Ubuntu 16.04 LTS; kernel 4.14.0) running on a 4-core Haswell CPU with 8GB of virtual RAM. For virtualization we use VirtualBox (Version 5.1.30) with hardware acceleration enabled (the default). We ran the same measurements as we did for physical machines (\Cref{sec:find-kernel-image}). As expected, a virtualized environment reduced the efficiency of our approach. Keeping the same parameters (i.e., 2 trials per probed address on a single core), the measurements took on average 2.51 seconds and 17.78 seconds to find mapped pages for the kernel image and loaded modules, respectively. Further, the precision of the approach was decreased, missing 47 out of 528 pages on average (min/max being 26 and 72 respectively, and median being 47) for modules, and missing 2 out of 11 pages on average for the kernel image. To cope with this reduced accuracy, in a second experiment, we doubled the number of trials per probed address (i.e., 4 trials instead of 2). This significantly improved the precision of our approach; however, it also doubled the execution time. With increased trials, it takes on average 5.66 seconds to find the kernel image and 33.80 seconds to find the loaded modules. As for the precision of the attack, we observed on average 5 missed pages for modules (min/max being 0 and 52, respectively, and median being 4) and 1 missed page of the kernel image. Note, however, that despite the missed pages, it is trivial for an attacker to correctly identify the area of the kernel image if the two missing pages do not constitute pages at the edge of the image---which, given the overall size of the region found, can be easily verified. Additionally, one can probe for neighboring pages after the initial scan to find possible false negatives, or simply repeat measurements. \subsection{Breaking Windows KASLR} \label{sec:find-kernel-image-Windows} After we have demonstrated how security guarantees of Linux KASLR are undermined with speculative execution, we will now turn to the Windows OS. We chose a Skylake CPU and Windows~10 (version 1709) for our evaluation. Despite being OS agnostic, we still had to adjust our test program for Windows. More specifically, we have to work around user-land ASLR implementation differences between Windows and Linux. In contrast to Linux, which randomizes executables at every run, Windows randomizes them using a fixed seed determined at boot time. Consequently, running the same program multiple times does not randomize base addresses anymore, which we used to evade dynamic prediction. To solve the problem, we created a single executable probing multiple addresses one after another in consecutive speculative memory accesses, derandomizing the address space in a single run. As a side effect, this drastically improved the performance of our test program. Similar to our attack against Linux Kernel~\Cref{sec:find-kernel-image}, we will also run this program as a single process, this time using just one probe per address. The second challenge in Windows comes from KASLR itself. We observed that the kernel image is always loaded together with the hardware abstraction layer (HAL) module. However, the loading order is randomized (e.g., Kernel$\rightarrow$HAL or HAL$\rightarrow$Kernel). Additionally, although both the kernel image and HAL are allocated on consecutive large pages (pages that are 2MiB large instead of 4KiB), their entry points are randomized inside the large page and can start at any 4KiB boundary. Given that we can only probe for mapped pages, this attack only allows us find the base address of the large page containing the kernel image and HAL, and not their actual addresses. However, this still removes 18 bits of KASLR randomness and can be used in combination with other techniques (e.g., those discussed in \Cref{sec:relatedwork}) to break the remaining 9~bits (i.e., the 4KiB-aligned kernel offset). According to \Cref{sec:background-KASLR}, we scan the kernel address range from \texttt{0xfffff80000000000} to \texttt{0xfffff88000000000}. Given the alignment of large pages, we step through the memory in 2MiB increments, giving us in total ‭262144‬ tries. We verified that only the kernel image would allocate five consecutive 2MiB pages and use this as its fingerprint. Running the experiment 100 times showed that the kernel image area in Windows can be found in under a second (0.55s) on average\footnote{Note that the additional overhead in Linux was due to loading and removing the executable for each memory probe, which could also be heavily optimized.}. Out of 1000 runs, all 5 pages were found 74 times, while missing a single page 15 times and missing two pages 11 times. Throughout the test run, we did not see any false positives. \section{Introduction} Being at the core of any computer system, CPUs have always strived for maximum execution efficiency. Several hardware-based efforts have been undertaken to increase CPU performance by higher clock frequencies, increasing the number of cores, or adding more cache levels. Orthogonal to such developments, vendors have long invested in logical optimization techniques, such as complex cache eviction algorithms, branch predictors or instruction reordering. These developments made clear that CPUs do not represent hardware-only components any longer. Yet our level of understanding of the \emph{algorithmic}, i.e., software-side aspects of CPUs is in its infancy. Given that many CPU design details remain corporate secrets, it requires tedious reverse engineering attempts to understand the inner workings of CPUs~\cite{opcode_reverse_x86}. In this paper, we argue that this is a necessary direction of research and investigate the security implications of one of the core logical optimization techniques that is ubiquitous in modern CPUs: \emph{speculative execution}. Whenever facing a conditional branch for which the outcome is not yet known, instead of waiting (stalling), CPUs usually speculate one of the branch target. This way, CPUs can still fully leverage their instruction pipelines. They predict the outcome of conditional branches and follow the more likely branch target to continue execution. Upon visiting a particular branch for the first time, CPUs use \emph{static} prediction, which usually guesses that backward jumps (common in loops to repeat the loop body) are taken, whereas forward jumps fall through (common in loops so as not to abort the loop). Over time, the CPU will learn the likely branch target and then uses \emph{dynamic} prediction to take the more likely target. When a CPU discovers that it mispredicted a branch, it will roll back the speculated instructions and their results. Despite this risk of mispredictions, speculative execution has significantly sped up CPU performance and is part of most modern CPUs of popular vendors Intel, AMD or ARM-licensed productions. To the best of our knowledge, we are the first to analyze the security implications of speculative execution. So far, the only known drawback of speculative execution is a slightly higher energy consumption due to non-committed instructions~\cite{speculation_powerreduction}. As we show, its drawbacks go far beyond reduced energy efficiency. Our analysis follows the observation that CPUs, when executing code speculatively, might leak data from the speculated execution branch, although this code would never have been executed in a non-speculative world. Ideally, speculated code should not change the CPU state unless it is committed at a later stage (e.g., because the predicted branch target was confirmed). We analyze how an adversary might undermine this assumption by causing measurable side effects during speculative execution. We find that at least two feedback channels exist to leak data from speculative execution, even if the speculated code, and thus its results, are \emph{never} committed. Whereas one side channel uses our observation that speculated code can change cache states, the other side channel observes differences in the time it takes to flush the instruction pipeline. With these techniques at hand, we then analyze the security implications of the possibility to leak data from within speculative execution. We first show how a user-space attacker can abuse speculative execution to reliably read arbitrary user-space memory. While this sounds boring at first, we then also discuss how that might help an attacker to access memory regions that are guarded by conditionals, such as in sandboxes. We then analyze if an unprivileged user can use speculation to read even kernel memory. We show that this attack is fortunately not possible. That is, speculative execution protects against invalid reads in that the results of access-violating reads (e.g., from user to kernel) are zeroed. This observation, however, leads us to discover a severe side channel that allows one to distinguish between mapped and unmapped kernel pages. In stark contrast to access-violating memory reads (which are zeroed), page faults (i.e., accesses to non-mapped kernel pages) stall the speculative execution. We show that an attacker can use this distinction to reliably and efficiently determine whether a virtual memory page is mapped. This effectively undermines a fundamental assumption of kernel-based Address Space Layout Randomization (KASLR) designs~\cite{linux_kaslr} present in modern OSes (Windows 8.x+, Linux kernel 4.4+, iOS 4.3+, Android 8.x): KASLR's foremost goal is to hide the location of the kernel image, which is easily broken with speculative execution. Access violations in speculative execution---in contrast to violations in non-speculated execution---do not cause program crashes due to segmentation faults, allowing one to easily repeat checks in multiple memory ranges. In our experiments, we use commodity hardware to show that one can reliably break KASLR on Ubuntu 16.04 with kernel 4.13.0 in less than three seconds. \vspace{0.5em} \noindent In this paper, we provide the following contributions: \begin{itemize}[noitemsep,nolistsep] \item To the best of our knowledge, we are the first to explore the internals of speculative execution in modern CPUs. We reveal details of branch predictors and speculative execution in general. Furthermore, we propose two feedback channels that allow us to transfer data from speculation to normal execution. We evaluate these primitives on five Intel CPU architectures, ranging from models from 2004 to recent CPU architectures such as Intel Skylake. \item Based on these new primitives, we discuss potential security implications of speculative execution. We first present how to read arbitrary user-mode memory from inside speculative execution, which may be useful to read beyond software-enforced memory boundaries. We then extend this scheme to a (failed) attempt to read arbitrary kernel memory from user space. \item We discover a severe side channel in Intel's speculative execution engine that allows us to distinguish between a mapped and a non-mapped kernel page. We show how we can leverage this concept to break KASLR implementations of modern operating systems, prototyping it against the Linux kernel 4.13 and Windows 10. \item We discuss potential countermeasures against security degradation caused by speculative execution, ranging from hardware- and software- to compiler-assisted attempts to fix the discovered weaknesses. \end{itemize} \section{Related Work} \label{sec:relatedwork} In the following, we list some of the works that are related to our approach. This includes recent works targeting KASLR, but also side channels in general. We highlight that none of these works has proposed to use speculative execution for their side channels. In contrast, our work is the first to show how (i) speculation can be reliably abused to execute attacker-controlled code that is never executed without speculation, (ii) that such speculative execution is \emph{not} free of side effects, as assumed so far, and (iii) that even modern KASLR implementations using a high entropy (such as in Windows) are undermined when facing speculation. \subsection{Using Hardware to Challenge (K)ASLR} \etal{Hund}~\cite{kaslr_break_practicaltiming} propose timing-based side channel attacks against KASLR. They describe three different scenarios, Cache Probing, Double Page Fault, and Cache Preloading, in which the attacker is able to leverage side-channels in the hardware to derandomize KASLR. The general observation of these attacks is that, even though the memory accesses in kernel space result in privilege faults, their corresponding cache/translation entries are still stored and allow faster consecutive accesses. The translation cache side channel was further improved by \etal{Jang}~\cite{kaslr_break_tsx} by using Intel's TSX (Transactional Synchronization Extensions). TSX allows handling faulty memory accesses without OS intervention, reducing measurement noise. The authors managed map the whole kernel space, as well as distinguish their executable privileges. Instead of accessing privileged memory pages directly, \etal{Gruss}~\cite{kaslr_break_prefetch} suggest using prefetch instructions. Some of the advantages of prefetch instructions are that they do not cause page faults and ignore privilege checks, however, they still go through the same translation/lookup as regular memory access would, and thus leave a measurable trace behind. Another KASLR derandomization attack, from \etal{Evtyushkin}~\cite{kaslr_break_branchpredictor}, is more related to our approach, in that it also used branch predictors. However, instead of abusing speculative execution to run arbitrary code without consequences, the authors try to cause collisions in branch target buffers (BTB) and thus leak the lower addresses of randomized pages. Also user-space ASLR has been challenged by others. \etal{Gras}~\cite{alsr_break_AnC} use MMU features to derandomize ASLR to mount an attack by executing JavaScript code on a victim's browsers. \etal{Bosman}~\cite{aslr_break_deduplications} use the memory deduplication feature in operating systems to leak memory pointers from JavaScript, thus also resulting in successful ASLR derandomization (although the consequences of the complete attack were more significant than breaking ASLR). Similarly, \etal{Barresi}~\cite{aslr_break_dedup_VM} use memory deduplication in virtual machine monitors to leak the address space layout of neighbor VMs. \subsection{CPU-Related Side Channels} The need to run multiple processes on the same machine creates a requirement to share limited resources among all of them. This opens an opportunity for an adversarial process to leak sensitive information about the environment by looking at the utilization of those resources. For example, instruction caches have been used to leak the information about the execution trace of co-existing programs on the same execution core~\cite{yet_another_microarch_attack_icache,new_results_icache,rsa_vuln_icache,improve_rsa_attack_icache}, or even across different VMs on the same machine~\cite{cross_vm_icache}, allowing the attacker to reconstruct sensitive information, e.g., private keys of cryptographic protocols. In contrast to instruction caches, where the attacker recovers execution trace of the program, data cache attacks can reveal the patterns of data accesses of neighboring processes and thus reveal the underlying operation. These types of attacks have been shown to be successful in reconstructing different cryptographic secrets, such as AES keys~\cite{efficient_cache_attacks_dcache}. Similarly, a last-level data cache side channel can be used reconstruct private keys~\cite{cache_games_dcache}, or leak sensitive information across VMs, e.g., keystroke timings to snoop user-typed passwords in SSH~\cite{hey_get_off_my_cloud}. One of the techniques of leaking cache usage information in x86 is Flush\&Reload attack~\cite{flush+reload}. In this attack, the attacker issues the \asm{clflush} instruction to flush victim's cache lines. Measuring the same cache lines later will reveal if it has been accessed. However, Flush\&Reload assumes that the attacker has access to victim's memory pages (e.g., via shared pages). Prime\&Probe~\cite{last_level_cache_practical}, in contrast, does not require shared memory regions, and instead relies on cache collisions on shared caches between the attacker and the victim.
\section{Introduction} Raman spectroscopy can detect vibrational and electronic properties of materials over a broad range of temperatures and pressures, and is a well-established and widely-used non-destructive measurement technique~\cite{zhao2004raman,grasselli1993industrial}. Comprehensive predictive models for Raman and Brillouin spectra are important for many applications involving amorphous carbon-based materials, from nanotechnology to polymer reaction engineering~\cite{houben2015feasibility,frauendorfer2010polymerization,hergeth2003industrial,ferrari2006raman}. Of particular interest is emulsion polymerisation~\cite{elizalde2005monitoring}, a common manufacturing route for many rubbers and plastics. The complexity of this process hinders characterisation of product quality by traditional methods~\cite{kiparissides1996polymerization}, and it is increasingly being probed by Raman spectroscopy. The vibrational density of states (VDOS) of solids is the main input for the prediction of the Raman and Brillouin scattering spectra. For glasses, the Shuker-Gammon formula gives the Raman intensity as a function of the VDOS as~\cite{shuker1970raman} \begin{equation} I(\omega)=\frac{n(\omega)+1}{\omega}C(\omega) D(\omega) \text{,} \end{equation} where $n(\omega)+1$ is the Bose-Einstein occupation factor, $D(\omega)$ is the VDOS, and $C(\omega)$ is the photon-phonon coupling coefficient. Since $C(\omega)$ is a simple function of frequency, possibly quadratic~\cite{martin1974model}, it is clear that most of the structure of the Raman spectrum is directly related to the $D(\omega)$ spectrum. While the VDOS of crystals can be obtained by a straightforward exercise in Fourier analysis, the same problem for amorphous solids, such as glasses, is analytically intractable and presents a rich phenomenology. This phenomenology is yet more complex when the building blocks are polymer chains, which, in the disordered glassy state, can have a considerably larger variety of conformations. There have been numerous studies into the vibrational properties of polymeric systems~\cite{herzberg1945molecular,bower1992vibrational}, starting from theoretical determinations of the single-chain backbone vibrational spectra in seminal works by~\citet{kirkwood1939skeletal} and~\citet{pitzer}, followed by the powerful combination of Wilson's GF-method with group theory by~\citet{higgs1953vibration}. These methods are not applicable to polymer glasses, however, where the chain conformation does not possess any periodicity that can allow the application of group theoretical methods. Further advances in numerical techniques have focused on reducing the computational time of the diagonalization problem~\cite{zerbi1971vibrational}. While signatures of individual monomers and their constituent bonds are very well characterized in the vibrational bands of highest energy in the spectrum, the relation between coarse-grained polymer structures and vibrational properties in the low frequency part of the spectrum is relatively unexplored. In the contemporary literature, the use of coarse-grained systems as model materials for studying the vibrational properties of amorphous solids has become a standard approach~\cite{damart2017theory,ilyin2009randomness,lemaitre2006sum,zaccone2011approximate}. In this direction, coarse-grained simulations based on the classical Kremer-Grest model~\cite{kremer1986dynamics} for bead-spring polymers can enable direct calculation of the VDOS. With a suitable procedure for coupling the VDOS to the Raman spectra~\cite{ilyin2009randomness}, such numerical approaches will be able to offer a systematic approach to linking vibrational properties to coarse-grained structures for polymers of arbitrary length and monomer-monomer interactions. Here, we report the structural properties and the VDOS for coarse-grained polymer glasses as functions of the chain length and the chain bending stiffness. We identify clear trends in the vibrational spectra that derive from microstructural rearrangements as the chain length and chain stiffness increase. Through these quantities, it will be possible in future work to make predictions about how the experimentally observed vibrational spectra will evolve during the course of an emulsion polymerisation, for example, guiding the development of noninvasive industrial process monitoring techniques. This work can further serve as the basis for quantitative understanding and modelling of Raman and Brillouin spectra at the atomistic level, particularly by coupling to atomistic simulation techniques. In the following, we first describe the numerical method used, then go on to study the structural and volumetric changes as functions of varying chain length and stiffness. We then analyze the VDOS as a function of chain length and stiffness, providing a mechanistic interpretation informed by an analytical argument. \section{Simulation details} Our model uses a coarse-graining approach that treats polymer chains as linear series of monomer `beads' on an elastic string. In a harmonic approximation, monomeric scale physics dominate the region of the VDOS of interest to this work, and indeed govern the viscoelastic response of the material~\cite{palyulin2017instantaneous}. For each bead in the system we use \texttt{LAMMPS}~\cite{plimpton1995fast} to solve the Langevin equation \begin{equation} m\frac{d{v}}{dt} = -\frac{m}{\xi}{v} - \frac{d{U}}{dr} + {f}_B(t) \text{,} \end{equation} for uniform beads of mass $m$ and velocity ${v}$, coefficient of friction $m/\xi$ and random forces ${f}_B(t)$ satisfying $\langle f_B(t)f_B(t')\rangle = 2mk_BT\delta(t-t')/\xi$. Beads interact with each other through a potential $U$, given by the Kremer-Grest model~\cite{kremer1986dynamics} with the addition of angular potentials that impose bending constraints on triplets of three consecutive beads along the chain backbones. Overall, the model for the potential energy $U$ comprises three terms: \begin{figure} \includegraphics[trim={102mm 115mm 0mm 0mm},clip,width = 0.275\textwidth]{FIGURES/FIG1} \caption{ Sketch of simulated polymer system showing two interacting chains (blue and pink). Shown are the LJ rest position of $2^{1/6}\sigma$ between non-bonded beads, the FENE rest position of $0.96\sigma$ between beads along a single linear chain, and the angle $\theta$ formed between three consecutive beads (forming a triplet) along chains. } \label{fig:sketch} \end{figure} [i] A truncated and shifted Lennard-Jones (LJ) potential of form \begin{equation} U_\mathrm{LJ}(r) = 4\varepsilon_\mathrm{LJ} \left[\left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^6 - \left(\left(\frac{\sigma}{r_c}\right)^{12} - \left(\frac{\sigma}{r_c}\right)^6\right) \right] \text{,} \end{equation} acting between all bead pairs within a cut-off range $r_c=2.5\sigma$, where $r$ is the bead-bead separation, $\sigma$ is the zero-crossing distance for the potential and the prefactor $\varepsilon_\mathrm{LJ}$ sets the LJ energy scale. Setting $\frac{dU_\mathrm{LJ}(r)}{dr} = 0$ leads to an energy minimum and corresponding LJ rest position at $2^{1/6}\sigma$. The LJ potential effectively acts as an excluded volume, as illustrated in Figure~\ref{fig:sketch}; [ii] A finitely extensible nonlinear elastic (FENE) potential acting between sequential bead pairs along each linear chain \begin{equation} U_\mathrm{FENE}(r) = -0.5\varepsilon_\mathrm{FENE} R_0^2 \ln \left[1 - \left(\frac{r}{R_0}\right)^2\right] \text{,} \end{equation} where $R_0$ is the maximum FENE bond length and $\varepsilon_\text{FENE}$ is the bonding energy scale. Adjacent beads along polymer chains have an overall interaction that represents the sum of the Lennard-Jones and FENE potentials, giving a rest position for bonded beads (obtained by setting $\frac{d}{dr}(U_\mathrm{LJ}(r)+U_\mathrm{FENE}(r))=0$) as $\approx0.96\sigma$ for the parameters used throughout this work. This discrepancy relative to the LJ rest length gives sufficient bidispersity to suppress crystallisation throughout, and we set $\varepsilon_\mathrm{FENE}/\varepsilon_\mathrm{LJ} = 30$; [iii] An energy associated with chain bending, given by \begin{equation} U_{\mathrm{bend}}(\theta) = \varepsilon_\mathrm{bend}[1-\cos(\theta-\theta_0)] \end{equation} for energy scale $\varepsilon_\mathrm{bend}$. The angle $\theta$ is formed between three consecutive beads (a triplet) along the length of the linear chains (Figure~\ref{fig:sketch}), and the characteristic rest angle is $\theta_0 = 109.5^\circ$. The resistance to bending of the polymer chains is thus set by $\varepsilon_\mathrm{bend}$, which is related to the persistence length $l_{p}$ of the chain via the standard relation: $l_{p}=\varepsilon_\mathrm{bend} \sigma /k_b T$. The relative importance of the three potentials in setting the overall structure and dynamics of the polymers is determined by their prefactors $\varepsilon_\mathrm{LJ}$, $\varepsilon_\mathrm{FENE}$ and $\varepsilon_\mathrm{bend}$. Since each of the potentials has a different form, it is difficult to compare the values of these prefactors directly. In order to render the different interaction strengths more comparable, therefore, we find it convenient to take a harmonic approximation about the rest position of each potential and consider the resulting spring constants $\kappa$. We find $\kappa_\mathrm{LJ} \approx 57.1\varepsilon_\mathrm{LJ}/\sigma^2$, $\kappa_\mathrm{FENE} \approx 32.7\varepsilon_\mathrm{FENE}/\sigma^2$ and $\kappa_\mathrm{bend} = \varepsilon_\mathrm{bend}/\sigma^2$. To characterize our systems we use two control parameters $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ and $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$ that compare the bending stiffness to the LJ and FENE bond strength, respectively. The strength of FENE bonds is fixed such that $\kappa_\mathrm{FENE}/\kappa_\mathrm{LJ} \approx 17.2$ throughout (recalling that $\varepsilon_\mathrm{FENE}/\varepsilon_\mathrm{LJ} = 30$). We explore bending stiffnesses in the range $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ} = 0 \to 20$. A sketch of two interacting polymer chains is shown in Figure~\ref{fig:sketch}, highlighting the angle $\theta$ on which $U_\mathrm{bend}$ acts as well as the rest positions for LJ ($2^{1/6}\sigma$) and FENE ($0.96\sigma$) interactions. With reference to fundamental units of mass $\mu$, length $d$, and energy $\epsilon$, we set $\sigma=1$, $R_0=1.5$, $m=1$ and $\varepsilon_\mathrm{LJ}=1$, giving a time unit of $\tau=\sqrt{m\sigma^2/\varepsilon_\mathrm{LJ}}$, and we set $\xi=100\tau$. The system volume $V$ has units $d^3$. A dissipative timescale emerges as $m\sigma^2/\xi\varepsilon_\mathrm{LJ}$, and a thermal timescale emerges as $m\sigma^2/\xi k_BT$ (where $k_B := 1$ [units energy/temperature]). The state of our system, i.e. whether it is in the melt or glassy state, is simply given by the ratio of these timescales, as $T^*=k_BT/\varepsilon_\mathrm{LJ}$. Two additional rescaled temperatures could be defined using $\varepsilon_\mathrm{FENE}$ or $\varepsilon_\mathrm{bend}$ as the reference energy, but we find that the most convenient description and characterisation of the transition to glassy behavior is obtained using $\varepsilon_\mathrm{LJ}$. Initial loose polymer configurations are generated within a cubic periodic domain using a non-overlapping random-walk algorithm. We use a system of $N_p = 5\times10^3$ beads, in chains of uniform length $L$, which we vary from 2 to 50. The value of $N_p$ is chosen following the entanglement critical of Ref~\cite{sliozberg2012bead}, and moreover we demonstrate the sensitivity to $N_p$ in Figure~\ref{fig:dos_split}. For each value of $L$ we generate 5 realisations of the system for the purposes of ensemble averaging. We comment on the variation between realisations elsewhere~\cite{palyulin2017instantaneous}. The system is first equilibrated in a melted state at $T^*=1.2$, maintaining zero external pressure using a Nose-Hoover barostat with damping parameter of $100\tau$. The system is subsequently cooled to $T^*=0.1$ by decreasing $T^*$ at rate $1/\tau_c$, with $\tau_c \sim \mathcal{O}(10^5)\tau$. Since $T^*=0.1$ is below the glass transition for all of the polymers considered in this work, this cooling procedure allows us to measure $T_g$. For determining the vibrational properties, though, it is necessary to go to lower temperatures. To reach temperatures closer to $T^*=0$, we subsequently relax the system further by applying the gradient method to the simulation configuration at constant volume. We used the fluctuation of net forces acting on beads $\langle f_i^2\rangle \sim T^*$ as a measure for temperature. By comparing the forces with the reference value from $T^*=0.1$ we get the temperature of the relaxed configuration by $T^* = 0.1 \langle f_i^2\rangle/\langle f_i^2(T^*=0.1)\rangle$. By this protocol, a target temperature of $T^*=10^{-4}$ was reached for each realization. Further decreasing the temperature does not lead to changes in the VDOS or structural quantities. \section{Structure of coarse-grained polymer glasses} \subsection{Changes in $T_g$ with chain length and stiffness} \begin{figure} \includegraphics[trim={0 0 80mm 0},clip,width = 0.48\textwidth]{FIGURES/FIG2} \caption{Volume-temperature curves for polymer cooling as functions of chain length and chain stiffness. The volume is rescaled with bead number $N_p$ and size $\sigma^3$. a) Increasing chain length for $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0$. Highlighted is the glass transition temperature $T_g^*$, where the polymer transitions from a melt to a glassy state; b) Increasing chain length for $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=17.5$; c) Increasing chain stiffness for chain length 3; d) Increasing chain stiffness for chain length 50. Colors in (a) and (b) refer, from blue to red, to chain lengths 2, 3, 4, 5, 20 and 50. Colors in (c) and (d) refer, from blue to red, to chain stiffnesses $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ = 0.0175, 0.0525, 0.175, 0.525, 1.75, 5.25 and 17.5. } \label{fig:tg} \end{figure} Ensuring that the external pressure remains zero, the system undergoes a decrease in volume $V$ as it is cooled, Figure~\ref{fig:tg}. In Figure~\ref{fig:tg}a, a change of gradient is identified at $T^*=T_g^*$, corresponding to the glass transition~\cite{han1994glass,white2016polymer}. As reported in Figures~\ref{fig:tg}a-b, the model predicts that $T_g^*$ increases with the chain length~\cite{boyer1974variation}, consistent with the classical free-volume result of Flory and Fox~\cite{fox1950second}, and with the more recent criterion based on generalized Born melting for glasses~\cite{zaccone2013disorder}. This is the case for both fully flexible ($\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0$) and very stiff ($\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=17.5$) chains. As expected~\cite{strobl1997physics}, we further find that $T_g^*$ increases with $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ (Figure~\ref{fig:tg}c-d), with apparent limiting values occurring for $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}\to0$ and $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ} > 4$. The increase is significantly more pronounced as $L$ is increased. We reported the increase of $T_g^*$ with $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ and provide further details in our earlier article~\cite{ness2017nonmonotonic}. We find that $T_g^*$ varies between $\approx 0.4$ and $\approx 0.9$ for all values of $L$ and $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$, and that in all cases the system is well within the glassy state at $T^*=0.1$. When we increase $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ above 20 (corresponding to $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}\approx 1$), we find that the angular potentials are large enough to stretch the FENE bonds beyond their maximum length $R_0$ at which point the chains break and the simulation becomes unstable due to the divergence of the $\ln(1-\left(r/R_0\right)^2)$ term in the FENE expression. We therefore treat this as a limiting value of $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ and do not explore stiffer chains. \subsection{Changes in density with chain length and chain stiffness} \begin{figure} \includegraphics[trim={0 0 0mm 0},clip,width = 0.45\textwidth]{FIGURES/FIG3} \caption{Contour plot of polymer glass density (enumerated as $N_p\sigma^3/V$ at $k_bT/\varepsilon_\text{LJ}=0.1$) as functions of chain length and chain stiffness. We note that increasing chain length leads to compaction for flexible chains but expansion for stiff chains.} \label{fig:density} \end{figure} It is evident from Figure~\ref{fig:tg} that the value of $V/N_p\sigma^3$ at $T^*= 0.1$ is sensitive to both chain stiffness and length. In our earlier article~\cite{ness2017nonmonotonic}, we showed that differences in $V/N_p\sigma^3$ persist even at fixed $T^*/T_g^*$ (rather than fixed $T^*$), demonstrating that there are robust changes in density as chain bending and length are varied. We present in Figure~\ref{fig:density} a contour map of polymer glass density, quantified as the number of beads per unit volume $N_p/V$, rescaled by the characteristic bead excluded volume $\sigma^3$, measured at $T^*=0.1$. Since our subsequent minimization protocol conserves volume, the map also applies at $T^*=10^{-4}$. With respect to the density at $L=3$, it is interesting to note that increasing chain length leads to compaction for flexible chains but expansion for stiff chains. For very flexible chains ($\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}\ll1$), the key effect of increasing chain length is to move bead pairs from the LJ rest position at $2^{1/6}\sigma$ to the FENE rest position at $0.96\sigma$, while maintaining a purely central-force system with minimal explicit bending constraints. As a result, the density increases with increasing chain length as illustrated in Figure~\ref{fig:density} and similarly by the decreasing value of $V/N_p\sigma^3$ at $T^*=0.1$ in~Figure~\ref{fig:tg}a. For less flexible chains, the roles of stiffness and chain length are more subtle. In order to achieve mechanical stability at, and below, $T_g^*$, approximately monodisperse beads in central force networks require six pairwise interactions to fully constrain their translational degrees of freedom, in agreement with Maxwell's criterion for isostaticity. As bending stiffness is increased, the translational motions of beads along chain backbones become increasingly constrained by three(and many)-body interactions. This means that as $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ increases, the translational degrees of freedom of individual beads can be fully constrained with fewer than six pairwise interactions per bead~\cite{zaccone2013disorder,hoy2017jamming}. We quantified this effect using the coordination number $Z$ in another contribution~\cite{ness2017nonmonotonic}. Since we operate at fixed external pressure, this lower coordination further implies that marginal stability can be achieved at lower density as stiffness is increased. This is the result observed in Figure~\ref{fig:density} for $L>3$ and indeed in Figure~\ref{fig:tg}c-d (inverse density $V/N_p\sigma^3$ at $T^*=0.1$ increases with increasing $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$), with the effect becoming more evident for longer chains, which permit many-body interactions. As we deviate from the short chain limit, it is interesting to note that there is a continuous transition from very weak dependence to rather strong dependence on stiffness with increasing chain length. This can be interpreted by considering again the coordination argument above, which argued that bending constraints impose many-body effects along chains such that marginal stability can be achieved with fewer \emph{pairwise} contacts than otherwise. For shorter chains, the maximum number of beads than can be correlated with one another in this way is small, so many-body interactions only have a weak contribution to the overall stability of the material. As such, when the stiffness is increased in short chains where there aren't many angular potentials defined (in relative terms), most of the interactions remain as central force and as such the density varies only weakly. Conversely, for long chains, the increased stiffness allows many-body bending constraints to affect a higher proportion of the overall number of interactions, so the density decrease becomes exaggerated. Interestingly, at $L=50$, the variation of density with chain stiffness is not linear, but rather it has an inflection around $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}\approx 1$. \subsection{Deviations from rest positions and the resulting internal stresses} \begin{figure} \includegraphics[trim={0 18mm 0mm 0},clip,width = 0.475\textwidth]{FIGURES/FIG4} \caption{(a) Radial distribution function $g(r)$ and (b) angular distribution function $p(\theta)$ for chains with $L=10$ and $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.175$. Shown are the FENE rest position, LJ rest position and the resting angle, as well as the force cut-off beyond which we do not compute LJ interactions. (c) and (d) illustrate the implicit angular resting positions that arise due to two different configurations of the excluded volumes of beads.} \label{fig:gr} \end{figure} \begin{figure*} \includegraphics[trim={0 0 0mm 0},clip,width = 0.8\textwidth]{FIGURES/FIG5} \caption{ Structural origin of internal stresses in the polymer glasses as a function of chain length and stiffness. Shown are a) Mean deviation of LJ pairs from their rest position; b) Mean deviation of FENE bonds from their rest position; c) Mean deviation of angles from their rest position, showing approximate independence of chain length; d) Total potential energy per unit volume, equivalent to the internal stress of the material. } \label{fig:maps} \end{figure*} It is likely that steric constraints will play a role within our densely packed systems, meaning that beads will not typically be situated at their minima with respect to all three potentials (LJ, FENE, bending) even when the temperature is considerably less than $T_g^*$. Such deviations from minima will lead naturally to internal stresses in the material. As chain length and bending stiffness are increased, it is likely that the extent to which beads deviate from their respective rest positions, and hence the total internal stress in the material, will change. It was shown recently~\cite{lin2016evidence} that properly accounting for internal stresses in jammed emulsions is crucial to correctly obtaining the VDOS. Here we give a description of the source of internal stresses, which will help to guide our interpretation of the VDOS below. To illustrate the deviation of beads from their rest positions, we present in Figure~\ref{fig:gr} an example bead-bead radial distribution function $g(r)$ and angular distribution function $p(\theta)$ for chains with $L=10$ and $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.175$ in the minimized configuration, highlighting the specified rest positions for LJ, FENE and bending potentials as well as the LJ cut-off distance. There is a clear deviation from each of the rest positions. In particular, LJ-bonded beads lie, on average, closer than their rest positions dictate, while FENE bonds are typically stretched, Figure~\ref{fig:gr}a. Although the FENE bonds have a steeper potential than their LJ counterparts, the LJ bonds are far more widespread in the system, being both longer range and inter-chain. Thus it is likely that the mean positions of FENE-bonded pairs can be dictated by the LJ bonds in their immediate vicinity. Deviations of both LJ and FENE naturally lead \textit{locally} to internal stresses and thus to a net storage of potential energy in the system. Furthermore, Figure~\ref{fig:gr}b shows peaks in the angular distribution at around $\theta = 70^\circ$ and $\theta=120^\circ$ that are not related to the potential minimum at $\theta_0 = 109.5^\circ$. Rather, implicit angular constraints that generate energetically favorable configurations arise in the material due to the LJ and FENE potentials. We illustrate such configurations in Figures~\ref{fig:gr}c-d. These configurations nonetheless lie far from their bending potential minima, thus accumulating additional potential energy in the system. The broad $p(\theta)$ distribution steadily narrows as the value of $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ is increased, as we showed in an earlier article~\cite{ness2017nonmonotonic}. To quantify the potential energy in the system, we compute the mean displacement of beads from their rest positions as a function of chain length and stiffness. At any time, there are $N_\mathrm{LJ}$ Lennard-Jones interactions (including those up to the cut-off $r_c=2.5\sigma$), which we label with the index $\alpha$ (so the bead-bead distance is $r_\alpha$). We take the average magnitude of the deviation of $r_\alpha$ from the LJ rest position. Analogous calculations are done for FENE interactions and bending interactions. Overall, we compute: $ \frac{1}{N_\mathrm{LJ}}\sum_\alpha|r_\mathrm{\alpha}-2^{1/6}\sigma| $, $ \frac{1}{N_\mathrm{FENE}}\sum_\beta|r_\mathrm{\beta}-0.96\sigma| $ and $ \frac{1}{N_\mathrm{bend}}\sum_\gamma|\theta_\mathrm{\gamma}-\theta_0| $. The results are given in Figure~\ref{fig:maps}a-c for LJ, FENE and bending interactions respectively. As bending stiffness $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ increases, the chains increasingly conform to $\theta_0$ independently of chain length (Figure~\ref{fig:maps}c). This requires changes in structure that must be accommodated by small additional deviations of LJ and FENE bonds from their resting positions. For LJ interactions (Figure~\ref{fig:maps}a) the deviations increase steadily with stiffness. This effect is more marked for long chains, which have a larger number of bending constraints per bead. For FENE bonds (Figure~\ref{fig:maps}b), meanwhile, the behavior is more subtle. The primary effect is similar to that observed for LJ interactions: increasing bending stiffness increases the deviation of FENE bonds from their rest positions. For short and flexible chains, however, there is an anomalous secondary effect: for $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}<1$, the deviation of FENE bonds increases with \emph{decreasing} chain length. As discussed above, the ubiquity of LJ interactions means they may dictate the positions of FENE bonded beads regardless of their considerably weaker potential. As chain length decreases, the average number of FENE bonds per bead decreases steadily, while the number of LJ interactions per bead remains unchanged. This means that LJ interactions can have more influence on FENE positions as chain length decreases, thus leading to additional stretching. This effect is stronger for flexible chains, which don't have the additional effect of angular constraints. We further show that deviations from rest positions lead directly to potential energy being stored in the system in each case. The potential energy is calculated by summing $U_\mathrm{LJ}$, $U_\mathrm{FENE}$ and $U_\mathrm{bend}$ over every interaction in the minimized configuration, and is given as a function of chain length and stiffness in Figure~\ref{fig:maps}d. The main effect is that increasing chain length introduces more FENE bonds into the system, whose individual deviations of $\sim0.02\sigma$ (Figure~\ref{fig:maps}b) contribute significantly to increasing stored potential energy. There is an additional effect whereby stored potential energy increases with increasing stiffness. This has contributions from LJ and FENE, in line with their deviations shown in Figures~\ref{fig:maps}a-b, and also from bending potentials. Although the triplet configurations increasingly conform to their rest positions with increasing stiffness, remaining deviations become progressively more costly as $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ increases, leading to a contribution to the stored potenital energy. \subsection{Overview of structural changes} The evolution of density and internal stresses (as parameterized by deviations from interaction energy minima) are strong functions of the bending stiffness and chain length. Upon increasing the stiffness, all angles between adjacent bonds tend to approach the minimum of the bending potential at $\theta_{0}$. However, this effect competes with the tendency of neighboring beads to stay close to the minima of LJ and FENE interactions. This competition leads to an increase of potential energy due to pairs of beads drifting subtly away from LJ and FENE minima. The effect of increasing the chain length is to insert more FENE bonds into the system. Since these are typically $\sim0.02\sigma$ from their resting positions, this leads to a sharp increase in stored potential energy. We have checked that increasing chain length further above $L=50$ does not bring any further evolution, and we can safely conclude that chain length has a non-negligible effect only for $L<50$. \section{Vibrational density of states} We next investigate the connection between chain length, angular potential and the VDOS. Importantly, changes in the spectrum due to increasing the angular potential are not only related to the associated increase in angular forces, but also to the structural changes that arise as discussed above. In what follows, we first outline our formalism for obtaining the VDOS, including a description of how we decompose it into various contributions. We then give an overview of the generic features of the VDOS of polymeric glasses, before focussing specifically on the behavior with respect to chain length and bending stiffness. \subsection{Formalism for obtaining the VDOS} Since we prepared the glasses well below $T_g^*$, we can ignore any effects of thermal noise and hence work in the harmonic approximation, where the displacements of the system around energy minima are small. The equation of motion can therefore be written with the Hessian $\textbf{H}$ of our system: \begin{equation}\label{eq:NewtonsEquation} m \,\ddot{\textbf{u}} \,=\, - \textbf{H} \, \textbf{u} \text{.} \end{equation} Here $m$ is the mass of the constituent beads of our polymer chains (which we take to be uniform) and $\textbf{u}$ is the displacement field. We can convert this equation into an eigenvalue problem by performing a Fourier transform, which gives: \begin{equation}\label{eq:EigenvalueProblem} m \,\omega^2\,\hat{u} \,=\, \textbf{H} \, \hat{u} \text{,} \end{equation} where $\omega$ are the eigenfrequencies of our system and $\hat{u}$ are the eigenvectors (displacement fields). Arranging the eigenfrequencies in a normalized histogram gives us the vibrational density of states (VDOS) of our system. To obtain $\omega$, we first need the explicit expressions for the elements of the Hessian, after which we can solve Equation~\eqref{eq:EigenvalueProblem} numerically. The elements of the Hessian are defined as second derivatives of the potential energy of the system: \begin{subequations} \begin{equation}\label{eq:HessianDef} H_{n m}^{a b} \,=\, \frac{\partial^2 \mathcal{U}(z)}{\partial r_n^a\,\partial r_m^b} \text{,} \end{equation} \begin{equation} \begin{split} \frac{\partial^2 \mathcal{U}(z)}{\partial x\,\partial y}\,&=\, \frac{\partial^2 \mathcal{U}(z)}{\partial z^2} \frac{\partial z}{\partial x} \frac{\partial z}{\partial y} \,+\, \frac{\partial \mathcal{U}(z)}{\partial z} \frac{\partial^2 z}{\partial x\,\partial y}\,\\ &=\, c\, \frac{\partial z}{\partial x} \frac{\partial z}{\partial y} \,+\, t\, \frac{\partial^2 z}{\partial x\,\partial y} \text{.} \end{split} \end{equation} \end{subequations} Here, $\mathcal{U}$ represents the overall potential, consisting of the sum of $U_\mathrm{LJ}$, $U_\mathrm{FENE}$ and $U_\mathrm{bend}$, $z$ is a generic argument, and $a$ and $b$ label the Cartesian components. As one can see, the entries in the Hessian consist of two parts: one proportional to the spring constant $c$ between two beads, and another one proportional to the tension $t$ (precise definitions are given in Appendix A). The latter contribution vanishes if all bonds are at their energy minimum at the same time. In reality this would require perfect crystallisation of the system, which is often not possible or would take a very long time. In this case, crystallisation is inhibited even for fully flexible chains by the disparity in rest positions of LJ and FENE interactions. Another source of tension is thermal noise, though this is not addressed in the present work since we work sufficiently below $T_g^*$. The main source of tension terms in our simulations is thus the angular potential and its competition with the LJ and FENE potentials, as discussed above. This combination of potentials creates two competing effects: the stronger angular potential forces all angles closer to the rest angle $\theta_0$, but also increases the strength of the tension for a given deviation, and generates additional tensions due to increased deviations from the LJ and FENE minima. Including them in the Hessian, we can now solve Equation~\eqref{eq:EigenvalueProblem} and get the eigenvalues $\omega$ and displacement fields $\hat{u}(\omega)$. The units of $\omega$ are $\sqrt{\varepsilon_\mathrm{LJ}/m \sigma^2}$. \begin{figure} \centering \includegraphics[trim=0cm 6.8cm 0cm 0cm, clip=true,width=0.45\textwidth]{FIGURES/FIG6} \caption{ (a) Important motions of bead $i$ along the polymer chains. $\hat{a}_{i,1}$, red circle denotes the motion perpendicular to the plane spanned by the two bonds (black lines) also referred to as rocking motion. The other two planar motions are perpendicular ($\hat{a}_{i,2}$, blue arrows) and along the chain ($\hat{a}_{i,3}$, green arrows); (b) Example VDOS for chain length $L=50$ and stiffness $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.525$, displaying a lower-frequency band corresponding to collective LJ-dominated motions, and a higher-frequency band corresponding to skeletal motions, which include FENE bonds. The dashed line (red) represents rocking motions, the dashed-dotted (blue) line represents perpendicular skeletal motions, while the dotted line (green) represents along-chain skeletal motions. } \label{fig:motions} \end{figure} A particularly instructive quantity is the ratio at which different vibration patterns contribute at certain frequencies~\cite{damart2017theory}. We are especially interested in the internal-coordinate directions shown in Figure~\ref{fig:ChainMotion}. These motions correspond to out-of-plane ``rocking'' motions (red, $\hat{a}_{i,1}$), perpendicular (to the chain) motions that remain in the plane of the chain (blue, $\hat{a}_{i,2}$), and ``along-chain'' motions (green, $\hat{a}_{i,3}$). To obtain each of these contributions separately, we project the displacement vector $\hat{u}_i(\omega)$ of each bead onto the orthogonal basis formed by the three unit vectors $(\hat{a}_{i,1}, \hat{a}_{i,2}, \hat{a}_{i,3})$ (see Figure~\ref{fig:motions}), generating a new representation $\hat{v}_i(\omega)$: \begin{equation}\label{eq:BaseChange} \begin{gathered} \hat{v}_i(\omega) \,=\, \begin{pmatrix} \hat{u}_i(\omega) \cdot \hat{a}_{i,1}\\ \hat{u}_i(\omega) \cdot \hat{a}_{i,2}\\ \hat{u}_i(\omega) \cdot \hat{a}_{i,3} \end{pmatrix} = \begin{pmatrix} \hat{v}_{i,1}\\ \hat{v}_{i,2}\\ \hat{v}_{i,3} \end{pmatrix}\\ \mathcal{X}_j(\omega) \,=\, \sum\limits_{i=1}^N \hat{v}_{i,j}^2 \qquad j = \{1,2,3\} \end{gathered} \end{equation} $\mathcal{X}_j(\omega)$ is a weight function which measures the contribution of each of the three different motions discussed above, from which we get a partial VDOS showing the contribution of each of these three motions to the full VDOS. This decomposition provides insights into the dynamics of the chains at different frequencies in the spectrum. \subsection{The vibrational spectrum: results and interpretation} \begin{figure*} \includegraphics[trim=0mm 22mm 0mm 0mm, clip=true,width = 0.98\textwidth]{FIGURES/FIG7.pdf} \caption{ VDOS for $L=3$ with (a) $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.001$; (c) $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.306$; (e) $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=1.019$. (b) Analytical solution for the three non-zero eigenfrequencies of a chain with $L=3$ (pictured in Inset) as a function of $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ (see Appendix~\ref{app:l3}). (d,f) Contribution weights for along-chain and perpedicular motion for $\omega_1$ and $\omega_3$ from analytical model. The weights of $\omega_2$ are inverted compared to $\omega_3$. Vertical dashed lines in (b,d,f) indicate sample values of $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$ for which the VDOS are shown in (a,c,e). As we can, see the qualitative behavior of our simulated systems with $L=3$ is well-captured by the analytical model, both in terms of frequency and motion weight evolution. The frequencies measured by simulation differ slightly in magnitude due to the large number of LJ interactions that collectively push the bond energy, and therefore frequency, to higher values.} \label{fig:dos} \end{figure*} \subsubsection{Collective Lennard-Jones `sea' and higher frequency skeletal modes} An example VDOS is given in Figure~\ref{fig:motions}, for chain length $L=50$ and stiffness $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}=0.525$, while in Figure~\ref{fig:dos_split} we present the VDOS across the full range of stiffnesses and chain lengths. A common feature of this work is a distinct splitting of the VDOS into low and high frequency parts, particularly evident for low bending stiffness. The low frequency part occupies the interval $\omega=[0,\sim40$], while the high frequency part extends up to $\omega\approx 70$ in most cases, and up to $\omega\approx 100$ when $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}\gtrsim1$. The low and high frequency bands are separated by a trough, whose depth and precise location in $\omega$ is subtly dependent on $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$. This generic splitting of the VDOS into two bands was shown previously by~\citet{jain2004influence}, who considered fully flexible chains only. Moreover, experimental works in polymerisation have demonstrated that during periods of chain growth a single peak in the Raman intensity transforms into two peaks~\cite{caponi2009raman,caponi2011effect}. These may be related to the two distinct bands predicted here, though a quantitative link between the Raman spectra and the VDOS reported here remains challenging and is the subject of ongoing work. We expect, furthermore, that imposing pressures greater than zero will increase the vibrational energy of both bands, thus shifting the spectrum to higher frequencies as observed experimentally~\cite{hong2008pressure}. By considering the relative prefactors of the LJ and FENE potentials, we find it instructive to interpret the low frequency part as a Lennard-Jones `sea', that comprises weak but ubiquitous inter-chain LJ interactions, while the high frequency part represents FENE bonds that are fewer in number and follow specific paths along chain backbones. Within this picture, the contributions to the VDOS coming from bending interactions are highly sensitive to $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$. In particular, when $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ is small, we expect bending interactions to contribute frequencies comparable to, or even lower than, the LJ interactions. By contrast, when $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}\to1$ we expect the bending interactions to contribute frequencies comparable to the FENE interactions. We anticipate a redistribution, therefore, of the bending contributions from the low to the high frequency band as $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ is increased. By analysing the motion patterns with respect to the geometry outlined in Figure~\ref{fig:ChainMotion}, we can see in Figure~\ref{fig:motions} that for flexible chains out-of-plane (rocking) motions are predominantly apparent in the low frequency peak, while the more energetic modes mainly contain motions in the plane (skeletal vibrations). This is consistent with the low frequency band being mainly due to LJ interactions, since they are the only interactions in the system which are not contained in the plane defined by two adjacent bonds. Consequently, the high frequency part is mostly caused by the FENE bonds, which point along the chain backbones. For high bending stiffness we can see a separation between along chain and perpendicular motion, of which the latter one occupies the high frequency part. Hence, the three-body bending interaction is mostly associated with perpendicular motion, whereas the FENE interaction is rather associated with along-chain motions. This makes sense as our chains have a rest angle $\phi_0 > \pi/2$, meaning the FENE bonds point mostly along the chain direction. For longer chains we see rocking motion arising at higher frequencies. The reason for this is that perpendicular in-plane motion caused by one triplet in the chain causes out-of-plane motion from the perspective of neighboring triplets, since they most likely do not lie in the same plane (as would be the case for a completely flat chain). As our chains are freely rotating, having a completely flat chain is very unlikely, which explains why strong bending interaction causes rocking motion at high frequencies. \begin{figure} \includegraphics[width = 0.45\textwidth]{FIGURES/FIG8} \caption{ (a) Vibrational density of states for $L=50$ upon increasing the stiffness, $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$. The arrow points in the direction of increasing bending stiffness; (b) Same data as (a) with the VDOS $D(\omega)$ rescaled by $\omega^2$ to highlight the behavior of the Boson peak.} \label{fig:dos_stiffness} \end{figure} \subsubsection{Short chain behavior} For chains with $L=3$, we use the analytical form of the eigenvalues, including both bending and stretching interactions, to provide insights into the behavior of the VDOS measured in the simulation. The analytical derivation is reported with full details in Appendix~\ref{app:l3}, with the expressions for the eigenvalues given in Equation~\eqref{L3_eigenvalues}. We present both the analytical and numerical results in Figure~\ref{fig:dos}. The analysis predicts three non-zero eigenmodes, whose characteristic eigenfrequencies as a function of $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ are given in Figure~\ref{fig:dos}b. The splitting of their associated motions into along-chain and perpendicular components are given in Figures~\ref{fig:dos}d,f. Since $L=3$ chains are planar, rocking motions are not part of this analysis. We have seen that rocking motions contribute mostly to the lower LJ-sea band and not so much to the high-frequency skeletal band which is our main focus here. In Figure~\ref{fig:dos}a,c,e we can see the VDOS for three different values of $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$ as determined from the simulation at $L=3$. Aside from the LJ-peak (which is not part of the analytical model), we can see that the VDOS follows closely the analytical prediction of the frequencies. In particular, the peak $\omega_1$ remains dominated by along-chain motions and also remains rather independent of $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ throughout. $\omega_2$ is initially at zero (meaning that it is a soft mode) but becomes stiffer and moves to the right as $\kappa_\mathrm{bend}/\kappa_\mathrm{LJ}$ is increased. Meanwhile, $\omega_3$ is initially slightly lower than $\omega_1$ but progressively increases also, eventually crossing over and becoming the higher of the three eigenvalues and at the same time becomes dominated by perpendicular motion. While the analytical model predicts delta peaks at eigenvalues $\omega_1$, $\omega_2$, $\omega_3$, in practice the peaks are broadened due to the distribution of rest angles, even for very high bending stiffness. At around $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}=0.3$ the two peaks $\omega_1$ and $\omega_3$ start to overlap and to merge into a single high peak. By looking at the evolution of eigenfrequencies and the associated motions for bending stiffness larger than$\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}=0.3$ we can also verify the interpretation that high frequency modes $\omega_3$ are dominated by perpendicular motions for high $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$, whereas the mode that only depends on the backbone interaction $\omega_1$ is dominated by along-chain motions independently of $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$. The mode $\omega_2$ has weights for along-chain and perpendicular motion which are the specular opposite to the $\omega_3$ case and hence presents a growing along-chain character upon increasing $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$. VDOS for additional values of $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}$ are shown in Figure~\ref{fig:dos_split}. We can clearly see the continuous shift of modes according to the analytical result given in Equation~\eqref{L3_eigenvalues}, reflected also in the motion pattern associated with those modes as shown in Figure~\ref{fig:dos}. \subsubsection{Dependence on bending stiffness for $L>3$} For longer chains we can see the same general features as for $L=3$, Figure~\ref{fig:dos_stiffness} and Figure~\ref{fig:dos_split}. Higher bending stiffness leads to redistribution of modes from the lower part of the FENE regime towards higher frequencies with an overlap happening at $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}\approx 0.3$, where they form a single peak. Above that value the bending interaction shifts modes associated with perpendicular motions towards higher frequencies, while the modes associated with along-chain motion stay relatively unchanged. The strong bending interaction also causes high frequency out-of-plane motions to appear, as discussed above. The gap between the LJ-sea and the FENE band is filled by modes in the same way as the third peak arises for $L=3$. We can relate the peak at $\omega = 60$ to $\omega_1$ from the $L=3$ model system by looking at a second toy model, the freely rotating chain with constant bond angle but no bending potential, as described in Appendix C, Equations~\eqref{eq:HessianChain}-\eqref{eq:motion_weights}. The VDOS is given by Equation~\eqref{roots_regular}, and is U-shaped spectrum with two divergent peaks at the van-Hove singularities (similar to the textbook example of completely straight linear chains with all angles at $180^{o}$). Since $\omega_1$ does not change with the bending stiffness it is natural that a remnant of this peak related to this frequency appears stationary for all bending stiffness. The lower peak, however, would correspond to $\omega_3$, which depends heavily on the bending stiffness and can therefore not be fully captured by a toy model without bending interaction. We further studied the so-called Boson peak, defined as the excess of low-frequency modes above the Debye $\sim \omega^{2}$ law, which is a paradigmatic and defining feature of glasses. In Figure~\ref{fig:dos_stiffness}b the VDOS normalized by the Debye law is shown, and it is evident that increasing the bending stiffness causes a significant decrease of the Boson peak. This is due to the fact that, since the VDOS is a normalized distribution, if vibration modes are shifted to high frequency due to the stiffening of skeletal vibrations involving bending, then necessarily the density of modes has to decrease in lower-frequency parts of the spectrum. From the point of view of mechanical response, a decrease of the Boson peak is linked with a decrease of the nonaffine component of elastic~\cite{lemaitre2006sum,zaccone2011approximate} and viscoelastic~\cite{rico2017viscoelastic} response which contributes negatively to the shear modulus. Hence, increasing the bending stiffness has a twofold effect on the elasticity: it increases the affine part of the shear modulus (which is a positive contribution to rigidity) by increasing the stiffness constant, and it decreases the Boson peak and therefore decreases (in absolute value) the nonaffine part of the shear modulus (which is a negative contribution to rigidity), as explained in previous work~\cite{lemaitre2006sum,zaccone2011approximate}. This, however, does not account for the structural effect brought about by increasing stiffness, which leads to volumetric expansion and, under certain conditions (as discussed by~\citet{ness2017nonmonotonic}) may lead to a decrease of shear modulus upon increasing bending stiffness, thus giving rise to a non-monotonic dependence of the shear modulus on chain stiffness. Clearly this mechanism by which the Boson peak is changed in polymer glasses, is very different from other mechanisms discussed in the literature for small-molecule or atomic glasses~\cite{mizuno2014acoustic,milkus2016local}. To summarize, we can separate the spectrum into four distinct parts:\\ i) the lowest-frequency band of LJ-sea which gets lowered as, with higher bending stiffness, more modes are shifted to higher frequencies;\\ ii) a stationary peak around $\omega = 60$ strongly associated with along-chain motion/vibration and with characteristic frequency $\omega_1$;\\ iii) modes associated with vibrations perpendicular to the chain axis, that resemble the behavior of $\omega_3$ and the frequencies of which diverge with the bending stiffness;\\ iv) modes associated with along-chain vibrations that resemble the behavior of $\omega_2$ filling the regime between the LJ-sea and the $\omega_1$-peak.\\ \begin{figure*} \includegraphics[width = 1\textwidth]{FIGURES/FIG9} \caption{Vibrational density of states for a range of parameters explored in this work. Shown are the overall result in black, as well as the decomposition into rocking (red), perpendicular (blue) and along-chain (green) motions as we defined in figure~\ref{fig:motions}. Given in the legend of each panel are the chain length and stiffness. Results for various system sizes are shown in the bottom left panel, demonstrating that the features discussed here are independent of $N_p$.}\label{fig:dos_split} \end{figure*} \subsubsection{Dependence on length $L$} By increasing the chain length we introduce more high-energy FENE bonds into the system, which leads to a shift or redistribution of modes from the low to the high frequency band, causing a lowering of the LJ peak (Figure~\ref{fig:dos_split}). This is particularly evident for fully flexible chains. Additionally, the number of possible polymer configurations increases drastically with chain length. In the VDOS this leads to a loss of distinct features (i.e. sharp peaks become broadened), especially in the high frequency band. The effect is best visible for fully flexible short chains of $L=3,4,5$, whereas the difference between $L=10$ and $L=50$ is only marginal. The total number of additional FENE bonds per chain $n$ decreases as the chains become longer $n/N = \frac{L - 1}{L} \,,\, \Delta n/N = \frac{1}{L (L + 1)}$ and therefore the change in total bond energy becomes smaller. As such, the averaged spectrum of sufficiently long ($L > 5$) chains already approximates the spectrum of an infinitely long chain quite well. A sample of chains with $L = 10$ consequently shows the same shape as for $L = 50$ (or even $L = 1000$). We thus limited our analysis to systems with those lengths, as there is no new physics to see in the spectrum of chains longer than $L = 50$. The distributions of motion patterns do not change much with the chain length, aside from the adjusting to the overall shape of the spectrum described above. An analytical derivation for fully flexible linear chains with $L=2,3,4,5$, with stretching interactions, is reported with full details in Appendix C. \section{Concluding remarks} We presented a systematic analysis and interpretation of the structure, internal stresses and vibrational spectra of glassy polymers from coarse-grained simulations, based on the Kremer-Grest bead-spring model with an energy minimum for angular bending interaction. Varying the angular stiffness and the chain length leads to rich phenomenology: an increase in both these parameters causes a build-up of internal stresses due to the competition between bending and stretching degrees of freedom, both of which want to minimize their energy at the same time. This leads to increased deviations from the minima of LJ and FENE interactions, an effect amplified for longer chains. For flexible chains with $\kappa_\mathrm{bend}/\kappa_\mathrm{FENE}<0.3$ there are two bands in the VDOS spectra, corresponding to LJ-dominated interactions at low frequency (the LJ-sea), and to skeletal modes dominated by FENE bonds at high frequency (the high-frequency skeletal band). For chains with higher bending stiffness this separation breaks down as modes associated with angular interactions appear, filling the gap between the two bands and creating additional high frequency modes. The latter of these are mostly made up from vibrations perpendicular to the chain, while the gap is filled by along-chain motions, creating a new separation between vibrational regimes in the spectrum. For short chains, the spectra feature sharp peaks whose behavior as a function of stiffness correspond very well with our analytical prediction. For longer chains this structure loses its sharp features and tends to a more continuous spectrum in which the various peaks are broadened by the averaging over many different chain conformations. This framework and concepts can be applied in future work to molecular and atomistic simulations of realistic materials~\cite{rutledge2016polyether,rutledge2015mechanics}, possibly in combination with Kernel Polynomial Methods~\cite{beltukov2016KPM} which can greatly speed up the evaluation of the VDOS using the Hessian as input. % We anticipate that the generic features of the VDOS predicted in this work will be robust to the introduction of more specific chemical interactions (including those that break the isotropic interaction symmetry), since the features of the vibrational spectrum are related essentially to the energy and the relative strength of interactions. For example, hydrogen bonds (which have typical energy (4-13kJ/mol) an order of magnitude less than covalent C-C bonds (346kJ/mol)) would be expected to add to the part of the spectrum that is already dominated by the LJ sea. The same can be stated about stacking interactions, which have typical energies of 8-12 kJ/mol. Finally, our results may open up the possibility of quantitatively linking the Raman and Brillouin spectra of glassy polymers with their viscoelastic response, since the VDOS is a key input to calculate viscoelastic moduli within recent developments in the nonaffine linear response of amorphous solids~\cite{rico2017viscoelastic,damart2017theory}. \section{Acknowledgements} We had useful discussions with Tim Sirk and Robert Elder. C.N. acknowledges the Maudslay-Butler Research Fellowship at Pembroke College, Cambridge for financial support. V.V.P. and A.Z. acknowledge financial support from the U.S. Army ITC-Atlantic and the U.S. Army Research Laboratory under cooperative Agreement No. W911NF-16-2-0091. The research leading to these results has also received funding from the European Research Council under the European Union's H2020 Grant Agreement no. 636820.
\section{Introduction} \label{sec_in} \setcounter{equation}{0} After inflation ends, the inflaton field rolls into the minimum of its potential and oscillates around it. During the oscillation the energy of the inflaton field transforms into some light particles and the Universe is reheated~\cite{EW}. However, the preliminary theory of reheating fails to reach a temperature high enough to produce baryon asymmetry in the grand unified theory (GUT) when the reheating ends~\cite{AD,LF}. It is worthy of noting that in addition to the GUT baryogenesis, there are some other mechanisms, such as electroweak baryogenesis and leptogenesis, which occur at much lower energy scales (see \cite{Dine} for recent review). Later, it was realized that at the first stage of reheating there exists an explosive particle production called preheating~\cite{JR,LAA,BSD}. In the simple chaotic inflation model~\cite{ADL} with the potential $m^2\phi^2/2$, the preheating requires a new scalar field $\chi$ which is coupled to the inflaton field $\phi$ through $g^2\phi^2\chi^2/2$~\cite{SI1,TT,LK}. The inflaton field rapidly decays to $\chi$-particle by the $g$-resonance. In the model with a self-coupling inflaton potential $\lambda\phi^4/4$, the fluctuation of the chaotic inflaton field was amplified by the parametric resonance and the inflaton field transforms into $\delta\phi$-particle \cite{SI2}. For the case of the $\lambda\phi^4/4+g^2\phi^2\chi^2/2$ potential , the above two processes exist simultaneously and the value of the parameter $g^2/\lambda$ affects the structure of the resonance~\cite{PB}. Although the usual chaotic inflation model with the power-law potentials seems to have been disfavored by the observations from the Planck satellite~\cite{Planck} , a natural generalization of it that assumes a coupling between the scalar field and the curvature is still consistent with the observations~\cite{Planck}. The preheating process in the non-minimally coupled inflation models in the metric formalism has been discussed in~\cite{SKT1, SKT2, DeCross}. When the inflaton potential is $m^2\phi^2/2$, it has been found that the non-minimal coupling enhances the $g$-resonance in certain parameter regimes~\cite{SKT1}. Once the potential is changed to $\lambda\phi^4/4$, the non-minimal coupling modifies the structure of resonance and promotes the particle creation for the strong coupling~\cite{SKT2}. Actually, the coupling between the kinetic term of the scalar field and the Einstein tensor is also allowed by observations~\cite{L, YTB}. However, because of the non-periodic oscillation of the inflaton field, there is no parametric resonance in this case~\cite{YY}. It is well known that, in addition to the metric formalism, there is another choice called the Palatini formalism, where the metric tensor and the connection are both independent variables. In the Einstein theory of gravity, two different formalisms give the same field equations. Once the gravitational theory is modified, these two formalisms yield different field equations and lead to different physical outcomes~\cite{TV,AS}. The inflation in the Palatini formalism has been investigated in~ \cite{FD2,BDD,NC}, and it has been found that scalar and tensor spectral indices and their ratio in different formalism show distinct results. In addition, in the usual metric formalism the non-minimally coupled Higgs inflation faces the problem of the unitarity violation, and the whole inflationary evolution is dependent on the unknown ultraviolet (UV) physics \cite{CHM,RJ,Be11, Atk11, JJ}. While, once the Palatini formalism is considered, the Higgs inflation with the non-minimal coupling is UV-safe and does not suffer from the problem which exists in the metric formalism~\cite{FD1}. Furthermore, Rasanen and Wahlman~\cite{Rasanen} found that the tensor-to-scalar ratio in the non-minimally coupled Higgs inflation can be consistently suppressed in the Palatini formalism compared to the one in the metric formalism. So, the non-minimally coupled scalar field inflation in the Palatini formalism has been shown to exhibit interesting different features, even some advantages. In this paper, we plan to carry out a further study on the inflationary dynamics with non-minimal couplings in both the Palatini and metric formalisms, and investigate the properties of the preheating in these formalisms, i.e., the similarities and differences. The remainder of this paper is organized as follows. Section \ref{sec_be} gives the basic field equations of the inflation model with non-minimal couplings. In Section \ref{sec_da}, we analyze the inflationary dynamics. We study the preheating process in Section \ref{sec_pr}. Finally, Section \ref{sec_co} presents the conclusions. Throughout this paper, unless specified, we adopt the metric signature ($-, +, +, +$). Latin indices run from 0 to 3 and the Einstein convention is assumed for repeated indices. \section{Basic equations} \label{sec_be} \setcounter{equation}{0} We consider an inflation model with a non-minimal coupling between the scalar field and gravity described by the action: \begin{equation}\label{1} S=\int d^4x \sqrt{-g}\biggl[\frac{1}{2\kappa^2}F(\phi)\hat R+\mathcal{L}_\phi(g_{\mu\nu},\phi)\biggl]\;, \end{equation} where $\kappa^2/8\pi\equiv M^{-2}_{PL}$ with $M_{PL}$ being the Planck mass, $g$ is the determinant of the metric tensor $g_{\mu\nu}$ and $\mathcal{L}_\phi$ is the Lagrangian of scalar field $\phi$, which has the form \begin{equation}\label{2} \mathcal{L}_\phi=-\frac{1}{2}\nabla_\mu\phi\nabla^\mu\phi-V(\phi)\;, \end{equation} with $ V(\phi)=\frac{1}{4}\lambda\phi^4$ being the self-interacting potential and $\lambda$ a constant. $\hat R$ is the curvature scalar, which, in the metric formalism, is determined only by the metric tensor $g_{\mu\nu}$. Hence, $\hat R=R(g_{\mu\nu})$. While, in the Palatini formalism, since the connection is also an independent variable, the curvature scalar $\hat R=\hat{R}(g_{\mu\nu},\hat{\Gamma}^\alpha_{\beta\gamma})$ is related to both the metric tensor $g_{\mu\nu}$ and the connection $\hat{\Gamma}^\alpha_{\beta\gamma}$. Appendix~\ref{app:gp} gives the basic equations of gravity in the Palatini formalism. In general, $F$ is an arbitrary function of $\phi$. In this paper, we consider the following special form: \begin{eqnarray}\label{3} F=1-\xi\kappa^2\phi^2\;. \end{eqnarray} where $\xi$ is the coupling constant, which is constrained to be $\xi\lesssim10^{-3}$~\cite{TK}. The tiny value of $\xi$ means an insignificant deviation from the minimal coupling if the coupling is positive. Thus, the negative coupling ($\xi \leq0$) will be considered in the following. Varying the action~(\ref{1}) with respect to the metric tensor gives the field equations (see Appendix~\ref{app:gp} for detail): \begin{align}\label{4} G_{\mu\nu}=&\kappa^2\biggl[\nabla_\mu\phi\nabla_\nu\phi-g_{\mu\nu}\Bigl(\frac{1}{2}\nabla_\mu\phi\nabla^\mu\phi+V(\phi)\Bigl)\biggl]+(1-F)R_{\mu\nu}+\nabla_\mu\nabla_\nu F\notag \\ &+\frac{1}{2}g_{\mu\nu}\biggl[(F-1)R-2\nabla_\sigma\nabla^\sigma F\biggl]+\sigma\biggl[\frac{3}{4F}g_{\mu\nu}\nabla_\sigma F\nabla^\sigma F-\frac{3}{2F}\nabla_\mu F \nabla_\nu F\biggl]\;, \end{align} where $G_{\mu\nu}$ is the Einstein tensor, and $\sigma=1$ and $0$ correspond to the Palatini formalism and the metric one, respectively. The inflaton field satisfies the modified Klein-Gordon equation \begin{equation}\label{5} \square\phi-\xi\hat{R}\phi-V_{,\phi}=0\;, \end{equation} where $\square$ is defined as $\square\equiv\nabla_\mu\nabla^\mu$ and $V_{,\phi}=dV/d\phi$. From Eq.~(\ref{A8}), one can see that the hatted curvature scalar $\hat R$ can be expressed as \begin{equation}\label{6} \hat{R}=R+\sigma\biggl[\frac{3}{2F^2}(\nabla_\mu F)(\nabla^\mu F)-\frac{3}{F}\nabla_\mu\nabla^\mu F\biggl]\;, \end{equation} or \begin{equation}\label{7} \frac{F}{\kappa^2}\hat{R}=\nabla_\mu\phi\nabla^\mu\phi+4V+\frac{3(1-\sigma)}{\kappa^2}\nabla_\sigma\nabla^\sigma F\;. \end{equation} by using Eqs.~(\ref{4}) and ~(\ref{6}) and $R=-g^{\mu\nu}G_{\mu\nu}$. To investigate the amplification of the fluctuations of the inflaton field by the parameter resonance in the metric and Palatini formalisms, we consider the spatially flat Friedmann-Robertson-Walker metric: \begin{equation}\label{8} ds^2=-dt^2+a^2(t)d\mathbf{x}^2\;, \end{equation} where $t$ is the cosmic time and $a(t)$ is the scale factor. Since the results have no significant difference whether the backreaction of metric perturbations is included~\cite{Zibin}, we only consider the perturbations of the scalar field. Thus, the inflaton field $\phi$ consists of the homogeneous and fluctuant parts: \begin{equation}\label{9} \phi(t,\mathbf{x})=\phi_0(t)+\delta\phi(t,\mathbf{x})\;. \end{equation} For the fluctuation, we impose the tadpole condition \begin{equation}\label{10} \langle\delta\phi(t,\mathbf{x})\rangle=0\;, \end{equation} where $\langle\cdot\cdot\cdot\rangle$ represents the expectation value, and make use of the Hartree factorization: \begin{align} (\delta\phi)^3&\rightarrow 3\langle(\delta\phi)^2\rangle(\delta\phi)\;,\\ (\delta\phi)^4&\rightarrow 6\langle(\delta\phi)^2\rangle(\delta\phi)^2-3\langle(\delta\phi)^2\rangle^2\;. \end{align} Then the Friedmann equation with the backreaction of the fluctuation is acquired via taking the mean field approximation in the $00$ component of Eq.~(\ref{4}): \begin{align}\label{13} H^2&=\frac{\kappa^2}{3(1-\alpha)}\biggl[\frac{1}{2}(\dot{\phi}_0^2+\langle\delta\dot{\phi}^2\rangle)+\bigg(\frac{1}{2}-2\xi \bigg )\langle\delta\phi^{\prime2}\rangle+\frac{1}{4}(\phi_0^4+6\phi_0^2\langle\delta \phi^2\rangle+3\langle\delta\phi^2\rangle^2)\nonumber\\ &+2\xi\{3H(\phi_0\dot\phi_0+\langle\delta\phi\delta\dot\phi\rangle)-\langle\delta\phi\delta\phi^{\prime\prime}\rangle\}-\frac{3\sigma\xi^2\kappa^2}{1-\alpha} \big (\phi_0^2\dot\phi_0^2+4\phi_0\dot\phi_0\langle \delta\phi\delta\dot\phi\rangle. \nonumber\\ &+\dot\phi_0^2\langle\delta\phi_0^2\rangle+\phi_0^2\langle\delta\dot\phi^2\rangle+\langle\delta\phi^2\delta\dot\phi^2\rangle+ \phi_0^2\langle\delta\phi^{\prime2}\rangle+\langle\delta\phi^2\delta\phi^{\prime2}\rangle \big )\biggl]\;, \end{align} where $\alpha\equiv\xi\kappa^2\langle\phi^2\rangle$, $H=\dot{a}/a$ is the Hubble parameter, and a dot and a prime denote the derivative with respect to the cosmic time and the space coordinate, respectively. Taking the mean field approximation of Eq.~(\ref{5}), we obtain that the inflation field and its perturbation obey \begin{equation}\label{15} \ddot\phi_0+3H\dot\phi_0+\lambda\phi_0(\phi_0^2+3\langle\delta\phi^2\rangle)+\xi \hat R \phi_0=0\;, \end{equation} \begin{equation}\label{16} \delta\ddot\phi+3H\delta\dot\phi-\partial_i\partial^i(\delta\phi)+\{3\lambda(\phi_0^2+\langle\delta\phi^2\rangle)+\xi \hat R\}\delta\phi=0\;, \end{equation} respectively, where the hatted curvature scalar $\hat R$ has the form \begin{align}\label{14} \hat R&=\frac{\kappa^2}{1-\alpha}\bigl[(-\dot\phi_0^2-\langle\delta\dot\phi^2\rangle+\langle\delta\phi^{\prime2}\rangle)+\lambda(\phi_0^4+6\phi_0^2\langle\delta\phi^2\rangle+3\langle\delta\phi^2\rangle) \nonumber\\& +(1-\sigma)\{-6\xi(-\dot\phi_0^2-\langle\delta\dot\phi\rangle+\langle\delta\phi^{\prime2}\rangle)+6\xi(\phi_0\ddot\phi_0+\langle\delta\phi\delta\ddot\phi\rangle\nonumber\\& -\langle\delta\phi\delta\phi^{\prime\prime}\rangle)+18\xi H(\phi_0\dot\phi_0+\langle\delta\phi\delta\dot\phi\rangle)\}\bigl]\;. \end{align} Since the fluctuant part of the inflation field can be expanded as \begin{equation}\label{17} \delta\phi=\frac{1}{(2\pi)^{3/2}}\int (a_k\delta\phi_k(t)e^{-i\mathbf{k}\cdot\mathbf{x}}+a_k^{\dagger}\delta\phi_k^{\ast}(t)e^{i\mathbf{k}\cdot\mathbf{x}})d^3\mathbf{k}\;, \end{equation} where $a_k$ and $a_k^\dagger$ are the annihilation and creation operators respectively and $k=|\mathbf{k}|$, from Eq.~(\ref{16}), we find that $\delta\phi_k$ satisfies the following equation of motion: \begin{equation}\label{18} \delta\ddot\phi_k+3H\delta\dot\phi_k+\biggl[\frac{k^2}{a^2}+3\lambda(\phi_0^2+\langle\delta\phi^2\rangle)+\xi \hat R\biggl]\delta\phi=0 \end{equation} with the expectation values of $\delta\phi^2$ taking the form \begin{equation}\label{} \langle\delta\phi^2\rangle=\frac{1}{2\pi^2}\int k^2|\delta\phi_k|^2dk\;. \end{equation} Introducing the conformal time $\eta\equiv\int a^{-1}dt$ and defining a new scalar field $\varphi_0\equiv a\phi_0$ and its perturbation $\delta\varphi \equiv a \delta\phi $, Eqs.~(\ref{15}) and~(\ref{18}) can be rewritten as \begin{equation}\label{21} \frac{d^2\varphi_0}{d\eta^2}+\lambda\varphi_0(\varphi_0^2+3\langle\delta\varphi^2\rangle)+(\xi \hat R a^2-\frac{1}{a}\frac{d^2a}{d\eta^2})\varphi_0=0\;, \end{equation} \begin{equation}\label{22} \frac{d^2}{d\eta^2}\delta\varphi_k+\omega_k^2\delta\varphi_k=0\;, \end{equation} with \begin{equation}\label{23} \omega_k^2\equiv k^2+3\lambda(\varphi^2_0+\langle\delta\varphi^2\rangle)+\xi \hat R a^2-\frac{1}{a}\frac{d^2a}{d\eta^2}\;. \end{equation} In the non-minimal coupling model, the $\xi \hat R a^2$ term affects not only the oscillation mode of the inflaton field but also the parametric resonance. Furthermore, the contributions of this term in the metric formalism are different from those in the Palatini formalism. We choose the conformal vacuum as the initial state and the following initial conditions of the fluctuation \begin{align} \delta\varphi_k(0)&=\frac{1}{\sqrt{2\omega_k(0)}}\;,\\ \delta\dot\varphi_k(0)&=-i\omega_k(0)\delta\varphi_k(0)\;. \end{align} Before investigating the preheating process, we will study the evolution of the scale factor in the inflationary period and analyze the dynamical behavior of the inflaton field. \section{The inflationary dynamics} \label{sec_da} In this Section, we investigate the dynamical property of the inflaton field with a non-minimal coupling. In the inflationary period, the fluctuation of the inflaton field can be neglected. Then, Eqs.~(\ref{13}) and~(\ref{15}) are simplified as \begin{equation}\label{26} H^2=\frac{\kappa^2}{3(1-\alpha_0)}\biggl[\frac{1}{2}\dot\phi_0^2+\frac{1}{4}\lambda\phi^4_0+6\xi H\phi_0\dot\phi_0-\frac{3\sigma\xi^2\kappa^2\phi_0^2\dot\phi_0^2}{1-\alpha_0}\biggl]\;, \end{equation} \begin{equation}\label{29} \ddot\phi_0+3H\dot\phi_0+\frac{\lambda\phi_0^3}{1-(1-(1-\sigma)6\xi)\alpha_0}-\frac{\xi\kappa^2(1-(1-\sigma)6\xi)\phi_0\dot\phi_0^2}{1-(1-(1-\sigma)6\xi)\alpha_0}=0\;, \end{equation} where $\alpha_0=\xi\kappa^2\phi_0^2$ and Eq.~(\ref{14}) has been used in obtaining Eq.~(\ref{29}). To obtain the inflation, one needs to define the slow-roll conditions: $|\ddot\phi_0/\dot\phi_0| \ll H$, $|\dot\phi_0/\phi_0| \ll H$ and $\dot\phi_0^2\ll V$. Meanwhile, to see the effect of the non-minimal coupling, we take the strong negative coupling limit $\alpha_0\ll-1$. Thus, in the inflationary era, Eqs.~(\ref{26}) and (\ref{29}) reduce to \begin{equation}\label{30} H^2\simeq-\frac{\kappa^2\lambda\phi_0^4}{12\alpha_0}\;, \end{equation} \begin{equation}\label{31} 3H\dot\phi_0\simeq\frac{\lambda\phi_0^3}{(1-(1-\sigma)6\xi)\alpha_0}\;. \end{equation} Using Eqs. (\ref{30}) and (\ref{31}), we obtain the expression of the e-fold number: \begin{align}\label{32} N&\equiv\int_{t_I}^{t_F}Hdt=\int_{\phi_0(t_I)}^{\phi_0(t_F)}\frac{H}{\dot\phi_0}d\phi_0=-\int_{\phi_0(t_I)}^{\phi_0(t_F)}\frac{(1-(1-\sigma)6\xi)\kappa^2}{4}\phi_0d\phi_0\nonumber\\ &=\frac{(1-(1-\sigma)6\xi)\kappa^2}{8}[ \phi_0(t_I)^2-\phi_0(t_F)^2], \end{align} where the subscript $I$ and $F$ denote the values when the inflation starts and ends, respectively. Considering $\phi_0(t_F)\ll\phi_0(t_I)$, we arrive at the initial value of $\phi_0$ field \begin{equation}\label{33} \phi_0(t_I)^2=\frac{8N}{(1-(1-\sigma)6\xi)\kappa^2}. \end{equation} In addition, combining Eqs. (\ref{30}) and (\ref{31}), we find the following relation: \begin{equation}\label{34} \dot\alpha_0=-\frac{8\xi}{1-(1-\sigma)6\xi} H\;, \end{equation} which is easily integrated to give \begin{equation}\label{35} \alpha_0=\alpha_{0I}-\frac{8\xi}{1-(1-\sigma)6\xi}\ln\left(\frac{a}{a_I}\right)\;. \end{equation} From Eq. (\ref{30}), it follows that the scale factor satisfies the differential equation: \begin{equation}\label{36} \frac{\dot a}{a}=\sqrt{\frac{-\lambda\alpha_{0I}}{12\xi^2\kappa^2}}\biggl[1-\frac{8\xi}{(1-(1-\sigma)6\xi)\alpha_{0I}}\ln\left({\frac{a}{a_I}}\right)\biggl]^{1/2}\;. \end{equation} Integrating the above equation gives \begin{equation}\label{37} a=a_I \exp[H_I t-\gamma(H_I t)^2]\;, \end{equation} where \begin{equation}\label{38} H_I\equiv \sqrt{\frac{-\lambda\alpha_{0I}}{12\xi^2\kappa^2}}=\sqrt{\frac{-2\lambda N}{3(1-(1-\sigma)6\xi)\xi\kappa^2}}\;,\qquad\gamma\equiv\frac{2\xi}{(1-(1-\sigma)6\xi)\alpha_{0I}}=\frac{1}{4N}\;. \end{equation} Apparently $\gamma$ is a small quantity since $N\gtrsim60$. At the beginning of inflation, the Universe evolves exponentially since the $\gamma$ term is negligible. However, as time goes on, this $\gamma$ term becomes significant and the expansion rate of the universe slows down. The value of $\gamma$ is the same in different formalisms, but the value of $H_I$ in the Palatini formalism is about $\sqrt{-6\xi}$ times of that in the metric formalism, which means that in the strong coupling case the deceleration effect caused by the $\gamma$ term will be greater in the Palatini formalism than in the metric formalism. \begin{table} \caption{\label{Tab1}The values of $\phi_0$ when the inflation ends in the metric and Palatini formalisms for different $\xi$. } \begin{center} \begin{tabular}{c|cc} \hline \hline &$\qquad\qquad\qquad\qquad\qquad\phi_0(t_F)/M_{PL}$\\ \hline $\xi$$\qquad$ &Palatini $\qquad$& $\qquad$Metric$\qquad$\\ \hline 0$\qquad$ & 0.5642 $\qquad$ & $\qquad$ 0.5642$\qquad$\\ -0.1$\qquad$ & 0.4569 $\qquad$ & $\qquad$ 0.4281$\qquad$\\ -1$\qquad$ & 0.3072 $\qquad$ & $\qquad$ 0.1995$\qquad$\\ -10$\qquad$ & 0.1835 $\qquad$ & $\qquad$ 0.0673$\qquad$\\ -50$\qquad$ & 0.1246 $\qquad$ & $\qquad$ 0.0303$\qquad$\\ -200$\qquad$ & 0.0887 $\qquad$ & $\qquad$ 0.0152$\qquad$\\ -1000$\qquad$ & 0.0595 $\qquad$ & $\qquad$ 0.0068$\qquad$\\ \hline \hline \end{tabular} \end{center} \end{table} Now we want to determine the value of $\phi_0(t_F)$, which corresponds to the initial value of reheating. For convenience, we change to the Einstein frame. The detailed calculation can be found in Appendix \ref{app:ae}. In the Einstein frame one can define the slow-roll parameter by using the potential $\bar V(\psi)$ given in Eq.~(\ref{B3})\begin{equation}\label{39} \epsilon=\frac{1}{\kappa^2}\biggl(\frac{\bar d V(\psi)/d\psi}{\bar V(\psi)}\biggl)^2\;. \end{equation} When $\epsilon$ increases to unity, the inflation ends. Using Eqs.~(\ref{B3})-(\ref{B5}), the slow-roll parameter can be rewritten as \begin{equation}\label{40} \epsilon=\frac{8}{\kappa^2\phi_0^2[1-(1-(1-\sigma)6\xi)\xi\kappa^2\phi_0^2]}\;. \end{equation} Setting $\epsilon=1$, we obtain the value of the scalar field $\phi_0$ at the end of the inflation: \begin{equation}\label{41} \phi_0(t_F)=\biggl[\frac{\sqrt{1-32\xi+(1-\sigma)192\xi^2 }-1}{16\pi(1-(1-\sigma)6\xi)|\xi|}\biggl]^{1/2}M_{PL}\;. \end{equation} Tab.~\ref{Tab1} shows the values of $\phi_0(t_F)$ with different values of $\xi$ in the metric and Palatini formalisms. With the increase of $|\xi|$, $\phi_0(t_F)$ decreases in both formalisms. But for the same value of the coupling parameter, $\phi_0(t_F)$ in the Palatini formalism is always larger than that in the metric one, which becomes more and more obvious with the increase of $|\xi|$. In order to show clearly the characteristics of the non-minimally coupled inflation, we turn to the dynamics which is governed by Eqs.~(\ref{26}, \ref{29}). A general result for an inflationary attractor is very hard to obtain. But, in the strong coupling limit: $\xi\ll-1$, Eqs. (\ref{30}) and (\ref{31}) give rise to the inflationary attractors of the form \begin{align}\label{48} \dot\phi_0\simeq\left\{\begin{array}{lcl} -\frac{1}{\kappa^2(1-(1-\sigma)6\xi)}\sqrt{\frac{4\lambda}{-3\xi}}\;,\quad(\phi_0>0)\\ +\frac{1}{\kappa^2(1-(1-\sigma)6\xi)}\sqrt{\frac{4\lambda}{-3\xi}}\;,\quad(\phi_0<0)\end{array}\right.\;. \end{align} \begin{figure}[!htb] \centering \subfigure[$\sigma=1$ (Palatini)]{ \includegraphics[width=0.47\textwidth ]{Fig1a1.eps}} \subfigure[$\sigma=0$ (Metric)]{ \includegraphics[width=0.49\textwidth ]{Fig1b1.eps}} \caption{\label{Fig1} The phase portrait in the $\phi_0-\dot\phi_0$ plane with $\xi=-100$, $\lambda=1$ and $M_{PL}=1$. The red lines describe the inflationary attractors given in Eq. (\ref{48}).} \end{figure} Fig. \ref{Fig1} shows the evolutionary curves in the $\phi_0-\dot{\phi}_0$ plane with different initial conditions. The left and right panels denote the Palatini and metric formalisms, respectively. The red lines represent the inflationary attractors. It is easy to see that regardless of the initial conditions the Universe dominated by a non-minimally coupled scalar field will evolve into an inflation and then go into an oscillating era, which represents the reheating phase. Comparing the left and right panels shows the apparent differences between the metric and the Palatini formalisms. One can find that the evolution of the inflaton field in the Palatini formalism deviates from the slow-roll line with a value of $\phi_0$ much larger than that in the metric formalism. This is because the former has a value of $H_I$ as given in Eq.~(\ref{38}) larger than the latter. After the inflation, the inflaton field rolls down along the potential with the increasing velocity in the metric formalism but the velocity is decreasing in the Palatini formalism. After the inflaton field rolls through the point of $\phi_0=0$, the value of $\dot\phi$ increases in the Palatini formalism, while it decreases in the metric formalism. When the scalar field evolves through its minimum and maximum, the change of the velocity of the inflaton field in the metric formalism is more violent than that in the Palatini formalism. Therefore, the oscillation of the inflaton filed in different formalisms shows distinctive features, which leads to a different preheating process as will be studied in the next section. \section{Preheating} \label{sec_pr} From the above section, one can see that after the inflation the scalar field evolves into an oscillating era, in which the energy of the scalar field transforms into some light particles and our Universe is reheated. The first stage of reheating is called preheating, which corresponds to the generation of particles due to the parameter resonance. Setting $t_i$ to be the beginning time of preheating, one can assume reasonably $t_i=t_F$ with $t_F$ being the finishing time of inflation, so that the value of the scalar field at the beginning of preheating is $\phi_0(t_i)=\phi_0(t_F)$, where $\phi_0(t_F)$ is given in Eq.~(\ref{41}). After introducing a dimensionless time variable $x\equiv\sqrt{\lambda}M_{PL}\eta$ and defining $f\equiv\varphi_0/M_{PL}=a\phi_0/M_{PL}$, $\langle\delta\bar\phi^2\rangle\equiv\langle\delta\phi^2\rangle/M_{PL}^2$ and $\langle\delta\bar\varphi^2\rangle\equiv a^2\langle\delta\bar\phi^2\rangle$, Eqs.~(\ref{21}) and (\ref{22}) can be re-expressed as \begin{equation}\label{50} \frac{d^2f}{dx^2}+f^3\left(1+3\frac{\langle\delta\bar\varphi^2\rangle}{f^2}\right)+\left(\xi a^2 \mathcal{\hat R}-\frac{1}{a}\frac{d^2a}{dx^2}\right)f=0\;, \end{equation} \begin{equation}\label{51} \frac{d^2}{dx^2}\delta\varphi_k+\biggl[p^2+3f^2\bigg(1+\frac{\langle\delta\bar\varphi^2\rangle}{f^2}\bigg)+\bigg(\xi a^2\mathcal{\hat R}-\frac{1}{a}\frac{d^2a}{dx^2}\bigg)\biggl]\delta\varphi_k=0\;, \end{equation} where $p^2\equiv k^2/(\lambda M_{PL}^2)$, and $\mathcal{\hat R}\equiv \hat R/(\lambda M_{PL}^2)$, which has the form \begin{equation}\label{52} \mathcal{\hat R}\approx\frac{8\pi (1-(1-\sigma)6\xi)( \bar\phi_0^4-a^{-2}(d\bar\phi_0/dx)^2)}{1-(1-(1-\sigma)6\xi)\alpha} \end{equation} at the stage before the inflaton quanta grow significantly. Here $\bar\phi_0\equiv\phi_0/M_{PL}$ and Eqs.~(\ref{29}) has been used. In order to analyze the effect of the non-minimal coupling on the growth of inflaton quanta, we introduce two frequencies, according to Eq.~(\ref{51}), \begin{eqnarray} \omega_1\equiv3f^2(1+\langle\delta\bar\varphi^2\rangle/f^2), \qquad \omega_2\equiv \xi a^2\mathcal{\hat R}-\frac{1}{a}\frac{d^2a}{dx^2} \;. \end{eqnarray} For the case of a very weak coupling, i.e. $-0.1\lesssim\xi<0$, the effect of the non-minimal coupling is negligible. The evolutions of $\omega_1$ and $\omega_2$ in both formalisms are almost the same as what were obtained in the minimally coupled case~\cite{PB,SKT2}. When the coupling becomes very strong, i.e. $\xi\lesssim-100$, we can take the limit of strong coupling. Assuming that at the initial stage of preheating the amplitude of the oscillating scalar field is not very small, we have $\xi \gg \xi \alpha \gg 1$, which means that Eq.~(\ref{52}) can be simplified to be \begin{eqnarray} \mathcal{R}\simeq \frac{8\pi}{\alpha}\big(a^{-2}(d \bar{\phi}_0/dx)^2- \bar{\phi}_0^4 \big) \end{eqnarray} in the metric formalism and \begin{eqnarray} \mathcal{\hat{R}}\simeq \frac{8\pi}{1-\alpha}\big(\bar{\phi}_0^4-a^{-2}(d \bar{\phi}_0/dx)^2\big)\simeq - {\alpha} \mathcal{R} \end{eqnarray} in the Palatini formalism. Then, using Eq.~(\ref{52}) one can obtain \begin{eqnarray} \omega_2=\bigg(\xi-\frac{1}{6} \bigg) a^2 \mathcal{ R} \simeq \xi a^2 \mathcal{ R} \end{eqnarray} in the metric formalism and \begin{eqnarray} \omega_2=\xi a^2 \mathcal{\hat{R}}-\frac{1}{6} a^2 \mathcal{R} \simeq -\xi \alpha a^2 \mathcal{ R} \end{eqnarray} in the Palatini formalism. Thus, in the metric formalism the perturbation term $\frac{1}{a}\frac{d^2a}{dx^2}$ is magnified $6|\xi|$ times, suggesting that the decrease of $\omega_2$ is lower than $\omega_1$ with the increase of $|\xi|$. In the Palatini formalism, the $\xi a^2 \mathcal{\hat R}$ term is also amplified with the increase of $|\xi|$ but it is much less than that in the metric formalism. \begin{table} \caption{\label{Tab2}The maximal values $\langle \delta \bar \phi^2\rangle_f$, the oscillation amplitude of the inflaton field $\tilde{\phi}_0(x_f)$, and the ratio of them ($\langle \delta \bar\phi^2\rangle_f/ \tilde{\phi}^2_0(x_f)$) in the metric and Palatini formalisms for different $\xi$. } \begin{center} \begin{tabular}{c|cc|cc|cc} \hline \hline &$\qquad \langle \delta \bar \phi^2\rangle_f/M^2_{PL}$& &$\qquad \tilde{\phi}_0(x_f)/M_{PL}$ & &$ \qquad \langle \delta \bar\phi^2\rangle_f/ \tilde{\phi}^2_0(x_f) $\\ \hline $\xi$ &Palatini & Metric & Palatini & Metric & Palatini & Metric \\ \hline 0 & $1.460\times10^{-7}$ & $1.460\times10^{-7}$ & $1.35\times10^{-3}$ & $1.35\times10^{-3}$ & 0.08 &0.08\\ -1 & $1.454\times10^{-7}$ & $1.451\times10^{-7}$ & $1.30\times10^{-3}$ & $1.25\times10^{-3}$ & 0.09 &0.09\\ -50 & $1.403\times10^{-7}$ & $7.642\times10^{-8}$ & $1.04\times10^{-3}$ & $3.67\times10^{-4}$ &0.13 & 0.56\\ -200 &$1.414\times10^{-7}$ & $1.709\times10^{-6}$ & $8.56\times10^{-4}$ & $9.50\times10^{-4}$ & 0.19 &1.88\\ \hline \hline \end{tabular} \end{center} \end{table} \begin{figure}[!htb] \centering \subfigure[ Palatini]{ \includegraphics[width=0.45\textwidth ]{Fig2a.eps}} \subfigure[ Metric]{ \includegraphics[width=0.45\textwidth ]{Fig2b.eps}} \caption{\label{Fig2} The evolution of $\omega_1$ and $\omega_2$ as a function of $x$ in the case of $\xi=-1$. For a comparison, the evolution in the minimally coupled case is shown with the black curves in the left panel.} \end{figure} \begin{figure} \subfigure[ Palatini]{ \includegraphics[width=0.45\textwidth]{Fig3a.eps} } \subfigure[ Metric]{ \includegraphics[width=0.45\textwidth]{Fig3b.eps} } \caption{\label{Fig3} The evolution of $\omega_1$ and $\omega_2$ as a function of $x$ in the case of $\xi=-50$. } \end{figure} \begin{figure} \subfigure[Palatini]{ \includegraphics[width=0.45\textwidth]{Fig4a.eps}} \subfigure[Metric]{ \includegraphics[width=0.45\textwidth]{Fig4b.eps}} \caption{\label{Fig4} The evolution of $\omega_1$ and $\omega_2$ as a function of $x$ in the case of $\xi=-200$. } \end{figure} \begin{figure} \begin{minipage}[f]{0.5\textwidth} \includegraphics[width=1\textwidth]{Fig5.eps} \end{minipage} \caption{\label{Fig5} The spectrum of enhanced momentum modes in $\xi=0$, $\xi=-1$, $\xi=-50$ and $\xi=-200$ cases. M and P represent the metric and Palatini formalisms, respectively. } \end{figure} In Figs.~\ref{Fig2}, \ref{Fig3}, and \ref{Fig4}, the evolutions of $\omega_1$ and $\omega_2$ with $x$ are plotted with three different values of $\xi$: $\xi=-1$, $-50$ and $-200$. We find that the oscillating period of the scalar field increases with the increase of $|\xi|$, and for a given $\xi$ , it is shorter in the Palatini formalism than in the metric formalism, which is a result of the fact, as is shown in Tab.~(\ref{Tab1}), that the values of $\phi_0(t_i)$ at the beginning of the preheating decrease with the increasing of $|\xi|$ and this decrease is faster in metric formalism than in the Palatini one. Furthermore, one can see that in the Palatini formalism the amplitude of $\omega_1$ is always larger than that of $\omega_2$ although the decrease of $\omega_2$ is slightly lower than that of $\omega_1$ with the increase of $|\xi|$. While in the metric formalism with the increase of $|\xi|$ the amplitude of $\omega_2$ will become larger than that of $\omega_1$ at the initial stage of preheating since the significant magnification on $\omega_2$ arises from the non-minimal coupling, and the domination duration of the $\omega_2$ term becomes longer with a larger $|\xi|$. Thus, the structure of resonances is similar to the $\xi=0$ case in the Palatini formalism. However, the structure changes with the increase of $|\xi|$ in the metric formalism . To show the changes of the structure of resonance for different values of $\xi$, we plot Fig.~\ref{Fig5} to give the resonance bands. With the increase of $|\xi|$, the resonance band in both formalisms moves towards $k=0$ and it moves faster in the metric formalism. In the Palatini formalism, the resonance band is always narrow. However, in the metric formalism, the resonance band becomes broad for a large $\xi$, and two effective resonance bands appear when $\xi=-50$. For the strong coupling, i.e. $\xi\lesssim-100$, the enhanced momentum modes in the metric formalism are mainly low momentum modes. \begin{figure}[!htb] \centering \includegraphics[width=0.45\textwidth ]{Fig6a.eps} \includegraphics[width=0.45\textwidth ]{Fig6b.eps} \caption{\label{Fig6} The evolution of $\langle\delta\bar\phi^2\rangle$ as a function of $x$ with $\xi=0$ and $\xi=-1$ (left), and $\xi=-50$ and $\xi=-200$ (right). } \end{figure} The evolutions of $\langle\delta \bar \phi^2\rangle$ with $\lambda=10^{-12}$ given by the COBE data are shown in Fig.~\ref{Fig6}. Apparently, the inflaton quanta do not grow forever and the growth will be terminated due to the backreaction, signaling the end of the parameter resonance. We find that in the Palatini formalism, with the increase of $|\xi|$ the growth of the fluctuation is delayed and the duration of parameter resonance era increases. The final values of the fluctuation ($\langle\delta \bar \phi^2\rangle_f$) are almost the same as that in the $\xi=0$ case, which can also be seen from Tab.~(\ref{Tab2}). For the metric formalism, since $\omega_2$ will play a dominating role during the whole preheating with the increase of $|\xi|$, the duration of the parameter resonance era does not increase forever with the increase of $|\xi|$ and the numerical calculation shows that it has a maximum at about $\xi\simeq -70$, if $-250<\xi<0$. In addition, one can see that several short plateau appear in the evolution of $\langle\delta\phi^2\rangle$ when $\xi=-50$, which arises from two effective resonance bands. Tab.~(\ref{Tab2}) and Fig.~\ref{Fig6} show that the variation of $\langle\delta \bar \phi^2\rangle_f$ is dramatical in the metric formalism, which is different from that in the Palatini one. In order to reveal the characteristics of $\langle\delta\bar \phi^2\rangle_f$ with the increase of $|\xi|$, we plot $\langle\delta\bar\phi^2\rangle_f$ as a function of $|\xi|$ in Fig.~\ref{Fig7}. We find that in the Palatini formalism the final value of $\langle\delta \bar\phi^2\rangle$ is almost a constant within $-1000\lesssim\xi<0$. While in the metric formalism $\langle\delta\bar \phi^2\rangle_f$ decreases firstly with the increase of $|\xi|$, and then reaches a minimum when $\xi$ is about $-70$. After that, $\langle\delta\bar \phi^2\rangle_f$ increases fast until it reaches its maximum at about $\xi=-120$, and then decreases slowly. \begin{figure} \begin{minipage}[e]{0.5\textwidth} \includegraphics[width=1\textwidth]{Fig7.eps} \end{minipage} \caption{\label{Fig7} The final value of $\langle\delta\bar\phi^2\rangle$ as a function of $\xi$. } \end{figure} Tab.~(\ref{Tab2}) indicates that in the Palatini formalism the oscillation amplitude $\tilde{\phi}_0$ of the inflaton field at the termination time $x_f$ of the parameter resonance decreases slowly, while in the metric formalism $\tilde{\phi}_0(x_f)$ does not vary monotonously. Even so, in both formalisms $\langle\delta\bar \phi^2\rangle_f/\tilde{\phi}^2_0(x_f)$ increases with the increase of $|\xi|$ and it increases faster in the metric formalism. This indicates that the energy transfer from the inflaton field to $\delta \phi_k$ becomes more efficient with the increase of $|\xi|$ and the efficiency in the Palatini formalism does not increase as fast as that in the metric one. \section{Conclusion} \label{sec_co} In this paper, we have studied the dynamics and preheating in a model with a non-minimally coupled inflaton field in the metric and Palatini formalisms. We find that irrespective of the initial conditions our Universe will evolve into a slow-roll inflationary era in both formalisms. However, the evolution of the scalar field in the Palatini formalism deviates from the slow-roll line with a value of $\phi_0$ much larger than that in the metric formalism. For the same the coupling parameter, the value of the scalar field at the end of inflation in the Palatini formalism is always larger than that in the metric one, which becomes more and more obvious with the increase of $|\xi|$. After inflation, the scalar field rolls into an oscillating phase. But, the oscillations in different formalisms show distinctive features. During the preheating, we find that the inflaton quanta are produced explosively due to the parameter resonance and the growth of inflaton quanta will be terminated by the backreaction. In the case of a weak coupling, the resonance bands are narrow in both formalisms. With the increase of $|\xi|$ the resonance bands gradually close to the zero momentum ($k=0$), and the structure of resonance changes and becomes broader and broader in the metric formalism, while, it remains to be narrow in the Palatini formalism. Owing to this effect, when $-1000\lesssim\xi<0$, the final value of $\langle\delta \bar \phi^2\rangle$ in the Palatini formalism does not vary significantly, and is almost the same as that in the $\xi=0$ case. However, in the metric formalism, when $-70\lesssim\xi<0$, the final value of the fluctuation is less than that in the Palatini formalism and reaches a minimum when $\xi$ is about $-70$. Then, $\langle\delta \bar \phi^2\rangle_f$ increases fast and becomes larger than that in the Palatini formalism. It reaches its maximum at about $\xi=-120$, and then decreases slowly. In addition, we find that the transfer of the energy from the $\phi_0$ field to the fluctuation is more and more efficient with the increase of $|\xi|$, and in the metric formalism the growth of the efficiency of energy transfer is much faster than that in the Palatini formalism. In conclusion, although our Universe dominated by a non-minimally coupled scalar field with a self-interacting potential is sure to evolve into an inflation era and then roll into a preheating phase in both formalisms, the inflation and preheating processes show different characteristics in different formalisms. It is well known that preheating typically results in inhomogeneous configurations of the scalar field and then leads to the production of a stochastic background of gravitational waves~\cite{Kh}, which depends on the resonance structure. So, we expect that the differences of the non-minimally coupled inflation in different formalisms may imprint on the gravitational waves generated during preheating. We would be in principle able of differentiating the two different formalisms if such a stochastic background of gravitational waves could be detected by future high-frequency gravitational wave detectors. The generation of gravitational waves during preheating in the two formalisms is an interesting topic which is currently under our investigation. \begin{acknowledgments} This work was supported by the National Natural Science Foundation of China under Grants No. 11775077, No. 11435006, No.11690034, and No. 11375092. \end{acknowledgments}
\section{Introduction} \label{sec:intro} The evolution of interstellar medium (ISM) in galactic disks is intimately related to star formation and galaxy evolution. In external face-on galaxies, compared to Milky Way (MW), it is easier to investigate ISM conditions and their evolution while rotating in the disk. Recent observations have reported that ISM conditions depend on associated galactic structures, such as spiral arms and bars. For example, massive clouds tend to reside in spiral arms \citep{Koda09,Colo14a}, suggesting that spiral arms play an important role to form massive clouds that are plausible precursors of massive star clusters. Line ratios have also been found to be different among disk structures \citep[e.g.][]{Koda12b,Tosa17}, representing different physical conditions. High resolution observations revealed ISM evolution within spiral arms \citep{Egu11,Hiro11}, clouds at the downstream side of spiral arms being more massive and star-forming. In bar regions, molecular gas is concentrated in ridges and bar edges \citep[e.g.][]{Sheth02} but star formation efficiency is relatively low especially in ridges \citep[e.g.][]{Momo10,Sor12,Pan17}. Recent numerical calculations have also suggested that ISM conditions depend on dynamical environments \edit1{\citep[e.g.][]{FujiY14,Ngu17}.} Many of studies mentioned above defined clouds using cloud identifying algorithms. One caveat of such algorithms is that they tend to identify structures whose size is similar to an angular resolution. As a result, a dynamic range of cloud size is rather small. In addition, recent numerical simulations suggest that molecular clouds are not isolated and discrete structures but are part of continuous fluid \citep[e.g.][]{Dob13}. For example, \citet{Colo14a} identified $>1500$ clouds in the nearby spiral galaxy M51 from a CO(1--0) data set at 40 pc resolution and most of the clouds have a radius between 20 pc and 100 pc (i.e.\ the dynamic range is $\sim 1$ dex, their Figure 8). They also calculated the mass in the clouds to be about half of the total mass. The cloud analysis cannot take into account such gas outside identified clouds whose mass can be comparable to that inside the clouds. Another and complementary way of measuring ISM properties is to use a probability distribution function (PDF), which is a normalized histogram of a physical parameter or an observed quantity. Advantages of PDF analysis are that it is free of any biases due to cloud identification and that it includes ISM components which would not be included in identified clouds. For Milky Way (MW) molecular clouds, the PDF of gas column density has been used to investigate their star-forming conditions. \citet{Kai09} created gas column density PDFs based on NIR extinction maps and found that those for star-forming clouds show a power-law (PL) like tail while those for quiescent clouds show a log-normal (LN) profile. Such different PDF profiles have been interpreted as different ISM conditions -- LN for turbulence-dominated clouds \citep[e.g.][]{NP99} and PL for self-gravity-dominated clouds \citep[e.g.][]{Kri11,Giri14} or clouds with high density contrast \citep{Elm11a}. \citet{Brunt15} claimed that the tail can be explained as a part of a wide LN profile which corresponds to a cold gas component. Brightness distribution function (BDF) introduced by \citet{Sawa12a} is a PDF of CO brightness temperature. Together with their following study \citep{Sawa12b}, they found that BDFs for spiral arms in MW tend to show a bright-end tail compared to interarm regions. Meanwhile, \citet{Rath14} presented that a cloud close to the MW center shows a PDF peaking at a higher density compared to clouds in the solar neighborhood. The PDF peak corresponds to a mean density and the authors attributed this difference to high-pressure environments around the MW center. For external galaxies, \citet{Hugh13a} created PDFs for galactic structures of M51 from CO(1--0) data at $\sim 40$ pc scale and found different PDF shapes among the structures. The difference is more clearly seen in PDFs of the integrated CO intensity in the sense that center and arm PDFs are wider and deviate from LN profiles while interarm PDFs are narrower and close to LN profiles. Interestingly, PDFs for the center and arm where star formation is relatively active appear to be truncated rather than extended. They interpreted this truncation as a feedback effect. They also claimed that the narrow LN profiles in the interarm are a sign of turbulence dominated ISM. \citet{Dru14} created a PDF at $\sim 50$ pc scale for M33 based on CO(2--1) integrated intensity and found that its shape positively deviates from the LN profile at $N({\rm H_2}) > 2 \times 10^{21}~{\rm H_2/cm^2}$. They attributed this bright-end excess to self-gravity, although the threshold column density is low (comparable to the nominal 3$\sigma$ limit of M51 data by \citet{Hugh13a}). We should note here that spatial resolutions of these studies are much larger than those of MW studies. Thus, a direct comparison of MW and these studies is not straightforward. \citet{Hugh13a} also investigated how data quality (i.e.\ resolution and sensitivity) and technique to create integrated intensity maps affect PDF shapes. Their results suggest that the high spatial resolution is important to investigate bright-end profiles. The importance of spatial resolution is also pointed out by numerical simulations in \citet{Wada07}. Consistently, \citet{Ber15} found that PDFs of gas surface densities for M31 and M51 at $\sim 300$ pc scale are well fitted by LN profiles. \citet{Oss16} investigated how observing conditions affect PDF shapes. In particular, they presented that interferometric observations should distort overall PDF shapes, i.e.\ their faint-end profile, peak position, and bright-end profile. To minimize the distortion, a dense uv sampling especially at low spatial frequencies is necessary. Given this dependency, we compare PDF profiles only within a galaxy and do not directly compare the results with other galaxies. In this paper, we present CO PDFs for the nearby \citep[$D=4.5$ Mpc;][]{Thim03} face-on \citep[inclination angle = $24^\circ$;][]{Com81} barred spiral \citep[SAB(s)c;][]{RC3} galaxy M83 (or NGC 5236). Its proximity and disk orientation are well suited to study ISM properties and their relationship to disk structures. We find that PDFs differ significantly among the galactic structures and discuss the origin of this difference. Stellar feedback effects on PDF profiles are also investigated. This is a complementary study to Hirota et al.\ (\edit1{submitted}, hereafter paper I), which investigates cloud properties based on the same data set. \section{Observations and data reduction} The rotational transitions of CO are the most widely used tracers of molecular gas, and their integrated intensities have been used to estimate the column density of molecular hydrogen \citep[e.g.][]{YS91,Bola13b}. We have mapped a central disk area of M83 in the $^{12}$CO(1--0) emission using Atacama Large Millimeter/submillimeter Array (ALMA) and the Nobeyama 45m telescope (NRO45m). A detail of observations and data reduction will be in paper I, and we provide a summary here. \subsection{ALMA observations} The data have been obtained for the Cycle 0 project 2011.0.00772.S, and consist of two Execution Blocks (EBs) with a compact configuration and three EBs with an extended configuration. The field of view (FoV) is about $2.6' \times 2.6'$ with 45 mosaic pointings, which includes the galactic center, a northern part of the bar, and a spiral arm. \subsection{Nobeyama 45m observations} The NRO45m observations were carried out using the on-the-fly mode with the T100 receiver and SAM45 spectrometers. The entire FoV includes the ALMA FoV. \edit1{ \subsection{Data combination}\label{sec:combine} } In order to combine the ALMA and NRO45m data, the NRO45m map is first converted to a uv data set. Then, the two uv data sets from ALMA and NRO45m are Fourier-transformed and deconvolved together. The synthesized beam is $2.0''\times 1.1''$ in full width at half maximum. At the distance of M83, this corresponds to 45 pc $\times$ 24 pc. We adopt a $1\sigma$ sensitivity of each channel to be 8.0 mJy/beam or 0.33 K with a channel width of 2.6 km/s. The pixel size is set to be $0.25''$. The moment 0 (i.e.\ integrated intensity; $I_{\rm CO}$) and moment 2 (i.e.\ velocity dispersion; $\sigma_V$) maps are created by \edit1{ applying the mask that includes all the pixels with S/N $\ge 4$ and those with S/N $\ge 2$ and morphologically connected to the former pixels. The noise map is not uniform according to the primary beam pattern and to different observing conditions (e.g.\ integration time) between mosaic pointings. } A typical $1\sigma$ sensitivity of the integrated intensity map is estimated to be 47 mJy/beam km/s or 1.8 K km/s. Assuming the Galactic conversion factor, $X_{\rm CO} = 2\times 10^{20}~{\rm H_2/cm^2/(K~km/s)}$ \citep{Dame01}, this sensitivity corresponds to $\Sigma = 3.6\times 10^{20}~{\rm H_2/cm^2}$ or $5.8~M_\odot/{\rm pc^2}$. Note that this is not corrected for inclination. \section{CO PDFs}\label{sec:pdf} In this section, we present PDFs of the integrated intensity ($I_{\rm CO}$), the peak temperature ($T_{\rm peak}$), and the velocity dispersion ($\sigma_V$), and discuss their profiles according to disk structures (\S \ref{sec:disk}) and to stellar feedback (\S \ref{sec:feedback}). \edit1{ Note that $\sigma_V$ is not corrected for the galactic rotation and beam smearing. As described in Appendix, these effects do not affect the following results and discussions. } \subsection{Disk structures}\label{sec:disk} According to the Fourier analysis of $K_{\rm s}$-band image by \citet[hereafter H14]{Hiro14}, we define the radial range of the bar to be $r=20''$--$85''$. This is the region where non-circular motions are clearly seen in a position-velocity diagram (their Figure 7). The semi-minor axis of the bar is set to be $46''$ based on an ellipse fitting to the same $K_{\rm s}$-band image. A region outside the bar, mostly consists of a spiral arm, is called an arm region. A region inside the bar is called a center region. The center and bar regions are indicated by dots-dashed and dashed lines in Figure \ref{fig:Ico_disk} (left), respectively. The definition in this paper is different and more simple compared to that of paper I, for the sake of better statistics especially for PDF profiles at the bright end. \subsubsection{$I_{\rm CO}$ PDF} The $I_{\rm CO}$ map and its PDF for each of the three regions are presented in Figure \ref{fig:Ico_disk}. Peak positions of bar and arm PDFs are similar (10--30 K km/s), while that for center is an order of magnitude higher. This difference in peak position is similar to what is found for MW clouds \citep{Rath14}. We have confirmed that this general trend holds when the outer boundary of the center region is changed to $r=10''$ or $30''$. The arm PDF is likely LN or at least without a clear PL tail. Its shape as well as the dynamic range of gas surface density are similar to those of spiral arms in M51 derived by \citet{Hugh13a}. \edit1{ In the rightmost panel of Figure \ref{fig:Ico_disk}, an LN function fitted to the arm PDF above $3\sigma$ (the gray dot-dashed vertical line) is presented by the black dotted line. The arm PDF appears to be slightly truncated at the bright end, but the fit result highly depends on the range used for the fit. } Furthermore, as already mentioned in \S \ref{sec:intro}, \citet{Oss16} presented that PDF profiles are highly sensitive to the data quality -- not only the sensitivity but also the uv coverage. In this study, we thus \edit1{ use this LN profile only for the purpose of guiding the eye, and do not compare the shape of profiles } with other studies. On the other hand, PDFs for the center and bar regions extend to higher densities \edit1{compared to the arm PDF.} The center PDF appears to have two peaks, while the bar PDF exhibits a PL like tail at the bright end ($I_{\rm CO} \ga 100$ K km/s). \edit1{ The excess is also clear when compared to the LN profile (Figure \ref{fig:Ico_disk} (right)). } As seen in Figure \ref{fig:Ico_disk} (left), such bright emission comes from the molecular ridges close to the center region and not so much gas concentration is found in the northern bar end. This is consistent with previous CO observations of M83, where gas concentration is found only at the southern bar end (H14), which is not covered by the current FoV. From PDF studies of MW clouds, a column density PDF with a bright-end tail has been regarded as a sign of star formation \citep{Kai09}. However, star formation efficiency (SFE = star formation rate / (molecular) gas mass) in the bar of M83 is lower than that in the arms (H14). One reason for this difference would be the difference in spatial scales. While MW studies discuss PDF profiles at pc scale within a cloud, M83 PDFs in this paper are at 40 pc scale, which is comparable to a typical MW cloud size. Results presented here indicate that at this scale, an existence of a bright-end tail of an $I_{\rm CO}$ PDF is not always the sign of active star formation. In the following subsections, we further discuss possible explanations for this finding. \subsubsection{$T_{\rm peak}$ and $\sigma_V$ PDF}\label{sec:TV_disk} In order to investigate the reason for the difference in $I_{\rm CO}$ PDFs between the bar and arm regions, we create PDFs of other observed properties. Figure \ref{fig:T_disk} presents the $T_{\rm peak}$ map and its PDFs, while Figure \ref{fig:dV_disk} presents those for $\sigma_V$. While $T_{\rm peak}$ PDFs do not differ between the bar and arm regions, the $\sigma_V$ PDF for the bar is shifted to the right-hand side of that for the arm. In M51, \citet{Hugh13a} found a similar trend that their brightness temperature PDFs are more similar between structures compared to $I_{\rm CO}$ PDFs. Since $I_{\rm CO} \sim T_{\rm peak} \times \sigma_V$, this large velocity dispersion in the bar region likely results in the bright-end tail of the $I_{\rm CO}$ PDF. A reason for this large velocity dispersion would be one or combination of large shear motions within the bar, large random motions within a cloud, and overlaps or collisions of clouds at different velocities. The second point is supported by large velocity dispersions of molecular clouds in the bar presented in paper I. \edit1{ A more detailed discussion on how these dynamic properties of molecular gas are related to star formation activities is given in \S \ref{sec:discussion}. } \edit1{ For the center region, both $T_{\rm peak}$ and $\sigma_V$ show different PDF profiles compared to the other regions. The excess in the $I_{\rm CO}$ PDF comes from both high $T_{\rm peak}$ and large $\sigma_V$. Such high $T_{\rm peak}$ and large $\sigma_V$ are also observed in individual clouds identified in paper I. The high $T_{\rm peak}$ is a sign of high gas temperature due to the circumnuclear starburst \citep[e.g.][]{Knap10,Woff11} and/or a large filling factor. The large $\sigma_V$ comes from either large streaming motions or highly turbulent clouds. } \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{show_mom0.eps} \includegraphics[width=0.4\linewidth]{plotpdf3.eps} \includegraphics[width=0.19\linewidth]{show_fitLN.eps} \caption{{\it Left:} The $I_{\rm CO}$ map of M83 from ALMA+NRO45m observations. The coordinates are Right Ascension and Declination in ICRS. The outer boundary of center and bar regions are indicated by 3dots-dashed and dashed lines, respectively. \edit1{{\it Middle:}} The $I_{\rm CO}$ PDFs for the center (green 3dots-dashed), bar (red solid), and arm (blue dashed) regions. The black solid line is the PDF for the entire FoV. The vertical gray dot-dashed line indicates the $3\sigma$ of $I_{\rm CO}$. The horizontal axis on top is the molecular gas surface density in ${\rm H_2/cm^2}$, calculated assuming the Galactic conversion factor. \edit1{{\it Right:} The same $I_{\rm CO}$ PDFs for the bar and arm with an LN function (black dotted line).} } \label{fig:Ico_disk} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{plotpdf6_peak_show.eps} \includegraphics[width=0.4\linewidth]{plotpdf6_peak.eps} \caption{ Same as Figure \ref{fig:Ico_disk}, but for $T_{\rm peak}$. The vertical gray dot-dashed line indicates the $3\sigma$ of channel maps in K. } \label{fig:T_disk} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{plotpdf7_show.eps} \includegraphics[width=0.4\linewidth]{plotpdf7.eps} \caption{ Same as Figure \ref{fig:Ico_disk}, but for $\sigma_V$. The vertical gray dot-dashed line is the channel width ($2.6$ km/s). } \label{fig:dV_disk} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{plotpdf4_show.eps} \includegraphics[width=0.4\linewidth]{plotpdf4.eps} \caption{ {\it Left:} Circles indicate the positions of young stellar clusters or HII regions (purple) and SNRs (red) with a radius of $2''$. The background image is the $I_{\rm CO}$ map (same as Figure \ref{fig:Ico_disk}, but in a different color). {\it Right:} PDFs for feedback (red dashed) and non-feedback (black \edit1{dot-dashed}) area. The center region is excluded. \edit1{Cyan solid} lines indicate the linear fit results at the bright end. } \label{fig:Ico_fb} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{plotpdf8_T_map.eps} \includegraphics[width=0.4\linewidth]{plotpdf8_T.eps} \caption{ Same as Figure \ref{fig:Ico_fb}, but for $T_{\rm peak}$. } \label{fig:T_fb} \end{figure*} \begin{figure*}[h] \includegraphics[width=0.4\linewidth]{plotpdf8_mom2_map.eps} \includegraphics[width=0.4\linewidth]{plotpdf8_mom2.eps} \caption{ Same as Figure \ref{fig:Ico_fb}, but for $\sigma_V$. } \label{fig:dV_fb} \end{figure*} \subsection{Stellar feedback}\label{sec:feedback} Another explanation for the different $I_{\rm CO}$ PDFs is that the arm PDF is truncated due to the effect of stellar feedback such as radiation pressure, photoionization, and supernova explosion \citep{Hop12}. Such stellar feedback mechanisms can preferentially destroy dense gas around young stars, and thus truncate density PDFs at the bright end. In order to investigate the feedback effect on PDF profiles, we have defined ``feedback area'' to be within $2''$ from known young star clusters, HII regions, or supernova remnants (SNRs), where stronger feedback is expected. \edit1{ The catalogs we use in this paper are \citet{Whit11} for young star clusters (their categories 3, 4a, and 4b only), H14 for bright HII regions (sources with $L({\rm H}\alpha) > 10^{37.6}$ erg/s only), and \citet{Dop10} and \citet{Blair12,Blair14} for SNR candidates. We have confirmed that $>90$\% of sources within our FoV have radius $<2''$. The defined } feedback area are indicated by circles in the left panel of Figure \ref{fig:Ico_fb}. \subsubsection{$I_{\rm CO}$ PDF} PDFs for feedback and non-feedback area are presented in the right panel of Figure \ref{fig:Ico_fb}. Since we are interested in difference between bar and arm regions, the center region (enclosed by a dots-dashed line in the left panel of Figure \ref{fig:Ico_fb}) is excluded. Contrary to the theoretical expectation, the bright-end slopes of these two PDFs are not significantly different. Based on numerical simulations by \citet{Hop12}, we fit each PDF at $\Sigma > 10^3~M_\odot/{\rm pc^2} = 6\times 10^{22}~{\rm H_2/cm^2}$ with a line. \edit1{ The fit is performed in the log-log space using the least chi-square method. } Although the number of data points that exceed this gas density limit is small, slopes of the two fitted lines (\edit1{solid cyan} lines in Figure \ref{fig:Ico_fb}) are consistent within errors. We thus deduce that at least at this spatial \edit1{scale (i.e., $\sim 40$ pc in radius)} the feedback effect is not dominant in shaping the bright-end profiles of $I_{\rm CO}$ PDFs. \edit1{ We have also tried different definition of radius ($r=1''$ and $3''$) for the feedback area. For the former case, the bright-end slope is steeper for the feedback area than that for the non-feedback area. However, the feedback PDF has only two data points above the threshold, which results in failure of deriving errors. For the latter case, the slope is shallower for the feedback area than that for the non-feedback area. A naive interpretation of this result is that stellar feedback reduces the amount of dense gas within 20 pc and increases it at 60 pc away from the source. The former is consistent with the general understanding that stellar feedback effect should be larger when closer to the source. The latter may indicate the positive feedback effect, in which the swept-out gas forms the next generation stars \citep[e.g.][]{Deh10}. However, this could also be due to the bias that the sources are mostly around the spiral arm where the gas density is generally high. For further discussion, CO data at a higher spatial resolution ($< 10$ pc considering the size distribution of feedback sources) are essential. } \subsubsection{$T_{\rm peak}$ and $\sigma_V$ PDF} One thing we should note here that PDFs in the simulations are for the gas column density $\Sigma$ while PDFs from observations are for the $I_{\rm CO}$. Although $X_{\rm CO}$ is often assumed to be constant within a galaxy, it could vary especially at smaller scales. For example, gas in the feedback area can be heated, which results in brighter CO emission. In addition, the stellar feedback may accelerate gas, which results in larger velocity dispersion. Such positive feedback effects can compensate the negative effect suggested by the simulations. In Figures \ref{fig:T_fb} and \ref{fig:dV_fb}, PDFs of $T_{\rm peak}$ and $\sigma_V$ for the feedback and non-feedback area are presented. While difference in the $\sigma_V$ PDFs is not clear, the $T_{\rm peak}$ PDF for the feedback area is shallower than that for the non-feedback area. This indicates that an increase of $\sigma_V$ due to feedback is not evident at the current \edit1{definition ($r=2''$),} and that gas in the feedback area tends to be warmer and/or a filling factor is larger. The former further suggests that the large $\sigma_V$ in the bar is not due to stellar feedback. To investigate the cause of difference in $T_{\rm peak}$ PDF profiles, gas temperature and density need to be measured. This requires multi-transition data sets at the same resolution that will be presented in a future paper. \section{Molecular gas in M83 bar}\label{sec:discussion} From the PDF analysis described above, we find the $I_{\rm CO}$ tail in the bar of M83. While such a tail has been regarded as a sign of active star formation in MW studies, SFE in the bar of M83 is lower than in the arm. We also find a similar tail for $\sigma_V$ in the bar and deduce that this large $\sigma_V$ is a major driver for the $I_{\rm CO}$ tail. Meanwhile, at least at the current spatial scale, stellar feedback does not affect $I_{\rm CO}$ and $\sigma_V$ PDFs. This suggests that the large $\sigma_V$ in the bar is not due to feedback. It is rather likely that the large $\sigma_V$ suppresses star formation in the bar. There are several other studies suggesting an explanation for low SFE in bars from a dynamical point of view. Based on a large velocity gradient analysis of molecular clouds in Maffei 2, \citet{Sor12} suggested that clouds in the bar region are likely unbound and that the $X_{\rm CO}$ factor can be a factor of 2 smaller than that in the arm region. \edit1{ If this is also the case for M83, the $\Sigma$ PDF for the bar would not have a clear excess compared to that for the arm, as the current excess in $I_{\rm CO}$ is $\sim 0.5$ dex, i.e., a factor of $\sim 3$. } \citet{Meidt13} presented that a radial area with large streaming motions is associated with low SFEs in a spiral galaxy M51. They interpreted this result that shearing motions can stabilize molecular clouds. These studies support the idea that individual clouds are under a condition which is unlikely to form stars. \edit1{ From a 2D hydrodynamical simulation for M83, \citet{Nimo13} found that clouds in the bar are more virialized and SFE should be $\sim 60$\% less in the bar compared to the arm. } On the other hand, \edit1{based on a more recent 3D simulation,} \citet{FujiY14b} proposed a scenario that suppressed star formation can be explained by high speed cloud-cloud collisions. Since these studies focus on molecular clouds, we here briefly summarize cloud properties derived in paper I. Note again that region definitions are not identical. \edit1{ Compared to clouds in the arm, those in the bar are typically larger (radius of $76^{+55}_{-16}$ pc for the bar and $62^{+20}_{-14}$ pc for the arm), with higher $T_{\rm peak}$ ($5.2^{+2.4}_{-0.9}$ K for the bar and $3.8^{+1.0}_{-1.1}$ K for the arm), with larger $\sigma_V$ ($18.7^{+17.1}_{-4.5}$ km/s for the bar and $11.9^{+3.5}_{-2.9}$ km/s for the arm), and with larger virial parameter ($1.6^{+2.1}_{-0.5}$ for the bar and $1.0^{+0.5}_{-0.4}$ for the arm). } This result is consistent with the idea that cloud property itself is against star formation. However, there is a possibility that large clouds \edit1{with large velocity dispersion} are a result of cloud-cloud collisions. Furthermore, \edit1{ the differences of the above parameters between the bar and arm are rather small and comparable to their dispersions. } For further discussion, again, gas density needs to be derived more accurately without assuming a constant conversion factor. \section{Summary} Based on ALMA and NRO45m observations toward M83 in CO(1--0) at 40 pc scale, we create PDFs of $I_{\rm CO}$, $T_{\rm peak}$, and $\sigma_V$. This work is complementary to paper I, which identifies molecular clouds based on the same data set and investigates their properties. We first investigate PDF profiles according to the galactic structure, i.e.\ center, bar, and arm. The $I_{\rm CO}$ PDF for the bar shows an excess or tail at the bright end ($I_{\rm CO} \ga 100$ K km/s) compared to that for the arm. From PDF studies of MW molecular clouds, such a bright-end tail is often interpreted as a sign of self-gravity and/or star formation. However, SFE in M83 bar is lower than in arms. The $\sigma_V$ PDF for the bar also shows an excess at $\sigma_V \ga 10$ km/s, suggesting that this large velocity dispersion in the bar is a major cause of the $I_{\rm CO}$ tail and low SFE. This result indicates that at least at 40 pc scale the $I_{\rm CO}$ tail is not always a sign of active star formation. We also investigate if stellar feedback affects PDF profiles. A feedback area and non-feedback area are defined according to catalogs of HII regions, young star clusters, and SNRs. \edit1{ The radius of the feedback area is set to be $2''$ ($\sim 40$ pc). } While the $T_{\rm peak}$ PDF is shallower for the feedback area, $\sigma_V$ and $I_{\rm CO}$ PDFs do not differ significantly between the two areas. We thus conclude that at least at 40 pc scale the feedback effect does not explain the different PDFs between bar and arm regions. These results suggest that the large-scale disk structures affect PDFs of $\sigma_V$ and thus of $I_{\rm CO}$ while the small-scale feedback affects the $T_{\rm peak}$ PDF. \acknowledgments \edit1{ We appreciate careful reading and suggestions by a referee that have improved our manuscript. } This paper makes use of the following ALMA data: ADS/JAO.ALMA\#2011.0.00772.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), NSC and ASIAA (Taiwan), and KASI (Republic of Korea), in cooperation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI/NRAO and NAOJ. The Nobeyama 45-m radio telescope is operated by Nobeyama Radio Observatory, a branch of National Astronomical Observatory of Japan. \vspace{5mm} \facilities{ALMA, Nobeyama 45m Telescope}
\section{Introduction} The parameters in the Pontecorvo-Maki-Nakagawa-Sakata (PMNS) matrix \cite{PMNS}, the currently accepted framework describing neutrino oscillations, can only be determined experimentally. While the measurements of mixing angles $\theta_{12}$ and $\theta_{23}$ are achieved with solar neutrinos and atmospheric neutrinos (with the help of accelerator neutrino data) respectively, the measurements of mixing angle $\theta_{13}$ completed so far rely on neutrinos sourced from manmade facilities. The T2K~\cite{T2K2011} and MINOS~\cite{MINOS2011} Collaborations studied the appearance of electron neutrinos $\nu_e$ in a beam of muon neutrinos $\nu_\mu$ produced in particle accelerators, while the Double Chooz~\cite{DC2012}, Daya Bay~\cite{DB2012} and RENO~\cite{RENO2012} Collaborations studied the disappearance of electron antineutrinos ${\bar \nu}_e$ produced from nuclear reactors in a nuclear power plant. The measurement of $\theta_{13}$ is much more challenging than the other two mixing angles because $\theta_{13}$ is the smallest among the three mixing angles. The limited flux of neutrino sources available from accelerators and reactors also constrained the measurement of $\theta_{13}$ to some extent. The Daya Bay Collaboration first reported a successful measurement of mixing angle $\theta_{13}$ (with a statistical significance of $5.2 \sigma$) in 2012~\cite{DB2012} and the RENO Collaboration reported their results (with a statistical significance of $4.9 \sigma$) in the same year~\cite{RENO2012}. More precise results from reactor neutrino experiments were reported in \cite{DBmore,RENOmore,DCmore}. To compensate the limitation on the source of electron antineutrinos from nuclear power plants and to reduce systematic uncertainty in estimating absolute neutrino flux from nuclear power plants, Daya Bay and RENO utilized the design of identical detectors placed in group of near and far away from the nuclear reactors. There are 6 detectors in the first Daya Bay experiment~\cite{DB2012} and 2 in the RENO experiment~\cite{RENO2012}. The number of nuclear reactors in both Daya Bay and RENO is 6. More detectors have been placed in the late measurements~\cite{DBmore,RENOmore}. The quantities measured in both experiments are number of electron antineutrinos at each detector over certain time period. Thereby the numbers of data points in the first Daya Bay~\cite{DB2012} and RENO~\cite{RENO2012} experiments are 6 and 2, respectively. While the use of multiple reactors and detectors improve the efficiency of the experiments, this will complicate the analysis of experimental data since one has to deal with multiple sources of uncertainties which include one for each reactor and two for each detector (one for the detector itself and one for the background of the detector). Precise evaluation of uncertainties in these experiments is particularly important, considering the value of $\theta_{13}$ is very small. The method used by the Daya Bay~\cite{DB2012} and RENO~\cite{RENO2012} Collaborations is know as pull method. This method is adopted with the intention to account for correlation of various systematic uncertainties. The pull method has been used in studies that perform global fits of experimental data from different experiments in order to extract parameters appearing in the fundamental theories, e.g. in the determination of parton distribution function of nucleon~\cite{Pull_PDF} and in the analysis of solar neutrino data from different experiments~\cite{Pull_other}. The pull method introduces one pull factor for each systematic uncertainty. So there are 18 pull factors in Daya Bay and 10 in RENO experiments. Together with the mixing angle $\theta_{13}$ and an overall normalization factor, there are 20 and 18 parameters to be determined from the minimization of $\chi^2$ defined with 6 and 2 points of data in the Daya Bay and RENO experiments respectively. The Daya Bay and RENO Collaborations reported results on the mixing angle and the normalization factor while omitting any results on the pull factors. It would be interesting to understand the role played by the pull factors. Are those pull factors all necessary? What are the constraints on the values of pull factors? What information can those pull factors reveal about the fit? A number of issues were raised in \cite{KhanWR14} regarding the analysis of neutrino oscillation data from reactor neutrinos. It was claimed \cite{KhanWR14} that they were unable to reproduce experimental groups' results due to their inability to access experimental details. They reported an unexplained discrepancy between their results, obtained by following standard analysing procedures, and Daya Bay's and RENO's results. They questioned the viability of the pull method used by the experimental groups in extracting parameters of interest when the number of data points is less than the number of parameters. They constructed a $\chi^2$ in a similar way as the experimental groups, but involving fewer parameters than the ones used by the experimental groups, and demonstrated that minimization of this $\chi^2$ leads to multiple sets of parameters which do not always give consistent values for the parameters of interest. The work reported in \cite{KhanWR14} casts some doubts on experimental groups' analyses of data. The Daya Bay Collaboration has employed the covariance method of data analysis in their later studies \cite{DBmore}. In this paper we address the issues with reproducibility of Daya Bay's results and the robustness of the pull method in analysing neutrino data. We analyze the data following the same method described by the Daya Bay Collaboration \cite{DB2012} and present results for the mixing angle and the normalization factor, together with the values for the pull factors. We investigate whether the extraction of parameters of interest are sensitive to the values of pull factors. Furthermore, we carry out an analysis with a $\chi^2$ defined with 5 fewer parameters than that used in Daya Bay's analysis after noticing the number of pull factors can be reduced due to identical detectors being used in the measurement. We give a review of two approaches in defining $\chi^2$ with an emphasis on the constraints implied in the construction of $\chi^2$ in the pull approach in Section \ref{sec:review}. An analysis following Daya Bay's approach is given in Section \ref{sec:DBfull}, while an analysis with a reduced $\chi^2$ is given in Section \ref{sec:DBreduced}. A summary is given in Section \ref{sec:summary}. \section{The covariance approach vs pull approach} \label{sec:review} In this section we review two commonly used approaches in defining the $\chi^2$. The underline assumption in defining a proper $\chi^2$ ({\it i.e.} it is a true measurement of goodness of fit) is the defined $\chi^2$ must follow a normal (Gaussian) distribution. For an experiment with $N$ observations (number of data points), correspondingly there are $N$ theoretical predictions. The theoretical predictions normally depend on a set of parameters for the theory. By comparing experimental measurements and theoretical calculations, one can test the theory and determine the parameters involved. The $\chi^2$ is defined in terms of experimental observations $R_n^{\rm exp}$, theoretical predictions $R_n^{\rm the}$, and uncorrelated and correlated uncertainties $u_n$ and $c_k$. The number of correlated uncertainties depends on the experiment setup. $\chi^2$ is a numerical measurement of goodness of fit, {\it i.e.} the goodness of the theory describing the observations. In the covariance approach, $\chi^2$ is defined as \begin{eqnarray} \chi_{\rm cov}^2=\sum_{n,m=1}^N \left( R_n^{\rm exp} - R_n^{\rm the} \right) \left[ \sigma_{nm}^2 \right]^{-1} \left( R_m^{\rm exp} - R_m^{\rm the} \right), \label{eq:chi_cov} \end{eqnarray} where $\left[ \sigma_{nm}^2 \right]^{-1}$ is the inverse of $\sigma_{nm}^2$ -- a matrix of squared uncertainties constructed from uncorrelated and correlated uncertainties $u_n$ and $c_k$, \begin{eqnarray} \sigma_{nm}^2=\delta_{nm} u_n u_m + \sum_{k=1}^K c_n^k c_m^k, \label{eq:sigma} \end{eqnarray} with $K$ being the total number of correlated uncertainties. The matrix of squared uncertainties is totally determined if all the uncertainties are well understood (given). The parameters to be determined from the fit are the parameters appearing in the theory. The number of degrees of freedom (d.o.f) is the number of observations (data points) minus the number of parameters. An acceptable fit requires $\chi \sim {\rm d.o.f}$. It becomes increasingly challenging to invert the $N \times N$ matrix $\sigma_{nm}^2$ when the number of observations becomes large. The alternative pull approach introduces one parameter (``pull factor") for each correlated systematic uncertainty and defines $\chi^2$ as \begin{eqnarray} \chi_{\rm pull}^2 &=& \sum_{n=1}^N \left( \frac{R_n^{\rm exp} - R_n^{\rm the} - \sum_{k=1}^K \xi_k c_n^k}{u_n } \right)^2 +\sum_{k=1}^K \xi_k^2 \nonumber \\ &\equiv& \chi_{\rm obs}^2+\chi_{\rm sys}^2. \label{eq:chi_pull} \end{eqnarray} Despite the apparent difference between Eqs.~(\ref{eq:chi_cov}) and (\ref{eq:chi_pull}), it has been proven~\cite{Fogli2012} that the two approaches are equivalent, {\it i.e.} $\chi_{\rm cov}^2=\chi_{\rm pull}^2$. The key observation is that the minimization of Eq.~(\ref{eq:chi_pull}) with respect to $\xi_k$ leads to a set of $K$ linear equations for $\xi_k$ and the solutions of $\xi_k$ can be written in terms of a matrix which is related to the matrix $\sigma_{nm}$ given by Eq.~(\ref{eq:sigma}). Thereby the pull factors introduced for $K$ systematic uncertainties are completely determined if all systematic uncertainties are given. The pull approach has the advantage over the covariance approach in computation time when $K < N$ since the pull approach is equivalent to the inversion of a $K \times K$ matrix while the covariance approach requires the inversion of a $N \times N$ matrix. The pull approach is also applicable for the case $N<K$. Another advantage of employing pull approach in data analysis is that it enables one to understand the effects of systematic uncertainties in the measurement more clearly. The effects from systematic uncertainty are expressed explicitly as the second term in Eq.~(\ref{eq:chi_pull}) ($\chi_{\rm sys}^2$) while the first term represents a measurement of difference between observations and theoretical predictions ($\chi_{\rm obs}^2$) The parameters in Eq.~(\ref{eq:chi_pull}) include parameters needed for theoretical predictions which are of physics interest and pull factors. The number of pull factors introduced in Eq.~(\ref{eq:chi_pull}) is normally more than the number of parameters needed in theoretical calculations. Although all pull factors are determined in principle when all uncertainties are known, in practice, the minimization of $\chi_{\rm pull}^2$ is carried out in the parameter space including parameter set for the theory and the pull factors. When the number of data points is less than the number of parameters, as in the cases for the Daya Bay and RENO experiments, the variational minimization usually will result in multiple sets of parameters that all give similar value for the $\chi^2$, {\it i.e.} having same level of goodness-of-fit. One needs to rely on other information implied in the design of $\chi_{\rm pull}^2$ to distinguish these fits. Apart from goodness-of-fit test, there are other requirements for a (an) good/acceptable fit when using the pull method. \begin{enumerate} \item All pull factors are small since the pull factors are Gaussian random variables with the expectations $\left< \xi_k \right>=0$ and $\left< \xi_k^2 \right>=1$. \item $\chi_{\rm sys}^2 << \chi_{\rm obs}^2$. A large value of $\chi_{\rm sys}^2$ means one or more systematic uncertainties dominates in achieving an agreement between the data and theoretical calculations. \end{enumerate} A violation of either condition usually indicates a great tension between experimental measurements and theoretical predictions. We consider a fit that might pass the goodness-of-fit test ($\chi \sim {\rm d.o.f}$) but violates one or both above requirements is not acceptable. Even after applying the goodness-of-fit test and the above two criteria, there are still multiple acceptable fits depending on the minimization algorithm and/or initial guessed values for the parameters. This dependence should be insignificant for the quantities of interest. To evaluate uncertainties associated with the existence of multiple acceptable fits, we adopt the following two methods: 1) We can perform a number of minimizations and calculate the statistical uncertainty in the standard way for multiple measurements. 2) An alternative way to avoid ambiguities in choosing the right fit from multiple sets of parameters is to treat $\chi_{\rm pull}^2$ as a function of parameters of interest. For every point in the space of parameters of interest, a minimization is done with respect to all pull factors and an acceptable minimization still need to meet all above requirements. In doing so, a plot of confidence level contours can be draw. \section{Reanalysis of Daya Bay data} \label{sec:DBfull} The Daya Bay result for $\theta_{13}$ reported in \cite{DB2012} was obtained by minimizing a $\chi^2$ function, as was done by the other short-baseline neutrino oscillation experiments. The function used by the Daya Bay Collaboration [9] was, \begin{eqnarray} \chi^2_{\rm DB}=\sum_{d=1}^6 \frac{\left[ M_d - T_d \left(1+\epsilon + \sum_{r=1}^6 \omega_r^d \alpha_r + \rho_d \right) +\eta_d \right]^2}{M_d+B_d} +\sum_{r=1}^6 \frac{\alpha_r^2}{\sigma_r^2} + \sum_{d=1}^6 \left( \frac{\rho_d^2}{\sigma_d^2} + \frac{\eta_d^2}{\sigma_{db}^2} \right), \label{eq:DB} \end{eqnarray} where $M_d$ is the total number of antineutrinos detected by detector $d$, $B_d$ is the measured background for detector $d$ and $T_d$ is theoretical prediction for the number of antineutrinos reaching detector $d$ basing on neutrino oscillation theory and thus depends on the mixing angle $\theta_{13}$. $\epsilon$ is the normalization factor and $\omega_r^d$ is fractional contribution of antineutrinos detected by detector $d$ from reactor $r$. $\sigma_r$, $\sigma_d$ and $\sigma_{db}$ are uncertainties associated with reactor $r$, detector $d$ and the background of detector $d$, respectively, and $\alpha_r$, $\rho_d$ and $\eta_d$ are the corresponding pull factors, respectively. The theoretical prediction is simply the total flux at the detector multiplied by the survival probability. The electron antineutrino survival probability is given by, \begin{eqnarray} P_{\rm surv}(\bar{\nu}_{e}\rightarrow\bar{\nu}_{e})&=&1-\sin^2(2\theta_{12})\cos^4(\theta_{13})\sin^2\left(\frac{\Delta_{12}}{2}t\right) \nonumber \\ && -\sin^2(2\theta_{13})\left[\cos^2(\theta_{12})\sin^2\left(\frac{\Delta_{13}}{2}t\right)+\sin^2(\theta_{12})\sin^2\left(\frac{\Delta_{12}}{2}t\right)\right], \label{eq:Pfull} \end{eqnarray} where each $\theta_{ij}$ is a mixing angle, $t$ is the time of fly for $\bar{\nu}_{e}$ between the reactor and the detector, and $\Delta_{ij}$ is the difference in energy between mass states $i$ and $j$. Since detected neutrinos are always ultra-relativistic, the energy difference term is swapped out for the relativistic approximation, and one has $\frac{\Delta_{ij}}{2}t\approx\frac{\Delta m^2_{ij}}{4E}L$ which depends on the mass-squared difference, the energy (which is assumed to be the same for all), and the baseline. It should be noted that Eq.~(\ref{eq:Pfull}) is hierarchy dependent, therefore Daya Bay used the short baseline approximation\footnote{The justification for this approximation is given in the supplemental material in~\cite{DB2012}.}, \begin{eqnarray} P=1-\sin^2(2\theta_{12})\cos^4(\theta_{13})\sin^2\left(\frac{\Delta m^2_{small}}{4E}L\right)-\sin^2(2\theta_{13})\sin^2\left(\frac{\Delta m^2_{big}}{4E}L\right), \label{eq:PShort} \end{eqnarray} where the two mass squared differences are the measured values. The energy dependency of the probability was dealt with by performing a normalized integration of the probability over the nuclear emission and inverse beta decay absorption energy spectra, which were obtained from~\cite{Espec} and~\cite{Cross-section} respectively. (Not long after the publication of~\cite{DB2012}, Daya Bay found that the energy spectrum given in~\cite{Espec} was incorrect, which prompted their use of the covariance method in later works~\cite{DBmore}.) Equation~(\ref{eq:DB}) contains 20 free parameters of which $\theta_{13}$ and the overall normalization factor $\epsilon$ are of interest while the other 18 pull factors are introduced to account for the correlation of the systematic uncertainties. Daya Bay group reported only results for $\theta_{13}$ and $\epsilon$ but not for the pull factors. We performed the fittings using the two methods described above: minimizing $\chi^2$ with respect to all parameters and minimizing $\chi^2$ with respect to the pull factors at fixed values of $\theta_{13}$ and $\epsilon$ and then finding the absolute minimum. The two methods are equivalent as each is performing a global minimization; the first does so in one step while the second does so in two steps. The advantage of the first is that far fewer calculations are needed to arrive at ``the answer" while the second provides more information about the behaviour of the function in the vicinity of the minimum. The minimization algorithm used for each method naturally requires some initial values for the parameters as inputs and is only capable of finding local minima. This was dealt with, in the case of the first method, by using psuedo-random inputs and taking the average of multiple minimizations, assuming that the faux minima are uniformly distributed around the true minimum. This can be confirmed if the value of $\chi^2$ produced when the obtained average values of the parameters are put into the function, is less than $\chi^2_{\rm ave}$. The results can be improved by imposing some sensible conditions, such as requiring $\theta_{13}$ to be positive and the minima to fall within a certain range, and choosing a reasonable range for the inputs. The fit described below used inputs taken from a uniform distribution ranging between 0 and 0.2 while minima were only accepted if they gave $\chi^2\leq5$ ({\it i.e.} the values needed to be within the expected first confidence interval), and satisfied the two criteria discussed in Section \ref{sec:review} ({\it i.e.} all pull factors being small and $\chi_{\rm sys}^2 << \chi_{\rm obs}^2$). We noticed that $\chi_{\rm sys}^2 << \chi_{\rm obs}^2$ is normally guaranteed when the other conditions for the acceptable fits are satisfied. A ``free" run minimization without imposing any conditions discussed above could lead to output with abnormal large value of $\chi^2$ or large values for pull factors with the associated result for the mixing angle being different from those reported by the Daya Bay Collaboration, a situation that has been reported in \cite{KhanWR14}. An additional feature of using random inputs is that statistics can be calculated for each variable when multiple fits are performed, which in turn will provide information about the topography of the function around the minimum. The mean values and uncertainties corresponding to $95\%$ confidence interval for each variable obtained from 20 random input fits are presented in table~\ref{tablefull}. The uncertainties listed in the table can be understood as the ``theoretical" uncertainties associated with the statistical method. The uncertainty for the mixing angle is negligible small. The values for the pull factors $\rho$ and $\alpha$ are on the order of $10^{-4}$, while the values for the pull factor $\eta$ are on the order of of $10^{-1}$ but having uncertainties comparable with their mean values. These results are consistent with the requirement that all pull factors should have an expectation value of zero. \begin{table} \caption{Results of random input fits with Eq.~(\ref{eq:DB})} \centering \begin{tabular}{l*{6}{c}} Parameter& \multicolumn{2}{c}{$\chi^2$} &\multicolumn{2}{c}{$\sin^2(2\theta_{13})$} &\multicolumn{2}{c}{$\epsilon$$({\times}10^{-4})$} \\ \hline Mean &\multicolumn{2}{c}{$3.872$} &\multicolumn{2}{c}{$0.08844$} &\multicolumn{2}{c}{$-2.3$}\\ 90\%CI &\multicolumn{2}{c}{$0.073$} &\multicolumn{2}{c}{$0.00025$} &\multicolumn{2}{c}{2.7}\\ \hline Parameter &$\rho_1$ &$\rho_2$ &$\rho_3$ &$\rho_4$&$\rho_5$ &$\rho_6$\\ \hline Mean $({\times}10^{-4})$ &$4.90$ &$-6.45$ &$1.36$ &$4.573$ &$-0.24$ &$-4.335$\\ 90\%CI $({\times}10^{-4})$ &$0.35$ &$0.07$ &$0.42$ &$0.039$ &$0.14$ &$0.031$\\ \hline Parameter &$\alpha_1$ &$\alpha_2$ &$\alpha_3$ &$\alpha_4$ &$\alpha_5$ &$\alpha_6$ \\ \hline Mean $({\times}10^{-4})$ &$-6.7$ &$-7.96$ &$7.8$ &$4.01$ &$8.4$ &$4.72$\\ 90\%CI $({\times}10^{-4})$ &$4.9$ &$0.54$ &$4.6$ &$0.88$ &$5.5$ &$0.73$\\ \hline Parameter &$\eta_1$ &$\eta_2$ &$\eta_3$ &$\eta_4$ &$\eta_5$ &$\eta_6$\\ \hline Mean $({\times}10^{-1})$ &$2.0$ &$-1.2$ &$1.8$ &$4.2$ &$1.5$ &$4.5$\\ 90\%CI $({\times}10^{-1})$ &$1.5$ &$2.4$ &$2.6$ &$1.6$ &$3.8$ &$2.1$\\ \end{tabular} \label{tablefull} \end{table} Using the obtained values for the parameters as input for the function gives $\chi^2_{\rm min}=3.78\leq\chi^2_{\rm ave}=3.90$, $\chi_{\rm obs}^2=3.47$ and $\chi_{\rm sys}^2=0.31 <<\chi_{\rm obs}^2$. This satisfies two of the criteria for a valid goodness of fit test and indicates that the absolute minimum (or a close approximation) was obtained. The pull factors are all quite small and their large variations relative to that of $\theta_{13}$ indicate that they are unimportant to the fit. This is further strengthened by the small value of $\chi_{\rm sys}^2$. \begin{figure} \includegraphics[width=\textwidth]{DBCNTF} \caption{(Color on line) Contour plot of the $\sin^2(2\theta_{13})$-$\epsilon$ plane for Eq.~(\ref{eq:DB}). Each contour line represents $1\sigma$. The red x is the minimum.} \label{DBSCNPLT} \end{figure} For the second type of fit, minimization of $\chi^2$ for each point in the $\sin^2(2\theta_{13})$-$\epsilon$ space is carried out using the theoretical expectation value (zero) for the pull factors as the initial guess. A contour plot was produced in Fig.~\ref{DBSCNPLT} with each confidence interval being marked. (For a two-variable fit, the $n$-th confidence interval is defined as $\sigma_n=\chi^2_{min}+n^2$.) The minimum found was $\chi^2=3.78$ at $\sin^2(2\theta_{13})=0.088_{-0.008}^{+0.009}$, and $\epsilon=0\pm0.004$, which is in agreement with the results obtained with the first method we discussed above and in agreement with the results reported by the Daya Bay Collaboration. A point of interest is that Fig.~\ref{DBSCNPLT} shows a greater variation along the $\epsilon$ axis than the $\sin^2(2\theta_{13})$ axis, supporting the previous supposition in regards to the significance of the variability of the parameters in the random fit. Fig.~\ref{DBSCNPLT} also shows that the uncertainties of the two variables are correlated. A simple examination of Eq.~(\ref{eq:DB}) will reveal that the same effect will occur for all of the pull factors. The antineutrino survival probability Eq.~(\ref{eq:Pfull}) is hierarchy dependent. We have checked that this hierarchy dependence has negligible effects on the extraction of the mixing angle $\theta_{13}$ and the normalization factor $\epsilon$. \section{Daya Bay results with reduced parameters} \label{sec:DBreduced} We notice that the uncertainty of detector, $\sigma_d$, has the same values for all six detectors due to the fact that all six detectors are identical. Thus we argue that only one pull factor in association with the uncorrelated uncertainty of the detectors is required in the definition of $\chi^2$ function. We define the reduced $\chi^2$ function as, \begin{eqnarray} \chi^2_{\rm DB}=\sum_{d=1}^6 \frac{\left[ M_d - T_d \left(1+\epsilon + \sum_{r=1}^6 \omega_r^d \alpha_r + \rho \right) +\eta_d \right]^2}{M_d+B_d} +\sum_{r=1}^6 \frac{\alpha_r^2}{\sigma_r^2} + \rho \frac{6}{\sigma_d^2} + \sum_{d=1}^6 \frac{\eta_d^2}{\sigma_{ab}^2}. \label{eq:DBReduced} \end{eqnarray} The number of parameters needed in the fitting process is reduced from 20 to 15 by using Eq.~(\ref{eq:DBReduced}) in stead of Eq.~(\ref{eq:DB}). Equation~(\ref{eq:DBReduced}) was minimized in the same two ways as Eq.~(\ref{eq:DB}). \begin{table} \caption{Results of random input fits with Eq.~(\ref{eq:DBReduced})} \centering \begin{tabular}{l*{6}{c}} Parameter &$\chi^2$ &\multicolumn{3}{c}{$\sin^2(2\theta_{13})$} &$\epsilon({\times}10^{-5})$ &$\rho({\times}10^{-7})$\\ \hline Mean &$4.1035$ &\multicolumn{3}{c}{$0.088551$} &$-1.93$ &$1.3$\\ 90\%CI &$0.0086$ &\multicolumn{3}{c}{$0.000013$} &$0.61$ &$2.5$\\ \hline Parameter &$\eta_1$ &$\eta_2$ &$\eta_3$ &$\eta_4$ &$\eta_5$ &$\eta_6$\\ \hline Mean $({\times}10^{-4})$ &$-9.99$ &$-9.512$ &$5.484$ &$4.505$ &$4.233$ &$5.40$\\ 90\%CI $({\times}10^{-4})$ &$0.12$ &$0.078$ &$0.041$ &$0.048$ &$0.061$ &$0.04$\\ \hline Parameter &$\alpha_1$ &$\alpha_2$ &$\alpha_3$ &$\alpha_4$ &$\alpha_5$ &$\alpha_6$\\ \hline Mean $({\times}10^{-1})$ &$1.8$ &$2.6$ &$2.8$ &$4.1$ &$0.1$ &$2.3$\\ 90\%CI $({\times}10^{-1})$ &$1.1$ &$1.5$ &$3.9$ &$2.7$ &$2.1$ &$1.4$\\ \end{tabular} \label{tablerf} \end{table} The results from random input fits are given in Table~\ref{tablerf}. Using the results as input for the function gives $\chi^2_{\rm min}=4.10=\chi^2_{\rm ave}$, $\chi_{\rm obs}^2=4.06$ and $\chi_{\rm sys}^2=0.05 <<\chi_{\rm obs}^2$ (some rounding occurred). Overall, the results are essentially the same as for Eq.~(\ref{eq:DB}). \begin{figure} \includegraphics[width=\textwidth]{DBCNTR} \caption{(Color online) Contour plot of the $\sin^2(2\theta_{13})$-$\epsilon$ plane for Eq.~(\ref{eq:DBReduced}). Each contour line represents $1\sigma$. The red x is the minimum.} \label{DBSCNRF} \end{figure} The second type of fit yields a contour plot as shown in Fig.~(\ref{DBSCNRF}). The minimum found was $\chi^2=4.10$ at $\sin^2(2\theta_{13})=0.089^{+0.008}_{-0.009}$, $\epsilon=0\pm0.004$, which is in agreement with the other method, as was the case with Eq.~(\ref{eq:DB}). Figure~\ref{DBSCNRF} shows the same $\sin^2(2\theta_{13})$-$\epsilon$ variation as Fig.~\ref{DBSCNPLT}, which is to be expected given the great similarity between Eqs.~(\ref{eq:DB}) and~(\ref{eq:DBReduced}). Again, the results are essentially the same as for Eq.~(\ref{eq:DB}). We conclude that Eq.~(\ref{eq:DBReduced}) is a suitable definition of $\chi^2$ in analysing Daya Bay's data. \section{Summary} \label{sec:summary} The successful measurement of mixing angle $\theta_{13}$ in the PMNS matrix is a significant progress in understanding neutrino oscillation phenomenon. In order to eliminate uncertainty associated with neutrino fluxes from multiple nuclear reactors at a nuclear power plant, the experiment groups placed identical detectors in different distance from the reactors, which unavoidably leads to the introduction of multiple sources of systematic uncertainties. The statistical method used in the data analyses by the Daya Bay Collaboration and RENO Collaboration is based on variational minimization of a $\chi^2$ function defined in terms of quantities of interest and pull factors which are introduced to deal with effects of systematic uncertainties. There exist multiple sets of parameters from the minimization of the $\chi^2$ function. We reviewed the two statistical approaches in data analysis, the covariance approach and the pull approach, emphasizing the equivalence of these two approaches and the other criteria needed for an acceptable fit apart from the normal goodness-of-fit test when the pull method is utilized. Without imposing those criteria one is at the risk of extracting unreliable information for the quantity of interest. We investigated the possible ambiguity in the extraction of mixing angle $\theta_{13}$ using the pull approach by performing an independent analysis of Daya Bay's data. We reported results for all parameters, including those of physics interest and pull factors. The obtained results for the mixing angle and the normalization factor are in agreement with those reported by the Daya Bay Collaboration. Furthermore, we presented plots of confidence level contours in the space of the mixing angle and normalization factor. Noticing some pull factors in the $\chi^2$ definition used by the Daya Bat Collaboration are surplus we presented results from fittings using a reduced $\chi^2$ function which requires 5 fewer parameters. We have checked that the hierarchy dependence of the antineutrino survival probability has negligible effects on the extraction of the mixing angle $\theta_{13}$ and the normalization factor~$\epsilon$. A reanalysis of RENO's data using the methods presented in this paper will be given in future work.
\section{Introduction} In this paper we consider the system of coupled nonlinear Schr\"odinger equations, \begin{equation}\label{Eq:NLS} \left\{\begin{array}{l} \mathbbm{i}\sigma_3 \dot u + \Delta u -\beta (|u |^2) u=0, \\[1ex] u(0,x)=u_0(x) \in \mathbb{C}^2,\qquad x\in \mathbb{R}^3, \end{array} \right. \end{equation} where $ \mathbbm{i}$ is the imaginary unit and the Pauli matrices are given by \begin{equation} \label{pauli-matrices} \begin{aligned} & \sigma_1=\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} \,, \qquad \sigma_2= \begin{pmatrix} 0 & -\mathbbm{i} \\ \mathbbm{i} & 0 \end{pmatrix} \,, \qquad \sigma_3=\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. \end{aligned} \end{equation} We assume that $\beta $ satisfies the following two hypotheses, which guarantee the local well-posedness of \eqref{Eq:NLS} in $H^1(\mathbb{R}^3, \mathbb{C}^2)$: \begin{itemize} \item[(H1)] $\beta (0)=0$, $\beta\in C^\infty(\mathbb{R},\mathbb{R})$; \item[(H2)] There exists $\alpha \in(1,5)$ such that for every $k\in\mathbb{N}_{0}$ there is a fixed $C_k$ with $$\left| \frac{d^k}{dv^k}\beta(v^2)\right|\le C_k \abs{v}^{\alpha-k-1} \qquad\text{for}\ \ v\in\mathbb{R},\quad \abs{v}\ge 1. $$ \end{itemize} \noindent We recall that under further hypotheses the corresponding scalar NLS \begin{equation}\label{Eq:scalNLS} \mathbbm{i} \dot u + \Delta u -\beta (|u |^2) u=0\,, \qquad u(t,x)\vert_{t=0}=u_0(x) \in \mathbb{C}, \qquad x\in \mathbb{R}^3 \end{equation} admits ground state solutions of the form $e^{\mathbbm{i}\omega t}\phi(x)$ in $H^1 (\mathbb{R}^3, \mathbb{C})$ with $\omega >0$ and $\phi(x)>0$. Here we assume what follows. \begin{itemize} \item[(H3)] There is an open interval $\mathcal{O}\subseteq (0, \infty)$ and a $C^\infty $-family \[ \mathcal{O}\ni\omega\mapsto \phi_{\omega}\in \mathop{\cap}\sb{n\in\mathbb{N}}\Sigma_{n}(\mathbb{R}^3, \mathbb{C}), \] with $ \Sigma_{n}(\mathbb{R}^3, \mathbb{C}) $ defined in \eqref{eq:sigma}, such that $\phi_{\omega}$ is a positive radial solution of \begin{equation} \label{eq:B} -\Delta u + \omega u+\beta(|u|^2)u=0\qquad\text{for $x\in \mathbb{R}^3$;} \end{equation} \item[(H4)] $\frac d {d\omega } \| \phi_{\omega }\|^2_{L^2}>0$ for $\omega\in\mathcal{O}$; \item[(H5)] Let $L_+:=-\Delta +\omega +\beta (\phi_\omega^2)+2\beta '(\phi_\omega^2) \phi_\omega^2$ with the domain $H^2 (\mathbb{R}^3,\mathbb{C})$. We assume that $L_+$ has one negative eigenvalue and that $\ker L_+ =\text{Span}\{ \partial_{x_j}\phi_{\omega}:\; j=1,2,3\}$. \end{itemize} The above hypotheses guarantee that the ground states are orbitally stable solutions of the scalar NLS \eqref{Eq:scalNLS}, see \cite{GSS2,W2}. In \cite{MR2805462,Cu3} it has been proved that, under some additional hypotheses, these ground states are asymptotically stable, in the following sense. \begin{theorem} [\mbox{Asymptotic stability of solitary waves in scalar NLS \cite{MR2805462,Cu3}}] \label{theorem-1.10} Assume (H1)--(H5) as well as a number of other hypotheses for which we refer to \cite{Cu3}. Let $\omega^0\in\mathcal{O}$. Then there exist $\epsilon_0 = \epsilon_0 (\omega^0)>0$ and $C= C (\omega^0)>0$ such that if $u $ is a solution to \eqref{Eq:scalNLS} with $u\vert_{t=0}=u_0$ and \begin{equation*} \epsilon:=\inf_{\theta \in \mathbb{R}, y_0\in \mathbb{R}^3 }\|u_0-e^{\mathbbm{i} \theta } \phi_{\omega_1 }(\cdot -y_0) \|_{H^1(\mathbb{R}^3, \mathbb{C})} <\epsilon_0, \end{equation*} then there exist $\omega_+\in\mathcal{O}$, $v_+ \in \mathbb{R}^3$, $\theta\in C^1(\mathbb{R}_+;\mathbb{R})$, $ y\in C^1(\mathbb{R}_+;\mathbb{R}^3)$ and $h_+ \in H^1(\mathbb{R}^3, \mathbb{C}) $ with $\| h_+ \|_{H^1(\mathbb{R}^3, \mathbb{C}) }+|\omega_+ -\omega^0 |+ |v_+ |\le C \epsilon $ such that \begin{equation}\label{eq:scattering0} \lim_{t\to +\infty}\|u(t)-e^{\mathbbm{i} \theta(t)+ \frac{\mathbbm{i}} 2{v_+ \cdot x} } \phi_{\omega_+} (\cdot -y(t))- e^{\mathbbm{i} t\Delta }h_+ \|_{H^1(\mathbb{R}^3, \mathbb{C}) }=0. \end{equation} \end{theorem} See \cite{MR2805462,Cu3,CM1} for more precise statements. Notice that if we substitute solitons with the 0 solution, orbital stability of 0 is obtained from local well posedness of the Cauchy problem and from the "almost" conservation in time of the $H^1$ norm form small solutions, which in many cases follows trivially from the conservation of the mass and the energy. Theorem \ref{theorem-1.10} corresponds, in this analogy with the 0 solution, to proving scattering near 0, which is an additional and always less straightforward issue, see \cite[Chapter 6]{strauss}. It is our purpose in this paper to perform a \textit{partial} extension of Theorem~\ref{theorem-1.10} to the case of solitons of the vectorial NLS \eqref{Eq:NLS}. We are not aware of analogous results in the literature to what we do here for systems of dispersive PDE's. \noindent The asymptotic stability theory which was developed in \cite{MR2805462,Cu3} exploited the fact that the group of symmetries of \eqref{Eq:scalNLS} was commutative and transitive; see also \cite{MR3053771,Cu0} where the theory is presented in a somewhat more abstract form. Among the reasons for the restrictions on the group of symmetries is the fact that in the literature modulation coordinates seem to have been used only in this case. It is also understandable that reducing the number of variables of the system in the presence of symmetries, see \cite[p. 412]{Olver}, which in \cite{MR2805462} and subsequent papers is performed by hand instead of appealing to abstract theory, is easier in the commutative case. So we need a non-obvious extension of this theory in the non-commutative situation. A general theory of orbital stability is contained in the classical study by Grillakis, Shatah and Strauss \cite{GSS2}. Although the orbital stability of NLS-like systems of the form \eqref{Eq:NLS} is addressed succinctly in \cite[Sect. 9]{GSS2}, we do not use the framework in \cite{GSS2} because central to us are the modulation coordinates in the spirit of \cite{SW1,SW2}. Let us mention that another example of class of systems with non-commutative symmetry groups is the nonlinear Dirac equation, where very few results on orbital or asymptotic stability are known, and where in particular the result closer in spirit to our theory, that is \cite{MR2924465}, deals only with classes of special symmetric solutions where the symmetry group is commutative. \bigskip In order to state our result, it will be convenient to denote by $\mathbf{C}:\;\mathbb{C}^n\to\mathbb{C}^n$ the operator of the complex conjugation on $\mathbb{C}^n$. \noindent We denote by $ {^t } {{v}}$ the transpose of $ {v}\in\mathbb{C}^n$, so that the hermitian conjugate of $v\in\mathbb{C}^n$ is given by ${^t }({\mathbf{C}v})$. For $ u,\,v \in \mathbb{C}^n$ we set $|v|^2= {^t(\mathbf{C}}v) v.$ We denote the hermitian form in $L^2(\mathbb{R}^3,\mathbb{C}^2)$ by \begin{equation} \label{eq:hermitian}\begin{aligned}& \langle u,v\rangle =\Re \int _{\mathbb{R}^3}{^t(\mathbf{C}u (x))}\,{v}(x)\,dx, \qquad u,\,v\in L^2(\mathbb{R}^3,\mathbb{C}^2), \end{aligned}\end{equation} and we consider the symplectic form \begin{equation} \label{eq:Omega} \Omega (X,Y) := \langle {\mathbbm{i}} \sigma_3 X, Y \rangle, \qquad X,\,Y\in L^2 (\mathbb{R}^3, \mathbb{C}^2). \end{equation} For $u\in H^1(\mathbb{R}^3, \mathbb{C}^2) $ we have the following functionals (the linear momenta and the charge, sometimes referred to as the mass) which are conserved in time by \eqref{Eq:NLS}: \begin{align} & {\Pi }_a(u)= 2^{-1} \langle \Diamond_a u, {u} \rangle \,, \quad \Diamond_a:=-\mathbbm{i}\sigma_3 \partial_{x_a}\text{ for $a = 1,2, 3$;}\label{eq:charge1} \\ & \Pi_4(u)= 2^{-1}\langle \Diamond_4 u, u \rangle\,, \quad \Diamond_4:={\kern+.3em {\rm 1} \kern -.22em {\rm l}} (=\text{identity operator}) ;\label{eq:charge} \end{align} see \cite[(2.6) and p. 343]{GSS2} for \eqref{eq:charge1}. We also consider the following functionals $\Pi_j$, $j=5,6,7$: \begin{equation}\label{eq:charge2} \Pi_j (u):= 2^{-1} \langle \Diamond_j u,u\rangle \text{ with } \Diamond_j:= \left\{\begin{matrix} \sigma_3\sigma_2 \mathbf{C},& j=5, \\ \mathbbm{i} \sigma_3\sigma_2 \mathbf{C}, & j=6, \\ \sigma_3,&j=7. \end{matrix}\right. \end{equation} The energy is defined as follows: for $B(0)=0$ and $B'=\beta$ we write \begin{eqnarray} \label{eq:energyfunctional} & E(u):=E_K(u)+E_P(u), \\[2ex] & E_K(u):= 2^{-1} \langle -\Delta u,{u} \rangle, \qquad E_P(u):=-2^{-1} \int_{\mathbb{R}^3}B(|u|^2)\,dx. \nonumber \end{eqnarray} It is a standard fact which can be proved like for the scalar equation \eqref{Eq:scalNLS}, for the latter see \cite{MR2002047}, that (H1)--(H2) imply local well--posedness of \eqref{Eq:NLS} in $H^1 (\mathbb{R}^3, \mathbb{C}^2)$. \noindent Consider now the column vector $\overrightarrow{e}_1= {^{t}(1,0)} $. By \eqref{eq:charge1} and (H4) the map $(\omega, v)\mapsto (\Pi_j (e^{ \sigma_3\frac{\mathbbm{i}} 2 v\cdot x }\phi_\omega \overrightarrow{e}_1))_{j=1}^{4}$ is a diffeomorphism into an open subset of $ \mathbb{R}_+\times \mathbb{R}^3$. We introduce \begin{equation}\label{def p} p=p(\omega, v)\in \mathbb{R}^7 \text{ defined by } p_j(\omega, v)= \begin{cases} \Pi_j (e^{ \sigma_3\frac{\mathbbm{i}} 2 v\cdot x }\phi_\omega \overrightarrow{e}_1), &\quad 1\le j\le 4; \\ 0, &\quad j=5,6; \\ \Pi_j (e^{ \sigma_3\frac{\mathbbm{i}} 2 v\cdot x }\phi_\omega \overrightarrow{e}_1), &\quad j=7. \end{cases} \end{equation} Notice that $ \Pi_j (e^{ \sigma_3\frac{\mathbbm{i}} 2 v\cdot x }\phi_\omega \overrightarrow{e}_1) =0$ for $j=5,6$. We denote by $\mathcal{P}$ the subset of $ \mathbb{R}^7 $ which is the image of the map $(\omega, v)\mapsto p(\omega, v)$: \begin{eqnarray}\label{def-p} \mathcal{P}= \{ p(\omega,v);\, \omega\in\mathcal{O}, \ v\in\mathbb{R}^3 \}. \end{eqnarray} For $p=p(\omega, v)\in \mathcal{P}$, we set \begin{equation}\label{eq:defPhi} \Phi _{p}(x):=e^{\frac{\mathbbm{i}} 2v\cdot x } \phi_\omega (x) \overrightarrow{e}_1 \end{equation} and \begin{equation}\label{eq:lambda0} \lambda (p) =(\lambda_1(p),..., \lambda_7(p)) \in \mathbb{R}^7 \text{ defined by } \lambda_j(p):= \begin{cases} -v_j,& 1\le j\le 3; \\ -\omega - \frac{v^2}4, \quad & j=4; \\ 0,& j\ge 5. \end{cases} \end{equation} An elementary computation shows that \begin{equation}\label{eq:solw0} u(t):= e^{- {\mathbbm{i}} \sigma_3 t \lambda (p) \cdot \Diamond}\Phi_p = \begin{bmatrix} e^{{\mathbbm{i}} t \left (\omega + \frac{v^2}{4} \right) } e^{\frac{\mathbbm{i}} 2v\cdot (x -tv) } \phi_\omega (x-tv) \\ 0 \end{bmatrix}. \end{equation} This function belongs to a class of solutions of \eqref{Eq:NLS} and our aim is to prove for this class a result similar to Theorem~\ref{theorem-1.10}. \noindent The group $\mathbf{SU}(2)$ can be represented by \begin{equation} \label{eq:su2} \mathbf{SU}(2) =\left \{ \begin{bmatrix} a&b\\- \mathbf{C} b& \mathbf{C} a \end{bmatrix} :\; (a,b) \in \mathbb{C}^2 \text{ such that } \abs{a}^2+\abs{b}^2=1 \right \}. \end{equation} Given two Banach spaces $\mathbb{X}$ and $\mathbb{Y}$ let $B(\mathbb{X},\mathbb{Y})$ be the Banach space of bounded linear transformations from $\mathbb{X}$ to $\mathbb{Y}$. We consider the group \begin{equation*} \mathbf{G}= \mathbb{R}^3 \times \mathbb{T}\times \mathbf{SU}(2) \end{equation*} and the representation $T:\mathbf{G}\to B (H^1 (\mathbb{R}^3, \mathbb{C}^2), H^1 (\mathbb{R}^3, \mathbb{C}^2))$ defined by \begin{equation}\label{eq:rep1} T(g) u_0 := e^{{\mathbbm{i}} \sigma_3 \sum_{j=1}^{4}\tau_j \Diamond_j} (a +b \sigma_2\mathbf{C})u_0 \text{ for } g= \left (\tau_1,\tau_2, \tau_3,\tau_4, \begin{bmatrix} a&b\\-\mathbf{C} b&\mathbf{ C} a \end{bmatrix} \right). \end{equation} \begin{lemma} \label{lem:cons0} We have the following facts. \begin{itemize} \item[(1)] The action of $\mathbf{G}$ given by \eqref{eq:rep1} preserves the symplectic form $\Omega$ defined in \eqref{eq:Omega}. \item[(2)] The action \eqref{eq:rep1} preserves the invariants $\Pi_j$ for $1\le j\le 4$ and $E$. \item[(3)] The functionals $\Pi_j$, $1\le j\le 7$, and the energy $E $ are conserved by the flow of \eqref{Eq:NLS} in $H^1 (\mathbb{R}^3, \mathbb{C}^2)$. \end{itemize} \end{lemma} \proof (1) follows from the commutation $[{\mathbbm{i}} \sigma_3, a+b\sigma_2\mathbf{C} ]=0$. (2) is a consequence of \begin{equation*} \begin{aligned} &\abs{ (a+b\sigma_2\mathbf{C})u}^2 = \Re {^t(\mathbf{C}u)} ((\mathbf{C} a)+\mathbf{C}\sigma_2(\mathbf{C} b)) (a+b\sigma_2\mathbf{C})u \\&= (\abs{a}^2+\abs{b}^2) \abs{u}^2 + \Re {^t(\mathbf{C}u)} ((\mathbf{C} a) b\sigma_2\mathbf{C}+\mathbf{C}\sigma_2 a \mathbf{C} b) u =\abs{u}^2. \end{aligned} \end{equation*} The fact that the functionals $\Pi_j$, $1\le j\le 4$, and the energy $E $ are preserved by the flow of \eqref{Eq:NLS} is standard. To deal with the cases $j=5, 6,7$, we first recall that the Lie algebra of $\mathbf{SU}(2)$ can be written as $\mathbf{su}(2) = \mathop{\mathrm{Span}} \left(\mathbbm{i}\sigma_i,\,1\le i\le 3\right)$. We have \[ \frac{d}{dt} \left.T(e^{-{\mathbbm{i}}t \sigma_i})\right |_{t=0} u_0 = \begin{cases} \frac{d}{dt} \left. (\cos (t)-{\mathbbm{i}} \sin (t) \sigma_2 \mathbf{C}) u_0 \right |_{t=0} =-{\mathbbm{i}} \sigma_2 \mathbf{C} u_0, & i=1; \\ \frac{d}{dt} \left. (\cos (t)+ \sin (t) \sigma_2 \mathbf{C}) u_0 \right |_{t=0} = -\sigma_2 \mathbf{C} u_0, & i=2; \\ \frac{d}{dt} \left. e^{-{\mathbbm{i}}t} u_0 \right |_{t=0} = -{\mathbbm{i}} u_0, & i=3. \end{cases} \] By an elementary argument \cite[line 5 p.313]{GSS2}, which is based on the fact that $\mathbf{G}$ preserves $E$ and the symplectic form, the quadratic forms $u_0\mapsto \left\langle {\mathbbm{i}} \sigma_3\frac{d}{dt} \left.T(e^{-{\mathbbm{i}} \sigma_it})\right |_{t=0} u_0,u_0 \right\rangle$, $1\le i\le 3$, which coincide with the $\Pi _{4+i}(u_0) $ in \eqref{eq:charge2}, are preserved by \eqref{Eq:NLS}. \qed \begin{remark}\label{rem:repr1} From the identification $\mathbb{C}^2=\mathbb{R}^4$ there is a natural inclusion $ \mathbf{SU}(2)\subseteq \mathrm{SO}(4)$. By \eqref{eq:su2} there is a natural identification of elements $ \mathbf{a} \in \mathbf{SU}(2)$ with elements of the unit sphere $\widetilde{ {{\mathbf{a}}}}\in S^3 \subset \mathbb{R}^4$ so that the action of $ {\mathbf{a}}\in \mathbf{SU}(2) $ on $ {\mathbf{v}}\in \mathbb{R}^4$ is nothing else but the product of quaternions, ${\mathbf{v}}\widetilde{ {{\mathbf{a}}}}$. Similarly, by elementary computations it is possible to see that $ (a +b \sigma_2\mathbf{C}){\mathbf{v}} =\widehat{ {{\mathbf{a}}}}{\mathbf{v}} $ for all $\mathbf{v}\in \mathbb{R}^4$ for an appropriate $\widehat{ {{\mathbf{a}}}}\in S^3$. \noindent Within the framework of \cite{GSS2} when applied to \eqref{Eq:NLS}, a central role is played by the centralizer of the group $\{e^{ \tau_4{\mathbbm{i}} \sigma_3};\,\tau_4\in\mathbb{R}\}$ inside $\mathbb{R}^3\times \mathrm{SO}(4)$. Using \cite[p. 111]{wolf}, it can be shown that the centralizer has as one connected component the group $\mathbf{G}$ acting as in \eqref{eq:rep1}. A simple consequence of Lemma \ref{lem:kernel}, see also Remark \ref{assumption 3} below, is that \cite[Assumption 3]{GSS2} is satisfied for this centralizer, a fact that does not follow from the discussion in \cite[Section 9]{GSS2}. \end{remark} We will prove the following partial extension of Theorem~\ref{theorem-1.10}. In the following statement and in the rest of the paper, $\Pi = \left. (\Pi_j) \right |_{j=1}^{7}$, with the invariants $\Pi_j$ introduced in \eqref{eq:charge1}, \eqref{eq:charge}, and \eqref{eq:charge2}. \begin{theorem}\label{theorem-1.1} Assume (H1)--(H5) stated above, (H6)--(H8) stated in Section~\ref{sec:speccoo}, and (H9) stated in Section~\ref{sec:system}. Let $\omega^0\in\mathcal{O}$ and consider the corresponding point $p^0=p(\omega^0,0)\in \mathcal{P}$, with $\mathcal{P}$ defined in \eqref{def-p}, and the solitary wave $\Phi_{p^0}$ of the form \eqref{eq:defPhi} characterized by the vector of invariants of motion $\Pi (\Phi_{p^0})=p^0$. Then there exist $\epsilon_0 = \epsilon_0 (\omega^0)>0$ and $C= C (\omega^0)>0$ such that if $u $ solves \eqref{Eq:scalNLS} with $u\vert_{t=0}=u_0$, \begin{equation}\label{def:epsilon} \epsilon:=\inf_{ g\in \mathbf{G} }\|u_0- T(g)\Phi _{p^0} \|_{H^1(\mathbb{R}^3, \mathbb{C}^2)}<\epsilon_0, \end{equation} and moreover \begin{eqnarray}\label{boxed} \Pi (u_0) = p^0, \end{eqnarray} then there exist $p_+\in\mathcal{P}$, $ g\in C^1(\mathbb{R}_+, \mathbf{G})$ and $h_+ \in H^1(\mathbb{R}^3, \mathbb{C}^2) $ with $\| h_+ \|_{H^1(\mathbb{R}^3, \mathbb{C}^2) }+|p_+ -p^0 | \le C \epsilon $ such that \begin{equation}\label{eq:scattering} \lim_{t\to +\infty} \|u(t)- T(g(t)) \Phi_{p_+} - e^{ - {\mathbbm{i}} \sigma_3 \Delta t} h_+ \|_{H^1(\mathbb{R}^3, \mathbb{C}^2) }=0. \end{equation} \end{theorem} \begin{remark}\label{rem:restr} Here the reason that Theorem~\ref{theorem-1.1} is only a partial extension of Theorem~\ref{theorem-1.10} is that, to simplify the proof, we impose the additional restriction \eqref{boxed} that the initial data satisfies ${\Pi (u_0) = p^0}$, that is, the perturbation $u_0$ has the same values of the invariants of motion as the initial solitary wave. \end{remark} We are not aware of similar results in the literature for systems of PDE's. Papers such as \cite{boussaid,PelinovskyStefanov,MR2924465} treat special cases of the Dirac Equation which don't touch the novel issues treated here. The proof of Theorem~\ref{theorem-1.1} goes along the lines of the proof of Theorem~\ref{theorem-1.10}. If we look at the analogous classical problem of the asymptotic stability of the equilibrium $0$ for a system $\dot r =Ar +g (r)$, where $g (r)=o(r)$ at $r=0$ and with a matrix $A$, of key importance is the location of the spectrum $\sigma (A)$. In particular, stability requires that if $\varsigma \in \sigma (A)$ then $\Re \varsigma\le 0$. Isolated eigenvalues on the imaginary axis correspond to central directions whose contribution to stability or instability can be ascertained only analyzing the nonlinear system, and not just the linearization $\dot r =Ar $. This classical framework is also used for Theorems~\ref{theorem-1.10} and~\ref{theorem-1.1}. First of all, an appropriate expansion of $u$ at the ground states (see Lemma~\ref{lem:modulation} below) gives us the variable $r$. The analogue of $A$ is given by \eqref{eq:lincom}. In our case the spectrum is all contained in the imaginary axis, but the continuous spectrum, thanks to dispersion, plays the same role of the stable spectrum of $A$, along the lines described in pp. 36--37 of Strauss's introduction to nonlinear wave equations \cite{strauss}. The discrete spectrum of \eqref{eq:lincom} plays the role of central directions. The nonlinear mechanism acting on the corresponding discrete modes and responsible for the stabilization indicated in \eqref{eq:scattering} and \eqref{eq:scattering0} has been termed \textit{Nonlinear Fermi Golden Rule} in \cite{sigal} and has been explored initially in \cite{MR1334139,SW3}. A detailed description, by means of some elementary example, can be found in \cite[Introduction]{CM4}. For a different perspective see also \cite{W3}. The same mechanisms described in \cite{CM4} and used in \cite{MR3053771,MR2843104,MR1334139,MR2805462, Cu3,CM1,SW3} and in a number of other papers referenced therein, are applied here to prove Theorem~\ref{theorem-1.1}. The novel difficulty occurs at the beginning, with the choice of modulation. Here the novelty of this paper is the idea of using the representation \eqref{eq:rep1}. The rest of the paper is not very different from \cite{MR2805462,Cu0,Cu3,CM1}. In the course of the proof there are some difficulties related to the fact that the Lie algebra of $\mathbf{G}$ is not commutative, and correspondingly, the Poisson brackets $\{ \Pi_j, \Pi_l \}$ are not identically zero like in the earlier papers. And this also accounts for the restriction $ {\Pi (u_0) = p^0}$ in Theorem~\ref{theorem-1.1}. While in \cite{MR2805462,Cu0, Cu3,CM1} the choice of Darboux coordinates and subsequent normal forms arguments occur inside an open subset of the original space $H^1(\mathbb{R}^3, \mathbb{C}^2)$, in the present paper we simplify the argument by considering the reduced manifold, see \cite[Ch. 6]{Olver}. Having done these reductions, which fully exploit the fact that we have fixed the values of the $\Pi_j= \Pi_j(u_0)$ (in other words, the fact that we are in a subset of $H^1(\mathbb{R}^3, \mathbb{C}^2)$ which is a fiber of the \textit{momentum map}), to eliminate this restriction and recover a full analogue of Theorem~\ref{theorem-1.10} we would need to take care of the fact that the constant $\epsilon_0>0$ in Theorem~\ref{theorem-1.1}, which in principle depends on the values $ \Pi_j(u_0)$, can in fact be chosen uniform in the values of $ \Pi_j(u_0)$. In a somewhat different and simpler setting, this uniformity is proved in \cite{CM1}. Here we have decided to avoid this issue. \bigskip We now briefly state list the contents of the paper. In Section~\ref{sec:mod} we choose the modulation coordinates, we compute some differentials, and make the first adjustment to the modulation coordinates writing the system in terms of them, see \eqref{eq:K}. In Section~\ref{sec:expansion} we modify the hamiltonian in a standard fashion introducing a new hamiltonian $K$ and write a Taylor expansion of $K$ around the soliton in terms of the coordinates. This is essential because the main step of the proof, being a normal forms argument, see \cite[Sect. 1.8]{hofer}, consists in choosing coordinates where some of the terms of the Taylor expansion have disappeared. In Section~\ref{sec:symplectic1} we express $\Omega =d\Gamma$ in terms of an appropriate 1-form $B$, and then we express $\Gamma$ in terms of the coordinates. In Section~\ref{sect:restrK} we introduce two important classes of functions and we write the Taylor expansion of $K$ on the manifold $\Pi_j=p^0_j$, $1\le j\le 4$. In Section~\ref{sect:flows} we state a result about flows generated by vector fields whose coefficients are functions of the type introduced in Section~\ref{sect:restrK}, and in Section~\ref{sect:pullback} we write how these flows act on the hamiltonian $K$. In Section~\ref{sect:darboux1} we start by restricting further and imposing $\Pi_j =p^0_j$ for $j\le 7$. This allows to freeze all coordinates except for the coordinate denoted by $r$. However it imposes also a nonlinear constraint on $r$, which thus belongs to a manifold invariant for the hamiltonian flow generated by $K$. On the points of this manifolds the symplectic form coincides with a simpler symplectic form. On the manifold the two hamiltonian fields of $K$ are the same. To simplify the discussion we allow now $r$ to vary in the whole spaces, which is endowed with the simpler symplectic form. We make the first change of variables, simplifying further the symplectic form. In Section~\ref{sec:speccoo} we decompose $r$ in terms of the spectral decomposition of the linearization of the $NLS$ at the standing wave. We write the symplectic form in terms of the new coordinates and then we make a further change of coordinates to further simply the symplectic form, which is the final symplectic form, before we start to perform a normal forms argument on $K$. In Section~\ref{sec:Normal form} we perform the normal forms argument. In Section~\ref{sec:system} we prove scattering of the continuous modes and Nonlinear Fermi Golden Rule for the discrete modes. Finally in Section~\ref{sec:end} we complete the proof of Theorem~\ref{th:main}. The changes of coordinates are continuous inside $H^1(\mathbb{R}^3, \mathbb{C}^2)$, but they are not $C^1$, so that pulling back the symplectic in principle makes no sense. However the coordinate changes are $C^1$ for example from $\Sigma_1 (\mathbb{R}^3, \mathbb{C}^2)$, see \eqref{eq:sigma}, to $L^2 (\mathbb{R}^3, \mathbb{C}^2)$. There is a fixed but possibly large number of these coordinate changes. This means that when we want to understand a solution of \eqref{Eq:NLS} looking at it in the best coordinate system, it has to involve an initial datum quite regular and quickly decaying to zero as $|x|\to \infty$, in order for it to be in the image of the maps. However what allows to capture also the solutions which initially are just in $H^1(\mathbb{R}^3, \mathbb{C}^2)$ is the well-posedness of the hamiltonian system in each of the coordinates spaces (where it makes sense in $H^1(\mathbb{R}^3, \mathbb{C}^2)$) and the fact that the coordinate changes are continuous in the $H^1(\mathbb{R}^3, \mathbb{C}^2)$ setting. \section{Modulation}\label{sec:mod} Before introducing the modulation coordinates we consider some notation. \noindent For $\varsigma\in \mathbb{C}^n$ we consider the Japanese Bracket $\langle \varsigma \rangle =\sqrt{1+|\varsigma |^2}$. \noindent We introduce some spaces that will be used later in the proof. Let $m,\,k,\,s\in\mathbb{R}$. Given a Banach space $\mathbb{E}$ and functions $\mathbb{R}^3\to \mathbb{E}$, we denote by $\Sigma_m(\mathbb{R}^3,\mathbb{E}) $ and $H^{ k,s}(\mathbb{R}^3,\mathbb{E})$ the Banach spaces with the norms \begin{eqnarray}\label{eq:sigma} && \| u \|_{\Sigma_m}^2:= \| \big\langle \sqrt{-\Delta +|x|^2}\, \big\rangle^{m} u \|_{L^2(\mathbb{R}^3,\mathbb{E})}^2, \\[1ex] && \label{eq:weigt} \| f\|_{H^{k,s}(\mathbb{R}^3,\mathbb{E})}:=\| \langle x \rangle^s \big\langle \sqrt{-\Delta } \,\big\rangle^{k} f \|_{L^2(\mathbb{R}^3,\mathbb{E})}, \end{eqnarray} where we will use mostly $\mathbb{E} =\mathbb{C}^2$. We next recall the following basic notions. \begin{definition} Given a differentiable function $F$, the Hamiltonian vector field corresponding to $F$ with respect to a {strong} symplectic form $\Omega $ is the field $X_F $ such that $ \Omega (X_F,Y)= dF (Y)$ for any tangent vector $Y $, with $dF$ the Fr\'echet derivative. \noindent For $F,G $ differentiable functions their Poisson bracket is $ \{ F,G \} := dF (X_G) $ if $G$ is scalar valued and $F$ is either scalar or has values in a Banach space $\mathbb{E}$. \end{definition} \noindent We denote by $dE$ the Fr\'echet derivative of the energy functional $E$ introduced in \eqref{eq:energyfunctional}. We define $ \nabla {E}$ by $dEX= \langle \nabla {E}, {X} \rangle$. Notice that $ \nabla {E}\in C^1 (H^1(\mathbb{R}^3, \mathbb{C}^2), H^{-1}(\mathbb{R}^3, \mathbb{C}^2))$, that \begin{equation}\label{eq:graden} \nabla {E}(u) =-\Delta u +\beta(|u|^2) u \end{equation} and henceforth \eqref{Eq:NLS} can be written as \begin{equation}\label{eq:graden-dot} \dot u =-{\mathbbm{i}}\sigma_3 \nabla {E}(u) = X_{E} (u), \end{equation} that is, as a hamiltonian system with hamiltonian $E$. Notice that $\nabla \Pi_j(u) =\Diamond_j u$ for $j=1\le j\le 7$ and that \begin{equation}\label{eq:eqphi} \nabla E (\Phi_{ p })- \sum_{j=1}^{7}\lambda_j (p) \Diamond_j\Phi_{ p } =0. \end{equation} The following lemma is elementary. \begin{lemma}\label{lem:Tmanifold} The following 10 vectors are linearly independent over $\mathbb{R}$: \begin{equation}\label{eq:Tmanifold} \partial_{p_1}\Phi _{p},\ \partial_{p_2}\Phi _{p},\ \partial_{p_3}\Phi _{p}, \ \partial_{p_4}\Phi _{p}, \ \partial_{x_1}\Phi _{p},\ \partial_{x_2}\Phi _{p},\ \partial_{x_3}\Phi _{p},\ {\mathbbm{i}} \sigma_2 \mathbf{C} \Phi _{p}, \ \sigma_2 \mathbf{C} \Phi _{p}, \ {\mathbbm{i}} \Phi _{p}. \end{equation} \end{lemma} \qed \noindent We will consider the operator ${\mathcal H}_{p}:= -{\mathbbm{i}} \sigma_3(\nabla^2 E(\Phi_{p})- \lambda (p) \cdot \Diamond) $. This is the linearization operator which plays a key role in the proof. Notice that by $\lambda (p(\omega,0)) \cdot \Diamond =-\omega $ we have \begin{equation} \label{eq:lincom} \begin{aligned} & {\mathcal H}_{p(\omega,0)} \begin{pmatrix} u_1 \\ u_2 \end{pmatrix} = - \begin{pmatrix}{\mathbbm{i}} \mathfrak{L}^{(1)}_{\omega }u_1 \\ - {\mathbbm{i}} \mathfrak{L}^{(2)}_{\omega }u_2 \end{pmatrix}, \quad \text{ where }\\& \mathfrak{L}^{(1)}_{\omega }u_1= - \Delta u_1 + \beta (\phi_{\omega}^2) u_1+ 2 \beta ' (\phi_{\omega}^2)\Re (u_1) + \omega u_1, \\& \mathfrak{L}^{(2)}_{\omega }u_2 =-\Delta u_2 + \beta (\phi_{\omega}^2) u_2+ \omega u_2. \end{aligned} \end{equation} An important fact, emphasized everywhere in the literature, is that ${\mathcal H}_{p}$ is $\mathbb{R}$-linear but not $\mathbb{C}$-linear, see \cite{MR1199635,MR1835384}. For this reason we interpret $H^1(\mathbb{R}^3, \mathbb{C}^2)$ as a vector space over $\mathbb{R}$ (later, see Section~\ref{sec:speccoo}, we perform a complexification). The following lemma is very important. \begin{lemma}\label{lem:kernel} The generalized kernel $N_g ({\mathcal H}_{ p(\omega,0)}) :=\cup_{j=1}^{\infty} \ker ({\mathcal H}_{ p(\omega,0)})^{j} $ coincides with the 10-dimensional vector space over $\mathbb{R}$, spanned by the vectors in \eqref{eq:Tmanifold}, with $p=p(\omega,0)$. \end{lemma} \proof First of all $\mathfrak{L}^{(i)}_{\omega }$ for $i=1,2$ are decoupled, so that it is enough to consider them separately. We have the following, which is a well-known fact about ground states, see for example \cite[Sect.XIII.12]{RS4}: \begin{equation*} \ker ({\mathbbm{i}} \mathfrak{L}^{(2)}_{\omega })=N_g({\mathbbm{i}} \mathfrak{L}^{(2)}_{\omega }) =\text{Span} \{ {\mathbbm{i}} \phi_{\omega}, \phi_{\omega} \}. \end{equation*} The following is a well-known consequence of (H4)--(H5) derived by M. Weinstein in his thesis, see \cite{W2}: \begin{equation*} \begin{aligned} & \ker ({\mathbbm{i}} \mathfrak{L}^{(1)}_{\omega }) =\text{Span} \{ {\mathbbm{i}} \phi_{\omega}, \left. \partial_{x_a}\phi_{\omega} \right |_{a=1}^{3} \}, \\& N_g(\mathfrak{L}^{(1)}_{\omega }) = \ker ({\mathbbm{i}} \mathfrak{L}^{(1)}_{\omega })^2 = ({\mathbbm{i}} \ker \mathfrak{L}^{(1)}_{\omega })\oplus \text{Span} \{ \left. \partial_{p_j} e^{\frac{\mathbbm{i}}2v\cdot x }\phi_{\omega} \right |_{j=1}^{4} \}. \end{aligned} \end{equation*} These facts yield the statement. \qed \begin{remark}\label{assumption 3} Recall that \cite[Assumption 3]{GSS2} asks that the space $Z$ defined as follows \begin{equation*} Z:=\left \{ \frac{d}{dt} \left.\widetilde{T}(e^{t\varpi}) \Phi_{ p(\omega,0)}\right |_{t=0} :\; \varpi\in \mathbb{R}^3\times so(4) \text{ commutes in $\mathbb{R}^3\times so(4)$ with ${\mathbbm{i}} \sigma_3$} \right \} \end{equation*} be $Z=\ker ({\mathcal H}_{ p(\omega,0)})$, where for $\varpi\in \mathbb{R}^3$ we have $\widetilde{T}(e^{t\varpi})= {T}(e^{t\varpi}) $ and for $\varpi \in so(4)$ we set $\widetilde{T}(e^{t\varpi}) w = e^{t\varpi} w $ for any $w\in \mathbb{R}^4$, with the usual product row column $ so(4)\times \mathbb{R} ^4\to \mathbb{R} ^4$. \noindent Notice that always $Z\subseteq\ker ({\mathcal H}_{ p(\omega,0)})$, see \cite[Lemma 2.2]{GSS2}. Lemma~\ref{lem:kernel} yields the equality and shows that \cite[Assumption 3]{GSS2} holds for the system \eqref{Eq:NLS} with the solitary waves \eqref{eq:solw0}. Notice that \cite[Assumption 1]{GSS2}, i.e. the local well posedness of \eqref{Eq:NLS}, is true and that \cite[Assumption 2]{GSS2}, about bound states, is true under our hypothesis (H3). Other hypotheses needed in \cite{GSS2}, that is the fact that the centralizer of ${\mathbbm{i}} \sigma_3$, or at least its connected component containing the unit element, in $\mathbb{R}^3\times SO(4)$ act by symplectomorphisms for the symplectic form \eqref{eq:Omega}, see \cite[formula (2.4)]{GSS2}, and that it leaves the energy invariant, see \cite[formula (2.1)]{GSS2}, follow from Lemma \ref{lem:cons0}, see also Remark \ref{rem:repr1}. So the hypotheses required to apply the theory in \cite{GSS2} for\eqref{Eq:NLS} and the group $\mathbf{G}$ are true, and in particular we can conclude that the bound states \eqref{eq:solw0} are orbitally stable. \end{remark} We consider the ``solitary manifold'' \begin{equation} \label{eq:manifold0} \begin{aligned} \mathcal{M} :&= \left\{ e^{{\mathbbm{i}} \sigma_3 \sum_{j=1}^{4}\tau_j \Diamond_j} (a +b \sigma_2 \mathbf{\mathbf{C}}) \Phi _{p}(x) :\; \tau \in \mathbb{R}^3\times \mathbb{T}, \ \begin{bmatrix} a&b\\- \mathbf{C} b& \mathbf{C } a \end{bmatrix} \in \mathbf{SU}(2),\ p \in \mathcal{P} \right\}\,. \end{aligned} \end{equation} Lemma~\ref{lem:Tmanifold} implies that there is $\varepsilon_0>$ such that for any $k>0$ the map \begin{eqnarray} & \text{ in } C^\infty (\mathbb{D}_{\mathbb{C}}(0,\varepsilon_0) \times \mathcal{P}\times \mathbb{T} \times \mathbb{R}^3, \Sigma_k (\mathbb{R}^3,\mathbb{C}^2))\text{ given by } \nonumber \\[1ex] & (b,p, \tau) \mapsto e^{{\mathbbm{i}} \sigma_3 \sum_{j=1}^{4} \tau_j \Diamond_j} \big(\sqrt{1-|b|^2} +b\sigma_2 \mathbf{C} \big) \Phi_{p}, \nonumber \end{eqnarray} is an embedding. This implies that $\mathcal{M} $ is a manifold. Furthermore it is a symplectic submanifold of $L^2(\mathbb{R}^3, \mathbb{C}^2)$, with the symplectic structure given by $j^*(\Omega)$, the pullback of the symplectic form $\Omega$ with respect to the embedding $j:\mathcal{M} {\hookrightarrow}L^2(\mathbb{R}^3, \mathbb{C}^2)$. This follows from \begin{equation*}\begin{aligned} & \Omega ({\mathbbm{i}} \sigma_2 \mathbf{C} \Phi _{p}, \sigma_2 \mathbf{C} \Phi _{p}) =p_4, \\& \Omega (\partial_{p_a}\Phi _{p}, \partial_{x_a}\Phi _{p}) = 2^{-1} \partial_{p_a}\langle \Phi_{p }, \Diamond_{a} \Phi_{p }\rangle = \partial_{p_a}p_a =1 \text{ for $a=1,2,3$}, \\& \Omega (\partial_{p_4}\Phi _{p}, {\mathbbm{i}} \Phi _{p}) = 2^{-1} \partial_{p_4} \langle {\mathbbm{i}} \sigma_3 \Phi_{p },{\mathbbm{i}} \Phi_{p } \rangle = \partial_{p_4}p_4 =1, \end{aligned} \end{equation*} and from the fact that all other pairs of vectors from \eqref{eq:Tmanifold} are symplectically orthogonal. \noindent We have $\displaystyle T_{ \Phi _{p} }\mathcal{M} \subset \mathcal{S}(\mathbb{R}^3, \mathbb{C}^2) = \cap_{m\in \mathbb{R} }\Sigma_{m}(\mathbb{R}^3, \mathbb{C}^2) $ (the space of Schwartz functions). It remains defined a bilinear form \begin{equation*} \Omega :\; \mathcal{S}(\mathbb{R}^3, \mathbb{C}^2) \times \mathcal{S}'(\mathbb{R}^3, \mathbb{C}^2) \to \mathbb{R} \end{equation*} from which we can define the subspace $ T_{\Phi _{p} }^{\perp_\Omega}\mathcal{M} \subseteq \mathcal{S}'(\mathbb{R}^3, \mathbb{C}^2)= \cup_{m\in \mathbb{R} }\Sigma_{m}(\mathbb{R}^3, \mathbb{C}^2)$ (the space of tempered distributions dual to $ \mathcal{S}(\mathbb{R}^3, \mathbb{C}^2)$). $\Omega $ also defines a bilinear form \begin{equation*} \Omega :\; \Sigma_n (\mathbb{R}^3, \mathbb{C}^2) \times \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2) \to \mathbb{R}. \end{equation*} This yields the decomposition \begin{equation}\label{eq:dirsumn} \begin{aligned} & \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2) = T_{ \Phi_{p} }\mathcal{M} \oplus (T_{\Phi_{p} }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2)). \end{aligned} \end{equation} We denote by $\widehat{P}_{ p} $ and $ {P}_{{ p} }$ the projections onto the first and second term of the direct sum, respectively: \begin{eqnarray} \label{def-widehat-p} && \widehat{P}_{ p}:\; \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2) \to T_{ \Phi_{p} }\mathcal{M}, \\ && {P}_{{ p} }:\; \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2) \to T_{\Phi_{p} }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{-n}(\mathbb{R}^3, \mathbb{C}^2). \end{eqnarray} A special case of \eqref{eq:dirsumn} is \begin{equation}\label{eq:dirsum} \begin{aligned} & L^2(\mathbb{R}^3, \mathbb{C}^2) = T_{ \Phi _{p} }\mathcal{M} \oplus (T_{\Phi _{p} }^{\perp_\Omega}\mathcal{M} \cap L^2(\mathbb{R}^3, \mathbb{C}^2)). \end{aligned} \end{equation} Notice that the map $p\mapsto \widehat{{P}}_{{p}}$ is an element of \begin{equation}\label{eq:ptilde1} \begin{aligned} & C^\infty(\mathcal{P},B(\Sigma_{-n}(\mathbb{R}^3,\mathbb{C}^2),\Sigma_{n}(\mathbb{R}^3,\mathbb{C}^2))), \quad\text{ for any $n\in \mathbb{Z}$.} \end{aligned} \end{equation} Indeed, if we denote by $( e_{i})\left . \right | _{i=1}^{10}$ the 10 vector fields in \eqref{eq:Tmanifold}, which belong to $C^\infty(\mathcal{P}, \Sigma_{-n}(\mathbb{R}^3,\mathbb{C}^2))$ for any $n$, and if we denote by $A=\{ a _{ij}\} $ the inverse matrix to $ \{ \Omega ( e_i, e_j) \} $, then \begin{equation*} \widehat{{P}}_{{p}} =\sum _{i,j=1,...,10}e_i \ a _{ij}\ \Omega ( e_j, \cdot ) . \end{equation*} We will use later the following elementary lemma. \begin{lemma} \label{lem:lambdas1} Set $u= (\sqrt{1-|b|^2} +b \sigma_2 \mathbf{\mathbf{C}}) \psi $. Then for $b_R=\Re (b)$ and $b_I=\Im (b)$ we have \begin{equation}\label{eq:lambdas11} \begin{aligned} & \Pi_{5}(u)= (1-2b_R^2) \Pi_{5}(\psi) -2b_I b_R \Pi_{6}(\psi) -2 \sqrt{1-|b|^2} b_R \Pi_{7}(\psi), \\& \Pi_{6}(u)= -2b_I b_R \Pi_{5}(\psi) +(1-2b_I^2) \Pi_{6}(\psi) -2 \sqrt{1-|b|^2} b_I \Pi_{7}(\psi), \\& \Pi_{7}(u)= 2 \sqrt{1-|b|^2}b_R \Pi_{5}(\psi) +2 \sqrt{1-|b|^2} b_I \Pi_{6}(\psi) + (1-2|b|^2) \Pi_{7}(\psi). \end{aligned} \end{equation} \end{lemma} \proof We have \begin{equation*} \begin{aligned} & 2\Pi_{5}(u)= \langle \sigma_3 \sigma_2 \mathbf{C}u,u \rangle = \langle (\sqrt{1-|b|^2} -b \sigma_2 \mathbf{C}) \sigma_3 \sigma_2 \mathbf{C}(\sqrt{1-|b|^2} +b \sigma_2 \mathbf{C}) \psi,\psi \rangle\\& = \langle \sigma_3 \sigma_2 (\sqrt{1-|b|^2} -b \sigma_2 \mathbf{C}) (\sqrt{1-|b|^2} - (\mathbf{C} {b}) \sigma_2 \mathbf{C}) \mathbf{C}\psi,\psi \rangle \\& = \langle \sigma_3 \sigma_2 \left [ ({1-|b|^2} + b \sigma_2 \mathbf{C} (\mathbf{C} {b})\sigma_2 \mathbf{C}) - \sqrt{1-|b|^2} (b+ (\mathbf{C} {b})) \sigma_2 \mathbf{C} \right ] \mathbf{C}\psi,\psi \rangle \\& = \langle \sigma_3 \sigma_2 \left [ {1-b_R^2-\cancel{b_I^2}} - (b_R^2-\cancel{b_I^2}+2{\mathbbm{i}} b_R b_I) - 2 \sqrt{1-|b|^2} b_R \sigma_2 \mathbf{C} \right ] \mathbf{C}\psi,\psi \rangle \\& = (1-2b_R^2) \langle \sigma_3 \sigma_2 \mathbf{C}\psi,\psi \rangle -2b_R b_I \langle {\mathbbm{i}} \sigma_3 \sigma_2 \mathbf{C}\psi,\psi \rangle - 2 \sqrt{1-|b|^2} b_R \langle \sigma_3 \psi,\psi \rangle. \end{aligned} \end{equation*} This yields the formula for $ \Pi_{5}(u)$. By a similar computation \begin{equation*} \begin{aligned} & 2\Pi_{6}(u)= \langle {\mathbbm{i}} \sigma_3 \sigma_2 \mathbf{C}u,u \rangle = \langle (\sqrt{1-|b|^2} -b \sigma_2 \mathbf{C}) {\mathbbm{i}} \sigma_3 \sigma_2 \mathbf{C}(\sqrt{1-|b|^2} +b \sigma_2 \mathbf{C}) \psi,\psi \rangle\\& = \langle {\mathbbm{i}} \sigma_3 \sigma_2 (\sqrt{1-|b|^2} +b \sigma_2 \mathbf{C}) (\sqrt{1-|b|^2} - (\mathbf{C} {b}) \sigma_2 \mathbf{C}) \mathbf{C}\psi,\psi \rangle \\& = \langle {\mathbbm{i}} \sigma_3 \sigma_2 \left [ ({1-|b|^2} - b \sigma_2 \mathbf{C} (\mathbf{C} {b}) \sigma_2 \mathbf{C}) + \sqrt{1-|b|^2} (b- (\mathbf{C} {b})) \sigma_2 \mathbf{C} \right ] \mathbf{C}\psi,\psi \rangle \\& = \langle {\mathbbm{i}} \sigma_3 \sigma_2 \left [ {1-\cancel{b_R^2}-b_I^2 } +\cancel{b_R^2}- {b_I^2}+2{\mathbbm{i}}b_R b_I + 2 {\mathbbm{i}} \sqrt{1-|b|^2} b_I \sigma_2 \mathbf{C} \right ] \mathbf{C}\psi,\psi \rangle \\& = (1-2b_I^2) \langle {\mathbbm{i}} \sigma_3 \sigma_2 \mathbf{C}\psi,\psi \rangle -2b_R b_I \langle \sigma_3 \sigma_2 \mathbf{C}\psi,\psi \rangle - 2 \sqrt{1-|b|^2} b_I \langle \sigma_3 \psi,\psi \rangle. \end{aligned} \end{equation*} This yields the formula for $\Pi_{6}(u)$. Finally, \begin{equation*} \begin{aligned} & 2\Pi_{7}(u)= \langle \sigma_3 u,u \rangle = \langle (\sqrt{1-|b|^2} -b \sigma_2 \mathbf{C}) \sigma_3 (\sqrt{1-|b|^2} +b \sigma_2 \mathbf{C}) \psi,\psi \rangle\\& = \langle \sigma_3 (\sqrt{1-|b|^2} +b \sigma_2 \mathbf{C}) (\sqrt{1-|b|^2} + b\sigma_2 \mathbf{C}) \psi,\psi \rangle \\& = \langle \sigma_3 \left [ ({1-|b|^2} + b \sigma_2 \mathbf{C} { b} \sigma_2 \mathbf{C}) + 2\sqrt{1-|b|^2} b \sigma_2 \mathbf{C} \right ] \psi,\psi \rangle \\& = \langle \sigma_3 \left [ 1-2|b|^2+ 2 \sqrt{1-|b|^2} b_R \sigma_2 \mathbf{C} + 2 {\mathbbm{i}} \sqrt{1-|b|^2} b_I \sigma_2 \mathbf{C} \right ] \psi,\psi \rangle \\& = (1-2|b|^2) \langle \sigma_3 \psi,\psi \rangle + 2 \sqrt{1-|b|^2} b_R \langle \sigma_3 \sigma_2 \mathbf{C}\psi,\psi \rangle + 2 \sqrt{1-|b|^2} b_I \langle {\mathbbm{i}} \sigma_3 \sigma_2 \mathbf{C} \psi,\psi \rangle. \end{aligned} \end{equation*} This yields the formula for $\Pi_{7}(u)$. \qed \begin{remark} \label{rem:invariants} Notice that, in the notation of Lemma \ref{eq:lambdas11}, we have $\Pi_{5}(u)\sim b_R$ and $\Pi_{6}(u)\sim b_I$ for $\psi = \Phi _p $. This follows from $\Pi _5 (\Phi _p )=\Pi _6 (\Phi _p )=0$ and $\Pi _7 (\Phi _p )=p_4 $. \end{remark} We have the following modulation result which is of key relevance to us. In the sequel we fix $\mathbf{n}$ large enough. \begin{lemma}[Modulation] \label{lem:modulation} Fix $n_1 \in\mathbb{N}_{0}$ and fix $ p^0 \in \mathcal{P} $. Then $\exists$ an open neighborhood $ \mathcal{U}_{-\mathbf{n}} $ of $ \Phi_{ p^0 }$ in $ \Sigma_{-n_1 }(\mathbb{R}^3, \mathbb{C}^2) $ and functions $p \in C^\infty (\mathcal{U}_{-n_1 }, \mathcal{P})$, $\tau \in C^\infty ({\mathcal{U}}_{-n_1 }, \mathbb{R}^3\times \mathbb{T})$ and $ b \in C^\infty ({\mathcal{U}}_{-n_1 }, \mathbb{C})$ such that $p (\Phi_{ p^0 })=p_0 $, $\tau (\Phi_{ p^0 }) =0$, $b (\Phi_{ p^0 }) = 0$ and $\vartheta (\Phi_{ p^0 }) = 0$ so that for any $u\in \mathcal{U}_{-n_1 } $, \begin{equation}\label{eq:ansatz} u = e^{- {\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j(u) \Diamond_j} (\sqrt{1-| b (u)|^2} + b (u)\sigma_2 \mathbf{C}) (\Phi_{ p (u) } +R(u)), \end{equation} with $R(u)\in T^{\bot_{\Omega}}_{\Phi_{ p (u) }}\mathcal{M}\cap\Sigma_{-\mathbf{n}}(\mathbb{R}^3,\mathbb{C}^2)$. \end{lemma} \proof Consider for $\mathbf{v}_{\iota}(p)$, $1\le\iota\le 10$, varying among the $10$ vectors in \eqref{eq:Tmanifold} the function \begin{equation*} F_{\iota}(u,p,\tau,b) := \Omega (e^{ {\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C})u-\Phi_{ p },\mathbf{v}_{\iota}(p)). \end{equation*} Then \begin{equation*} F_{\iota}(e^{-{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p },p,\tau,0)=0. \end{equation*} Next, setting $\overrightarrow{F}=(F_1,..., F_{10})$, the Jacobian matrix is \begin{equation}\label{eq:Jac} \left. \frac{\partial F (u,p,\tau,b)}{\partial (p,\tau,b)} \right |_{u= e^{ -{\mathbbm{i}} \sigma_3\tau \cdot \Diamond } \Phi_{ p }, \ b=0 } = \left [ \varepsilon_{ij} \Omega (\mathbf{v}_i(p),\mathbf{v}_j(p)) \right ]_{i,j}, \qquad 1\le i,j\le 10, \end{equation} where the numbers $\varepsilon_{ij} $ belong to $\{ 1, -1\}$. Since for each $\mathbf{v}_i(p)$ there is exactly one $\mathbf{v}_j(p)$ such that $\Omega (\mathbf{v}_i(p),\mathbf{v}_j(p))\neq 0$, it follows that all the columns in \eqref{eq:Jac} are linearly independent. We can therefore apply the implicit function theorem which yields the statement. \qed It can be proved, see \cite[Lemma 2.3]{Cu0}, that there is an open neighborhood $ \mathcal{V}$ of $p^0$ in $\mathcal{P}$ such that for any $p\in \mathcal{V}$ and any $k\ge -n_1 $ the projection \begin{eqnarray}\label{def-p-p} P_{p}:\; T_{\Phi _{p^0 } }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{k}(\mathbb{R}^3, \mathbb{C}^2) \longrightarrow T_{\Phi _{p } }^{\perp_\Omega}\mathcal{M}\cap \Sigma_{k}(\mathbb{R}^3, \mathbb{C}^2) \end{eqnarray} is an isomorphism. From Lemma~\ref{lem:modulation} we have the parametrization \begin{equation}\label{eq:coordinate} \mathcal{P}\times (\mathbb{R}^3 \times \mathbb{T}) \times \mathbb{D}_{\varepsilon_0}\times (T_{\Phi _{p^0 } }^{\perp_\Omega}\mathcal{M}\cap H^1 (\mathbb{R}^3, \mathbb{C}^2)) \to H^1 (\mathbb{R}^3, \mathbb{C}^2) \end{equation} with the \emph{modulation coordinates} \begin{equation}\label{eq:coordinate-2} \\ (p,\tau,b, r) \mapsto u = e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r). \end{equation} It can be proved, see \cite[Lemma 2.6]{Cu0}, that, in terms of these coordinates, system \eqref{Eq:NLS}, which we have also written as $\dot u = X_{E} (u)$, see \eqref{eq:graden-dot}, can be expressed in terms of the Poisson brackets as \begin{equation} \label{eq:SystE1} \begin{aligned} & \dot p = \{ p, E \} \,, \quad \dot \tau = \{ \tau, E \} \,, \quad \dot b = \{ b, E \} \,, \quad \dot r= \{ r, E \}. \end{aligned} \end{equation} By the intrinsic definition of partial derivative on manifolds, we have the following vector fields (recall $b_R=\Re (b)$ and $b_I=\Im (b)$), see \cite[p.25]{docarmo}: \begin{equation}\label{eq:vectorfields} \begin{aligned} & \frac \partial {\partial {\tau_j}} = -{\mathbbm{i}} \sigma_3 \Diamond_ju \text{ for $1\le j\le 4$, } \\ & \frac \partial {\partial {p_k}}= e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\partial_{p_k}\Phi_{ p } + \partial_{p_k}P_{ p }r)\text{ for $1\le k\le 4$, } \\& \frac \partial {\partial {b_A}} = e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j }\partial_{b_A}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{p } + P_{p }r) \text{ for $A=R,I$},\end{aligned} \end{equation} which are obtained by differentiating by the various coordinates the r.h.s. of the equality in \eqref{eq:coordinate-2}. Along with the vector fields \eqref{eq:vectorfields} we have the Fr\'echet derivatives of the coordinates. In particular we have the following result, useful later, and which is basically the same as \cite[Lemma 2.5]{Cu0}. \begin{lemma} \label{lem:gradient R} Let $n_1 \ge 1$ and $\mathcal{U}_{-n_1 }$ be as in Lemma~\ref{lem:modulation}. Let $k\in\mathbb{Z}$, $k\ge -n_1 $. Then the mapping $r:\; u\mapsto r(u) $, with $r$ from \eqref{eq:coordinate} and \eqref{eq:coordinate-2}, satisfies \begin{eqnarray} r\in C^{0} (\mathcal{U}_{-n_1 }\cap \Sigma_{k }, \Sigma_k) \cap C^1(\mathcal{U}_{-n_1 }\cap \Sigma_{k+1}, \Sigma_{k }), \quad k\ge -n_1 . \end{eqnarray} For $\mathcal{U}_{-n_1 }$ sufficiently small in $\Sigma_{-n_1 }$ the Fr\'echet derivative $dr(u) $ of $r(u)$ is defined by the following formula, summing on the repeated indexes (${\kern+.3em {\rm 1} \kern -.22em {\rm l}}$ is the identity operator): \begin{equation} \label{eq:gradient R} \begin{aligned} dr =& (P_{p}P_{p^{0}})^{-1} P_{p} \Big [ e^{ {\mathbbm{i}}\sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) {\kern+.3em {\rm 1} \kern -.22em {\rm l}} +{\mathbbm{i}} \sigma_3 \sum_{j=1}^{4} \Diamond_jP_{p} r\, d\tau_j \\& - \sum_{j=1}^{4} \partial_{p_j} P_{p} r \, dp_j - (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \partial_{b_A}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}r\,db_A \Big ], \end{aligned} \end{equation} with $(P_{p}P_{p^{0}})^{-1} $ the inverse of \begin{equation}\label{eq:isoph1} P_{p} =P_{p}P_{p^0 }:\; T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M}\cap \Sigma_{k -1}(\mathbb{R}^3, \mathbb{C}^2) \to T_{\Phi _{p } }^{\perp_\Omega}\mathcal{M}\cap \Sigma_{k -1}(\mathbb{R}^3, \mathbb{C}^2). \end{equation} \end{lemma} \proof As we already mentioned in the proof of Lemma~\ref{lem:modulation}, we refer to \cite[Lemma 2.3]{Cu0} for the fact that the map $(P_{p}P_{p^0 })^{-1} :\; T_{\Phi _{p } }^{\perp_\Omega}\cap \Sigma_{k -1}\to T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M}\cap \Sigma_{k -1} $, which is almost the identity because the two spaces are almost the same and \eqref{eq:isoph1} is an isomorphism. We also refer to \cite[Lemma 2.5]{Cu0} for the continuity of $ r(u)$. The rest of the proof is also similar to \cite[Lemma 2.5]{Cu0}, but we briefly discuss the formula \eqref{eq:gradient R}. To get the formula for $dr(u)$ notice that this differential is characterized by the equalities \[ dr\frac \partial {\partial {p_j}}=dr\frac \partial {\partial {\tau_j}}= dr\frac \partial {\partial {b_A}}=0, \qquad dr e^{ -{\mathbbm{i}} \sigma_3\tau \cdot \Diamond } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}P_{p^0 } = {\kern+.3em {\rm 1} \kern -.22em {\rm l}}_{ T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M}}. \] We claim that we have \begin{equation}\label{eq:frechr} dr= \sum_{j=1}^{4}\mathfrak{D}_j d\tau_j+ \sum_{j=1}^{4} \mathfrak{Q}_j dp_j + \sum_{A=R,I}\mathfrak{B}_A\,db_A+(P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}} \sigma_3\tau \cdot \Diamond } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \end{equation} for some $\mathfrak{D}_j$, $\mathfrak{Q}_j $, and $\mathfrak{B}_A $. First of all, by the independence of coordinates $(\tau,p,b)$ from $r\in T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M}$, we have \begin{equation*}\begin{aligned}& d \Bbbk \circ e^{ - {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C})P_{p}P_{p^0 }=0 \text{ \ for \ }\Bbbk = \tau_j, p_j, b_A. \end{aligned} \end{equation*} Indeed for $\tilde{r} \in T_{\Phi _{p^0 } }^{\perp_\Omega}\mathcal{M} $ we have \begin{equation*}\begin{aligned} 0= \frac{d}{ds} \Bbbk (u (p,\tau,b, r+s\tilde{r}))\at{s=0} &= \frac{d}{ds} \Bbbk \left (e^{ - {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{p}(r+s\tilde{r})) \right)\at{s=0} \\& = d\Bbbk \circ e^{ - {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i }(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p} P_{p^0} \tilde{r}. \end{aligned} \end{equation*} Then, by the definition of $(P_{p}P_{p^0 })^{-1}$, \begin{equation*} (P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}}\sigma_3\sum_{i\le 4} \tau_i \Diamond_i } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \circ e^{ -{\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i }(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}P_{p^0 } ={\kern+.3em {\rm 1} \kern -.22em {\rm l}}_{ T_{\Phi _{p_0} }^{\perp_\Omega}\mathcal{M}}. \end{equation*} Hence we get the claimed equality \eqref{eq:frechr}. To get $\mathfrak{D}_j $, notice that by $dr \frac \partial {\partial \tau_{j}}=0$, \eqref{eq:vectorfields}, and $P_p{\mathbbm{i}} \sigma _3 \Diamond_j\Phi_p=0$ for $1\le j\le 4$ which follows from the fact that ${\mathbbm{i}}\sigma _3 \Diamond_j\Phi_p$ for $1\le j\le 4$ is in the list \eqref{eq:Tmanifold} (the vector fields in \eqref{eq:Tmanifold} are a basis of $\ker P_p$), we have \begin{equation*} \begin{aligned} & \mathfrak{D}_j = - (P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \frac \partial {\partial \tau_{j}} = (P_{p}P_{p^0 })^{-1} P_{p} {\mathbbm{i}} \sigma_3 \Diamond_jP_{p} r. \end{aligned} \end{equation*} Similarly, \begin{equation*} \begin{aligned} & \mathfrak{Q}_j= -(P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i }(\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \frac \partial {\partial {p_j}}\\& = -(P_{p}P_{p^0 })^{-1} P_{p} ( \partial_{p_j}\Phi_{p} +\partial_{p_j}P_{p}r)= -(P_{p}P_{p^0 })^{-1} P_{p} \partial_{p_j}P_{p}r \end{aligned} \end{equation*} and \begin{equation*} \begin{aligned} & \mathfrak{B}_A= - (P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i }(\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \frac \partial {\partial {b_A}} \\& = - (P_{p}P_{p^0 })^{-1} P_{p} e^{ {\mathbbm{i}} \sigma_3\sum_{i\le 4} \tau_i \Diamond_i } \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{p}+P_{p}r) \\& = - (P_{p}P_{p^0 })^{-1} P_{p} (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}r. \end{aligned} \end{equation*} \qed By \eqref{eq:vectorfields} we have the elementary and crucial fact that $ X_{\Pi_j } (u) ={\mathbbm{i}} \sigma_3\nabla \Pi_j (u) = {\mathbbm{i}} \sigma_3 \Diamond_ju$ for $1\le j\le 7$ which corresponds to formulas (2.5)--(2.6) in \cite{GSS2}. In particular we have \begin{equation}\label{eq:hampi} \begin{aligned} & X_{\Pi_j } (u) = \frac{\partial}{\partial \tau_j} \text{ for } 1\le j\le 4 \end{aligned} \nonumber \end{equation} which immediately implies \begin{equation*} \label{eq:Ham.VecField1} \{ \Pi_j,\tau_k \} =-\delta_{jk}, \quad \{ \Pi_j,b_A \} = 0, \quad \{ \Pi_j,p_k \} = 0, \quad \{ r, \Pi_j \} = 0 \text{ for } 1\le j\le 4. \end{equation*} A natural step, which helps to reduce the number of equations in \eqref{eq:SystE1} and corresponds to an application of Noether's Theorem to Hamiltonian systems, see \cite[Theorem 6.35, p.402]{Olver}, is to substitute each function $\left. p_j \right |_{j=1}^{4}$ in the coordinate system $(p,\tau,b, r)$ with the functions $\left.\Pi_j\right |_{j=1}^{4}$ and move to coordinates $(\left.\Pi_j\right |_{j=1}^{4},\tau,b, r)$. Indeed, as in \cite[(34)]{Cu0}, we have \begin{equation}\label{eq:variables} \begin{aligned} & \Pi_j = p_j+ \varsigma_j - \Pi_j((P_{p} -P_{p^0 }) r) +\langle r, \Diamond_j (P_{p} -P_{p^0 }) r\rangle, \quad \text{where } \varsigma_j :=\Pi_j(r) \text{ and $1\le j\le 4$}. \end{aligned} \end{equation} This allows to move from $(p,\tau,b, r)$ to $(\left.\Pi_j\right |_{j=1}^{4},\tau,b, r)$. Furthermore, the fact that $ \frac{\partial}{\partial \tau_k } \Pi_j(u)\equiv 0 $ for $k\le 4$ implies that the vector fields $ \left.\frac{\partial}{\partial \tau_k }\right |_{k=1}^{4}$ are the same whether the field is defined using the coordinates $(\left.p_j\right |_{j=1}^{4}, \left.\tau_j\right |_{j=1}^{4},b, r)$ or the coordinates $(\left.\Pi_j\right |_{j=1}^{4}, \left.\tau_j\right |_{j=1}^{4},b, r)$ (here we recall that the partial derivative in every single coordinate in \eqref{eq:vectorfields} depends on the other coordinates, but we have just shown that the $ \frac{\partial}{\partial \tau_k }$ for $k\le 4$ remain the same vector field). Hence, \begin{equation*}\label{eq:poi--1} \{ \Pi_j, E \} =- \{ E,\Pi_j \} =-dE X_{\Pi_j} = -dE \frac{\partial}{\partial \tau_j}=- \frac{\partial E}{\partial \tau_j}=0\quad \text{for $1\le j\le 4$}, \end{equation*} where we exploited the invariance $E(e^{{\mathbbm{i}} \sigma_3\sum_{j=1}^{4} \tau_j \Diamond_j}u)=E(u)$. By these identities, \eqref{Eq:NLS} in the new coordinates $(\left.\Pi_j\right |_{j=1}^{4},\tau,b, r)$ becomes \begin{equation} \label{eq:SystE2} \begin{aligned} & \dot \Pi_j = 0 \text{ for $1\le j\le 4$}, \quad \dot \tau = \{ \tau, E \} \,, \quad \dot b = \{ b, E \} \,, \quad \dot r= \{ r, E \}. \end{aligned} \end{equation} Notice that in effect the system reduces to the last two equations and hence we produced a (first) Noetherian reduction of coordinates. \section{Expansion of the Hamiltonian} \label{sec:expansion} We introduce now a new Hamiltonian: \begin{equation} \label{eq:K} \begin{aligned} & {K}(u):= {E} (u)- {E} \left (\Phi_{ {p}^0}\right ) - \sum_{j=1}^{4}\lambda_j(p) \left (\Pi_j - \Pi_j (\Phi_{ {p}^0}) \right). \end{aligned} \end{equation} For solutions of the initial value problem \eqref{Eq:NLS} which satisfy \eqref{boxed} we have \begin{equation*} \begin{aligned} & \{ \Pi_j, K \} = \{ \Pi_j, E \} =0 \quad \text{ for $1\le j\le 4$ }, \\& \{ b, K \} = \{ b, E \} \,, \qquad \{ r, K \} = \{ r, E \} \,, \qquad \{ \tau_j, K \} = \{ \tau_j, E \} - \lambda_j(p). \end{aligned} \end{equation*} Indeed, for example, since $\Pi =\Pi (u)=\Pi (u_0)= \Pi (\Phi_{ {p}^0}) $ and $ \{ \Pi_j, \Pi_k \}=0$ for $j,k\le 4$ (which follows from $[\Diamond_j,\Diamond_k]=0$, that is, from the fact that $\mathbb{R} \times \mathbb{T}$ is commutative) we have \begin{equation*} \begin{aligned} & \{ \Pi_j, K \}\left |\right ._{\Pi = \Pi (\Phi_{ {p}^0})} = \{ \Pi_j, {E} \} \left |\right ._{\Pi = \Pi (\Phi_{ {p}^0})} - \sum_{k=1}^{4}\lambda_k \overbrace{\{ \Pi_j, \Pi_k \}}^{0} \left |\right ._{\Pi = \Pi (\Phi_{ {p}^0})}\\& - \sum_{k=1}^{4}\underbrace{( \Pi_j-\Pi_j (\Phi_{ {p }^0}))} _{0} \{ \Pi_j, \lambda_k \} \left |\right ._{\Pi = \Pi (\Phi_{ {p}^0})}=\{ \Pi_j, {E} \}\left |\right ._{\Pi = \Pi (\Phi_{ {p}^0})}. \end{aligned} \end{equation*} The other Poisson brackets are computed similarly. By $\partial_{\tau_j} {K} \equiv 0$ for $1\le j\le 4$, the evolution of the variables $\left. (\Pi_j) \right |_{j=1}^{4},b,r$ is unchanged if we consider the following new Hamiltonian system: \begin{equation} \label{eq:SystK} \begin{aligned} & \dot \Pi_j = \{ \Pi_j, K \} =0 \text{ for $1\le j\le 4$, } \quad \dot \tau = \{ \tau, K \} \,, \quad \dot b = \{ b, K \} \,, \quad \dot r= \{ r, {K} \}. \end{aligned} \end{equation} Key in our discussion is the expansion of $K(u)$ in terms of the coordinates $(\left. (\Pi_j) \right |_{j=1}^{4},r)$. We consider the expansion \begin{equation*} \begin{aligned} K(u)=& K(\Phi_{ p } +P_{p}r) = K (\Phi_{ p }) + \langle \overbrace{\nabla E (\Phi_{ p })- \sum_{j=1}^{4}\lambda_j(p) \nabla \Pi_j(\Phi_{ p })}^{0}, P_{p}r \rangle \\& + \int_0^1 (1-t)\Big\langle \Big [ \nabla^2 E (\Phi_{ p } + t P_{p}r)P_{p}r)-\sum_{j=1}^{4} \lambda_j(p) \nabla^2 \Pi_j(\Phi_{ p } + t P_{p}r)P_{p}r)\Big ] P_{p}r, P_{p}r \Big\rangle\,dt. \end{aligned} \end{equation*} The last line equals (cf. \cite[(99)]{Cu0}) \begin{equation*} \begin{aligned} & 2^{-1}\langle (-\Delta +\sum_{j=1}^{4}\lambda_j(p) \Diamond_j)P_{p}r,P_{p}r\rangle + \int_0^1 (1-t)\langle \nabla^2 E_P (\Phi_{ p } + t P_{p}r) P_{p}r, P_{p}r \rangle\,dt=\\& 2^{-1}\langle (-\Delta +\sum_{j=1}^{4}\lambda_j(p) \Diamond_j)P_{p}r,P_{p}r\rangle + \int_{\mathbb{R}^3}dx \int_{[0,1]^2} \frac{t^2}{2 } (\partial_t^{2})\at{t=0} \partial_s [B (|s \Phi_{ p } +tP_{p}r |^2) ]\,dt\,ds \\&+ \sum_{ j=2}^{3}\int_{\mathbb{R}^3}dx\int_{[0,1]^2} \frac{t^j}{j!} (\partial_t^{j+1})\at{t=0} \partial_s [ B (|s \Phi_{ p } +tP_{p}r |^2) ]\,dt\,ds \\& + \int_{\mathbb{R}^3}dx \int_{[0,1]^2}\,dt\,ds \int_0^t \partial_\tau^5 \partial_s [B (|s \Phi_{ p } +\tau P_{p}r |^2)] \frac{(t-\tau)^3}{3!} d\tau + E_P (P_{p}r). \end{aligned} \end{equation*} The second term in the second line is $\frac{1}{2} \langle \nabla^2 E_P(\Phi_{p})P_{p}r, P_{p}r\rangle$ and so in particular the second line is \begin{equation*} 2^{-1}\langle (-\Delta + \nabla^2 E_P(\Phi_{p}) -\sum_{j=1}^{4}\lambda_j(p) \Diamond_j)P_{p}r,P_{p}r\rangle = 2^{-1}\langle (\nabla^2 E (\Phi_{p}) -\sum_{j=1}^{4}\lambda_j(p) \nabla^2\Pi_j(\Phi_{p}))P_{p}r,P_{p}r\rangle. \end{equation*} By \eqref{eq:K}, we have \begin{equation}\label{eq:expKphi0} K(\Phi_{p}) = d(p) -d({p}^0)+(\lambda (p) - \lambda ({p}^0)) \cdot {p}^0, \end{equation} where \begin{eqnarray}\label{def-d-p} d(p):= E (\Phi_{p})-\lambda (p)\cdot p. \end{eqnarray} Since $\partial_{p_j}d(p)=-p\cdot \partial_{p_j} \lambda (p)$, we conclude $K(\Phi_{p}) =O((p- {p}^0)^2)$. Furthermore, from \eqref{eq:variables} we have \begin{eqnarray} K(\Phi_{p}) = \mathfrak{G} \Big( (\Pi_j- {p}^0_j)|_{j=1}^{4}, \Pi_j (r)|_{j=1}^{4}, \left( \Pi_j\big((P_{p}-P_{p^0})r\big) +\big\langle r,\Diamond_j(P_{p}-P_{p^0})r\big\rangle \right) \big|_{j=1}^{4} \Big), \label{eq:expKphi} \end{eqnarray} with $\mathfrak{G} $ smooth and equal to zero at $(0,0,0)$ up to second order. Summing up, we have the following lemma. \begin{lemma} \label{lem:back} There is an expansion \begin{align} \label{eq:Kexpansion0} & K(u)= K(\Phi_{p}) + 2^{-1}\Omega (\mathcal{H}_p P_{p}r, P_{p}r)+ E_P(P_{p}r)\\& + \sum_{d=3}^4 \langle B_{d }(p), (P_{p}r)^{ d} \rangle +\int_{\mathbb{R}^3} B_5 (x, p, r(x)) (P_{p}r)^{ 5}(x)\,dx, \nonumber \end{align} where for any $k\in \mathbb{N}$ \begin{itemize} \item $ K(\Phi_{p})$ satisfies \eqref{eq:expKphi0}--\eqref{eq:expKphi}; \item $(P_{p}r)^d(x)$ represents $d$-products of components of $P_{p}r$; \item $B_{d } \in C^\infty (\mathcal{P}, \Sigma_{k} (\mathbb{R}^3, B ( (\mathbb{R}^{4 })^{\otimes d},\mathbb{R}))) $ for $3\le d \le 4$; \item for $ \zeta \in \mathbb{R}^{4 }$, $B_5$ depends smoothly on its variables, so that for any $i\in\mathbb{N}$, there is a constant $C_i$ such that \begin{equation} \label{eq:B5}\begin{aligned} & \| \nabla_{ p, \zeta } ^iB_5 (\cdot,p, \zeta) \|_{\Sigma_{k}(\mathbb{R}^3, B( (\mathbb{R}^{4 })^{\otimes 5},\mathbb{R}))} \le C_i. \end{aligned} \end{equation} \end{itemize} \end{lemma} \qed We will perform a normal form argument on the expansion \eqref{eq:Kexpansion0}, that is, we will eliminate a few terms from the expansion by means of changes of variables. The first step in a normal forms argument is the diagonalization of the \textit{homological equation}, see \cite[p. 182]{Arnold}, which is discussed in Section~\ref{sec:Normal form}. \section{Representation of $\Omega$ in modulation coordinates} \label{sec:symplectic1} While the symplectic form $\Omega $ has a very simple definition \eqref{eq:Omega} in terms of the hermitian structure of $L^2(\mathbb{R}^3, \mathbb{C}^2)$, it has a rather complicated representation in terms of the coordinates $(\left.\Pi_j\right |_{j=1}^{4},\tau,b, r)$ making them unsuitable for normal forms arguments. In order to find better coordinates, we need to write this complicated representation. To achieve this goal we consider $\widetilde{\Gamma}:= 2^{-1}\langle {\mathbbm{i}} \sigma_3 u, \,\cdot\, \rangle $. Using the definition of exterior differentiation it is elementary to show that $ d \widetilde{\Gamma } =\Omega $. We consider now the function \begin{equation*} \psi (u):= 2^{-1}\langle {\mathbbm{i}} \sigma_3 e^{ -{\mathbbm{i}} \sigma_3\sum_{l\le 4} \tau_l \Diamond_l}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p},u \rangle \end{equation*} and we set $\Gamma:= \widetilde{\Gamma}-d\psi +d\sum _{j=1}^{4}\Pi _j \tau _j$. Obviously $d\Gamma=\Omega$. We have the following lemma, which is important to apply the Darboux Theorem, see \cite[p. 10]{hofer}, and to find a system of coordinates where $\Omega$ has a simpler form. \begin{lemma}\label{lem:tildeB} We have \begin{equation}\label{eq:defgamma} \Gamma = \sum_{j=1}^{4} \tau_j d{\Pi_j} +2^{-1} \Omega (P_p r, dr)+\sum_{j=1}^{4}2^{-1} \Omega (r,P_p \partial_{p_j}P_p r)dp_j+ \varsigma, \end{equation} where \[ \varsigma := \left (\Pi_5 \frac{b_Rb_I}{\sqrt{1-|b|^2}}-\Pi_6 \frac{1-b_I^2}{\sqrt{1-|b|^2}} - \Pi_7b_I \right)\,db_R + \left (\Pi_5 \frac{1-b_R^2}{\sqrt{1-|b|^2}}-\Pi_6 \frac{b_Rb_I}{\sqrt{1-|b|^2}} + \Pi_7b_R \right)\,db_I . \] \end {lemma} \proof In the coordinates \eqref{eq:coordinate} we have \begin{equation*} \widetilde{\Gamma} = 2^{-1}\langle {\mathbbm{i}}\sigma_3 e^{ -{\mathbbm{i}} \sigma_3\sum_{l\le 4} \tau_l \Diamond_l}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p}, \ \rangle + 2^{-1}\langle {\mathbbm{i}} \sigma_3 e^{ -{\mathbbm{i}} \sigma_3 \sum_{l\le 4} \tau_l \Diamond_l} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{ p} r, \ \rangle. \end{equation*} Next we claim \begin{equation} \label{eq:dpsi} \begin{aligned} & d\psi - 2^{-1}\langle {\mathbbm{i}} \sigma_3 e^{ -{\mathbbm{i}} \sigma_3 \sum_{l\le 4} \tau_l \Diamond_l} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p},\ \rangle =\sum_{j=1}^{4} p_j d\tau_j \\& + 2^{-1}\langle {\mathbbm{i}} \sigma_3 \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p}, (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r) \rangle\,db_A.\end{aligned} \end{equation} This follows from the fact that the l.h.s. of \eqref{eq:dpsi} equals \begin{equation*} \begin{aligned} & 2^{-1}\sum_{j=1}^{4}\langle \Diamond_j \cancel{e^{ -{\mathbbm{i}} \sigma_3 \sum_{l\le 4} \tau_l \Diamond_l} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) } \Phi_{ p},\cancel{e^{ -{\mathbbm{i}} \sigma_3\sum_{l\le 4} \tau_l \Diamond_l } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C})} (\Phi_{ p } +\cancel{P_{ p}r }) \rangle d\tau_j\\ + &2^{-1}\sum_{j=1}^{4}\langle {\mathbbm{i}} \sigma_3 \cancel{e^{ -{\mathbbm{i}}\sigma_3\sum_{l\le 4} \tau_l \Diamond_l } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C})} \partial_{p_j}\Phi_{ p},\cancel{e^{ -{\mathbbm{i}}\sigma_3\sum_{l\le 4} \tau_l \Diamond_l } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C})} (\Phi_{ p } +\cancel{P_{ p}r }) \rangle dp_j \\ +& 2^{-1}\langle {\mathbbm{i}} \sigma_3 \cancel{e^{ -{\mathbbm{i}} \sigma_3 \sum_{l\le 4} \tau_l \Diamond_l}} \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p},\cancel{e^{ -{\mathbbm{i}} \sigma_3\sum_{l\le 4} \tau_l \Diamond_l }} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r) \rangle\,db_A,\end{aligned} \end{equation*} and exploit the fact that $\langle {\mathbbm{i}} \sigma_3 \partial_{p_j}\Phi_{ p}, \Phi_{ p } \rangle =0$, which follows with a direct computation from \eqref{eq:defPhi}. We have \begin{equation}\label{eq:equatB} \begin{aligned}& \Gamma = -\text{l.h.s.\eqref{eq:dpsi}} + 2^{-1}\langle {\mathbbm{i}} \sigma_3 e^{ -{\mathbbm{i}} \sigma_3 \sum_{l\le 4} \tau_l \Diamond_l} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{ p} r, \ \rangle +d\sum _{j=1}^{4}\Pi _j \tau _j\\& = -\text{l.h.s.\eqref{eq:dpsi}}+ 2^{-1}\langle {\mathbbm{i}} \sigma_3 r, P_{p}e^{ {\mathbbm{i}}m \sigma_3\sum_{l\le 4} \tau_l \Diamond_l} (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) {\kern+.3em {\rm 1} \kern -.22em {\rm l}} \rangle +d\sum _{j=1}^{4}\Pi _j \tau _j \end{aligned} \end{equation} By \eqref{eq:gradient R} we have \begin{equation} \begin{aligned}& P_{p}e^{ {\mathbbm{i}} \sigma_3\sum_{l\le 4} \tau_l \Diamond_l } (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) {\kern+.3em {\rm 1} \kern -.22em {\rm l}} =P_{p}dr -\sum_{j=1}^{4}P_{p}{\mathbbm{i}} \sigma_3 \Diamond_jP_{p} r\, d\tau_j +\sum_{j=1}^{4}\partial_{p_j} P_{p} r \, dp_j \\& +\sum_{A=R,I} P_{p}(\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) \partial_{b_A}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}r\,db_A. \end{aligned}\nonumber \end{equation} Substituting in \eqref{eq:equatB} we get \begin{equation*} \begin{aligned} \Gamma =&-\sum_{j=1}^{4}p_jd\tau_j-\sum_{A=R,I} 2^{-1}\langle {\mathbbm{i}} \sigma_3 \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p}, (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r) \rangle\,db_A \\& + 2^{-1}\langle {\mathbbm{i}} \sigma_3 r, P_{p}dr \rangle -2^{-1}\sum_{j=1}^{4}\langle \cancel{{\mathbbm{i}} \sigma_3} P_{p} r,\cancel{{\mathbbm{i}} \sigma_3} \Diamond_j P_pr \rangle d\tau_j + \sum_{j=1}^{4}2^{-1}\langle {\mathbbm{i}} \sigma_3 P_{p} r,\partial_{p_j} P_{p} r\rangle dp_j\\& +\sum_{A=R,I} \langle {\mathbbm{i}} \sigma_3 (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p} r, \partial_{b_A}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}r\rangle\,db_A+d\sum _{j=1}^{4}\Pi _j \tau _j. \end{aligned} \end{equation*} This yields \begin{equation*} \begin{aligned} \Gamma =&-\sum_{j=1}^{4}p_jd\tau_j- 2^{-1}\sum_{A=R,I}\langle {\mathbbm{i}} \sigma_3 \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) \Phi_{ p}, (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r) \rangle\,db_A \\& + 2^{-1} \langle {\mathbbm{i}} \sigma_3 r, P_{p}dr \rangle -2^{-1}\sum_{j=1}^{4}\langle \cancel{{\mathbbm{i}} \sigma_3} P_{p} r,\cancel{{\mathbbm{i}} \sigma_3} \Diamond_j P_pr \rangle d\tau_j + 2^{-1}\sum_{j=1}^{4}\langle {\mathbbm{i}} \sigma_3 P_{p} r,\partial_{p_j} P_{p} r\rangle dp_j\\& +\sum_{A=R,I} \langle {\mathbbm{i}} \sigma_3 (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p} r, \partial_{b_A}(\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) P_{p}r\rangle\,db_A+d\sum _{j=1}^{4}\Pi _j \tau _j. \end{aligned} \end{equation*} This can be rewritten as \begin{align} & \Gamma = \sum_{j=1}^{4}\tau_j d\Pi_j +\sum_{j=1}^{4} 2^{-1}\langle {\mathbbm{i}} \sigma_3 P_{p} r,\partial_{p_j} P_{p} r\rangle dp_j + 2^{-1}\langle {\mathbbm{i}} \sigma_3 r, P_{p}dr \rangle \label{eq:brack1} \\& - 2^{-1}\sum_{A=R,I}\langle {\mathbbm{i}} \sigma_3 \partial_{b_A} (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r), (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r) \rangle\,db_A. \nonumber \end{align} For $A=R$ the bracket in the last line equals \begin{equation*} \begin{aligned} & \langle {\mathbbm{i}} \sigma_3 \left (\frac{-b_R}{\sqrt{1-| b |^2}} + \sigma_2 \mathbf{C} \right) (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) u, u \rangle =\\& \langle {\mathbbm{i}} \sigma_3 \left [ {-b_R} +\overline{b} + \left ( \sqrt{1-| b |^2} + \frac{ b_R b}{\sqrt{1-| b |^2}} \right) \sigma_2 \mathbf{C} \right ] u, u \rangle =\\& \langle {\mathbbm{i}} \sigma_3 \left [ -{\mathbbm{i}} b_I + \frac{ 1-\cancel{b^2_R}-b^2_I + \cancel{b^2_R}+{\mathbbm{i}} b_R b_I}{\sqrt{1-| b |^2}} \sigma_2 \mathbf{C} \right ] u, u \rangle = \langle {\mathbbm{i}} \sigma_3 \left [ -{\mathbbm{i}} b_I +\frac{ 1- b^2_I }{\sqrt{1-| b |^2}} \sigma_2 \mathbf{C} + \frac{ b_R b_I}{\sqrt{1-| b |^2}} {\mathbbm{i}} \sigma_2 \mathbf{C} \right ] u, u \rangle \\& = b_I \Pi_7 + \frac{ 1- b^2_I }{\sqrt{1-| b |^2}} \Pi_6 - \frac{ b_R b_I}{\sqrt{1-| b |^2}}\Pi_5. \end{aligned} \end{equation*} For $A=I$ the bracket in the last line of \eqref{eq:brack1} equals \begin{equation*} \begin{aligned} & \langle {\mathbbm{i}} \sigma_3 \left (\frac{-b_I}{\sqrt{1-| b |^2}} + {\mathbbm{i}} \sigma_2 \mathbf{C} \right) (\sqrt{1-| b |^2} - b \sigma_2 \mathbf{C}) u, u \rangle =\\& \langle {\mathbbm{i}} \sigma_3 \left [ {-b_I} +{\mathbbm{i}} \overline{b} + \left ( {\mathbbm{i}} \sqrt{1-| b |^2} + \frac{ b_I b}{\sqrt{1-| b |^2}} \right) \sigma_2 \mathbf{C} \right ] u, u \rangle =\\& \langle {\mathbbm{i}} \sigma_3 \left [ {\mathbbm{i}} { b_R} + \frac{ {\mathbbm{i}} (1-b^2_R -\cancel{b^2_I}) + \cancel{{\mathbbm{i}} b^2_I}+ b_R b_I}{\sqrt{1-| b |^2}} \sigma_2 \mathbf{C} \right ] u, u \rangle = \langle {\mathbbm{i}} \sigma_3 \left [ {\mathbbm{i}} b_R +\frac{ 1- b^2_R }{\sqrt{1-| b |^2}} {\mathbbm{i}} \sigma_2 \mathbf{C} + \frac{ b_R b_I}{\sqrt{1-| b |^2}} \sigma_2 \mathbf{C} \right ] u, u \rangle \\& =- b_R \Pi_7 - \frac{ 1- b^2_R }{\sqrt{1-| b |^2}} \Pi_5 + \frac{ b_R b_I}{\sqrt{1-| b |^2}}\Pi_6. \end{aligned} \end{equation*} This completes the proof of Lemma~\ref{lem:tildeB}. \qed \section{Symbols $\mathcal{R}^{i,j}_{k, m}$, $\mathbf{S}^{i,j}_{k, m}$ and restriction of $ K $ onto $\Pi_j= p_j^0$ for $1\le j\le 4$} \label{sect:restrK} \noindent We introduce two classes of symbols which will be important in the sequel. \begin{definition}\label{def:scalSymb} For $ {A} \subset\mathbb{R}^d$ an open set, $k\in\mathbb{N}_{0}$, $\mathcal{A}\subset \mathbb{R}^ 7\times (T^{\bot_{\Omega}}{\mathcal M}_{ p^0 } \cap \Sigma_{-k}) $ an open neighborhood of $(0,0)$, we say that $ F \in C^{m}(A\times \mathcal{A},\mathbb{R})$ is $\mathcal{R}^{i,j}_{k, m}$ if there exists $C>0$ and an open neighborhood $\mathcal{A}'\subset\mathcal{A}$ of $(0,0)$ in $ \mathbb{R}^ 7 \times (T^{\bot_{\Omega}}{\mathcal M}_{ p^0 } \cap \Sigma_{-k})$ such that \begin{equation}\label{eq:scalSymb} |F(a,\varrho, r)|\le C \| r\|_{\Sigma_{-k}}^j (\| r\| _{\Sigma_{-k}}+|\varrho |)^{i} \text{ in $I\times \mathcal{A}'$}. \end{equation} We will write also $F=\mathcal{R}^{i,j}_{ n,m}$ or $F=\mathcal{R}^{i, j}_{ k,m} (a, \varrho, r)$. We say $F=\mathcal{R}^{i, j}_{k, \infty}$ if $F=\mathcal{R}^{i,j}_{k, l}$ for all $l\ge m$. We say $F=\mathcal{R}^{i, j}_{\infty, m} $ if for all $l\ge k$ the above $F$ is the restriction of an $F \in C^{m}(A\times \mathcal{A}_{l },\mathbb{R})$ with $\mathcal{A}_l$ an open neighborhood of $(0,0)$ in $ \mathbb{R}^ 7\times (T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap \Sigma_{-l})$ and $F=\mathcal{R}^{i,j}_{l, m}$. If $F=\mathcal{R}^{i, j}_{\infty, m} $ for any $m$, we set $F=\mathcal{R}^{i, j}_{\infty, \infty} $. \end{definition} \begin{remark}\label{rem:scalSymb} Above we can have $d=0$, that is $A$ missing. We will use the following cases: $d=0$ and $A$ missing; $A$ an interval in $\mathbb{R}$; $A$ an open neighborhood of the origin of $ \mathbb{R} \times \mathbf{su}(2)$. The last case is used only in Appendix \ref{sec:flowspf}. \end{remark} \begin{definition}\label{def:opSymb} $T \in C^{m}(A\times \mathcal{A},\Sigma_{k} (\mathbb{R}^3, \mathbb{C}^{2 }))$, with $A\times \mathcal{A}$ like above, is $ \mathbf{{S}}^{i,j}_{k,m} $, and we write as above $T= \mathbf{{S}}^{i,j}_{k,m}$ or $T= \mathbf{{S}}^{i,j}_{k,m} (a, \varrho, r)$, if there exists $C>0$ and a smaller open neighborhood $\mathcal{A}'$ of $(0,0)$ such that \begin{equation}\label{eq:opSymb} \|T(a, \varrho, r)\|_{\Sigma_{k}}\le C \| r \|_{\Sigma _{-k}}^j (\| r\|_{\Sigma_{-k}}+|\varrho |)^{i} \text{ in $I\times \mathcal{A}'$}. \end{equation} We use notation $T=\mathbf{{S}}^{i,j}_{k,\infty }$, $T=\mathbf{{S}}^{i,j}_{\infty,m}$ and $T=\mathbf{{S}}^{i,j}_{\infty,\infty}$ as above. \end{definition} By implicit function theorem applied to \eqref{eq:variables} the following is elementary. \begin{lemma} \label{lem:repp} On the manifold $\Pi_j= p_j^0$ for $1\le j\le 4$ there exist functions ${\mathcal R}^{1,2}_{\infty,\infty} $ such that \begin{equation} \label{eq:p in r} \begin{aligned} &p_a=-\Pi_a(r) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi _j(r)\left . \right | _{j=1}^{4}, r), \quad a\le 3; \\ & p_4=p_4^0-\Pi_4(r) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi _j(r)\left . \right | _{j=1}^{4}, r). \end{aligned} \end{equation} \end{lemma} \section{Flows } \label{sect:flows} In the sequel we will need to consider flows like in \eqref{eq:ODE} below. The following lemma is similar to \cite[Lemma 3.8]{Cu0}. \begin{lemma} \label{lem:ODE} For $n,M,M_0, {s}, {s}',k,l\in \{ 0 \}\cup\mathbb{N}$ with $1\le l\le M$ and $\widetilde{\varepsilon}_0>0$, consider \begin{equation} \label{eq:ODE}\begin{aligned} & \dot r (t) = {\mathbbm{i}} \sigma_3\sum_{j\le 7} \mathcal{A }_j(t, \Pi (r), r) \Diamond_j r + \mathcal{D}(t, \Pi (r), r), \end{aligned} \end{equation} where we assume that \begin{itemize} \item[(i)] $\displaystyle \widehat{P}_{ p^0} \Big(\sum_{j\le 7}\mathcal{A }_j(t, \varrho, r) {\mathbbm{i}} \sigma_3\Diamond_j r + \mathcal{D}(t, \varrho,r) \Big) \equiv 0$, with $\widehat{P}_{p}$ defined in \eqref{def-widehat-p}; \item[(ii)] for $|t|<5$, $|\Pi (r)| <\widetilde{\varepsilon}_0$ and $\| r\|_{\Sigma_{-n}} <\widetilde{\varepsilon} _0$ we have $\mathcal{A } ={\mathcal R}^{0,M_0+1}_{n,M}(t, \Pi (r), r) $ and $ \mathcal{D} =\mathbf{S}^{i,M_0 }_{n,M}(t, \Pi (r), r)$. \end{itemize} Let $k\in \mathbb{Z}\cap [0,n-(l+1) ]$ and set for $s''\ge 1$ and $\varepsilon >0$ \begin{equation} \label{eq:domain0} \begin{aligned} \mathcal{U}_{\varepsilon,k}^{ {s}''} := &\{ r \in T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{ {s}''} \ :\; \| r \|_{\Sigma_{-k }} + |\Pi (r)| \le \varepsilon \}. \end{aligned} \end{equation} Then for $\varepsilon >0$ small enough, \eqref{eq:ODE} defines a flow $\mathfrak{F}_{t } $ \begin{equation} \label{eq:ODE1} \begin{aligned} & \mathfrak{F}_{t } (r) = e^{{\mathbbm{i}} \sigma_3 \sum _{j=1}^4{\mathcal R}^{0,M_0+1 }_{ n- l-1, l}(t, \Pi (r), r) \Diamond _j } T( e^{ \sum _{i=1}^3 {\mathcal R}^{0,M_0+1 }_{ n- l-1, l}(t, \Pi (r), r) {\mathbbm{i}} \sigma _i } ) (r+\mathbf{{S}}^{i,M_0 }_{ n- l-1,l}(t, \Pi (r), r)), \end{aligned} \end{equation} where for \begin{equation}\label{eq:index1} \text{$n- l-1 \ge {s}' \ge {s}+l \ge l $ and $k\in \mathbb{Z}\cap [0,n- l-1 ]$} \end{equation} and for $ \varepsilon_1> \varepsilon_2> 0$ sufficiently small we have \begin{equation} \label{eq:reg1}\begin{aligned} &\mathfrak{F}_{t } \in C^l((-4,4)\times \mathcal{U}_{\varepsilon_2,k}^{ {s}'}, \mathcal{U}_{\varepsilon_1,k}^{ {s}} ) . \end{aligned} \end{equation} \noindent The constants implicit in \eqref{eq:ODE1} and the constants $\varepsilon_1$ and $\varepsilon_2$ can be chosen to depend only on the constants from (ii). \end{lemma} \proof While the statement is the same of \cite[Lemma 3.8]{Cu0}, for the proof of formula \eqref{eq:ODE1} we need to keep into account the fact that the operators $\Diamond _j | _{j=5}^{7}$ do not commute. See in Appendix \ref{sec:flowspf}. \qed \noindent Notice that in \eqref{eq:reg1} the $C^l$ regularity comes at the cost of a loss of $l$ derivatives in the space $\Sigma_{ {s}''}$, which is accounted by $s'\ge {s}+l$. In Proposition~\ref{th:main} we will need the following elementary technical lemma. \begin{lemma} \label{lem:ODEbis} Consider two systems for $\ell =1,2$: \begin{equation} \label{eq:ODEbis}\begin{aligned} & \dot r (t) = {\mathbbm{i}} \sigma_3\sum_{j=1}^{7} \mathcal{A }_j^{(\ell)}(t, \Pi (r), r) \Diamond_j r + \mathcal{D}^{(\ell)}(t, \Pi (r), r), \end{aligned} \end{equation} with the hypotheses of Lemma~\ref{lem:ODE} satisfied, and suppose that \begin{equation} \label{eq:ODEbis1}\begin{aligned} & \mathcal{D}^{(1)}(t,\Pi(r),r)-\mathcal{D}^{(2)}(t,\Pi(r),r)=\mathbf{S}^{0,M_0+1}_{n,M}(t,\Pi(r),r). \end{aligned} \end{equation} Let $r \mapsto r^t _{(\ell)} $ with $\ell =1,2$ be the flow for each of the two systems. Then for $\mathbf{s},\mathbf{s}'$ as in Lemma \ref{lem:ODE} we have \begin{equation} \label{eq:ODE1bis}\begin{aligned} & \| r^1_{(1)}- r^1_{(2)}\|_{\Sigma_{- {s}' }} \le C \| r\|_{\Sigma_{ - {s} }}^{M_0+1}. \end{aligned} \end{equation} \end{lemma} \proof The proof is elementary. We consider \begin{equation*} \begin{aligned} \sum_{\ell =1}^{2}(-)^\ell \frac{d}{dt} r_{(\ell)}^t &= \sum_{\ell =1}^{2}(-)^\ell {\mathbbm{i}} \sigma_3 {\mathcal R}^{0,M_0+1}_{n,M}(t, \Pi (r_{(\ell)}^t), r_{(\ell)}^t)\cdot \Diamond r_{(\ell)}^t\\& +\underbrace{\sum_{\ell =1}^{2}(-)^\ell\mathcal{D}^{(\ell)}(t, \Pi (r_{(2)}^t), r_{(2)}^t)}_{S^{0,M_0+1 }_{n,M}(t, \Pi (r_{(2)}^t), r_{(2)}^t)}+ \sum_{\ell =1}^{2}(-)^\ell\mathcal{D}^{(1)}(t, \Pi (r_{(\ell)}^t), r_{(\ell)}^t). \end{aligned} \end{equation*} Then for $\mathbf{x}_\ell ^t :=(\Pi (r_{(\ell)}^t), r_{(\ell)}^t) $ \begin{equation*} \begin{aligned} & \| r_{(2)} ^t- r_{(1)} ^t \|_{\Sigma_{-\mathbf{s} ' }} \le \sum_\ell \int_0^t \| r_{(\ell)} ^{t '} \|_{\Sigma_{- {s} }}^{M_0+2}\,dt' + \int_0^t \| r_{(2)} ^{t '}\|_{\Sigma_{- {s} }}^{M_0+1}\,dt' \\&+ \int_0^t \int_0^1 \| \partial_{\Pi (r)} \mathcal{D}^{(1)}(t', \mathbf{x}_1^{t '} + \tau (\mathbf{x}_2^{t '}-\mathbf{x}_1^{t '})) \|_{\Sigma_{- {s} }} |\Pi (r_{(2)} ^{t '}) - \Pi (r_{(1)} ^{t '}) |\,dt' \\& + \int_0^t \int_0^1 \| \partial_{r} \mathcal{D}^{(1)}(t', \mathbf{x}_1^{t '} + \tau (\mathbf{x}_2^{t '}-\mathbf{x}_1^{t '})) \|_{\Sigma_{- {s} } \to \Sigma_{- {s} }} \| r_{(2)} ^{t '} - r_{(1)}^{t '} \|_{\Sigma_{- {s} }}\,dt'. \end{aligned} \end{equation*} Since there is a fixed $C>0$ such that \begin{equation*} \begin{aligned} & \| r_{(\ell)} (t')\|_{\Sigma_{- {s} }}\le C \| r \|_{\Sigma_{- {s} }} \text{ from \eqref{eq:ODE1}}, \\& |\Pi (r_{(2)} ^{t '}) - \Pi (r_{(1)} ^{t '}) | \le \| r \|_{\Sigma_{- {s} }}^{M_0+1} \text{ from the previous one and \eqref{eq:ODE1}} \\& \| \partial_{r} \mathcal{D}^{(1)}(t, \Pi, \varrho, r) \|_{\Sigma_{-\mathbf{s} } \to \Sigma_{- {s} } } \le C \| r \|_{\Sigma_{- {s} }}^{M_0-1}, \\& \| \partial_{\varrho} \mathcal{D}^{(1)}(t, \Pi, \varrho, r) \|_{\Sigma_{- {s} } } \le C \| r \|_{\Sigma_{- {s} }}^{M_0 } \quad , \end{aligned} \end{equation*} where the last inequalities follow from \eqref{eq:opSymb}, for some fixed constant $C>0$ we obtain, \begin{equation*} \| r_{(2)} ^{t }- r_{(1)}^{t } \|_{\Sigma_{- {s} ' }} \le C\left( t\| r \|_{\Sigma_{- {s} }}^{M_0+1} + \| r \|_{\Sigma_{- {s} }}^{M_0-1} \int_0^t \| r_{(2)} ^{t '} - r_{(1)} ^{t '} \|_{\Sigma_{- {s} }}\,dt \right), \end{equation*} for $t\in[0,1]$, which by Gronwall's inequality yields \eqref{eq:ODE1bis}. \qed \begin{lemma} \label{lem:ODEtris} Under the hypotheses and notation of Lemma \ref{lem:ODEbis} we have \begin{equation} \label{eq:ODE1tris}\begin{aligned} & \Pi _j( r^1_{(1)}) - \Pi _j( r^1_{(2)}) ={\mathcal R} ^{0,M_0+2}_{ {s}, l} \text{ for }j=1,2,3,4. \end{aligned} \end{equation} \end{lemma} See Appendix \ref{sec:flowspf}. \section{Pullbacks of $K $} \label{sect:pullback} In the proof it is important to perform expansions of the functional $K$ analogous to Lemma~\ref{lem:back} but in different coordinate systems, which are obtained by repeated applications of maps of the type considered in Lemma~\ref{lem:ODE}. First of all, recall that in the coordinate system $(\left.\Pi_j\right |_{j=1}^{4},\tau,b, r)$ the function $K$ depends only on the coordinates $(\left.\Pi_j\right |_{j=1}^{4}, r)$. At this time we limit ourselves to $r\in T_{\Phi _{p^0} }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{ \mathbf{N}_0}$ for $\mathbf{N}_0 $ a large number. We can pick $\mathbf{N}_0 >2\mathbf{N}+2$ where $ \mathbf{N}$ is defined in \eqref{eq:h8}. Notice that \eqref{eq:SystE2} preserves this space. \noindent Next we consider the manifold defined by $ \left. (\Pi_j) \right |_{j=1}^{4} =\left. (\Pi_j(u_0)) \right |_{j=1}^{4} $ and the effect on $K$ of transformations like in Lemma~\ref{lem:ODE}. Then we have the following lemma, proved in \cite[Sect. 4]{Cu0}. \begin{lemma} \label{lem:ODE1} Consider $\mathfrak{F} =\mathfrak{F}^1 \circ \cdots \circ \mathfrak{F}^L$ with $ \mathfrak{F}^j= \mathfrak{F}^j_{t=1}$ transformations as in Lemma~\ref{lem:ODE} on the manifold defined by $ \left. (\Pi_j) \right |_{j=1}^{4} =\left. (\Pi_j(u_0)) \right |_{j=1}^{4} $. Suppose that for any $ \mathfrak{F}^j$ the $M_0 $ in Lemma~\ref{lem:ODE} equals $m_j$, where $1= m_1\le...\le m_L$ with the constant $i$ in Lemma~\ref{lem:ODE} (ii) equal to $1$ when $m_j=1$. Fix $M, k$ with $n_1\gg k\ge \mathbf{N}_0$ ($n_1$ picked in Lemma \ref{lem:modulation}). Then there is a $ n=n(L,M,k)$ such that if the assumptions of Lemma~\ref{lem:ODE} apply to each of operators $ \mathfrak{F}^j$ for $(M,n)$, there exist $\underline{{{\psi}}}(\varrho)\in C^\infty$ with $\underline{{\psi}}(\varrho)=O(|\varrho|^2)$ and a small $\varepsilon >0$ such that in $\mathcal{U}^{s}_{\varepsilon,k}$ for $s\ge n-(M+1)$ we have the expansion \begin{align} \label{eq:back1} & K \circ \mathfrak{F} = \underline{{{\psi}}} (\Pi (r)\left. \right | _{j=1}^{4}) + \frac{1}{2}\Omega (\mathcal{H}_{ p} P_{ p}r, P_{ p}r) + {\mathcal R}^{1,2}_{k,M} + E_P(P_{ p}r)+\textbf{R}'', \\& \textbf{R}'':= \sum_{d=2}^4 \langle B_{d } (\Pi (r) , r), (P_{ p}r)^{ d} \rangle +\int_{\mathbb{R}^3}B_5 (x, \Pi (r) , r, r(x)) (P_{ p}r)^{ 5}(x)\,dx, \nonumber \end{align} with: \begin{itemize} \item $B_2(0,0)=0$; \item $B_{d}(\varrho, r) \in C^{M } (\mathcal{U}_{-k}, \Sigma_k (\mathbb{R}^3, B ( (\mathbb{R}^{4 })^{\otimes d},\mathbb{R}))) $, $2\le d \le 4$, with $\mathcal{U}_{-k}\subset \mathbb{R}^7 \times (T_{\Phi_{p^0} }^{\perp_\Omega}\mathcal{M} \cap \Sigma_{-k})$ an open neighborhood of $(0,0)$; \item for $ \zeta \in \mathbb{R}^{4 }$ $(\varrho, r) \in \mathcal{U}_{-k}$ we have for $i\le M$ \begin{equation*} \label{eq:B5a} \begin{aligned} & \| \nabla_{ r,\varrho,\zeta}^iB_5(\varrho,r,\zeta)\|_{\Sigma_k(\mathbb{R}^3, B ((\mathbb{R}^{4 })^{\otimes 5},\mathbb{R})} \le C_i. \end{aligned} \end{equation*} \end{itemize} \end{lemma} \proof As mentioned above, the proof is in \cite{Cu0}. Nonetheless we make some comments. First of all, by \eqref{eq:reg1} we have, for $k\le n-L(M+1) $, \begin{equation}\label{eq:lossreg} \mathcal{U}_{\varepsilon_{L+1},k}^{n-(M+1)} \stackrel{\mathfrak{F}^L }{\longrightarrow} \mathcal{U}_{\varepsilon_L,k}^{n- 2(M+1)}...\stackrel{\mathfrak{F}^2 }{\longrightarrow} \mathcal{U}_{\varepsilon_2,k}^{n- L (M+1)} \stackrel{\mathfrak{F}^1 }{\longrightarrow} \mathcal{U}_{\varepsilon_1,k}^{n-(L+1)(M+1)}\subset \mathcal{U}_{\varepsilon_1,k}^{ k+3} \subset \mathcal{U}_{\varepsilon_1,k}^{\mathbf{N}_0} , \end{equation} where each map is $C^M$ if we pick $n_1\ge n = n (L,M,k) := k+3 +(L+1)(M+1)$ and then we get $\mathfrak{F}\in C^M (\mathcal{U}_{\varepsilon_{L+1},k}^{n-(M+1)}, \mathcal{U}_{\varepsilon_1,k}^{ k+3}) $. \noindent By \eqref{eq:ODE1}, the $r$--th component of $\mathfrak{F}$ is of the form \begin{equation} \label{eq:structf}\begin{aligned} & \mathfrak{F} ( \varrho, r) = e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^4{\mathcal R}^{1,1 }_{ k+3,M}(\varrho, r) \Diamond _j } T( e^{ \sum _{i=1}^3 {\mathcal R}^{1,1 }_{ k+3,M}(\varrho, r) {\mathbbm{i}} \sigma _i } ) (r+ \mathbf{{S}}^{1,1 }_{ k+3,M} (\varrho, r)). \end{aligned} \end{equation} Then by $[\Diamond _j,\Diamond _k]=0$ for all $k$ if $j\le 4$ we have \begin{equation*} \Pi _j(r) | _{j=1}^{4}\circ \mathfrak{F} = \Pi _j(r+ \mathbf{{S}}^{1,1 }_{ k+3,M} \Pi (r), r)) | _{j=1}^{4} = \Pi (r)| _{j=1}^{4} +\mathcal{R}^{1, 2}_{k+2,M}(\Pi (r), r) . \end{equation*} From \eqref{eq:variables} we have \begin{equation*} \label{eq:ODE2}\begin{aligned} & p\circ \mathfrak{F} = p +\mathcal{R}^{1, 2}_{k+2,M} \text{ and so } \Phi_{ p}\circ \mathfrak{F} = \Phi_{p} + \mathbf{S}^{1, 2}_{k+2,M}. \end{aligned} \end{equation*} Then we have \begin{equation*} \begin{aligned} & E(u\circ \mathfrak{F})= E\Big(e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j \Diamond_j } (\sqrt{1-| b |^2} + b \sigma_2 \mathbf{C}) (\Phi_{ p } +P_{ p}r)\circ \mathfrak{F}\Big) \\& = E((\Phi_{ p } +P_{ p}r)\circ \mathfrak{F}) = E(\Phi_{ p} + \mathbf{S}^{1, 2}_{k+2,M} +P_{ p }(e^{{\mathbbm{i}} \sigma_3{\mathcal R}^{1,1 }_{ k+2,M} \cdot \Diamond } (r+ \mathbf{{S}}^{1,1 }_{ k+2,M})) \\&= E(\Phi_{ p } +P_{ p}r +\mathbf{S}^{1, 2}_{k+2,M} + P_{ p}\mathbf{S}^{1, 1}_{k+2,M}), \end{aligned} \end{equation*} where in the first equality we used \eqref{eq:coordinate}, the fact that the manifold $ \left. (\Pi_j) \right |_{j=1}^{4} =\left. (\Pi_j(u_0)) \right |_{j=1}^{4} $ is parametrized by $(\left. (\tau_j ) \right |_{j=1}^{4},b, r)$ and that the transformations in Lemma~\ref{lem:ODE} only affect the variable $r$; in the second Lemma~\ref{lem:cons0}; in the third the previous two formulas, and in the fourth the commutation \begin{equation*}\begin{aligned} & [P_{ p },e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^4{\mathcal R}^{1,1 }_{ k+3,M} \Diamond _j } T( e^{ \sum _{i=1}^3 {\mathcal R}^{1,1 }_{ k+3,M} ) \mathbbm{i} \sigma _i } ]r\\& = [e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^4{\mathcal R}^{1,1 }_{ k+3,M} \Diamond _j } T( e^{ \sum _{i=1}^3 {\mathcal R}^{1,1 }_{ k+3,M} ) \mathbbm{i} \sigma _i },\widehat{P}_{ p }]r=\mathbf{S}^{1, 2}_{k+2,M}, \end{aligned} \end{equation*} where the proof in \cite[Lemma 4.1]{Cu0} holds. We get similarly for $1\le j \le 4$ \begin{equation*} \begin{aligned} \Pi _j(u\circ \mathfrak{F}) | _{j=1}^{4} &= \Pi _j(\Phi_{ p } +P_{ p}r +\mathbf{S}^{1, 2}_{k+2,M} + P_{ p}\mathbf{S}^{1, 1}_{k+2,M}) | _{j=1}^{4}= \Pi_j (\Phi_{ p } +P_{ p}r)| _{j=1}^{4} + \mathcal{R}^{1,2}_{k,m}. \end{aligned} \end{equation*} Then \begin{equation} \label{k-f-u} \begin{aligned} & {K}(\mathfrak{F}(u))= E (\Phi_{ p } +P_{ p}r +\mathbf{S}^{1, 2}_{k+2,M} + P_{ p}\mathbf{S}^{1, 1}_{k+2,M})- E\left (\Phi_{ {p}^0}\right) \\& \qquad\qquad\qquad -\sum _{j\le 4}(\lambda_j(p) + {\mathcal R}^{1,2}_{k+2,m}) \left (\Pi_j (\Phi_{ p } +P_{ p}r) + \mathcal{R}^{1,2}_{k,m} -\Pi_j\left (\Phi_{ {p}^0}\right) \right). \end{aligned} \end{equation} Like in \cite[Lemma 4.3]{Cu0}, we set \begin{equation*} \Psi = \Phi_{ p } +\mathbf{S}^{1, 2}_{k+2,M} + P_{ p}\mathbf{S}^{1, 1}_{k+2,M}; \end{equation*} we need to analyze $E(\Psi +P_{ p}r)$ which we break into (cf. \eqref{eq:energyfunctional}) \[ E(\Psi +P_{ p}r) = E_P(\Psi +P_{ p}r) + E_K(\Psi +P_{ p}r). \] It is also shown in \cite[Lemma 4.3]{Cu0} that \begin{equation} \label{eq:back2} \begin{aligned} & E_P(\Psi +P_{ p}r)= E_P(\Psi) + E_P(P_{ p}r) + \text{terms that can be incorporated into $ \textbf{R}'' $} \\& \qquad\qquad\qquad +\sum_{ j=0}^{1}\int_{\mathbb{R}^3}dx \int_{[0,1]^2} \frac{t^j}{j!} (\partial_t^{j+1})\at{t=0} \partial_s [B (|s \Psi+tP_{ p}r |^2) ]\,dt\,ds. \end{aligned} \end{equation} The second line of \eqref{eq:back2} equals \begin{equation} \label{eq:back3} \begin{aligned} & \int_{\mathbb{R}^3}dx \int_{[0,1]^2}\,dt\,ds \sum_{ j=0}^{1}\frac{t^j}{j!}(\partial_t^{j+1})\at{t=0} \partial_s \ \Big \{ \ \ B (|s \Phi_{ p}+tP_{ p}r |^2) + \\ & \qquad\qquad + \int_0^1 d\tau \partial_\tau [B (|s (\Phi_{ p} +\tau (\mathbf{S}^{1, 2}_{k+2,M} + P_{ p}\mathbf{S}^{1, 1}_{k+2,M}) +tP_{ p}r |^2) ] \ \ \Big \}. \end{aligned} \end{equation} The contribution from the last line of \eqref{eq:back3} can be incorporated into $\textbf{R}''+{\mathcal R}^{1,2}_{k,m}$. Notice that from the $j=0$ term in the first line of \eqref{eq:back3} we get \begin{equation} \label{eq:back31-1} 2\int_{\mathbb{R}^3}dx \int_{0}^1\,ds \partial_s [B' (|s \Phi_p |^2) s \Phi_{ p}\cdot P_{ p}r ] =2\int_{\mathbb{R}^3}dx B' (| \Phi_{ p} |^2) \Phi_{ p}\cdot P_{ p}r =\langle \nabla E_P(\Phi_{ p}), P_{ p} r\rangle. \end{equation} The $j=1$ term in the first line of \eqref{eq:back3} is $\frac{1}{2}\langle\nabla^2 E_P(\Phi_{p})P_{p}r,P_{p}r\rangle$; thus, \begin{eqnarray}\label{e-p} E_P(\Psi +P_{ p}r) = E_P(\Psi) + E_P(P_{ p}r) + \langle \nabla E_P(\Phi_{ p}), P_{ p} r\rangle + \frac{1}{2}\langle\nabla^2 E_P(\Phi_{p})P_{p}r,P_{p}r\rangle +\textbf{R}''+{\mathcal R}^{1,2}_{k,m}. \end{eqnarray} Then, \begin{eqnarray} \label{eq:back31} E_K(\Psi +P_{p}r) = E_K(\Psi) -\langle \Delta \Phi_{ p}, P_{ p}r \rangle +\overbrace{\langle -\Delta (\mathbf{S}^{1, 2}_{k+2,M} +P_{ p}\mathbf{S}^{1, 1}_{k+2,M}), P_{ p}r \rangle}^{{\mathcal R}^{1,2}_{k,m}} +E_K(P_{ p}r). \end{eqnarray} Using \eqref{eq:energyfunctional}, \eqref{eq:Omega}, \eqref{eq:eqphi} and the fact that ${\mathbbm{i}} \sigma_3\lambda (p)\cdot \Diamond \Phi_{ p }\in T_{ \Phi _{ p} }\mathcal{M}$, see \eqref{eq:Tmanifold}, we have \begin{equation*}\begin{aligned} \langle -\Delta \Phi_{ p}+\nabla E_P(\Phi_{ p}), P_{ p} r\rangle &= \langle \nabla E (\Phi_{ p }), P_{ p} r\rangle = -\Omega ({\mathbbm{i}} \sigma_3 \nabla E (\Phi_{ p }), P_{ p} r) = -\Omega ({\mathbbm{i}} \sigma_3 \lambda (p) \cdot \Diamond \Phi_{ p }, P_{ p} r) =0. \end{aligned} \end{equation*} Adding \eqref{e-p} and \eqref{eq:back31} and using the cancellation of the sum of the second term in the right-hand side of \eqref{eq:back31} with the term \eqref{eq:back31-1} which follows from the above relation, we arrive at \begin{eqnarray}\label{e-p-k} E(\Psi +P_{ p}r) = E(\Psi) + E(P_{ p}r) + \frac{1}{2}\langle\nabla^2 E_P(\Phi_{p})P_{p}r,P_{p}r\rangle +\textbf{R}''+{\mathcal R}^{1,2}_{k,m}, \end{eqnarray} where we used \eqref{eq:energyfunctional}. From \eqref{eq:eqphi}, \begin{equation} \label{lastform}\begin{aligned} E (\Psi) &= E (\Phi_{ p }) +\overbrace{\langle \nabla E(\Phi_{ p }), P_{ p }\mathbf{S}^{1,1}_{k+2,M}\rangle}^{0} + \overbrace{\langle \nabla E(\Phi_{ p }), \mathbf{S}^{1,2 }_{k+2,M} \rangle }^{ {\mathcal R}^{1,2 }_{k+2,M}}+ {\mathcal R}^{1,2 }_{k,M} = E (\Phi_{ p }) + {\mathcal R}^{1,2 }_{k,M}, \end{aligned} \end{equation} where the ${\mathcal R}^{1,2 }_{k,M}$ in the right-hand side is absorbed by ${\mathcal R}^{1,2 }_{k,M}$ in \eqref{eq:back1}. We have \begin{equation}\label{previousformula} \begin{aligned} -\lambda (p)\cdot \Pi (\Phi_{ p } +P_{ p}r) &= -\lambda (p)\cdot \Pi (\Phi_{ p })-\lambda (p)\cdot \Pi (P_{ p}r) - \langle \lambda (p)\cdot \Diamond \Phi_{ p },P_{ p}r \rangle \\& = -\lambda (p)\cdot \Pi (\Phi_{ p })-\lambda (p)\cdot \Pi (P_{ p}r), \end{aligned} \end{equation} where we used $\langle \lambda (p)\cdot \Diamond \Phi_{ p },P_{ p}r \rangle = \Omega (-{\mathbbm{i}} \sigma_3\lambda (p)\cdot \Diamond \Phi_{ p },P_{ p}r)=0$. Substituting \eqref{e-p-k} (where we apply \eqref{lastform}) and \eqref{previousformula} into \eqref{k-f-u}, we have: \begin{equation} \nonumber \begin{aligned} {K}(\mathfrak{F}(u)) &= E(\Phi_p) + E(P_{ p}r) + \frac{1}{2}\langle\nabla^2 E_P(\Phi_{p})P_{p}r,P_{p}r\rangle -E(\Phi_{p^0})\\& -\lambda (p)\cdot \Pi (\Phi_{ p })-\lambda (p)\cdot \Pi (P_{ p}r) + \lambda(p)\cdot\Pi(\Phi_{ {p}^0}) +\textbf{R}''+{\mathcal R}^{1,2}_{k,m}. .\end{aligned} \end{equation} By \eqref{def-d-p}, $d(p) =E(\Phi_{ p }) - \lambda (p) \cdot \Pi (\Phi_{ p })$. Then we have \begin{eqnarray} \label{eq:back4} E(\Phi_{ p }) - E(\Phi_{ {p}^0 })- \lambda (p)\cdot (\Pi (\Phi_{ p }) - \Pi (\Phi_{ {p}^0 })) &=& d(p)- d({p}^0)- (\lambda ({p}^0)-\lambda (p))\cdot {p}^{0 } \nonumber \\ &=& K (\Phi_{ p })= O((\Pi _j(r)| _{j=1}^{4})^2)+{\mathcal R}^{2,2}_{\infty, \infty}, \end{eqnarray} where $O((\Pi _j(r)| _{j=1}^{4})^2)$ is $\underline{{{\psi}}} (\Pi _j(r)| _{j=1}^{4})$ in \eqref{eq:back1} and ${\mathcal R}^{2,2}_{\infty, \infty}$ is absorbed inside ${\mathcal R}^{1,2}_{k,M}$. Thus, \[ {K}(\mathfrak{F}(u)) = \underline{{{\psi}}} (\Pi _j(r)| _{j=1}^{4}) +E(P_{ p}r) + \frac{1}{2}\langle\nabla^2 E_P(\Phi_{p})P_{p}r,P_{p}r\rangle -\lambda (p)\cdot \Pi (P_{ p}r) +\textbf{R}''+{\mathcal R}^{1,2}_{k,m}. \] Breaking $E(P_{ p}r)=E_P(P_{ p}r)+E_K(P_{ p}r)$ and using the relation \begin{equation*} \begin{aligned}& \frac{1}{2} \langle \nabla^2 E_P(\Phi_{ p })P_{ p } r, P_{ p } r\rangle + E_K(P_{ p }r)-\lambda (p) \cdot \Pi (P_{ p } r) \\ &\qquad = \frac{1}{2}\langle (\nabla^2 E (\Phi_{ p }) -\lambda (p) \cdot \Diamond)P_{ p } r, P_{ p } r\rangle = \frac{1}{2}\Omega (\mathcal{H}_{ p} P_{ p}r, P_{ p}r), \end{aligned} \end{equation*} we arrive at the conclusion of the lemma. \qed The following lemma is an elementary consequence of Lemma~\ref{lem:ODE1} and is proved in \cite[Lemma 4.4]{Cu0}. \begin{lemma} \label{lem:back11} Under the hypotheses and notation of Lemma~\ref{lem:ODE1}, for $\textbf{R}'$ like $\textbf{R}''$, for $ {{{\psi}}} \in C^\infty (\mathbb{R}^4, \mathbb{R})$ with $ {{\psi}} (\varrho) =O(| \varrho |^2)$, we have \begin{align} \label{eq:back11} & K \circ \mathfrak{F}= {{\psi}} (\Pi _j(r)| _{j=1}^{4}) + \frac{1}{2}\Omega (\mathcal{H}_{ {p}^0} r, r) + {\mathcal R}^{1,2}_{k,m} +E_P(r)+\textbf{R}', \\& \textbf{R} ':= \sum_{d=2}^4 \langle B_{d } (\Pi (r), r), r^{ d} \rangle +\int_{\mathbb{R}^3} B_5 (x, \Pi (r), r, r(x)) r)^{ 5}(x)\,dx, \nonumber \end{align} the $B_d$ for $2\le d\le 5$ with similar properties of the functions in Lemma~\ref{lem:back}. \end{lemma} \proof The proof, for whose details we refer to \cite{Cu0}, is obtained by writing \begin{equation*} P_{ p} r=r+(P_{ p} -P_{ {p}^0}) r=r +\mathbf{S}^{1,1}_{\infty,\infty} \end{equation*} and substituting $P_{ p} r=r +\mathbf{S}^{1,1}_{\infty,\infty}$ inside \eqref{eq:back1}. The fact that from $E_P(P_{ p}r)+\textbf{R}''$ in \eqref{eq:back1} we thus obtain a term which is contained in ${\mathcal R}^{1,2}_{k,m} +E_P(r)+\textbf{R}'$ in \eqref{eq:back11} is elementary and is discussed in \cite{Cu0}. \noindent We have \begin{equation} \label{eq:back012} \begin{aligned}& \frac{1}{2}\Omega (\mathcal{H}_{ p} P_{ p}r, P_{ p}r) = \frac 12 \langle -\Delta P_{ p}r, P_{ p}r \rangle - \lambda (p) \cdot \Pi (P_{ p}r) + \frac 12 \langle \nabla^2 E_P (\Phi_{ p}) P_{ p}r, P_{ p}r \rangle.\end{aligned} \end{equation} Then \begin{equation} \label{eq:back13} \begin{aligned} \langle -\Delta P_{ p}r, P_{ p}r \rangle &= \langle -\Delta r, r \rangle +{\mathcal R}^{1,2}_{k,m}, \quad \Pi (P_{ p}r) = \Pi (r) +{\mathcal R}^{1,2}_{k,m}, \\[1ex] \langle \nabla^2 E_P (\Phi_{ p})P_{ p}r, P_{ p}r \rangle & = \langle \nabla^2 E_P (\Phi_{ {p}^0}) r, r \rangle + {\mathcal R}^{1,2}_{k,m} + \langle (\nabla^2 E_P (\Phi_{ p})-\nabla^2 E_P (\Phi_{ {p}^0})) r, r \rangle, \\[1ex] \lambda (p) &=\lambda ({p}^0)+ {\mathcal R}^{1,0}_{\infty, \infty}(\Pi _j(r)| _{j=1}^{4}) + {\mathcal R}^{1,2}_{k,m}, \end{aligned} \nonumber \end{equation} where for the last line we considered \eqref{eq:variables} which implies \begin{equation*} \begin{aligned} & p=\Pi -\Pi (r) + {\mathcal R}^{1,2}_{\infty,\infty } \end{aligned} \end{equation*} and where ${\mathcal R}^{1,0}_{\infty, \infty}(\Pi (r))$ is smooth in the argument and is $O(|\Pi (r)|)$. \noindent Then we conclude that the right hand side of \eqref{eq:back012} is \begin{equation} \label{eq:back120} \begin{aligned} & \overbrace{2^{-1} \langle (-\Delta - \lambda ({p}^0) \cdot \Diamond +\nabla^2 E_P (\Phi_{ {p}^0})) r, r \rangle }^{2^{-1}\Omega (\mathcal{H}_{ {p}^0} r, r) }+{\mathcal R}^{2,0}_{\infty, \infty}(\Pi _j(r)| _{j=1}^{4}) +{\mathcal R}^{1,2}_{k,m} \\&+ 2^{-1}\langle (\nabla^2 E_P (\Phi_{ {p} })-\nabla^2 E_P (\Phi_{ {p}^0})) r, r \rangle, \end{aligned} \end{equation} where the last term can be absorbed in the $d=2$ term of $\textbf{R}'$ by \eqref{eq:variables}. Setting $\psi (\varrho) =\underline{\psi }(\varrho) +{\mathcal R}^{2,0}_{\infty,\infty} (\varrho)$ with the ${\mathcal R}^{2,0}_{\infty,\infty}$ in \eqref{eq:back120}, we get the desired result. \qed \section{The first application of the Darboux theorem } \label{sect:darboux1} Since normal forms arguments are crucial in the proof of Theorem~\ref{theorem-1.1}, it is important to settle on a coordinate system where the homological equations look manageable. Eventually we will settle on a coordinate system where the symplectic form is equal to the form $\Omega_0$ to be introduced in Section~\ref{sec:speccoo}. In the present section we discuss an intermediate symplectic form, denoted by $\Omega_0'$. In the previous section we considered the manifold $ \left. (\Pi_j) \right |_{j=1}^{4} =\left. (p^0_j) \right |_{j=1}^{4} $. Now we restrict further, picking $ \left. (\Pi_j) \right |_{j=1}^{6} =\left. (p^0_j ) \right |_{j=1}^{6} $. In particular we have $\Pi_j=0$ for $2\le j \le 6$. As a consequence, by the first two equations in \eqref{eq:lambdas11}, by $\Pi_j (\Phi_p+P_pr)= \Pi_j (P_pr)$ for $j=5,6$ and by $\Pi_7 (\Phi_p+P_pr)=p_4+ \Pi_7 (P_pr)$ we have \begin{equation}\label{eq:lambdas1--3} \begin{aligned} & 2 \sqrt{1-|b|^2} b_R (p_4+\Pi_{7}(P_pr))= (1-2b_R^2) \Pi_{5}(P_pr) -2b_I b_R \Pi_{6}(P_pr), \\& 2 \sqrt{1-|b|^2} b_I (p_4+\Pi_{7}(P_pr))= -2b_I b_R \Pi_{5}(P_pr) +(1-2b_I^2) \Pi_{6}(P_pr). \end{aligned} \end{equation} This, Lemma~\ref{lem:repp} and Implicit Function Theorem imply the following. \begin{lemma} \label{lem:repp1} On the manifold $\left.\Pi \right |_{j=1}^{6} =\left. p^0_j \right |_{j=1}^{6} $ there exist functions ${\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r) $ and functions ${\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r)) $ dependent only on $\Pi (r)$ such that \begin{equation}\label{eq:lambdas13} \begin{aligned} & b_R = \frac{1}{2p_4^0} \Pi_{5}(r)+ {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r)) + {\mathcal R}^{1,2}_{\infty,\infty} (\Pi (r), r) \\& b_I = \frac{1}{2p_4^0} \Pi_{6}(r)+ {\mathcal R}^{2,0}_{\infty,\infty} (\Pi (r)) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r). \end{aligned} \end{equation} \end{lemma} \noindent \textit{Proof (sketch)}.We consider the following change of coordinates, which defines $x_R$ and $x_I$: \begin{equation}\label{eq:lambdas1--4} 2p^0_4 b_R=\Pi_{5}(r) + x_R \text{ and } 2p^0_4 b_I=\Pi_{6}(r) + x_I. \end{equation} Substituting in the l.h.s. of \eqref{eq:lambdas1--3} both \eqref{eq:lambdas1--4} and $p_4=p_4^0-\Pi_4(r) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)$, see \eqref{eq:p in r}, and writing $\Pi_{j}(P_pr) = \Pi_{j}( r)+ {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r) $ everywhere in \eqref{eq:lambdas1--3}, from the 1st equation in \eqref{eq:lambdas1--3} we get \begin{equation}\nonumber \begin{aligned} & (1+O(b^2)) ( 1-\Pi_4(r) /p^0_4 +\Pi_{7}( r)/p^0_4 + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) (\Pi_{5}(r) + x_R) \\& =\Pi_{5}( r) + O(b^2 \Pi (r)) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) . \end{aligned} \end{equation} So, after an obvious cancelation, we have \begin{equation}\nonumber \begin{aligned} & (1+O(b^2)) ( 1-\Pi_4(r) /p^0_4 +\Pi_{7}( r)/p^0_4 + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) x_R \\& = {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r) ) + O(b^2 \Pi (r)) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) . \end{aligned} \end{equation} which in turn implies for $A=R$ \begin{equation}\nonumber \begin{aligned} & x_A = {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r) ) + O(b^2 \Pi (r)) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) \end{aligned} \end{equation} where the big $O$ is smooth. Since a similar equality holds also for $A=I$, substituting again $b$ by means of \eqref{eq:lambdas1--4} and applying the Implicit Function Theorem, we obtain \begin{equation}\nonumber \begin{aligned} & x_A = {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r) ) + {\mathcal R}^{1,2}_{\infty,\infty}(\Pi (r), r)) \text{ for $A=R,I$.} \end{aligned} \end{equation} \qed Our purpose now is to rewrite the form $\Gamma$ by elaborating on formula \eqref{eq:defgamma}. \noindent Differentiating in \eqref{eq:lambdas13}, we obtain \begin{equation}\label{eq:lambdas14} \begin{aligned} & db_R = \frac{1}{2p_4^0}\langle \sigma_3\sigma_2 \mathbf{C} r, dr\rangle + {\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))d\Pi (r)+ \langle \mathbf{ S}^{1,1}_{\infty,\infty},dr \rangle, \\& db_I = \frac{1}{2p_4^0}\langle {\mathbbm{i}} \sigma_3\sigma_2 \mathbf{C} r, dr\rangle + {\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))d\Pi (r)+ \langle \mathbf{ S}^{1,1}_{\infty,\infty},dr \rangle, \end{aligned} \end{equation} where $ {\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))d\Pi (r)$ stands for $ \sum_{j=1}^{7}{\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))d\Pi_j (r)$ with different real-valued functions from the class ${\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))$. For $1\le j\le 4$ we obtain from \eqref{eq:p in r}: \begin{equation*} \begin{aligned} & d p_j = -\langle \Diamond_jr +\mathbf{S}^{1,1}_{\infty,\infty},dr \rangle +\sum_{k\le 4} \mathcal{R}^{0,2}_{\infty,\infty} dp_k \end{aligned} \end{equation*} which solved in terms of the $dp_j$'s gives \begin{equation}\label{eq:dpj} \begin{aligned} & d p_j = -\sum_{k\le 4} \langle (\delta_{jk} +\mathcal{R}^{0,2}_{\infty,\infty})\Diamond_kr +\mathbf{S}^{1,1}_{\infty,\infty},dr \rangle. \end{aligned} \end{equation} We now consider the differential form $\Gamma$ in formula \eqref{eq:defgamma}, restricting $\Gamma$ on the manifold $\left.\Pi _j\right |_{j=1}^{6} =\left. p^{0}_j \right |_{j=1}^{6} $. Obviously $\left. d\Pi _k \right | _{\left.\Pi _j\right |_{j=1}^{6} =\left. p^{0}_j \right |_{j=1}^{6}}=0$ for $1\le k \le 4$, so that the 1st summation in the r.h.s. of \eqref{eq:defgamma} contributes 0. Using \eqref{eq:dpj} and $P_pr=r+\mathbf{S}^{1,1}_{\infty ,\infty}(\Pi (r), r)$ on this manifold, and simplifying the form $\varsigma$ using the fact that on this manifold $\Pi _5=\Pi _6=0$, \eqref{eq:defgamma} yields \begin{equation} \label{eq:eqB} \begin{aligned} & \Gamma = 2^{-1} \Omega (r, dr)+\langle \mathcal{R}^{0,2}_{\infty,\infty}(\Pi (r), r) \cdot \Diamond r + \mathbf{S}^{1,1}_{\infty,\infty}(\Pi (r), r), dr \rangle + \Pi_7\varpi, \end{aligned} \end{equation} where \begin{equation} \label{eq:eqB1}\begin{aligned} \varpi &= (b_R\,db_I-b_I\,db_R) =\frac{1}{4(p_4^0)^2} (\Pi_5(r) \langle {\mathbbm{i}} \sigma_3\sigma_2 \mathbf{C} r, dr\rangle -\Pi_6(r) \langle \sigma_3\sigma_2 \mathbf{C} r, dr\rangle) \\& + {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r))d\Pi (r)+ \langle \mathbf{ S}^{2,1}_{\infty,\infty} (\Pi (r), r),dr \rangle. \end{aligned} \end{equation} Notice that the manifold $ \Pi _j |_{j=1}^{6} = p^{0}_j |_{j=1}^{6} $ is parametrized by the variable $r\in T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap H^1 (\mathbb{R}^3, \mathbb{C}^2)$. On the other hand the additional equation $\Pi_7= p^{0}_7$ imposes a nonlinear constraint on $r$, see the third equality in \eqref{eq:lambdas11}. \noindent We modify the symplectic form by considering in $ \Pi _j |_{j=1}^{6} = p^{0}_j |_{j=1}^{6}$ the form \begin{equation} \label{eq:eqtildeB} \begin{aligned} &\Gamma ' := 2^{-1} \Omega (r, dr)+\langle \mathcal{R}^{0,2}_{\infty,\infty}(\Pi (r), r) \cdot \Diamond r + \mathbf{S}^{1,1}_{\infty,\infty}(\Pi (r), r), dr \rangle + p^{0}_7 \varpi \end{aligned} \end{equation} and correspondingly $ {\Omega}'=d \Gamma '$. $\Gamma '$ has been obtained from $\Gamma$ simply by replacing the function $\Pi _7$ with the constant $p^{0}_7$ in the last term of \eqref{eq:eqB}. While $ {\Omega}'$ differs from $\Omega$, nonetheless at the points of the submanifold $ \Pi _j |_{j=1}^{7} = p^{0}_j |_{j=1}^{7} $ of $\Pi _j |_{j=1}^{6} = p^{0}_j |_{j=1}^{6} $ the hamiltonian field of $K$ is the same for these two distinct symplectic forms, and it is tangent to the manifold $ \Pi _j |_{j=1}^{7} = p^{0}_j |_{j=1}^{7}$. Since we are interested only in the solutions of \eqref{eq:SystK} which live in $ \Pi _j |_{j=1}^{7} = p^{0}_j |_{j=1}^{7} $, but on the other hand we prefer $r$ to live in an open subspace of a Banach space, we simply replace $\Omega $ by $\Omega '$ and allow $r$ to vary freely in the Banach space, that is to say we work on the manifold $ \Pi _j |_{j=1}^{6} = p^{0}_j |_{j=1}^{6} $: in any case the trajectories of the hamiltonian field on $ \Pi _j |_{j=1}^{7} = p^{0}_j |_{j=1}^{7} $ do not change. Hence in the sequel we take as symplectic form $ {\Omega}'=d \Gamma'$. \noindent We introduce now \begin{equation} \label{eq:B0pr}\begin{aligned} &\Gamma_0' := 2^{-1} \Omega (r, dr)+\frac{ p^{0} _7}{4(p_4^0)^2} (\Pi_5(r) d\Pi_6(r) -\Pi_6(r) d\Pi_5(r)) + {\mathcal R}^{2,0}_{\infty,\infty}(\Pi (r))d\Pi (r) \end{aligned} \end{equation} so that \begin{equation} \label{eq:tildeB01}\begin{aligned} & \Gamma'-\Gamma_0' = \langle \mathbf{ S}^{2,1}_{\infty,\infty},dr \rangle. \end{aligned} \end{equation} Notice that the 2nd term in the r.h.s. of \eqref{eq:B0pr} is obtained multiplying by $ p^{0} _7$ the last term in the 1st line of \eqref{eq:eqB1} and using $ 2^{-1}d \langle \Diamond _j r, r \rangle = \langle\Diamond _j r, dr \rangle $, and by a similar multiplication the $ {\mathcal R}^{2,0}_{\infty,\infty}$ in \eqref{eq:B0pr} is obtained from the ${\mathcal R}^{2,0}_{\infty,\infty}$ in \eqref{eq:eqtildeB}. The 1-form $\Gamma_0'$ and the corresponding symplectic form \begin{equation}\label{eq:Omega00} \Omega_{0}':=d\Gamma_0' \end{equation} are just an intermediate step before turning to our final local model of symplectic form ${ { \Omega}}_0 =d\Gamma_0 $ which we will introduce in Section~\ref{sec:speccoo}. Looking at the r.h.s. of \eqref{eq:tildeB01} we have \begin{equation*} \begin{aligned} d\langle \mathbf{ S}^{2,1}_{\infty,\infty},dr \rangle =& \langle \left. \partial_{r}\mathbf{S}^{2,1}_{\infty,\infty} (\rho, r) \right |_{\rho = \Pi (r) } dr, dr\rangle +\sum_{j=1}^{7} \langle\mathbf{S}^{1,1}_{\infty,\infty}, dr \rangle \wedge \langle \Diamond_j r, dr \rangle, \end{aligned} \end{equation*} where we used $ \partial_\varrho \mathbf{ S}^{2,1}_{\infty,\infty} (\varrho, r) = \mathbf{S}^{1,1}_{\infty,\infty} (\rho, r)$. \noindent Our aim is to define a diffeomorphism in the $r$ variable which transforms $ {\Omega}' $ to $\Omega '_0 $; that is to say, to prove the Darboux theorem. We want this diffeomorphism to be generated by flows like the one in Lemma~\ref{lem:ODE}, and that is why we do not apply abstract arguments in the sequel. \noindent We consider the symplectic forms $\Omega_t':=\Omega_0'+t({\Omega}' -\Omega_0')$ and solve a linear system to obtain a vector field which is dual in an appropriate sense to the 1-form $\Gamma-\Gamma_0'$. \begin{lemma} \label{lem:vectorfield0} For the $n_1 $ the index in Lemma \ref{lem:modulation} and for $\varepsilon_1>0$ consider the subset \[ \mathcal{U}_{1} = \left\{ r\in T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap H^1(\mathbb{R}^3, \mathbb{C}^2); \quad \|r\|_{\Sigma_{-n_1}}\le \varepsilon_1, \quad | \Pi(r)|\le \varepsilon_1 \right\}. \] Then for $ \varepsilon _1 $ small enough there is a unique vector field $ \mathcal{X}^{t } $ in $\mathcal{U}_{1}$ s.t. $ i_{\mathcal{X}^{t }} \Omega_t' =\Gamma _0'-\Gamma ' $ for $|t|<5$ with \begin{equation}\label{eq:quasilin1} \begin{aligned} & \mathcal{X}^{ t } = {\mathbbm{i}} \sigma_3 \mathcal{A }\cdot \Diamond r + \mathcal{D}, \text{ with} \end{aligned} \end{equation} \begin{equation}\label{eq:quasilin2} \begin{aligned} & \mathcal{A }_j=\mathcal{R}^{0,2}_{{n_1},\infty} (t, \Pi (r),r) \text{ and } \mathcal{D } =\mathbf{S}^{1,1}_{n_1,\infty }(t, \Pi (r),r). \end{aligned} \end{equation} \end{lemma} \proof The proof is similar to \cite[Lemma 3.4]{Cu0}. First of all we find the field $Y$ such that $ i_{Y} \Omega_0'=\Gamma _0'-\Gamma ' $, where the interior product is defined by $ i_{Y} \Omega_0 '(X):= \Omega_0' (Y, X) $, with $\Omega_0'=d\Gamma _0'$ and with $\Gamma _0'$ defined in \eqref{eq:B0pr}, schematically we have \begin{equation} \label{eq:Omega01}\begin{aligned} \Omega_0 ' =& \frac{p^0_7}{2(p^0_4)^2}d\Pi_5(r)\wedge d\Pi_6(r)+ {\mathcal R}^{1,0}_{\infty,\infty}(\Pi (r))d\Pi (r)\wedge d\Pi (r) + \Omega (dr, dr). \end{aligned} \end{equation} We claim that \begin{equation} \label{eq:Yvec} \begin{aligned} & Y= P_{p^0}{\mathbbm{i}} \sigma_3\mathcal{R}^{2,2}_{{n_1},\infty}\cdot \Diamond r + \mathbf{S}^{2,1}_{{n_1},\infty} ={\mathbbm{i}} \sigma_3\mathcal{R}^{0,2}_{{n_1},\infty}\cdot \Diamond r + \mathbf{S}^{1,1}_{{n_1},\infty}. \end{aligned} \end{equation} To prove \eqref{eq:Yvec} we observe that $ i_{Y} \Omega_0'=\Gamma_0'-\Gamma ' $ is, schematically, \begin{equation*} {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (r)) \langle \Diamond r, Y\rangle \langle \Diamond r, dr\rangle + \langle P_{p^0} {\mathbbm{i}} \sigma_3 Y, dr\rangle = \langle \mathbf{ S}^{2,1}_{\infty,\infty},dr \rangle. \end{equation*} After elementary manipulations \begin{equation*} Y = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (r)) \langle \Diamond r, Y\rangle {\mathbbm{i}} \sigma_3\Diamond r +\mathbf{ S}^{2,1}_{\infty,\infty}. \end{equation*} To solve this equation, we write $\displaystyle Y = \sum_{i=0}^{\infty} Y_i$, where \begin{equation*}\begin{aligned} Y_0&= \mathbf{ S}^{2,1}_{\infty,\infty} \text{ and}\\ Y_{i+1}&={\mathcal R}^{0,0}_{\infty,\infty}(\Pi (r))\langle \Diamond r, Y_{i} \rangle P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond r = (\mathcal{R}^{0,0}_{\infty,\infty})^{i+1}\langle \Diamond r,P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond r \rangle^{i} \langle \Diamond r, \mathbf{ S}^{2,1}_{\infty,\infty} \rangle P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond r, \end{aligned} \end{equation*} where, by direct computation, for any pair $(j,k)\in\mathbb{N}\times\mathbb{N}$, $\langle \Diamond_jr, P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond_k r \rangle$ is a bounded bilinear form in $ L^2(\mathbb{R}^3, \mathbb{C}^4)$ for all $j,k$. Since $\langle \Diamond r, \mathbf{ S}^{2,1}_{\infty,\infty} \rangle = \mathcal{R}^{2,2}_{\infty,\infty} $ and since the series defining $Y$ is convergent for $\| r \|_{ L^2(\mathbb{R}^3, \mathbb{C}^4)} = \sqrt{2 \Pi_4(r)}$ small enough, we conclude that $Y$ is as in \eqref{eq:Yvec}. \noindent Next we consider the operator $\mathcal{K} $ defined by $ i_{X} d(\Gamma '-\Gamma _0') = i_{\mathcal{K} X} \Omega '_0$. We claim that \begin{align} \mathcal{K} X =& (P_{p^0} {\mathbbm{i}} \sigma_3{\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r + \mathbf{S}^{0,1}_{{n_1},\infty}) \langle {\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{{n_1},\infty},X \rangle + P_{p^0} {\mathbbm{i}} \sigma_3 \left. \partial_{r}\mathbf{S}^{2,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)}X. \label{eq:fred-1} \end{align} First of all, schematically, \begin{equation*} \begin{aligned} & d(\Gamma '-\Gamma _0') = d \langle \mathbf{ S}^{2,1}_{\infty,\infty},dr \rangle= d\Pi (r) \wedge \langle \mathbf{ S}^{1,1}_{\infty,\infty},dr \rangle + \langle \left. \partial_r\mathbf{ S}^{2,1}_{\infty,\infty} \right |_{\varrho =\Pi (r) }dr,dr \rangle \end{aligned} \end{equation*} so that \begin{equation*} \begin{aligned} & i_Xd(\Gamma '-\Gamma _0') = \langle {K}_0 X, dr \rangle \text{ for }\\& {K}_0 X= \langle \Diamond r, X \rangle \mathbf{ S}^{1,1}_{\infty,\infty} + \langle \mathbf{ S}^{1,1}_{\infty,\infty},X \rangle P_{p^0}^*\Diamond r + \left. \partial_r\mathbf{ S}^{2,1}_{\infty,\infty} \right |_{\varrho =\Pi (r) } X. \end{aligned} \end{equation*} Similarly, we have \begin{equation*} \begin{aligned} & i_{\mathcal{K} X} \Omega '_0 = \langle \langle \Diamond r, \mathcal{K}X\rangle \Diamond r +{\mathbbm{i}} \sigma_3 \mathcal{K}X, dr \rangle.\end{aligned} \end{equation*} Hence $ i_{\mathcal{K} X} \Omega '_0 =i_{X} d(\Gamma '-\Gamma _0') $ is of the form \begin{equation} \label{eq:fred-2}\begin{aligned} & \mathcal{K}X -\langle \Diamond r, \mathcal{K}X \rangle P_{p^0}{\mathbbm{i}} \sigma_3 \Diamond r =\mathcal{K}_0X, \quad \text{where } \mathcal{K}_0=-{\mathbbm{i}} \sigma_3 K_0. \end{aligned} \end{equation} Then we set $\displaystyle \mathcal{K} =\sum_{i=0}^{\infty}\mathcal{K}_i$ with $\mathcal{K}_0$ defined in \eqref{eq:fred-2} and \begin{equation} \label{eq:fred-3} \begin{aligned} & \mathcal{K}_{i+1}X = \langle \Diamond r, \mathcal{K}_{i }X \rangle P_{p^0}{\mathbbm{i}} \sigma_3 \Diamond r = \langle \Diamond r, P_{p^0}{\mathbbm{i}} \sigma_3 \Diamond r \rangle^{i}\langle \Diamond r, \mathcal{K}_{0 }X \rangle P_{p^0}{\mathbbm{i}} \sigma_3 \Diamond r.\end{aligned} \end{equation} By \eqref{eq:fred-2} have \begin{equation*} \begin{aligned} & \langle \Diamond r, \mathcal{K}_{0 }X \rangle = \langle \Diamond r, \mathbf{ S}^{1,1}_{\infty,\infty} \rangle \langle \Diamond r, X \rangle + \langle \Diamond r, P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond r \rangle \langle \mathbf{ S}^{1,1}_{\infty,\infty},X \rangle + \langle \left [ \left. \partial_r\mathbf{ S}^{2,1}_{\infty,\infty} \right |_{\varrho =\Pi (r) }\right ]^*\Diamond r, X \rangle \end{aligned} \end{equation*} Since $ \langle \Diamond r, \mathbf{ S}^{1,1}_{\infty,\infty} \rangle = {\mathcal R}^{1,2}_{\infty,\infty} $, $ \langle \Diamond r, P_{p^0} {\mathbbm{i}} \sigma_3 \Diamond r \rangle= {\mathcal R}^{1,0}_{\infty,\infty}$ and $\left [ \left. \partial_r\mathbf{ S}^{2,1}_{\infty,\infty} \right |_{\varrho =\Pi (r) }\right ]^*\Diamond r =\mathbf{ S}^{2,1}_{\infty,\infty} $ we conclude that \begin{equation*} \begin{aligned} & \langle \Diamond r, \mathcal{K}_{0 }X \rangle = \langle {\mathcal R}^{1,2}_{\infty,\infty} \Diamond r + \mathbf{ S}^{1,1}_{\infty,\infty}, X \rangle. \end{aligned} \end{equation*} This and \eqref{eq:fred-2}--\eqref{eq:fred-3} yields \eqref{eq:fred-1}. \noindent The equation $ i_{\mathcal{X}^{t }} \Omega_t ' =\Gamma_0'-\Gamma ' $ is equivalent to \begin{equation} \label{eq:fred1} \begin{aligned} & (1+ t\mathcal{K})\mathcal{X}^t=Y \end{aligned} \end{equation} and so by \eqref{eq:fred-1} \begin{equation*} \begin{aligned} \mathcal{X}^t +& ({\mathbbm{i}} \sigma_3{\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{{n_1},\infty}) \langle {\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{n,\infty}, \mathcal{X}^t \rangle - t {\mathbbm{i}} \sigma_3 \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)} \mathcal{X}^t \\& ={\mathbbm{i}} \sigma_3\mathcal{R}^{0,2}_{{n_1},\infty} \cdot \Diamond r + \mathbf{S}^{1,1}_{{n_1},\infty}. \end{aligned}\end{equation*} Set $ \mathcal{X}^t ={\mathbbm{i}} \sigma_3\widetilde{\mathcal{R}} \cdot \Diamond r + \widetilde{\mathbf{S}} $ for unknown $\widetilde{\mathcal{R}} $ and $\widetilde{\mathbf{S}} $. Then the above equation is satisfied if, schematically, \begin{equation*} \begin{aligned} \widetilde{\mathcal{R}} &+{\mathcal R}^{0,2}_{{n_1},\infty}\langle \mathbf{S}^{0,1}_{{n_1},\infty}, \Diamond r \rangle \widetilde{\mathcal{R}} + {\mathcal R}^{0,2}_{{n_1},\infty}\langle {\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{{n_1},\infty},\widetilde{\mathbf{S}} \rangle = {\mathcal R}^{0,2}_{{n_1},\infty}\\ \widetilde{\mathbf{S}} &+\widetilde{\mathcal{R}}^{0,2} \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1}n ,\infty} \right |_{\rho =\Pi (r)}{\mathbbm{i}} \sigma_3 \Diamond r + \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)}\widetilde{\mathbf{S}} + \mathbf{S}^{0,1}_{{n_1},\infty} \widetilde{\mathcal{R}} \langle \mathbf{S}^{0,1}_{{n_1},\infty},\Diamond r \rangle \\& + \mathbf{S}^{0,1}_{{n_1},\infty}\langle {\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{{n_1},\infty},\widetilde{\mathbf{S}} \rangle = \mathbf{S}^{1,1}_{{n_1},\infty}. \end{aligned}\end{equation*} Since, as can be seen from Definitions~\ref{def:scalSymb} and~\ref{def:opSymb}, we have $\langle \mathbf{S}^{0,1}_{{n_1},\infty},\Diamond r \rangle = {\mathcal R}^{0,2}_{{n_1},\infty}$, ${\mathcal R}^{i,l}_{{n_1},m} \mathbf{S}^{j,k}_{{n_1},m}=\mathbf{S}^{i+j,l+k}_{{n_1},m} $ and ${\mathcal R}^{i,l}_{{n_1},m} {\mathcal R}^{j,k}_{{n_1},m}={\mathcal R}^{i+j,l+k}_{{n_1},m} $, then \begin{equation*} \text{$\widetilde{\mathcal{R}} ={\mathcal{R}}^{0,2}_{n,\infty}+\langle {\mathcal R}^{0,4}_{n,\infty}\Diamond r +\mathbf{S}^{0,3}_{n,\infty},\widetilde{\mathbf{S}} \rangle$.} \end{equation*} Furthermore we have $ \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)} \in C^\infty (\mathcal{U}, B(\Sigma_{-{n_1}}, \Sigma_{{n_1}}))$ for $\mathcal{U}$ an open neighborhood of $(0,0)$ in $\mathbb{R}^7\times T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap \Sigma_{-{n_1}} (\mathbb{R}^3, \mathbb{C}^2)$ and \begin{equation*} \| \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)} \|_{B(\Sigma_{-{n_1}}, \Sigma_{{n_1}})}\le C (\| r\|_{\Sigma_{-{n_1}}}+|\Pi (r) |). \end{equation*} Then it follows \begin{equation*} \begin{aligned} & \widetilde{\mathbf{S}} + \mathfrak{L}\widetilde{\mathbf{S}} = \mathbf{S}^{1,1}_{{n_1},\infty},\quad \text{where}\\& \mathfrak{L}X:= \left. \partial_{r}\mathbf{S}^{1,1}_{{n_1},\infty} \right |_{\rho =\Pi (r)}X + \mathbf{S}^{0,1}_{{n_1},\infty}\langle {\mathcal R}^{0,2}_{{n_1},\infty}\Diamond r +\mathbf{S}^{0,1}_{{n_1},\infty},X \rangle. \end{aligned}\end{equation*} Notice that $\mathfrak{L}\in C^{\infty} (\mathcal{U}, B(\Sigma_{-{n_1}} (\mathbb{R}^3, \mathbb{C}^2),\Sigma_{ {n_1}} (\mathbb{R}^3, \mathbb{C}^2)))$ with \begin{equation*} \| \mathfrak{L} \|_{B(\Sigma_{-{n_1}} (\mathbb{R}^3, \mathbb{C}^2),\Sigma_{ {n_1}} (\mathbb{R}^3, \mathbb{C}^2))} \le C \varepsilon_0. \end{equation*} Then there exists $\widetilde{\mathbf{S}} \in C^{\infty} (\mathcal{U}, \Sigma_{ {n_1}} (\mathbb{R}^3, \mathbb{C}^2))$ solving $\widetilde{\mathbf{S}} + \mathfrak{L}\widetilde{\mathbf{S}} = \mathbf{S}^{1,1}_{n,\infty} $. Performing a Neumann expansion $(1+\mathfrak{L} ) ^{-1}=\sum _{j=0} ^{\infty} (-\mathfrak{L} )^j $ we see that $\widetilde{\mathbf{S}} = \mathbf{S}^{1,1}_{{n_1},\infty} $. \qed \noindent Classically the Darboux Theorem follows by $ i_{\mathcal{X} ^{t }} \Omega_t' =\Gamma _0'-\Gamma ' $ and by \begin{equation}\label{eq:fdarboux} \begin{aligned} & \partial_t (\mathfrak{F}_{ t }^*\Omega_t') = \mathfrak{F}_{ t }^* (L_{\mathcal{ X}^{ t }}\Omega_t' +\partial_t\Omega_t') = \mathfrak{F}_{ t }^* (d i_{\mathcal{X}^{ t }}\Omega '_t +d(\Gamma '-\Gamma_0')) =0 \end{aligned} \end{equation} with $L_X$ the Lie derivative, whose definition is not needed here. Since this $\mathfrak{F}_{ t }$ is not a differentiable flow on any given manifold, \eqref{eq:fdarboux} is formal. Still, \cite[Sect. 3.3 and Sect. 7]{Cu0} (i.e. a regularization and a limit argument for $ \mathfrak{F}_{t }$) yield: \begin{lemma} \label{lem:darboux} Consider \eqref{eq:ODE} defined by the field ${\mathcal X}^{t }$ and consider indexes and notation of Lemma~\ref{lem:ODE} (in particular $M_0=1$ and $i=1$; $n$ and $M$ can be arbitrary as long as we fix ${n_1}$ large enough). Consider $l$, $ {s}'$,$ {s}$ and $k$ as in \eqref{eq:index1}. Then for $\mathfrak{F}_{1 } \in C^l(\mathcal{U}_{\varepsilon _2,k}^{\mathbf{s}'}, \mathcal{U}_{\varepsilon _1,k}^{\mathbf{s}})$ derived from \eqref{eq:reg1}, we have $ \mathfrak{F}_{1 }^* \Omega' =\Omega_0'$. \qed \end{lemma} \section{Spectral coordinates associated to $\mathcal{H}_{ p^0}$} \label{sec:speccoo} As we will see later the symplectic form $\Omega '_0$ introduced in Lemma~\ref{lem:darboux} is not the most optimal symplectic form on which we will perform a normal form argument. We will need a new form $\Omega_0$. However, before introducing it, we need to consider the spectral decomposition of $\mathcal{H}_{ p^0}$. \noindent In the sequel we assume $p^0=p(\omega^0,0)$. Recall the operator $ \mathcal{H}_{ p^0} $ is defined in $L^ 2(\mathbb{R}^3, \mathbb{C}^2)$ is not $\mathbb{C}$-linear (because of $ \mathfrak{L}^{(1)}_{\omega^0 }$), but rather $\mathbb{R}$-linear. To make it $\mathbb{C}$-linear, we consider the complexification \[ L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}. \] To avoid the confusion between $\mathbb{C}$ in the left factor and $\mathbb{C}$ on the right, we will use $\mbox{$\imath\hskip -4pt\imath\,$}$ to denote the imaginary unit in the latter space; that is, given $u\in L^ 2(\mathbb{R}^3, \mathbb{C}^2)$, we will have $u\otimes(a+\mbox{$\imath\hskip -4pt\imath\,$} b)\in L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$. Notice that the domain of $ \mathcal{H}_{ p^0} $ in $L^ 2(\mathbb{R}^3, \mathbb{C}^2) $ is $ H^2(\mathbb{R}^3, \mathbb{C}^2) $; we extend it to $L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$ with the domain $H^2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$ by setting $ \mathcal{H}_{ p^0}(v\otimes z)=(\mathcal{H}_{ p^0} v) \otimes z $. \noindent We extend the bilinear form $\langle\,,\,\rangle $ defined in \eqref{eq:hermitian} to a $\mathbb{C}$-bilinear form on $L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$ by \begin{equation*} \langle u\otimes z, v\otimes \zeta\rangle = z\zeta \langle u, v \rangle, \qquad u,\,v\in L^ 2(\mathbb{R}^3, \mathbb{C}^2), \quad z,\,\zeta\in\mathbb{C}. \end{equation*} We also extend $\Omega$ onto $L^2(\mathbb{R}^3,\mathbb{C}^2)\otimes_\mathbb{R}\mathbb{C}$, setting $\Omega (X,Y)=\langle {\mathbbm{i}} \sigma_3 X,Y \rangle$. Then the decomposition \eqref{eq:dirsum} extends into \begin{equation}\label{eq:dirsumc} \begin{aligned} & L^2(\mathbb{R}^3, \mathbb{C}^4) \otimes_\mathbb{R} \mathbb{C} = (T_{ \Phi_{p^0} }^{\perp_\Omega}\mathcal{M}\otimes_\mathbb{R} \mathbb{C}) \oplus (T_{ \Phi_{p^0} }\mathcal{M}\cap H^1(\mathbb{R}^3, \mathbb{C}^2)) \otimes_\mathbb{R} \mathbb{C}. \end{aligned} \end{equation} Note that the extention of $ \mathcal{H}_{ p^0} $ onto $L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$ is such that its action preserves the decomposition \eqref{eq:dirsumc}. \noindent The complex conjugation on $ L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$ is defined by $ \overline{v \otimes z} := v \otimes \overline{z} $. \noindent Notice that if $\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{ p^0} \xi_l =\mathbf{e}_l \xi_l $ with $\mathbf{e}_l >0$, then applying the complex conjugation we obtain $\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{ p^0} \overline{\xi}_l =-\mathbf{e}_l \overline{\xi}_l $. \noindent By Weyl's theorem, $\sigma_e(\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{ p^0}) = (-\infty, - \omega^0]\cup [ \omega^0, \infty)$. It is also elementary to show that $\sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathbbm{i}\mathfrak{L}^{(2)}_{\omega^0} ) \subset [- \omega^0, \omega^0 ]$. We will assume the generic fact that $\sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathbbm{i}\mathfrak{L}^{(2)}_{\omega^0} ) \subset (- \omega^0, \omega^0)$ and that $\pm \omega^0$ are not resonances. This is the same as assuming that $z=0$ is neither a resonance nor an eigenvalue for the Schr\"odinger operator $-\Delta + \beta (\phi_{\omega^0}^2)$. For the operator $\mathbbm{i}\mathfrak{L}^{(1)}_{\omega^0}$, which coincides with the linearization at $e^{{\mathbbm{i}} t \omega^0} \phi_{\omega^0}$ of the scalar equation \eqref{Eq:scalNLS}, we will assume analogues of hypotheses (L1)--(L6) in \cite[Sect. 5]{Cu0} made in the context of asymptotic stability of the scalar equation \eqref{Eq:scalNLS}. However, the conditions we are to impose are more restrictive since $\sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{ p^0}) =\sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathbbm{i}\mathfrak{L}^{(1)}_{\omega^0}) \cup \sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathbbm{i}\mathfrak{L}^{(2)}_{\omega^0}) $. We impose the following hypotheses. \begin{itemize} \item[(H6)] For any eigenvalue $ \mathfrak{e} \in \sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{p^0}) \backslash \{ 0 \}$ its algebraic and geometric multiplicities coincide and are finite. \item [(H7)] There is a number $N\in\mathbb{N}$ and positive numbers $0<\mathbf{e}_1 < \mathbf{e}_2 <\ldots<\mathbf{e}_N <\omega^0$ such that $\sigma_p(\mathcal{H}_{ p^0})$ consists exactly of the numbers $\pm \mbox{$\imath\hskip -4pt\imath\,$} \mathbf{e}_\ell $ and $0$. Denote $d_\ell:=\dim\ker (\mathcal{H}_{ p^0} -\mbox{$\imath\hskip -4pt\imath\,$} \mathbf{e}_\ell)$ and let \[ \mathbf{n}=\sum\sb{\ell=1}\sp{N}d_\ell. \] \item[(H8)] We define \begin{equation}\label{eq:h8} \mathbf{N}=\sup_\ell \inf \{ n\in\mathbb{N} :\; n \mathbf{e}_\ell \in \sigma_e(\mbox{$\imath\hskip -4pt\imath\,$}\mathcal{H}_{ p^0}) \}-1. \end{equation} If $\mathbf{e}_{\ell_1} <...<\mathbf{e}_{\ell_i} $ are distinct and $\mu\in \mathbb{Z}^i$ satisfies $|\mu|:=\sum_{j=1}^{i}\mu_{j}\leq 2\mathbf{N} +3$, we assume that $$ \mu_1\mathbf{e}_{\ell_1} +\dots +\mu_k\mathbf{e}_{\ell_i} =0 \quad\iff\quad \mu=0. $$ \end{itemize} Noting that one can easily prove the symmetry of $\sigma_p(\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{ p^ 0})\subset\mathbb{R}$ around $0$, we have the following decomposition: \begin{align} \label{eq:spectraldecomp} & (T_{ \Phi_{p^0} }^{\perp_\Omega}\mathcal{M}\cap H^1(\mathbb{R}^3, \mathbb{C}^2)) \otimes_\mathbb{R} \mathbb{C} = \big (\oplus_{\pm}\oplus_{l=1}^{N} \ker (j\mathcal{H}_{ p^ 0} \mp \mathbf{e}_l ) \big) \oplus X_c, \\& \nonumber X_c := \left ((T_{ \Phi_{p^0} }^{\perp_\Omega}\mathcal{M}\cap H^1(\mathbb{R}^3, \mathbb{C}^2)) \otimes_\mathbb{R} \mathbb{C} \right) \bigcap_\pm \bigcap_{l=1}^{N} \left (\ker (j\mathcal{H}_{ p^ 0} \mp \mathbf{e}_l ) \big) \right)^{\perp_\Omega}. \end{align} The decomposition in \eqref{eq:spectraldecomp} is $ \mathcal{H}_{p^ 0}$-invariant. \noindent Consider now the coordinate $r\in T_{ p^0 }^{\perp_\Omega}\mathcal{M} \cap L^ 2(\mathbb{R}^3, \mathbb{C}^2)$ from the coordinate system \eqref{eq:coordinate}; it corresponds to the second summand in \eqref{eq:dirsumc}. Then, considered as an element from $L^ 2(\mathbb{R}^3, \mathbb{C}^2)\otimes_\mathbb{R} \mathbb{C}$, it can be decomposed into \begin{equation} \label{eq:decomp2} r (x) =\sum_{l=1}^{ \mathbf{{n}}}z_l \xi_l (x) + \sum_{l=1}^{ \mathbf{{n}}}\overline{z}_l \overline{{\xi }}_l (x) + f (x), \quad f \in X_c \text{ with $f= \overline{{f}} $ }, \end{equation} with $\xi_l$ eigenfunctions of $\mathcal{H}_{ p^ 0}$ corresponding to $\mbox{$\imath\hskip -4pt\imath\,$} \mathbf{e}_l $. We claim that it is possible to choose them so that \begin{equation} \label{eq:norm1} \begin{aligned} & \langle {\mathbbm{i}} \sigma_3 \xi_i, \xi_l\rangle = \langle {\mathbbm{i}} \sigma_3 \xi_i, f\rangle = 0\text{ for all $i,l$ and for all $f\in X_c $}, \\& \langle {\mathbbm{i}} \sigma_3 \xi_i, \overline{\xi}_l \rangle=-\mbox{$\imath\hskip -4pt\imath\,$} \delta_{il} \text{ for all $i,l$}. \end{aligned}\end{equation} To see the second line, observe that on one hand for $ \Xi \in (T_{ \Phi_{p^ 0} }^{\perp_\Omega} \mathcal{M}\otimes_\mathbb{R} \mathbb{C}) \backslash \{ 0 \} $ we have $ \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^ 0}\Xi, \overline{{ \Xi}} \rangle>0$. Indeed, for $\Xi =(\Xi_1, \Xi_2) $ we have \begin{equation*} \begin{aligned} & \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^ 0}\Xi, \overline{{ \Xi}} \rangle= \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^ 0}\Xi, \overline{{ \Xi}} \rangle = \langle \mathfrak{L}_{\omega^0}^{(1)}\Xi_1, { \Xi}_1^*\rangle + \langle \mathfrak{L}_{\omega^0}^{(2)}\Xi_2, \overline{{ \Xi}}_2 \rangle \end{aligned}\end{equation*} with $\langle \Xi_2, \phi_{\omega^0} \rangle =0$, which implies $ \langle \mathfrak{L}_{\omega^0}^{(2)}\Xi_2, \overline{{ \Xi}}_2 \rangle >c_0 \| \Xi_2 \|^2_{L^2}$ and with $\langle \Xi_1, \partial_a\phi_{\omega^0} \rangle =\langle \Xi_1, x_a\phi_{\omega^0} \rangle =\langle \Xi_1, {\mathbbm{i}} \phi_{\omega^0} \rangle =0$ which implies $\langle \mathfrak{L}_{\omega^0}^{(1)}\Xi_1, \overline{{ \Xi}}_1 \rangle >c_0 \| \Xi_1\|^2_{L^2}$, for a fixed $c_0>0$. On the other hand, \begin{equation*} \begin{aligned} & 0< \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^ 0}\xi_i,\overline{\xi}_i \rangle= \mbox{$\imath\hskip -4pt\imath\,$} \mathbf{e}_i \langle {\mathbbm{i}} \sigma_3 \xi_i,\overline{\xi}_i \rangle. \end{aligned}\end{equation*} \noindent It is then possible to choose $\xi_i$ so that \eqref{eq:norm1} is true. Notice that \eqref{eq:norm1} means that the nonzero eigenvalues have positive \textit{Krein signature}. This proves the second line of \eqref{eq:norm1}. The proof of the 1st line is elementary. \noindent By \eqref{eq:decomp2} and \eqref{eq:norm1}, we have \begin{equation} \label{eq:H2} \frac{1}{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^0 } r, r\rangle = \sum_{l=1}^\mathbf{n} \mathbf{e}_l|z_l|^2 + \frac{1}{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{ p^0 } f, f\rangle =:H_2. \end{equation} In terms of $(z,f)$, the Fr\'echet derivative $dr$ can be expressed as \begin{equation} \label{eq:decomp20} dr=\sum_{l=1}^{\mathbf{n}}(dz_l \xi_l+d\overline{z}_l \overline{{\xi}}_l) +df, \end{equation} and by \eqref{eq:norm1} we have \begin{equation} \label{eq:OmegaCoo} 2^{-1} \langle {\mathbbm{i}} \sigma_3 r, dr\rangle = 2^{-1} \mbox{$\imath\hskip -4pt\imath\,$} \sum_{l=1}^{\mathbf{n}} (\overline{z}_l d {z}_l -z_l d \overline{z}_l) + 2^{-1} \langle {\mathbbm{i}} \sigma_3 f, df\rangle. \end{equation} Notice now that, in terms of \eqref{eq:decomp2} and \eqref{eq:decomp20}, \begin{equation*} d\Pi_j(r) = \langle \Diamond_j(z\xi + \overline{z}\ \overline{\xi} +f),\ \xi\,dz + \overline{\xi}\,d\overline{z}+df\rangle = \sum_{l=1}^{\mathbf{n}} ({\mathcal R}^{0,1}_{\infty,\infty}\,dz_l+{\mathcal R}^{0,1}_{\infty,\infty}\,d\overline{z}_l)+\langle \Diamond_jf + \mathbf{S}^{0,1}_{\infty,\infty}, df\rangle. \end{equation*} Hence, we obtain from \eqref{eq:B0pr}: \begin{equation} \label{eq:B0pr2}\begin{aligned} &\Gamma_0' = \Gamma_0+ \sum_{l=1}^{\mathbf{n}} ({\mathcal R}^{1,1}_{\infty,\infty}\,dz_l+{\mathcal R}^{1,1}_{\infty,\infty}\,d\overline{z}_l)+\langle \mathbf{S}^{1,1}_{\infty,\infty}, df\rangle, \quad \text{where}\\ &\Gamma_0:= 2^{-1} \mbox{$\imath\hskip -4pt\imath\,$} \sum_{l=1}^{\mathbf{n}} (\overline{z}_l d {z}_l -z_l d \overline{z}_l) + 2^{-1} \langle {\mathbbm{i}} \sigma_3 f, df\rangle +\sum_{j} {\mathcal R}^{1,0}_{\infty,\infty}(\Pi (f)) \langle\Diamond_jf, df\rangle . \end{aligned} \end{equation} Then \begin{equation}\label{eq:modomega0} \Omega_0:=d \Gamma_0= - \mbox{$\imath\hskip -4pt\imath\,$} \sum_{l=1}^{\mathbf{n}} \,dz_l\wedge d \overline{z}_l + \langle {\mathbbm{i}} \sigma_3 df, df\rangle + \sum_{j,k} {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f)) \langle\Diamond_kf, df\rangle \wedge \langle\Diamond_jf, df\rangle, \end{equation} and, schematically, \begin{equation*} \begin{aligned} \Omega_0 ' =& \Omega_0 + {\mathcal R}^{0,2}_{\infty,\infty} \,dz \wedge \,dz + \langle \partial_f\left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} df, df \rangle +dz \wedge \langle \mathbf{S}^{1,0}_{\infty,\infty}, df \rangle \\& + d\Pi (f) \wedge \langle \mathbf{S}^{0,1}_{\infty,\infty}, df \rangle, \end{aligned} \end{equation*} where in the last line we used $\partial_\rho \left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} = \mathbf{S}^{0,1}_{\infty,\infty} $. Now we transform $\Omega_0 ' $ into $\Omega_0 $ by means of another application of the Darboux Theorem, once again performed in a non-abstract way, to make sure that the coordinate transformation is as in Lemma~\ref{lem:ODE}. \begin{lemma} \label{lem:vectorfield01} For $n_1$ the constant in Lemma \ref{lem:modulation} $\varepsilon _2>0$ consider the subset \[ \mathcal{U}_{2}=\left\{f\in\mathbb{C}^{\mathbf{n}} \times X_c;\quad \|f\|_{\Sigma_{-{n_1}}}\le \varepsilon _2,\quad | \Pi (f)|\le \varepsilon_2,\quad |z|\le \varepsilon_2\right\}. \] Then for $ \varepsilon _2>0$ small enough there exists a unique vector field $ \mathcal{Y}^{t } $ in $\mathcal{U}_{2}$ such that $ i_{\mathcal{Y}^{t }} (\Omega_0+ t(\Omega_0'-\Omega_0)) =\Gamma _0-\Gamma _0' $ for $|t|<5$ with components \begin{equation}\label{eq:quasilin10} \begin{aligned} & (\mathcal{Y}^{ t })_{z_j}= \mathcal{R}^{1,1}_{{n_1},\infty} \quad, \quad (\mathcal{Y}^{ t })_{f} = {\mathbbm{i}} \sigma_3 \mathcal{R}^{1,2}_{n,\infty}\cdot \Diamond f + \mathbf{S}^{1,1}_{{n_1},\infty }.\end{aligned} \end{equation} \end{lemma} \proof The proof is essentially the same as that of Lemma~\ref{lem:vectorfield0}. The first step is to consider a field $Z$ such that $i_{Z}\Omega_0 =\Gamma _0-\Gamma _0' $. We claim that \begin{equation*} (Z)_{z}= \mathcal{R}^{1,1}_{\infty,\infty} \,, \qquad (Z)_{f} = {\mathbbm{i}} \sigma_3 \mathcal{R}^{1,2}_{\infty,\infty}\cdot \Diamond f + \mathbf{S}^{1,1}_{\infty,\infty }. \end{equation*} Schematically, the equation for $Z$ is of the form \begin{equation*} (Z)_{z}\,dz+\langle \left [ {\mathbbm{i}} \sigma_3 (Z)_{f} + \mathcal{R}^{0,0}_{\infty,\infty}\langle \Diamond f, (Z)_{f} \rangle \right ] \Diamond f, df \rangle = \mathcal{R}^{1,1}_{\infty,\infty}\,dz +\langle \mathbf{S}^{1,1}_{\infty,\infty}, df\rangle. \end{equation*} This immediately yields $(Z)_{z}= \mathcal{R}^{1,1}_{\infty,\infty}$. The equation for $ (Z)_{f}$ is of the form \begin{equation}\label{eq:quasilin100} (Z)_{f} + \mathcal{R}^{0,0}_{\infty,\infty}\langle \Diamond f, (Z)_{f} \rangle {\mathbbm{i}} \sigma_3 \Diamond f =\mathbf{S}^{1,1}_{\infty,\infty}, \end{equation} has a solution in the form $\displaystyle (Z)_{f}= \sum_{i=0}^{\infty}(Z)_{f}^{(i)}$, with $(Z)_{f}^{(0)}=\mathbf{S}^{1,1}_{\infty , \infty} $ and \begin{equation*} (Z)_{f}^{(i+1)}=\mathcal{R}^{0,0}_{\infty,\infty}\langle \Diamond f, (Z)_{f}^{(i)} \rangle {\mathbbm{i}} \sigma_3 \Diamond f = (\mathcal{R}^{0,0}_{\infty,\infty})^{i+1}\langle \Diamond f, {\mathbbm{i}} \sigma_3 \Diamond f \rangle^{i} \langle \Diamond f, (Z)_{f}^{(0)} \rangle {\mathbbm{i}} \sigma_3 \Diamond f, \end{equation*} where by direct computation $\langle \Diamond_jf, {\mathbbm{i}} \sigma_3 \Diamond_k f \rangle$ is a bounded bilinear form in $X_c\cap L^2(\mathbb{R}^3, \mathbb{C}^4)$ for all $j,k$. This implies that the series defining $(Z)_{f}$ is convergent and that $(Z)_{f}$ is as in \eqref{eq:quasilin100}. \noindent The next step is to define an operator $\mathcal{K} $ like in Lemma~\ref{lem:vectorfield0}, defined by $ i_{X} d(\Gamma _0'-\Gamma _0) = i_{\mathcal{K} X} \Omega_0$. We claim that \begin{equation}\label{eq:quasilin101} \begin{aligned} (\mathcal{K}X)_{z }&= {\mathcal R}^{0,2}_{\infty,\infty} (X)_{z } + \langle \mathbf{S}^{1,0}_{\infty,\infty}, (X)_{f } \rangle \\ (\mathcal{K}X)_{f } &= {\mathbbm{i}} \sigma_3 \langle \mathbf{S}^{0,1}_{\infty,\infty}, (X)_{f } \rangle \Diamond f + \partial_f\left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} (X)_{f } \\&+(X)_{z } \mathbf{S}^{1,0}_{\infty,\infty} + \langle \Diamond f, (X)_{f }\rangle \mathbf{S}^{0,1}_{\infty,\infty}. \end{aligned} \end{equation} We have schematically \begin{equation*} \begin{aligned} & \mbox{$\imath\hskip -4pt\imath\,$} (\mathcal{K}X)_{z }d {z} + \langle \left [{\mathbbm{i}} \sigma_3 (\mathcal{K}X)_{f } + \mathcal{R}^{0,0}_{\infty,\infty} \langle \Diamond f, (\mathcal{K}X)_{f } \rangle \Diamond f\right ], df \rangle \\& = \left ({\mathcal R}^{0,2}_{\infty,\infty} (X)_{z } + \langle \mathbf{S}^{1,0}_{\infty,\infty}, (X)_{f } \rangle \right) \,dz \\& + \langle \left [ \partial_f\left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} (X)_{f } +(X)_{z }\mathbf{S}^{1,0}_{\infty,\infty}+\langle \mathbf{S}^{0,1}_{\infty,\infty},(X)_{f }\rangle \Diamond f+\langle \Diamond f,(X)_{f }\rangle \mathbf{S}^{0,1}_{\infty,\infty}\right ],df \rangle \end{aligned} \end{equation*} which yields immediately the first equation in \eqref{eq:quasilin101}. We have $\displaystyle (\mathcal{K}X)_{f } =\sum_{i=0}^{\infty}(\mathcal{K}^{(i)}X)_{f } $ with \begin{equation*} \begin{aligned} {\mathbbm{i}} \sigma_3 (\mathcal{K}^{(0)}X)_{f } = \partial_f\left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} (X)_{f } +(X)_{z } \mathbf{S}^{1,0}_{\infty,\infty}\\ + \langle \mathbf{S}^{0,1}_{\infty,\infty}, (X)_{f } \rangle \Diamond f + \langle \Diamond f, (X)_{f }\rangle \mathbf{S}^{0,1}_{\infty,\infty} \end{aligned} \end{equation*} and \begin{equation*} \begin{aligned} & (\mathcal{K}^{(i+1)}X)_{f } = \mathcal{R}^{0,0}_{\infty,\infty} \langle \Diamond f, (\mathcal{K}^{(i)}X)_{f } \rangle {\mathbbm{i}} \sigma_3 \Diamond f = (\mathcal{R}^{0,0}_{\infty,\infty})^{i+1}\langle \Diamond f, {\mathbbm{i}} \sigma_3 \Diamond f \rangle^{i} \langle \Diamond f, (\mathcal{K}^{(0)}X)_{f } \rangle {\mathbbm{i}} \sigma_3 \Diamond f. \end{aligned} \end{equation*} Then the series defining $(\mathcal{K}^{(0)}X)_{f }$ converges and we get in particular the second equation in \eqref{eq:quasilin101}. Now the equation defining $\mathcal{Y}^{t}$ is equivalent to $(1+t \mathcal{K}) \mathcal{Y}^t= Z$, like \eqref{eq:fred1}. So we have \begin{equation*} \begin{aligned} & (\mathcal{Y}^t)_{z } +t {\mathcal R}^{0,2}_{\infty,\infty} (\mathcal{Y}^t)_{z } + t \langle \mathbf{S}^{1,0}_{\infty,\infty}, (\mathcal{Y}^t)_{f } \rangle = \mathcal{R}^{1,1}_{\infty,\infty} \\& (\mathcal{Y}^t)_{f } +{\mathbbm{i}}t \sigma_3 \langle \mathbf{S}^{0,1}_{\infty,\infty}, (\mathcal{Y}^t)_{f } \rangle \Diamond f + t\partial_f\left. \mathbf{S}^{1,1}_{\infty,\infty} \right |_{(\rho,z, f)=(\Pi (f),z, f)} (\mathcal{Y}^t)_{f } \\&+t(\mathcal{Y}^t)_{z } \mathbf{S}^{1,0}_{\infty,\infty} + t \langle \Diamond f, (\mathcal{Y}^t)_{f }\rangle \mathbf{S}^{0,1}_{\infty,\infty} = {\mathbbm{i}} \sigma_3 \mathcal{R}^{1,2}_{\infty,\infty}\cdot \Diamond f + \mathbf{S}^{1,1}_{\infty,\infty }. \end{aligned} \end{equation*} Solving this we get \eqref{eq:quasilin10}. \qed We can apply Lemma~\ref{lem:ODE} to the flow $\widetilde{\mathfrak{F}}_t:\;(z,f) \mapsto (z^t, f^t)$ generated by $ \mathcal{Y}^t$. In terms of the decomposition \eqref{eq:decomp2} of $r$ formula \eqref{eq:ODE1} becomes for $n= {n_1}$ \begin{align} &z^t= z+\mathcal{R}^{1,1}_{{n_1}- l-1, l}, \label{eq:tildef}\\& f^t= e^{{\mathbbm{i}} \sum _{j=1}^{4}\sigma_3{\mathcal R}^{0,2 }_{ {n_1}- l-1, l}(t, z,\Pi (f), f) \Diamond _j } T(e^{\sum _{a=1}^{3}{\mathcal R}^{0,2 }_{ {n_1}- l-1, l}(t, z,\Pi (f), f) {\mathbbm{i}}\sigma _a }) (f+ \mathbf{{S}}^{1,1 }_{ {n_1}- l-1,l} (t, z,\Pi (f), f)).\nonumber\end{align} Lemma~\ref{lem:darboux} applies also to this flow, and we have $ \widetilde{\mathfrak{F}}_{1 }^* \Omega_0' =\Omega_0$. We now turn to the analysis of the hamiltonian vector fields in the new coordinate system. For a function $F$ let us decompose $X_F$ according to the spectral decomposition \eqref{eq:decomp2}: for $(X_F)_{f} \in X_c $, \begin{equation}\label{eq:XFext} \begin{aligned} X_F &= \sum_{j=1}^{\mathbf{n}}(X_F)_{z_j} \xi_j (x) + \sum_{j=1}^{\mathbf{n}}(X_F)_{\overline{z}_j} {\xi }_j^*(x) + (X_F)_{f}. \end{aligned} \end{equation} By \eqref{eq:modomega0} and by $i_{X_F}\Omega_0=dF$ we have, schematically, \begin{equation} \begin{aligned}& - \mbox{$\imath\hskip -4pt\imath\,$} (X_F)_{z_l} d \overline{z}_l+ (X_F)_{\overline{z}_l} \,dz_l + \langle \left [ {\mathbbm{i}} \sigma_3 (X_F)_{f} +{\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, (X_F)_{f} \rangle \Diamond f \right ], df\rangle \\& = \partial_{z_l} F d {z}_l +\partial_{\overline{z}_l} F d {\overline{z}}_l + \langle \nabla_{f} F, df\rangle. \end{aligned}\nonumber \end{equation} and so, schematically, \begin{equation} \begin{aligned}& (X_F)_{z_l} =\mbox{$\imath\hskip -4pt\imath\,$} \partial_{\overline{z}_l} F \quad, \quad (X_F)_{\overline{z}_l} =-\mbox{$\imath\hskip -4pt\imath\,$} \partial_{z_l} F\\& (X_F)_{f} +{\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, (X_F)_{f} \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f = -{\mathbbm{i}} \sigma_3\nabla_{f} F. \end{aligned}\nonumber \end{equation} We set \begin{equation}\label{eq:X_Fsplit} X_F =X_F^{(0)}+X_F^{(1)} \end{equation} with \begin{equation}\label{eq:X_F0} \begin{aligned}& (X_F^{(0)})_{z_l} =\mbox{$\imath\hskip -4pt\imath\,$} \partial_{\overline{z}_l} F \quad, \quad (X_F^{(0)})_{\overline{z}_l} =-\mbox{$\imath\hskip -4pt\imath\,$} \partial_{z_l} F\quad, \quad (X_F^{(0)})_{f} = -{\mathbbm{i}} \sigma_3\nabla_{f} F \end{aligned} \end{equation} and where the remainder is of the form \begin{equation}\label{eq:X_F1} \begin{aligned}& (X_F^{(1)})_{z_l} =(X_F^{(1)})_{\overline{z}_l} =0\\& (X_F^{(1)})_{f} = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, (X_F^{(0)})_{f} \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, {\mathbbm{i}} \sigma_3\nabla_{f} F \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f. \end{aligned} \end{equation} Indeed, $(X_F^{(1)})_{f}$ has to satisfy an equation of the form \begin{equation} \begin{aligned}& (X_F^{(1)})_{f} +{\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, (X_F)_{f}^{(1)} \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, {\mathbbm{i}} \sigma_3\nabla_{f} F \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f. \end{aligned}\nonumber \end{equation} This can be solved like in the proof of Lemma~\ref{lem:vectorfield01} by writing $\displaystyle (X_F)_{f}^{(1)} = \sum_{i=0}^{\infty} X_i$ with \begin{equation*}\begin{aligned} X_0&= {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, {\mathbbm{i}} \sigma_3\nabla_{f} F \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f \text{ and}\\ X_{i+1}&={\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f))\langle \Diamond f, X_{i} \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f \\&= (\mathcal{R}^{0,0}_{\infty,\infty})^{i+1}\langle \Diamond f, {\mathbbm{i}} \sigma_3 \Diamond f \rangle^{i} \langle \Diamond f, {\mathbbm{i}} \sigma_3\nabla_{f} F \rangle P_c {\mathbbm{i}} \sigma_3 \Diamond f\end{aligned} \end{equation*} which yields \eqref{eq:X_F1}. For two functions $F$ and $G$ we have the Poisson brackets \begin{equation} \label{eq:poiss}\begin{aligned} & \{ F,G \} :=dF(X_G) = \partial_{z_{l} }F (X_G)_{z_{l} } + \partial_{\overline{z}_{l} }F (X_G)_{\overline{z}_{l} } +\langle \nabla_fF, (X_G)_{f } \rangle \\& = \{ F,G \}_{(0)} + \{ F,G \}_{(1)}, \end{aligned}\end{equation} where $ \{ F,G \}_{(i)}:=dF(X_G^{(i)}) $ and where \begin{equation} \label{eq:poiss0}\begin{aligned} & \{ F,G \}_{(0)}= \mbox{$\imath\hskip -4pt\imath\,$} (\partial_{z_l } F \partial_{z_l } G - \partial_{\overline{z}_l } F \partial_{\overline{z}_l } G) -\langle \nabla_fF, {\mathbbm{i}} \sigma_3\nabla_f G \rangle \end{aligned}\end{equation} and, schematically, \begin{equation} \label{eq:poiss1}\begin{aligned} \{ F,G \}_{(1)}& = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f)) \langle \nabla_fF,\Diamond f \rangle \langle \Diamond f, {\mathbbm{i}} \sigma_3\nabla_{f} G \rangle. \end{aligned}\end{equation} The key point later is the use of the Poisson brackets to set up the homological equations. Now compared to the material in \cite{Cu0} where the Poisson bracket equals \eqref{eq:poiss0}, here the homological equations will have an additional term contributed by \eqref{eq:poiss1}, which however is of higher order and thus is harmless, as we will see later. \section{ Birkhoff normal forms} \label{sec:Normal form} We will reduce now to \cite[Sect. 6]{Cu0}. We set, for the $\mathbf{e}_{j}$'s in (H6), see Section~\ref{sec:speccoo}, \begin{equation*} \mathbf{e} :=(\mathbf{e}_{1},..., \mathbf{e}_{\mathbf{n}}). \end{equation*} We consider $a_{\mu \nu}^{(\ell)} (\varrho)\in C^{ \widehat{m}} (U,C)$ for $k_0\in\mathbb{N}$ a fixed number and $U$ an open neighborhood of $0$ in $ \mathbb{R}^{7}$. Then we set \begin{equation} \label{eq:H2birk} H_2^{(\ell)} (\varrho,z,f):= \sum_{\substack{ |\mu +\nu |=2\\ \mathbf{e} \cdot (\mu -\nu)=0}} a_{\mu \nu}^{(\ell)} (\varrho) z^\mu \overline{z}^\nu + \frac{1}{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{p^0 } f, f\rangle, \end{equation} \begin{equation} \label{eq:lambda} \textbf{e}_j (\varrho) := a _{\delta_j\delta_j}^{(\ell)}(\varrho), \quad \textbf{e} (\varrho)= (\textbf{e}_1(\varrho), \cdots, \textbf{e}_\mathbf{n}(\varrho)), \end{equation} where $\delta_j:=(\delta_{1j},..., \delta_{\mathbf{n}j}).$ We further assume that $\textbf{e} (0) = \mathbf{e} $. \begin{definition} \label{def:normal form} A function $Z(\varrho, z,f)$ is in normal form if $ Z=Z_0+Z_1$, where $Z_0$ and $Z_1$ are finite sums of the following type: \begin{equation} \label{e.12a}Z_1= \sum_{\mathbf{e} \cdot(\nu-\mu)\in \sigma_e(\mathcal{H}_{p^0})} z^\mu \overline{z}^\nu \langle {\mathbbm{i}} \sigma_3 G_{\mu \nu}(\varrho),f\rangle \end{equation} with $G_{\mu \nu}(x, \varrho)\in C^{m} (U,\Sigma_{k }(\mathbb{R}^3, \mathbb{C}^{4}))$ for fixed $k,m\in\mathbb{N}$ and $U\subseteq \mathbb{R}^{7} $ an open neighborhood of $0\in]R^7$, \begin{equation} \label{e.12c}Z_0= \sum_{ \mathbf{e} \cdot(\mu-\nu)=0} g_{\mu \nu} (\varrho)z^\mu \overline{z}^\nu, \end{equation} with $g_{\mu \nu} (\varrho)\in C^{m} (U, \mathbb{C})$. We assume furthermore the symmetries $ \overline{{g}}_{\mu \nu} =g_{\nu\mu }$ and $ \overline{{G}}_{\mu \nu} =G_{\nu \mu }$. \end{definition} \begin{lemma} \label{lem:chi} For $i\in \{ 0,1\}$ fixed and $n,M\in\mathbb{N}$ sufficiently large and for $m\le M-1$ let \begin{equation*} \label{eq:chi1}\chi =\sum_{|\mu +\nu |=M_0 +1} c_{\mu\nu} (\Pi (f)) z^{\mu} \overline{z}^{\nu} +\mbox{$\imath\hskip -4pt\imath\,$} \sum_{|\mu +\nu |=M_0 } z^{\mu} \overline{z}^{\nu} \langle {\mathbbm{i}} \sigma_3 C_{\mu \nu }(\Pi (f)), f \rangle, \end{equation*} with $ c_{\mu\nu}(\varrho)= {\mathcal R}^{i,0} _{n,M}(\varrho)$ and $ C_{\mu\nu}(\varrho)= \mathbf{S}^{i,0}_{n,M}(\varrho)$ and with \begin{equation} \label{eq:symm} \overline{{c}}_{\mu\nu} = {c}_{\nu\mu}, \quad \overline{{C}}_{\mu \nu } =-C_{\nu\mu}\end{equation} (so that $\chi$ is real-valued for $f= \overline{{f}} $). Then we have what follows. \begin{itemize} \item[(1)] For $\phi^{t }$ the flow of $X_\chi $, see Lemma~\ref{lem:ODE}, and $(z^t,f^t)= (z,f)\circ \phi^{t }$, \begin{align} z^t =& z + {\mathcal R}^{0,M_0}_{n-m-1,m-1}(t, \Pi (f), z, f),\nonumber \\ f^t =&e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^{4}{\mathcal R}^{0,M_0+1}_{n-m-1,m-1}(t, \Pi (f), z, f) \Diamond _j} T(e^{ \sum _{i=1}^{3}{\mathcal R}^{0,M_0+1}_{n-m-1,m-1}(t, \Pi (f), z, f) {\mathbbm{i}} \sigma _i})\label{eq:quasilin51}\\& \quad \quad\quad\quad\quad \times (f+ \mathbf{{S}}^{0,M_0}_{n-m-1,m-1}(t, \Pi (f), z, f))\nonumber. \end{align} \item[(2)] For $n- m-1 \ge s' \ge s+m-1 \ge m-1 $ and $k\in \mathbb{Z}\cap [0,n- m-1 ]$ and for $ \varepsilon_1> \varepsilon_2> 0$ sufficiently small, $\phi :=\phi^{1 } \in C^{m-1} (\mathcal{U}_{\varepsilon_2,k}^{s'}, \mathcal{U}_{\varepsilon_1,k}^{s} ) $ satisfies $\phi^{ \ast }\Omega_0=\Omega_0$. \end{itemize} \end{lemma} \proof This result is a simple corollary of Lemma~\ref{lem:ODE} once we represent $r$ by the decomposition \eqref{eq:decomp2}. However we need to check that the Hamiltonian vector field $X_{\chi} $ has components that satisfy the hypotheses in (ii) in Lemma~\ref{lem:ODE}. Our claim is that \begin{align} & (X_\chi)_{z } = {\mathcal R}^{0,M_0 }_{n-1,M-1}(t, \Pi (f), z,f) \label{eq:symchi}\\& (X_\chi)_f = {\mathbbm{i}} \sigma_3{\mathcal R}^{0,M_0+1}_{n-1,M-1}(t, \Pi (f), z,f)\Diamond f + \mathbf{ S}^{0,M_0 }_{n-1,M-1}(t, \Pi (f), z,f). \nonumber \end{align} To check this, we use the splitting $X_\chi =X_\chi^{(0)}+X_\chi^{(1)}$ like the one we used before \eqref{eq:X_F0}, where from \eqref{eq:X_F0} we have \begin{equation}\label{eq:symchi0} \begin{aligned} (X_\chi)_{ z_l }^{(0)} & = \mbox{$\imath\hskip -4pt\imath\,$} \partial_{\overline{z}_l} \chi = {\mathcal R}^{0, M_0 }_{n,M-1} \\ (X_\chi)_f^{(0)}&= {\mathbbm{i}} \sigma_3 {\mathcal R}^{0, M_0+1}_{n,M-1} \Diamond f + \mathbf{S}^{0, M_0+1}_{n,M}, \end{aligned} \end{equation} where we used the following expression for $\nabla_f \chi$: \begin{equation} \begin{aligned} \nabla_f \chi = \left. \partial_{\rho} \chi (\rho, z,f)\right |_{\rho = \Pi (f)} \Diamond f + \mbox{$\imath\hskip -4pt\imath\,$} \sum_{|\mu +\nu |=M_0 } z^{\mu} \overline{z}^{\nu} {\mathbbm{i}} \sigma_3 C_{\mu \nu }(\Pi (f)) = {\mathcal R}^{0, M_0+1}_{n,M-1} \Diamond f + \mathbf{S}^{0, M_0+1}_{n,M}. \end{aligned}\nonumber \end{equation} When we insert the r.h.s. into \eqref{eq:X_F1}, we obtain: \begin{equation}\label{eq:X_F1a} \begin{aligned}& (X_\chi^{(1)})_{f} = \langle {\mathbbm{i}} \sigma_3 \Diamond f, {\mathcal R}^{0, M_0+1}_{n,M-1} \Diamond f + \mathbf{S}^{0, M_0+1}_{n,M} \rangle \Diamond f = {\mathcal R}^{1, M_0+1}_{n-1,M-1} \Diamond f. \end{aligned} \end{equation} Hence the hypotheses stated in Lemma~\ref{lem:ODE} are satisfied, but with the pair $(n,M)$ in Lemma~\ref{lem:ODE} replaced by the pair $(n-1,M-1)$. In particular \eqref{eq:quasilin51} is obtained by substituting $(n,l)$ in \eqref{eq:ODE1} with $(n-1, m-1)$. This substitution performed in \eqref{eq:index1} yields the conditions on the indexes in Claim (2). For the proof that $\phi^{ \ast }\Omega_0=\Omega_0$, which is obvious in the standard setups, see the comments in \cite[Lemma 5.3]{Cu0}. \qed The following lemma is a reformulation in terms of the spectral coordinates of Section~\ref{sec:speccoo} of Lemma~\ref{lem:ODE1}, see \cite[Lemma 5.4]{Cu0}. \begin{lemma} \label{lem:ExpH11} Consider $\mathfrak{F} =\mathfrak{F}_1 \circ \cdots \circ \mathfrak{F}_L $ like in Lemma~\ref{lem:ODE1}, with $m_1=2$ and for $n$ and $M$ fixed and sufficiently large and like in Lemma \ref{lem:ODE1}. Let $(k,m)$ be a fixed pair. Consider decomposition \eqref{eq:decomp2}. Then on the domain $\mathcal{U}^s_{\varepsilon, k} $, for $s\ge n-(m+1)$, defined in \eqref{eq:domain0} one has \begin{equation} \label{eq:ExpH11} \begin{aligned} & {K} \circ \mathfrak{F}= { \psi} ( \Pi _j(f)| _{j=1}^{4}) +H_2' +\textbf{R}, \end{aligned} \end{equation} where $ \psi (\varrho) = O(\varrho^2)$ is $C^{m}$ and with what follows.\begin{itemize} \item[(1)] We have \begin{equation} \label{eq:ExpH2} H_2 '= \sum_{\substack{ |\mu +\nu |=2\\ \mathbf{e} \cdot (\mu -\nu)=0}} g_{\mu \nu} (\Pi (f)) z^\mu \overline{z}^\nu + \frac{1 }{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{p^0 } f, f\rangle. \end{equation} \item[(2)] Denote $ \varrho =\Pi (f). $ There is the expansion $\textbf{R} = \sum_{j=-1}^{3} {\textbf{R}_{ j }} + {\mathcal R}^{1,2}_{k,m}(\varrho, f) $, \begin{equation*} \begin{aligned} &{ {\mathbf{R}}_{ - 1 }}= \sum_{\substack{ |\mu +\nu |=2\\ \mathbf{e} \cdot (\mu -\nu)\neq 0 }} g_{\mu \nu } (\varrho)z^\mu \overline{z}^\nu + \sum_{|\mu +\nu | = 1} z^\mu \overline{z}^\nu \langle {\mathbbm{i}} \sigma_3 G_{\mu \nu }(\varrho),f\rangle ;\\& |{\mathcal R}^{1,2}_{k,m}(\varrho, f)|\le C \| f\|_{\Sigma_{-k}}^2 (\| f\| _{\Sigma_{-k}}+|\varrho | +|z|) ; \end{aligned} \end{equation*} for $ \mathbf{N}$ as in (H8), \begin{equation*} \begin{aligned} & {\textbf{R}_0}= \sum_{|\mu +\nu |= 3}^{2 {\mathbf{N}}+1} z^\mu \overline{z}^\nu g_{\mu \nu }(\varrho) ; \quad {\textbf{R}_1}= \mbox{$\imath\hskip -4pt\imath\,$} \sum_{|\mu +\nu |= 2}^{2 {\mathbf{N}} } z^\mu \overline{z}^\nu \langle {\mathbbm{i}} \sigma_3 G_{\mu \nu }(\varrho), f\rangle ; \end{aligned}\nonumber \end{equation*} \begin{equation*} \begin{aligned} & {\textbf{R}_2} = \sum_{|\mu +\nu |= 2\mathbf{N}+2} z^\mu \overline{z}^\nu g_{\mu \nu }(\varrho, z,f) -\sum_{ |\mu +\nu |= 2\mathbf{N}+1} z^\mu \overline{z}^\nu \langle {\mathbbm{i}} \sigma_3 G_{\mu \nu }(\varrho, z,f), f\rangle ;\\ & {\textbf{R}_3}= \sum _{d=2}^4 \langle B_{d } (\varrho, z,f), f^{ d} \rangle +\int_{\mathbb{R}^3} B_5 (x, \varrho, z,f, f(x)) f^{ 5}(x)\,dx + E_P (f) \\& \text{ with $B_2(0,0,0)=0$.} \end{aligned}\nonumber \end{equation*} Above, $f^d(x)$ schematically represents $d$-products of components of $f$. \item[(3)] For $\delta_j\in\mathbb{N}_{0}^m$ the vectors defined in terms of the Kronecker symbols by $\delta_j:=(\delta_{1j},..., \delta_{mj}) $, \begin{equation} \label{eq:ExpHcoeff1} \begin{aligned} & g_{\mu \nu } = {\mathcal R}^{1,0}_{k,m} \quad \text{ for $|\mu +\nu | = 2$ \ for \ $(\mu, \nu)\neq (\delta_j, \delta_j)$, \ $1\le j\le m$;} \\& g_{\delta_j \delta_j } =\mathbf{e}_j^{0} + {\mathcal R}^{1,0}_{k,m}, \text{\ $1\le j\le m$}; \\& G_{\mu \nu } =\mathbf{S}^{1,0}_{k,m} \text{ for $|\mu +\nu | = 1$}; \end{aligned} \end{equation} $g_{\mu \nu }$ and $G_{\mu \nu }$ satisfy symmetries analogous to \eqref{eq:symm}. \item[(4)] All the other $g_{\mu \nu } $ are ${\mathcal R}^{0,0}_{k,m} $ and all the other $G_{\mu \nu } $ are $\mathbf{S}^{0,0}_{k,m} $. \item[(5)] $B_{d }(\varrho, z,f) \in C^{m } (\mathcal{U}_{-k}, \Sigma_k (\mathbb{R}^3, B ( (\mathbb{R}^{4 })^{\otimes d},\mathbb{R}))) $ for $2\le d \le 4$ with $\mathcal{U}_{-k}\subset \mathbb{R}^7 \times \mathbb{C}^{\mathbf{n}}\times X_c$ an open neighborhood of $(0,0,0)$. \item[(6)] Let $ \zeta \in \mathbb{C}^{2 }$. Then for $B_5(\cdot, \varrho,z,f, \zeta)$ we have for fixed constants $C_l$ (the derivatives are not in the holomorphic sense) \begin{equation} \label{H5power2}\begin{aligned} &\text{for $|l|\le m $,} \quad \| \nabla_{ \varrho, z,f,\zeta }^lB_5(\varrho,z,f,\zeta ) \|_{\Sigma_k(\mathbb{R}^3, B ( (\mathbb{C}^{2 })^{\otimes 5},\mathbb{R})} \le C_l. \end{aligned}\nonumber \end{equation} \end{itemize} \end{lemma} \proof The proof is elementary and is in \cite[Lemma 5.4]{Cu0}. It consists in rewriting the expansion \eqref{eq:back11} by expressing $r$ in terms of $(z,f)$ using \eqref{eq:decomp2}, that is, \begin{equation*} r = z \cdot \xi + \overline{z} \cdot {\xi }^* +f \text{ and } \Pi (r)= \Pi (f) +{\mathcal R}^{0,2}_{\infty, \infty}(z,f). \end{equation*} \qed Then we have the following result on Birkhoff normal forms. \begin{proposition} \label{th:main} For any integer $2\le \ell \le 2\mathbf{N}+1$ there are transformations $\mathfrak{F}^{(\ell)} = \mathfrak{F}_1 \circ \widetilde{\mathfrak{F}}_1 \circ\phi_2\circ...\circ \phi_\ell $, with $\mathfrak{F}_1$ the transformation in Lemma~\ref{lem:darboux}, $\widetilde{\mathfrak{F}}_1$ the one in \eqref{eq:tildef} and with the $\phi_j$'s like in Lemma~\ref{lem:chi}, such that the conclusions of Lemma~\ref{lem:ExpH11} hold, that is such that we have the following expansion: \begin{equation*} H^{(\ell)}:=K\circ \mathfrak{F}^{(\ell)} ={ \psi} (\Pi _j(f)| _{j=1}^{4})+ H_2^{(\ell)} + {\mathcal R}^{1,2}_{k,m}(\Pi (f), f) + \sum_{j=-1}^3 \textbf{R}_{j}^{(\ell)}, \end{equation*} with $H_2^{(\ell)}$ of the form \eqref{eq:ExpH2} and with the following additional properties: \begin{itemize} \item[(i)] $\textbf{R}_{-1}^{(\ell)} =0$; \item[(ii)] all the nonzero terms in $\textbf{R}_0^{(\ell)} $ with $|\mu +\nu |\le \ell $ are in normal form, that is $\mathbf{e} \cdot (\mu -\nu)=0$; \item[(iii)] all the nonzero terms in $\textbf{R}_1^{(\ell)} $ with $|\mu +\nu |\le \ell -1$ are in normal form, that is $\mathbf{e}\cdot (\mu -\nu)\in \sigma_e(\mathcal{H}_{p^0})$. \end{itemize} \end{proposition} \proof The proof of Proposition~\ref{th:main} is in \cite{Cu0} for the symplectic form \begin{equation*}\label{eq:modomega00} \Omega_0^{(0)}:= - \mbox{$\imath\hskip -4pt\imath\,$} \sum_{l=1}^{\mathbf{n}} \,dz_l\wedge d \overline{z}_l + \langle {\mathbbm{i}} \sigma_3 df, df\rangle. \end{equation*} In \eqref{eq:ExpH11}, we replace $\Pi (f)$ with $\varrho$; then $\mathbf{h}=H^{(\ell)}(\varrho, z,f)$ is $C^{2\mathbf{N}+2}$ near $(0,0,0) $ in $\mathbb{R}^7\times \mathbb{C} \times (T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap \Sigma_{ k}) $ and the statement of Proposition~\ref{th:main} is about the fact that some of the following derivatives vanish: \begin{align} \label{eq:derivmain1} & g_{\mu \nu}(\varrho) =\frac{1}{\mu !\nu ! } \partial_z^\mu \partial_{\overline{z}}^\nu \mathbf{h}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad |\mu +\nu |\le 2\mathbf{N}+1,\\& \label{eq:derivmain2}{\mathbbm{i}} \sigma_3 G_{\mu \nu}(\varrho) =\frac{1}{\mu !\nu ! } \partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f \mathbf{h}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad |\mu +\nu |\le 2\mathbf{N}. \end{align} The proof is iterative and consists in assuming the statement correct for a given $\ell$ and proving it for $\ell +1$, by picking an unknown $\chi$ as in \eqref{eq:chi1} such that $H^{(\ell)} \circ\phi $ satisfies the conclusions for $\ell +1$, where $\phi $ is the $t=1$ flow for the Hamiltonian vector field of $\chi$. \noindent Now, let us pick $\chi$ provided by \cite[Theorem 6.4]{Cu0} when we use the symplectic form $ \Omega_0^{(0)}$. We will show that this same $\chi$ works here. \noindent Let $ {\phi}^{(0)} $ be the $t=1$ flow generated by $X_\chi^{(0)}$. Notice that $ {\phi}^{(0)} $ is a symplectomorphism for $ \Omega_0^{(0)}$. Set \begin{equation}\label{eq:mainblock-1} \widehat{H}^{(\ell)}= \psi (\Pi _j(f)| _{j=1}^{4}) +H_2 '+ \sum_{j=-1}^{1} \mathbf{{R}}_{j}^{(\ell)}. \end{equation} We have (notice that here $\psi (\Pi _j(f)| _{j=1}^{4})$ contributes 0 because here is ${ \psi} (\varrho _j| _{j=1}^{4})$ with $\varrho$ an auxiliary variable independent from $f$) \begin{equation}\label{eq:mainblock-} \begin{aligned} & \partial_z^\mu \partial_{\overline{z}}^\nu {H}^{(\ell)}\at{(\varrho, z,f)= (\varrho,0,0)}= \partial_z^\mu \partial_{\overline{z}}^\nu \widehat{{H}}^{(\ell)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 2\le |\mu +\nu |\le 2\mathbf{N}+1,\\& \partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f {{H}}^{(\ell)}\at{(\varrho, z,f)= (\varrho,0,0)}=\partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f \widehat{{H}}^{(\ell)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 1\le |\mu +\nu |\le 2\mathbf{N} \end{aligned} \end{equation} since all the other terms of ${H}^{(\ell)}$ not contained in $\widehat{{H}}^{(\ell)}$ are higher order in some of the variables, for example order 2 or higher in $f$. As we pointed out, $\psi (\Pi (f))$ contributes nothing to \eqref{eq:mainblock-}. The same is true of the term $\frac{1 }{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{p^0 } f, f\rangle$ inside $H_2 '$, see \eqref {eq:ExpH2} (however, the pullbacks of these terms are significant in the formulas below). So the only contributors of \eqref{eq:mainblock-1} to \eqref{eq:mainblock-} are very regular functions in $(\varrho , z, f)$, where $\varrho =\Phi (f)$ is as before treated as auxiliary variable and $f\in (T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap \Sigma_{- k}) $. This yields the useful result that while the l.h.s.'s in \eqref{eq:mainblock-} require $f$ quite regular, for example $f\in \Sigma_{ k} $ for a sufficiently large $k$, the r.h.s.'s are defined for $f\in \Sigma_{ -k} $ for a large preassigned $k$. This because the only term in $ \widehat{H}^{(\ell)}(\varrho , z,f )$ that requires some regularity in $f$ to make sense, that is the $\frac{1 }{2} \langle {\mathbbm{i}} \sigma_3 \mathcal{H}_{p^0 } f, f\rangle$ hidden inside $ H'_2$, see \eqref{eq:ExpH2}, does not contribute to \eqref{eq:mainblock-}. \noindent Furthermore, by Lemma \ref{lem:chi} we have \begin{equation}\label{eq:mainblock} \begin{aligned} & \partial_z^\mu \partial_{\overline{z}}^\nu {H}^{(\ell)}\circ {\phi}^{(0)} \at{(\varrho, z,f)= (\varrho,0,0)}= \partial_z^\mu \partial_{\overline{z}}^\nu \widehat{{H}}^{(\ell)}\circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 2\le |\mu +\nu |\le 2\mathbf{N} +1,\\& \partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f {{H}}^{(\ell)}\circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}= \partial_{\overline{z}}^\nu \nabla_f \widehat{{H}}^{(\ell)}\circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 1\le |\mu +\nu |\le 2\mathbf{N} \end{aligned} \end{equation} since the pull backs of the terms of ${H}^{(\ell)}$ not contained in $\widehat{{H}}^{(\ell)}$ have zero derivatives because are higher order either in $z$ or in $f$, as can be seen considering that ${\phi}^{(0)}$ acts like \eqref{eq:quasilin51} for $M_0=\ell$. Since $\phi$ too has this structure, \eqref{eq:mainblock} is true also with ${\phi}^{(0)}$ replaced by $\phi$. \noindent Set now \begin{equation}\label{eq:pullcheck1} \widehat{{H}}^{(\ell)}\circ {\phi} = \psi (\varrho _j | _{j=1}^{4}) + F \text{ with } F:= \widehat{{H}}^{(\ell)}\circ {\phi} -\psi (\varrho _j | _{j=1}^{4}) . \end{equation} We have $d F \at{(\varrho, z,f)= (\varrho,0,0)}=0$, since by Lemma \ref{lem:ExpH11} we see that is at least quadratic in $(z,f)$ . Lemma \ref{lem:ODEbis} is telling us that $\phi ^{-1} \circ {\phi}^{(0)}$ is the identity up to a zero of order $\ell+1$ at $(z,f)=(0,0)$ in $\mathbb{C} ^{\mathbf{n}}\times (T^{\bot_{\Omega}}{\mathcal M}_{p^0 } \cap \Sigma_{- k}) $. Then by an elementary application of the chain rule \begin{equation*} \begin{aligned} & \partial_z^\mu \partial_{\overline{z}}^\nu F \at{(\varrho, z,f)= (\varrho,0,0)}= \partial_z^\mu \partial_{\overline{z}}^\nu F\circ \phi ^{-1} \circ {\phi}^{(0)} \at{(\varrho, z,f)= (\varrho,0,0)}, \quad 2\le |\mu +\nu |\le \ell +1, \\& \partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f F \at{(\varrho, z,f)= (\varrho,0,0)}= \partial_{\overline{z}}^\nu \nabla_f F\circ \phi ^{-1} \circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 1\le |\mu +\nu |\le \ell . \end{aligned} \end{equation*} On the other hand, by Lemma \ref{lem:ODEtris} we have that $\psi (\varrho _j | _{j=1}^{4})$ and $\psi (\varrho _j | _{j=1}^{4})\circ \phi ^{-1} \circ {\phi}^{(0)}$ differ by a zero of order $\ell +2$ in $(\varrho,0,0)$. Summing up, we conclude \begin{equation*} \begin{aligned} & \partial_z^\mu \partial_{\overline{z}}^\nu \widehat{{H}}^{(\ell)}\circ {\phi} \at{(\varrho, z,f)= (\varrho,0,0)}= \partial_z^\mu \partial_{\overline{z}}^\nu \widehat{{H}}^{(\ell)}\circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 2\le |\mu +\nu |\le \ell +1,\\& \partial_z^\mu \partial_{\overline{z}}^\nu \nabla_f \widehat{{H}}^{(\ell)}\circ {\phi} \at{(\varrho, z,f)= (\varrho,0,0)}= \partial_{\overline{z}}^\nu \nabla_f \widehat{{H}}^{(\ell)}\circ {\phi}^{(0)}\at{(\varrho, z,f)= (\varrho,0,0)}, \quad 1\le |\mu +\nu |\le \ell . \end{aligned} \end{equation*} Hence \cite[Theorem 6.4]{Cu0} implies Proposition~\ref{th:main}. \qed \section{Formulation of the system} \label{sec:system} So we consider the Hamiltonian $ {H}:= H^{(2\mathbf{N}+1)}$ and the reduced system \begin{equation} \label{eq:SystK1} \begin{aligned} & \dot z= \{ z, {H} \} \,, \quad \dot f= \{ f, {H} \}. \end{aligned} \end{equation} Recall that \begin{equation} \label{eq:partham} {H}=\psi (\Pi _j(f)| _{j=1}^{4}) + H'_2+Z_0+Z_1+{\mathcal R}, \end{equation} with $H'_2$ like \eqref{eq:ExpH2}, $Z_0$ like \eqref{e.12c}, $Z_1$ like \eqref{e.12a}, and \begin{equation} \label{eq:partham2}{\mathcal R} =\sum_{j=2}^3\mathbf{R}_j +{\mathcal R}^{1,2}_{k,m}(\Pi (f), f). \end{equation} We recall that, in the context of Strichartz estimates, the pair $(p,q)$ is called \emph{admissible} if \begin{equation}\label{admissiblepair} 2/p+3/q= 3/2, \qquad 2\le q\le 6, \qquad p\ge 2. \end{equation} \begin{theorem}\label{thm:mainbounds} Consider the constants $0<\epsilon <\epsilon_0 $ of Theorem~\ref{theorem-1.1}. Then there is a fixed $C >0$ such that \begin{align} & \| f \|_{L^p_t(\mathbb{R}_{+},W^{ 1,q}_x)}\le C \epsilon \text{ for all admissible pairs $(p,q)$,} \label{Strichartzradiation} \\& \| z^\mu \|_{L^2_t(\mathbb{R}_{+})}\le C \epsilon \text{ for all multi-indexes $\mu$ with $ \mathbf{{e}}\cdot \mu >\omega_0 $,} \label{L^2discrete}\\& \| z \| _{W^{1,\infty}_t (\mathbb{R}_{+})}\le C \epsilon.\label{L^inftydiscrete} \end{align} Furthermore, we have \begin{equation}\label{eq:limz} \lim_{t\to +\infty} z(t)= 0. \end{equation} \end{theorem} By standard arguments, such as a much simpler version of \cite[Sect. 7]{CM1} that we skip, Theorem~\ref{thm:mainbounds} is a consequence of the following continuity argument. \begin{proposition}\label{prop:mainbounds} Consider the constants $0<\epsilon <\epsilon_0 $ of Theorem~\ref{theorem-1.1}. There exists a constant $ \kappa >0$ such that for any $C_0>\kappa$ there is $ \epsilon_0 >0 $ such that if the inequalities \eqref{Strichartzradiation}--\eqref{L^inftydiscrete} hold for $I=[0,T]$ for some $T>0$ and for $C=C_0$, then in fact the inequalities \eqref{Strichartzradiation}--\eqref{L^inftydiscrete} hold for $I=[0,T]$ for $C=C_0/2$. \end{proposition} We now discuss the proof of Proposition~\ref{prop:mainbounds}, which is similar to the proof for the scalar NLS, see for example \cite{CM1} or \cite{Cu3}. We have, see \eqref{eq:X_Fsplit}, \begin{equation}\label{equation f} \dot f=(X_H^ {(0)})_f + (X_H^ {(1)})_f. \end{equation} In \cite{Cu3}, the equation was $\dot f= (X_H^ {(0)})_f$. Given multi-indexes $\Theta ', \Theta \in \mathbb{N}_{0}^{m} $ we write $\Theta ' < \Theta $ if $\Theta ' \neq \Theta $ and $\Theta '_l \le \Theta_l$, $1\le l\le m$. We now introduce \begin{eqnarray}\label{def-m-0} \mathbf{M}_0 =\left\{\mu\in\mathbb{N}_{0}^{\mathbf{n}} :\; |\mathbf{e} \cdot\mu|> \omega^0 \,, \quad |\mu|\leq 2\mathbf{N} +1, \quad |\mathbf{e} \cdot\mu '|< \omega^0 \text{ if $ \mu ' < \mu $} \right\}, \end{eqnarray} \begin{equation} \label{eq:defM}\begin{aligned} \mathbf{M} =\{ (\mu, \nu) \in \mathbb{N}_{0}^{2\mathbf{n}}& :\; |\mathbf{e} \cdot(\mu-\nu)|> \omega^0 \,, \quad |\mu+\nu|\leq 2\mathbf{N} +1 \text{ and }\\& |\mathbf{e} \cdot(\mu '-\nu ')|< \omega^0 \text{ if $ (\mu ', \nu ') < (\mu, \nu) $} \}. \end{aligned}\end{equation} Notice that \begin{equation} \label{eq:defM1}\begin{aligned} \text{if $(\mu, \nu) \in \mathbf{M}$ we have either $\mu =0$ and $\nu\in\mathbf{M}_0$, or $\nu =0$ and $\mu\in\mathbf{M}_0$}. \end{aligned}\end{equation} In \cite{CM1, Cu3} it is shown that, for $G_{\mu \nu}^0:=G_{\mu \nu }(0)$ and for $P_c$ the projection on $X_c$ in \eqref{eq:spectraldecomp}, \begin{equation} \label{eq:equation f}\begin{aligned} & (X_H^ {(0)})_f = \mathcal{H}_{p^0}f + \sum_{j=1}^{7} (\partial_{ \Pi_j(f)} H) P_c {\mathbbm{i}} \sigma_3 \Diamond_j f - \sum_{(\mu, \nu) \in \mathbf{M} } z^\mu \overline{z}^\nu G_{\mu \nu}^0 + R_1+ R_2, \end{aligned}\end{equation} and there is a constant $ C(C_0 )$ independent of $\epsilon$ such that the following is true: \begin{equation} \label{bound1:z1} \| R_1 \|_{L^1_t([0,T],H^{ 1 })}+\| R_2 \|_{L^{2 }_t([0,T],W^{ 1, \frac{6}{5}})}\le C(C_0 ) \epsilon^2. \end{equation} By similar proofs, \eqref{eq:equation f}--\eqref{bound1:z1} remain true here. Next from \eqref{eq:X_F1} we have \begin{equation*} \begin{aligned} X_H^ {(1)} = {\mathcal R}^{0,0}_{\infty,\infty}(\Pi (f)) & \left [ \langle \Diamond f, \mathcal{H}_{p^0}f \rangle + (\partial_{ \Pi (f)} H)\langle \Diamond f, {\mathbbm{i}} \sigma_3 \Diamond f\rangle + \langle \Diamond f, R_1+ R_2 \rangle \right. \\& - \sum_{(\mu, \nu) \in \mathbf{M}} z^\mu \overline{z}^\nu \left. \langle \Diamond f, G_{\mu \nu}^0 \rangle \right ] P_c {\mathbbm{i}} \sigma_3 \Diamond f. \end{aligned}\end{equation*} Hence \begin{equation} \label{eq:equation f1}\dot f -\left ( \mathcal{H}_{p^0}f + P_c {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond f\right )= - \sum_{(\mu, \nu) \in \mathbf{M}} z^\mu \overline{z}^\nu G_{\mu \nu}^0 + R_1+ R_2, \end{equation} with the following estimates which follow from \eqref{Strichartzradiation}--\eqref{L^inftydiscrete} and \eqref{bound1:z1}: \begin{equation} \label{eq:bound v}\begin{aligned} & \| \mathbf{v} \|_{L^1 ([0, T], \mathbb{R}^7) +L^\infty ([0, T], \mathbb{R}^7)}\le C(C_0 ) \epsilon. \end{aligned}\end{equation} Strichartz and smoothing estimates on $f$ are a consequence of well-known estimates for the group $e^{t\mathcal{H}_{p^0}} P_c$ which resemble those valid for $e^{{\mathbbm{i}}t \Delta}$. One source of trouble, already well-recognized in the earliest paper by Buslaev and Perelman \cite{MR1199635}, is the term $ P_c {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond f$. Here we will adopt the solution devised by Beceanu \cite[Lemma 2.16]{MR2831875}. To do so we consider the system $\dot f = {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond f$, writing it in the form \begin{equation} \label{eq:int fa} \begin{aligned} & \dot f = A(t)f+B(t)f \text{ with } A(t):= \sum_{j=1}^{4}{\mathbbm{i}} \sigma_3 \mathbf{v}_j(t) \Diamond_j \text{ and }B(t):= \sum_{j=5}^{7}{\mathbbm{i}} \sigma_3 \mathbf{v}_j (t)\Diamond_j. \end{aligned} \end{equation} Since $A(t)$ and $B(t)$ commute and the terms of the sum defining $A(t)$ commute, if we denote by $W (t,s)$ the fundamental solution of the system \eqref{eq:int fa}, that is, \begin{equation} \label{eq:fu sol} \begin{aligned} & \partial_t W (t,s)= (A(t)+ B(t)) W (t,s) \text{ with } W (s,s)=I, \end{aligned} \end{equation} and by $W_A(t,s)= e^{\int_s^tA(t')\,dt'}$ (resp. $W_B(t,s)$) the fundamental solution of $\dot f = A(t)f$ (resp. $\dot f = B(t)f$), then we have $ W (t,s)= W_A (t,s) W_B (t,s)$. We have the following lemma. \begin{lemma} \label{lem:error1} Let $M>5/2$ and $\alpha\in [0,1/2)$. Then there exists a constant $C>0$ dependent only on $M$ such that for all $s<t$ in $[0,T]$ \begin{align} & \| \langle x \rangle^{-M}\left (W (t,s) -1\right) e^{ {{\mathbbm{i}} \sigma_3 (\Delta -\omega^{0}) (t-s)}} \langle x \rangle^{-M } \|_{B (L^2, L^2)}\le C \psi_\alpha (t -s) \| \mathbf{v}\|^\alpha_{L^1 ([s,t]) +L^\infty ([s,t])} \nonumber\\& \text{ with $\psi_\alpha (t) = \langle t\rangle^{- \frac{3}{2} +\alpha }$ for $t\ge 1$ and $\psi_\alpha (t) = t^{- \alpha }$ for $t\in (0,1)$.}\label{eq:psialpha} \end{align} \end{lemma} \proof We have \begin{equation}\label{eq:error11} \begin{aligned} & W (t,s) -1= \left [(W_A(t,s) -1) W_B(t,s)\right ] +\left [ W_B(t,s) -1\right ]. \end{aligned} \end{equation} For the first term in the right-hand side, we have: \begin{equation} \begin{aligned} & \| \langle x \rangle^{-M}W_A(t,s) -1) W_B(t,s) e^{ {{\mathbbm{i}} \sigma_3 (\Delta -\omega^{0}) (t-s)}} \langle x \rangle^{-M } \|_{B (L^2, L^2)} \\& = \| \langle x \rangle^{-M}W_A(t,s) -1) e^{ {{\mathbbm{i}} \sigma_3 (\Delta -\omega^{0}) (t-s)}} \langle x \rangle^{-M } \|_{B (L^2, L^2)}, \end{aligned}\nonumber \end{equation} because $W_B(t,s)$ commutes with the operators on its right and is an isometry in $L^2$. Now the desired estimate for the first term in the r.h.s. of \eqref{eq:error11} is that of \cite[Lemma 9.4]{CM1}. We next consider the contribution from the second term in the r.h.s. of \eqref{eq:error11}. By the commutation properties of $W_B(t,s)$ we are reduced to bound \begin{equation} \begin{aligned} & \| \langle x \rangle^{-M} e^{ {{\mathbbm{i}} \sigma_3 (\Delta -\omega^{0}) (t-s)}} \langle x \rangle^{-M } \|_{B (L^2, L^2)} \left (\int_s^t \| B(t') W_B(t',s)dt' \|_{B (L^2, L^2)} \right)^{\alpha}. \end{aligned}\nonumber \end{equation} The first factor is bounded by $c_0 \langle t-s\rangle^{-\frac{3}{2}}$ while the second by $ |t-s|^{\alpha} \| B \|_{L^\infty ((s,t), B (L^2, L^2)) }^{\alpha}$, where the last factor is bounded by $\| \mathbf{v} \|_{L^\infty ((s,t), \mathbb{R}^7) }^{\alpha}$. \qed Now we have \begin{proposition}\label{thm:strich} Let $F(t)$ satisfy $P_cF(t)=F(t)$ Considerthe equation \begin{equation} \label{eq:strich1} \dot u - \mathcal{H}_{p^0}u - P_c {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond u=F. \end{equation} Then there exist fixed $\sigma >3/2 $, and an $\epsilon_0>0$ such that if $ \epsilon \in (0,\epsilon_0)$ then for any admissible pair $ (p,q)$ we have \begin{equation}\label{eq:strich3} \| u \| _{L^p([0,T],W^{1,q})}\le C (\| P_cu(0) \|_{H^1 } + \| F \| _{L^2([0,T],H^{1, \sigma})+ L^1([0,T],H^{1 })}). \end{equation} \end{proposition} By elementary arguments Proposition~\ref{thm:strich} implies the following result. \begin{corollary}\label{prop:conditional4.2} Under the hypotheses of Theorem~\ref{thm:mainbounds} there exist two constants $c_0$ and $\epsilon_0>0$ such that if $ \epsilon \in (0,\epsilon_0)$ then \begin{equation}\label{4.5} \| f \|_{L^p_t([0,T],W^{ 1,q}_x)}\le c_0 \epsilon +c_0 \sum_{(\mu, \nu) \in \mathbf{M}} \| z^{\mu +\nu }\|_{L^2(0,T)}, \end{equation} for any admissible pair $(p,q)$ in the sense of \eqref{admissiblepair}. \end{corollary} For the proof of this Corollary see for instance \cite[Lemma 8.1]{CM1}. \noindent \textit{Proof of Proposition~\ref{thm:strich}}. We follow \cite{MR2831875}. Denote $u_0=P_cu(0)$. We set $P_d:=1-P_c$, fix $\delta >0$ and consider \begin{equation}\label{ast} \begin{aligned} & \dot Z -\mathcal{H}_{p^0}P_cZ -P_c{\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond P_cZ=F - \delta P_d Z \,, \quad Z(0) =u_0.\end{aligned} \end{equation} Notice that, see \eqref{eq:lincom}, \begin{equation}\label{eq:potlin} \text{$ \mathcal{H}_{p^0}= {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0})+ V $ with $V\in \mathcal{S}(\mathbb{R}^3, B(\mathbb{C}^2, \mathbb{C}^2))$;} \end{equation} we then rewrite \eqref{ast} as \begin{equation*} \begin{aligned} & \dot Z - {\mathbbm{i}} \sigma_3 (\Delta - \omega^{0})Z -{\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond Z=F +V_1V_2 Z -\widetilde{P}_d (\mathbf{v}) Z \text{ with } Z(0) =u_0, \end{aligned} \end{equation*} $\widetilde{P}_d (\mathbf{v}):= P_d {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond + {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond P_d$ and $V_1V_2 =V -\mathcal{H}_{p^0}P_d - \delta P_d$ with $V_2(x)$ a smooth exponentially decaying and invertible matrix, and with the multiplication operator $V_1:H^{k,s'}\to H^{k,s}$ bounded for all $k$, $s$ and $s'$. We have: \begin{align} &Z (t) = W(t,0)e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) t}Z (0)\label{eq:423} \\& + \int_0^t e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) (t-t')}W(t,t') \left [ F(t')+ V_1 V_2 Z (t ') - \widetilde{P}_d (\mathbf{v}(t ')) Z(t ') \right ]\,dt'. \nonumber\end{align} For arbitrarily fixed pairs $(K,S)$ and $(K',S')$ there exists a constant $C$ such that we have \begin{equation*} \| \widetilde{P}_d (\mathbf{v}) V_2^{-1 } \|_{B (H^{-K',-S'},H^{ K, S })} \le C \epsilon. \end{equation*} By picking $\epsilon$ small enough, we can assume that the related operator norm is small. We have \begin{equation*} \label{eq:4231} \begin{aligned} & \| Z \|_{L^p_t W^{ q,1} \cap L^2_t H^{ k,-\tau_0} }\le C\| Z(0) \|_{H^{ 1 }}+C \| F \|_{L^1_t H^{ 1 } +L^2_t H^{ 1, \tau_0} } \\& + \| V_1 - \widetilde{P}_d (\mathbf{v}(t ')) V_2^{-1 } \|_{ L^\infty_t(B(H^{ 1 }, H^{ 1, \tau_0})) } \| V_2 Z (t) \|_{ L^2_t H^{ 1 } }. \end{aligned} \end{equation*} For $\widetilde{T}_0 f (t)= V_2\int_0^t e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) (t-t')}W(t,t') V_1 f(t') dt',$ by \eqref{eq:423}, we obtain: \begin{equation}\begin{aligned} & (I- \widetilde{T}_0) V_2Z (t)= V_2 W(t,0)e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) t}Z (0) \\& - V_2\int_0^t e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) (t-t')}W(t,t') \left [ F(t') - \widetilde{P}_d (\mathbf{v}(t ')) Z(t ') \right ]\,dt' \end{aligned}\nonumber \end{equation} We then obtain the desired result if we can show that \begin{equation} \label{ns1}\| (I- \widetilde{{T}}_0)^{-1} \|_{B(L^2([0,T), H^1(\mathbb{R}^3)), L^2([0,T), H^1(\mathbb{R}^3)))} <C_1, \end{equation} for $\epsilon C_1 $ smaller than a fixed number. Thanks to Lemma~\ref{lem:error1} it is enough to prove \eqref{ns1} with $\widetilde{T}_0$ replaced by \begin{equation}\begin{aligned} & {T}_0 f (t)= V_2\int_0^t e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) (t-t')} V_1 f(t') dt'. \end{aligned}\nonumber \end{equation} Set \begin{equation}\begin{aligned} & {T}_1 f (t)= V_2\int_0^t e^{ (-\mathcal{H}_{p^0}P_c +\delta P_d)(t'-t)} V_1 f(t')\,dt'. \end{aligned}\nonumber \end{equation} By \cite{MR1835384} we have $\| T_1 \|_{B(L^2([0,T), H^1(\mathbb{R}^3)), L^2([0,T), H^1(\mathbb{R}^3)))} <C_2$ for a fixed $C_2$. By elementary arguments, see \cite{NakanishiSchlag}, \begin{equation}\begin{aligned} & (I- {T}_0) (I+ {T}_1)= (I+ {T}_1) (I- {T}_0)=I. \end{aligned}\nonumber \end{equation} This yields \eqref{ns1} with $ \widetilde{{T}}_0$ replaced by $ {T}_0$ and with $C_1=1+C_2$. \qed Now we turn to the equations $\dot z_l = \mbox{$\imath\hskip -4pt\imath\,$} \partial_{\overline{z}_l}H$. We will prove the following. \begin{proposition}\label{prop:est z} There exists a fixed $c_0>0$ and a constant $ \epsilon_0>0$ which depends on $C_0$ such that \begin{equation}\label{eq:est z1}\begin{aligned} & \sum_l | z _l(t)|^2 + \sum_{(\mu, \nu) \in \mathbf{M}} \| z^{\mu +\nu }\|_{L^2(0,t)}^{2}\le c_0 (1+C_0)\epsilon^2, \qquad\forall t\in [0,T],\quad\forall\epsilon\in (0, \epsilon_0). \end{aligned} \end{equation} \end{proposition} Proposition~\ref{prop:est z} allows to conclude the proof of Proposition~\ref{prop:mainbounds}. The proof of Proposition~\ref{prop:est z} follows a series of standard steps, and is basically the same as the analogous proof in \cite{MR2805462}, or in \cite{MR2843104}. The first step in the proof of Proposition~\ref{prop:mainbounds} consists in splitting $f$ as follows: \begin{equation} \label{eq:g variable} g=f+ Y \,, \quad Y:=-\mbox{$\imath\hskip -4pt\imath\,$} \sum_{(\mu, \nu) \in \mathbf{M} } z^\mu \overline{z}^\nu R^{+}_{\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{p^ 0 } } (\mathbf{{e}} \cdot(\nu-\mu)) G_{\mu \nu}^0, \end{equation} where $R^{+}_{\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{p^ 0 } }$ is extension from above of the resolvent and makes sense because the theory of Jensen and Kato \cite{JK} holds also for these operators, see for example Perelman \cite[Appendix 4]{perelman} \noindent The part of $f$ that acts effectively on the variables $z$ will be shown to be $Y$, while $g$ is small, thanks to the following lemma. \begin{lemma}\label{lemma:bound g} For fixed $s>1$ there exist a fixed $c$ such that if $\epsilon_0$ is sufficiently small we have $\| g \|_{L^2((0,T), H^{0,-s} (\mathbb{R}^3, \mathbb{C}^4)}\le c \epsilon $. \end{lemma} \proof In the same way as the proof of Proposition~\ref{thm:strich} (which we wrote explicitly) is similar to analogous proofs valid for the scalar NLS \eqref{Eq:scalNLS}, the proof of Lemma~\ref{lemma:bound g} is analogous to the proof of \cite[Lemma 8.5]{CM1} contained in \cite[Sect. 10]{CM1} and is skipped here. The only difference between \cite{CM1} and the present situation is notational, in the sense that inside \eqref{eq:strich1} one has $ {\mathbbm{i}} \sigma_3 \mathbf{v}\cdot \Diamond u = {\mathbbm{i}} \sigma_3 \sum_{j\le 7}\mathbf{v}_j \Diamond_ju$, as opposed to \cite[(10.1)]{CM1}, where the corresponding terms are $ {\mathbbm{i}} \sigma_3 \sum_{j=1}^{4}\mathbf{v}_j \Diamond_ju$. But this does not make any difference in the proof because what matters is simply that each $\Diamond_j$ commutes with $-\Delta + \omega^0$, which was used to get \eqref{eq:423}. \qed Now we examine the equations on $z$. We have \begin{equation*}\label{eq:FGR0} \begin{aligned} & -\mbox{$\imath\hskip -4pt\imath\,$} \dot z_l = \partial_{\overline{z}_j}(H_2'+Z_0+Z_1+ \mathcal{R}). \end{aligned} \end{equation*} When we substitute \eqref{eq:g variable} and we set $R_{\mu \nu }^+=R_{ j\mathcal{H}_{p^0} }^+ (\mathbf{e}\cdot (\nu -\mu ))$ we obtain \begin{equation}\label{eq:FGR0-1} \begin{aligned} & -\mbox{$\imath\hskip -4pt\imath\,$} \dot z_l = \partial_{\overline{z}_j}(H_2'+Z_0) +\mbox{$\imath\hskip -4pt\imath\,$} \sum_{ \substack{(\alpha, \beta), (\mu, \nu) \in \mathbf{M} }} \nu_l\frac{z^{\mu +\alpha } \overline{{z }}^ { {\nu} +\beta}}{\overline{z}_l} \langle R_{ \alpha \beta}^+G^0_{ \alpha \beta },{\mathbbm{i}} \sigma_3G_{\mu \nu }\rangle \\ & + \sum_{(\mu, \nu) \in \mathbf{M}} \nu_l\frac{z^\mu \overline{ {z }}^ { {\nu} } }{\overline{z}_l} \langle g, {\mathbbm{i}} \sigma_3 G _{\mu \nu }\rangle + \partial_{ \overline{z}_l} {\mathcal R}. \end{aligned} \end{equation} Using \eqref{eq:defM1}, we rewrite this as \begin{align} \label{equation:FGR1}& -\mbox{$\imath\hskip -4pt\imath\,$} \dot z_l= \partial_{\overline{z}_l}(H_2+Z_0)+ \sum_{ (\mu, \nu) \in \mathbf{M}} \nu_l\frac{z^\mu \overline{ {z }}^ { {\nu} } }{\overline{z}_l} \langle g, {\mathbbm{i}} \sigma_3 G _{\mu \nu }\rangle + \mathcal{E}_l \\ & \label{equation:FGR12} +\mbox{$\imath\hskip -4pt\imath\,$}\sum_{ \substack{ \beta,\nu \in \mathbf{M}_0 }} \nu _l\frac{ \overline{{z }}^ {\nu +\beta } }{\overline{z}_l}\langle R_{ 0 \beta}^+ { G}_{ 0\beta }^0, {\mathbbm{i}} \sigma_3G^0_{0 \nu }\rangle \\ & \label{equation:FGR13} +\mbox{$\imath\hskip -4pt\imath\,$} \sum_{ \substack{ \alpha,\nu\in \mathbf{M}_0 }} \nu _l\frac{z^{ \alpha } \overline{{z }}^ {\nu } }{\overline{z}_l}\langle R_{ \alpha 0 }^+ G_{ \alpha 0}^0, {\mathbbm{i}} \sigma_3G^0_{0 \nu }\rangle. \end{align} Here the elements in \eqref{equation:FGR12} can be eliminated through a new change of variables that we will see momentarily and $\mathcal{E}_l$ is a remainder term defined by \begin{equation} \begin{aligned} & \mathcal{E}_l:= \sum_{ (\mu, \nu) \in \mathbf{M}} \nu_l\frac{z^\mu \overline{ {z }}^ { {\nu} } }{\overline{z}_l} \langle g, {\mathbbm{i}} \sigma_3 G _{\mu \nu }\rangle + \partial_{ \overline{z}_l} {\mathcal R} -\text{\eqref{equation:FGR12}}- \text{\eqref{equation:FGR13}}. \end{aligned} \nonumber \end{equation} Set \begin{equation}\label{equation:FGR2} \begin{aligned} & \zeta_l =z_l +\mbox{$\imath\hskip -4pt\imath\,$} \sum_{ \substack{ \beta,\nu \in \mathbf{M}_0 }} \frac{ \nu_l}{\mathbf{e} \cdot (\beta +\nu) } \frac{ \overline{{z }}^ {\nu +\beta } }{\overline{z}_l}\langle R_{ 0 \beta}^+ { G}_{ 0 \beta }^0, {\mathbbm{i}} \sigma_3G_{0 \nu }^0\rangle \\& -\mbox{$\imath\hskip -4pt\imath\,$} \sum_{ \substack{ \alpha, \nu \in \mathbf{M}_0 \\ \mathbf{e}\cdot \alpha \neq \mathbf{e}\cdot \nu }}\frac{ \nu_l}{\mathbf{e} \cdot (\alpha - \nu) } \frac{z^{ \alpha } \overline{ z}^ { \nu }}{\overline{z}_l} \langle R_{ \alpha 0 }^+ G^0_{ \alpha 0},{\mathbbm{i}} \sigma_3 G_{0 \nu }^0\rangle. \end{aligned} \end{equation} Notice that in \eqref{equation:FGR2}, by $\nu\in \mathbf{M}_0$, which implies $\nu \cdot \mathbf{e}>\omega^0$, we have $| {\nu} |>1$. Then by \eqref{L^2discrete}--\eqref{L^inftydiscrete} \begin{equation} \label{equation:FGR3} \begin{aligned} & \| \zeta - z \|_{L^2(0,T)} \le C \epsilon \sum_{\substack{ \alpha\in \mathbf{M}_0 }} \| z^{\alpha }\|_{L^2(0,T)} \le C(C_0) \epsilon^2, \\& \| \zeta - z \|_{L^\infty (0,T)} \le C(C_0)\epsilon^3. \end{aligned} \end{equation} In the new variables, \eqref{equation:FGR1} takes the form \begin{equation} \label{equation:FGR4} \begin{aligned} & -\mbox{$\imath\hskip -4pt\imath\,$} \dot \zeta _l= \partial_{\overline{\zeta}_l}H_2 (\zeta, f) + \partial_{\overline{\zeta}_l}Z_0 (\zeta, f)+ \mathcal{D}_l + \mbox{$\imath\hskip -4pt\imath\,$} \sum_{ \substack{ \alpha, \nu \in \mathbf{M}_0 \\ \mathbf{e}\cdot \alpha = \mathbf{e}\cdot \nu }}\nu_l \frac{\zeta^{ \alpha } \overline{ \zeta}^ { \nu }}{\overline{\zeta}_l} \langle R_{ \alpha 0 }^+ G^0_{ \alpha 0},{\mathbbm{i}} \sigma_3 G^0_{0 \nu }\rangle. \end{aligned} \end{equation} From these equations by $\sum_l \mathbf{e}_l \big(\overline{\zeta}_l \partial_{\overline{\zeta}_l}(H_2+Z_0) - {\zeta}_j \partial_{ {\zeta}_l}(H_2+Z_0)\big) =0$ we get \begin{equation} \label{eq:FGR5} \begin{aligned} &\partial_t \sum_{l=1}^\mathbf{n} \mathbf{e}_l | \zeta_l|^2 = 2 \sum_{l=1}^\mathbf{n} \mathbf{e}_l{\Im} \left ( \mathcal{D}_l\overline{\zeta}_l \right) +\\& +2 \sum_{ \substack{ \alpha,\nu\in \mathbf{M}_0\\ \mathbf{e}\cdot \alpha = \mathbf{e}\cdot \nu }} \mathbf{e}\cdot \nu \Re \Big(\zeta^{ \alpha } \overline{\zeta }^ { \nu } \langle R_{ \alpha 0}^+ G_{ \alpha 0}^0, {\mathbbm{i}} \sigma_3 G^0_{0\nu }\rangle \Big). \end{aligned} \end{equation} We have the following lemma, whose proof we skip; it is similar to \cite[Appendix B]{MR2843104}. \begin{lemma} \label{lemma:FGR1} Assume inequalities \eqref{Strichartzradiation}--\eqref{L^inftydiscrete}. Then for a fixed constant $c_0$ we have \begin{equation}\label{eq:FGR7} \sum_{j=1}^{\mathbf{n}}\|\mathcal{D}_j \overline{\zeta}_j\|_{ L^1[0,T]}\le (1+C_0)c_0 \epsilon^{2} . \end{equation} \end{lemma} For the sum in the second line of \eqref{eq:FGR5} we get \begin{equation} \label{eq:FGR8} \begin{aligned} & 2\sum_{\kappa>\omega ^0 } \kappa \Re \left \langle R_{\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{p^0}}^+ (-\kappa)\sum_{ \substack{ \alpha\in \mathbf{M}_0 \\ \mathbf{e}\cdot \alpha =\kappa }}\zeta^{ \alpha } G_{ \alpha 0}^0, {\mathbbm{i}} \sigma_3\sum_{ \substack{\nu\in \mathbf{M}_0 \\ \mathbf{e}\cdot \nu =\kappa }}\overline{\zeta}^{ \nu } G^0_{0\nu } \right \rangle =\\& \frac{1}{\pi}\sum_{\kappa >\omega ^0 } \kappa \Re \left \langle R_{\mbox{$\imath\hskip -4pt\imath\,$} \mathcal{H}_{p^0}}^+ (- \kappa)\mathbf{G}, {\mathbbm{i}} \sigma_3\overline{\mathbf{G} }\right \rangle \text{ for }\mathbf{G}:=\sqrt{2\pi}\sum_{ \substack{ \alpha\in \mathbf{M}_0 \\ \mathbf{e}\cdot \alpha =\kappa }}\zeta^{ \alpha } G_{ \alpha 0}^0, \end{aligned} \end{equation} where we use $G_{\mu \nu }^0= \overline{G^0}_{ \nu\mu} $ and where we sum on on the $\kappa >\omega ^0$ s.t. of the form $\kappa =\mathbf{e}\cdot \nu $ for some $\nu\in \mathbf{M}_0$ since, for other $\kappa$'s the contribution of $\kappa$ to the sum would be 0. \noindent As in \cite[Lemma 10.5]{MR2805462}, there exists ${L}_{ \alpha 0} \in W^{k,p}(\mathbb{R} ^3, \mathbb{C} ^4)$ for all $k\in \mathbb{R}$ and $p\ge 1$ such that the r.h.s. of \eqref{eq:FGR8} is equal to \begin{equation} \label{eq:FGR81} \begin{aligned} & \sum_{\kappa >\omega ^0 } \kappa \Lambda(\kappa,\zeta) \text{ for }\Lambda(\kappa,\zeta) =\frac{1}{\pi}\Re \left \langle R_{\mbox{$\imath\hskip -4pt\imath\,$}{\mathbbm{i}} \sigma_3 (-\Delta + \omega^0)}^+ (- \kappa)\mathbf{L}(\zeta), {\mathbbm{i}} \sigma_3\overline{\mathbf{L} }\right \rangle \text{ and } \mathbf{L}(\zeta):=\sqrt{2\pi}\sum_{ \substack{ \alpha\in \mathbf{M}_0 \\ \mathbf{e}\cdot \alpha =\kappa }}\zeta^{ \alpha } L_{ \alpha 0}^0, \end{aligned} \end{equation} where on the left we sum over $\kappa =\mathbf{e}\cdot \alpha $ with $\alpha \in \mathbf{M}_0$. We claim that each term in the above summation is non-negative. To see this observe that $ \Lambda(\kappa,\zeta)=\Lambda_1(\kappa,\zeta)+\Lambda_2 (\kappa,\zeta)$, $\mathbf{L}(\zeta) = {^t (\mathbf{L}_1(\zeta),\mathbf{L}_2(\zeta))}$, with \begin{equation*} \Lambda_i(\kappa,\zeta)= \frac{1}{\pi}(-1)^{i+1}\Re \left \langle R_{\mbox{$\imath\hskip -4pt\imath\,$}{\mathbbm{i}} (-1)^{i+1} (-\Delta + \omega^0)}^+ (- \kappa)\mathbf{L}_i, {\mathbbm{i}} \overline{\mathbf{L} }_i\right \rangle. \end{equation*} Introduce now \begin{equation*} U=\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ \mbox{$\imath\hskip -4pt\imath\,$} & -\mbox{$\imath\hskip -4pt\imath\,$} \end{pmatrix} \text{ such that }U^{-1}{\mathbbm{i}} U =-\mbox{$\imath\hskip -4pt\imath\,$} \sigma_3, \end{equation*} with $\sigma_3$ the Pauli matrix \eqref{pauli-matrices}. Taking the complex conjugation, $\overline{U}^{-1}{\mathbbm{i}} \overline{U} =\mbox{$\imath\hskip -4pt\imath\,$} \sigma_3$. Then, using ${^t \overline{U}}= {U}^{-1}$, we have, for $ U^{-1}\mathbf{L}_{i}= {^t (\mathbf{L}_{i1},\mathbf{L}_{i2})}$: \begin{equation*} \begin{aligned} & \pi \Lambda_i(\kappa,\zeta) = (-1)^{i+1}\Re \left \langle U^{-1} R_{\mbox{$\imath\hskip -4pt\imath\,$}{\mathbbm{i}} (-1)^{i+1} (-\Delta + \omega^0)}^+ (- \kappa)U U^{-1}\mathbf{L}_i, \overline{U}^{-1} {\mathbbm{i}} \overline{U} \overline{U}^{-1}\overline{\mathbf{L} }_i\right \rangle \\& = (-1)^{i+1}\Re \left \langle R_{ (-1)^{i+1} \sigma_3(-\Delta + \omega^0)}^+ (- \kappa) U^{-1}\mathbf{L}_i, \mbox{$\imath\hskip -4pt\imath\,$} \sigma_3 \overline{U}^{-1}\overline{\mathbf{L} }_i\right \rangle \\& = (-1)^{i+1}\Re \left \langle R_{ (-1)^{i+1} (-\Delta + \omega^0)}^+ (- \kappa) \mathbf{L}_{i1}, \mbox{$\imath\hskip -4pt\imath\,$} \overline{\mathbf{L} }_{i1}\right \rangle -(-1)^{i}\Re \left \langle R_{ (-1)^{i} (-\Delta + \omega^0)}^+ (- \kappa) \mathbf{L}_{i2}, \mbox{$\imath\hskip -4pt\imath\,$} \overline{\mathbf{L} }_{i2}\right \rangle. \end{aligned} \end{equation*} Using Plemelj formula we have \begin{equation*} \begin{aligned} & \Lambda_1(\kappa,\zeta)= \left \langle \mbox{$\imath\hskip -4pt\imath\,$} \delta (\Delta- \omega^0+ \kappa) \mathbf{L}_{12}, \mbox{$\imath\hskip -4pt\imath\,$} \overline{\mathbf{L} }_{12}\right \rangle =- \left \langle \delta (\Delta- \omega^0+ \kappa) \mathbf{L}_{12}, \overline{\mathbf{L} }_{12}\right \rangle \le 0 \end{aligned} \end{equation*} and \begin{equation*} \begin{aligned} & \Lambda_2(\kappa,\zeta)= \left \langle \mbox{$\imath\hskip -4pt\imath\,$} \delta (\Delta - \omega^0+ \kappa) \mathbf{L}_{21}, \mbox{$\imath\hskip -4pt\imath\,$} \overline{\mathbf{L} }_{21}\right \rangle =- \left \langle \delta (\Delta - \omega^0+ \kappa) \mathbf{L}_{21}, \overline{\mathbf{L} }_{21}\right \rangle \le 0. \end{aligned} \end{equation*} The Fermi Golden Rule consists in two parts. The 1st part consists in showing that $ \Lambda ( \kappa , \zeta )$ are negative quadratic forms for the vector $(\zeta^\alpha )_{\alpha\in \mathbf{M}_0 \ s.t.\ \alpha\cdot \omega ^0=\kappa}$. This was proved here. The 2nd part is that the $ \Lambda ( \kappa , \zeta )$ are strictly negative quadratic forms. This is expected to be generically true (as a similar statement was expected to be true in \cite{MR1334139,SW3}). We don't know how to prove this. For a proof on a different problem, see \cite[Proposition 2.2]{MR3053771}. For specific systems the strict negative condition ought to be checked numerically. Here we assume it as an hypothesis: \begin{itemize} \item[(H9)] (\textit{Fermi Golden Rule}) the l.h.s. of \eqref{eq:FGR}, proved above to be negative, is strictly negative, that is for some fixed constants and for any vector $\zeta \in \mathbb{C}^\mathbf{n}$ we have \begin{equation} \label{eq:FGR} \begin{aligned} & \sum_{\kappa >\omega ^0 } \kappa \Lambda(\kappa,\zeta) \approx -\sum_{ \alpha\in \mathbf{M}_0 } | \zeta^\alpha |^2. \end{aligned} \end{equation} \end{itemize} By (H9) we have \begin{equation} \label{eq:FGR10} \begin{aligned} & 2\sum_{l=1}^{\mathbf{n}}\mathbf{e }_l\Im \left (\mathcal{D}_l \overline{\zeta}_l \right)\gtrsim \partial_t \sum_{l=1}^{\mathbf{n}}\mathbf{e }_l| \zeta_l|^2 + \sum_{ \alpha\in \mathbf{M}_0 } | \zeta^\alpha |^2. \end{aligned} \end{equation} Then, for $t\in [0,T]$ and assuming Lemma~\ref{lemma:FGR1}, we have \begin{equation*} \sum_{l=1}^{\mathbf{n}}\mathbf{e }_l | \zeta_l(t)|^2+ \sum_{ \alpha\in \mathbf{M}_0 } \| \zeta^\alpha \|_{L^2(0,t)}^2\lesssim \epsilon^2+ C_0\epsilon^2. \end{equation*} By \eqref{equation:FGR3} this implies $|z|_{L^\infty(0,t)}^2+ \| z^\alpha \| _{L^2(0,t)}^2\lesssim \epsilon^2+ C_0\epsilon^2$ for all the above multi-indexes and yields Proposition~\ref{prop:est z}. \qed In the course of the proof we have shown that $\| z^\alpha \|_{L^2(0,t)}^2\lesssim C_0^2\epsilon^2$ and \eqref{def:epsilon} together imply $\| z^\alpha \|_{L^2(0,t)}^2\lesssim C_0\epsilon^2$. This means that we can take $C_0\approx 1$. With Corollary \ref{prop:conditional4.2} this completes the proof of Proposition \ref{prop:mainbounds}. \qed \section{Proof of Theorem~\ref{theorem-1.1}} \label{sec:end} \begin{lemma}\label{lem:scattf} There is $f_+ \in H^1(\mathbb{R}^3, \mathbb{C}^4)$ such that $f(t)$ from \eqref{Strichartzradiation} satisfies \begin{equation}\label{eq:scattering1} \begin{aligned} & \lim_{t\to + \infty } \| f(t) - W(t,0)e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) t}f_+ \|_{H^1 }=0, \end{aligned} \end{equation} where $W(t,s)$ is the fundamental solution from \eqref{eq:fu sol}. \end{lemma} \proof Starting from \eqref{eq:equation f} and using \eqref{eq:potlin}, we obtain the following analogue of \eqref{eq:423}: \begin{equation*} \begin{aligned} & f (t) = W(t,0)e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) t}f (0) \\& + \int_0^t e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) (t-t')}W(t,t') \Big[ V f (t ') - \sum_{(\mu, \nu) \in \mathbf{M}} z^\mu (t ') \overline{z}^\nu (t ') G_{\mu \nu}^0 + R_1(t ')+ R_2(t ') \Big]\,dt'. \end{aligned} \end{equation*} This implies, by standard arguments (cf. \cite[Sect. 11]{CM1}), that $ W(0,t)e^{ {\mathbbm{i}} \sigma_3 (\Delta - \omega^{0}) t}f(t) \mathop{\longrightarrow}\limits\sb{t\to +\infty}f_+ $ in $H^1(\mathbb{R}^3, \mathbb{C}^4)$. \qed \textit{Completion of the proof of Theorem~\ref{th:main}.} Recall that expressing $u$ in terms of the coordinates in \eqref{eq:coordinate} we have \begin{equation}\label{eq:u} u(t)= e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j'(t) \Diamond_j } \big(\sqrt{1-| b'(t) |^2} + b '(t) \sigma_2 \mathbf{C}\big) \big(\Phi_{ p' (t) } +P_{ p'(t)}r'(t)\big), \end{equation} where we denote by $ (p ',\tau ',b', r')$ the initial coordinates. Using the invariance $\Pi (u(t))= \Pi (u_0)$ we can express $ (p ', b')$ in terms of $r'$: \begin{equation}\label{eq:compl0} \begin{aligned}& p'_j(t) = \Pi_j(u_0) - \Pi_j(r' (t)) + {\mathcal R}^{1,2}_{\infty,\infty }\big(\Pi (r' (t)),r' (t)\big) \quad\text{for $j=1,2,3,4$}; \\& b_R'(t) = \frac{1}{2p_4^0} \Pi_{5}(r'(t))+ {\mathcal R}^{2,0}_{\infty,\infty}\big(\Pi (r'(t))\big) +{\mathcal R}^{1,2}_{\infty,\infty} \big(\Pi (r'(t)), r'(t)\big); \\& b_I' (t)= \frac{1}{2p_4^0} \Pi_{6}(r'(t))+ {\mathcal R}^{2,0}_{\infty,\infty} \big(\Pi (r'(t))\big) +{\mathcal R}^{1,2}_{\infty,\infty}\big(\Pi (r'(t)), r'(t)\big) . \end{aligned} \end{equation} Furthermore we can express $r'$ in terms of the $(z,f)$ of the last coordinate system for $\ell = 2\mathbf{N}+1$ in Proposition~\ref{th:main}: \begin{equation}\label{eq:compl01} \begin{aligned} r'(t)= e^{{\mathbbm{i}} \sum _{j=1}^{4}\sigma_3{\mathcal R}^{0,2}_{k,m} \big(\Pi (f(t)), z(t), f(t)\big) \Diamond _j }& T(e^{ \sum _{i=1}^{3}{\mathcal R}^{0,2}_{k,m}(t, \Pi (f), z, f) {\mathbbm{i}} \sigma _i}) \\& \left(f(t)+ \mathbf{{S}}^{0,1}_{k,m}\big(\Pi (f(t)), z(t), f(t)\big)\right). \end{aligned} \end{equation} Notice that while the changes of coordinates in Lemma~\ref{lem:darboux} and in the normal forms argument in Section~\ref{sec:Normal form} need to involve loss of regularity of $f$, in order to be differentiable so that the pullback of the symplectic forms makes sense. Nonetheless these maps are also continuous changes of coordinates inside in $H^1(\mathbb{R}^3, \mathbb{C}^2)$, see Lemma~\ref{lem:ODE} for $l=0$. Notice that \eqref{Eq:NLS} leaves $\Sigma _k(\mathbb{R}^3, \mathbb{C}^2)$ invariant for any $k \in \mathbb{N}$ and that, similarly, system leaves $\mathbb{C}^{\mathbf{n}}\times (X_c\cap \Sigma _k(\mathbb{R}^3, \mathbb{C}^2))$ invariant. \noindent By the well-posedness of \eqref{Eq:NLS} in $H^1(\mathbb{R}^3, \mathbb{C}^2)$ and of \eqref{eq:SystK1} in $\mathbb{C}^{\mathbf{n}}\times X_c$, as a continuous change of coordinates \eqref{eq:u}--\eqref{eq:compl01} maps solutions of \eqref{eq:SystK1} in $\mathbb{C}^{\mathbf{n}}\times X_c$ into solutions in $H^1(\mathbb{R}^3, \mathbb{C}^2)$ of \eqref{Eq:NLS}, in particular capturing the solutions of \eqref{Eq:NLS} in the statement of Theorem~\ref{th:main}. See also \cite[Sect. 8]{CM2}. \noindent By Lemma~\ref{lem:scattf} it is easy to conclude that ${\mathcal R}^{0,2}_{k,m}\mathop{\longrightarrow}\limits\sb{t\to +\infty} 0 $ in $\mathbb{R}^7$ and $\mathbf{{S}}^{0,1}_{k,m}\mathop{\longrightarrow}\limits\sb{t\to +\infty} 0 $ in $ \Sigma_k(\mathbb{R}^3, \mathbb{C}^4)$ for the terms in \eqref{eq:compl01}, and that ${\mathcal R}^{1,2}_{k,m}\mathop{\longrightarrow}\limits\sb{t\to +\infty} 0 $ for the terms in \eqref{eq:compl0}. Then for $1\le j\le 4$ we have \begin{equation*}\begin{aligned}& \lim_{t\to +\infty} \Pi_j(r' (t)) = \lim_{t\to +\infty} \Pi_j(f (t)) =\lim_{t\to +\infty}\Pi_j \big(W(t,0)e^{\mathbbm{i} \sigma_3(-\Delta + \omega^{0}) t}f_+\big) = \Pi_j(f_+) \end{aligned}\end{equation*} since $\Pi_j\big(W(t,0)e^{ {\mathbbm{i}} \sigma_3 (-\Delta + \omega^{0}) t}f_+\big) = \Pi_j(f_+)$. Hence, since $p$ is characterized by the first four variables (cfr. \eqref{def p}), this defines $p_+$ in \eqref{eq:scattering}. \noindent We consider a function $ g\in C^1(\mathbb{R}_+, \mathbf{G})$ such that \begin{equation*} e^{ -{\mathbbm{i}} \sigma_3\sum_{j=1}^{4}\tau_j'(t) \Diamond_j } \big(\sqrt{1-| b'(t) |^2} + b '(t) \sigma_2 \mathbf{C}\big) =T(g(t)). \end{equation*} By \eqref{eq:compl01} we have \begin{equation}\label{expans1}\begin{aligned}& T(g(t))P_{ p'(t)}r'(t) = T(g(t)) e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^4{\mathcal R}^{0,2}_{k,m} \Diamond _j } T(e^{\sum _{i=1}^3{\mathcal R}^{0,2}_{k,m} {\mathbbm{i}}\sigma _i}) f + o_{\Sigma_{k}}(1), \end{aligned}\end{equation} where $o_{\Sigma_{k}}(1) \mathop{\rightarrow}\limits\sb{t\to +\infty} 0 $ in $\Sigma_{k}(\mathbb{R}^3, \mathbb{C}^2)$. We claim that \begin{claim}\label{claim:represent} \begin{equation}\label{eq:represent1} T(g(t)) e^{{\mathbbm{i}} \sigma_3\sum _{j=1}^4{\mathcal R}^{0,2}_{k,m} \Diamond _j } T(e^{\sum _{i=1}^3{\mathcal R}^{0,2}_{k,m} {\mathbbm{i}}\sigma _i})= \widetilde{W}(0,t) \end{equation} with $\widetilde{W}(t,s)$ the fundamental solution, in the sense of \eqref{eq:fu sol}, of a system of the form \begin{equation}\label{eq:represent2} \dot u = {\mathbbm{i}} \sigma_3 \widetilde{\mathbf{v}} \cdot \Diamond u, \qquad \text{where} \quad \widetilde{\mathbf{v}} \cdot \Diamond = \sum_{j=1}^{7}{\mathbbm{i}} \sigma_3 \widetilde{\mathbf{v}}_j(t) \Diamond_j. \end{equation} \end{claim} We prove the above Claim \ref{claim:represent} in Appendix \ref{sec:flowspf}. \noindent Substituting \eqref{eq:coordinate} and \eqref{eq:compl01} into \eqref{Eq:NLS}, we get for a $G_1 \in C^0 (H^1(\mathbb{R}^3, \mathbb{C}^2), L^1(\mathbb{R}^3, \mathbb{C}^4))$ \begin{equation}\label{eq:compl3} \begin{aligned} & \dot f=-{\mathbbm{i}} \sigma_3 \Delta f+ {\mathbbm{i}} \sigma_3 \widetilde{\mathbf{v}} \cdot \Diamond f +G_1(u), \end{aligned} \end{equation} while from \eqref{eq:equation f1} we have for a $G_2 \in C^0 (H^1(\mathbb{R}^3, \mathbb{C}^2), L^1(\mathbb{R}^3, \mathbb{C}^4))$ \begin{equation} \label{eq:equation f1-1}\begin{aligned} & \dot f = -{\mathbbm{i}} \sigma_3 \Delta f +{\mathbbm{i}} \sigma_3 \omega^0 f + {\mathbbm{i}} \sigma_3 {\mathbf{v}} \cdot \Diamond f+G_2(u). \end{aligned}\end{equation} The fact that $G_1 ,\,G_2 \in C^0 (H^1(\mathbb{R}^3, \mathbb{C}^2), L^1(\mathbb{R}^3, \mathbb{C}^4))$ is rather simple. For example $G_2(u)$ is given by the sum of the r.h.s. of \eqref{eq:equation f1} with a linear term $V _{\omega ^0}f$ where $V _{\omega ^0}\in S (\mathbb{R} ^3, M(\mathbb{C} ^4) )$ is a matrix valued function whose entries are of the form $ \beta (\phi_{\omega ^0}^2) $ and $ \beta ' (\phi_{\omega ^0}^2)$ and is the potential term inside $\mathcal{H}_{p^0}$. Obviously $u\to f$ is in $C^0 (H^1(\mathbb{R}^3, \mathbb{C}^2), L^2(\mathbb{R}^3, \mathbb{C}^4))$: this follows from the continuity of $u\to r(u)$ in Lemma \ref{lem:gradient R}, the continuity of $r\to f$, see \eqref{eq:decomp2}, and the continuity of the maps in \eqref{eq:ODE1} and in \eqref{eq:quasilin51}. \noindent The rest of $G_2(u)$ comes from the r.h.s. of \eqref{eq:equation f1}, obtained applying $\nabla _f$ to the terms $\mathbf{R} | _{j=1} ^{3} $ in the expansion \eqref{eq:ExpH11}. It is elementary that this too is in $ \in C^0 (H^1(\mathbb{R}^3, \mathbb{C}^2), L^1(\mathbb{R}^3, \mathbb{C}^4))$. \noindent By comparing the equation for $f$ with $G_1$ and the equation for $f$ with $G_2$, it follows that we necessarily have $ \widetilde{\mathbf{v}} \cdot \Diamond = \omega^0 + {\mathbf{v}} \cdot \Diamond $, see \cite[Lemma 13.8]{Cu3}. Hence, returning to \eqref{expans1}, we have \begin{equation} \begin{aligned}& T(g(t))P_{ p'(t)}r'(t) = \widetilde{W}(0,t) W(t,0) e^{ {\mathbbm{i}} \sigma_3 \omega^{0} t} e^{ - {\mathbbm{i}} \sigma_3 \Delta t}f_+ + o_{H^1}(1), \end{aligned}\nonumber \end{equation} where \begin{equation*} \partial_t (\widetilde{W}(0,t) W(t,0)e^{ {\mathbbm{i}} \sigma_3 \omega^{0} t}) = \widetilde{W}(0,t) {\mathbbm{i}} \sigma_3\left (({\mathbf{v}} - \widetilde{{\mathbf{v}}}) \cdot \Diamond +\omega ^0 \right ) W(t,0) =0. \end{equation*} We conclude that there exists $g_0\in \mathbf{G}$ such that for $h_+= T(g_0) f_+$ one has \begin{equation} \begin{aligned}& T(g(t))P_{ p'(t)}r'(t) = e^{ - {\mathbbm{i}} \sigma_3 \Delta t} h_+ + o_{H^1}(1). \end{aligned}\nonumber \end{equation} This completes the proof of \eqref{eq:scattering} and of Theorem~\ref{th:main}.\qed
\subsection*{Keywords} XL algorithm, multinomial, ordinary multinomials, unimodal. \newpage \section{Introduction} Algorithms and methods for solving systems of polynomial equations in several variables have many applications, and the XL algorithm is one such method. Most papers so far that analyse the XL algorithm have considered quadratic equations only. In this article we will present some results on the success parameter of the XL algorithm for arbitrary degree polynomials. In Section \ref{xlback} we give background on the XL algorithm, and in Section \ref{hilbert} we prove a new theoretical result in commutative algebra (following Diem \cite{Diem04}) which will allow us to estimate the optimal termination value. In Section \ref{om} we will prove that the ordinary multinomials $\binom{N}{k}_s$ are strongly unimodal, as well as finding the smallest $k$ such that the inequality $\binom{N}{k}_s\leq k$ holds. These results are of independent interest and this section may be read independently of the rest of the paper. We will prove another inequality involving ordinary multinomials in Section \ref{c2}. Other papers have outlined proofs of unimodality of ordinary multinomials before; however, our method is different and proves \emph{strong} unimodality. Section \ref{c1} contains the main results of the paper -- our theoretical and computational results on the XL algorithm in the case of one more equation than unknown, and Section \ref{c2} considers the case of two more equations than unknowns. \section{Background on the XL algorithm}\label{xlback} The XL (eXtended Linearization) Algorithm, introduced in \cite{CKPS00}, is an algorithm to solve (overdetermined) systems of multivariate polynomial equations. Consider a system of multivariate polynomial equations \begin{align*} f_1(x_1,\ldots,x_n)&=0\\ &\ldots\\ f_{n+c}(x_1,\ldots,x_n)&=0\\ \end{align*} over a (finite) field K, where $c\geq1$.\\ Fix $D\in\mathbb{N}$, where $D> \deg(f_i)$ for all $i$. We call $D$ the maximal degree. We consider the system of all products\\ \begin{equation*} \prod^k_{l=1} x_{j_l}\cdot f_i(x_1,\ldots,x_n) \end{equation*} where $k\leq D-\deg(f_i)$ for $i=1,\ldots,n+c$. Note that \cite{CKPS00} assumes $\deg(f_i)=2$ for all $i$, an assumption we do not make. The idea of the XL algorithm is to linearize this new system in hope of finding a univariate equation which then allows us to solve the initial system.\\ \bigskip \begin{Definition}{(The XL Algorithm)} Input: polynomials $f_1, \ldots ,f_{n+c}$ in variables $x_1,\ldots ,x_n$ (an overdetermined system with 0-dimensional solution space) and a positive integer $D\geq 1+\max_i \deg(f_i)$. Output: All solutions of the system $f_1=0, \ldots ,f_{n+c}=0$. \begin{enumerate} \item \textbf{Multiply}: Generate all the products $\prod^k_{l=1} x_{j_l}\cdot f_i(x_1,\ldots,x_n)$ with $k\leq D-deg(f_i)$. \item \textbf{Linearize}: Consider each monomial in the $x_i$ of degree $\leq D$ as a new variable and perform Gaussian elimination on the equations obtained in step 1.\\ The ordering on the monomials must be such that all the terms containing one (fixed) variable (say $x_1$) are eliminated last. \item \textbf{Solve}: If step 2 yields at least one univariate equation in the powers of $x_1$, solve this equation over $K$. If not, algorithm fails. \item \textbf{Repeat}: Substitute each solution for $x_1$ into the other equations and repeat the process to find the values of the other variables. \end{enumerate} \end{Definition} \bigskip See \cite{CY04} for some variations and discussions of the algorithm, and a comparison with Gr\"{o}bner basis algorithms. In particular, it was shown by Moh \cite{Moh} (see also \cite{CY04}) that the algorithm terminates for some $D$ provided the solution set is 0-dimensional. One might set the starting value of $D$ at $D=1+\max_i \deg(f_i)$. If the 'Solve' step fails for this $D$, or any $D$, we increment the input value of $D$ and run the algorithm again. In practice, the first $D$ at which the algorithm succeeds and terminates is usually larger than $D=1+\max_i \deg(f_i)$. Considering only those $D$ for which the XL algorithm succeeds, the algorithm increases in running time with $D$. Therefore, when looking for maximum efficiency we would like to know the smallest $D$ such that the XL algorithm succeeds. Let us denote this value by $D^*$, the optimal input value of $D$. If we know $D^*$, we would use this as the starting input value for $D$. If we don't know the exact value of $D^*$ then a lower bound for $D^*$ is useful because we can use the lower bound as the starting value in the XL algorithm. Using ordinary multinomials, we will derive some lower bounds in this article. \section{A Hilbert series associated to the XL algorithm}\label{hilbert} We will now follow C. Diem (\cite{Diem04}) to set up the theoretical background for determining the optimal choice of the maximal degree $D$.\\ Let $V_D$ be the $K$-vector space generated by the products produced in the first step of the XL algorithm, i.e. \begin{equation} \label{eq:V_D} V_D=\langle \prod^k_{l=1} x_{j_l}\cdot f_i(x_1,\ldots,x_n) \text{ with } k\leq D-deg(f_i) \rangle_K \end{equation} Let $K[x_1,\ldots,x_n]_{\leq D}$ be the $K$-vector space of polynomials of total degree $\leq D$. Let \begin{equation} \label{eq:chi(D)} \chi(D):=dim_K(K[x_1,\ldots,x_n]_{\leq D})-dim_K(V_D) \end{equation} \begin{Theorem}\label{success} (\cite{Diem04}) If $\chi(D)\leq D$ then the XL algorithm terminates for that $D$. \end{Theorem} \bigskip \begin{proof} Since $dim_K(K[x_1]_{\leq D})=D+1$, if $\chi(D)\leq D$ then $dim_K(K[x_1]_{\leq D})>\chi(D)$, i.e. $dim_K(V_D)+dim_K(K[x_1]_{\leq D})>dim_K(K[x_1,\ldots,x_n]_{\leq D})$ and hence $V_D\cap K[x_1]_{\leq D}\neq \{0\}$. So step 2 of the XL algorithm produces a univariate equation in $x_1$ in this case. \end{proof} Clearly then, for reasons of efficiency of the XL algorithm, we would like to know the the smallest $D$ such that $\chi(D)\leq D$. We will now try to estimate $\chi(D)$ in order to find the smallest $D$ such that $\chi(D)\leq D$. \bigskip Let $K[x_0,x_1,\ldots,x_n]_D$ be the $K$-vector space of all homogeneous polynomials of total degree $D$. Let $F_i\in K[x_0,x_1,\ldots,x_n]$ denote the homogenization of $f_i$. Then $V_D\cong I_D$ via the degree D homogenization map, where \begin{equation*} I_D := \langle \prod^k_{l=1} x_{j_l}\cdot F_i(x_0,x_1,\ldots,x_n) \text{ with } k=D-deg(F_i) \rangle_K \end{equation*} Now $I_D$ is the $D^{\text{th}}$ homogeneous component of the homogeneous ideal $I:=(F_1,\ldots,F_{n+c})\vartriangleleft K[x_0,\ldots,x_n]$. It follows that \begin{align*} \chi(D)&=dim_K(K[x_0,\ldots,x_n]_D)-dim_K(I_D)\\ &=dim_K(K[x_0,\ldots,x_n]_D/I_D)\\ &=dim_K((K[x_0,\ldots,x_n]/I)_D) \end{align*} \begin{Definition} Let $R:=K[x_0,\ldots,x_n]$. Let $M=\oplus_{i\in\mathbb{N}}M_i$ be a finitely generated positively graded $R$ module. Define the Hilbert function of $M$ as \begin{align*} \chi_M :\text{ } \mathbb{N}_0&\rightarrow\mathbb{N}_0\\ i&\mapsto dim_R(M_i) \end{align*} and the Hilbert series of $M$ as $H_M:=\displaystyle\sum_{i\in\mathbb{N}}\chi_M(i)T^i$. \end{Definition} So $\chi(D)=\chi_{R/I}(D)$ $\forall D\in\mathbb{N}$. \begin{Definition}{(see also \cite{Froberg85})} A form $G\in K[x_0,\ldots,x_n]$ of degree $d$ is called \textit{generic} if all monomials of degree $d$ in $K[x_0,\ldots,x_n]$ have non-zero coefficients in $G$, and those coefficients are algebraically independent over the prime field of $K$. \end{Definition} \begin{Lemma} The Hilbert series of an ideal generated by a generic system of forms depends only on the field characteristic, the rank $n$, and the degrees of the forms. If $\text{char } K=0$, we call it the generic Hilbert series of type $(n+1;m;d_1,\ldots,d_m)$ where $m$ is the number of forms. (For us, $m=n+c$.) \end{Lemma} \begin{proof} See \cite{Diem04}. \end{proof} \begin{Proposition}\label{Hilbert_series_type} Let $K$ be a field (any characteristic), let $F_1,\ldots,F_m\in R:=K[x_0,\ldots,x_n]$ be forms of degree $d_1,\ldots,d_m$ (not necessarily generic). Let $I:=(F_1,\ldots,F_m)\vartriangleleft R$. Let $H_g$ be the generic Hilbert series of type $(n+1;m;d_1,\ldots,d_m)$. Then $H_{R/I}\geq H_g$ coefficient-wise. \end{Proposition} \begin{proof} See \cite{Diem04}. \end{proof} \begin{Proposition}\label{multiplicationmap} Let $G_1,\ldots,G_m=G\in R$ be a generic system of forms with $m\leq n+1$, let $d=deg(G)$. Let $J:=(G_1,\ldots,G_{m-1})\vartriangleleft R$. Then for all $D\in\mathbb{N}_0$, the multiplication map \begin{align*} G\cdot : (R/J)_D&\rightarrow(R/J)_{D+d}\\ \bar{F}&\mapsto G\cdot \bar{F} \end{align*} is injective, and we have a short exact sequence \begin{align*} 0 \longrightarrow (R/J)_D \xrightarrow{G\cdot} (R/J)_{D+d} \longrightarrow (R/(J,G))_{D+d} \longrightarrow 0 \end{align*} \end{Proposition} \begin{Proposition}\label{generic m<=n+1} Let $G_1,\ldots,G_m\in R$ be a generic system of forms of degrees $d_1,\ldots,d_m$ with $m\leq n+1$. Then \[ H_{R/(G_1,\ldots,G_m)}=\frac{\prod_{j=1}^m(1-T^{d_j})}{(1-T)^{n+1}}. \] \end{Proposition} \begin{proof} By the previous proposition, $H_{(R/J)_{D+d}}=H_{(R/J)_D}+H_{(R/(J,G))_{D+d}}$. The result then follows by induction since $H_R=\frac{1}{(1-T)^{n+1}}$. \end{proof} All preceding results of this section can be found in \cite{Diem04}. We incude the statements because they are needed for the next result, which is new. \bigskip \begin{Theorem}\label{Hilbert_inequality} Let $F_1,\ldots,F_{n+c}\in R$ $(\text{with }c\geq1)$ be forms of degrees $d_1,\ldots,d_{n+c}$. Then \[ H_{R/(F_1,\ldots,F_{n+c})}\geq\Big(1-\displaystyle\sum_{j=n+2}^{n+c}T^{d_j}\Big) \frac{\prod_{j=1}^{n+1}(1-T^{d_j})}{(1-T)^{n+1}} \] coefficient-wise. If $d_1=\ldots=d_{n+c}=d$ then \[ H_{R/(F_1,\ldots,F_{n+c})}\geq(1-(c-1)T^d)(1+T+\ldots+T^{d-1})^{n+1} \] coefficient-wise. \end{Theorem} \begin{proof} The case $d_1=\ldots=d_{n+c}=2$ is done in \cite{Diem04}. The general case is similar. We will prove that the generic Hilbert series of type $(n+1;n+c;d_1,\ldots,d_{n+c})$ is $\geq\Big(1-\displaystyle\sum_{j=n+2}^{n+c}T^{d_j}\Big)\frac{\prod_{j=1}^{n+1}(1-T^{d_j})}{(1-T)^{n+1}}$ coefficient-wise. The result then follows by \cref{Hilbert_series_type}.\\ Let $G_1,\ldots,G_{n+c}\in R:=K[x_0,\ldots,x_n]$ (with $\text{char } K=0$) be a generic system of forms of degrees $d_1,\ldots,d_{n+c}$. Let $R':=R/(G_1,\ldots,G_{n+1})$ and let $I':=(G_{n+2},\ldots,G_{n+c})\vartriangleleft R'$. Then $H_{R'}=\frac{\prod_{j=1}^{n+1}(1-T^{d_j})}{(1-T)^{n+1}}$ by \cref{generic m<=n+1}. Since $R/(G_1,\ldots,G_{n+c})\cong R'/I'$, \begin{align*} \chi_{R/(G_1,\ldots,G_{n+c})}(D)=\chi_{R'/I'}(D)=dim_K(R'_D)-dim_K(I'_D). \end{align*} For $D\geq d$, $I'_D=\sum_{j=n+2}^{n+c}G_j\cdot R'_{D-d_j}$ with multiplication map $G_j\cdot: R'_{D-d_j}\rightarrow R'_D$ as in \cref{multiplicationmap}. Hence $dim_K(I'_D)\leq\sum_{j=n+2}^{n+c}dim_K(R'_{D-d_j})$ by \cref{multiplicationmap}. Thus we have \begin{align*} \chi_{R/(G_1,\ldots,G_{n+c})}(D)\geq dim_K(R'_D)-\displaystyle\sum_{j=n+2}^{n+c}dim_K(R'_{D-d_j}) \end{align*} and hence \[ H_{R/(G_1,\ldots,G_{n+c})}\geq H_{R'}-\displaystyle\sum_{j=n+2}^{n+c}T^{d_j}H_{R'}= \Big(1-\displaystyle\sum_{j=n+2}^{n+c}T^{d_j}\Big)\frac{\prod_{j=1}^{n+1}(1-T^{d_j})}{(1-T)^{n+1}} \] \end{proof} \begin{Corollary}\label{xi_inequality} If $f_1,\ldots,f_{n+1}\in K[x_1,\ldots,x_n]$ (i.e. $c=1$) with $deg(f_i)=d$ for all $i$, then $\chi(D)\geq \binom{n+1}{D}_{d-1}$. Furthermore, if all the forms are generic, then equality holds. \end{Corollary} \begin{proof} Take $c=1$ in \cref{Hilbert_inequality}, and recall that the coefficient of $T^D$ in $(1+T+\ldots+T^{d-1})^{n+1}$ is $\binom{n+1}{D}_{d-1}$. The second statement follows from \cref{generic m<=n+1}. \end{proof} In Section \ref{c1} we use this Corollary to find the smallest $D$ such that $\chi(D)\leq D$ (and XL succeeds by \cref{success}) in the $c=1$ case. \bigskip \begin{Remark}\label{Ds} We remark that there are three possibly different $D$'s under discussion: 1. the smallest $D$ such that the XL algorithm terminates (call it $D^*$), 2. the smallest $D$ such that $\chi(D) \leq D$ (call it $D_\chi$), 3. the smallest $D$ such that $\binom{n+1}{D}_{d-1}\leq D$ (call it $D_m$). \noindent \cref{success} implies that $D^*\leq D_\chi$. In the case $c=1$, \cref{xi_inequality} implies that $D_m\leq D_\chi$, and $D_m= D_\chi$ when the equations are generic. In Section \ref{c1} we investigate the relationship between these when $c=1$. At the end of the section we will conjecture that $D^*=D_\chi=D_m$ when $c=1$ and the equations are generic, and provide evidence. \end{Remark} \section{Ordinary Multinomials}\label{om} This section is independent of the rest of the paper. We will prove here that ordinary multinomials are strongly unimodal, and some inequalities. \begin{Definition} A sequence $s_0, s_1, \ldots ,s_N$ of integers is said to be \emph{unimodal} if there is an integer $t$ with $0\leq t \leq N$ such that \[ s_0\leq s_1\leq \cdots \leq s_t, \quad s_t\geq s_{t+1}\geq \cdots \geq s_N. \] \end{Definition} A unimodal sequence is said to be \emph{strongly unimodal} if all the inequalities are strict, except that $s_t=s_{t+1}$ may hold. For example, the sequence of binomial coefficients $\binom{N}{k}$ ($k=0,1,\ldots ,N$) is strongly unimodal. \begin{Remark} We remark that there are different definitions of \emph{strongly unimodal} in the literature. One definition is the same as ours except it does not allow $s_t=s_{t+1}$, in which case the binomial coefficients are strongly unimodal only for $N$ even. \end{Remark} \bigskip \begin{Definition} The coefficient of $T^k$ in $(1+T+\ldots+T^{s})^{N}$ is called \textit{ordinary multinomial} or \textit{generalized binomial coefficient of order $s$} and is denoted by $\binom{N}{k}_s$. \end{Definition} Combinatorially, $\binom{N}{k}_s$ is the number of different ways of distributing $k$ objects among $N$ boxes, where each box contains at most $s$ objects. See \cite{Boll86} and \cite{Bondarenko} for an introduction. \begin{table}[ht!] \setlength{\tabcolsep}{2pt} \begin{tabular}{rccccccccccccccccccccccccc} $N=0$:& & & & & & & & & & & & &1\\ $N=1$:& & & & & & & & & &1 & &1 & &1 & &1\\ $N=2$:& & & & & & &1 & &2& &3& &4& &3& &2& &1\\ $N=3$:& & & &1& &3& &6& &10& &12& &12& &10& &6& &3& &1\\ $N=4$:&1& &4& &10& &20& &31& &40& &44& &40& &31&&20& &10& &4& &1\\ \end{tabular} \caption{\label{tab:expl}Triangle of ordinary multinomials $\binom{N}{k}_s$ with $s=3$ and $k=0...sN$} \end{table} \begin{Proposition} \begin{enumerate}[label=(\alph*),ref=(\alph*)] \item $\binom{N}{k}_s=0$ for $k<0$ and $k>sN$. \item For $s=1$, the ordinary multinomials are the usual binomial coefficients. \item $\dbinom{N}{k}_s=\displaystyle\sum_{i=0}^{\lfloor k/(s+1)\rfloor}(-1)^i\binom{N}{i} \binom{k-i(s+1)+N-1}{k-i(s+1)}$ \item\Label{ordinarymultinomials} $\dbinom{N}{k}_s=\displaystyle\sum_{\substack{j_1+\ldots+j_{s+1}=N\\ j_2+2j_3+\ldots+sj_{s+1}=k}}\binom{N}{j_1,\ldots,j_{s+1}}$ \end{enumerate} \end{Proposition} \begin{proof} (c) follows from expanding $(1+T+\ldots+T^{s})^{N}=\frac{(1-T^{s+1})^N}{(1-T)^{N}}$.\\ (d) follows from the multinomial theorem. \end{proof} \begin{Lemma} $\binom{N}{k}_s=\binom{N}{sN-k}_s$, i.e. the ordinary multinomials are symmetric. \end{Lemma} \begin{proof} Using \cref{ordinarymultinomials}, if $j_1,\ldots,j_{s+1}$ satisfy $\{\substack{j_1+\ldots+j_{s+1}=N\\j_2+2j_3+\ldots+sj_{s+1}=k}$, then $j_s+2j_{s-1}+\ldots+sj_{1}=sN-k$ and $\binom{N}{j_{s+1},\ldots,j_1}=\binom{N}{j_1,\ldots,j_{s+1}}$. \end{proof} \begin{Lemma}\label{recurrence} $\binom{N}{k}_s=\sum_{m=0}^s \binom{N-1}{k-m}_s$ \end{Lemma} \begin{proof} Use \cref{ordinarymultinomials} and the recurrence relation of multinomial coefficients. \end{proof} \begin{Theorem}\label{strongunimodality} The ordinary multinomials are strongly unimodal. For $N\geq2$ we have \[ \binom{N}{0}_s<\binom{N}{1}_s<\cdots<\binom{N}{\lfloor\frac{sN}{2}\rfloor}_s= \binom{N}{\lceil\frac{sN}{2}\rceil}_s>\cdots>\binom{N}{sN}_s \] \end{Theorem} \begin{proof} It follows from \cref{recurrence} that \begin{align*} \dbinom{N}{k+1}_s&=\displaystyle\sum_{m=0}^s\binom{N-1}{k+1-m}_s\\ &=\dbinom{N-1}{k+1}_s+\displaystyle\sum_{m=0}^s\binom{N-1}{k-m}_s-\dbinom{N-1}{k-s}_s\\ &=\dbinom{N-1}{k+1}_s+\dbinom{N}{k}_s-\dbinom{N-1}{k-s}_s. \end{align*} So if $\binom{N-1}{k+1}_s>\binom{N-1}{k-s}_s$ for $k<\lfloor\frac{sN}{2}\rfloor$ then $\binom{N}{k+1}_s>\binom{N}{k}_s$ for $k<\lfloor\frac{sN}{2}\rfloor$. We proceed by induction on $N$. For $N=2$, the base case, $\binom{1}{k+1}_s-\binom{1}{k-s}_s=1-0=1$ for $0\leq k<s$. Thus $\binom{2}{k+1}_s>\binom{2}{k}_s$ for all $k<\lfloor\frac{sN}{2}\rfloor$. Now assume $\binom{N-1}{k+1}_s>\binom{N-1}{k}_s$ for all $k<\lfloor\frac{s(N-1)}{2}\rfloor$. Then \begin{align*} \binom{N-1}{k+1}_s>\binom{N-1}{k}_s>\cdots>\binom{N-1}{k-s}_s \end{align*} whenever $k<\lfloor\frac{s(N-1)}{2}\rfloor$. It remains to prove the cases $\lfloor\frac{s(N-1)}{2}\rfloor \leq k <\lfloor\frac{sN}{2}\rfloor$. If $k=\lfloor\frac{s(N-1)}{2}\rfloor+m$ with $0\leq m<s/2$ (and hence $k<\lfloor\frac{sN}{2}\rfloor$) then \[ \binom{N-1}{k+1}_s=\binom{N-1}{s(N-1)-k-1}_s=\binom{N-1}{\lceil\frac{s(N-1)}{2}\rceil-m-1}_s. \] \underline{Case 1:} where $ s(N-1)$ is even. In this case $\lceil\frac{s(N-1)}{2}\rceil=\lfloor\frac{s(N-1)}{2}\rfloor$ so \begin{align*} \binom{N-1}{k+1}_s&=\binom{N-1}{\lfloor\frac{s(N-1)}{2}\rfloor-m-1}_s>\cdots\\ &>\binom{N-1}{\lfloor\frac{s(N-1)}{2}\rfloor+m-s}_s=\binom{N-1}{k-s}_s \end{align*} by induction assumption and since $m<s/2$. \underline{Case 2:} where $ s(N-1)$ is odd. In this case $\lceil\frac{s(N-1)}{2}\rceil=\lfloor\frac{s(N-1)}{2}\rfloor+1$ so \begin{align*} \binom{N-1}{k+1}_s&=\binom{N-1}{\lfloor\frac{s(N-1)}{2}\rfloor+1-m-1}_s =\binom{N-1}{\lfloor\frac{s(N-1)}{2}\rfloor-m}_s\\ &>\cdots>\binom{N-1}{\lfloor\frac{s(N-1)}{2}\rfloor+m-s}_s=\binom{N-1}{k-s}_s \end{align*} by induction assumption and since $m<s/2$. Thus, $\binom{N-1}{k+1}_s>\binom{N-1}{k-s}_s$ and hence $\binom{N}{k+1}_s>\binom{N}{k}_s$ for all $k<\lfloor\frac{sN}{2}\rfloor$. By symmetry, $\binom{N}{k+1}_s<\binom{N}{k}_s$ for all $k\geq\lceil\frac{sN}{2}\rceil$, and $\binom{N}{\lfloor\frac{sN}{2}\rfloor}_s=\binom{N}{\lceil\frac{sN}{2}\rceil}_s$. \end{proof} \begin{Remark} The smallest mode is given by $\lfloor\frac{sN}{2}\rfloor$. If $sN$ is odd, then we have a plateau of two modes: $\frac{sN-1}{2}$ and $\frac{sN+1}{2}$. If $sN$ is even, then we have a peak at $\frac{sN}{2}$. \end{Remark} \begin{Remark} One can also prove (weak) unimodality of $\binom{N}{k}_s$ using Theorem 4.7 of \cite{conv} which says that the convolution of two symmetric discrete unimodal distributions is again unimodal, along with $\binom{N}{k}_s=\sum_{m=0}^N \binom{N}{m}\binom{m}{k-m}_{s-1}$ (this relation can be proved using $\binom{N}{j_1,\ldots,j_m}=\prod_{i=1}^m \binom{\sum_{l=1}^i j_l}{j_i}$ and \cref{ordinarymultinomials}). See also \cite{uniproof}. \end{Remark} \begin{Proposition}\label{starsandbars} $\binom{N}{k}_s=\binom{N+k-1}{k}$ for $k\leq s$. \end{Proposition} \begin{proof} $\binom{N+k-1}{k}$ counts the number of ways of putting $k$ objects into $N$ boxes. As noted in \cite{Bondarenko}, $\binom{N}{k}_s$ is the number of ways of putting $k$ objects into $N$ boxes, where each box contains at most $s$ objects. \end{proof} \begin{Remark} By symmetry, if $k\geq s(N-1)$ then $\binom{N}{k}_s=\binom{(s+1)N-k-1}{sN-k}$. \end{Remark} \bigskip Here is a theorem we will need later in Section 5. \begin{Theorem}\label{smallestk} For $2\leq s< \frac{N+1}{2}+\frac{2}{N}$, the smallest $k$ such that $\binom{N}{k}_s\leq k$ is $k=sN-1$. \end{Theorem} \bigskip \begin{proof} \underline{Claim:} $\binom{N}{k}_s>k$ for all $k<\lfloor\frac{sN}{2}\rfloor$.\\ \underline{Proof of claim:} $\binom{N}{0}_s=1>0$. Now assume $\binom{N}{k}_s>k$. Then $\binom{N}{k+1}_s\geq\binom{N}{k}_s+1>k+1$ by strong unimodality (\cref{strongunimodality}) for $k<\lfloor\frac{sN}{2}\rfloor$.\\ \underline{Claim:} $\binom{N}{k}_s>k$ for all $k\leq sN-2$ and $2\leq s< \frac{N+1}{2}+\frac{2}{N}$.\\ \underline{Proof of claim:} If $\binom{N}{k}_s\leq k$ for some $k\geq\lceil\frac{sN}{2}\rceil$, then $\binom{N}{k+1}_s\leq \binom{N}{k}_s+1\leq k+1$ by strong unimodality. By \cref{starsandbars}, $\binom{N}{sN-2}_s=\binom{N+1}{2}>sN-2$ for $2\leq s< \frac{N+1}{2}+\frac{2}{N}$.\\ Again by \cref{starsandbars}, $\binom{N}{sN-1}_s=\binom{N}{1}=N\leq sN-1$ for $s\geq2$. Thus, $k=sN-1$ is the smallest $k$ such that $\binom{N}{k}_s\leq k$. \end{proof} \begin{Remark} For $s=1$, the smallest $k$ such that $\binom{N}{k}_1\leq k$ is $k=N$. If $s\geq\frac{N+1}{2}+\frac{2}{N}$, then the smallest $k$ is $<sN-1$. These instances can easily be evaluated directly, see Table \ref{tab:Dmin}. \end{Remark} We will also use the following result, which will be proved in Section 6. \begin{Theorem} The smallest $k$ such that $\binom{N}{k}_{s}-\binom{N}{k-(s+1)}_{s}\leq k$ is \begin{enumerate}[label=(\alph*),ref=(\alph*)] \item $k=s+1$ for $N=2$, \item $k=2s$ for $N=3$, \item $k=\lfloor\frac{s(N+1)}{2}\rfloor+1$ for $N\geq4$. \end{enumerate} \end{Theorem} \section{One more equation than unknowns (\texorpdfstring{$c=1$}{}) in XL}\label{c1} We are now ready to find our lower bound on the smallest $D$ such that $\chi(D)\leq D$ for the case $c=1$, i.e., when the number of equations exceeds the number of unknowns by 1. By \cref{success} the XL algorithm will succeed for this $D$, so this may be a good choice for the initial value of $D$. We will see that this is actually an excellent choice, and very often the optimal choice. According to \cref{xi_inequality}, $\chi(D)\geq \binom{n+1}{D}_{d-1}$ when we have $n$ unknowns, $n+1$ equations, and all equations have the same degree $d$. According to \cref{success} $\chi(D)\leq D$ is a sufficient condition for the XL algorithm to succeed. Combining these we get \[ D\geq \chi(D)\geq \binom{n+1}{D}_{d-1} \] as sufficient for success, and so we consider the inequality \[ D\geq \binom{n+1}{D}_{d-1}. \] \bigskip \begin{Corollary}\label{lb} If $f_1,\ldots,f_{n+1}\in K[x_1,\ldots,x_n]$ with $deg(f_i)=d$ for all $i$ and $3\leq d\leq\frac{n+2}{2}+\frac{2}{n+1}$, then the smallest $D$ such that $\chi(D)\leq D$ is at least $ (d-1)(n+1)-1$. \end{Corollary} \begin{proof} Take $s=d-1$ and $N=n+1$ in \cref{smallestk}. \end{proof} \begin{Remark} This is why we proved \cref{smallestk} earlier. We note that the proof of \cref{smallestk} uses strong unimodality of ordinary multinomials, and this is why we included that result in our paper. \end{Remark} \begin{table}[ht!] \begin{center} \begin{tabular}{|c|c|c||c|c|c||c|c|c|} \hline $d$ & $n$ & $D$ & $d$ & $n$ & $D$ & $d$ & $n$ & $D$\\ \hline 2 & $\geq2$ & $n+1$ & 6 & $\geq8$ & $5n+4$ & 9 & $2$ & $8n+4$\\ 3 & $\geq2$ & $2n+1$ & 7 & $2,3$ & $6n+3$ & 9 & $3,4$ & $8n+5$\\ 4 & $2,3$ & $3n+1$ & 7 & $4,\ldots,9$ & $6n+4$ & 9 & $5,\ldots,13$ & $8n+6$\\ 4 & $\geq4$ & $3n+2$ & 7 & $\geq10$ & $6n+5$ & 9 & $\geq14$ & $8n+7$\\ 5 & $2,\ldots,5$ & $4n+2$ & 8 & $2$ & $7n+3$ & 10 & $2$ & $9n+4$\\ 5 & $\geq6$ & $4n+3$ & 8 & $3$ & $7n+4$ & 10 & $3,4$ & $9n+6$\\ 6 & $2$ & $5n+2$ & 8 & $4,\ldots,11$ & $7n+5$ & 10 & $5,\ldots,15$ & $9n+7$\\ 6 & $3,\ldots,7$ & $5n+3$ & 8 & $\geq12$ & $7n+6$ & 10 & $\geq16$ & $9n+8$\\ \hline \end{tabular} \caption{\Label{tab:Dmin}The smallest $D$ such that $\binom{n+1}{D}_{d-1}\leq D$} \end{center} \end{table} \begin{Remark} It follows that for fixed $d\geq3$, as $n$ gets large, the smallest $D$ such that $\chi(D)\leq D$ is $\geq(d-1)(n+1)-1$. On the other hand, Table \ref{tab:Dmin} gives the value of the smallest $D$ such that $\binom{n+1}{D}_{d-1}\leq D$ up to $d=10$. Note that this is equal to $(d-1)(n+1)-1$. Recall from \cref{xi_inequality} that $\chi(D)= \binom{n+1}{D}_{d-1}$ when the equations are generic. \end{Remark} \begin{table}[ht!] \begin{center} \begin{tabular}{|c|c|c|c|c||c|c|c|c|c|} \hline $p$&$d$&$n$&$D_{average}$&$D_{min}$&$p$&$d$&$n$& $D_{average}$&$D_{min}$\\ \hline 3109&2&2&3.00&3 & 3109&5&2&10.00&10\\ 5011&2&2&3.00&3 & 5011&5&2&10.00&10\\ 3109&2&3&4.00&4 & 3109&5&3&14.00&14\\ 5011&2&3&4.00&4 & 5011&5&3&14.00&14\\ 3109&2&4&5.00&5 & 3109&5&4&18.00&18\\ 5011&2&4&5.00&5 & 5011&5&4&18.00&18\\ \cline{6-10} 3109&2&5&6.00&6 & 3109&6&2&12.00&12\\ 5011&2&5&6.00&6 & 5011&6&2&12.00&12\\ 3109&2&6&6.99&7 & 3109&6&3&18.00&18\\ 5011&2&6&7.00&7 & 5011&6&3&18.00&18\\ \cline{6-10} 3109&2&7&8.00&8 & 3109&7&2&15.00&15\\ 5011&2&7&8.00&8 & 5011&7&2&15.00&15\\ \cline{1-5} 3109&3&2&5.00&5 & 3109&7&3&21.00&21\\ 5011&3&2&5.00&5 & 5011&7&3&21.00&21\\ \cline{6-10} 3109&3&3&7.00&7 & 3109&8&2&17.00&17\\ 5011&3&3&7.00&7 & 5011&8&2&17.00&17\\ 3109&3&4&9.00&9 & 3109&8&3&25.00&25\\ 5011&3&4&9.00&9 & 5011&8&3&25.00&25\\ \cline{6-10} 3109&3&5&11.00&11 & 3109&9&2&20.00&20\\ 5011&3&5&11.00&11 & 5011&9&2&20.00&20\\ \cline{1-5} 3109&4&2&7.00&7 & 3109&9&3&29.00&29\\ 5011&4&2&7.00&7 & 5011&9&3&29.00&29\\ \cline{6-10} 3109&4&3&10.00&10 & 3109&10&2&22.00&22\\ 5011&4&3&10.00&10 & 5011&10&2&22.00&22\\ 3109&4&4&14.00&14 & 3109&10&3&33.00&33\\ 5011&4&4&14.00&14 & 5011&10&3&33.00&33\\ \hline \end{tabular} \caption{\label{tab:exp}Running XL on randomly chosen polynomials over prime fields of order $p$ with one more equation than unknowns. Here $D_{average}$ is the average value of the smallest $D$ such that the XL algorithm terminates over 100 experiments with the same parameters, and $D_{min}$ has been calculated according to Table \ref{tab:Dmin}. All experiments were done using Magma V2.21-6 \cite{magma}.} \end{center} \end{table} \begin{Remark} We ran experiments for small values of $d$ and $n$, summarised in Table \ref{tab:exp}. They show that the smallest $D$ such that $\chi(D)\leq D$ is equal to the smallest $D$ such that the XL algorithm terminates, i.e. the lower bound was met in all (but one, see next Remark) of our experiments. \end{Remark} \begin{Remark} In one experiment, namely $p=3109$, $d=2$, $n=6$, the reader will notice that $D_{average}=6.99$ and not 7. This means that 1 out of 100 randomly chosen sets of input polynomials finished with $D=6$ and not $D=7$. We then checked this particular set of input polynomials, and two coefficients were equal in one polynomial, i.e., the polynomials were not generic in this one case. This is an example that shows that our bound is (conjecturally) tight for generic polynomials, but non-generic polynomials may finish with a smaller $D$. \end{Remark} Let us denote by $D^*$ the optimal input value of $D$ in the XL algorithm, i.e., $D^*$ is the smallest $D$ such that the XL algorithm succeeds. Based on the evidence in Table \ref{tab:exp} we conjecture that our lower bound in \cref{lb} is tight for generic polynomials. \bigskip \begin{Conjecture} When $c=1$ and the polynomials are generic we have $D^*=(d-1)(n+1)-1$. \end{Conjecture} \begin{Remark} In the notation of \cref{Ds} we are conjecturing that $D^*=D_\chi=D_m$. \end{Remark} \begin{Remark} Our conjecture is consistent with Proposition 6 in \cite{Diem04} where it is shown that $D_\chi \geq n/(1+\sqrt{c-1})$ for quadratic equations. When $c=1$ this becomes $D_\chi \geq n$, and our conjecture with $d=2$ becomes $D^*=n$. \end{Remark} \begin{Remark} When the equations do not all have the same degree, we can take $d$ to be the maximum of the degrees and the above arguments will give a good starting input value for $D$, but not necessarily the optimal value. \end{Remark} \section{Two more equations than unknowns (\texorpdfstring{$c=2$}{}) in XL}\label{c2} When $c>1$ ($c$ being the difference between the number of equations and the number of unknowns), then \cref{Hilbert_inequality} tells us that $$\chi(D)\geq \binom{n+1}{D}_{d-1}-(c-1)\binom{n+1}{D-d}_{d-1}$$ when we have $n$ unknowns, and all equations have the same degree $d$. When $c=2$ we need the following result. \begin{Theorem} The smallest $k$ such that $\binom{N}{k}_{s}-\binom{N}{k-(s+1)}_{s}\leq k$ is \begin{enumerate}[label=(\alph*),ref=(\alph*)] \item $k=s+1$ for $N=2$, \item $k=2s$ for $N=3$, \item $k=\lfloor\frac{s(N+1)}{2}\rfloor+1$ for $N\geq4$. \end{enumerate} \end{Theorem} \begin{proof} \begin{enumerate}[label=(\alph*),ref=(\alph*)] \item $N=2$: If $k\leq s$ then $\binom{2}{k}_{s}\stackrel{\ref{starsandbars}}{=}\binom{2+k-1}{k}=k+1$, and thus $\binom{2}{k}_{s}-\binom{2}{k-(s+1)}_{s}=k+1-0>k$ $\forall k\leq s$. Now $\binom{2}{s+1}_{s}\stackrel{\text{sym.}}{=}\binom{2}{s-1}_{s}\stackrel{\ref{starsandbars}}{=}\binom{2+s-2}{s-1}=s$ since we have a peak at $s$, and thus $\binom{2}{s+1}_{s}-\binom{2}{s+1-(s+1)}_{s}=s-1\leq s+1$. \item $N=3$: If $k\leq s$ then $\dbinom{3}{k}_{s}-\dbinom{3}{k-(s+1)}_{s}\stackrel{\ref{recurrence}}{=}\displaystyle\sum_{m=0}^k\dbinom{2}{k-m}_{s}-0\geq \dbinom{2}{k}_{s}>k$ by part (a) and since the ordinary multinomials are nonnegative. Now let $k=s+t$ where $1\leq t\leq s$, i.e. $s<k\leq 2s$. Thus \begin{align*} \binom{3}{k}_{s}&-\binom{3}{k-(s+1)}_{s} =\binom{3}{s+t}_{s}-\binom{3}{t-1}_{s}\\ &\stackrel{\ref{recurrence}}{=}\sum_{m=0}^s\binom{2}{s+t-m}_{s}-\sum_{m=0}^{t-1}\binom{2}{t-1-m}_{s}\\ &=\sum_{m=0}^{t-1}\binom{2}{s+t-m}_{s}+\sum_{m=t}^s\binom{2}{s+t-m}_{s}- \sum_{m=0}^{t-1}\binom{2}{t-1-m}_{s}\\ &\stackrel{\text{sym.}}{=}\sum_{m=0}^{t-1}\binom{2}{s-t+m}_{s}+\sum_{m=t}^s\binom{2}{s+t-m}_{s}- \sum_{m=0}^{t-1}\binom{2}{t-1-m}_{s}\\ &\stackrel{\ref{starsandbars}}{=}\sum_{m=0}^{t-1}\binom{s-t+m+1}{s-t+m}+ \sum_{m=t}^s\binom{s+t-m+1}{s+t-m}-\sum_{m=0}^{t-1}\binom{t-m}{t-1-m}\\ &=\sum_{m=0}^{t-1}(s-t+m+1)+\sum_{m=t}^s(s+t-m+1)-\sum_{m=0}^{t-1}(t-m)\\ &=(s-t+1)(s+2t+1)+\frac{t(t-3)}{2}-\frac{s(s+1)}{2} \end{align*} Now we are left with considering the inequality \begin{align*} (s-t+1)(s+2t+1)+\frac{t(t-3)}{2}-\frac{s(s+1)}{2} &> k=s+t\\ \Leftrightarrow s^2-3t^2+2st+s-3t+2 &> 0 \end{align*} Since $t\leq s$, we can write $s=t+a$, where $a\geq0$, and substitute: \begin{align*} (t+a)^2-3t^2+2(t+a)t+(t+a)-3t+2 = a^2+a+4at-2t+2 \end{align*} The right hand side is $\leq0$ when $a=0$, and $>0$ when $a\geq1$. Thus $\binom{3}{k}_{s}-\binom{3}{k-(s+1)}_{s}>k$ whenever $k<2s$ and $\binom{3}{k}_{s}-\binom{3}{k-(s+1)}_{s}\leq k$ when $k=2s$. \item $N\geq4$: Recall that $\binom{N}{k}_{s}-\binom{N}{k-1}_{s}=\binom{N-1}{k}_{s}- \binom{N-1}{k-(s+1)}_{s}$ (see proof of \cref{strongunimodality}). We will proceed by induction on N, and assume that $\binom{N-1}{k}_{s}-\binom{N-1}{k-(s+1)}_{s}>k$ for $k\leq\lfloor\frac{sN}{2}\rfloor$. Then $\binom{N}{k}_{s}-\binom{N}{k-1}_{s}>k$ and hence $\binom{N}{k}_{s}-\binom{N}{k-(s+1)}_{s}>k$ for $k\leq\lfloor\frac{sN}{2}\rfloor$.\\ For the base case $N=4$, we only have $\binom{N-1}{k}_{s}-\binom{N-1}{k-(s+1)}_{s}>k$ for $k<\lfloor\frac{sN}{2}\rfloor$. So we do the case $k=\lfloor\frac{sN}{2}\rfloor=2s$ separately: From the proof of part (b), we have $\binom{4}{2s}_{s}-\binom{4}{2s-1}_{s}=\binom{3}{2s}_{s}- \binom{3}{2s-(s+1)}_{s}=3s+1+\frac{s(s-3)}{2}-\frac{s(s+1)}{2}=s+1$. Hence $\binom{4}{2s}_{s}- \binom{4}{s-1}_{s}=[\binom{4}{2s}_{s}-\binom{4}{2s-1}_{s}]+[\binom{4}{2s-1}_{s}-\binom{4}{2s-2}_{s}] +\ldots+[\binom{4}{s}_{s}-\binom{4}{s-1}_{s}]\stackrel{\text{(b)}}{>}s+1+ \displaystyle\sum_{i=s}^{2s-1}i=s+1+\frac{(2s-1)(2s)}{2}-\frac{s(s-1)}{2}=\frac{s(3s+1)}{2}+1>2s$ for $s\geq1$.\\ Now for $N\geq4$, let $k=\lfloor\frac{sN}{2}\rfloor+t$, where $1\leq t<\lceil\frac{s}{2}\rceil$. Then \begin{align*} \binom{N}{k}_{s}&-\binom{N}{k-(s+1)}_{s}\stackrel{\text{sym.}}{=} \binom{N}{sN-k}_{s}-\binom{N}{k-(s+1)}_{s}\\ &=\binom{N}{\lceil\frac{sN}{2}\rceil-t}_{s}-\binom{N}{\lfloor\frac{sN}{2}\rfloor+t-(s+1)}_{s}\\ &=\binom{N}{\lceil\frac{sN}{2}\rceil-t}_{s}-\binom{N}{\lceil\frac{sN}{2}\rceil-t-1}_{s}+\\ &\binom{N}{\lceil\frac{sN}{2}\rceil-t-1}_{s}-\binom{N}{\lceil\frac{sN}{2}\rceil-t-2}_{s}+\ldots+\\ &\binom{N}{\lfloor\frac{sN}{2}\rfloor+t-s}_{s}-\binom{N}{\lfloor\frac{sN}{2}\rfloor+t-s-1}_{s}\\ &>\displaystyle\sum_{i=\lfloor\frac{sN}{2}\rfloor+t-s}^{\lceil\frac{sN}{2}\rceil-t}i \text{ (by induction hypothesis)}\\ &=\frac{(\lceil\frac{sN}{2}\rceil-t)(\lceil\frac{sN}{2}\rceil-t+1)}{2}- \frac{(\lfloor\frac{sN}{2}\rfloor+t-s)(\lfloor\frac{sN}{2}\rfloor+t-s-1)}{2}\\ &=\frac{\lceil\frac{sN}{2}\rceil^2-\lfloor\frac{sN}{2}\rfloor^2+2s\lfloor\frac{sN}{2}\rfloor+sN-s^2 -s-2tsN+2ts}{2}\\ &=\begin{cases} (s^2N+sN-s^2-s-2tsN+2ts)/2 &\mbox{if } 2\mid sN \\ (s^2N+2sN-s^2-2s-2tsN+2ts)/2 & \mbox{if } 2\nmid sN \end{cases}\\ &\stackrel{\text{?}}{>} \lfloor\frac{sN}{2}\rfloor+t=k \end{align*} \underline{Case 1:} $2\mid sN$. Assume $2t\leq s-1$. \begin{align*} \frac{s^2N+sN-s^2-s-2tsN+2ts}{2}>\frac{sN}{2}+t\\ \Leftrightarrow s^2N-s^2-s>2tsN-2ts+2t=2t(sN-s+1) \end{align*} For $N\geq4$, $2t\leq s-1$ implies \begin{align*} 2t(sN-s+1)\leq s^2N-s^2-sN+2s-1<s^2N-s^2-s \end{align*} \underline{Case 2:} $2\nmid sN$. Assume $2t\leq s$. \begin{align*} \frac{s^2N+2sN-s^2-2s-2tsN+2ts}{2}>\frac{sN-1}{2}+t\\ \Leftrightarrow s^2N+sN-s^2-2s+1>2tsN-2ts+2t=2t(sN-s+1) \end{align*} For $N\geq4$, $2t\leq s$ implies \begin{align*} 2t(sN-s+1)\leq s^2N-s^2+s<s^2N+sN-s^2-2s+1 \end{align*} So we have shown $\binom{N}{k}_{s}-\binom{N}{k-(s+1)}_{s}>k$ for\\ $k\leq \begin{cases} \lfloor\frac{s(N+1)}{2}\rfloor-1 &\mbox{if } 2\mid s\\ \lfloor\frac{s(N+1)}{2}\rfloor &\mbox{if } 2\nmid s \text{ and } 2\mid N\\ \lfloor\frac{s(N+1)}{2}\rfloor-1 &\mbox{if } 2\nmid s \text{ and } 2\nmid N\\ \end{cases}$\\ So we still need to show the case $k=\frac{s(N+1)}{2}$ if $2\mid s$ and if $2\nmid sN$. Assuming that $\binom{N-1}{k}_{s}-\binom{N-1}{k-1}_{s}=\binom{N-2}{k}_{s}-\binom{N-2}{k-(s+1)}_{s}>k$ for $k\leq\frac{s(N-1)}{2}$ (strong induction), we have \begin{align*} \binom{N}{\frac{s(N+1)}{2}}_{s}&-\binom{N}{\frac{s(N+1)}{2}-(s+1)}_{s}\stackrel{\text{sym.}}{=} \binom{N}{\frac{s(N-1)}{2}}_{s}-\binom{N}{\frac{s(N-1)}{2}-1}_{s}\\ &=\binom{N-1}{\frac{s(N-1)}{2}}_{s}-\binom{N-1}{\frac{s(N-1)}{2}-(s+1)}_{s}\\ &=\binom{N-1}{\frac{s(N-1)}{2}}_{s}-\binom{N-1}{\frac{s(N-1)}{2}-1}_{s}+\ldots+\\ &\binom{N-1}{\frac{s(N-1)}{2}-s}_{s}-\binom{N-1}{\frac{s(N-1)}{2}-s-1}_{s}\\ &>\displaystyle\sum_{i=\frac{s(N-1)}{2}-s}^{\frac{s(N-1)}{2}}i=\frac{s^2N+sN-2s^2-2s}{2}\\ &\stackrel{\text{?}}{>}\frac{s(N+1)}{2}=k \end{align*} The last inequality holds for $N\geq4$ and $s\geq2$. The case $s=1$ corresponds to the usual binomial coefficients and can be shown directly for $N\geq4$.\\ For the base case $N=4$, we only have the weaker assumptions from parts (a) and (b). But from the proof of part (b) we have \begin{align*} \binom{4}{\frac{5s}{2}}_{s}&-\binom{4}{\frac{5s}{2}-(s+1)}_{s} \stackrel{\text{sym.}}{=}\binom{4}{\frac{3s}{2}}_{s}-\binom{4}{\frac{3s}{2}-1}_{s}\\ &=\binom{3}{\frac{3s}{2}}_{s}-\binom{3}{\frac{3s}{2}-(s+1)}_{s}\\ &=(\frac{s}{2}+1)(2s+1)+\frac{\frac{s}{2}(\frac{s}{2}-3)}{2}-\frac{s(s+1)}{2} >\frac{5s}{2} \text{ for all } s. \end{align*} Also, for the case $N=5$, we only have $\binom{4}{2s}_{s}-\binom{4}{2s-1}_{s}=s+1$. So we have $\binom{5}{3s}_{s}-\binom{5}{3s-(s+1)}_{s}=\ldots>s+1+\displaystyle\sum_{i=s}^{2s-1}i =\frac{s(3s+1)}{2}+1>3s$ for $s\geq2$. For $s=1$, $\binom{5}{3}-\binom{5}{1}=5>3$.\\ Now if $k=\lfloor\frac{s(N+1)}{2}\rfloor+1$ then \begin{align*} \binom{N}{\lfloor\frac{s(N+1)}{2}\rfloor+1}_{s}&- \binom{N}{\lfloor\frac{s(N+1)}{2}\rfloor+1-(s+1)}_{s}\\ &\stackrel{\text{sym.}}{=}\binom{N}{\lceil\frac{s(N-1)}{2}\rceil-1}_{s}- \binom{N}{\lfloor\frac{s(N-1)}{2}\rfloor}_{s} \leq0 \leq k \end{align*} Thus $k=\lfloor\frac{s(N+1)}{2}\rfloor+1$ is the smallest $k$ such that $\binom{N}{k}_{s}-\binom{N}{k-(s+1)}_{s}\leq k$. \end{enumerate} \end{proof} \begin{Corollary} ($c=2$) If $f_1,\ldots,f_{n+2}\in K[x_1,\ldots,x_n]$ with $deg(f_i)=d$ $\forall i=1,\ldots,n+2$, then the smallest $D$ such that $\chi(D)\leq D$ is \begin{enumerate}[label=(\alph*),ref=(\alph*)] \item $\geq 2(d-1)$ for $n=2$, \item $\geq \lfloor\frac{(d-1)(n+2)}{2}\rfloor+1$ for $n\geq3$. \end{enumerate} \end{Corollary} We conjecture that this lower bound is tight. Based on the $c=1$ and $c=2$ cases, it appears as though the optimal starting value for $D$ in the XL algorithm will be approximately $(d-1)(n+c)/c$. \FloatBarrier \bibliographystyle{alpha}
\section{INTRODUCTION} Learning-based methods have been successful in modeling and controlling many dynamical systems~\cite{6315769,Lenz15deepmpclearning}. These methods often require a large number of system runs (e.g., trajectories from different initial conditions) over a long time span, to achieve reasonable performance. However, for a relatively broad class of systems, collecting large sums of data can be too cumbersome or not viable at all. The scarcity of the available data is particularly noticeable for safety-critical systems, in which an abrupt change in system model can result in catastrophic control failures. For instance, it is not practically possible to test and collect data from all possible failure scenarios for an unmanned vehicle~\cite{f15Israel}. Furthermore, for safety-critical systems, we need to construct a model that can be used to predict the behavior of the system, and the construction of and control with such models should not incur a high computational cost (as opposed to conventional learning methods). Recent studies have shown that certain mathematical models in the form of differential equations can be extracted from data~\cite{Schmidt81}. In particular, \cite{HGH15} studied the problem of finding system dynamics when the system follows Lagrangian mechanics. Also, see~\cite{tran2016exact} for a method that can extract chaotic polynomial differential equations from noisy data and relies on the ergodicity property of the data such that the central limit theorem can be applied. However, these methods often require large amounts of training data, which may not be available. In the control literature, system analysis based on input-output data or input-state data is not new. System identification techniques~\cite{Ljung20101} have looked into the problem of finding a model of the system based on data. Nevertheless, the available methods are ``data-hungry'' or computationally expensive, especially if they require a validation stage. Adaptive control techniques~\cite{Tao20142737} also studied controller synthesis methods for systems in which the system model is known up to a parametrization. Such parametrization of the system dynamics is not often available, for instance, in the case of an abrupt system change. One fundamental issue for safety critical systems is to ensure the system behaves \emph{safely} or guarantee that the system avoids certain \emph{unsafe} behavior. If the system model is given, verifying safety is a familiar subject to the control community~\cite{1215682,Prajna2006117}. One of the methods for safety verification relies on the construction of a function of the states, called the \emph{barrier certificate}~\cite{Prajna2006117}. Barrier certificates have shown to be useful in several system analysis and control problems inluding bounding moment functionals of stochastic systems~\cite{ahmadi2016optimization}, safety analysis of systems described by partial differential equations~\cite{AHMADI201733}, safety verification of refrigeration systems~\cite{7602538}, and control of a swarm of silk moths~\cite{4587085}. It was also proved in~\cite{7236867} that for every safe dynamical system (defined in the appropriate sense), there exists a barrier certificate. To the authors' knowledge, the only article that applied barrier certificates for system analysis based on data is~\cite{7402508}. However, the latter method requires large amounts of data, as well. Apart from safety analysis, several studies considered the so called control barrier functions as a means to render the solutions of a system safe. In~\cite{WIELAND2007462}, the authors, inspired by the notion of control Lyapunov functions~\cite{sontag89}, introduced control barrier functions. This formulation, however, requires a one-dimensional control signal. In the same vein, \cite{ROMDLONY201639} demonstrated that one can simultaneously search for a safe and stabilizing controller. Alternatively, \cite{ames2016control} proposed control barrier functions with a fixed logarithmic structure as a function of the unsafe set. It was also shown that this control barrier function structure allows the safe controller synthesis problem to be solved by a set of quadratic programs, satisfies robustness properties such as input-to-state stability with regards to the perturbations to the vector field, and leads to Lipschitz continuous control laws ~\cite{XU201554}. This result was extended in~\cite{7524935} to exponential control barrier functions based on techniques from linear control theory. In this paper, we study safety analysis and safe control of systems for which limited data in terms of state and input samples from a single trajectory is available (by \emph{limited}, we imply that the number of data samples is not large enough for determining the complete dynamics using a system identification or machine learning method). This research is motivated by the recent works on Whitney's extension problem~\cite{Fefferman2013} on finding interpolants with optimal regularity constants in terms of the $\mathcal{C}^n$-norms. Following the footsteps~\cite{Fefferman2013}, \cite{herbert2014computing} showed that the cubic spline polynomials are the best interpolants in terms of minimizing the Lipschitz constant ($\mathcal{C}^0$-norm) for twice continuously differentiable trajectories and proposed computational methods on how to find these interpolants. Accordingly, we build a data-driven differential inclusion model that can be used to predict the evolution of system trajectories based on the piecewise-polynomial (cubic spline) approximation of the state and input data and some regularity information on the evolution of system state. Equipped with this data-driven model in terms of convex differential inclusions, we formulate a safety analysis theorem based on barrier certificates for differential inclusions using notions from set-valued analysis~\cite{aubinsetvalued} and the theory of differential inclusions~\cite{aubincelina}. This barrier certificate is a possibly non-smooth function of the states and time satisfying two inequalities along the solutions of the data-driven differential inclusion. Then, we present conditions to synthesize controllers ensuring safety of the latter differential inclusions, without imposing any \textit{a priori} fixed structure on the barrier functions. We evince that both the analysis and controller synthesis methods can be cast into a set of sum-of-squares programs whenever the certificates are parametrized by polynomials of fixed degree and the sets are semi-algebraic. We further demonstrate that our formulation can accommodate more side information such as conservations laws in terms of algebraic inequalities/equalities and hard integral quadratic constraints~\cite{6915700} based on the application of Positivstellensatz. Preliminary results on this work were discussed in~\cite{AIT17}, in which we brought forward the safety analysis method based on barrier certificates for the data-driven models. The current paper in addition to providing more detailed proofs to the results in~\cite{AIT17} with more discussion of the literature, proposes a controller synthesis algorithm for safety of the data-driven models, formulates a method to include side information in terms of algebraic and integral inequalities, such hard IQCs, and includes a computational method based on sum-of-squares optimization to synthesize the safe controllers. The paper is organized as follows. The next section presents the notation and some preliminary mathematical definitions. In Section~\ref{sec:main}, we show how the data-driven differential inclusion models are constructed from the piece-wise polynomial approximation of the data. In Section~\ref{sec:controlsafe}, we propose a method based on barrier certificates for safety analysis of differential inclusions and a method for designing safe controllers for systems with limited data. Section~\ref{sec:compute} describes a computational approach for finding barrier certificates and designing safe controllers based on polynomial optimization, and Section~\ref{sec:side} delineates an approach using Positivstellensatz to include side infromation. In Section~\ref{sec:numresults}, we illustrate the proposed method by two examples. Finally, Section~\ref{sec:conclusions} concludes the paper and provides directions for future research. \textbf{Notation:} The notations employed in this paper are relatively straightforward. $\mathbb{R}_{\ge 0}$ denotes the set $[0,\infty)$. $\| \cdot \|$ denotes the Euclidean norm on $\mathbb{R}^n$. $\mathcal{R}[x]$ accounts for the set of polynomial functions with real coefficients in $x \in \mathbb{R}^n$, and $\Sigma \subset\mathcal{R}$ is the subset of polynomials with an sum of squares decomposition; i.e, $p \in \Sigma[x]$ if and only if there are $p_i \in \mathcal{R}[x],~i \in \{1, \ldots ,k\}$ such that $p = p_i^2 + \cdots +p_k^2$. We denote by $\mathcal{C}^m(X)$, with $X \subseteq \mathbb{R}^n$, the space of $m$-times continuously differentiable functions and by $\partial^m = \frac{\partial^m}{\partial x^m}$ the derivatives up to order $m$. For $f \in \mathcal{C}^m(X)$, we denote by $\| f \|_{\mathcal{C}^m}$ the $\mathcal{C}^m$-norm given by $$ \| f \|_{\mathcal{C}^m} = \max_{\alpha \le m}\sup_{x \in X} | \partial^{\alpha} f(x) |. $$ For $f \in \mathcal{C}^m(X)$ and $x \in X$, we denote by $J_x(f)$ the $m$th degree Taylor polynomial of $f$ at $x$ $$ J_x(f)(x') = \sum_{\alpha \le m} \frac{\partial^\alpha f(x) (x'-x)^\alpha}{\alpha !}. $$ Note that $J_x(f) \in \mathcal{R}[x]$. We denote by $\mathcal{L}(X;Y)$ the set of Lebesgue measurable functions mapping $X$ to $Y$ and similarly $\mathcal{C}^n(X;Y)$ the set of $n$-times continuously differentiable functions mapping $X$ to $Y$, where $X$ and $Y$ are subsets of the Euclidean space. $2^{A}$ signifies the power set of $A$. Finally, for a finite set $A$, we denote by $co\{A\}$ the convex hull of the set~$A$. \section{Preliminaries} In this section, we discuss some preliminary mathematical notions and results that will be employed in the sequel. \subsection{Whitney's Extension Problem} Whitney's extension problem is concerned with the question of whether, given data on a function $f$, i.e., $\{ \partial^m f_i \}_{i=1}^N$ corresponding to $\{x_i\}_{i=1}^N$ such that $\partial^m f_i = \partial^m f_i(x_i)$, one can find a $\mathcal{C}^m$-function that approximates $f$. It can be described as follows. Suppose we are given an arbitrary subset $D \subset \mathbb{R}^n$ and a function $f : D \to \mathbb{R}$. How can we determine whether there exists a function $F \in \mathcal{C}^m(\mathbb{R}^n)$ such that $F = f$ on $D$? Whitney indeed addressed this problem for the case $n=1$. \begin{thm}[Whitney's Extension Theorem \cite{citeulike:12551299}] Let $E \subset \mathbb{R}^n$ be a closed set, and let $\{{P}_x\}_{x \in {E}}$ be a family of polynomials ${P}_x \in \mathcal{R}[x]$ indexed by the points of $E$. Then the following are equivalent. \begin{enumerate} \item[A.] There exists $F \in \mathcal{C}^m(\mathbb{R}^n)$ such that $J_x(F) = P_x$ for each $x \in E$. \item[B.] There exists a real number $M > 0$ such that $$ | \partial^\alpha P_x(x) | \le M \quad \text{for} \quad | \alpha | \le m,~x \in E. $$ \end{enumerate} \end{thm} Recently in \cite{10.2307/3597349} and \cite{fefferman2009} considered a more general problem. That is, given $\{ f_i=f(x_i) \}_{i=1}^N$, the problem of computing a function $F \in \mathcal{C}^m(\mathbb{R}^n)$ and a real number $M \ge 0$ such that $$ \|F\|_{\mathcal{C}^m} \le M \quad \text{and} \quad |F(x) - f(x)| \le M\sigma(x),\quad \forall x \in E. $$ The function $\sigma:\mathbb{R}^n \to \mathbb{R}_{\ge0}$ is determined by the problem under study and from "observations". The function also serves as a ``tolerance''. It implies that the graph of $F$ passes sufficiently close to the $N$ given data points. Computing such a function $F$ in the general form is a cumbersome task and amounts to computing sets containing $F$~\cite{fefferman2011,10.2307/40345469}. In this paper, instead of considering general interpolants of data, we focus on piecewise-polynomial approximations for which construction algorithm are widely available~\cite{de2001practical}. \subsection{Piecewise-Polynomial Approximation: B-Splines} B-spline functions~\cite{peter1986curve} have properties that make them very suitable candidates for function approximation. They can be efficiently computed in closed form based on available algorithms~\cite{de2001practical}. B-splines are widely employed in computer graphics, automated manufacturing, data fitting, computer graphics, and computer aided design~\cite{Farin1993133}. A $p$th degree B-spline function, $f(t)$, defined by $n$ control points (points that the curve passes through) and knots $\hat{t}_i$, $i=1,2,\ldots,n + p + 1$, is given by \begin{equation} \label{cscs} f(t) = \sum_{i=1}^n \beta_i Q_{i,p}(t). \end{equation} Knot vectors are sets of non-decreasing real numbers. The spacing between knots defines the shape of the curve along with the control points. Function $Q_{i,p}(t)$ is called $i$th B-spline basis function of order $p$ and it can be described by the recursive equations \begin{equation}\label{dada} Q_{i,0}(t) = \begin{cases} 1 & t \in [\hat{t}_i, \hat{t}_{i+1}) \\ 0 & \text{otherwise} \end{cases} \end{equation} and \begin{equation}\label{eqwew} Q_{i,p}(t) = \frac{t - \hat{t}_i}{\hat{t}_{i+p}-\hat{t}_i}Q_{i,p-1}(t) + \frac{\hat{t}_{i+p+1} - t}{\hat{t}_{i+p+1}-\hat{t}_{i+1}} Q_{i+1,p-1}(t), \end{equation} defined using the Cox-de Boor algorithm \cite{de2001practical}. First-order basis functions are evaluated using~\eqref{dada}, followed by iterative evaluation of \eqref{eqwew} until the desired order is reached. In contrast to B\'ezier curves, the number $n$ of control points of the curve, is independent of the order, $p$, providing more robustness for the generated paths topology. Furthermore, the derivative of a B-spline $Q_{i,p}$ of degree $p$ is simply a function of B-splines of degree $p-1$: \begin{equation} \label{fscsc} \frac{\mathrm{d}Q_{i,p}(t)}{\mathrm{d}t} = (p-1)\bigg( \frac{-Q_{i+1,p-1}}{t_{i+p}-t_{i+1}}+ \frac{Q_{i,p-1}}{t_{i+p-1}-t_{i}} \bigg). \end{equation} \section{Construction of Data-Driven Differential Inclusions} \label{sec:main} In this section, we bring forward a method that uses B-spline approximation of data and known regularity side information to construct a data-driven model. We call this model a data-driven differential inclusion. We show in the sequel that such data-driven differential inclusions enable safety analysis and controller synthesis. \subsection{Piecewise-Polynomial Approximation of the System Dynamics} We study systems for which, at time instances $t_1\le t_2 \le \cdots \le t_N$, samples of control and state values are available. In order to construct data-driven differential inclusions, we employ the tensor-product spline technique~\cite{GROSSE198029} which allows for efficient approximation of multi-variate systems. To this end, we parametrize the states as a function of $t$ and $u=(u_1,\ldots,u_m)^T$, $x(t,u)$. Furthermore, in order to obtain a control-affine model, we consider first-order spline (piecewise linear) functions of control inputs $u=(u_1,\ldots,u_m)^T$. That is, for each state, we have \begin{equation} X_l(t) = \sum_{i=1}^L \sum_{j=1}^m c_{i,j}^l Q_{i,j}^l(t) (a_{0,j}^l+a_{1,j}^lu_j),~~ l=1,2,\ldots,n. \end{equation} We are interested in approximating the time evolution of the state. Computing the time-derivative of $X$ yields \begin{multline} \label{eq:XXXXXZAA} \dot{X}_l(t) = \sum_{i=1}^L \sum_{j=1}^m c_{i,j}^l \dot{Q}_{i,j}^l(t) (a_{0,j}^l+a_{1,j}^lu_j) \\= \sum_{i=1}^L \sum_{j=1}^m a_{0,j}^l c_{i,j}^l \dot{Q}_{i,j}^l(t) + \sum_{i=1}^L \sum_{j=1}^m a_{1,j}^l c_{i,j}^l \dot{Q}_{i,j}^l(t) u_j, \end{multline} where $\dot{Q}_{i,j}^l(t)$ can be computed efficiently using the recursive formula~\eqref{fscsc}. Define \begin{eqnarray*} f_l(t) &=& \sum_{i=1}^L \sum_{j=1}^m a_{0,j}^l c_{i,j}^l \dot{Q}_{i,j}^l(t) \quad \text{and} \nonumber \\ G_l(t) &=& \begin{bmatrix} \sum_{i=1}^L a_{1,1}^l c_{i,1}^l \dot{Q}_{i,1}^l(t) \\ \vdots \\ \sum_{i=1}^L a_{1,m}^l c_{i,m}^l \dot{Q}_{i,m}^l(t) \end{bmatrix}^T \in \mathbb{R}^{1\times m}. \nonumber \end{eqnarray*} Then, \eqref{eq:XXXXXZAA} can be rewritten as \begin{equation} \label{dssdsdcceeww} \dot{X}(t) = F(t)+G(t)u, \end{equation} where $X= (X_1(t),\cdots,X_n(t))^T$, $F = (f_1(t),\cdots,f_n(t))^T$ and $G=(G_1(t),\cdots,G_n(t))^T$. \subsection{Data-Driven Differential Inclusions} We are given samples of the state $\{x(t_i,u_i)\}_{i=1}^N$ at time instances $t_1\le t_2\le \cdots \le t_N$. That is, information about only one trajectory is available. We consider state evolutions that belong to $\mathcal{C}^2(\mathbb{R}_{\ge 0})$. Hence, $\dot{x}(t) \in \mathcal{C}^1(\mathbb{R}_{\ge 0})$. We consider cases in which, in addition to state and input samples, some prior regularity knowledge (that we also call side information) on the state evolutions may be available. We capture such information by constraints in the form of $$ \| x \|_{\mathcal{C}^2} \le M, $$ for a constant $M>0$. For mechanical systems, for example, the above constraint represents bounds on maximum acceleration. In order to account for the uncertainty in approximating $\dot{x}$ with the function $\dot{X}$, we introduce a function $\sigma:\mathbb{R}_{\ge 0} \to \mathbb{R}_{\ge 0}$ such that \begin{equation}\label{eq:sidenew} |\dot{X}(t) - \dot{x}(t)| \le M\sigma(t). \end{equation} In the case of piecewise-polynomial approximation of the data, we have~\eqref{dssdsdcceeww}. From the side information~\eqref{eq:sidenew}, we have $\dot{X}_{-} \le \dot{x} \le \dot{X}_{+}$, where $\dot{X}_{-}=\dot{X}(t)-M\sigma(t)$ and $\dot{X}_{+}=\dot{X}(t)+M\sigma(t)$ and $\dot{X}(t)$ is given as~\eqref{dssdsdcceeww}. Hence, the dynamics of the system for $t>t_N$ can be described by the following data-driven differential inclusion \begin{eqnarray}\label{mainDIS} \begin{cases} \dot{x}(t) \in co \big \{ \dot{X}_{-}(t),\dot{X}_{+}(t) \big \}, \\ x(t_N)=x_N. \end{cases} \end{eqnarray} Note that the above dynamics are dependent on the control signal through~\eqref{dssdsdcceeww}. \begin{figure}[!t] \centering \includegraphics[width=7cm]{datacontrolillus.eps} \caption{Data samples (black dots), actual system state evolution (dashed lines), and the solution set of the data-driven differential inclusion (blue). } \label{fig1ccc} \end{figure} Differential inclusion~\eqref{mainDIS} in fact over-approximates the dynamics after $t>t_N$. Note that the information on the system state is only available for $0<t<t_N$ and the regularity information ($M$ and $\sigma$) provides the means using~\eqref{mainDIS} to predict the behavior of system state. The rate of growth of the approximation error for $t>t_N$ can be approximated by the application of Gronwall's inequality~\cite{aubincelina}. This rate is a linear function of the Lipschitz constant of the interpolant. Nonetheless, cubic-spline polynomials are the best interpolants in terms of minimizing the Lipschitz constant for $\mathcal{C}^2$ trajectories~\cite{herbert2014computing}. Figure~\ref{fig1ccc} illustrates the solution set of the differential inclusion~\eqref{mainDIS} for a system with only one state and $\sigma(t) = 1,~~t>0$. We are interested in solving the following safety analysis problem. \\ \textbf{Problem 1:} Consider the data-driven differential inclusion~\eqref{mainDIS} with $u \equiv 0$. Given $\mathcal{X}_u \subset \mathbb{R}^n$ and $T>t_N$, check whether $x(T) \notin \mathcal{X}_u$. \\ In addition, we are interested in addressing the following safe controller synthesis problem. \\ \textbf{Problem 2:} Consider the data-driven differential inclusion~\eqref{mainDIS}. Given $\mathcal{X}_u \subset \mathbb{R}^n$ and $T>t_N$, find a feedback law $u(x)$ such that $x(T) \notin \mathcal{X}_u$. \\ In the next section, we discuss differential inclusions in the form of~\eqref{mainDIS} and we address Problem 1 and Problem 2. \section{Safety analysis and Safe Controller Synthesis for Differential Inclusions}\label{sec:controlsafe} We start by deriving a safety theorem based on barrier certificates for convex differential inclusions and then show how this result can be applied to the data-driven differential inclusion~\eqref{mainDIS} for safe controller synthesis. Let $\{f_i(t,x,u)\}_{i=1}^m$ be a family of (piecewise) smooth functions, where $f_i:\mathcal{T} \times \mathcal{X} \times \mathcal{U} \to \mathbb{R}^n$ with $\mathcal{X} \subseteq \mathbb{R}^n$, $\mathcal{T} \subseteq \mathbb{R}_{\ge0}$, and $\mathcal{U} \subseteq \mathbb{R}^m$. We further assume $u \in \mathcal{L}^\infty$. Define $\mathcal{F}: \mathcal{T} \times \mathcal{X} \times \mathcal{U} \to 2^{\mathbb{R}^n}$ with $$ \mathcal{F}(t,x,u) = co \{ f_1(t,x,u),\ldots, f_m(t,x,u) \}. $$ Consider the following differential inclusion \begin{eqnarray} \label{eq:DImain} \begin{cases} \dot{x} \in \mathcal{F}(t,x,u),\quad t \ge t_0, \label{eq:DI} \\ x(t_0) = x_0. \end{cases} \end{eqnarray} Well-posedness conditions of differential inclusions~\cite[Theorem 1, p. 106]{fillipov} require the set-valued map $\mathcal{F}$ to be closed and convex for all $t$, $x$, and $u$, and also measurable in $u$. The set $\mathcal{F}(t,x,u)$ is closed and convex, because it is defined as the convex hull of a finite set. Furthermore, the mapping $\mathcal{F}(t, \cdot,u) : \mathcal{X}\to 2^{\mathbb{R}^n}$ is upper hemi-continuous in $x$, for all $t$ and $u$, because it can be written as a convex combination of smooth mappings $f_i(t,\cdot,u)$. Finally, the mapping $\mathcal{F}(t,x,u)$ satisfies the one-sided Lipschitz condition \begin{equation*} (x_1-x_2)^T \left(v_1 - v_2 \right) \le C \| x_1-x_2\|^2, \quad \forall t>0, \end{equation*} for some $C>0$ and all $x_1 \in \mathcal{X}$, $x_2 \in \mathcal{X}$, $v_1 \in \mathcal{F}(t,x_1,u)$ and $v_2 \in \mathcal{F}(t,x_2,u)$, which follows from the fact that $\mathcal{F}(t,\cdot,u)$ is a convex hull of smooth and Lipschitz functions for all $t$ and $u$. \subsection{Safety Analysis for Autonomous Differential Inclusions} \label{sec:ddss|} In order to propose a solution to Problem 1, we extend the concept of barrier certificates to differential inclusions. Before stating the result, we require a definition of the derivative for set-valued maps~\cite{aubinsetvalued}. Denote by $$ D_{+} V(x)(f) = \liminf_{h \to 0^{+},~v \to f} \frac{V(x+hv)-V(x)}{h} $$ the upper contingent derivative of $V$ at $x$ in the direction $f$. In particular, when $V$ is Gateaux differentiable and $\mathcal{F}=\{v\}$ is a singleton, $D_{+}V(x)$ coincides with the gradient $$ D_{+}V(x)(v) = \left(\nabla V(x)\right)^T v. $$ \begin{thm} \label{thm:barriersDifInq} Consider differential inclusion~\eqref{eq:DI} with $u \equiv 0$ and let $T>t_0$. If there exist a function $B \in \mathcal{C}^1(\mathbb{R}^n;\mathbb{R}) \cap \mathcal{C}^1(\mathbb{R}_{\ge 0};\mathbb{R})$ and a positive definite function $W\in \mathcal{L}(\mathbb{R}^n \times \mathbb{R}_{\ge 0};\mathbb{R}_{\ge 0})$ such that \begin{equation}\label{eq:Bcon1} B\left(x(T),T\right)-B\left(x(t_0),t_0\right) >0, \quad x(T) \in \mathcal{X}_u, \end{equation} \begin{equation} \label{eq:Bcon2} D_{+} B(t,x)(v,1) \le -W(t,x), \quad t \in [t_0,T],~~v \in \mathcal{F}(t,x), \end{equation} then the solutions of \eqref{eq:DI} satisfy $x(T) \notin \mathcal{X}_u$. \end{thm} \begin{proof} The proof is carried out by contradiction. Assume it holds that $x(T) \in \mathcal{X}_u$. Then, \eqref{eq:Bcon1} implies that $$ B\left(x(T),T\right)>B\left(x(t_0),t_0\right). $$ Furthermore, using the comparison theorem for differential inclusions~\cite[Proposition~8, p. 289]{aubincelina} and inequality~\eqref{eq:Bcon2}, we can infer that $$ B(x(s),s)-B(x(t_0),t_0) \le - \int_{t_0}^s W(x,\tau)~d\tau \le 0. $$ That is, $$ B(x(s),s) \le B(x(t_N),t_N). $$ Since $s$ was chosen arbitrary, this is a contradiction. Thus, the solutions of \eqref{eq:DI} satisfy $x(T) \notin \mathcal{X}_u$. \end{proof} Theorem~\ref{thm:barriersDifInq} presents conditions to check the safety of the solutions of a differential inclusion. The above formulation only necessitates the barrier certificate to have an upper contingent derivative. Hence, our formulation here includes non-smooth barrier certificates. The closet work on this class of barrier certificates is the recent research~\cite{7937882}, wherein the authors considered min/max barrier functions with application to control of multi-robot systems. Nonetheless, the formulation in~\cite{7937882} is based on fixing the the barrier functions, i.e., the 0-super level sets of the barrier functions define the unsafe sets. This assumption can be restrictive in many cases, in particular, general semi-algebraic sets. In this study, we do not make such assumptions on the structure of the barrier functions and we allow them to be variables in the computational formulation in Section~\ref{sec:compute}. \subsection{Safety Controller Synthesis for Data-Driven Differential Inclusions} \label{dccsdccsec} Having established a safety analysis theorem for differential inclusions, we proceed by proposing conditions for safety analysis and safe controller synthesis for data-driven differential inclusion~\eqref{mainDIS}. We begin with the safety analysis result, which follows from Theorem~\ref{thm:barriersDifInq}. In other words, given the limited data over states up to some time $t_N$ and the regularity information, we verify whether the system behaves safely at a given time $T>t_N$. \begin{cor}\label{cordsdsds} Consider differential inclusion~\eqref{mainDIS} with $u \equiv 0$ and let $T>t_N$. If there exist a function $B \in \mathcal{C}^1\left(\mathbb{R}^n;\mathbb{R}) \cap \mathcal{C}^1([t_N,\infty);\mathbb{R}\right)$ and two positive definite functions $W_{+} \in \mathcal{L}\left(\mathbb{R}^n \times [t_N,\infty);[t_N,\infty)\right)$ and $W_{-} \in \mathcal{L}\left(\mathbb{R}^n \times [t_N,\infty);[t_N,\infty)\right)$ such that \begin{equation}\label{eq:Bcon11} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) >0, \quad x(T) \in \mathcal{X}_u, \end{equation} \begin{eqnarray} D_{+} B(t,x)\left(\dot{X}_{-},1\right) \le -W_{-}(t,x), \quad t \in [t_N,T], \label{eq:Bcon22} \\ D_{+} B(t,x)\left(\dot{X}_{+},1\right) \le -W_{+}(t,x), \quad t \in [t_N,T], \label{eq:Bcon33} \end{eqnarray} then the solutions of \eqref{mainDIS} satisfy $x(T) \notin \mathcal{X}_u$. \end{cor} \begin{proof} Inequality~\eqref{eq:Bcon11} ensures that ~\eqref{eq:Bcon1} holds. Multiplying both sides of inequality~\eqref{eq:Bcon22} with a constant $0 \le \alpha_{-}\le 1$ and inequality~\eqref{eq:Bcon33} with a constant $0 \le \alpha_{+}\le 1$ such that $ \alpha_{-}+\alpha_{+} =1$ and adding them, we obtain \begin{multline*} \alpha_{-} D_{+} B(t,x)(\dot{X}_{-},1) +\alpha_{+} D_{+} B(t,x)(\dot{X}_{+},1) \\ \le - \alpha_{-} W_{-}(t,x)-\alpha_{+} W_{+}(t,x). \end{multline*} Since $D_{+}$ is a linear operator, we have \begin{multline*} D_{+} B(t,x)( \alpha_{-}\dot{X}_{-}+ \alpha_{+}\dot{X}_{+},1) \\ \le D_{+} B(t,x)( \alpha_{-}\dot{X}_{-}) + D_{+} B(t,x)( \alpha_{-}\dot{X}_{+}) \\ \le - \alpha_{-} W_{-}(t,x)-\alpha_{+} W_{+}(t,x), \end{multline*} where, in the last line above, we applied inequalities~\eqref{eq:Bcon22} and \eqref{eq:Bcon33}. Let $W(t,x) = \min \left\{ W_{-}(t,x),W_{+}(t,x) \right\}$. We obtain \begin{multline*} D_{+} B(t,x)(\alpha_{-}\dot{X}_{-}+ \alpha_{+}\dot{X}_{+},1) \\ \le - \alpha_{-} W_{-}(t,x)-\alpha_{+} W_{+}(t,x) \\ \le -(\alpha_{-}+\alpha_{+}) W(t,x) = -W(t,x). \end{multline*} That is, $$ D_{+} B(t,x)(v,1) \le - W(t,x),\quad v \in co\{\dot{X}_{-},\dot{X}_{+}\}. $$ Thus inequality~\eqref{eq:Bcon2} is also satisfied. This completes the proof. \end{proof} We show in Section~\ref{sec:compute} that if we parametrize $B$ and $W$ by polynomials of fixed degree and let $\mathcal{X}_u$ be a semi-algebraic set, then we can check inequalities~\eqref{eq:Bcon11} through~\eqref{eq:Bcon33} using sum of squares programming. We next address Problem 2 by proposing a method to design controllers such that solutions to~\eqref{dssdsdcceeww} are safe with respect to a given unsafe set $\mathcal{X}_u$ for all $t>t_N$. In other words, we address Problem 2. \begin{cor}\label{cordsdsds} Consider differential inclusion~\eqref{mainDIS} and let $T>t_N$. If there exist a function $B \in \mathcal{C}^1\left(\mathbb{R}^n;\mathbb{R}) \cap \mathcal{C}^1([t_N,\infty);\mathbb{R}\right)$ and a positive definite function $W\in \mathcal{L}\left(\mathbb{R}^n \times [t_N,\infty);[t_N,\infty)\right)$ such that \begin{equation}\label{eq:Bcon12221} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) >0, \quad x(T) \in \mathcal{X}_u, \end{equation} \begin{multline} \label{rwewdw2222wcv} \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f-M\sigma) \le -W(t,x),\\ \forall x \in \mathcal{X},~~\forall t \in [t_N,T], \end{multline} \begin{multline} \label{cccxzeew} \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f+M\sigma) \le -W(t,x), \\ \quad \forall x \in \mathcal{X},~~\forall t \in [t_N,T],\end{multline} and \begin{equation} \label{eq:controlability} \left( \frac{\partial B}{\partial x} \right)^T g \neq 0, \quad \forall x \in \mathcal{X},~~\forall t \in [t_N,T], \end{equation} then the controller \begin{equation} \label{eq:controller} u =g^T \frac{\partial B}{\partial x} \left( (\frac{\partial B}{\partial x})^T g g^T \frac{\partial B}{\partial x} \right)^{-1} W(t,x), \end{equation} renders the solutions of \eqref{mainDIS} safe, i.e., $x(t) \notin \mathcal{X}_u$ for all $t \in [t_N,T]$. \end{cor} \begin{proof} The proof follows by applying Corollary~\ref{cordsdsds} to system~\eqref{dssdsdcceeww} with $W_{-}=W_{+}=W$. Inequality~\eqref{eq:Bcon12221} ensures that~\eqref{eq:Bcon11} holds. Computing the directional derivative of $B$ along the solutions of system~\eqref{dssdsdcceeww} and using the linearity property of the $D_{+}$ operator we have \begin{multline} \label{cscscsC} D_{+} B(t,x)\left(f(t)+g(t)u \pm M\sigma(t),1\right) \\ = \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f+gu \pm M\sigma) \\= \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f \pm M\sigma) + \left( \frac{\partial B}{\partial x} \right)^Tgu. \end{multline} Note that if $\left( \frac{\partial B}{\partial x} \right)^Tg = 0$, we cannot design $u$ such that makes the last line of~\eqref{cscscsC} negative definite, i.e., to ensure safety. Noting that~\eqref{eq:controlability} holds and substituting the controller~\eqref{eq:controller} in the last line of~\eqref{cscscsC}, we obtain \begin{multline} \label{opoepeore} \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f \pm M\sigma) \\+ \left( \frac{\partial B}{\partial x} \right)^Tg g^T \frac{\partial B}{\partial x} \left( (\frac{\partial B}{\partial x})^T g g^T \frac{\partial B}{\partial x} \right)^{-1} W(t,x) \\ = \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x} \right)^T( f \pm M\sigma) \\+ W(t,x) -W(t,x)+W(t,x) \le 0, \end{multline} where, in the last line inequality above, we used the fact that~\eqref{rwewdw2222wcv} and \eqref{cccxzeew} hold. Thus, $$ D_{+} B(t,x) ( f(t)+g(t) \pm M\sigma(t),1) \le 0. $$ Let $0 \le \alpha_1,\alpha_2 \le 1$ satisfying $\alpha_1+\alpha_2=1$. Then, \begin{multline*} \alpha_1 D_{+} B(t,x) ( f(t)+g(t) + M\sigma(t),1) \\+\alpha_2 D_{+} B(t,x) ( f(t)+g(t) - M\sigma(t),1) \\ = D_{+} B(t,x) \left( \alpha_1(f(t)+g(t) + M\sigma(t)),1 \right) \\+ D_{+} B(t,x) \left( \alpha_2(f(t)+g(t) - M\sigma(t)),1 \right) \\ = D_{+} B(t,x) \bigg( \alpha_1(f(t)+g(t) + M\sigma(t)) \\+\alpha_2(f(t)+g(t) - M\sigma(t)) ,1 \bigg) \le 0, \end{multline*} where in the last line we used ~\eqref{opoepeore}. This completes the proof. \end{proof} \section{Computational Method} \label{sec:compute} In this section, we propose computational methods to address the analysis and the synthesis problems. Piecewise polynomial interpolation leads to a computational formulation based on polynomial optimization or sum-of-squares programs. Assuming $\sigma \in \Sigma[t]$, \eqref{mainDIS} becomes a differential inclusion with polynomial vector fields. The next lemma, which is based on the application of Putinar's Positivestellensatz~\cite{putinar99,S1052623403431779}, presents conditions in terms of polynomial positivity that can be efficiently checked via semi-definite programs (SDPs)~\cite{Par00}. \begin{lem}\label{lem1} Consider the differential inclusion~\eqref{mainDIS} with $u \equiv 0$ and the following semi-algebraic unsafe set \begin{equation} \label{dcscsdcscscs} \mathcal{X}_u = \{ x \mid l_i(x) \le 0,~i=1,2,...,n_c\}, \end{equation} where $l_i \in \mathcal{R}[x]$. If there exist functions $B \in \mathcal{R}[x,t]$, $W_{-} \in {\Sigma}[x,t]$, $W_{+} \in {\Sigma}[x,t]$, $m_i \in \Sigma[x,t]$, $i=1,2$, $s_i \in \Sigma[x,t]$, $i=1,\ldots,n_c$ and a positive constant $c>0$, such that \begin{multline} \label{Con1111s} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) \\+ \sum_{i=1}^{n_c} s_i\left(x(T)\right) l_i\left(x(T)\right) -c \in \Sigma \left[x(T)\right] \end{multline} and \begin{multline} \label{rwewdwwcv1} -\frac{\partial B}{\partial t} - \left( \frac{\partial B}{\partial x} \right)^T \dot{X}_{-} -W_{-}(t,x) \\- m_1(t,x)(t-t_N)(t-T) \in \Sigma[x,t], \end{multline} \begin{multline} \label{wqqwsszz} -\frac{\partial B}{\partial t} - \left(\frac{\partial B}{\partial x}\right)^T \dot{X}_{+} -W_{+}(t,x) \\- m_2(t,x)(t-t_N)(t-T) \in \Sigma[x,t], \end{multline} then the solutions to~\eqref{mainDIS} satisfy $x(T) \notin \mathcal{X}_u$. \end{lem} \begin{proof} Applying Putinar's Positivstellensatz, condition~\eqref{Con1111s} implies that $$ B\left(x(T),T\right)-B\left(x(t_N),t_N\right)>0, $$ for all $x(T) \in \mathcal{X}_u$ as in~\eqref{eq:Bcon11}. Thus, inequality~\eqref{eq:Bcon11} holds. Moreover, since $B \in \mathcal{R}[x,t]$ and thus smooth, we have $$ D_{+} B(t,x)\left(\dot{X}_{-},1\right) = \frac{\partial B}{\partial t} + \left( \frac{\partial B}{\partial x}\right)^T \dot{X}_{-} . $$ Hence, from condition~\eqref{rwewdwwcv1}, we have $$ D_{+} B(t,x)\left(\dot{X}_{-},1\right) \le -W_{-}(t,x), \quad t \in [t_N,T]. $$ Therefore, inequality~\eqref{eq:Bcon22} is satisfied. In a similar manner, we can show that \eqref{eq:Bcon33} holds as well. Analogously, we can show that~\eqref{wqqwsszz} implies that \eqref{eq:Bcon33} is satisfied. Then, from Corollary~\ref{cordsdsds}, the solutions to~\eqref{mainDIS} satisfy $x(T) \notin \mathcal{X}_u$. \end{proof} We now focus on formulating sum of squares conditions to synthesize a safe controller as highlighted in Corollary 2. The following result can be proved by a direct application of Positivstellensatz. \begin{lem}\label{lem5651} Consider the differential inclusion~\eqref{mainDIS} and the following semi-algebraic unsafe set \begin{equation} \label{dcscsdcscscs} \mathcal{X}_u = \{ x \mid l_i(x) \le 0,~i=1,2,...,n_c\}, \end{equation} where $l_i \in \mathcal{R}[x]$. If there exist functions $B \in \mathcal{R}[x,t]$, $W \in {\Sigma}[x,t]$, $m_i \in \Sigma[x,t]$, $i=1,2$, $s_i \in \Sigma[x,t]$, $i=1,\ldots,n_c$, $q_1 \in \mathcal{R}[x,t]$, $q_2 \in \Sigma[x,t]$ and a positive constant $c>0$ such that \begin{multline} \label{Con1111} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) \\+ \sum_{i=1}^{n_c} s_i\left(x(T)\right) l_i\left(x(T)\right) -c \in \Sigma \left[x(T)\right], \end{multline} \begin{multline} \label{rwewdwwcv} -\frac{\partial B}{\partial t} - \left( \frac{\partial B}{\partial x} \right)^T( f-M\sigma) \\-W(t,x) - m_1(t,x)(t-t_N)(t-T) \in \Sigma[x,t], \end{multline} \begin{multline} -\frac{\partial B}{\partial t} - \left( \frac{\partial B}{\partial x} \right)^T( f+M\sigma) \\-W(t,x) - m_2(t,x)(t-t_N)(t-T) \in \Sigma[x,t], \end{multline} and \begin{equation} \label{eq:bilinearB} -q_1 \left( \left( \frac{\partial B}{\partial x} \right)^T g \right) - q_2 \in \Sigma[x,t], \end{equation} then the solutions to~\eqref{mainDIS} satisfy $x(T) \notin \mathcal{X}_u$. \end{lem} Note that sum of squares constraint~\eqref{eq:bilinearB} is bilinear in variables $B$ and $q_1$. In practice, we fix the polynomial $q_1$ and look for a barrier certificate such that \eqref{Con1111} to \eqref{eq:bilinearB} are satisfied. In many cases such as the examples given in Section~\ref{sec:numresults}, this constraint holds for a computed barrier certificate $B$. \section{Including Side Information: Algebraic and Integral Inequalities} \label{sec:side} In addition to the regularity side information discussed so far, we consider physical conservation laws in the form of algebraic and integral inequalities (note that we can always represent an equality with two inequalities). The side information can be used to restrict the set of predictions we make regarding the dynamics of the system at a future point in time. For instance, consider the two-dimensional motion of a simple pendulum of fixed length $\ell>0$ and a bob of mass $m$ (see Figure~\ref{fig:pendul}). Let $x$ and $y$ represent the horizontal and vertical positions of the bob, which also account for the states of the system. Since the length of pendulum is fixed (non-elastic), the states always satisfy the following equality (conservation of length) $$ x^2+y^2= \ell^2. $$ In the following, we show how we can use such physical side information to obtain less conservative predictions. Formally, we consider side information that can be represented as \begin{multline}\label{hardiqcs} \mathcal{C} = \bigg \{ (t,x,u) \mid \phi_i(t,x,u)\ge0,~i \in I, \\ \int_0^T \psi_j(t,x,u)~dt \ge0,~j \in J,~T>0 \bigg\}, \end{multline} where $I$ and $J$ are index sets and $\phi_i,~i \in I$ and $\psi_j,~j \in J$ are continuous functions. \begin{figure} \centering \begin{tikzpicture}[thick,>=latex,->,scale=0.7] \begin{scope} \clip(-5,2) rectangle (5,-5); \draw[dashed] (0,0) circle (4.24cm); \filldraw[white] (-4.3,4.3) rectangle (4.3,0); \draw[double distance=1.6mm] (0,0) -- (3,-3) node[midway,xshift=4mm,yshift=2mm]{$\ell$}; \draw[->] (3,-3) -- (3,-4.5) node[below]{$m g$}; \draw[fill=white] (-1.2,1.0) -- (-.5,0) arc(180:360:0.5) -- (1.2,1.0) -- cycle; \draw[draw=black,fill=white] (0, 0) circle circle (.3cm); \draw[draw=black,fill=white] (3,-3) circle circle (.3cm); \draw[->] (.6,0) -- (2,0) node[below]{{$x$}}; \draw[->] (0,-.6) -- (0,-2) node[below]{{$y$}}; \draw[pattern=north east lines] (-1.4,1.3) rectangle (1.4,1); \end{scope} \end{tikzpicture} \caption{Schematic diagram of the two dimensional pendulum.} \label{fig:pendul} \end{figure} In the case in which $\psi_j$'s are quadratic functions of $x$ and/or $u$, they can represent (hard) integral quadratic constraints, which can be used to model system properties such as passivity, induced input-output norms, saturation and etc. In the absence of inputs, we have \begin{multline} \label{eq:sideauton} \mathcal{C}_0 = \bigg \{ (t,x) \mid \phi_i(t,x)\ge 0,~i \in I, \\ \int_0^T \psi_j(t,x)~dt\ge0,~j \in J,~T>0 \bigg\}. \end{multline} We can incorporate side information in the form of~\eqref{eq:sideauton} as additional constraints. To illustrate, conditions of Corollary~\ref{cordsdsds} can be rewritten~as \begin{equation}\label{eq:Bcon11cccx} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) >0, \quad x(T) \in \mathcal{X}_u, \end{equation} \begin{equation} \label{eq:Bconcxssssccxc22} D_{+} B(t,x)\left(\dot{X}_{-},1\right) \le -W_{-}(t,x),~~ t \in [t_N,T],~~(t,x) \in \mathcal{C}_0, \end{equation} and \begin{equation} D_{+} B(t,x)\left(\dot{X}_{+},1\right) \le -W_{+}(t,x),~~ t \in [t_N,T],~~(t,x) \in \mathcal{C}_0. \end{equation} The next result gives a sum of squares formulation to the above inequalities and therefore allows us to assess the safety of the system given the side information. \begin{lem}\label{lem2} Consider the differential inclusion~\eqref{mainDIS} with $u \equiv 0$, the semi-algebraic unsafe set $$ \mathcal{X}_u = \{ x \mid l_i(x) \le 0,~i=1,2,...,n_c\}, $$ and side information~\eqref{eq:sideauton} where $\phi_i \in \mathcal{R}[x,t],~i \in I$, $\psi_j\in \mathcal{R}[x,t],~j\in J$, and $l_i \in \mathcal{R}[x]$. If there exist functions $B \in \mathcal{R}[x,t]$, $W_{-} \in {\Sigma}[x,t]$, $W_{+} \in {\Sigma}[x,t]$, $m_i \in \Sigma[x,t]$, $i=1,2$, $s_i \in \Sigma[x,t]$, $i=1,\ldots,n_c$, $p_i, \hat{p}_i \in \Sigma[x,t]$, $i=1,\ldots,n_s$, and positive constants $q_i,\hat{q}_i$, $i=1,\ldots,n_{si}$ and $c>0$ such that \begin{multline} \label{Con11211} B\left(x(T),T\right)-B\left(x(t_N),t_N\right) \\+ \sum_{i=1}^{n_c} s_i\left(x(T)\right) l_i\left(x(T)\right) -c \in \Sigma \left[x(T)\right] \end{multline} and \begin{multline} \label{rwewdw2wcv} -\frac{\partial B}{\partial t} - \left( \frac{\partial B}{\partial x}\right)^T \dot{X}_{-} -W_{-}(t,x) - m_1(t,x)(t-t_N)(t-T) \\-\sum_{i=1}^{n_s} p_i(t,x) \phi_i(t,x) -\sum_{j=1}^{n_{si}} q_j\psi_j (t,x) \in \Sigma[x,t], \end{multline} \begin{multline} -\frac{\partial B}{\partial t} - \left( \frac{\partial B}{\partial x}\right)^T \dot{X}_{+} -W_{+}(t,x) - m_2(t,x)(t-t_N)(t-T) \\-\sum_{i=1}^{n_s} \hat{p}_i(t,x) \phi_i(t,x) -\sum_{j=1}^{n_{si}} \hat{q}_j\psi_j (t,x) \in \Sigma[x,t], \end{multline} then the solutions to~\eqref{mainDIS} satisfy $x(t) \notin \mathcal{X}_u$, for all $t \in [t_N,T]$. \end{lem} Note that the side information requires inequalities~\eqref{eq:Bconcxssssccxc22} to hold in a smaller set; therefore, it makes it easier to find the barrier function. However, from a computational standpoint, as the number of inequalities in~\eqref{eq:sideauton} increases, we have to add more variables to the sum of squares program. Similarly, we can formulate sum of squares conditions for controller synthesis with side information~\eqref{hardiqcs} as described in Lemma~\ref{lem5651}. \section{Numerical Results} \label{sec:numresults} In this section, we illustrate the proposed method using two examples. The first example is a single state system for which limited data is available and safety in a future time is of interest. The second example is a safe-landing scenario for an aircraft with critical failure. In the following examples, we used the parser SOSTOOLs~\cite{PAVPSP13} to cast the polynomial inequalities into semidefinite programs and then we used Sedumi~\cite{Stu98} to solve the resultant SDPs. \subsection{Example I} We consider 20 samples of the solution to the following differential equation \begin{eqnarray}\label{dccsxsew} \dot{x}& =& 0.5x^2-0.05x^3+u, \nonumber \\ x(0) &=& 1, \end{eqnarray} in the interval $0<t<1.7$ when $u \equiv 0$ (see Figure~\ref{L2curve}). The regularity information is given as $\|x\|_{\mathcal{C}^2} \le 5$ and $$ |\dot{X}(t) - \dot{x}(t) | \le 5, $$ which implies that $M=5$ and $\sigma(t)=1$. We use a cubic piecewise-polynomial approximation of $x(t)$. This can be carried out readily by the \texttt{spline} function in MATLAB. The unsafe set is given by $$ \mathcal{X}_u = \left\{ x \in \mathbb{R} \mid x-9 \ge 0 \right\}. $$ The boundary of the unsafe set $x=9$, the data points $\{x_i\}_{t=1}^{20}$ and the piecewise-polynomial approximation of the state $X(t) = \sum_i \beta_i Q_{i,p}(t)$ are shown in Figure~\ref{L2curve}. As it can be observed from the figure, since there exists an stable equilibrium at $x=10$, the solution of the actual system converges to the equilibrium at $t \approx 3$. However, since the piecewise-polynomial approximation of the state is based on the information up to $t=1.7$, $X(t)$ differs from $x(t)$ as time passes. Nonetheless, the data-driven differential inclusion~\eqref{mainDIS} provides an approximation of the state evolutions for $t>1.7$. \begin{figure} \centering \includegraphics[scale=.5]{Fig1.eps}\\ \caption{The boundary of the unsafe set $x=9$ (red line), the data points $\{x(t_i)\}_{i=1}^{20}$ (black circles), the piecewise-polynomial approximation of the state $X(t)$ (black dots) and the actual solution of the system (solid blue). }\label{L2curve} \end{figure} \begin{table}[!b] \caption{Numerical results for 20 samples and $t_N=2$.} \label{t11} \centering \begin{tabular}{c||c|c|c|c|c|c} \bfseries deg & 1 & 2 & 3 & 4 & 5 & 6 \\ \hline \bfseries $T$ & 2.26 & 2.34 & 2.41 & 2.45 & 2.46 & 2.49 \\ \end{tabular} \end{table} In this example, we are interested in finding the maximum $T$ for which the solutions become unsafe, i.e., $x(T) \ge 9$. To this end, based on Corollary~\ref{lem1}, we increase the value of $T$ and look for a barrier certificate. We continue until no barrier certificate can be found. Table~\ref{t11} provides the numerical results. Notice that the actual system become unsafe at $T=2.66$. However, due to system uncertainty and limited data, the lower bound on the unsafe set has been found to be $T=2.49$ corresponding to certificates of degree 6. The barrier certificate of degree 3 is given bellow \begin{multline} B(t,x) = -0.496t^3+0.119t^2x + 0.0449t^2 - 0.0383tx^2 \\-0.5855tx - 0.8398t + 0.1063x^2 +1.389x. \nonumber \end{multline} At this point, we consider 20 samples of the solution to the differential equation~\eqref{dccsxsew} from $t \in [0,2]$ and we allow one seconds for the computations. Thus, the safe controller would kick in at around $t=3$. The values of $u$ for learning phase are drawn from $10\sin(t)$. The unsafe set given by $\mathcal{X}_u = \left\{ x \in \mathbb{R} \mid x-10 \ge 0 \right\}$ and we are interested in making sure that the system solutions remain safe from $[3,10]$, i.e., $T=10$. Figure~\ref{L2ddcurve} shows the application of the designed safe controller based on Corollary 2. As it can be observed as the safe controller starts acting on the system, the solutions become safe for $t \ge 3$. The computed certificates $B$ and $W$ of degree 2 in the synthesis problem are given below \begin{multline} B(t,x) = 0.3845t^2 - 0.0002269tx - 1.594t \\+ 0.0006x^2 + 0.0001038x, \nonumber \end{multline} \begin{multline} W(t,x) = 0.1664t^2 - 0.6558t + 1.5543x^2 + 0.6664 . \nonumber \end{multline} \begin{figure} \centering \includegraphics[scale=.46]{safecontrol.eps}\\ \caption{The boundary of the unsafe set $x=10$ (red line), the data points $\{x(t_i)\}_{i=1}^{20}$ (black circles), and the solution of the system (solid blue). The safe controller starts operating at $t=3$.}\label{L2ddcurve} \end{figure} \subsection{Example II: Aircraft Landing} \begin{figure} \centering \includegraphics[scale=.4]{plane.png}\\ \caption{Point mass force diagram for the longitudinal dynamics of the aircraft~\cite[p. 108]{viabbookbayern}. }\label{figplane} \end{figure} We consider a point mass longitudinal model of an aircraft subject to the gravity force $mg$ with $m$ being the mass and $g=9.8 ms^{-2}$, thrust $T$ , lift $L$ and drag $D$ (see Figure~\ref{figplane}). The equations of motion are then described by \begin{eqnarray}\label{eq:aircraft} \dot{V} &=& \frac{1}{m} \left[ T\cos(\alpha) - D(\alpha,V)-mg\sin(\gamma) \right], \nonumber \\ \dot{\gamma} &=& \frac{1}{mV} \left[ T\sin(\alpha) +L(\alpha,V)-mg\cos(\gamma) \right], \nonumber \\ \dot{z} &=& V\sin(\gamma), \end{eqnarray} where $V$ the velocity, $\gamma$ the flight path angle and $z$ the altitude are the states of the system. The angle of attack $\alpha$ and thrust $T$ are the inputs of the system. Typically, landing is operated at $T_{idle} = 0.2 T_{max}$ where $T_{max}$ is the maximal thrust. This value enables the aircraft to counteract the drag due to flaps, slats and landing gear. Most of the parameters for the DC9-30 can be found in the literature. The values of the numerical parameters used for the DC9-30 in this flight configuration are $m = 60, 000~(kg)$, and $T_{max} = 160, 000~(N)$. The lift and drag forces are thus \begin{eqnarray} L(\alpha, V ) &=& 68.6 (1.25 + 4.2\alpha)V^2, \nonumber \\ D(\alpha, V ) &=& \left[2.7+3.08 (1.25 + 4.2\alpha)^2\right]V^2, \end{eqnarray} both in Newtons. For safety analysis and controller synthesis, we consider two separate aircraft failure scenarios in which the aircraft model~\eqref{eq:aircraft} is not valid anymore and we use data-driven differential inclusion models instead. In both cases, we are interested in the safe landing speed of the aircraft $V_{safe}$ as it reaches the ground $z=0$. Therefore, we define the unsafe set as $$ \mathcal{X}_u = \left\{ (V,\gamma,z) \mid V > V_{safe},~z=0 \right\}. $$ We consider the following regularity side information $$ \| x\|_{\mathcal{C}^1} \le 10,\quad |\dot{X}(t) - \dot{x}(t) | \le 10. $$ In the first scenario, we model wing failure by sudden drop in the lift force $L$ to $0.2L$ at $t=0.5(s)$. We collect $25$ data samples until $t=2(s)$ and we are interested in checking whether the aircraft satisfies the safe landing speed at the time of landing. Using Lemma~\ref{lem1}, we found a barrier certificate of degree $5$ proving that the system is safe. Figure~\ref{L2curve2cxcxcxc} illustrates the collected data, the actual system state evolution and the solutions of the data-driven differential inclusion given the side information. \begin{figure} \centering \includegraphics[scale=.39]{landingsafe2222.eps}\\ \caption{The data points $\{x(t_i)\}_{i=1}^{25}$ (black circles), the piecewise-polynomial approximation of the state $X(t)$ (black line), the solution set of the data-driven differential inclusion (the meshed cone) and the actual solution of the system (green). }\label{L2curve2cxcxcxc} \end{figure} \begin{figure} \centering \includegraphics[scale=.45]{unsafeplane.eps}\\ \caption{The solution of the plane system (blue) and the unsafe set (red surface). }\label{L2curve2cxcxcxc2} \end{figure} In the second scenario, we consider an engine control failure which is modeled as a sudden surge in thrust (to $0.8T_{max}$ from $0.2T_{max}$) at $t=0.5(s)$. 25 data samples are collected non-uniformly until $t=2(s)$. The simulation results show that the system trajectories without the controller are not safe as shown on Figure~\ref{L2curve2cxcxcxc2}. A data-driven differential inclusion is constructed using the side information and piecewise polynomial interpolation. We then allow $T_g=5(s)$ to calculate the safe controller using Lemma~\ref{lem5651}. Figure~\ref{L2curve2cxdddcxcxc2} shows the result of applying the safe controller obtained based on Lemma 2 with certificates $B$ and $W$ of degree $3$. Hence, the safe controller is able to ensure safe landing despite the critical failure of the aircraft. \begin{figure} \centering \includegraphics[scale=.45]{planesafecontrol.eps}\\ \caption{The solution of the data driven differential inclusion system (meshed surface), data points (black circles) and the unsafe set (red surface). Note that, as the safe controller kicks in, the state evolution of the system becomes~safe.}\label{L2curve2cxdddcxcxc2} \end{figure} \section{CONCLUSIONS AND FUTURE WORK} \label{sec:conclusions} \subsection{Conclusions} We considered the problem of safety analysis and controller synthesis for safety of systems for which only limited data and some regularity side information on system states are available. We reformulated the problem into safety analysis and safe controller synthesis of differential inclusions. We proposed a solution established upon an extension of barrier certificates for differential inclusions. In the case of piecewise-polynomial approximations of data, we showed that the barrier certificates can be found by polynomial optimization. Two examples were used to illustrate the proposed approach. \subsection{Future Work} In this study, we assumed the measurements of the states are not noisy. In many practical situations, this is not the case and sensor measurements are subject to measurement noise, say due to heat. In this setting, safety analysis requires side information in the probabilistic sense. In this respect, one can use notions such as spline smoothing~\cite{cite-keycdfd}. The application of the proposed safety analysis results in this paper are not only limited to data-driven differential inclusions but also the discussions in Section~\ref{sec:ddss|} can be used to tackle safety analysis of discontinuous and hybrid systems, such as mechanical system with impact and Columb friction~\cite{posa2016stability}.
\section{Introduction} The primary purpose of relativistic heavy-ion collisions at the Relativistic Heavy Ion Collider (RHIC) is to create the QCD matter under high temperature and high density - Quark-Gluon Plasma (QGP), and study its properties. Due to their large masses, heavy quarks are produced on a short time scale in hard partonic scatterings during the early stages of the nucleus-nucleus collisions and the probability of thermal production in the QGP phase is expected to be small. Therefore, they are considered a good probe for studying the QGP. Among all the open charm mesons, the charm-strange meson, D$_{\rm_{S}}$, is particularly sensitive to the charm quark hadronization in the hot nuclear medium because of its unique valence quark composition. Theoretical calculations predict that the production of D$_{\rm_{S}}$ can be influenced by the charm-quark recombination with strange quarks whose production is enhanced in the deconfined matter~\cite{rapp}. Like multi-strange hadrons, D$_{\rm_{S}}$ mesons have smaller hadronic interaction cross-sections compared to the non-strange D mesons and are expected to freeze out early. Therefore, the elliptic flow ($v_{2}$) of D$_{\rm_{S}}$ is considered a better measure of the partonic contribution to the charm hadron $v_{2}$ than that of D$^{0}$ or D$^{\pm}$. The Heavy Flavor Tracker (HFT) at STAR provides an opportunity for D$_{\rm_{S}}$ measurements by reconstructing displaced decay vertices. \section{Data set and analysis details} The results presented here are based on an analysis of about 900 million minimum bias events taken during the 2014 Au+Au run at $\sqrt{s_{\rm{NN}}}$ = 200 GeV. The Time Projection Chamber (TPC) and the Time-of-Flight (TOF) detectors, both with full azimuthal coverage, are used for particle identification in the central rapidity (y) region ($|$y$|$ $<$ 1.0). The HFT detector is used to reconstruct the decay vertices. It is made of three layers, named as PiXeL detector (PXL), Intermediate Silicon Tracker (IST) and Silicon Strip Detector (SSD). A state-of-the-art thin Monolithic Active Pixel Sensors (MAPS) technology has been used in the PXL. There are two layers of the MAPS in the PXL, which are placed at radii of 2.8 and 8 cm from the centre of the beam pipe, respectively. The track pointing resolution of the HFT detector is about 46 $\mu$m for 750 MeV/c kaons. We reconstruct D$_{\rm_{S}}$ through the decay channel, D$_{\rm_{S}}$$^{\pm}$ $\longrightarrow$ $\phi$ ($\phi$ $\longrightarrow$ $\it{K}^{+}$ + $\it{K}^{-}$) + $\pi^{\pm}$. Topological and kinematic cuts are applied to reduce the combinatorial background. The wrong-sign method is used to estimate the combinatorial background. A first order polynomial function is then used to describe the residual background and a Gaussian function for the signal peak after subtraction of the combinatorial background, as shown in Fig.~\ref{sig_08}. \\ \begin{figure}[!ht] \begin{center} \begin{overpic}[scale=0.45]{ds_sig.eps} \end{overpic} \caption{(Color online) The invariant mass distributions of $K^{+}K^{-}\pi$ triplets from Au+Au collisions at \mbox{$\sqrt{s_{\rm{NN}}}$ = 200 GeV} for 0-80$\%$ centrality, 2.5 $<$ $p_{T}$ $<$ 8.0 GeV/$c$. } \label{sig_08} \end{center} \end{figure} \section{Results} The nuclear modification factors (R$_{\rm{AA}}$) of D$_{\rm_{S}}$, as a function of transverse momentum ($p_{ T}$), for the 0-10$\%$ and 10-40$\%$ most central Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV are shown in Fig.~\ref{raa}. The cap symbols are the systematic uncertainties and statistical uncertainties are shown by vertical lines. The systematic uncertainties have been evaluated by using different approaches for background subtraction and by varying topological cuts. To obtain the R$_{\rm{AA}}$, the charm quark production cross-section measured in p+p collisions by the STAR experiment~\cite{stard0pp} is used together a fragmentation factor f$_{frag}$($c$ $\longrightarrow$ D$_{\rm_{S}}$) = 0.079 $\pm$ 0.004~\cite{ctods}. A Levy fit function is used to obtain the D$_{\rm_{S}}$ yield in p+p collisions at corresponding measured $p_{T}$ in the Au+Au collisions. Shaded grey bands represent combined statistical and systematic uncertainties from the p+p reference. The R$_{\rm{AA}}$ of K$^{0}_{\rm_{S}}$ are also shown in Fig.~\ref{raa} for 0-12$\%$ Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV~\cite{k0sraa}. The D$_{\rm_{S}}$ R$_{\rm{AA}}$ is found to be systematically higher than those of K$^{0}_{S}$. The R$_{\rm{AA}}$ of D$_{\rm_{S}}$ is consistent with unity at low $p_{T}$ (2.5 <$p_{T}$ < 4 .0 GeV/c) within large uncertainties. There is an indication of a suppression of high $p_{T}$ (> 5 GeV/c) D$_{\rm_{S}}$ w.r.t the p+p reference. \\ \begin{figure}[!ht] \begin{center} \begin{overpic}[scale=0.45]{dsraa_comp_k0s.eps} \end{overpic} \caption{(Color online) The R$_{\rm{AA}}$ of D$_{\rm_{S}}$ for 0-10$\%$ and 10-40$\%$ central Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV. Cap symbols are systematic uncertainties and statistical uncertainties are shown by vertical lines. The R$_{\rm{AA}}$ of K$^{0}_{\rm_{S}}$ are shown as black stars for 0-12$\%$ Au+Au collisions.} \label{raa} \end{center} \end{figure} The ratio of D$_{\rm_{S}}$/D$^{0}$ yields, as a function of $p_{T}$, is shown in Fig.~\ref{ds_d0_ratio}. To compare with the D$_{\rm_{S}}$/D$^{0}$ ratio in p+p collisions, we have used the result from the PYTHIA 6.4 Monte Carlo generator~\cite{pythia}, which is shown as a magenta band. The model prediction for Au+Au collisions by the TAMU group is also shown by the red band~\cite{rapp}. A substantial enhancement in the D$_{\rm_{S}}$/D$^{0}$ ratio in Au+Au collisions w.r.t. the fragmentation baseline (as well as PYTHIA model) is observed. The TAMU model calculation~\cite{rapp} based on charm quark recombination with enhanced strange quarks also under-predicts data. We have also compared our results with the ALICE measurement in Pb+Pb collisions at 5.02 TeV~\cite{alice_ds}, as shown in the right panel of Fig.~\ref{ds_d0_ratio}. The STAR and ALICE results are comparable in the overlapping $p_{T}$ range. \\ \begin{figure}[!ht] \begin{center} \begin{overpic}[scale=0.36]{Ds_over_D0_ratio_TAMU.pdf} \end{overpic} \begin{overpic}[scale=0.39]{Ds_by_d0_alice.pdf} \end{overpic} \caption{(Color online) The ratio of D$_{\rm_{S}}$/D$^{0}$ yields as a function of $p_{T}$ in Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ =200 GeV. Yellow band corresponds to the fragmentation baseline. The magenta and red bands (left panel) represent the PYTHIA prediction and TAMU model calculation~\cite{rapp}, respectively. Results from the ALICE collaboration for Pb+Pb collisions at $\sqrt{s_{\rm{NN}}}$ = 5.02 TeV are also shown (right panel). Cap symbols are systematic uncertainties and statistical uncertainties are shown by vertical lines. } \label{ds_d0_ratio} \end{center} \end{figure} The elliptic flow ($v_{2}$), a measure of the anisotropy in the momentum space, can be used to probe the dynamics of early stages of heavy-ion collisions~\cite{v2intro}. The measured D$_{\rm_{S}}$ $v_{2}$, as a function of $p_{T}$, in Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV is shown in Fig.~\ref{ds_d0_v2}. These results are obtained by using the event plane method~\cite{v2method,D0v2}. The left panel of Fig.~\ref{ds_d0_v2} shows that the D$_{\rm_{S}}$ $v_{2}$ is non-zero and its magnitude is comparable to the D$^{0}$ $v_{2}$,~\cite{D0v2}. However, the statistical uncertainties are still large. The right panel of Fig.~\ref{ds_d0_v2} shows a comparison of the D$_{\rm_{S}}$ $v_{2}$ with available model predictions~\cite{rapp,AMPTDsv2}. Both the AMPT and TAMU models are in agreement with the data within 1$\sigma$ confidence intervals. In the AMPT model calculation, partonic interactions generate $v_{2}$ and hadronization is done via Dynamic Coalescence Model~\cite{AMPTDsv2}, whereas coupling of the charm quarks to the QGP medium and their subsequent recombination with equilibrated strange quarks give rise to the $v_{2}$ of D$_{\rm_{S}}$ in the TAMU model~\cite{rapp}. \begin{figure}[!ht] \begin{center} \begin{overpic}[scale=0.37]{Ds_D0_v2_new.pdf} \end{overpic} \begin{overpic}[scale=0.37]{dv2_model.pdf} \end{overpic} \caption{(Color online) D$_{\rm_{S}}$ $v_{2}$ as a function of $p_{T}$ in 10-40$\%$ Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV. The cap symbols are systematic uncertainties and statistical uncertainties are shown by vertical lines. Grey bands represent non-flow contribution. } \label{ds_d0_v2} \end{center} \end{figure} \section{Summary} In summary, we present the nuclear modification factors of D$_{\rm_{S}}$, D$_{\rm_{S}}$/D$^{0}$ ratio and elliptic flow of D$_{\rm_{S}}$ as a function of transverse momentum in Au+Au collisions at $\sqrt{s_{\rm{NN}}}$ = 200 GeV using the data collected by the STAR experiment in year 2014. The R$_{\rm{AA}}$ of D$_{\rm_{S}}$ in 0-10$\%$ and 10-40$\%$ Au+Au collisions are consistent with unity at low $p_{T}$ (2.5 <$p_{T}$ < 4 .0 GeV/c) with large uncertainties and there is an indication of a suppression of high $p_{T}$ (> 5 GeV/c) D$_{\rm_{S}}$. Production of the light strange K$^{0}_{\rm_{S}}$ meson is found to be more suppressed compared to that of the heavy D$_{\rm_{S}}$ meson. We have observed a strong enhancement in the D$_{\rm_{S}}$/D$^{0}$ ratio in Au+Au collisions with respect to that in p+p baseline. This may indicate that coalescence plays an important role for charm quark hadronization in the QGP. The elliptic flow of the D$_{\rm_{S}}$ meson is measured in Au+Au collisions (10-40$\%$) at $\sqrt{s_{\rm{NN}}}$ = 200 GeV and is found to be comparable to the D$^{0}$ $v_{2}$ within large uncertainties.
\section{Introduction} \label{sect:sect_intro} While the classical notion of delay is a measure of how long a packet spends in transit, the \lq Age of Information\rq\ (\cite{KaulYatesGruteser-2012Infocom}) is a receiver-centric notion that measures how fresh the data is at the receiver. Specifically, with $u(t)$ denoting the generation time of the last successfully received packet before time $t$, one defines $\Delta(t) = t-u(t)$ as the instantaneous age of the information at the receiver at time $t$. One can then consider \begin{equation} \label{eq:eq_age_definition} \Delta = \lim_{\tau\to\infty} \frac{1}{\tau}\int_0^\tau \Delta(t)\mathrm{d}t, \end{equation} as the (time) average age. Observe that $\Delta(t)$ increases linearly in the intervals between packet receptions, and when a packet is received, $\Delta(t)$ jumps down to the delay experienced by this packet. This results in a sawtooth sample path as in Fig.~\ref{fig1}. In \cite{KaulYatesGruteser-2012Infocom,2012CISS-KaulYatesGruteser,CostaCodreanuEphremides2014ISIT, KamKompellaEphremides2013ISIT,NajmNasser-ISIT2016,YatesKaul-2012ISIT} the properties of $\Delta$ were investigated under the assumption that the packets are generated by a Poisson process, and various transmission policies (M/M/1, M/M/$\infty$, gamma service time,\dots). A related metric, called average peak age, was introduced in \cite{CostaCodreanuEphremides2014ISIT} as the average of the value of the instantaneous age $\Delta(t)$ at times just before its downward jumps. In Fig.~\ref{fig1}, $K_j$ denotes the instantaneous age just before the reception of the $j^{th}$ successfully transmitted packet, and hence, the average peak age is given by \begin{equation} \label{eq:eq_avg_peak_age_def} \Delta_{peak} = \lim_{N\to\infty}\frac{1}{N}\sum_{j=1}^N K_j. \end{equation} The authors in \cite{YatesKaul-2016arxiv} studied the average age when considering multiple sources sending update through one queue. They computed the average age for three scenarios: all sources transmit according to an M/M/1 FCFS policy, all sources transmit according to an M/M/1/1 with preemption policy and all sources transmit according to an M/M/1/1 with preemption in waiting policy. In the M/M/1/1 with preemption policy, if a newly generated update finds the system busy, the transmitter preempts the one currently in service and starts sending the new packet. On the other hand, in the M/M/1/1 with preemption in waiting policy, the system has a buffer of size 1 and if the generated update finds the system busy, it replaces any waiting update in the buffer. In \cite{HuangModiano2015ISIT}, the authors also consider multiple sources transmitting through a single queue but in this case they assume a generally distributed service time. Moreover, they study two scenarios: all sources transmit according to an M/G/1 FCFS policy or all sources transmit according to an M/G/1/1 with blocking policy. For each one of these policies, the authors give the expression of the average peak age relative to each source. In this paper, we assume updates are generated according to a Poisson process with rate $\lambda$, and that the updates belong to two different streams where each stream $i$ is chosen independently with probability $p_i$, $i=1,2$. So we have two independent Poisson streams with rates $\lambda_1=\lambda p_1$ and $\lambda_2 = \lambda p_2$. However, unlike \cite{YatesKaul-2016arxiv} and \cite{HuangModiano2015ISIT}, we assume a different transmission policy for each stream. To the best of our knowledge, this model was not studied before although it models a natural scenario. In fact, the two independent streams generated by the source can be used to model different types of content carried by the packets of each stream. For example, if the source is a sensor, one stream could carry emergency messages (fire alarm, high pressure, etc.) and thus it needs to be always as fresh as possible while the other stream will carry regular updates and hence is not age sensitive. Therefore, it stands to reason to transmit these two streams in a different manner. The regular stream will be transmitted according to a FCFS policy while the high priority stream will be sent by preemption, packets of the high priority stream preempt all packets including packets of their own stream. We will further assume that the service times requirements of the two streams may be different; a packet of the regular stream will be served at rate $\mu_1$, a packet of the priority scheme at rate $\mu_2$. We will study the above model and answer the questions: what should the relation between $\lambda_1$, $\mu_1$, $\lambda_2$ and $\mu_2$ be for the system to be stable? How does each stream affects the average age of the other one? What are the ages of each stream? To answer these questions, we will give a necessary and sufficient condition for the system stability, find the steady-state distribution of the underlying state-space, and give closed form expressions for the average peak age and a lower bound on the average age of the regular stream and compare them to the average age of the high priority stream. This paper is structured as follows: in Section~\ref{sec:sec_system_model}, we start by defining the model and the different variables needed in our study. In Section~\ref{sec:sec_stab_system} we derive the stability condition of the system and its stationary distribution. The closed form expressions of the average peak age and the lower bound on the average age of the regular stream are computed in Section~\ref{sec:sec_ages_stream_1_2}. Finally, in Section~\ref{sec:sec_numerical_results} we present numerical results of our results. \section{System Model} \label{sec:sec_system_model} We consider a source that generates packets (or updates) according to a Poisson process of rate $\lambda$. Each packet, independently of the previous packets, is of type $1$ with probability $p_1$ and of type $2$ with probability $p_2=1-p_1$. We can thus see our source as generating two independent Poisson streams $\mathcal{U}_1$ and $\mathcal{U}_2$ with rates $\lambda_1=\lambda p_1$ and $\lambda_2=\lambda p_2$ respectively, $\lambda=\lambda_1+\lambda_2$ (see \cite{ross}). As noted in the introduction, the different streams can be used to model packets of different types of content, for example, emergency messages, alerts, error messages, warnings, notices, etc. We also assume that the updates are sent through a single server (or transmitter) queue to a monitor. The service time of each packet is considered to be exponentially distributed with rate $\mu_1$ for stream $\mathcal{U}_1$ and rate $\mu_2$ for stream $\mathcal{U}_2$. The difference in service rates between the two streams is to account for the possible difference in compression, packet length, etc., between the two streams. Given this model, we impose on the transmitter that all packets from stream $\mathcal{U}_1$ should be sent. Hence the server applies a FCFS policy on the packets from stream $\mathcal{U}_1$ with a buffer to save waiting updates. On the other hand, we assume that the information carried by stream $\mathcal{U}_2$ is more time sensitive (or has higher priority) and thus we aim at minimizing its average age. To this end, the transmitter is allowed to perform packet management: in this case we assume the server applies a preemption policy whenever a packet from $\mathcal{U}_2$ is generated. This means that if a newly generated packet from stream $\mathcal{U}_2$ finds the system busy (serving a packet from $\mathcal{U}_1$ or $\mathcal{U}_2$), the server preempts the update currently in service and starts serving the new packet. Moreover, if the preempted packet belongs to $\mathcal{U}_1$, this packet is placed back at the head of the $\mathcal{U}_1$-buffer so that it can be served once the system is idle again. If the preempted packet belongs to $\mathcal{U}_2$ then it is discarded. However, if a newly generated $\mathcal{U}_1$-packet finds the system busy serving a $\mathcal{U}_2$-packet, it is placed in the buffer and served when the system becomes idle. This choice of policy for the age sensitive stream is motivated by the conclusion reached in \cite{BedewySunShroff17} that for exponentially distributed packet transmission times, the M/M/1/1 with preemption policy is the optimal policy among causal policies. These ideas are illustrated in part in Fig.~\ref{fig1} which also shows the variation of the instantaneous age of stream $\mathcal{U}_1$. In this plot, $t_i$ and $D_i$ refer to the generation and delivery times of the $i^{th}$ packet of stream $\mathcal{U}_1$ while $t'_i$ and $D'_i$ are the start and end times of the $i^{th}$ period during which the system is busy serving packets from stream $\mathcal{U}_2$ only. \begin{figure}[!t] \centering \begin{tikzpicture}[scale=0.8,font=\scriptsize] \draw (0,0) -- (9.1,0); \draw (9.1,3pt) -- (9.1,-3pt); \draw (9.3,3pt) -- (9.3,-3pt); \draw[->] (9.3,0) -- (10,0)node[anchor=north] {$t$}; \draw (0,0) node[anchor=north] {0}; \draw[color=blue] (1,1pt) -- (1,-3pt) node[anchor=north] {{$t_1$}}; \draw[color=red] (1.5,1pt) -- (1.5,-3pt) node[anchor=north] {$D_1$}; \draw[color=blue] (2,1pt) -- (2,-3pt) node[anchor=north] {$t_2$}; \draw (2.7,3pt) -- (2.7,-3pt) node[anchor=north] {$t'_1$}; \draw[color=blue] (3.5,1pt) -- (3.5,-3pt) node[anchor=north] {$t_3$}; \draw (4,3pt) -- (4,-3pt) node[anchor=north] {$D'_1$}; \draw[color=red] (4.5,1pt) -- (4.5,-3pt) node[anchor=north] {$D_2$}; \draw (5,3pt) -- (5,-3pt) node[anchor=north] {$t'_2$}; \draw (5.4,3pt) -- (5.4,-3pt) node[anchor=north] {$D'_2$}; \draw (5.8,3pt) -- (5.8,-3pt) node[anchor=north] {$t'_3$}; \draw (6.3,3pt) -- (6.3,-3pt) node[anchor=north] {$D'_3$}; \draw[color=red] (6.8,1pt) -- (6.8,-3pt) node[anchor=north] {$D_3$}; \draw (7.3,3pt) -- (7.3,-3pt) node[anchor=north] {$t'_4$}; \draw[color=blue] (7.6,1pt) -- (7.6,-3pt) node[anchor=north] {$t_4$}; \draw (8.1,3pt) -- (8.1,-3pt) node[anchor=north] {$D'_4$}; \draw[color=red] (8.6,1pt) -- (8.6,-3pt) node[anchor=north] {$D_4$}; \draw[->] (0,0) -- (0,5) node[anchor=south] {$\Delta(t)$}; \draw[thick] (0,0.5) -- (1.5,2) -- (1.5,0.5); \draw[dotted, color=blue] (1,0) -- (1.5,0.5); \draw[dotted, color=red] (1.5,0.5) -- (1.5,0); \draw (0,0.5) node[anchor=east] {$\Delta_0$}; \draw (1.5,2) node[anchor=south] {$K_1$}; \draw (1,0.5) node[anchor=south] {$Q_1$}; \draw[thick] (1.5,0.5) -- (4.5,3.5) -- (4.5,2.5); \draw[dotted, color=blue] (2,0) -- (4.5,2.5); \draw[dotted, color=red] (4.5,2.5) -- (4.5,0); \draw (4.5,3.5) node[anchor=south] {$K_2$}; \draw (3,1.3) node[anchor=south] {$Q_2$}; \draw[thick] (4.5,2.5) -- (6.8,4.8) -- (6.8,3.3); \draw[dotted, color=blue] (3.5,0) -- (6.8,3.3); \draw[dotted, color=red] (6.8,3.3) -- (6.8,0); \draw (6.8,4.8) node[anchor=south] {$K_3$}; \draw (6,3.2) node[anchor=south] {$Q_3$}; \draw[thick] (6.8,3.3) -- (8.6,5.1) -- (8.6,1); \draw[dotted, color=blue] (7.6,0) -- (8.6,1); \draw[dotted, color=red] (8.6,1) -- (8.6,0); \draw (8.6,5.1) node[anchor=south] {$K_4$}; \draw (8.1,3) node[anchor=south] {$Q_4$}; \draw[thick] (8.6,1) -- (9.1,1.5); \draw[dotted, thick] (9.1,1.5)--(9.6,2); \draw[<->] (2.7,-1) -- (4,-1); \draw[<->] (5,-1) -- (5.4,-1); \draw[<->] (5.8,-1) -- (6.3,-1); \draw[<->] (7.3,-1) -- (8.1,-1); \draw[dotted] (2.7,-1) -- (2.7,0); \draw[dotted] (4,-1) -- (4,0); \draw[dotted] (5,-1) -- (5,0); \draw[dotted] (5.4,-1) -- (5.4,0); \draw[dotted] (5.8,-1) -- (5.8,0); \draw[dotted] (6.3,-1) -- (6.3,0); \draw[dotted] (7.3,-1) -- (7.3,0); \draw[dotted] (8.1,-1) -- (8.1,0); \draw (3.35,-1)--(5.4,-1.6); \draw (5.2,-1)--(5.4,-1.6); \draw (6.05,-1)--(5.4,-1.6); \draw (7.7,-1)--(5.4,-1.6) node[anchor=north] {System busy serving stream $\mathcal{U}_2$}; \draw[<->, color=red] (3.5,0.3) -- (6.8,0.3); \draw[color=red] (5.15,0.3) node[anchor=center, fill=white] {$T_3$}; \draw[<->, color=red] (7.6,0.7) -- (8.6,0.7); \draw[color=red] (8.1,0.7) node[anchor=center, fill=white] {$T_4$}; \draw[<->, color=blue] (3.5,0.3) -- (2,0.3); \draw[color=blue] (2.75,0.3) node[anchor=center, fill=white] {$X_3$}; \draw[<->, color=blue] (7.6,0.7) -- (3.5,0.7); \draw[color=blue] (5.55,0.7) node[anchor=center, fill=white] {$X_4$}; \draw[<->] (4.5,1.2) -- (6.8,1.2); \draw (5.65,1.2) node[anchor=center, fill=white] {$Z_3$}; \draw[<->] (7.6,1.2) -- (8.6,1.2); \draw (8.1,1.2) node[anchor=center, fill=white] {$Z_4$}; \end{tikzpicture} \caption{Variation of the instantaneous age of stream $\mathcal{U}_1$.} \label{fig1} \end{figure} \section{System Stability and stationary distribution} \label{sec:sec_stab_system} The fact that we wish to receive all of stream $\mathcal{U}_1$ updates and that stream $\mathcal{U}_2$ has higher priority and preempts stream $\mathcal{U}_1$ might lead to an unstable system. In order to derive the necessary and sufficient condition for the stability of the system we study the Markov chain of the number of packets in the system (in service and waiting) shown in Fig.~\ref{fig:fig_sys_mc}. In this chain, $q_0$ is the idle state where the system is completely empty. States $q_i$, $i>0$, in the upper row refer to states where the queue is serving a packet from stream $\mathcal{U}_1$ while states $q'_i$, $i>0$, in the row below correspond to the queue serving a packet from stream $\mathcal{U}_2$. In both cases there are $i-1$ stream $\mathcal{U}_1$ updates waiting in the buffer. The system leaves state $q_0$ at rate $\lambda_1$ to state $q_1$ when a packet from stream $\mathcal{U}_1$ is generated first and it leaves $q_0$ at rate $\lambda_2$ to state $q'_1$ when a packet from stream $\mathcal{U}_2$ is generated first. However, when the system enters state $q_i$, $i>0$, three exponential clocks start: a clock with rate $\mu_1$ which corresponds to the service time of the stream $\mathcal{U}_1$ packet being served, a clock with rate $\lambda_1$ which corresponds to the generation time of stream $\mathcal{U}_1$ packets and a clock with rate $\lambda_2$ which corresponds to the generation time of stream $\mathcal{U}_2$ packets. If the $\mu_1$-clock ticks first, the system goes to state $q_{i-1}$: this means that the current stream $\mathcal{U}_1$ packet was delivered and the queue begins the service of the next one in the buffer (if there is any). However, if the $\lambda_1$-clock ticks first, a new stream $\mathcal{U}_1$ update is generated and added to the buffer and hence the system goes to state $q_{i+1}$. On the other hand, if the $\lambda_2$-clock ticks first, the system preempts the packet currently in service and places it back at the head of the buffer and starts the service of the newly generated stream $\mathcal{U}_2$ update. Thus the system goes to state $q'_{i+1}$. When the system enters a state $q'_i$, $i>0$, two exponential clocks start: the clock with rate $\lambda_1$ and a clock with rate $\mu_2$ which corresponds to the service time of a stream $\mathcal{U}_2$ packet. If the $\lambda_1$-clock ticks first, the newly generated stream $\mathcal{U}_1$ packet is placed in the buffer and the stream $\mathcal{U}_2$ update is continued to be served. Hence the system goes to state $q'_{i+1}$. However, if the $\mu_2$-clock ticks first, the stream $\mathcal{U}_2$ packet has finished service and the system starts serving the first stream $\mathcal{U}_1$ packet in the buffer (if there is any). Thus the system goes to state $q_{i-1}$. \begin{figure}[!t] \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2.4cm, semithick] \tikzstyle{every state}=[fill=red,draw=none,text=white] \node[state] (A) {$q_0$}; \node[state] (B) [right of=A] {$q_1$}; \node[state] (C) [right of=B] {$q_2$}; \node[state] (D) [right of=C] {$q_3$}; \node[state,fill=white] (E) at (8.5,0) {}; \node[state] (A') [below of=A] {$q'_1$}; \node[state] (B') [below of=B] {$q'_2$}; \node[state] (C') [below of=C] {$q'_3$}; \node[state] (D') [below of=D] {$q'_4$}; \node[state,fill=white] (E') [below of=E] {}; \path [->] (A) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (B); \path [->] (A) edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\lambda_2$} (A'); \draw [->] (B) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\mu_1$} (A); \path [->] (B) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (C); \path [->] (B) edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\lambda_2$} (B'); \draw [->] (C) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\mu_1$} (B); \path [->] (C) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (D); \path [->] (C) edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\lambda_2$} (C'); \draw [->] (D) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\mu_1$} (C); \path [-] (D) edge [bend left] node {} (E); \path [->] (D) edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\lambda_2$} (D'); \path [->] (E) edge [bend left] node {} (D); \path [->] (A') edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (B'); \path [->] (A') edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\mu_2$} (A); \path [->] (B') edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (C'); \path [->] (B') edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\mu_2$} (B); \path [->] (C') edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$\lambda_1$} (D'); \path [->] (C') edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\mu_2$} (C); \path [->] (D') edge [bend right] node[ fill=white, anchor=center, pos=0.5] {$\mu_2$} (D); \path [-] (D') edge [bend left] node {} (E'); \end{tikzpicture} \caption{Markov chain governing the number of packets in the system.} \label{fig:fig_sys_mc} \end{figure} This next theorem gives the necessary and sufficient condition for the above system to be stable as well as its stationary distribution. \begin{thm} \label{thm:thm_stat_dist} The system described in Section~\ref{sec:sec_system_model} is stable, i.e. the average number of packets in the queue is finite, if and only if \begin{equation} \label{eq:eq_stab_condition} \mu_1 > \lambda_1\left( 1+\frac{\lambda_2}{\mu_2}\right). \end{equation} In this case the Markov chain shown in Fig.~\ref{fig:fig_sys_mc} has a stationary distribution $\Pi=[\pi_0, \pi_1,\dots,\pi_i,\dots,\pi'_1,\dots,\pi'_i,\dots]$, where $\pi_i$ denotes the stationary probability of state $q_i$, $i\geq 0$, and $\pi'_i$ denotes the stationary probability of state $q'_i$, $i>0$. This stationary distribution is described by the following system of equations, \begin{align} \pi_0 & = \frac{\mu_2}{\mu_2+\lambda_2}-\frac{\lambda_1}{\mu_1}, \label{eq:eq_po}\\ \begin{bmatrix} \pi_i\\ \pi'_i \end{bmatrix} &= \begin{bmatrix}\mathbf{\large{0}} & \mathbf{I}_2\end{bmatrix}\mathbf{H}^i\begin{bmatrix} \frac{\lambda}{\mu_1}-\frac{\mu_2\lambda_2}{\mu_1\left(\lambda_1+\mu_2\right)}\\ \frac{\lambda_2}{\lambda_1+\mu_2}\\ 1\\ 0 \end{bmatrix}\pi_0,\ i\geq1 \label{eq:eq_stat_prob} \end{align} where $\lambda=\lambda_1+\lambda_2$, $ \mathbf{H} = \begin{bmatrix} \mathbf{C} & \mathbf{D}\\ \mathbf{I}_2 & \mathbf{\large{0}} \end{bmatrix}$, \begin{align*} &\mathbf{C} = \begin{bmatrix} 1+\frac{\lambda}{\mu_1}-\frac{\mu_2\lambda_2}{\mu_1\left(\mu_2+\lambda_1\right)} & -\frac{\mu_2\lambda_1}{\mu_1\left(\mu_2+\lambda_1\right)}\\ \frac{\lambda_2}{\mu_2+\lambda_1} & \frac{\lambda_1}{\mu_2+\lambda_1} \end{bmatrix}, \mathbf{D} = \begin{bmatrix} -\frac{\lambda_1}{\mu_1} & 0\\ 0 & 0 \end{bmatrix}. \end{align*} $\mathbf{I}_2$ is the $2\times2$ identity matrix and $\mathbf{\large{0}}$ is the $2\times2$ zero matrix. \end{thm} \begin{corollary} \label{cor:cor_exp_value} If we define $N(t)$ to be the number of stream $\mathcal{U}_1$ packets in the system at time $t$, then its moment generating function is $\phi_{N(t)}$ \begin{scriptsize}\begin{equation} \label{eq:eq_mgf_stream_1} \phi_{N(t)}(s) = \frac{\pi_0\mu_1\left(\lambda_1+\lambda_2+\mu_2-\lambda_1 e^s\right)}{\mu_1\mu_2+\mu_1\lambda_1-e^s\left(\lambda_1^2+\lambda_1\lambda_2+\lambda_1\mu_1+\lambda_1\mu_2\right)+\lambda_1^2e^{2s}}, \end{equation}\end{scriptsize} where $\pi_0$ is given by \eqref{eq:eq_po}. Particularly, the expected value of $N(t)$ is \begin{equation} \label{eq:eq_exp_stream_1} \mathbb{E}\left( N(t)\right) = \frac{\lambda_1\left( 2\lambda_2\mu_2+\lambda_2\mu_1+\lambda_2^2+\mu_2^2\right)}{\left( \mu_2+\lambda_2\right)\left( \mu_1\mu_2-\lambda_1\left( \mu_2+\lambda_2\right)\rp}. \end{equation} \end{corollary} \begin{proof} The distribution given by \eqref{eq:eq_po} and \eqref{eq:eq_stat_prob} satisfy the detailed balance equations of the Markov chain shown in Fig.~\ref{fig:fig_sys_mc}. Moreover, \eqref{eq:eq_stab_condition} is the condition needed to have $\pi_0>0$. As for the expression for $\phi_{N(t)}(s)$, it is a consequence of \eqref{eq:eq_po} and \eqref{eq:eq_stat_prob}. The appendix presents a full technical version of the proof for Theorem~\ref{thm:thm_stat_dist} and Corollary~\ref{cor:cor_exp_value}. \end{proof} The condition in \eqref{eq:eq_stab_condition} can be interpreted as follows: define the map $f$ from the state-space of the chain as $f(s) = 0$ if $s$ is in $\{q_0,q_1,\dots\}$ and $f(s)=1$ if $s\in\{q_1',q_2',\dots\}$. For each $s$ and $s'$ for which $f(s)=0$ and $f(s')=1$ the transition rate from $s$ to $s'$ is the same $(\lambda_2)$ and similarly for $s$ and $s'$ with $f(s)=1$, $f(s')=0$, $(\mu_2)$. Consequently $F(t)=f(s(t))$, with $s(t)$ being the state at time $t$, is Markov (which would not be the case for an arbitrary $F$), and it is easily seen that $F(t)=0$ a fraction $\phi_0=\mu_2/(\lambda_2+\mu_2)$ amount of time, $F(t)=1$ a fraction $\phi_1=\lambda_2/(\lambda_2+\mu_2)$ amount of time. Thus, while the Markov chain in Fig.~\ref{fig:fig_sys_mc} moves right at rate $\lambda_1$, it moves left at a rate $\mu_1\phi_0$. The system is stable only if the rate of moving left is larger than the rate of moving right; which gives the condition \eqref{eq:eq_stab_condition}. \section{Ages of streams\ $\mathcal{U}_1$ and\ $\mathcal{U}_2$} \label{sec:sec_ages_stream_1_2} \subsection{Preliminaries} \label{subsec:subsec_preliminaries} In this section, unless stated otherwise, all random variables correspond to stream $\mathcal{U}_1$. We also follow the convention where a random variable $U$ with no subscript corresponds to the steady-state version of $U_j$ which refers to the random variable relative to the $j^{th}$ received packet from stream $\mathcal{U}_1$. To differentiate between streams we will use superscripts, so $U^{(i)}$ corresponds to the steady-state variable $U$ relative to stream $\mathcal{U}_i$ , $i=1,2$. In addition to that, we define: $(i)$ $X^{(i)}$ to be the interarrival time between two consecutive generated updates from stream $\mathcal{U}_i$, so $f_{X^{(i)}}(x) = \lambda_i e^{-\lambda_i x}$, $i=1,2$ $(ii)$ $S^{(i)}$ to be the service time random variable of stream $\mathcal{U}_i$ updates, so $f_{S^{(i)}}(t) = \mu_i e^{-\mu_i t}$, $i=1,2$ $(iii)$ $T_j$ to be the system time, or the time spent by the $j^{th}$ stream $\mathcal{U}_1$ update in the queue. In our model, we assume the service time of the updates from the different streams to be independent of the interarrival time between consecutive packets (belonging to the same stream or not). Given the description of the model in Section~\ref{sec:sec_system_model}, we can define for each $\mathcal{U}_1$ packet $j$ a \lq\lq virtual\rq\rq\ service time $Z_j$ which could be different from its \lq\lq physical\rq\rq\ service time $S^{(1)}_j$. We define the \lq\lq virtual\rq\rq\ service time $Z_j$ as follows: \begin{equation} \label{eq:eq_Z} Z_j = D_j - \max(D_{j-1},t_j), \end{equation} where $D_j$ is the delivery time of the $j^{th}$ packet and $t_j$ is its generation time. Fig.~\ref{fig1} shows the \lq\lq virtual\rq\rq\ service time for packets $3$ and $4$. For stream $\mathcal{U}_1$, given that the average age calculations seems to be intractable, we will compute its average peak age and give a lower bound on its average age. To that end, we first study the steady state \lq\lq virtual\rq\rq\ service time $Z$. We define the event $$\Psi_j = \left\{\text{packet $j$ finds the system in state $q'_1$}\right\}$$ and its complement $\overline{\Psi_j}$. Then we need the following lemmas. \begin{lemma} \label{lemma:lemma_service_time_1} Let $Y_j$ be the \lq\lq virtual\rq\rq\ service time of packet $j$ given that this packet does not find the system in state $q'_1$, i.e. $\mathbb{P}\left( Y_j>t\right)=\mathbb{P}\left( Z_j>t|\overline{\Psi_j}\right)$. Then, in steady state, \begin{equation} \label{eq:eq_mgf_Y} \phi_Y(s) = \mathbb{E}\left( e^{sY}\right)= \frac{\mu_1(\mu_2-s)}{s^2-s(\mu_2+\mu_1+\lambda_2)+\mu_1\mu_2}. \end{equation} Similarly, let $Y'_j$ be the \lq\lq virtual\rq\rq\ service time of packet $j$ given that this packet finds the system in state $q'_1$, i.e. $\mathbb{P}\left( Y'_j>t\right)=\mathbb{P}\left( Z_j>t|\Psi_j\right)$. Then, in steady state, \begin{equation} \label{eq:eq_mgf_Y'} \phi_{Y'}(s) = \mathbb{E}\left( e^{sY'}\right)= \frac{\mu_1\mu_2}{s^2-s(\mu_2+\mu_1+\lambda_2)+\mu_1\mu_2}. \end{equation} \end{lemma} \begin{proof} We start by proving \eqref{eq:eq_mgf_Y}. For that we will use the detour flow graph method. \begin{figure}[!t] \centering \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2.8cm, semithick] \tikzstyle{every state}=[fill=red,draw=none,text=white] \node[initial,state] (A) {$s_0$}; \node[state] (B) [above right of=A] {$s_1$}; \node[state] (C) [below right of=B] {$s_2$}; \path [->] (A) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$1$} (B); \path [->] (B) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$a$} (A); \path [->] (B) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$v$} (C); \path [->] (C) edge [loop right] node {$b$} (C); \path [->] (C) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$u$} (B); \end{tikzpicture} \caption{Semi-Markov chain representing the \lq\lq virtual\rq\rq\ service time $Y_j$.} \label{fig:fig_Y_mc} \end{figure} Fig.~\ref{fig:fig_Y_mc} shows the semi-Markov chain relative to the \lq\lq virtual\rq\rq\ service time $Y_j$ of the $j^{th}$ packet of first stream $\mathcal{U}_1$. When the $j^{th}$ packet gets at the head of the buffer, the system is in the idle state $s_0$. Hence with probability $1$ it goes immediately to state $s_1$ where it starts serving the $j^{th}$ packet. Due to the memoryless property of the interarrival time of the second stream $X^{(2)}$, two clocks start: a service clock $S^{(1)}$ and a clock $X^{(2)}$. The service clock ticks first with probability $a=\mathbb{P}\left( S^{(1)}<X^{(2)}\right)$ and its value $A$ has distribution $\mathbb{P}\left( A>t\right)=\mathbb{P}\left( S^{(1)}>t|S^{(1)}<X^{(2)}\right)$. At this point the stream $\mathcal{U}_1$ packet currently being served finishes service before any packet from the other stream is generated and the system goes back to state $s_0$. This ends the \lq\lq virtual\rq\rq\ service time $Y_j$. On the other hand, clock $X^{(2)}$ ticks first with probability $v=1-a=\mathbb{P}\left( X^{(2)}< S^{(1)}\right)$ and its value $V$ has distribution $\mathbb{P}\left( V>t\right)=\mathbb{P}\left( X^{(2)}>t|X^{(2)}< S^{(1)}\right)$. At this point, a new stream $\mathcal{U}_2$ update is generated and preempts the stream $\mathcal{U}_1$ packet currently in service. In this case the system goes to state $s_2$, where the preempted stream $\mathcal{U}_1$ update is placed back at the head of the buffer and the system starts service of the stream $\mathcal{U}_2$ update. When the system arrives in state $s_2$, this means a new stream $\mathcal{U}_2$ packet was just generated and is starting service. Thus, two clocks start: a service clock $S^{(2)}$ and a clock $X^{(2)}$. The service clock ticks first with probability $u=\mathbb{P}\left( S^{(2)}<X^{(2)}\right)$ and its value $U$ has distribution $\mathbb{P}\left( U>t\right)=\mathbb{P}\left( S^{(2)}>t|S^{(2)}< X^{(2)}\right)$. At this point, the packet currently being served finishes service before any new stream $\mathcal{U}_2$ packet is generated and the system goes back to state $s_1$ where the $j^{th}$ packet of stream $\mathcal{U}_1$ starts service again. However, clock $X^{(2)}$ ticks first with probability $b=1-u$ and its value $B=$ has distribution $\mathbb{P}\left( B>t\right)=\mathbb{P}\left( X^{(2)}>t|X^{(2)}< S^{(2)}\right)$. At this point, a new stream $\mathcal{U}_2$ update is generated and preempts the one currently in service. In this case the system stays in state $s_2$. From the above analysis we see that the \lq\lq virtual\rq\rq\ service time is given by the sum of the values of the different clocks on the path starting and finishing at $s_0$. For example, for the path $s_0s_1s_2s_1s_2s_2s_1s_0$ in Fig.~\ref{fig:fig_Y_mc}, the \lq\lq virtual\rq\rq\ service time $Y=V_1+U_1+V_2+B_1+U_2+A_1$, where all the random variables in the sum are mutually independent. This value of $Y$ is also valid for the path $s_0s_1s_2s_2s_1s_2s_1s_0$. Hence $Y$ depends on the variables $A_j,B_j,U_j,V_j$ and their number of occurrences and not on the path itself. Therefore, the probability that exactly $(i_1, i_2, i_3, i_4)$ occurrences of $\left( A, B, U, V\right)$ happen, which is equivalent to the probability that \begin{equation*} Y=\sum_{k=1}^{i_1} A_k + \sum_{k=1}^{i_2} B_k + \sum_{k=1}^{i_3} U_k + \sum_{k=1}^{i_4} V_k \end{equation*} is given by $a^{i_1}b^{i_2}u^{i_3}v^{i_4}Q(i_1,i_2,i_3,i_4)$, where $Q(i_1,i_2,i_3,i_4)$ is the number of paths with this combination of occurrences. Taking into account the fact that the $\{A_k, B_k, U_k, V_k\}$ are mutually independent and denoting by $\{I_1, I_2, I_3, I_4\}$ the random variables associated with the number of occurrences of $\{A, B, U,V\}$ respectively, the moment generating function of $Y$ is, \begin{align} \label{eq:eq_Y_mgf1} \phi_Y(s) &= \mathbb{E}\left(\mathbb{E}\left( e^{sY}|\left( I_1, I_2, I_3, I_4\right)=\left( i_1, i_2, i_3, i_4\right) \right)\rp\nonumber\\ &= \sum_{i_1,i_2,i_3,i_4} \left[a^{i_1}b^{i_2}u^{i_3}v^{i_4}Q(i_1,i_2,i_3,i_4)\right.\nonumber\\ & \left. {} \mathbb{E}\left( e^{s\left(\sum_{k=1}^{i_1} A_k + \sum_{k=1}^{i_2} B_k + \sum_{k=1}^{i_3} U_k + \sum_{k=1}^{i_4} V_k\right)}\right)\right]\nonumber\\ &=\sum_{i_1,i_2,i_3,i_4} \left[a^{i_1}b^{i_2}u^{i_3}v^{i_4}Q(i_1,i_2,i_3,i_4)\right.\nonumber\\ &\left. {} \mathbb{E}\left( e^{sA}\right)^{i_1}\mathbb{E}\left( e^{sB}\right)^{i_2}\mathbb{E}\left( e^{sU}\right)^{i_3}\mathbb{E}\left( e^{sV}\right)^{i_4}\right]. \end{align} However \eqref{eq:eq_Y_mgf1} is nothing but the generating function $H_1(D_1,D_2,D_3,D_4)$ of the detour flow graph shown in Fig.~\ref{fig:fig_detour_flow_graph_Y}, where $D_1, D_2, D_3, D_4$ are dummy variables (see \cite[pp. 213--216]{rimoldi_2016}). Simple calculations give \begin{align} \label{eq:eq_H} &H_1(D_1,D_2,D_3,D_4)\nonumber\\ &=\sum_{i_1,i_2,i_3,i_4} \left[Q(i_1,i_2,i_3,i_4)a^{i_1}b^{i_2}u^{i_3}v^{i_4} D_1^{i_1} D_2^{i_2}D_3^{i_3}D_4^{i_4}\right]\nonumber\\ &=\frac{aD_1(1-bD_2)}{1-bD_2-uD_3vD_4}. \end{align} Thus $$\phi_Y(s) = H_1\left(\mathbb{E}\left( e^{sA}\right),\mathbb{E}\left( e^{sB}\right),\mathbb{E}\left( e^{sU}\right),\mathbb{E}\left( e^{sV}\right)\rp.$$ From \cite[Appendix A, Lemma 2]{YatesKaul-2016arxiv}, we know that $A$, $B$, $U$ and $V$ are exponentially distributed with $\mathbb{E}\left( e^{sB}\right)=\mathbb{E}\left( e^{sU}\right)=\frac{\lambda_2+\mu_2}{\lambda_2+\mu_2-s}$ and $\mathbb{E}\left( e^{sA}\right)=\mathbb{E}\left( e^{sV}\right)=\frac{\lambda_2+\mu_1}{\lambda_2+\mu_1-s}$. Simple computations show that $a=\frac{\mu_1}{\mu_1+\lambda_2}$, $b=\frac{\lambda_2}{\mu_2+\lambda_2}$, $u=\frac{\mu_2}{\mu_2+\lambda_2}$, $v=\frac{\lambda_2}{\mu_1+\lambda_2}$. Finally, replacing the above expressions into \eqref{eq:eq_H}, we get our result. \begin{figure}[!t] \centering \subfloat[]{\begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=2cm, semithick,scale=0.6] \tikzstyle{every state}=[fill=red,draw=none,text=white] \node[state] (A) {$s_0$}; \node[state] (B) [right of=A] {$s_1$}; \node[state] (C) [right of=B] {$s_0$}; \node[state] (D) [above of=B] {$s_2$}; \path [->] (A) edge node[ fill=white, anchor=center, pos=0.5] {$1$} (B); \path [->] (B) edge node[ fill=white, anchor=center, pos=0.5] {$aD_1$} (C); \path [->] (B) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$vD_4$} (D); \path [->] (D) edge [bend left] node[ fill=white, anchor=center, pos=0.5] {$uD_3$} (B); \draw [->] (D) edge [loop above] node {$bD_2$} (D); \end{tikzpicture} \label{fig:fig_detour_flow_graph_Y}} ~ \subfloat[]{ \begin{tikzpicture}[>=stealth',shorten >=1pt,auto,node distance=1.5cm, semithick] \tikzstyle{every state}=[fill=red,draw=none,text=white] \node[state] (A) {$s_0$}; \node[state] (B) [below of=A] {$s_2$}; \node[state] (C) [below of=B] {$s_1$}; \node[state] (D) [below of=C] {$s_0$}; \path [->] (A) edge node[anchor=east] {$1$} (B); \path [->] (B) edge [bend right] node[anchor=east] {$uD_3$} (C); \path [->] (B) edge [loop right] node[anchor=west] {$bD_2$} (B); \path [->] (C) edge [bend right] node[anchor=west] {$vD_4$} (B); \draw [->] (C) edge node {$aD_1$} (D); \end{tikzpicture} \label{fig:fig_detour_flow_graph_Y'}} \caption{Detour flow graphs for (a) $Y$ and (b) $Y'$.} \label{fig:fig_detour_flow_graphs} \end{figure} To prove \eqref{eq:eq_mgf_Y'}, we use the same method as before but in this case we notice that the $j^{th}$ packet from stream $\mathcal{U}_1$ finds the system busy serving a packet from stream $\mathcal{U}_2$. This translates in the detour flow graph shown in Fig.~\ref{fig:fig_detour_flow_graph_Y'}. The generating function of this graph is \begin{equation} \label{eq:eq_H_2} H_2(D_1,D_2,D_3,D_4) = \frac{aD_1uD_3}{1-bD_2-vD_4uD_3}. \end{equation} For {\small$\left( D_1,D_2,D_3,D_4\right)=\left(\mathbb{E}\left( e^{sA}\right),\mathbb{E}\left( e^{sB}\right),\mathbb{E}\left( e^{sU}\right),\mathbb{E}\left( e^{sV}\right)\rp$} and replacing $a$, $b$, $u$ and $v$ by their values in \eqref{eq:eq_H_2}, we get \eqref{eq:eq_mgf_Y'}. \end{proof} \begin{lemma} \label{lemma:lemma_moments_Z} The first and second moments of the \lq\lq virtual\rq\rq\ service time $Z$ are given by {\small \begin{align} \label{eq:eq_Z_mean_var} &\mathbb{E}\left( Z\right) = \frac{\lambda_2}{\left(\lambda_1+\mu_2\right)\left(\mu_2+\lambda_2\right)} + \frac{\lambda_1+\lambda_2+\mu_2}{\mu_1\left(\lambda_1+\mu_2\right)},\nonumber\\ &\mathbb{E}\left( Z^2\right)= \frac{2\left(\lp\lambda_2+\mu_2\right)^2\left(\lambda_2+\mu_2+\lambda_1\right) + \lambda_2\mu_1\lp2\lambda_2+\mu_1+2\mu_2\right)\rp}{\mu_1^2\mu_2\left(\lambda_1+\mu_2\right)\left(\lambda_2+\mu_2\right)} \end{align} }% \end{lemma} \begin{proof} For any packet $j$ of stream $\mathcal{U}_1$, conditioning on the event $\Psi_j$, we get \begin{align} \label{eq:eq_mean_Z} \mathbb{E}\left( Z_j\right) &= \mathbb{P}\left(\Psi_j\right) \mathbb{E}\left( Z_j|\Psi_j\right)+ \mathbb{P}\left(\overline{\Psi_j}\right) \mathbb{E}\left( Z_j|\overline{\Psi_j}\right) \nonumber\\ &= \mathbb{P}\left(\Psi_j\right) \mathbb{E}\left( Y'_j\right)+ \mathbb{P}\left(\overline{\Psi_j}\right) \mathbb{E}\left( Y_j\right), \end{align} where $Y'_j$ and $Y_j$ are defined as in Lemma~\ref{lemma:lemma_service_time_1}. From Theorem~\ref{thm:thm_stat_dist} we deduce that $\mathbb{P}\left(\Psi_j\right) = \pi'_1=\frac{\lambda_2}{\lambda_1+\mu_2}\pi_0$. So in steady-state, $\mathbb{E}\left( Z\right)=\pi'_1\mathbb{E}\left( Y'\right)+(1-\pi'_1)\mathbb{E}\left( Y\right)$. Moreover, using \eqref{eq:eq_mgf_Y} and \eqref{eq:eq_mgf_Y'} we get $$\mathbb{E}\left( Y\right)=\frac{\mu_2+\lambda_2}{\mu_1\mu_2},\ \mathbb{E}\left( Y'\right)=\frac{\mu_1+\mu_2+\lambda_2}{\mu_1\mu_2}.$$ Similarly, $\mathbb{E}\left( Z^2\right)=\pi'_1\mathbb{E}\left( {Y'}^2\right)+(1-\pi'_1)\mathbb{E}\left( Y^2\right)$. Using \eqref{eq:eq_mgf_Y} and \eqref{eq:eq_mgf_Y'} we get $$\mathbb{E}\left( Y^2\right)=\frac{2\left((\mu_2+\lambda_2)^2+\mu_1\lambda_2\right)}{(\mu_1\mu_2)^2}\text{\ and}$$ $$\mathbb{E}\left( {Y'}^2\right)=\frac{2\left((\mu_1+\mu_2+\lambda_2)^2-\mu_1\mu_2\right)}{(\mu_1\mu_2)^2}.$$ \end{proof} \subsection{Average peak age of stream $\mathcal{U}_1$} \label{subsec:subsec_age_stream_2} It is worth noting that the system under consideration can't be seen as an M/G/1 queue with service time distributed as $Z$ since the \lq\lq virtual\rq\rq\ service times of different packets are correlated. Indeed, if we know that the \lq\lq virtual\rq\rq\ service time of packet $j$, $Z_j$, is big then with very high probability the $(j+1)^{th}$ packet will be generated during the service of the $j^{th}$ packet and thus with high probability $Z_{j+1}$ will be distributed as $Y$. On the other hand, if $Z_j$ is small then there is a non-negligible probability with which the $(j+1)^{th}$ packet will find the system serving stream $\mathcal{U}_2$ and thus $Z_{j+1}$ will be distributed as $Y'$. \begin{thm} \label{thm:thm_avg_peak_age} The average peak age of stream $\mathcal{U}_1$ is given by \begin{equation} \label{eq:eq_avg_peak_age_1} \Delta_{peak,1} = \frac{1}{\lambda_1}+\frac{ 2\lambda_2\mu_2+\lambda_2\mu_1+\lambda_2^2+\mu_2^2}{\left( \mu_2+\lambda_2\right)\left( \mu_1\mu_2-\lambda_1\left( \mu_2+\lambda_2\right)\rp}. \end{equation} \end{thm} \begin{proof} As we can deduce from Fig.~\ref{fig1}, the $j^{th}$ peak $K_j=X_j^{(1)}+T_j$ where $X_j^{(1)}$ is the $j^{th}$ interarrival time for stream $\mathcal{U}_1$ and $T_j$ is the system time of the $j^{th}$ stream $\mathcal{U}_1$ update. At steady state, we get $\Delta_{peak,1}=\mathbb{E}\left( K\right) = \mathbb{E}\left( X^{(1)}\right) + \mathbb{E}\left( T\right)$. From Little's law we know that $\mathbb{E}\left( T\right) = \mathbb{E}\left( N(t)\right)\mathbb{E}\left( X^{(1)}\right)$, with the expected number of stream $\mathcal{U}_1$ packets $\mathbb{E}\left( N(t)\right)$ given by \eqref{eq:eq_exp_stream_1} and $\mathbb{E}\left( X^{(1)}\right)=1/\lambda_1$. \end{proof} \subsection{Lower bound on the average age of stream $\mathcal{U}_1$} The average peak age is an obvious upper bound, hence in this section we will compute a lower bound of the average age. Consider a fictitious system where if a stream $\mathcal{U}_1$ arrival finds the system in state $q'_1$, then the stream $\mathcal{U}_2$ packet that is being served is discarded (and the stream $\mathcal{U}_1$ packet enters service immediately). The instantaneous age process of this fictitious system is pointwise less than the instantaneous age of the true system, consequently its average age lower bounds the true average age. Note that the fictitious system from the point of view of the stream $\mathcal{U}_1$ is M/G/1, with service time distributed like $Y$ in \eqref{eq:eq_mgf_Y}. \begin{lemma} \label{lemma:lemma_system_time_lb} Assume an M/G/1 queue with interarrival time $X^{(1)}$ exponentially distributed with rate $\lambda_1$ and service time $Y$ whose moment generating function is given by \eqref{eq:eq_mgf_Y}. The service time and the interarrival time are assumed to be independent. Then the distribution of the system time $T$ is {\small\begin{equation} \label{eq:eq_dist_system_time_lb} f_T(t) = -C_1 e^{-\alpha_1 t}-C_2 e^{-\alpha_2 t},\ t\geq0, \end{equation}}% where $\alpha_1>\alpha_2>0$ are the roots of the quadratic expression $$s^2-s(\mu_1+\mu_2+\lambda_2-\lambda_1)+\mu_1\mu_2-\lambda_1\mu_2-\lambda_1\lambda_2,$$ $$C_1 = \frac{(1-\rho)\mu_1(\mu_2-\alpha_1)}{\alpha_1-\alpha_2},\ C_2 = \frac{(1-\rho)\mu_1(\mu_2-\alpha_2)}{\alpha_2-\alpha_1}$$ and $\rho = \lambda_1\mathbb{E}\left( Y\right) = \frac{\lambda_1(\mu_2+\lambda_2)}{\mu_1\mu_2}$. \end{lemma} \begin{proof} From \cite[p. 166]{daigle2005queueing}, we know that $$\phi_T(s) = \frac{(1-\rho)\phi_Y(s)}{s+\lambda_1(1-\phi_Y(s))}.$$ Replacing $\phi_Y(s)$ by its expression in \eqref{eq:eq_mgf_Y} we get \begin{align} \phi_T(s) &= \frac{(1-\rho)\mu_1(\mu_2-s)}{s^2-s(\mu_1+\mu_2+\lambda_2-\lambda_1)+\mu_1\mu_2-\lambda_1\mu_2-\lambda_1\lambda_2}\nonumber\\ &= \frac{C_1}{s-\alpha_1}+\frac{C_2}{s-\alpha_2}, \end{align} by partial fraction expansion. Moreover, due to condition \eqref{eq:eq_stab_condition}, $$\alpha_1+\alpha_2 = \mu_1+\mu_2+\lambda_2-\lambda_1>0$$ and $$\alpha_1\alpha_2= \mu_1\mu_2-\lambda_1\mu_2-\lambda_1\lambda_2>0.$$ This proves that both roots $\alpha_1$ and $\alpha_2$ are positive. Without loss of generality, we take $\alpha_1>\alpha_2$. Taking the inverse Laplace transform of $\phi_T(-s)$ we get \eqref{eq:eq_dist_system_time_lb}. \end{proof} From \cite{KaulYatesGruteser-2012Infocom}, we know that the average age of the M/G/1 queue with interarrival time $X^{(1)}$ and service time $Y$ is \begin{align} \label{eq:eq_avg_age_lb} \Delta_{LB} &= \lambda_1\left(\frac{1}{2}\mathbb{E}\left( {X^{(1)}_j}^2\right) + \mathbb{E}\left( T_jX^{(1)}_j\right)\rp, \end{align} where for the $j^{th}$ packet we have $T_j = (T_{j-1}-X^{(1)}_j)^+ + Y_j$, $f(x) =(x)^+ = x1_{\{x\geq 0\}}$ and $1_{\{.\}}$ is the indicator function. So $\mathbb{E}\left( T_jX^{(1)}_j\right)$ becomes \begin{equation} \label{eq:eq_ETX} \mathbb{E}\left( T_jX^{(1)}_j\right) = \mathbb{E}\left( X^{(1)}_j(T_{j-1}-X^{(1)}_j)^+\right) + \mathbb{E}\left( Y_j\right)\mathbb{E}\left( X^{(1)}_j\right), \end{equation} where the second term is due to the independence between $Y_j$ and $X_j$. \begin{proposition} \label{prop:prop_ETXX} \begin{align} \label{eq:eq_ETXX} &\mathbb{E}\left( X^{(1)}_j(T_{j-1}-X^{(1)}_j)^+\right) \nonumber\\ &= \frac{\lambda_1(1-\rho)\mu_1\left( \left((\alpha_1+\alpha_2)^2-\alpha_1\alpha_2\right)(\mu_2+2\lambda_1\mu_2-\alpha_1\alpha_2)\right)}{\mu_1^2(\lambda_1+\mu_2)^2(\alpha_1\alpha_2)^2}\nonumber\\ &+\frac{\lambda_1(1-\rho)\mu_1\left((\alpha_1+\alpha_2)\left( \lambda_1^2\mu_2-2\lambda_1\alpha_1\alpha_2\right)-\lambda_1^2\alpha_1\alpha_2\right)}{\mu_1^2(\lambda_1+\mu_2)^2(\alpha_1\alpha_2)^2}, \end{align} where $\alpha_1+\alpha_2 = \mu_1+\mu_2+\lambda_2-\lambda_1$, $\alpha_1\alpha_2=\mu_1\mu_2-\lambda_1\mu_2-\lambda_1\lambda_2$ and $\rho = \lambda_1\mathbb{E}\left( Y\right) = \frac{\lambda_1(\mu_2+\lambda_2)}{\mu_1\mu_2}$. \end{proposition} \begin{proof} Given that $T_{j-1}$ and $X^{(1)}_j$ are independent then \begin{align*} &\mathbb{E}\left( X^{(1)}_j(T_{j-1}-X^{(1)}_j)^+\right)\nonumber\\ &= \int_0^\infty \int_x^\infty x(t-x)f_T(t)\lambda_1 e^{-\lambda_1 x}\mathrm{d}t\mathrm{d}x \end{align*} Replacing $f_T(t)$ by its value in \eqref{eq:eq_dist_system_time_lb}, we get \eqref{eq:eq_ETXX} after some computations. \end{proof} Finally, using \eqref{eq:eq_ETXX}, $\mathbb{E}\left( Y_j\right)=\mathbb{E}\left( Y\right)=\frac{\mu_2+\lambda_2}{\mu_1\mu_2}$ and $\mathbb{E}\left( X^{(1)}_j\right)=\mathbb{E}\left( X^{(1)}\right) = \frac{1}{\lambda_1}$, we can find a closed form expression for $\mathbb{E}\left( T_jX^{(1)}_j\right)$. Replacing this expression in \eqref{eq:eq_avg_age_lb} and using the fact that $\mathbb{E}\left( {X^{(1)}_j}^2\right)= \frac{2}{\lambda_1^2}$, we obtain a closed form expression of the average age $\Delta_{LB}$ of an M/G/1 queue with interarrival time $X^{(1)}$ and service time $Y$. This is also a lower bound on the true average age of stream $\mathcal{U}_1$ packets. \subsection{Average age of stream $\mathcal{U}_2$} \label{subsec:subsec_age_stream_1} By design, stream $\mathcal{U}_2$ is not interfered at all by stream $\mathcal{U}_1$ and hence behaves like a traditional M/M/1/1 with preemption queue with generation rate $\lambda_2$ and service rate $\mu_2$. The average age of this stream was computed in \cite{2012CISS-KaulYatesGruteser} to be \begin{equation} \label{eq:eq_stream_2_age} \Delta_{\mathcal{U}_2} = \frac{1}{\mu_2}+\frac{1}{\lambda_2}. \end{equation} \begin{figure}[!t] \centering \includegraphics[scale=0.4,trim={0 0.5cm 0 1.5cm},clip]{Lower_bound_avg_peak_age_vs_lambda2_mu1_10_mu2_5_lambda1_2_avg_age_stream_2_traditional_mm1_correct_version} \caption{Plot of the average age for stream $\mathcal{U}_2$ and average peak age and lower bound on the average age for stream $\mathcal{U}_1$, with $\mu_1=10$, $\mu_2=5$, $\lambda_1=2$ and $\lambda_2<\frac{\mu_1\mu_2}{\lambda_1}-\mu_2=20$.} \label{fig:fig_bounds} \end{figure} \section{Numerical results} \label{sec:sec_numerical_results} Fig.~\ref{fig:fig_bounds} shows the simulated average age, the average peak age ($\Delta_{peak,1}$) and the lower bound on the average age ($\Delta_{LB}$) as computed in the previous section for stream $\mathcal{U}_1$ as well as the average age ($\Delta_{\mathcal{U}_2}$) of stream $\mathcal{U}_2$. In this plot, we fix $\mu_1=10$, $\mu_2=5$, $\lambda_1=2$ and we vary $\lambda_2$. As we can see, for stream $\mathcal{U}_1$ the average age, the lower bound and the average peak age blow up when $\lambda_2$ gets close to $\frac{\mu_1\mu_2}{\lambda_1}-\mu_2$. This observation is in line with our result in Theorem~\ref{thm:thm_stat_dist} and the stability condition \eqref{eq:eq_stab_condition}. In this simulation we also notice that the average peak age appears to be a good upper bound on the average age while the lower bound is much looser. It is easy to see via a coupling argument that if we increase $\lambda_2$, the age process $\Delta_{\mathcal{U}_1}(t)$ of the $\mathcal{U}_1$ stream will stochastically increase. We see from the plots that the lower bound on $\Delta_{\mathcal{U}_1}$ and its average peak exhibit the same behavior. On the other hand, the average age of stream $\mathcal{U}_2$ is decreasing in $\lambda_2$ (from \eqref{eq:eq_stream_2_age}). Consequently, minimizing $\Delta_{\mathcal{U}_2}$ and minimizing $\Delta_{\mathcal{U}_1}$ are conflicting goals. We have seen that the average age of stream $\mathcal{U}_2$ is not affected by the presence of the other stream. However, Fig.~\ref{fig:fig_bounds} shows the effect of stream $\mathcal{U}_2$ on the average age of stream $\mathcal{U}_1$ ($\Delta_1$). For that, we plot the average age ($\Delta_{ref}$) of an M/M/1 queue with generation rate $\lambda_1=2$ and service rate $\mu_1=10$ (given in \cite{KaulYatesGruteser-2012Infocom}). We observe an expected behavior: for very low values of $\lambda_2$, the two average ages are close (they are equal at $\lambda_2=0$). However, as $\lambda_2$ increases the presence of stream $\mathcal{U}_2$ quickly leads to an increase in $\Delta_1$. In fact, for $\lambda_2=5$, $\Delta_1$ is already $50\%$ higher than $\Delta_{ref}$. This shows that the presence of the priority stream $\mathcal{U}_2$ takes a big toll on the stream $\mathcal{U}_1$ age. Another observation is that the average age curve of stream $\mathcal{U}_2$ crosses the average age of stream $\mathcal{U}_1$ at a value of $\lambda_2$, denoted $\lambda_2^*=1.9$. This means that for $\lambda_2\leq\lambda_2^*$, stream $\mathcal{U}_2$ has a higher average age than stream $\mathcal{U}_1$. These observations show that not all values of $\lambda_2$ are suitable for our system. A small $\lambda_2$ will not ensure for stream $\mathcal{U}_2$ the priority it needs while a large $\lambda_2$ will make the average age of stream $\mathcal{U}_1$ large and the system unstable. \section{Conclusion} In this paper we studied the effect of implementing content-dependent policies on the average age of the packets. We considered a source generating two independent Poisson streams with one stream being age sensitive and having higher priority than the other stream. The \lq\lq high priority\rq\rq\ stream is sent using a preemption policy while the \lq\lq regular\rq\rq\ stream is transmitted using a First Come First Served (FCFS) policy. We derived the stability condition for the system as well as closed form expressions for the average peak age and a lower bound on the average age of the \lq\lq regular\rq\rq\ stream. We also deduced that one can't hope to minimize both streams if we can only control the generation rate of the high priority stream. \section*{Acknowledgements} This research was supported in part by grant No. 200021\_166106/1 of the Swiss National Science Foundation. \bibliographystyle{IEEEtran}
\section{Introduction and Preliminaries} \subsection{Introduction} The boundary of the compactification of various moduli spaces exhibits a stratification in terms of increasingly degenerate objects. A basic example of this phenomenon is $\overline{M}_g$, the compactification of the moduli space of smooth curves of genus $g\geq 2$ by stable curves, where the boundary strata parametrize curves with an increasing number of nodes. This widespread behaviour has received new attention lately thanks to recent progress in tropical and non-Archimedean geometry. In fact, a thorough study of the boundary of $\overline{M}_g$ and of its combinatorial incarnation has led to a remarkable discovery: in loose words, the Berkovich skeleton of $\overline{M}_g$ (the tropicalization of $\overline{M}_g$) is the moduli space for the skeleta of stable curves over complete valued fields (the moduli space of tropical curves, $\ov{\Mgt}$). An analogous result holds for other moduli spaces, like $\ov{M}_{g,n}$ or the space of admissible covers. These facts are proved, building upon results of \cite{berkovich}, \cite{BMV} and \cite{thuillier}, in \cite{ACP} for $\ov{M}_{g,n}$ and in \cite{CMR} for admissible covers; see also \cite{BPR1}, \cite{tyomkin}, \cite{viviani}, \cite{BR15} for related progress. We here investigate the compactification of the universal Jacobian. As we said, the starting point has been the study of the boundary from the combinatorial point of view. First, one shows it admits a so-called {\it graded stratification} by a poset ${\mathcal P}$, then one identifies ${\mathcal P}$ with a combinatorial object interesting on its own. For example, for $\overline{M}_g$ the stratifying poset is $\Sg$, the set of all stable graphs of genus $g$ partially ordered with respect to edge-contraction. We have a ``stratification" map, $\overline{M}_g\to \Sg$, mapping a curve to its dual graph. This stratification implies, roughly speaking, that to a degeneration of curves there corresponds a ``dual" edge-contraction of dual graphs, and to edge-contractions there correspond degenerations of curves. In this paper we shall extend this correspondence to degenerations of curves together with a line bundle by suitably enriching the combinatorial counterpart. Moreover, we shall prove this holds on the compactification of the universal degree-$d$ Jacobian (or degree-$d$ Picard variety) over $\overline{M}_g$, for $d=g-1,g$. Let us be more precise. Recall that for any $d\in {\mathbb{Z}}$ the compactification of the universal degree-$d$ Jacobian is a projective morphism, $ \psi:\overline{P}^{d}_g\to \overline{M}_g $, whose fiber over an automorphism-free curve, $X$, is ${\operatorname{{Pic}}}^d(X)$ if $X$ is smooth, and a compactified degree-$d$ Jacobian, $\overline{P}^{d}_X$, if $X$ is singular; we use the notation and moduli description of \cite{Cthesis}. As $d$ varies so does $\overline{P}^{d}_g$, but it is well known that there are only finitely many non-isomorphic types, each of which can be realized by a value of $d$ such that $0\leq d\leq g$. We concentrate on the cases $d=g-1$ and $d= g$, which are of special interest. The case $d=g-1$ has been studied extensively because of its connection with Prym varieties, the Theta divisor and the Torelli problem; see \cite{be77}, \cite{Al04}, \cite{CV2}. The case $d=g$ is notable because $\overline{P}^{g}_g$ is the coarse moduli scheme of a Deligne-Mumford stack, and its fiber over the curve $X$ is a compactified Jacobian of N\'eron type, i.e. it compactifies the N\'eron model of the Jacobian of a regular one-parameter smoothing of $X$. Before studying the full space $\overline{P}^{d}_g$ we study its fiber, $\overline{P}^{d}_X$, over the curve $X$. The space $\overline{P}^{d}_X$ parametrizes line bundles on partial normalizations of $X$ having a special multidegree; as multidegrees on $X$ coincide with divisors on the dual graph, $G$, of $X$, we call such special multidegrees {\it stable divisors}. This leads to a stratification of $\overline{P}^{d}_X$ given by the sets of nodes that are normalized, and by the sets of stable divisors on the partial normalization. For a fixed curve $X$ the existence of such a stratification was essentially known, but a combinatorially interesting incarnation for it was not, with the exception of the case $d=g-1$. Indeed, it was known that a divisor of degree $g-1$ is stable if and only if it is the divisor associated to a {\it totally cyclic} orientation on $G$. Preceeding the notion of stable divisor, this observation was made in \cite[Lemma 2.1]{be77} while studying Prym varieties. Independently, using the basic inequality of \cite{Cthesis}, this is a consequence of a theorem in graph theory known as Hakimi's Theorem (originally in \cite{Ha65}, see also \cite[Theorem 4.8]{ABKS}). The graded stratification of $\overline{P}^{g-1}_X$ by totally cyclic orientations was established in \cite{CV2} to study the Torelli map of stable curves. We will prove results of a similar type in case $d=g$, and show that $\overline{P}^{g}_X$ has a graded stratification by the poset of {\it rooted} (generalized) orientations on $G$; see Definition~\ref{1ordef}. In particular, we show that a divisor is stable if and only if it is the divisor associated to a rooted orientation. We note that from this and \cite[Lemma 3.3]{ABKS} it easily follows that the notions of break divisor, as introduced in \cite{MZ08}, and of stable divisor coincide. We will introduce for a stable graph $G$ two graded posets: the poset $\OGt$ of totally cyclic orientation classes on spanning subgraphs of $G$, and the poset $\OGb$ of rooted orientation classes on spanning subgraphs of $G$. We treat the cases $d=g-1$ and $d=g$ simultaneously, so we write $b=0,1$ and $d=g-1+b$. By mapping a point to its stratum we get a graded stratification map $\overline{P_X^{g-1+b}} \rightarrow \OG$; see Theorem~\ref{PX}. Then we extend our analysis over $\overline{M}_g$ which, as we said, is stratified by $\Sg$ ordered by edge-contraction. The goal is to endow $\overline{P}^{g-1}_g$ and $\overline{P}^{g}_g$ with a graded stratification compatible with the one of $\overline{M}_g$. In order to do that we need to study the behaviour of the posets $\OG$ under edge-contractions. This is a combinatorial problem which, to our knowledge, has never been studied. Our main result here is Theorem~\ref{fthm}, stated informally as follows. \begin{thm} \label{fthmintro} Let $G$ and $G'$ be stable graphs and let $\gamma:G\to G'$ be a non-trivial edge-contraction. Then, for $b=0,1$, we have a natural quotient of posets $ {\overline {\gamma}}_*:\oOPGb\to {\overline{\mathcal{OP}}}^b_{G'} . $ \end{thm} Taking the action of ${\operatorname{Aut}}(G)$ into account we have a quotient of posets, $\qOg \to \Sg$, whose fiber over $G$ is $\OG/{\operatorname{Aut}}(G)$. The theorem below, describing our compactified Jacobians in terms of orientations on graphs, summarizes the algebro-geometric results. \begin{thm} \label{mainintro} Let $b=0,1$. The following diagram is commutative. The four horizontal maps, denoted by $\sigma$, are graded stratification maps, and the vertical map $\mu$ is a quotient of posets. $$\xymatrix@=.5pc{ \overline{P^{g-1 + b}_g} \ar@{->>} [rrrrrrrrr]^{\sigma} \ar[ddddd]_{\psi}&&&&&&&&&\qOg\ar [ddddd]^{\mu}&&\\ &&&&&&&&& && \\ &\overline{P}^{g-1+b}_X/{\operatorname{Aut}}(X) \ar[dd] \ar@{_{(}->}[luu] \ar@{->>}[rrrrrr]^{\sigma} &&&&&&\qOPGb \ar [dd]\ar@{^{(}->}[rruu] &&& &&&& \\ &&\overline{P}^{g-1+b}_X\ar[lu]\ar[ld] \ar@{->>}[rrr]^{\sigma} &&&\OG\ar[rru]\ar[rrd] &&&& &&\\ &[X] \ar@{|->}[rrrrrr] \ar@{|->}[ld] &&&&&&[G] \ar@{|->}[rrd] &&& &&\\ \overline{M}_g \ar@{->>} [rrrrrrrrr]^{\sigma} &&&&&&&&&\Sg&&\\ }$$ \end{thm} This holds in degrees $g-1$ and $g$ and can be easily extended to degree $g - 2$ (by taking the residual of the degree $g$ case). But for the extension to other degrees, we have no candidate for a stratifying poset. The theorem gives the sought-for combinatorial presentation of the compactified Jacobian of a curve, and of the compactified universal Jacobian over $\overline{M}_g$. The next question now is to provide the tropical/non-Archimedian version of the theorem, starting from the fact that the left-bottom corner of the diagram should be occupied by the moduli space of tropical curves, $\ov{\Mgt}$, while the right side should be the same, up to isomorphism. This will involve constructing skeleta of $\overline{P}^{d}_X$ and $\overline{P}^{d}_g$ as moduli spaces of suitable polyhedral objects. This research direction relates to results of \cite{BR15}, where the skeleton of the Jacobian of a curve over a valuation ring is shown to be the Jacobian of the skeleton of the curve. Results of \cite{Sthesis} show that the compactification considered there agrees with the one constructed in \cite{Cthesis}, the one studied in this paper if $d=g$. Results of \cite{Kthesis} indicate that one can extend this description to the universal setting on the combinatorial side. The paper begins with some elementary combinatorial preliminaries. Then Section~\ref{secfun} establishes the main results for orientations and their behavior under edge-contractions, proving Theorem~\ref{fthmintro}. Our work here has been influenced by \cite{Gi07} and \cite{Ba14}, which study the interplay between orientations and the divisors they define. In Section~\ref{finsec} we treat compactified Jacobians and prove Theorem \ref{mainintro}. \subsection{Graphs} \label{graphsec} Throughout the paper $G$ denotes a vertex-weighted finite graph; we allow loops and multiple edges. We denote by $V=V(G)$ the set of vertices of $G$, by $E=E(G)$ the set of edges of $G$ and by $ w :V\to {\mathbb{N}} $ the weight function of $G$. We write $c(G)$ for the number of connected components of $G$. The {\it genus}, $g=g(G)$, of $G$, is $$g(G):=\sum_{v\in V} w(v) -|V|+|E| +c(G).$$ We think of an edge of $G$ as the union of two {\it half-edges}, each of which has a vertex of $G$ as end, so that the ends of an edge $e$ are the ends of its half-edges and $e$ is a {\it loop} if the two ends coincide. We write $H=H(G)$ for the set of half-edges of $G$. We have a natural two-to-one surjection $H\to E$, and we write $\{h^+_e,h^-_e\}$ for the preimage of $e\in E$. The {\it degree}, $\deg v$, of a vertex $v$ is the number of half-edges whose end is $v$. For a non empty $Z\subset V$, we write $Z^c:=V\smallsetminus Z$. The {\it induced subgraph}, $G[Z]\subset G$, is the subgraph whose vertex-set is $Z$, whose edge-set is the set of all edges of $G$ having both ends in $Z$, and whose weight function is the restriction to $Z$ of the one of $G$. We set $$ g(Z):=g(G[Z])=|E(G[Z])|-|Z|+c(G[Z]) +\sum_{v\in Z} w(v). $$ If $S\subset E$ is a set of edges of $G$, we write $G-S$ for the graph obtained from $G$ by removing $S$; notice that $G$ and $G-S$ have the same vertices, in other words $G-S$ is a so-called {\it spanning} subgraph of $G$. We denote by $\langle S\rangle$ the subgraph of $G$ spanned by $S$, so that $E(\langle S\rangle)=S$ and the vertices of $\langle S\rangle$ are the vertices adjacent to the edges in $S$. A {\it cut} of $G$ is a set of edges, $S\subset E$, such that for a partition $V=Z\sqcup Z^c$, with $\emptyset\subsetneq Z \subsetneq V$, our $S$ is the set of all edges adjacent to both $Z$ and $Z^c$. We also write $S=E(Z,Z^c)$ for such a cut. For a non empty cut $S$ we have $ c(G)<c(G-S). $ A {\it bridge} is an edge such that $\{e\}$ is a cut. We denote by $G_{br}\subset E$ the set of bridges of $G$. \begin{remark} \label{cutrk} Let $S\subset E$ be a cut of $G$ and let $H\subset G$ be a subgraph. Then either $S\cap E(H)=\emptyset$ or $S\cap E(H)$ is a cut for $H$. \end{remark} \begin{remark} For any $S\subset E$ we have $ g(G)\geq g(G-S), $ with equality if and only if $S\subset G_{br}$. \end{remark} A {\it {morphism}} between two graphs, $\eta:G\to G'$, is given by two maps, $\eta_V:V(G)\to V(G')$ and $\eta_E:E(G)\to E(G')\cup V(G')$ such that $\eta_E(e)$ has ends $\eta_V(v)$ and $\eta_V(w)$ for any $e\in E(G)$ whose ends are $v$ and $w$. We sometime write just $\eta=\eta_E$ and $\eta=\eta_V$. An {\it {isomorphism}} between two graphs, $\alpha:G\to G'$, is a morphism such that $\alpha_V$ is a bijection, $\alpha_E:E(G)\to E(G')$ is a bijection, and such that for every $v\in V(G)$ the weight of $\alpha_V(v)$ equals the weight of $v$. An isomorphism induces also a bijection between the half-edges of $G$ and $G'$. An {\it automorphism} is an isomorphism of $G$ with itself. We denote by ${\operatorname{Aut}}(G)$ the group of automorphisms of $G$. $G$ is {\it semistable} if it is connected, $g(G)\geq 2$, and has no vertex of weight $0$ and degree less than $2$. $G$ is {\it stable} if it is semistable and has no vertex of weight $0$ and degree less than $3$. The set of all stable graphs of genus $g$ is denoted by $\Sg$. Notice that $\Sg$ is finite. \subsection{Posets} \label{posec} A {\it poset}, $({\mathcal P}, \leq)$, or just ${\mathcal P}$, is a set partially ordered with respect to $`` \leq"$. Let $p_1,p_2\in {\mathcal P}$. We say that $p_2$ {\it covers} $p_1$ if $p_1< p_2$ and if there is no $p'\in {\mathcal P}$ such that $p_1<p'<p_2$. Let $({\mathcal P},\leq_{_{\mathcal P}})$ and $({\mathcal Q},\leq_{_{\mathcal Q}})$ be two posets. We say that a map $ \mu :{\mathcal P}\to{\mathcal Q}. $ is a {\it morphism of posets} if $p_1\leq _{_{\mathcal P}} p_2$ implies $\mu(p_1)\leq _{_{\mathcal Q}} \mu(p_2)$. We say that $\mu$ is a {\it quotient (of posets)} if for any $q_1,q_2\in {\mathcal Q}$ such that $q_1\leq _{_{\mathcal Q}}q_2$ there exist $p_1\in \mu^{-1}(q_1)$ and $ p_2\in \mu^{-1}(q_2)$ such that $p_1\leq _{_{\mathcal P}} p_2$. In particular, a quotient is a surjective morphism of posets. We will apply the following trivial lemma a few times. \begin{lemma} \label{posettriv} Let ${\mathcal P}$ be a finite poset and $\sim$ an equivalence relation on ${\mathcal P}$. Let $\pi:{\mathcal P} \to \overline{{\mathcal P}}={\mathcal P}/_\sim$ be the quotient. Assume the following holds For every $ x,y\in {\mathcal P}$ with $y\geq x$ and for every $y\sim y'$ there exists $x'\sim x$ such that $y'\geq x'$. Then $\overline{{\mathcal P}}$ is a poset as follows: for $\overline{x},\overline{y}\in\overline{{\mathcal P}}$ set $\overline{y}\geq \overline{x}$ if there exist $x'\sim x$ and $y'\sim y$ such that $y'\geq x'$. Moreover $\pi$ is a quotient of posets. \end{lemma} The lemma holds if we switch roles between $x$ and $y$, i.e. if we assume that for every $x\sim x'$ there exists $y'\sim y$ such that $y'\geq x'$. A {\it rank} on a poset ${\mathcal P}$ is a map $ \rho: {\mathcal P}\to {\mathbb{N}} $ such that if $p_2$ covers $p_1$ then $\rho(p_2)=\rho(p_1)+1$. Of course, ${\mathbb{N}}$ is a poset and a rank is a morphism of posets. A poset endowed with a rank is called a {\it graded poset}. \begin{defi} \label{stratdef} Let $M$ be an algebraic variety and let ${\mathcal P}$ be a poset. A {\it stratification of $M$ by ${\mathcal P}$} is a partition of $M$ $$ M=\sqcup_{p\in {\mathcal P}}M_p $$ such that the following hold for every $p,p'\in {\mathcal P}$. \begin{enumerate} \item the {\it stratum} $M_p$ is irreducible and quasi-projective; \item if $M_p\cap \overline{M_{p'}}$ is not empty, then $M_p\subset\overline{M_{p'}}$; \item $M_p\subset\overline{M_{p'}}$ if and only if $p\leq p'$. \end{enumerate} A stratification of $M$ by ${\mathcal P}$ is called {\it graded} if the following is a rank on ${\mathcal P}$ $$ {\mathcal P}\longrightarrow {\mathbb{N}}; \quad \quad p\mapsto \dim M_p. $$ Let $\sigma: M \twoheadrightarrow {\mathcal P}$ be a surjective map. We call $\sigma$ a {\it (graded) stratification map} if the fibers of $\sigma$ form a (graded) stratification of $M$ by ${\mathcal P}$. \end{defi} \subsection{Generalized orientations} Let $G$ be a graph and $e$ an edge of $G$. An {\it orientation} on $e$ is the assignment of a direction so that one half-edge of $e$ is the starting half-edge and the other is the ending half-edge. Accordingly, the vertex adjacent to the starting half-edge will be called the {\it source} of $e$, and the vertex adjacent to the ending half-edge will be called the {\it target} of $e$. If $e$ is a loop then its base vertex is both source and target. An {\it orientation}, $O$, on $G$ is the assignment of an orientation on every edge of $G$. If $x\in V$ is the source (respectively, the target) of $e\in E$ we say that $e$ is $O${\it-outcoming} from $x$ (resp. $O${\it-incoming} at $x$). A {\it generalized orientation} on $G$ is the assignment, for every $e\in E$, of either an orientation on $e$, or of both orientations on $e$; in the latter case we say that $e$ is {\it bioriented}. So, a bioriented edge has both its ends as targets and sources. For $b\in {\mathbb{N}}$ a {\it $b$-orientation} is a generalized orientation having exactly $b$ bioriented edges. We thus recover usual orientations as 0-orientations (which we shall continue to call ``orientations" to ease the terminology) In this paper, we shall mostly be interested in the cases $b=0,1$. \begin{defi} \label{1ordef} Let $G$ be a graph. An orientation (i.e. a 0-orientation) on $G$ is {\it totally cyclic} if it has no {\it directed cut} i.e. if every non empty cut $E(Z,Z^c)$ has an edge with target in $Z$ and one edge with target in $Z^c$. A 1-orientation on $G$ with bioriented edge $e$ is {\it rooted}, or $e$-{\it rooted}, if for every $Z\subsetneq V$ such that $e\in G[Z]$, the cut $E(Z,Z^c)$ contains an edge with target in $Z^c$. \end{defi} We denote $$ {\mathcal O}^0(G):=\{O:\ O \text{ is a totally cyclic orientation on } G\} $$ and $$ {\mathcal O}^1(G):=\{O:\ O \text{ is a rooted 1-orientation on } G\}. $$ The terminology ``totally cyclic" and ``rooted" is motivated by \ref{F1} \eqref{F12}, and \ref{lmfree}, respectively. Let $G$ be a cycle. We say that $G$ is {\it cyclically oriented} if it is given a totally cyclic orientation (of course, a cycle admits exactly two totally cyclic orientations). From \cite[Lemma 2.4.3]{CV} we have: \begin{fact} \label{F1} \begin{enumerate}[(a)] \item \label{F11} $ {\mathcal O}^0(G)$ is not empty if and only if $G$ is free from bridges. \item \label{F12} Let $G$ be connected. An orientation on $G$ is totally cyclic if and only if every pair of vertices is contained in a cyclically oriented cycle. \end{enumerate} \end{fact} \begin{conv} \label{empty} Assume $G$ has no edges. The empty orientation will be considered totally cyclic, so that ${\mathcal O}^0(G)$ consists of exactly that orientation. If $G$ consists of a single vertex, the empty orientation will be considered rooted, so that ${\mathcal O}^0(G)= {\mathcal O}^1(G)$. \end{conv} By definition, an orientation on a graph is totally cyclic if and only if its restriction to every connected component of $G$ is totally cyclic. \begin{remark} \label{0e1} Let $O$ be a totally cyclic orientation on a connected graph $G$. For any $e$ of $G$, let $O_e$ be the 1-orientation having $e$ as bioriented edge and such that every remaining edge is oriented according to $O$. The definition implies that $O_e$ is rooted. This gives an injection (not a surjection) $$ {\mathcal O}^0(G)\times E \longrightarrow {\mathcal O}^1(G);\quad \quad (O,e)\mapsto O_e. $$ \end{remark} \begin{lemma} \label{LmO} $ {\mathcal O}^1 (G)$ is not empty if and only if $G$ is connected. \end{lemma} \begin{proof} If $G$ admits a rooted 1-orientation then, by definition, every cut $E(Z,Z^c)$ is non empty, hence $G$ must be connected. Conversely, let $G$ be connected and set $ G-G_{br}=G_1\sqcup G_2 \sqcup \ldots \sqcup G_n $ with $G_i$ connected for $i=1,\ldots n$. Of course, $G_i$ is bridgeless for every $i$, hence we can fix on $G_i$ a totally cyclic orientation, $O_i$. We pick an edge $e$ of $G_1$ and consider the 1-orientation on $G_1$ having $e$ as bioriented edge and such that every other edge is oriented according to $O_1$. This is a rooted 1-orientation, as noted in Remark~\ref{0e1}. We fix this orientation on $G_1$ from now on, and we fix the orientations $O_2,\ldots , O_n$ on the remaining $G_i$. Let us show how to orient $G_{br}$ to obtain a rooted 1-orientation. Let $B_1\subset G_{br}$ be the set of bridges adjacent to $G_1$ and, up to reordering $G_2,\ldots, G_n$, let $G_2,\ldots , G_{n_1}$ be adjacent to $B_1$, so that the following subgraph of $G$ $$ H_2=G_1\cup B_1 \cup G_2\cup \ldots \cup G_{n_1} $$ is connected. Since $G$ is connected, $n_1\geq 2$. Orient every edge in $B_1$ pointing away from $G_1$. It is easy to check that the so obtained 1-orientation on $H_2$ is rooted. If $H_2=G$ we are done. If not we iterate as follows. Let $B_2\subset G_{br}$ be the set of bridges adjacent to $H_2$ and let $G_{n_1+1}, \ldots G_{n_2}$ be the components not contained in $H_2$ and adjacent to $B_2$, so that the following $$ H_3=H_2\cup B_2 \cup G_{n_1+1}\cup \ldots \cup G_{n_2} $$ is connected. Orient every edge in $B_2$ away from $H_2$ so that the so-obtained 1-orientation is rooted. If $H_2=G$ we stop, otherwise we iterate. Since $G$ is connected, after a finite number, say $m$, of iterations we get $H_m=G$. \end{proof} \subsection{Divisors of generalized orientations} The group of divisors on $G$, written ${\operatorname{Div}}(G)$, is the free abelian group generated by $V$. We shall identify $ {\operatorname{Div}}(G)= {\mathbb{Z}}^V $ and denote a divisor on $G$ by ${\underline{d}}=\{{\underline{d}}_v\}_{v\in V}$. The degree of a divisor ${\underline{d}}$ is defined as $|{\underline{d}}|=\sum_{v\in V}{\underline{d}}_v$ and we write ${\operatorname{Div}}^k(G)$ for the set of divisors of degree $k$. If ${\underline{d}},{\underline{d}}'\in {\operatorname{Div}}(G)$ are such that ${\underline{d}}_v\leq {\underline{d}}'_v$ for every $v\in V$, we write ${\underline{d}}\leq {\underline{d}}'$. If $S\subset E$, then $G$ and $G-S$ have the same vertices, hence we shall identify $ {\operatorname{Div}}(G)={\operatorname{Div}}(G-S). $ If $Z\subset V$ we write ${\underline{d}}_Z$ for the restriction of ${\underline{d}}$ to $Z$ and $|{\underline{d}}_Z|=\sum _{v\in Z}{\underline{d}}_v$. To a generalized orientation $O\in {\mathcal O}^b(G) $ (recall that if $E(G)$ is not empty $b$ is the number of bioriented edges) we associate a divisor, ${\underline{d}}^O\in {\operatorname{Div}}(G)$, whose $v$ coordinate, for every $v\in V$, is defined as follows $$ {\underline{d}}^{O}_v:= \begin{cases} w(v)-1+{\underline{t}}^O_v & \text{ if } E(G)\neq \emptyset \\ w(v)-1+b & \text{ if } E(G)= \emptyset\\ \end{cases} $$ where $ {\underline{t}}^{O}_v $ denotes the number of half-edges having $v$ as target, so that ${\underline{t}}^{O}:=\{{\underline{t}}^{O}_v\}$ is also in $ {\operatorname{Div}}(G)$. If $G$ is connected and $O\in {\mathcal O}^b(G)$ we have \begin{equation} \label{degto} |{\underline{d}}^O|= g(G)-1+b. \end{equation} For any $Z\subset V$ we denote by $t^O(Z)$ the number of edges not contained in $G[Z]$ having target in $Z$, and by $b(Z)$ the number of bioriented edges contained in $G[Z]$. Notice the following \begin{equation} \label{tOZ} t^O(Z)= \sum_{z\in Z}{\underline{t}}_z^O - |E(G[Z])| -b(Z). \end{equation} The following trivial lemma generalizes \eqref{degto}. \begin{lemma} Let $O$ be a $b$-orientation on $G$ and let $Z\subset V$ be such that $G[Z]$ is connected. Then \begin{equation} \label{degtZ} |{\underline{d}}_Z^O|= g(Z)-1+b(Z)+t^O(Z). \end{equation} \end{lemma} \begin{proof} We have $$ |{\underline{d}}^{O}_Z|=\sum_{z\in Z}{\underline{d}}_v^O=\sum_{z\in Z}(w(z) -1+ {\underline{t}}_z^O)= \sum_{z\in Z}w(z) -|Z|+\sum_{z\in Z}{\underline{t}}_z^O. $$ Now, $g(Z)=\sum_{z\in Z}w(z) -|Z|+ |E(G[Z])|+1$ hence, by \eqref{tOZ}, $ |{\underline{d}}^{O}_Z|= g(Z)-1-|E(G[Z])|+\sum_{z\in Z}{\underline{t}}_z^O = g(Z)-1+b(Z)+t^O(Z). $ \end{proof} The following lemmas characterize totally cyclic and rooted orientations. They are slight generalizations of \cite[Lemma 1]{Be08} and the remark thereafter. \begin{lemma} \label{lm0} Let $O$ be a $0$-orientation on a connected graph $G$. The following are equivalent. \begin{enumerate}[(a)] \item \label{lm0a} $O$ is totally cyclic. \item \label{lm0b} $ t^O(Z)> 0$ for every non empty $Z\subsetneq V$. \item \label{lm0c} $ t^O(Z)> 0$ for every non empty $Z\subsetneq V$ with $G[Z]$ connected. \item \label{lm0d} $ |{\underline{d}}^{O}_Z|>g(Z)-1 $ for every non empty $Z\subsetneq V$ with $G[Z]$ connected. \end{enumerate} \end{lemma} \begin{proof} \eqref{lm0a} $\Rightarrow$ \eqref{lm0b}. By hypothesis the cut $E(Z,Z^c)$ must have some edge with target in $Z$, hence $ t^O(Z)> 0$. \eqref{lm0b} $\Rightarrow$\eqref{lm0c} is obvious. \eqref{lm0c} $\Rightarrow$\eqref{lm0d}. By \eqref{degtZ} (with $b(Z)=0$) and by hypothesis we have $$ |{\underline{d}}^{O}_Z|=g(Z) -1 + t^O(Z)>g(Z) -1. $$ \eqref{lm0d} $\Rightarrow$ \eqref{lm0a}. Let $E(U,U^c)$ be a cut in $G$, we must prove that $E(U,U^c)$ is not a directed cut. Let $Z\subset U$ such that $G[Z]$ is a connected component of $G[U]$. Of course, $E(Z,Z^c)\subset E(U,U^c)$. By \eqref{degtZ} we have $$ t^O(Z)= |{\underline{d}}^{O}_Z|-(g(Z)-1)>0 $$ where the inequality follows by hypothesis. Hence $E(U,U^c)$ has an edge with target in $Z$, hence in $U$. The same argument applied to $U^c$ shows that $E(U,U^c)$ has an edge with target in $U^c$. \end{proof} \begin{lemma} \label{lmO1} Let $O$ be a non empty 1-orientation on $G$ and let $e$ be its bioriented edge. The following are equivalent. \begin{enumerate}[(a)] \item \label{lmO1a} $O$ is $e$-rooted. \item \label{lmO1b} $ t^O(Z)> 0$ for every non empty $Z\subset V$ with $e\not\in G[Z]$. \item \label{lmO1c} $ t^O(Z)> 0$ for every non empty $Z\subset V$ such that $G[Z]$ is connected and $e\not\in G[Z]$. \item \label{lmO1d} $ |{\underline{d}}^{O}_Z|>g(Z)-1 $ for every $Z\subsetneq V$ such that $G[Z]$ is connected. \end{enumerate} \end{lemma} \begin{proof} \eqref{lmO1a} $\Rightarrow$ \eqref{lmO1b}. By hypothesis $e\in G[Z^c]$. As $O$ is rooted the cut $E(Z,Z^c)$ must have some edge with target in $Z$, hence $ t^O(Z)> 0$. \eqref{lmO1b} $\Rightarrow$\eqref{lmO1c} is obvious. \eqref{lmO1c} $\Rightarrow$\eqref{lmO1d}. If $e\not\in G[Z]$ the proof is the same as for Lemma~\ref{lm0}. If $e\in G[Z]$ we apply \eqref{degtZ}; as $b(Z)=1$ we get $$ |{\underline{d}}^{O}_Z|= g(Z) + t^O(Z) \geq g(Z)>g(Z)-1. $$ \eqref{lm0d} $\Rightarrow$ \eqref{lm0a}. Let $E(U,U^c)$ be a cut in $G$ with $e\in G[U]$. Let $W$ be a connected component of $G[U^c]$, it suffices to show that $E(U,U^c)$ contains an edge with target in $W$. Now \eqref{degtZ} applied to $W$ yields $$ g(W) -1 + t^O(W)= |{\underline{d}}^{O}_W|>g(W)-1, $$ by hypothesis. Hence $t^O(W)>0$, as wanted. \end{proof} \subsection{Equivalence of generalized orientations} \begin{defi} \label{defequivo} We define two generalized orientations, $O$ and $O'$, on a graph $G$ to be {\it equivalent}, and write $O\sim O'$, if ${\underline{d}}^O={\underline{d}}^{O'}$. We denote by ${\overline{O}}$ the equivalence class of $O$. \end{defi} \begin{remark} \label{eqOrk} Let $O$ and $O'$ be two $b$-orientations, with $b=0,1$. By Lemmas~\ref{lm0} and \ref{lmO1}, if $O\sim O'$ then $O$ is totally cyclic (resp. rooted) if and only if so is $O'$. \end{remark} We now introduce the sets of equivalence classes of totally cyclic orientations, and of rooted 1-orientations, on $G$ written \begin{equation} \label{ocG} \overline{{\mathcal O}}^0(G):={\mathcal O}^0(G)/\sim \quad \quad \text{and} \quad \quad \overline{{\mathcal O}}^1(G):={\mathcal O}^1(G)/\sim. \end{equation} \begin{remark} \label{revpath}{\it Equivalence of 1-orientations through reversal of directed paths.} Let $O$ be a 1-orientation whose bioriented edge $e$ has ends $v_0, v_1$. We say that a path $P\subset G$ is $O$-directed from $e$ to $v$, with $v\neq v_0,v_1$, if the first edge of $P$ is $e$ and if the component of $P-e$ containing $v$ is a directed path with $v$ as target. Let $P\subset G$ be an $O$-directed path from $e$ to $v_{n+1}$ as in the picture below \begin{figure}[h] \begin{equation*} \xymatrix@=.4pc{ *{\bullet} \ar@{<->}[rrr] ^(1){v_1}^(0){v_0}_(.5){e}&&& *{\bullet} \ar@{->} [rr]^(1){v_2} &&*{\bullet} \ar@{.>} [rrr]&&&*{\bullet}\ar@{->}[rr] ^(0){v_n}^(1){v_{n+1}}_(.5){e'}&& *{\bullet} &&&&&& *{\bullet} \ar@{<-}[rr] ^(1){v_1}^(0){v_0}_(.5){e}&& *{\bullet} \ar@{<-} [rr]^(1){v_2} &&*{\bullet} \ar@{<.} [rrr]&&&*{\bullet}\ar@{<->}[rrr] ^(0){v_n}^(1){v_{n+1}}_(.5){e'}&&& *{\bullet} \\ &&&&&&O& &&&&&&&&&&&&&O'&&&&&&&} \end{equation*} \end{figure} Let $e'\subset P$ be the last edge of the path, so that the ends of $e'$ are $v_n$ and $v_{n+1}$. Define a new 1-orientation, $O'$ on $G$ as follows. Let $e'$ be the bioriented edge, reverse the orientation on every remaining edge of $P$, and fix on $e$ the orientation from $v_1$ to $v_0$. Notice that $P$ is an $O'$-directed path from $e'$ to $v_0$. Let $O'$ coincide with $O$ on the remaining edges of $G$. It is clear that $O$ and $O'$ are equivalent. \end{remark} \begin{lemma} \label{lmfree} Let $O$ be a non empty 1-orientation on a connected graph $G$ and let $e$ be its bioriented edge. The following are equivalent. \begin{enumerate}[(a)] \item \label{lmfreea} $O$ is $e$-rooted. \item \label{lmfreeb} For every $v\in V$ there exists an $O$-directed path from $e$ to $v$. \item \label{lmfreec} For every $e'\in E$ there exists a 1-orientation $O'$ whose bioriented edge is $e'$ and such that $O\sim O'$. \end{enumerate} \end{lemma} \begin{proof} \eqref{lmfreea} $\Rightarrow$ \eqref{lmfreeb}. Let $x,y$ be the ends of $e$ and let $Z_1=\{x,y\}$. Since $O$ is $e$-rooted and $e\in G[Z_1]$ the set, $W_1$, of vertices in $Z_1^c$ that are targets of edges with source in $Z_1$ is not empty. Set $Z_2=Z_1\cup W_1$. If $W_1$ contains $v$ we are done. If not, we iterate as follows. As $O$ is rooted the set, $W_2$, of vertices in $Z_2^c$ that are targets of edges with source in $Z_2$ is not empty. By construction, every vertex $w$ in $W_2$ is the target of an edge with source in $W_1$, and hence $w$ is the last vertex of a directed path starting with $e$. If $W_2$ contains $v$ we are done, otherwise we iterate. Since $G$ is connected, after finitely many steps this process includes all vertices of $G$, so we are done. \eqref{lmfreeb} $\Rightarrow$ \eqref{lmfreec}. Let $e'$ be oriented from $v$ to $w$ and let $P$ be an $O$-directed path from $e$ to $v$. We define $O'$ as the 1-orientation obtained by reversing the orientation of $P$, as defined in \ref{revpath}. \eqref{lmfreec} $\Rightarrow$ \eqref{lmfreea}. By contradiction, suppose $O$ is not rooted. Hence there exists a cut $E(Z,Z^c)$ directed away from $Z$ and such that $e\in G[Z^c]$. Up to replacing $Z$ with a subset, we can assume that $G[Z]$ is connected. We thus have $t^O(Z)=0$ and, as $e\not\in G[Z]$, \begin{equation} \label{eqlmfreea} |{\underline{d}}^O_{Z}|=g(Z)-1+t^O(Z)=g(Z)-1. \end{equation} Pick $e'\in G[Z]$ and let $O'$ be a 1-orientation with $e'$ as bioriented edge such that $O\sim O'$, which exists by hypothesis. As $e' \in G[Z]$ we have $$ |{\underline{d}}^O_{Z}|= |{\underline{d}}^{O'}_{Z}|=g(Z)+t^{O'}(Z)\geq g(Z) $$ a contradiction with \eqref{eqlmfreea}. \end{proof} \subsection{The posets of bridgeless and connected subgraphs} \label{brisec} Let $G$ be a graph and $E$ its edge-set. The set of all subsets of $E$, written ${\mathcal P}(E)$, will be considered as a poset with respect to reverse inclusion, i.e. we set \begin{equation} \label{ri} S\leq S' \quad \text{ if } \quad S'\subset S \end{equation} for any $S, S'\subset E$. We are interested in two special sub-posets of ${\mathcal P}(E)$, written $\AGt$ and $\AGr$, related to totally cyclic orientations, respectively rooted, orientations. We saw that ${\mathcal O}^0(G)\neq \emptyset$ (i.e. $G$ admits a totally cyclic orientation) only if $G$ is free from bridges. We need to study all totally cyclic orientations on all spanning subgraphs of $G$, so we consider the following set $$ \AGt:=\{S\subset E: (G-S)_{br}=\emptyset\}. $$ Next, we know ${\mathcal O}^1(G)\neq \emptyset$ (i.e. $G$ admits a rooted $1$-orientation) only if $G$ is connected, hence we set $$ \AGr:=\{S\subset E: \ G-S \text{ is connected}\}. $$ Of course, $\AGr$ is empty if $G$ is not connected. \begin{lemma} \label{rkBP} Let $b=0,1$ and assume $G$ connected if $b=1$. Then $\AGb$ is a graded poset with respect to \eqref{ri}, with rank function mapping $S$ to $ g(G-S).$ \end{lemma} In particular, $ \AGt$ has $E$ as unique minimal element and $G_{br}$ as unique maximal element, with $ g(G-E) =\sum_{v\in V}w(v)$ and $g(G-G_{br})= g(G)$. If $G$ is connected, then $ \AGr$ has $\emptyset$ as unique maximal element, and its minimal elements are the $S\subset E$ such that $G-S$ is a spanning tree. \begin{remark} \label{nobri} For any $S\subset E$ we have $\At_{G-S}\hookrightarrow \AGt$. If $S=G _{br}$ the injection induces an identification $ \AGt= \At_{G-G _{br}} . $ Indeed, for every $S\in \AGt$ we have $G _{br}\subset S$, hence $S$ is also an element of $ \At_{G-G _{br}}$. \end{remark} \subsection{Posets of orientations.} We shall be considering generalized orientations defined on various spanning subgraphs of a fixed graph $G$. To keep track of these subgraphs we shall use subscripts, as follows. Given $S\subset E$, we shall denote by $O_S$ a generalized orientation on $G-S$. A generalized orientation with no subscript will be defined on the whole graph. \begin{defi} \label{podef} Let $G$ be a graph and let $S,T\subset E(G)$. Given two generalized orientations $O_S$ on $G-S$ and $O_T$ on $G-T$ we set $$ O_S\leq O_T \quad \text{ if } \quad S\leq T \quad \text{and} \quad (O_{T})_{|G-S}= O _S. $$ \end{defi} It is easy to check that the above is a partial order. We introduce, for a fixed graph $G$, the set of all totally cyclic orientations on all spanning subgraphs of $G$. \begin{equation} \label{O1} \OPt_G:= \bigsqcup_{S\in \AGt}{{{\mathcal O}}^0}(G-S). \end{equation} Similarly, for rooted $1$-orientations \begin{equation} \label{Ob} \OPb_G:= \bigsqcup_{S\in \AGr}{{{\mathcal O}}^1}(G-S). \end{equation} The notation ``${\mathcal{OP}}$" indicates that $ \OPt_G$ and $\OPb_G$ are endowed with the poset structure introduced by Definition~\ref{podef}. Finally, we consider orientations up to equivalence: \begin{equation} \label{O3} \OGt := \bigsqcup_{S\in \AGt}{{\overline{{\mathcal O}}}^0}(G-S) \quad {\text{ and }} \quad \OGb := \bigsqcup_{S\in \AGr}{{\overline{{\mathcal O}}}^1}(G-S). \end{equation} We will define a poset structure on $\OGt$ and $\OGb$. We fix the following \begin{conv} \label{convo} Let $S\subset E(G)$ and consider $G(S)=G/(E-S)$. Fix a $b$-orientation, $\tilde{O}$, on $G(S)$. We have identifications $E(G(S))=E(\langle S \rangle)=S, $ hence we can define a $b$-orientation, $\tilde{O}^*$, on $\langle S \rangle$ as follows. Let $e\in S$. If $e$ is $\tilde{O}$-bioriented then $e$ gets $\tilde{O}^*$-bioriented. If $e$ is not a loop of $G(S)$ then $e$ gets $\tilde{O}^*$-oriented according to $\tilde{O}$. If $e$ is a loop of $G(S)$ we choose an arbitrary orientation on $e$. We refer to $\tilde{O}^*$ as a $b$-orientation {\it induced by $\tilde{O}$}. \end{conv} \begin{lemma} \label{quoto} Let $b=0,1$ and $S,T\in \AGb$ with $T\subset S$. Then for every $O_S\in {\mathcal O}^b(G-S)$ there exists ${O}_T\in {\mathcal O}^b(G-T)$ such that ${O}_T\geq O_S$. Moreover, if $O _S\sim O'_{S}$ for some $O_{S}'\in {\mathcal O}^b(G-S)$, there exists $ {O'}_T\in {\mathcal O}^b(G-T)$ such that ${O'}_T\geq O_{S}'$ and ${O'}_T\sim O_T$. \end{lemma} \begin{proof} We first assume $b=0$. Up to replacing $G$ with $G-T$, we can assume $T=\emptyset$ and $G$ bridgeless. Hence $G(S)$ is bridgless and we can fix a totally cyclic orientation, $\tilde{O}$, on it. Using \ref{convo}, $\tilde{O}$ induces an orientation, $\tilde{O}^*$, on $\langle S \rangle$. Then $O_T:=O_S\cup \tilde{O}^*$ is an orientation on $G$. We claim $O_T$ is totally cyclic. By contradiction, let $F\subset E(G)$ be an $O_T$-directed cut of $G$. Then $F\cap E(G-S)=\emptyset$, as $G-S$ admits no $O_S$-directed cuts. Therefore $F\subset S$, hence, using Lemma~\ref{ftriv} \eqref{ftrivcut}, $F$ is a directed cut of $G(S)$, which is not possible. Finally, if $O_S\sim O_{S}'$, we construct $O_{T}'$ using the same orientations $\tilde{O}$ and $\tilde{O}^*$ used to construct $O_T$. Obviously, ${\underline{d}}^{O_T}={\underline{d}}^{O_{T}'}$, hence we are done. The proof for $b=1$ follows the same steps. Up to replacing $G$ with $G-T$ we can assume $T=\emptyset$. Now $G(S)$ is bridgeless. Indeed, if $e\in S$ is a bridge of $G(S)$ it has to be a bridge of $G$, and hence $G-S$ is not connected, which is impossible by hypothesis. We can thus fix a totally cyclic $0$-orientation, $\tilde{O}$, on $G(S)$, and let $\tilde{O}^*$ be a $0$-orientation on $\langle S \rangle$ induced by $\tilde{O}$. Set $O_T:=O_S\cup \tilde{O}^*$; arguing as for $b=0$ one checks that $O_T$ is a rooted 1-orientation on $G$. The rest of the proof is the same as for $b=0$. \end{proof} \begin{prop} \label{poo} Let $b=0,1$. Then $\OG$ is partially ordered as follows. For ${\overline{O}}_S $ and ${\overline{O}}_T$ we set $ {\overline{O}}_S\leq {\overline{O}}_T$ if $S\leq T$ and if one of the two equivalent conditions below holds. \begin{enumerate}[(i)] \item \label{exist} There exist $O'_{S}\in {\overline{O}}_S$ and $O'_{T}\in {\overline{O}}_T$ such that $ (O'_{T})_{|G-S}= O' _{S}. $ \item \label{forall} For every $O'_{S}\in {\overline{O}}_S$ there exists $O'_{T}\in {\overline{O}}_T$ such that $ (O'_{T})_{|G-S}= O' _{S}.$ \end{enumerate} Moreover, the forgetful map, $ \OG \to \AGb$, sending ${\overline{O}}_S$ to $S$, is a quotient of poset, and the map sending $ {\overline{O}}_S$ to $g(G-S) $ is a rank on $\OG$. \end{prop} \begin{proof} Lemma~\ref{quoto} yields that \eqref{exist} implies \eqref{forall}, and the converse is obvious. Lemma~\ref{posettriv} yields that we have a partial order on $ \OG$. The two forgetful maps are onto by Fact~\ref{F1} and Lemma~\ref{LmO}, and they are quotients by Lemma~\ref{quoto}. The rest of the statement is clear. \end{proof} \begin{remark} If ${\overline{O}}_S\leq {\overline{O}}_T$ then ${\underline{d}}^{O_S} \leq {\underline{d}}^{O _{T}} $, but the converse is not true. See Figure 2, where all vertices have weight $1$, $T=\emptyset$ and $S$ consists of the bottom edge on the right of the first graph. \begin{figure}[h] \begin{equation*} \xymatrix@=.5pc{ &&&&&&&&&&&&&&\\ &&&*{\bullet}\ar@{<-} @/^ 1.4pc/[rrrr]^(.02){2}\ar@{->}[rrrr]\ar@{<-} @/_1.4pc/[rrrr]_{ }&&&&*{\bullet} \ar@{<-} @/^ 1.2pc/[rrrr]^(1.1){3}\ar@{->} [rrrr]^(1){\;\; 1}\ar@{<-} @/_1.1pc/[rrrr]&&&&*{\bullet} &&&& *{\bullet}\ar@{->} @/^ 1.4pc/[rrrr]^(.06){1}\ar@{<-}[rrrr]\ar@{->} @/_1.4pc/[rrrr]_{ }&&&&*{\bullet} \ar@{<-} @/^ 1.2pc/[rrrr]^(1.1){3}\ar@{->} [rrrr]^(1){\;\; 1} &&&&*{\bullet} &&& &&&&&& \\ \\ &&&&&&&&{\underline{d}}^{O_T}& &&&&&&&&&&&{\underline{d}}^{O_S}&&&&&&&} \end{equation*} \caption{${\underline{d}}^{O_S}\leq{\underline{d}}^{O_T}$ but ${\overline{O}}_S\not\leq {\overline{O}}_T$} \end{figure} \end{remark} Using Remark~\ref{nobri} and similarly to it, we have \begin{remark} \label{nobrio} For any $S\subset E$ we have $\OPt_{G-S}\subset \OPt_G$. If $S=G _{br}$ we have two identifications $$ \OPt_G=\OPt_{G-G _{br}}\quad \quad \quad \quad \OGt={\overline{\mathcal{OP}}^0}_{G-G _{br}}. $$ \end{remark} \begin{remark} \label{noinjdeg} Consider the map \begin{equation} \label{OGmap} \OGt \longrightarrow {\operatorname{Div}}(G); \quad \quad O_S\mapsto {\underline{d}}^{O_S}. \end{equation} Its restriction to ${\overline{\mathcal{O}}^0}(G-S)$ is injective for every $S\in \AGt$, yet, the map is not injective. See the following picture, where $S$ and $T$ are the dotted edges. \begin{figure}[h] \begin{equation*} \xymatrix@=.5pc{ &&&&&&&&&&&&&&\\ &&&*{\bullet}\ar@{<-} @/^ 1.4pc/[rrrr]^(.02){1}\ar@{->}[rrrr]\ar@{.} @/_1.4pc/[rrrr]_{S}&&&&*{\bullet} \ar@{<-} @/^ 1.2pc/[rrrr]^(1.1){3}\ar@{->} [rrrr]^(1){\;\; 1}\ar@{<-} @/_1.1pc/[rrrr]&&&&*{\bullet} &&&& *{\bullet}\ar@{->} @/^ 1.4pc/[rrrr]^(.06){1}\ar@{<-}[rrrr]\ar@{->} @/_1.4pc/[rrrr]_{ }&&&&*{\bullet} \ar@{<-} @/^ 1.2pc/[rrrr]^(1.1){3}\ar@{->} [rrrr]^(1){\;\; 1}\ar@{.} @/_1.1pc/[rrrr]_{T} &&&&*{\bullet} &&& &&&&&& } \end{equation*} \caption{${\underline{d}}^{O_S}={\underline{d}}^{O_T}$ but ${\overline{O}}_S\not\sim {\overline{O}}_T$} \end{figure} \end{remark} \section{Functoriality under edge-contractions} \label{secfun} In this section and we establish the combinatorial results, which we believe bear an interest on their own, we shall apply in Section~\ref{finsec} to the algebro-geometric set-up. The goal is to study the functorial behaviour of generalized orientations with respect to edge-contractions. Indeed, as we shall see, edge-contractions of graphs are naturally associated to degenerations of curves, and conversely, to any edge-contraction there corresponds a (non-unique) degeneration of curves. \subsection{Edge-contractions} \label{consec} Let $G$ be a graph and $S\subset E$ a set of edges of $G$. The {\it (weighted) contraction} of $S$ is a map of weighted graphs, $ \gamma: G\to G/S $ (introduced in \cite{BMV}). Informally $\gamma$ is given by contracting to a vertex every edge in $S$, and such that the weight of a vertex $v$ of $G/S$ equals the genus of the subgraph of $G$ which gets contracted into $v$. Rigorously, consider the subgraph, $\langle S\rangle \subset G$, spanned by the edges in $S$ and let $\langle S\rangle = H_1\sqcup \ldots \sqcup H_m$ be its decomposition in connected components. Now set $$ V(G/S):= V(G)\smallsetminus V(\langle S\rangle)\sqcup \{v_1,\ldots, v_m\}, \quad \quad E(G/S):=E(G)\smallsetminus S. $$ We have two maps, \begin{equation} \label{gammaVE} \gamma_V:V(G)\longrightarrow V(G/S) \quad \text{and} \quad \gamma_E:E(G)\longrightarrow E(G/S)\cup V(G/S), \end{equation} where $\gamma_V$ is the identity on $V(G)\smallsetminus V(\langle S\rangle)$ and maps every vertex of $H_i$ to $v_i$, and $\gamma_E$ is the identity on $E(G)\smallsetminus S$ and maps every $e\in S$ to $v_i$ such that $e$ lies in $H_i$. It is clear that $\gamma_V$ and $\gamma_E$ determine a morphism of graphs $ \gamma: G\to G/S$, as wanted. Finally, the weight function $w_{/S}:V(G/S)\to {\mathbb{N}}$ is defined as follows: $$ w_{/S}(v)=g(\gamma^{-1}(v)). $$ Indeed, $\gamma^{-1}(v)$ is the subgraph of $G$ induced by the subset $\gamma_V^{-1}(v) \subset V(G)$, hence its genus is well defined. For convenience we view the identity of $G$ as the trivial contraction. \begin{remark} \label{ftrivrk} We list some useful consequences of the definition. \begin{enumerate}[(a)] \item \label{ftriv0} $G$ is connected if and only if $G/S$ is connected. \item \label{ftrivg} $g(G)=g(G/S)$. \item \label{ftriv1} If $G$ is stable, or semistable, so is $G/S$. \end{enumerate} \end{remark} Let $S\subset E(G)$ be a subset of edges of a graph $G$, we set \begin{equation} \label{G(S)} G(S) =G/(E\smallsetminus S). \end{equation} \begin{lemma} \label{ftriv} Let $S\subset E(G)$ and $H:=G/S$. Let $T\subset E(H)$. Then \begin{enumerate}[(a)] \item \label{ftriv2} $H-T =(G-T)/S$. \item \label{ftriv3} $H(T)=G(T)/S=G(T)$. \item \label{ftrivcut} $T$ is a cut of $H$ if and only $T$ is a cut of $G$. \item \label{ftriv4} $H_{br}=\emptyset$ if and only if $G_{br}\subset S$. \end{enumerate} \end{lemma} \begin{proof} It suffices to assume $S=\{e\}$; let $x,y\in V$ be the ends of $e$. Denote by $v_e\in H$ the vertex to which $e$ is contracted; we have natural identifications $$ E(H)=E(G)\smallsetminus\{e\}\quad \text { and } \quad V(H)=V(G)\cup \{v_e\} \smallsetminus\{x,y\}. $$ Let us prove \eqref{ftriv2}. Using the above identities and the fact that $e\not\in T$, we have natural identifications (viewed as equalities): $$ E(H-T)= E(H)\smallsetminus T= E(G)\smallsetminus (T\cup \{e\} )=E(G-T)\smallsetminus \{e\}=E\Bigr(\frac{G-T}{e}\Bigl) $$ and, since $V(H-T)=V(H)$ $$ V(H-T) =V(G)\cup \{v_e\} \smallsetminus\{x,y\}=V(G-T)\cup \{v_e\} \smallsetminus\{x,y\}=V\Bigr(\frac{G-T}{e}\Bigl). $$ It is clear that the above identifications induce a natural isomorphism between $H-T$ and $(G-T)/e$. \eqref{ftriv2} is proved. \eqref{ftriv3}. We have $$ H(T)=\frac{H}{ E(H)\smallsetminus T }=\frac{G/e} {E(G)\smallsetminus (e \cup T)}=\frac{G }{ (E(G)\smallsetminus T)\cup e}=\frac{G(T) }{e}=G(T). $$ \eqref{ftrivcut}. By \eqref{ftriv2} we have $H-T=(G-T)/S$, which is connected if and only if $G-T$ is connected. \eqref{ftriv4}. Follows trivially from the preceeding parts. \end{proof} For two graphs, $G$ and $G'$, we define the {\it edge-contraction} relation: \begin{equation} \label{pograph} G'\geq G \quad \text {if } \quad G'=G/S \ \text{ for some } S\subset E(G). \end{equation} Edge-contraction is easily seen to be a partial order on the set of all graphs. \begin{prop} \label{rkSg} The set $\Sg$, endowed with the edge-contraction relation defined in \eqref{pograph}, is a graded poset with respect to the following rank $$ \Sg\longrightarrow {\mathbb{N}}:\quad \quad G\mapsto 3g-3-|E(G)|. $$ \end{prop} \begin{proof} It is well known that for every $G\in \Sg$ we have $|E(G)|\leq 3g-3$. Let us prove that $\Sg$ is graded. Let $G,H\in \Sg$ such that $H$ covers $G$. Hence $H=G/S$ for some non empty $S\subset E(G)$. We claim $|S|=1$. Indeed, if $|S|\geq 2$ there exists a non empty $S'\subsetneq S$. But then by Remark~\ref{ftrivrk} $G/S'\in \Sg$ and $ H>G/S'>G, $ a contradiction. Therefore $|S|=1$ and $|E(H)|=|E(G)|-1$ as wanted. \end{proof} \subsection{Bridgeless and connected subgraphs.} We now study the behaviour of $ \AGt$ and $ \AGr$, introduced in Subsection~\ref{brisec}, under edge-contractions. Let {\sc graphs} be the category whose objects are graphs and whose morphisms are contractions. Let {\sc posets} be the category whose objects are posets and whose morphisms are morphisms of posets. For $b=0,1$ we have a map between the objects of these categories, \begin{equation} \label{APP} \Ab: \{\text{{\sc graphs}}\} \longrightarrow\{\text{{\sc posets}}\}; \quad G \mapsto \AGb. \end{equation} Using this map, we shall define two functors from {\sc graphs} to {\sc posets}, a covariant functor, written $(\Ab, \Ab_*)$, and a contravariant functor, written $(\Ab, {\mathcal A}^{b*})$, so that $\Ab_*$ and ${\mathcal A}^{b*}$ are the functor maps defined on morphisms. \begin{lemma} \label{forward} Let $b=0,1$. For any $\gamma:G\to H=G/S_0$ and any $S\in \AGb$ set $$ \gamma_* S :=S\smallsetminus S_0. $$ Then the following hold. \begin{enumerate}[(a)] \item \label{flm0} $ \gamma_* S \in \Ab_H$. \item \label{flm1} If $T\in \AGb $ is such that $S\leq T$, then $\gamma_*S\leq \gamma_*T$. \item \label{forward2} Let ${ \delta}:H \to J$ be a contraction of $H$. Then $({ \delta}\circ \gamma)_*={ \delta}_*\circ \gamma_*$. \end{enumerate} In other words, the following is a covariant functor $$ (\Ab, \Ab_*):\text{{\sc graphs}}\longrightarrow \text{{\sc posets}} $$ where $\Ab_*(\gamma)(S)= \gamma_*S$ for every $\gamma:G\to H$ and $S\in \AGb$. \end{lemma} \begin{proof} We have, by Lemma~\ref{ftriv}\eqref{ftriv2} $$ H- \gamma_*S= H-(S\smallsetminus S_0) =\frac{G- (S\smallsetminus S_0)}{S_0}. $$ If $b=0$ we must check $H- \gamma_*S$ has no bridges. As $G-S$ has no bridges any bridge of $G- (S\smallsetminus S_0)$ must lie in $S_0$, hence its quotient by $S_0$ is bridgeless, and we are done. If $b=1$ we must prove $H- \gamma_*S$ is connected. As $G-S$ is connected so is $G- (S\smallsetminus S_0)$, hence so is its quotient. \eqref{flm0} is proved. \eqref{flm1} and \eqref{forward2} are obvious. \end{proof} Recall that $ \AGt$ and $ \AGr$ are graded posets. Now, the map $\gamma_*$ does not preserve the gradings. Indeed, let $e\in E(G)\smallsetminus G_{br}$. Set $S=S_0=\{e\}$ so that $\gamma_*S=\emptyset$. We have $g(G-S)=g(G)-1$ and $g(H-\gamma_*S)=g(H)=g(G)$. By contrast, the ``pull-back" map, with the associated contravariant functor, defined below does preserve the grading. \begin{lemma} \label{flm} Let $b=0,1$. For any $\gamma:G\to H=G/S_0$ and $T\in \Ab_H$ define $ \gamma^* T \subset E(G)$ as follows \begin{equation} \label{} \gamma^* T: =\begin{cases} T\cup(G-T)_{br} & \text{ if } b=0\\ T & \text{ if }b=1. \end{cases} \end{equation} Then the following hold. \begin{enumerate}[(a)] \item \label{flm0} $ \gamma^* T \in \AGb$ and $g(H-T)=g(G-\gamma^*T)$. \item \label{flm1} If $R\in \Ab_H$ is such that $R\leq T$, then $\gamma^*R\leq \gamma^*T$. \item \label{flm2} Let $\delta:H \to J$ be a contraction of $H$. Then $(\delta\circ \gamma)^*=\gamma^*\circ\delta^*$. \end{enumerate} In short, the following is a grading-preserving, contravariant functor $$ (\Ab, {\mathcal A}^{b*}):\text{{\sc graphs}}\longrightarrow \text{{\sc posets}} $$ where ${\mathcal A}^{b*}(\gamma)(T)= \gamma^*T$ for every $\gamma:G\to H$ and $T\in \Ab_H$. \end{lemma} \begin{proof} The only nontrivial claim of \eqref{flm0} is the last, i.e. that $\gamma^*$ preserves the rank. The proof in case $b=0$ trivially gives the proof for $b=1$, so let us concentrate on the former. $$ g(H-T)=g\Bigr(\frac{G-T}{S_0}\Bigl)=g(G-T)=g\Bigr((G-T)-(G-T)_{br}\Bigl)=g (G-\gamma^*T), $$ where we used Lemma~\ref{ftriv}\eqref{ftriv2} in the first equality, and that contractions and bridge-removals preserve the genus in the second and third equality. \eqref{flm1} is obvious if $b=1$. Let $R\in \At_H$ such that $T\subset R$. We must prove $\gamma^*T\subset \gamma^*R$. It is clearly enough to prove $ (G-T)_{br}\subset (G-R)_{br}. $ Since $(H-T)_{br}=\emptyset$ and, by Lemma~\ref{ftriv}\eqref{ftriv2}, $H-T=(G-T)/S_0$, we have $(G-T)_{br}\subset S_0$. Hence $(G-T)_{br}\cap R=\emptyset$. Therefore, as $G-R\subset G-T$, we have $ (G-T)_{br}\subset (G-R)_{br}$ as wanted. We omit the direct proof of \eqref{flm2}, which follows easily from \ref{fupr}\eqref{fupr2}. \end{proof} \begin{prop} \label{fupr} Let $b=0,1$. Fix a contraction $\gamma:G\to H=G/S_0$. Let $S\in \AGb$ and $T\in \Ab_H$. Then \begin{enumerate}[(a)] \item \label{fupr1} $ \gamma_* \gamma^* T=T$ (equivalently, $\Ab_*(\gamma){\mathcal A}^{b*}(\gamma)=\operatorname{id}_{\Ab_H}$). \item \label{fuprb} $T\subset \gamma_*S \Leftrightarrow \gamma^*T\subset S$. \item \label{fupr2} $\gamma^*T$ is the smallest element of $ \AGb$ whose image under $\gamma_*$ equals $T$. \item \label{fupr3} $\Ab_*( \gamma): \AGb \to \Ab_H $ is a quotient of posets. \item \label{fupr4} If $S_0\subset G_{br}$ then $\Ab_*( \gamma): \AGb \to \Ab_H $is an isomorphism. \end{enumerate} \end{prop} \begin{proof} \eqref{fupr1}, \eqref{fuprb} and \eqref{fupr2} are obvious if $b=1$, so assume $b=0$. We have $ \gamma_* \gamma^* T=\gamma_*(T\cup (G-T)_{br})=\bigr(T\cup (G-T)_{br}\bigl) \smallsetminus S_0. $ By hypothesis $(H-T)_{br}$ is empty, hence, by Lemma~\ref{ftriv}, $(G-T)_{br}\subset S_0$. Therefore $$ \gamma_* \gamma^* T=\bigr(T\cup (G-T)_{br}\bigl) \smallsetminus S_0= T \smallsetminus S_0=T. $$ \eqref{fupr1} is proved. The implication $\Leftarrow$ in \eqref{fuprb} follows trivially from \eqref{fupr1}. For the other implication, the hypothesis is $T \subset S\smallsetminus S_0$, hence $T\subset S$. Since $\gamma^*T= T\cup(G-T)_{br}$ it is enough to prove $(G-T)_{br}\subset S$. We have $G-S\subset G-T$, hence every bridge of $G-T$ is either contained in $S$, or a bridge of $G-S$. As $G-S$ is bridgeless, we conclude $(G-T)_{br}\subset S$. \eqref{fupr2} follows immediately from \eqref{fuprb}. \eqref{fupr3}. Part \eqref{fupr1} implies $\Ab_*(\gamma)$ is surjective and, for any $T,T'\in \At_H$, we have $T=\gamma_* \gamma^* T$ and $T'=\gamma_* \gamma^* T'$. By Lemma~\ref{flm}, if $T\leq T'$ then $ \gamma^* T\leq \gamma^* T'$. Hence we are done. \eqref{fupr4}. Notice that ${\mathcal A}^{b*}(\gamma)$ is obviously injective. If $S_0$ is made of bridges of $G$ then $S_0\subset S$ for any $S\in \AGt$, and $S\cap S_0=\emptyset$ for any $S\in \AGr$. Hence $\Ab_*(\gamma)$ is injective, and we are done. \end{proof} \subsection{Direct image of divisors and orientations} In this subsection we will denote by $\gamma:G\to G/S_0=H$ a contraction, with $S_0\subset E(G)$. To any contraction $\gamma$ we associate a map, easily checked to be a surjective group homomorphism, from $ {\operatorname{Div}}(G)$ to ${\operatorname{Div}} (H)$ mapping ${\underline{d}}$ to $\gamma_*{\underline{d}}$ defined as follows $$ (\gamma_* {\underline{d}})_v :=\sum _{z\in \gamma_V^{-1}(v)}{\underline{d}}_z $$ for any $v\in V(H)$. Let ${ \delta}:H \to J$ be a contraction. Then \begin{equation}\label{homo} ({ \delta}\circ \gamma)_*({\underline{d}})={ \delta}_* (\gamma_* ( {\underline{d}})). \end{equation} In the sequel we shall employ the following notation. Let $O$ be a generalized orientation on $G$ and let $\gamma:G\to H$ be a contraction. As $E(H)$ identifies with a subset of $E(G)$ we can restrict $O$ to $E(H)$, thus defining a generalized orientation on $H$, denoted by $O_{|H}$. Let $S\subset E$ and let $O_S$ be a generalized orientation on $G-S$. We have $ E(H-\gamma_*S)=E(G -S\cup S_0)\subset E(G-S), $ so we can define (abusing notation again) the following generalized orientation on $H-\gamma_*S$ \begin{equation} \label{defio} \gamma_* O_S :=(O_S)_{|H-\gamma_*S}. \end{equation} As a final piece of notation, to $\gamma$ and $S\subset E$ we associate the divisor ${\underline{c}}^{\gamma,S}$ on $H$ such that for any $v\in V(H)$ \begin{equation} \label{mcv} {\underline{c}}_v^{\gamma,S}:=|\{e\in S_0\cap S: \ \gamma(e)=v\}|. \end{equation} If $S=E(G)$ we write ${\underline{c}}^{\gamma} ={\underline{c}}^{\gamma,E(G)}$. Of course, $ {\underline{c}}^{\gamma,S}\geq 0$ and equality holds if and only if $S\cap S_0=\emptyset$. \begin{prop} \label{fprop} Let $G$ be a graph, $S\subset E$, and $O_S$ a $b$-orientation on $G-S$, with $b=0,1$. Let $\gamma:G\to H=G/S_0$ be a contraction such that no edge of $S_0$ is bioriented. Then $\gamma_*O_S$ is a $b$-orientation on $H-\gamma_*S$ and the following hold. \begin{enumerate}[(a)] \item \label{fprop1} If $O_S\in {\mathcal O}^b(G-S)$ then $\gamma_*O_S \in {\mathcal O}^b(H-\gamma_*S)$. \item \label{ffpropfunc} Let ${ \delta}:H \to J$ be a contraction of $H$. Then $({ \delta}\circ \gamma)_*O_S={ \delta}_* \gamma_* O_S $. \item \label{dlm} $\gamma_*{\underline{d}}^{O_S}= {\underline{d}}^{\gamma_*O_{S}}- {\underline{c}}^{\gamma,S}$. \item \label{fprop3} Let $O'_{S}$ be a $b$-orientation on $G-S$. If $O'_S\sim O_S$ then $\gamma_*O'_S\sim \gamma_*O_S$. \item \label{fprop4} Let $O_{T}$ be a $b$-orientation on $G-T$. If $ O_S \leq O_{T} $ then $ \gamma_*O_S \leq \gamma_*O_{T} $. \end{enumerate} \end{prop} \begin{proof} It is clear that $ \gamma_* O_S $ is a $b$-orientation on $H-\gamma_*S$ whose bioriented edge, in case $b=1$, is the same as that of $O_S$. \eqref{fprop1}. We need to show $\gamma_* O_S $ is totally cyclic if $b=0$, and rooted if $b=1$. It suffices to prove that if $F$ is a directed cut of $H -\gamma_*S$ then $F$ is a directed cut of $G-S$. We can assume $S_0=\{e_0\}$. If $e_0\not\in S$ then $\gamma_*S=S$. By Lemma~\ref{ftriv} \eqref{ftrivcut}, every directed cut of $H-S$ is also a directed cut of $G-S$ and we are done. If $e_0 \in S$ set $T=S\smallsetminus \{e_0\}$. We have $$ H -\gamma_*S=H -T= (G-T)/e_0. $$ A directed cut, $F$, of $H -\gamma_*S$ is thus a directed cut of $G-T$. Now, $G-S\subset G-T$, hence $F$ is a directed cut in $G-S$. \eqref{fprop1} is proved. \eqref{ffpropfunc} is trivial. \eqref{dlm}. For any $v\in V(H)$ set $Z_v=\gamma^{-1}(v)$, which is a connected subgraph of $G$. We have $ g(Z_v)=\sum_{z\in V(Z_v)} \bigr(w(z)-1 \bigl)+|E(Z_v)| +1$, hence $$ (\gamma_*{\underline{d}}^{O_S})_v= \sum_{z\in V(Z_v)}\bigr(w(z)-1+{\underline{t}}_z^{O_S}\bigl)=g(Z_v)-1-|E(Z_v)|+\sum_{z\in V(Z_v)} {\underline{t}}_z^{O_S}. $$ Let $t^{O_S}(Z_v)$ be the number of edges with target in $Z_v$ and not contained in it. As every edge of $Z_v$ lies in $S_0$, $$ |E(Z_v)| = \sum_{z\in V(Z_v)} {\underline{t}}_z^{O_S} - t^{O_S}(Z_v) + {\underline{c}}_v^{\gamma,S}. $$ Therefore \begin{equation} \label{eq*} (\gamma_*{\underline{d}}^{O_S})_v = g(Z_v) -1 + t^{O_S}(Z_v) - {\underline{c}}_v^{\gamma,S}. \end{equation} On the other hand we have \begin{equation} \label{eqzz} ({\underline{d}}^{\gamma_*O_S})_v= w_{/S_0}(v)-1+{\underline{t}}_v^{\gamma_*O_S} = g(Z_v)-1+ t^{O_S}(Z_v). \end{equation} Indeed, by definition of contraction, $w_{/S_0}(v)= g(Z_v)$ and, clearly, the number of $O_S$-incoming edges at $Z_v$ equals the number of $\gamma_*O_S$-incoming edges at $v$. Comparing \eqref{eq*} and \eqref{eqzz} yields \eqref{dlm}. \eqref{fprop3}. By hypothesis, ${\underline{d}}^{O_S}={\underline{d}}^{O'_{S}}$, hence ${\underline{t}}^{O_S}={\underline{t}}^{O'_{S}}$. Hence, by \eqref{tOZ}, for any $v\in V(H)$ we have $t^{O_S}(Z_v)= t^{O'_{S}}(Z_v)$ as $Z_v$ does not contain bioriented edges. Combining with \eqref{eqzz} we get ${\underline{d}}^{\gamma_*O_S}={\underline{d}}^{\gamma_*O'_{S}}$, and we are done. \eqref{fprop4}. By assumption we have $S\leq T$ and $ (O_{T})_{|G-S}= O _{S}$. We obviously have $ \gamma_*S\leq \gamma_*T $. Next, as $H- \gamma_*S\subset H-\gamma_*T $ $$ (\gamma_*O_{T})_{|H-\gamma_*S} = (O_T)_{|H-\gamma_*S}= (O_T\:_{|G-S})_{|H-\gamma_*S}=O _{S}\;_{|H-\gamma_*S}= \gamma_*O _{S}. $$ The proof is complete \end{proof} \begin{example} In the picture we have $S=S_0=\{e\}$. \begin{figure}[h] \begin{equation*} \xymatrix@=.5pc{ &&&&&&&&&&&&&&\\ &G=&*{\bullet}\ar@{<-} @/^ 1.4pc/[rrrr]^(.02){}\ar@{->}[rrrr]\ar@{.} @/_1.4pc/[rrrr]^{e}&&&& *{\bullet} \ar@{->} @/^ 1.6pc/[rrrr]^(1.1){}\ar@{<-} [rrrr]^(1){}\ar@{->} @/_1.5pc/[rrrr]&&&&*{\bullet} &\ar@{->}[rrr] && &&H=&&*{\bullet}\ar@{->}@(ul,ur)\ar@{->}@(ul,dl) \ar@{->} @/^ 1.2pc/[rrrr]\ar@{<-} @/_0.1pc/[rrrr]\ar@{->} @/_1.5pc/[rrrr]_(0,1){v_e}&&&&*{\bullet} &&& &&&&&&& \\ \\ &&&&& O_S &&&&&&&&&&&&&&\gamma_*O_S&&&&&&} \end{equation*} \caption{Case $S=S_0$} \end{figure} Assume all vertices of $G$ have weight $1$, so that $v_e$ has weight $2$ in $H$. We have, ordering the vertices from left to right, $ {\underline{t}}^{O_S}={\underline{d}}^{O_S} = (1,2,2)$, \ ${\underline{t}}^{\gamma_*O_S}=(3, 2),$ \ $ {\underline{d}}^{\gamma_*O_S}=(4, 2)$, and $ \gamma_*{\underline{d}}^{O_S} = (3,2). $ Hence ${\underline{d}}^{\gamma_*O_S}>\gamma_*{\underline{d}}^{O_S}$. \end{example} From the previous result we derive a few facts. \begin{prop} \label{fbar} Fix $\gamma:G\to H=G/S_0$ and let $b=0,1$. \begin{enumerate}[(a)] \item Let $b=0$. Then we have a morphism of posets $$ {\overline {\gamma}}_*:\OGt\longrightarrow \OHt; \quad {\overline{O}}_S\mapsto \overline {\gamma_*O_S}. $$ \item Let $b=1$ and $S_0\neq E(G)$. Then we have a morphism of posets $$ {\overline {\gamma}}_*:\OGb\longrightarrow \OHb; \quad {\overline{O}}_S\mapsto \overline {\gamma_*O'_{S}} $$ for any $O'_{S}\sim O_S$ whose bioriented edge is not in $S_0$. \item Let $b=0,1$ and let ${ \delta}:H \to H/T_0$ be a contraction; if $b=1$ assume $T_0\neq E(H)$. Then $\overline{({\delta}\circ \gamma)}_*={\overline {\delta}}_*\circ {\overline {\gamma}}_* $. \end{enumerate} \end{prop} \begin{proof} If $b=0$ the statement is a trivial consequence of \ref{fprop}. For $b=1$, pick any ${\overline{O}}_S\in \OGt$. By Lemma~\ref{lmfree}, there exists $O'_{S}\sim O_S$ whose bioriented edge does not lie in $S_0$. Then \ref{fprop} yields that $\gamma_*O'_{S}$ is a well-defined element in $\OPt_H$, and different choices of $O'_{S}$ yield equivalent elements in $\OPt_H$. Hence $ {\overline {\gamma}}_*{\overline{O}}_S$ is a well defined element of $\OHt$. The rest of the proof follows from \ref{fprop}. \end{proof} \begin{cor} \label{fdiag} Let $\gamma:G\to H=G/S_0$ be a contraction. Then we have a commutative diagram of posets $$\xymatrix{ \OPt_G\ar[rr]^{\gamma_*}\ar[d]_{} && \OPt_H\ar[d] \\ \OGt\ar[rr]^{\overline{\gamma}_*} && \OHt,} $$ where the vertical arrows are the quotient maps. If $S_0\subset G_{br}$ then the horizontal arrows are bijections.\end{cor} \begin{remark} If $S_0\subset G_{br}$ the lower arrow, $\overline{\gamma}_*$, is a bijection also for $b=1$. The proof uses a different language so we omit it as we will not need it. \end{remark} \begin{proof} The commutativity of the diagram follows from Propositions~\ref{fprop} and \ref{fbar}. For the remaining part it is enough to prove that $\gamma_*$ is a bijection. We have $S_0\subset S$ for all $S\in \AGt$ and we already know we have a bijection $ \AGt\to \At_H$ mapping $S$ to $\gamma_*S$. Now $G-S$ and $H-\gamma_*S$ have exactly the same edges, hence we have an injection $\gamma_*:{\mathcal O}^0(G-S)\hookrightarrow {\mathcal O}^0(H-\gamma_*S)$. We proved that $\gamma_*$ is injective. Now pick $O_T\in {\mathcal O}(H-T)$. Let $S=\gamma^*T=T\cup(G-T)_{br}$ so that $\gamma_*S=T$. We have $(G-T)_{br}\subset S_0$ hence $$ E(G-\gamma^*T)=E(G)\smallsetminus \bigr(T\cup(G-T)_{br}\bigl)\subset E(G)\smallsetminus (T\cup S_0)=E(H-T). $$ Therefore we can restrict $O_T$ to $G-\gamma^*T$, obtaining an orientation easily seen to be totally cyclic and to map to $O_T$ via $\gamma_*$. Hence $\gamma_*$ is surjective. \end{proof} \begin{cor} \label{bricor} The inclusion $\iota:G-G _{br}\hookrightarrow G$ and the contraction $\gamma: G\to G/G _{br}$ induce natural isomorphisms (viewed as identifications) $$ \OPt_{G-G _{br}} \stackrel{\iota_*}{=}\OPt_G\stackrel{\gamma_*}{=}{\OPt_{G/G _{br}} } $$ and $${\overline{\mathcal{OP}}^0}_{G-G _{br}} \stackrel{\overline{\iota}_*}{=}{\overline{\mathcal{OP}}^0_G}\stackrel{\overline{\gamma}_*}{=}{\overline{\mathcal{OP}}}^0_{G/G _{br}}. $$ \end{cor} \begin{proof} Combine Remark~\ref{nobrio} with \ref{fdiag}. \end{proof} \subsection{Quotients of orientation spaces} We shall now give a more precise description of the map $ {\overline {\gamma}}_*:\oOPGb\to \oOPHb $ introduced in Proposition~\ref{fbar}. \begin{thm} \label{fthm} Let $\gamma:G\to H=G/S_0$ be a contraction with $S_0\subsetneq E(G)$; let $b=0,1$. Then $ {\overline {\gamma}}_*:\oOPGb\to \oOPHb $ is a quotient of posets mapping $\overline{{\mathcal O}}^b(G-\gamma^*T)$ onto $ \overline{{\mathcal O}}^b(H-T) $ for every $T\subset E(H)$. \end{thm} We begin with the case $b=0$, for which we have the following. \begin{prop} \label{fsu} A contraction $\gamma:G\to H$ induces the quotient of posets $\gamma_*: \OPt_G\to \OPt_H$ mapping ${\mathcal O}^0(G-\gamma^*T)$ onto $ {\mathcal O}^0(H-T) $ for every $T\in \At_H$. \end{prop} \begin{proof} We proceed in three steps. Steps 1 and 2 prove that $\gamma_*$ is a quotient, Steps 1 and 3 prove that it is onto, as stated. \ \noindent {\bf Step 1}. {\it Suppose $G_{br}=\emptyset$, then the restriction of $\gamma_*$ to $ {\mathcal O}^0(G)$ gives a surjection $ {\mathcal O}^0(G)\twoheadrightarrow {\mathcal O}^0(H). $ } We can assume $S_0=\{e\}$. As $G_{br}=\emptyset$ we have $H_{br}=\emptyset$. Fix $\tilde{O}\in {\mathcal O}^0(H)$. If $e$ is a loop or if $H$ has only one vertex the statement is trivial, so we exclude this and let $x,y\in V(G)$ be the ends of $e$. Now, using convention~\ref{convo}, we have an orientation $\tilde{O}^*$ on $G-e$ induced by $\tilde{O}$. We shall denote $O_{e}=\tilde{O}^*$ and prove that we can extend $O_{e}$ to $e$ by a totally cyclic orientation on $G$, written $O$. Obviously, we will have $\gamma_*O=\tilde{O}$. We denote $v_e=\gamma(e)$. Since $\tilde{O}$ is totally cyclic we can fix a cyclically oriented cycle $ {C}\subset H$ containing $v_e$. Then it is easy to check that the edges of $ {C}$ generate in $G$ a subgraph, $P:=\langle E( {C}) \rangle$, which is an $O_e$-directed path having $x$ and $y$ as ends. Of course, $P$ does not contain $e$, hence $C_e:=P+e$ is a cycle in $G$. We now orient $e$ in such a way that $C_e$ becomes a cyclically oriented cycle. This gives an orientation, $O\geq O_e$, on $G$, which we claim is totally cyclic. Indeed, let $F\subset E(G)$ be an $O$-directed cut. Then $e\in F$ (for otherwise $F$ would be a $\tilde{O}$-directed cut of $H$). Hence $F\cap E(C_e)\neq \emptyset$, and hence $F\cap E(C_e)$ is a directed cut of the cyclically oriented cycle $C_e$. This is not possible. Step 1 is proved. \ \noindent {\bf Step 2}. {\it Let $O_T, O_R\in \OPt_H$ with $O_T\geq O_R$. Then there exist $O_{\gamma^*T},O_{\gamma^*R}\in \OPt_G$ such that $\gamma_*O_{\gamma^*T}=O_T$, $\gamma_*O_{\gamma^*R}=O_R$ and $O_{\gamma^*T}\geq O_{\gamma^*R}$.} By hypothesis $T\geq R$, hence $G-\gamma^*T\supset G-\gamma^*R$. We assume $S_0=\{e\}$ and we use the same set-up of Step 1. We begin by fixing a totally cyclic orientation $O_{\gamma^*R}$ induced by $O_{R}$ as described in Step 1. To define $O_{\gamma^*R}$ on $G-\gamma^*R$ the only choices we make are for non-loop edges corresponding to loops of $H-R$ (the orientation is chosen arbitrarily, see \ref{convo}), and for the contracted edge $e$, if $e\in G-\gamma^*R$ (the orientation is chosen to ensure total cyclicity). Now, among all orientations induced by $O_T$ on $G-\gamma^*T$ according to \ref{convo}, we choose one, written $O_{\gamma^*T}$, with the requirement that it agrees with $O_{\gamma^*R}$ on $G-\gamma^*R$. Hence every non loop-edge corresponding to a loop of $H-R$, is oriented in the same way as in $O_{\gamma^*R}$ and, more importantly, if the contracted edge $e$ is contained in $G-\gamma^*R$ then it has to be $O_{\gamma^*T}$-oriented as in $O_{\gamma^*R}$. Obviously, $O_{\gamma^*T}\geq O_{\gamma^*R}$. We need to check $O_{\gamma^*T}$ is totally cyclic. By construction, we need to prove it only in case $e\in G-\gamma^*R$ (in the other case the $O_{\gamma^*T}$-orientation on $e$ is given as in Step 1, to ensure $O_{\gamma^*T}$ is totally cyclic). By contradiction, let $F$ be a directed cut of $G-\gamma^*T$. Then $e\in F$, for otherwise $F$ would be a cut of $H-T$. Hence $F\cap E( G-\gamma^*R)$ is not empty. Hence $F$ induces a directed cut of $G-\gamma^*R$, which is not possible. \ \noindent {\bf Step 3}. {\it The restriction of $\gamma_*$ to $ {\mathcal O}^0(G-\gamma^*T)$ is a surjection onto $ {\mathcal O}^0(H-T). $} We shall reduce this to Step 1, to do which we need to handle the problem that $(G-\gamma^*T)/S_0$ may fail to be equal to $H-T$. Consider the contraction induced by restricting $\gamma$ to $G-T$ $$ \gamma_{|G-T}:G-T \longrightarrow (G-T)/S_0=H-T $$ (using \ref{ftriv} \eqref{ftriv2}). We have $(G-T)_{br}\subset S_0$, hence we can factor $\gamma_{|G-T}$ $$ \gamma_{|G-T}:G-T \longrightarrow (G-T)/(G-T)_{br} \stackrel{\gamma'}{\longrightarrow} (G-T)/S_0=H-T. $$ Set $$J:=\frac{G-T}{(G-T)_{br}}, \quad \quad \tilde{J}:=\frac{J}{S_0- (G-T)_{br}}=H-T. $$ As $J$ is bridgeless we can apply the conclusion of Step 1 to the contraction $\gamma':J\to \tilde{J}$. Hence $\gamma'_*$ yields a surjection \begin{equation} \label{OOHH} {\mathcal O}^0(J) \longrightarrow {\mathcal O}^0(\tilde{J})= {\mathcal O}^0(H-T). \end{equation} On the other hand we have natural identifications $$ \OPt_J =\OPt_{G-T}= \OPt_{(G-T)-(G-T)_{br}} = \OPt_{G-\gamma^*T} $$ using \ref{bricor} for the first two equalities. Combining with \eqref{OOHH} we obtain the surjection $ \OPt_{G-\gamma^*T} \to \OPt_{H-T}. $ Step 3 and the Proposition are proved. \end{proof} \noindent {\it {Proof of Theorem~\ref{fthm}.}} The case $b=0$ follows from Proposition~\ref{fsu}. Suppose $b=1$. We argue similarly to the proof of Proposition~\ref{fsu}. We begin by proving that $\overline{\gamma}_*$ induces a surjection $ \overline{{\mathcal O}}^1(G)\twoheadrightarrow\overline{{\mathcal O}}^1(H). $ We can assume $G$ and $H$ connected, and $S_0=\{e\}$; we write $v_e=\gamma(e)$ and $x,y\in V(G)$ for the ends of $e$ ($x\neq y$ otherwise we are done). Fix $\tilde{O}\in {\mathcal O}^1(H)$, then, by \ref{convo}, we have a $1$-orientation $O_{e}= \tilde{O}^*$ on $G-e$ induced by $\tilde{O}$. We shall prove we can extend $O_{e}$ by a rooted orientation, $O$, on $G$, whose bioriented edge is the same as that of $\tilde{O}$, denoted by $\tilde{e}$. We shall use \ref{lmfree}. As $\tilde{O}$ is rooted, there exists a directed path $\tilde{P}\subset H$ from $\tilde{e}$ to $v_e$. It is clear that the edges of $\tilde{P}$ span in $G$ a directed path, $P$, from $\tilde{e}$ to $x$ (say) and not containing $e$. We set $P_e=P+e$ and orient $e$ so that $P_e$ is a directed path from $\tilde{e}$ to $y$. Let $O$ be the so-obtained orientation on $G$; we shall prove it is rooted using \ref{lmfree} \eqref{lmfreeb}. Let $w\in V(G)$, we must exhibit an $O$-directed path from $\tilde{e}$ to $w$. If $w=x,y$ it suffices to take $P$ or $P_e$. So we can assume $w$ is also a vertex of $H$ different from $v_e$. Let $\tilde{P}_w\subset H$ be a directed path from $\tilde{e}$ to $w$. If $\tilde{P}_w$ does not contain $v_e$ then $\tilde{P}_w$ is naturally identified with a directed path in $G$ from $\tilde{e}$ to $w$ and we are done. If $v_e$ is in $\tilde{P}_w$, we can write $ \tilde{P}_w=\tilde{Q_1}+\tilde{Q_2} $ where $\tilde{Q_1}$ is a directed path from $\tilde{e}$ to $v_e$ and $\tilde{Q_2}$ is a directed path from $v_e$ to $w$ not containing $v_e$. Hence $\tilde{Q_2}$ corresponds to a directed path, $Q_2$, from either $x$ or $y$ to $w$. In $G$, we attach $Q_2$ to either $P$ (if $Q_2$ starts at $x$) or $P_e$ (if $Q_2$ starts at $y$) getting a path in $G$ directed from $\tilde{e}$ to $w$. We conclude that the restriction of $\overline{\gamma}_*$ to $ \overline{{\mathcal O}}^1(G)$ surjects onto $\overline{{\mathcal O}}^1(H). $ The rest of the proof is the same as for Proposition~\ref{fsu}, Steps 2 and 3, mutatis mutandis. Theorem~\ref{fthm} is proved. $\qed$ \subsection{Orientations in genus $g$} We use notation \eqref{APP}. \begin{defi} \label{Bgdef} Let $g\geq 2$ and let $b=0,1$. Set $$ \Ag:=\{(G, S):\ G\in \Sg, \ S\in \AGb\} $$ and endow it with the following partial order relation: $$(G, S)\leq (H, T)\quad \quad\quad \text{ if } \quad \quad G\leq H \quad \text{ and } \quad S \leq \gamma^*T $$ for some (possibly trivial) contraction $\gamma:G\to H$. \end{defi} It is easy to check that $ \Ag$ is indeed a poset inducing, for every $G\in \Sg$, the poset structure on $ \AGb$ defined earlier. \begin{prop} \label{Bgq} Let $g\geq 2$ and let $b=0,1$. \begin{enumerate}[(a)] \item \label{Bgqa} The map $ \Ag\longrightarrow \Sg $ mapping $(G,S)$ to $G$ is a quotient of posets. \item \label{Bgqb} The following is a rank on $ \Ag$ $$ \rho_{\Ag}: \Ag \longrightarrow {\mathbb{N}};\quad \quad (G, S)\mapsto 3g-3-|E(G)|+g(G-S). $$ \end{enumerate} \end{prop} \begin{proof} The map in \eqref{Bgqa} is clearly a surjective morphism of posets. To check that it is a quotient, pick $G,H\in \Sg$ with $G\leq H$. Fix $T\in \Ab_H$, then $\gamma^*T\in \AGb$ and, of course, $(G, \gamma^* T)\leq (H,T)$. \eqref{Bgqa} is proved. Write $\rho=\rho_{\Ag}$. Fix $(G,S),(H,T)\in \Ag$ such that $(H,T)$ covers $(G,S)$. First, suppose $G\neq H$. We claim $S=\gamma^*T$. By contradiction, suppose $S< \gamma^*T$. Then $ (G,S) < (G,\gamma^*T) < (H,T), $ a contradiction. Hence $S=\gamma^*T$. But then $G$ covers $H$ in $\Sg$, indeed if $G<G'<H$ for some $G'\in \Sg$ then $ (G,S) < (G', T') < (H,T), $ where $T'$ is the pull-back of $T$ to $G'$ under the contraction $G'\to H$; this is impossible. As $H$ covers $G$, Proposition~\ref{rkSg} gives $|E(G)|=|E(H)|+1$, hence $$ \rho (G,S)-(3g-3)= g(G-S)-|E(G)|=g(G-\gamma^*T)-|E(H)|-1. $$ Now, Lemma~\ref{flm} \eqref{flm0} yields $g(G-\gamma^*T)=g(H-T)$, hence $$ \rho (H,T)-\rho(G,S)=g(H-T)-|E(H)| - (g(H-T)-|E(H)|-1)= 1. $$ As wanted. Now, suppose $G=H$. Then $\gamma^*T=T$ and $T$ covers $S$ (for otherwise we would have $(G,S)< (G, S') < (G,T)$ for $S'$ between $S$ and $T$). By Lemma~\ref{rkBP} we have $ g(G-S)= g(G-T)-1=g(H-T)-1. $ Since $|E(G)|=|E(H)|$ we are done. \end{proof} \begin{defi} \label{Ogdef} Assume $b=0,1$. Set $$ \Og:=\{(G, {\overline{O}}_S):\ G\in \Sg, \ {\overline{O}}_S\in \overline{{\mathcal O}}^b(G-S)\}. $$ Let $(H, {\overline{O}}_T), (G, {\overline{O}}_S)\in \Og$. We set $(G, {\overline{O}}_S)\leq (H, {\overline{O}}_T)$ if $G\leq H$ and if there exists a contraction $\gamma:G\to H$ such that \begin{enumerate} \item \label{Ogdef1} $S \leq \gamma^*T$, or equivalently (by \ref{fupr}\eqref{fuprb}), $ \gamma_*S \leq T$; \item \label{Ogdef2} $ \overline{\gamma}_*{\overline{O}}_S \leq {\overline{O}}_{T}$. \end{enumerate} \end{defi} The definition is illustrated in the picture below. By \eqref{Ogdef1} we have $H-T\supset H-\gamma_*S$. Hence ${\overline{O}}_T$ can be restricted to $H-\gamma_*S$. By Definition~\ref{podef}, we require that this restriction be equal to $ \overline{\gamma}_*{\overline{O}}_S$. \begin{figure}[h] \begin{equation*} \xymatrix@=.2pc{ &&&&*{\bullet} \ar@{-} @/^ 1pc/ [ddrr] \ar@{-}[ddrr]_e \ar@{-}@/_ 1pc/ [ddll] \ar@{-} [ddll]&&&& &&&& &&&&\\ G =& &&&&&&& \ar@{->}[rrrr]^{\gamma} &&&&& H = & *{\bullet} \ar@{-} [rr] \ar@{-} @/_ 0.5pc/ [rr] \ar@{-} @/^ 0.5pc/ [rr] && *{\bullet} \ar@{-}@(ur,dr) \\ &&*{\bullet}\ar@{-}[rrrr] && &&*{\bullet} && &&\\ &&\\ &&&& \ar@{-} @/^ 1pc/ [ddrr] \ar@{-}@/_ 1pc/ [ddll] &&&& &&&& &&&&\\ S =& &&&&&&& \ar@{->}[rrrr]^{\gamma_*} &&&&& \gamma_* S = & \ar@{-} @/^ 0.5pc/ [rr] && \ar@{-}@(ur,dr) &&& \leq & T = & \ar@{-} @/^ 0.5pc/ [rr] &&\\ &&&& && && &&\\ &&\\ &&&&*{\bullet} \ar@{->}[ddrr] \ar@{<-} [ddll]&&&& &&&& &&&&\\ O_S =& &&&&&&& \ar@{->}[rrrr]^{\gamma_*} &&&&& \gamma_* O_S = & *{\bullet} \ar@{->} [rr] \ar@{<-} @/_ 0.5pc/ [rr] && *{\bullet} &&& \leq & O_T = & *{\bullet} \ar@{->} [rr] \ar@{<-} @/_ 0.5pc/ [rr] && *{\bullet} \ar@{->}@(ur,dr) && \\ &&*{\bullet}\ar@{<-}[rrrr] && &&*{\bullet} && &&\\ &&} \end{equation*} \caption{An example of the partial order on $\overline{\mathcal{OP}}_{g}^0$: $(G, {\overline{O}}_S) \leq (H, {\overline{O}}_T)$ with $\gamma: G \rightarrow H$ contracting $e$. The orientations $O_S$, $\gamma_* O_S$ and $O_T$ are living on $G - S$, $H - \gamma_* S$ and $H - T$, respectively.} \end{figure} \begin{prop} \label{propOg} Assume $b=0,1$. Then $\Og$ is a poset such that the inclusion $\OG \hookrightarrow \Og$ is a morphism of posets for every $G\in \Sg$. Moreover, the following hold. \begin{enumerate}[(a)] \item \label{propOgb} The forgetful maps $$ \chi: \Og \longrightarrow \Sg;\quad \quad (G, {\overline{O}}_S)\mapsto G $$ and $$ \tau: \Og \longrightarrow \Ag ;\quad \quad (G, {\overline{O}}_S)\mapsto (G,S) $$ are quotients of posets. \item \label{propOgc} The following is a rank on $ \Og$ $$ \rho_{\Og}: \Og \longrightarrow {\mathbb{N}};\quad \quad (G, {\overline{O}}_S)\mapsto 3g-3-|E(G)|+g(G-S). $$ \end{enumerate} \end{prop} \begin{proof} The only property of partial orders which is not an obvious consequence of the definition is transitivity. Suppose $(G, O_S)\leq (H, O_T)$ and $(H, O_T)\leq (J,O_U)$, let $ \delta:H\to J $ be a contraction. Then we have the following contraction, $ \delta\circ \gamma:G\longrightarrow J. $ Next, by \ref{forward}\eqref{forward2} we have $(\delta\circ \gamma)_*= \delta_*\circ \gamma_*$. Hence, as $\gamma_*S \leq T$ and $\delta_*T \leq U$ we have $$ (\delta\circ \gamma)_*S= \delta_*(\gamma_*S) \leq \delta_*(T) \leq U $$ proving the first requirement of Definition~\ref{Ogdef}. Finally, to show that ${\overline{O}}_{U}\geq (\overline{\delta\circ \gamma})_*{\overline{O}}_S$ we must restrict ${\overline{O}}_U$ to $J-(\overline{\delta\circ \gamma})_*S$ and check it is equal to $(\overline{\delta\circ \gamma})_*{\overline{O}}_S$. This is trivial. \eqref{propOgb}. The map $ \chi:\Og \to \Sg$ factors as follows $$ \chi:\Og \stackrel{\tau}{\longrightarrow} \Ag \longrightarrow \Sg $$ and Proposition~\ref{Bgq} states that $\Ag \to \Sg$ is a quotient. Hence it suffices to prove that $\tau$ is a quotient. Now, $\tau$ is clearly a surjective morphism of posets. Let $(G,S)\leq (H,T)$ and let $\gamma:G\to H$ be a contraction such that $ S \leq \gamma^*T$. Now pick ${\overline{O}}_S\in \OG$, then $\overline{\gamma}_*{\overline{O}}_S\in \oOH$. By Lemma~\ref{quoto}, there exists ${\overline{O}}_T\in \oOH$ such that $\overline{\gamma}_*{\overline{O}}_S\leq {\overline{O}}_T$. As $\tau(G,{\overline{O}}_S)=(G,S)$ and $\tau(H,{\overline{O}}_T)=(H,T)$ the proof of \eqref{propOgb} is complete. \eqref{propOgc}. Notice that $\rho_{\Og}(G,{\overline{O}}_S)=\rho_{\Ag}(G,S)$, the latter being the rank defined in Proposition~\ref{Bgq}. Now, $\tau$ is such that if $\tau(G,{\overline{O}}_S)=\tau(G',{\overline{O}}_{S'})$ then $G=G'$ and $S=S'$, hence $(G,{\overline{O}}_S)$ and $(G',{\overline{O}}_{S'})$ are not comparable. Hence if $(H,{\overline{O}}_T)$ covers $(G,{\overline{O}}_S)$ then $(H,T)$ covers $(G,S)$. Therefore $\tau\circ \rho_{\Ag}=\rho_{\Og}$ is a rank on $\Og$. The proof is complete. \end{proof} \subsection{Automorphisms of graphs} \label{autsec} We need to extend the functoriality results proved for edge-contractions in Section~\ref{secfun} to isomorphisms of graphs. We need the following, whose proof is trivial. \begin{prop} \label{iso} Let $\alpha:G\to G'$ be an isomorphism. \begin{enumerate} \item \label{iso1} Let $b=0,1$. Then we have an isomorphism of posets $$\alpha_*:\AGb\longrightarrow \Ab_{G'}; \quad \quad S \mapsto \alpha_*S=\alpha(S).$$ \item \label{iso2} For $O_S\in {\mathcal O}^b(G-S)$ define $\alpha_*O_S\in {\mathcal O}^b(G'-\alpha_*S)$ so that, for any $e\in E(G)$, the starting half-edge of $\alpha(e)$ is the image under $\alpha$ of the starting half-edge of $e$. Then we have an isomorphism of posets $$ \alpha_*:{\mathcal{OP}}^b_G{\longrightarrow} {\mathcal{OP}}^b_{G'}; \quad \quad O_S\mapsto \alpha_*O_S. $$ \item \label{iso3} The isomorphism in \eqref{iso2} descends to an isomorphism of posets $$ \alpha_*:\oOPGb {\longrightarrow} {\overline{\mathcal{OP}}}^b_{G'}. $$ \end{enumerate} \end{prop} \begin{definition} We say that $(H, {\overline{O}}_T), (G, {\overline{O}}_S) \in {\overline{\mathcal{OP}}}_g^b$ are {\it conjugate}, and write $(H, {\overline{O}}_T) \equiv (G, {\overline{O}}_S)$, if $G = H$ and there exists $\alpha \in {\operatorname{Aut}}(G)$ such that $\alpha_*{\overline{O}}_T = {\overline{O}}_S$. \end{definition} Conjugacy is clearly an equivalence relation on $\Og$. We denote $$ \qOPGb=\oOPGb/_\equiv \quad \quad \text{and} \quad \quad \qOg = \Og/_\equiv $$ and write $ [O_S]$ and $(G, [O_S])$ for an element of $\qOPGb$ and $\qOg$ respectively. \begin{prop} \label{cOP} Notation as above. We endow $\qOg$ with the following partial order: $(G, [O_S]) \leq (H, [O_T]) $ if there exist ${\overline{O}}_{T'} \in [O_T]$ and ${\overline{O}}_{S'} \in [O_S]$ such that $(G, {\overline{O}}_{S'}) \leq (H, {\overline{O}}_{T'}) $ in ${\overline{\mathcal{OP}}}^b_g$. Then the quotient ${\overline{\mathcal{OP}}}^b_g \rightarrow [\mathcal{OP}^b_g]$ is a quotient of posets, the inclusion $[\OPGb] \hookrightarrow [\mathcal{OP}^b_g]$ a morphism of posets, and the forgetful map $[\mathcal{OP}^b_g]\to \Sg$ is a quotient of posets. Furthermore $$\rho_{[\mathcal{OP}^b_g]}(G, [O_S]) = 3g - 3 - |E(G)| + g(G - S)$$ is a rank function. \end{prop} \begin{proof} Let $\gamma:G\to H$ be a contraction such that $(G,{\overline{O}}_S)\leq (H,{\overline{O}}_T)$. By Lemma~\ref{posettriv}, it suffices to prove that for any ${\overline{O}}_{S'}\equiv {\overline{O}}_S$ there exists ${\overline{O}}_{T'}\equiv {\overline{O}}_T$ such that ${\overline{O}}_{S'}\leq {\overline{O}}_{T'}$. We have ${\overline{O}}_S=\alpha_*{\overline{O}}_{S'}$ for some $\alpha\in {\operatorname{Aut}}(G)$. If $\gamma$ is trivial then ${\overline{O}}_S\leq {\overline{O}}_T$ and ${\overline{O}}_{S'}=\alpha_*^{-1}{\overline{O}}_S\leq \alpha_*^{-1}{\overline{O}}_T$, as $\alpha_*^{-1}{\overline{O}}_T \equiv {\overline{O}}_T$ we are done. Suppose $\gamma$ nontrivial. By hypothesis $ ({\overline{O}}_T)_{|H-\gamma_*S}= \overline{\gamma}_*{\overline{O}}_S. $ Let $\gamma'$ be the contraction obtained by composing $\alpha$ with $\gamma$: $$ \gamma':G\stackrel{\alpha}{\longrightarrow}G\stackrel{\gamma}{\longrightarrow}H $$ We have ${\overline{O}}_{S'}\in {\overline{O}}(G-\alpha^{-1}_*S)$; set $S'=\alpha^{-1}_*S$. We claim $$({\overline{O}}_T)_{|H-\gamma'_*S'}=\overline{\gamma}'_*{\overline{O}}_{S'}$$ which of course implies ${\overline{O}}_{S'}\leq {\overline{O}}_T$. We have $$ \overline{\gamma}'_*{\overline{O}}_{S'}=\overline{\gamma}_*\overline{\alpha}_*{\overline{O}}_{S'}=\overline{\gamma}_* {\overline{O}}_S=({\overline{O}}_T)_{|H-\gamma_*S}=({\overline{O}}_T)_{|H-\gamma_*\alpha_*\alpha^{-1}_*S} =({\overline{O}}_T)_{|H-\gamma'_* S'} $$ as claimed. Hence $[\mathcal{OP}^b_g]$ is a poset and ${\overline{\mathcal{OP}}}^b_g \rightarrow [\mathcal{OP}^b_g]$ a quotient of posets. The inclusion $[\OPGb] \hookrightarrow [\mathcal{OP}^b_g]$ is obviously a morphism of poset. By Proposition~\ref{propOg} the forgetful map $\chi:{\overline{\mathcal{OP}}}^b_g \to \Sg$ is a quotient of posets. It is clear that $\chi$ factors as follows $$\chi:{\overline{\mathcal{OP}}}^b_g \longrightarrow [\mathcal{OP}^b_g]\longrightarrow \Sg. $$ Since ${\overline{\mathcal{OP}}}^b_g \to [\mathcal{OP}^b_g]$ is a quotient, $[\mathcal{OP}^b_g]\to \Sg$ is also a quotient. The claim about the rank follows from the fact that conjugate elements of ${\overline{\mathcal{OP}}}^b_g$ have the same rank. \end{proof} \section{Stratifying the compactified universal Picard variety.} \label{finsec} In this section we turn to algebraic geometry and prove our main results. We work over an algebraically closed field $k$. \subsection{Dictionary between graphs and nodal curves} \label{dict} From now on, $X$ will be an algebraic, projective, reduced curve over $k$ having at most nodes as singularities, and whose (weighted) dual graph is $G=(V,E)$. Recall that $V$ is the set of irreducible components of $X$ and $E$ is the set of nodes of $X$, with an edge/node joining the two vertices/components on which it lies. The weight of a vertex/component is its geometric genus. We shall use the same symbols for edges and nodes, but we shall write $X=\cup_{v\in V}C_v$ with $C_v$ irreducible component. The genus of $X$ equals the genus of $G$, and $X$ is stable if so is $G$. We shall say, somewhat abusively, that ``$X$ is dual to $G$". Let $S\subset E$ and let $ \nu_S:X^{\nu}_S\to X $ the normalization of $X$ at $S$. The dual graph of $\XN_S$ is $G-S$, and $g(X^{\nu}_S)=g(G-S).$ We denote by $ \hat{X}_S$ the nodal curve obtained by attaching to $\XN_S$, for every node $e\in S$, a smooth rational component, named {\it exceptional component}, to the two branch points in $\nu_S^{-1}(e)$. Of course, $X$ and $\hat{X}_S$ have the same genus. If $X$ is a stable curve, the curves of the form $\hat{X}_S$ are called {\it quasistable}. Two exceptional components of a quasistable curve never intersect. The dual graph of $\hat{X}_S$ will be denoted by $\hat{G}_S$. So, $\hat{G}_S$ is obtained from $G$ by inserting a vertex of weight zero, $v_e$, in every edge $e\in S$. We refer to $v_e$ as the {\it exceptional} vertex corresponding to the exceptional component $C_{v_e}$ of $\hat{X}_S$, and we write $h_e, j_e$ for the two edges of $\hat{G}_S$ adjacent to $v_e$. We have $ \hat{X}_S=\XN_S\cup (\cup_{e\in S}C_{v_e}). $ The set of non-exceptional vertices of $\hat{G}_S$ is naturally identified with $V(G)$. We denote $\hat{S}=\{h_e, j_e, \ \forall e\in S\}\subset E(\hat{G}_S)$ so that we have a natural inclusion $ G-S\subset \hat{G}_S-\hat{S}. $ Let $L$ be a line bundle on $X$, the multidegree of $L$ is defined as follows: ${\underline{\deg}} (L)=\{\deg_{C_v}L,\ \ \forall v\in V\}$. We shall identify ${\underline{\deg}} (L)$ with a divisor on $G$, whose $v$-coordinate is $\deg_{C_v}L$, so that we have a map $$ {\underline{\deg}}:{\operatorname{{Pic}}}(X)\longrightarrow {\operatorname{Div}}(G);\quad \quad L\mapsto {\underline{\deg}} (L). $$ Then $ {\operatorname{{Pic}}}(X)=\sqcup_{{\underline{d}} \in {\operatorname{Div}}(G)}{\operatorname{{Pic}}}^{{\underline{d}}}(X) $ where ${\operatorname{{Pic}}}^{{\underline{d}}}(X):={\underline{\deg}}^{-1}({\underline{d}}) $ is the moduli space of line bundles of multidegree ${\underline{d}}$. Of course, ${\operatorname{{Pic}}}^{{\underline{d}}}(X)$ is isomorphic to the generalized Jacobian, ${\operatorname{{Pic}}}^{(0,\ldots,0)}(X)$, of $X$. \subsection{Compactified Jacobians of a curve} \label{CPsubsec} Let $X$ be a stable curve of genus $g$. We consider $\overline{P}^{d}_X$, its compactified degree-$d$ Jacobian. $\overline{P}^{d}_X$ is a connected, reduced, possibly reducible, projective variety of pure dimension $g$ whose smooth locus is a disjoint union of (finitely many) $g$-dimensional varieties parametrizing line bundles of degree $d$ on $X$. Several constructions of $\overline{P}^{d}_X$ exist in the literature, \cite{OS}, \cite{Cthesis}, \cite{Simpson}, \cite{Esteves}, and they have been proved to be isomorphic to one another even though their modular interpretations are different. We here adopt the modular interpretation given in \cite{Cthesis}, according to which $\overline{P}^{d}_X$ parametrizes ``stably balanced" line bundles of degree $d$ on certain quasistable curves having stable model $X$. To give the precise description we need some definitions. \begin{defi} \label{stabledef} Let $G=\sqcup_{i=1}^cG_i$ have $c$ connected components. \begin{enumerate}[(a)] \item \label{stableg} A divisor ${\underline{d}} \in {\operatorname{Div}}^g(G)$ is {\it stable} if $c=1$ and if for every $Z\subset V(G)$ we have $ |{\underline{d}}_Z|>g(Z)-1. $ \item Suppose $c=1$. A divisor ${\underline{d}} \in {\operatorname{Div}}^{g-1}(G)$ is {\it stable} if for every $Z\subsetneq V(G)$ we have $ |{\underline{d}}_Z|>g(Z)-1. $ \noindent For arbitrary $c$, a divisor ${\underline{d}} \in {\operatorname{Div}}^{g-c}(G)$ is stable if its restriction to every $G_i$ is stable of degree $g(G_i )-1$. \end{enumerate} \end{defi} The somewhat artificial requirement, in \eqref{stableg}, that stable divisors of degree $g$ exist only on connected graphs, serves our goals and simplifies terminology. As we are interested in the cases $d=g$ and $d=g-c$, we shall often unify our statements by writing $$ d=g-c+b \quad \quad \text{with} \quad \quad b=0,1. $$ If $G$ is a graph of genus $g$ with $c$ connected components, for $b=0,1$ we set $$ \Sigma^{b}(G):=\{{\underline{d}}\in {\operatorname{Div}}^{g-c+b}(G):\ {\underline{d}} \text{ is stable}\}. $$ \begin{defi} \label{stbaldef} Let $X$ be a stable curve of genus $g$ and $G$ its dual graph. Let $S\subset E(G)$ and $b=0,1$. A line bundle $\hat{L}_S\in {\operatorname{{Pic}}}^{g-1+b}\hat{X}_S$, and its multidegree ${\underline{\deg}}\hat{L}_S$, are said to be {\it stably balanced} if \begin{enumerate}[(a)] \item $\hat{L}_S$ has degree 1 on each exceptional component; \item ${\underline{\deg}}_{\XN_S} \hat{L}_S$ is a stable divisor on $G-S$ of degree $g(G-S) -c(G-S)+b$. \end{enumerate} Line bundles $\hat{L}_S\in {\operatorname{{Pic}}}^{g-1+b}\hat{X}_S$ as above are referred to as ``stably balanced line bundles of $X$". Two stably balanced line bundles, $\hat{L}_S$ and $\hat{M}_T$, of $X$ are {\it equivalent} if $S=T$ and if their restrictions to $\XN_S$ are isomorphic. \end{defi} By definition, $\hat{L}_S$ has total degree $g-1+b$ and degree $1$ on every exceptional component, hence the restriction of $\hat{L}_S$ to $\XN_S$ satisfies $$ \deg_{\XN_S}\hat{L}_S=g-1+b-|S|. $$ \begin{remark} \label{degst} For $S\subset G$ we have $$ \Sigma^{b}(G-S)=\{{\underline{d}}\in {\operatorname{Div}}^{g(G-S)-c(G-S)+b}(G):\ {\underline{d}} \text{ is stable.}\}, $$ and a divisor in $\Sigma^{b}(G-S)$ has total degree $g-1+b-|S|$. \end{remark} From \cite{Cthesis} we have \begin{fact} \label{Cthesis} Let $X$ be a stable curve of genus $g$ and let $b=0,1$. Then $ \overline{P}^{g-1+b}_X$ is a coarse moduli space for equivalence classes of stably balanced line bundles of degree $g-1+b$ of $X$. \end{fact} The above statement uses a different terminology from the original one (\cite[Prop. 8.2]{Cthesis}) so we need a few words to explain that it is indeed the same. If $b=0$ this is already known (see \cite{CV2} for example), so let us concentrate on the case $b=1$, i.e. degree $g$. For degree $g$ the results of \cite{Cneron}, such as Thm. 5.9, apply in their strongest form. Moreover, from Sect. 7 (in particular Lemma 7.6), we get that our definition~\ref{stbaldef} coincides with the definition of stably balanced line bundles given there. We need to establish an explicit connection between Definitions~\ref{stabledef} and \ref{stbaldef}. For any quasistable curve $\hat{X}_S$ we have a (not unique) contraction $$ \delta:\hat{G}_S\longrightarrow G=\hat{G}_S/S_0, $$ with $S_0=\{j_e, \ \forall e\in S\}$ where $j_e$ is an edge of $\hat{G}_S$ adjacent to the exceptional vertex $v_e$. Clearly, $\delta$ depends on the choice of $j_e$ for each $e\in S$. Now, let ${\underline{d}}\in {\operatorname{Div}}(G)$. We denote by $\widehat{d}\in {\operatorname{Div}}(\hat{G}_S)$ the following divisor $$ \widehat{{\underline{d}}}_v: =\begin{cases} {{\underline{d}}}_v & \text{ if } v\in V(G)\\ 1 & \text{ if }v=v_e,\ e\in S. \end{cases} $$ In short, $\widehat{d}$ extends ${\underline{d}}$ with degree $1$ on all exceptional vertices. We have the following simple fact, for which we use notation \eqref{mcv}. \begin{lemma} \label{exclm} Let $X$ be stable and $G$ its dual graph. Let ${\underline{d}}_S$ be a stable divisor on $G-S$. Then $\widehat{{\underline{d}}_S}$ is stably balanced and we have a surjective map $$ {\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}(\hat{X}_S)\longrightarrow {\operatorname{{Pic}}}^{{\underline{d}}_S}(\XN_S);\quad \quad \hat{L}\mapsto \hat{L}_{|\XN_S}. $$ For any $\delta:\hat{G}_S\to G$ as above we have \ $ \delta_*\widehat{{\underline{d}}_S} ={\underline{d}}_S+ {\underline{c}}^{\delta}. $ \end{lemma} \begin{proof} A divisor on $G-S$ is also a divisor on $G$, so the first part follows trivially by definition. Next, recall that ${\underline{c}}^{\delta}_v$ is the number of edges mapped to $v\in V(G)$ by $\delta$. Hence $ {\underline{c}}^{\delta}_v = 0$ if $\delta^{-1}(v)=v$, and $ {\underline{c}}^{\delta}_v =1$ otherwise. Since the value of $\widehat{{\underline{d}}_S}$ on exceptional vertices is $1$ we have $$ (\delta_*\widehat{{\underline{d}}_S})_v =\begin{cases} (\widehat{{\underline{d}}_S})_v & \text{ if } \delta^{-1}(v)=v\\ (\widehat{{\underline{d}}_S})_v+1 & \text{ otherwise.} \end{cases} $$ Hence $ (\delta_*\widehat{{\underline{d}}_S} - {\underline{c}}^{\delta})_v = (\widehat{{\underline{d}}_S})_v =({\underline{d}}_S)_v. $ \end{proof} \subsection{Combinatorics of compactified Jacobians} We shall now connect to the material of the earlier sections. \begin{lemma} \label{orient} Let $G$ be connected of genus $g$. \begin{enumerate}[(a)] \item \label{orienta} Let $\underline{d} \in {\operatorname{Div}}^{g-1}(G)$. There exists a $0$-orientation, $O$, s.t. $\underline{d} = \underline{d}^O$ if and only if $|\underline{d}_{Z}| \geq g(Z) - 1$ for all $Z\subset V$. \item \label{orientb} For any $\underline{d} \in \Sigma^1(G)$ there exists a $1$-orientation, $O$, on $G$ such that $\underline{d} = \underline{d}^O$. \end{enumerate} \end{lemma} \begin{proof} Part \eqref{orienta} is well known, for example in graph theory as a version of Hakimi's Theorem (for a modern formulation see \cite [Thm 4.8] {ABKS}). For part \eqref{orientb}, fix a vertex $v$ of $G$. Let ${\underline{d}}':={\underline{d}}-\underline{v}$ so that ${\underline{d}}' \in {\operatorname{Div}}^{g-1}(G)$. We have $|\underline{d}'_{Z}| \geq g(Z) - 1$ for all $Z\subset V$. Indeed, if $v \in Z$, we get $|\underline{d}_Z'| = |\underline{d}_Z| - 1 > g(Z) - 2$; thus $|\underline{d}_Z'| \geq g(Z) - 1$. If $v \not \in Z$ we get $|\underline{d}_Z'| = |\underline{d}_Z| > g(Z) - 1$. Thus, by part \eqref{orienta}, we can choose a $0$-orientation $O'$ on $G$ such that $\underline{d}' = \underline{d}^{O'}$. Since $\underline{d} \in \Sigma^1(G)$, we have $|\underline{d}_{G - v}| > g(G - v) - 1$, hence$$ \underline{d}_v =g- |{\underline{d}} _{G - v}| < g - g(G - v) + 1\leq g(v) + \deg v -1 + 1 =g(v) + \deg v $$ (the ``$\leq$" above is a ``$=$" iff $G-v$ is connected). On the other hand $$ {\underline{d}}_v={\underline{d}}'_v+1=g(v)+{\underline{t}}^{O'}_v. $$ Therefore ${\underline{t}}^{O'}_v< \deg v$, hence $O'$ has an edge, $e$, whose source is $v$. Biorienting $e$ gives a $1$-orientation, $O$, with $\underline{d} = \underline{d}^O$. \end{proof} Recall that we denote by ${\mathcal O}^0(G)$ (resp. ${\mathcal O}^1(G)$) the set of totally cyclic (resp. rooted) orientations on $G$, and by $ \OPt_G$ (resp. $ \OPb_G$) the poset of totally cyclic (resp. rooted) orientations on spanning subgraphs of $G$. On such sets we defined an equivalence relation whose class-sets are marked by an overline. Finally, recall the notation introduced in \ref{degst}. \begin{lemma} \label{degor} Let $b=0,1$. Let $G$ be a graph of genus $g$ and $S,T\subset E$. Consider the following map $$ \oOPGb\longrightarrow {\operatorname{Div}}(G);\quad \quad \overline{O}_S\mapsto {\underline{d}}^{O_S}. $$ \begin{enumerate}[(a)] \item \label{degora} The map induces a bijection between $ \overline{{\mathcal O}}^b(G-S)$ and $\Sigma^{b}(G-S)$. \item \label{degorb} If $O_S$ is a $b$-orientation with ${\underline{d}}^{O_S}\in \Sigma^{b}(G-S)$, then $O_S\in {\mathcal O}^b(G-S)$. \end{enumerate} \end{lemma} \begin{proof} The map is well defined and injective by Definition~\ref{defequivo}. Its image lies in $ \Sigma^{b}(G-S)$ by Lemma~\ref{lm0} in case $b=0$ and by Lemma~\ref{lmO1} in case $b=1$. Moreover, its image is the whole of $ \Sigma^{b}(G-S)$ by Lemma~\ref{orient}. This proves \eqref{degora}, and \eqref{degorb} follows from it. \end{proof} \begin{remark} \label{pointsCP} By \ref{Cthesis} the points of $\overline{P}^{g-1+b}_X$ correspond to equivalence classes of stably balanced line bundles, and two such line bundles are equivalent if they are defined on the same $\hat{X}_S$ and if their restrictions to $\XN_S$ are isomorphic. Denote by ${\underline{d}}_S$ a stable divisor of $G-S$ and by $P_X^{{\underline{d}}_S}\subset \overline{P}^{g-1+b}_X$ the set of equivalence classes of stably balanced line bundles on $\hat{X}_S$ whose restriction to $\XN_S$ has multidegree ${\underline{d}}_S$. By Lemma~\ref{degor}, there exists a unique ${{\overline{O}}_S}\in \overline{{\mathcal O}}^b(G-S)$ such that ${\underline{d}}_S= {\underline{d}}^{O_S}$, and every stable divisor on $G-S$ is obtained in this way. Therefore we define, for any ${{\overline{O}}_S}\in {\mathcal O}^b(G-S)$ \begin{equation} \label{POS} P_X^{O_S}:=P_X^{{\underline{d}}_S}. \end{equation} \end{remark} \begin{thm} \label{PX} Let $X$ be a stable curve of genus $g$ and $G$ its dual graph, let $b=0,1$. Then the following is a graded stratification of $\overline{P}^{g-1+b}_X$ by $\oOPGb$\begin{equation} \label{strato} \overline{P}^{g-1+b}_X=\bigsqcup_{{{\overline{O}}_S}\in \oOG^b(G)}P_X^{O_S}, \end{equation} and we have natural isomorphisms for every ${{\overline{O}}_S}\in \oOG^b_G$ \begin{equation} \label{isoo}P_X^{O_S}\cong {\operatorname{{Pic}}}^{{\underline{d}}^{O_S}}(X^{\nu}_S). \end{equation} \end{thm} \begin{proof} The case $b=0$ follows directly from results of \cite{CV2}. Our proof in case $b=1$ also works for $b=0$, so we include it for completeness. As in Remark~\ref{pointsCP}, we denote by $P_X^{{\underline{d}}_S}\subset \overline{P}^{g-1+b}_X$ the set of equivalence classes of stably balanced line bundles on $\hat{X}_S$ whose restriction to $\XN_S$ has degree ${\underline{d}}_S$, for ${\underline{d}}_S$ a stable divisor of $G-S$. By Fact~\ref{Cthesis} we have \begin{equation} \label{stratd} \overline{P}^{g-1+b}_X=\bigsqcup_{\stackrel{S\subset E}{{\underline{d}}_S\in \Sigma^{b}(G-S)}}P_X^{{\underline{d}}_S}. \end{equation} Now, as noted above, we have $ P_X^{O_S}=P_X^{{\underline{d}}_S} $ for a unique class ${{\overline{O}}_S}\in {\mathcal O}^b(G-S)$ such that ${\underline{d}}_S= {\underline{d}}^{O_S}$. Moreover, by Lemma~\ref{degor} every ${\underline{d}}_S\in \Sigma^{b}(G-S)$ is obtained in this way, for every $S\subset E$. Hence \eqref{stratd} yields \eqref{strato}. Also, we obviously have $ P_X^{{\underline{d}}_S} \cong {\operatorname{{Pic}}}^{{\underline{d}}_S}(\XN_S)$, from which \eqref{isoo} follows. Next, recalling Definition~\ref{stratdef}, we prove the following $$ {P_X^{O_S}}\subset \overline{P_X^{O_T}} \quad \Leftrightarrow \quad {{\overline{O}}_S}\leq{{\overline{O}}_T}. $$ By \cite[Prop. 5.1]{Cthesis} (revised using graphs) we have ${P_X^{{\underline{d}}_S}}\cap \overline{P_X^{{\underline{d}}_T}}\neq \emptyset$ if and only if ${P_X^{{\underline{d}}_S}}\subset \overline{P_X^{{\underline{d}}_T}}$. Moreover, ${P_X^{{\underline{d}}_S}}\subset \overline{P_X^{{\underline{d}}_T}}$ if and only if $T\subset S$ and the edges in $S\smallsetminus T$ can be oriented so that, denoting by $t_v$ the number of edges in $S\smallsetminus T$ with target a vertex $v$, we have $({\underline{d}}_{T})_v= ({\underline{d}}_{S})_v+t_v. $ Assume ${P_X^{{\underline{d}}_S}}\subset \overline{P_X^{{\underline{d}}_T}}$ and denote by $O'_T$ the orientation on $G-T$ which extends $O_S$ to $S\smallsetminus T$ by the orientation we just defined (where ${\overline{O}}_S\in \overline{{\mathcal O}}(G-S)$ is such that ${\underline{d}}^{O_S}={\underline{d}}_{S}$, by the previous part). Of course $O_S\leq O'_T$ and, as ${\underline{d}}^{O_T}={\underline{d}}_{T}$ for some ${\overline{O}}_T \in \overline{{\mathcal O}}(G-T)$, we have ${\underline{d}}^{O_T}={\underline{d}}_{T}={\underline{d}}^{O'_T},$ hence $O'_T\sim O_T$. We conclude that ${{\overline{O}}_S}\leq{{\overline{O}}_T}$. The converse is obvious. Finally, we need to show that the stratification \eqref{stratd} is graded. Recall that the generalized Jacobian of $\XN_S$ is an irreducible variety of dimension $g(G-S)$, hence so is $ {\operatorname{{Pic}}}^{{\underline{d}}_S}(\XN_S)$, hence so is $P_X^{O_S}$. By Proposition~\ref{poo}, the map ${{\overline{O}}_S}\mapsto g(G-S)$ is a rank $\oOPGb$, hence we are done. \end{proof} \subsection{Specialization of polarized curves} \label{rigor} We shall be interested in (flat, projective) families of curves over a one-dimensional nonsingular base, specializing to a given curve $X$. Up to restricting the base we can assume that away from $X$ the family is topologically trivial, i.e. that every fiber different from $X$ has the same dual graph of some fixed curve $Y$. We shall refer to such a family as a {\it specialization from $Y$ to $X$}. Since $X$ has only nodes as singularities, the same holds for $Y$. Suppose our curves $X$ and $Y$ are ``polarized", i.e. endowed with a line bundle, $L\in {\operatorname{{Pic}}}(X)$ and $M\in {\operatorname{{Pic}}}(Y)$. We say that $(Y,M)$ specializes to $(X,L)$ if there is a specialization of $Y$ to $X$ under which $M$ specializes to $L$. Let us be more precise. The family under which $Y$ specializes to $X$ is a projective morphism $f:{\mathcal X}\to B$ where $B$ is a smooth, connected, one-dimensional variety with a point $b_0$ such that $f^{-1}(b_0)\cong X$, and the restriction of $f$ away from $b_0$ is locally trivial, moreover $f^{-1}(b)\cong Y$ for some $b\neq b_0$. As an \'etale base change of $f$ determines again a specialization of $Y$ to $X$ we are free to replace $f$ by an \'etale base change. For the polarized version, to say that $M$ specializes to $L$ means that ${\mathcal X}$ is endowed with a line bundle whose restriction to $Y$ is $M$ and whose restriction to $X$ is $L$. \begin{prop} \label{hbk1} Let $X$ and $Y$ be two nodal curves and $G$ and $H$ their respective dual graphs. Let $L\in {\operatorname{{Pic}}}(X)$ and $M\in {\operatorname{{Pic}}}(Y)$ such that $(Y, M)$ specializes to $(X,L)$. Then there exists a contraction $\gamma : G\to H$ such that $$ \gamma_*{\underline{\deg}} (L)= {\underline{\deg}}(M). $$ \end{prop} In the opposite direction, we have the following. \begin{prop} \label{hbk2} Let $\gamma : G\to H$ be a contraction between two graphs. Then for any curve $X$ dual to $G$ and for any $L\in {\operatorname{{Pic}}}(X)$ there exist a curve $Y$ dual to $H$ and a line bundle $M\in {\operatorname{{Pic}}}(Y)$ such that $\gamma_*{\underline{\deg}} (L)= {\underline{\deg}}(M)$ and such that $(Y, M)$ specializes to $(X,L)$. \end{prop} \begin{proof} We prove Propositions~\ref{hbk1} and \ref{hbk2} together as their proofs are closely related. They extend \cite[Thm 4.7 (2)]{CHBK} to polarized nodal curves. To prove Proposition ~\ref{hbk1}, assume $(Y, M)$ specializes to $(X,L)$. Under such a specialization every node of $Y$ specializes to a node of $X$ and different nodes specialize to different nodes. Hence we partition $E(G)=S_0\sqcup T$ so that $S_0$ is the set of nodes of $X$ which are not specializations of nodes of $Y$. We let $\gamma:G\to G/S_0$, and, arguing as for \cite[Thm 4.7]{CHBK}, we have $G/S_0=H$. For any vertex $w\in V(H)$ we write $D_w\subset Y$ for the irreducible component corresponding to $w$. As shown in loc. cit., the specialization from $Y$ to $X$ induces a specialization of $ D_w$ to $ \cup_{ \gamma(v)=w}C_v$ (as a subcurve of $X$). Now, $M$ specializes to $L$ and hence $M_{|D_w}$ specializes to the restriction of $L$ to $\cup_{ \gamma(v)=w}C_v$. Therefore $$ {\underline{\deg}}(M)_w=\deg_{D_w} M=\deg L_{|\cup_{ \gamma(v)=w}C_v}=\sum_{\gamma(v)=w} {\underline{\deg}}(L)_v =\gamma_*{\underline{\deg}}(L)_w. $$ This proves Proposition~\ref{hbk1}. For Proposition~\ref{hbk2}, let $\gamma:G\to G/S_0=H$ be a contraction, for some $S_0\in E(G)$; write $E(G)=S_0\sqcup T$ so that $T$ is identified with $E(H)$. Let $X$ be a curve dual to $G$ and let $\XN_T$ be its normalization at $T$, so that $G-T$ is the dual graph of $\XN_T$. The curve $\XN_T$ is endowed with $|T|$ pairs of marked smooth points, namely the branches over the nodes in $T$. Observe that the connected components of $\XN_T$ are in bijection with the connected components of $H-T$, and hence with the vertices of $H$. We can therefore decompose $\XN_T$ as follows $ \XN_T=\sqcup_{w\in V(H)}Z_w $ with $Z_w$ a connected nodal curve whose genus, $g(Z_w)$, is equal to the weight of $w$ as a vertex in $H$. Therefore we can find a family of smooth curves of genus $g(Z_w)$ specializing to $Z_w$, i.e. we have a smooth curve, $W_w$, specializing to $Z_w$. Considering the union for $w\in V(H)$ we get a specialization of $\sqcup_{w\in V(H)}W_w$ to $\sqcup_{w\in V(H)}Z_w= \XN_T$. Now, up to \'etale cover, such a specialization can be endowed with $|T|$ pairs of sections specializing to the $|T|$ pairs of branch points of $\XN_T$. By gluing together each such pair of sections we get a specialization to our $X$ from a curve, $Y$, whose dual graph is $H$. Clearly, the contraction $\gamma:G\to H$ corresponds to this specialization from $Y$ to $X$. Now, using the notation of Subsection~\ref{rigor}, let $f:{\mathcal X}\to B$ be a family under which $Y$ specializes to $X$, and consider its relative Picard scheme, ${\operatorname{{Pic}}}_{{\mathcal X}/B}\to B$. Its fiber over $b_0$ is ${\operatorname{{Pic}}}(X)$ and its fiber over $b$ is ${\operatorname{{Pic}}}(Y)$. Write ${\underline{d}}=\deg{L}$; we claim that, in the relative Picard scheme, ${\operatorname{{Pic}}}^{ {\underline{d}}}(X)$ is the specialization of ${\operatorname{{Pic}}}^{\gamma_*{\underline{d}}}(Y)$. Indeed, ${\operatorname{{Pic}}}^{ {\underline{d}}}(X)$ must be the specialization of some connected component of ${\operatorname{{Pic}}}(Y)$ (even if this Picard scheme were not separated, every connected component of its fiber over $b_0$ is the specialization of some connected component of the general fiber), and this component is necessarily ${\operatorname{{Pic}}}^{\gamma_*{\underline{d}}}(Y)$ by the same computation we used to prove Proposition~\ref{hbk1}. Now, as ${\operatorname{{Pic}}}^{ {\underline{d}}}(X)$ is the specialization of ${\operatorname{{Pic}}}^{\gamma_*{\underline{d}}}(Y)$, any $L\in {\operatorname{{Pic}}}^{ {\underline{d}}}(X)$ is the specialization of some $M\in {\operatorname{{Pic}}}^{\gamma_*{\underline{d}}}(Y)$, and we are done. \end{proof} \subsection{Compactified universal Jacobians} \label{unisec} We fix $d\in {\mathbb{Z}}$. In this paper we are interested in $d=g$ and $d=g-1$, so we shall restrict to these two cases even though some of the preliminary results quoted in this subsection hold more generally for every $d$. We also assume $b=0,1$ so that $d=g-1+b$. We let $\overline{M}_g$ be the moduli space of stable curves of genus $g\geq 2$, an irreducible projective variety. \begin{fact}\label{strathbk} The following is a graded stratification of $\overline{M}_g$ by $\Sg$: $$ \overline{M}_g= \bigsqcup_{G\in \Sg} M_G $$ where $M_G$ parametrises curves having $G$ as dual graph. \end{fact} Indeed, the map $G\mapsto \dim M_G$ is the rank on $\Sg$ defined in Proposition~\ref{rkSg}. Now, from \cite{Cthesis} we introduce, for every $d\in {\mathbb{Z}}$, the compactified universal degree-$d$ Jacobian $$ \psi_{g,d}:\overline{P}^{d}_g \longrightarrow \overline{M}_g. $$ We sometimes write $\psi=\psi_{g,d}$ for simplicity. Recall that $\overline{P}^{d}_g$ is the GIT quotient of a Hilbert scheme, and that $\psi$ is a projective morphism whose fiber over $X\in \overline{M}_g$ is isomorphic to $\overline{P}^{d}_X/{\operatorname{Aut}}(X)$. Set $$ P_G^{d}:=\psi_{g,d}^{-1}(M_G). $$ Pick a stable curve $X\in M_G$. Then we have a canonical map \begin{equation} \label{muX} \mu_X:\overline{P}^{d}_X\to P_G^d. \end{equation} \begin{cor} \label{corstr} Let $G,H\in \Sg$. Then $$ P_G^{d} \subset \overline{ P_H^{d}}\quad \quad \text{if and only if} \quad \quad H\geq G. $$ \end{cor} \begin{proof} It suffices to use Fact~\ref{strathbk} and that $\psi:\overline{P}^{d}_g \to \overline{M}_g$ is projective. \end{proof} In the next remark we recall the basic moduli properties of $\overline{P}^{d}_g$. \begin{remark} \label{modprop} Let $f:{\mathcal X}\to B$ be a family of quasistable curves of genus $g$ and let $\cL$ be a line bundle on ${\mathcal X}$ whose restriction, $L_b$, to every fiber over $b\in B$ is stably balanced of degree $d$ (in the sense of Definition~\ref{stbaldef}). Then there is a {\it moduli morphism}, $\mu_{\cL}:B \to \overline{P}^{d}_g$ such that the image of $b\in B$ is the equivalence class of $L_b$. Consider the case of a fixed curve rather than a family. So $B=\{b\}$ and ${\mathcal X}=\hat{X}_S$ is a fixed quasistable curve. Let $L, L'\in {\operatorname{{Pic}}}(\hat{X}_S)$ be stably balanced. If the restriction of $L$ and $L'$ away from the exceptional components are isomorphic (i.e. if $L_{\XN_S}\cong L'_{\XN_S}$) then $\mu_L(b)=\mu_{L'}(b)$. \end{remark} Fix $G$ and $S\subset E(G)$. Let $f:{\mathcal X}\to B$ be a family of stable curves all having dual graph identified with $G$, hence $S$ can be identified with $|S|$ (set-theoretic) sections of $f$ corresponding to the nodes in $S$. Denote by $f_S:{\mathcal X}_S\to B$ the desingularization at these sections, so that every fiber of $f_S$ has dual graph $G-S$. For every $e\in S$ we have a pair of sections $(\sigma_{h^+_e}, \sigma_{h^-_e})$ of $f_S$ (where $h^+_e, h^-_e$ are the half-edges of $e$). We glue to ${\mathcal X}_S$ a copy of ${\mathbb{P}}^1\times B$ by identifying its $0$ and $\infty$ section to $ \sigma_{h^+_e}$ and $\sigma_{h^-_e}$. By repeating this for every $e\in S$ we obtain a family of quasistable curves $\widehat{f_S}:\hat{{\mathcal X}}_S\to B$ with dual graph $\hat{G}_S$. Let now ${\underline{d}}_S$ be a divisor on $G-S$, denote by ${\operatorname{{Pic}}}^{{\underline{d}}_S}_{{f_S}}$ the corresponding connected component of the Picard scheme ${\operatorname{{Pic}}}_{f_S}$. Similarly, denote by $ {\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}} $ the connected component of ${\operatorname{{Pic}}}_{\widehat{f_S}}$ corresponding to $\widehat{{\underline{d}}_S}\in {\operatorname{Div}}(\hat{G}_S)$. Now, using the notation in Lemma~\ref{exclm}, we have \begin{lemma} \label{exclm2} Let $f:{\mathcal X}\to B$ be as above. Let $b=0,1$ and ${\underline{d}}_S\in \Sigma^b(G-S)$. Then there exist a moduli morphism $ \mu_{\widehat{{\underline{d}}_S}}:{\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}}\to \overline{P}^{d}_g $ and a morphism $\mu_{{\underline{d}}_S}: {\operatorname{{Pic}}}^{{\underline{d}}_S}_{{f_S}} \to P_G^d $ such that $$ \mu_{\widehat{{\underline{d}}_S}}:{\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}} \stackrel{\varphi}{\longrightarrow} {\operatorname{{Pic}}}^{{\underline{d}}_S}_{{f_S}} \stackrel{\mu_{{\underline{d}}_S}} {\longrightarrow} P_G^d, $$ where $\varphi$ is given by restriction away from the exceptional components. \end{lemma} \begin{proof} We have a polarized family of quasistable curves $$ \cL\longrightarrow {\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}}\times_B \hat{{\mathcal X}}_S\longrightarrow {\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}} $$ where $\cL$ is the tautological (Poincar\'e) line bundle, which, by hypothesis, is relatively stably balanced. By Remark~\ref{modprop} we have a moduli morphism $\mu_{\cL}:{\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}}\to \overline{P}^{d}_g$. Set $\mu_{\widehat{{\underline{d}}_S}}=\mu_{\cL}$, it is clear that its image lies in $P_G^d.$ We let $\varphi:{\operatorname{{Pic}}}^{\widehat{{\underline{d}}_S}}_{\widehat{f_S}} \to {\operatorname{{Pic}}}^{{\underline{d}}_S}_{{f_S}}$ be the map given by restricting a line bundle away from the exceptional components, so $\varphi$ is the analog of the map used in Lemma~\ref{exclm}. Now, as we said in Remark~\ref{modprop}, if two line bundles have the same image under $\varphi$ (i.e. their restriction away from the exceptional components are isomorphic) they also have the same image under $\mu_{\cL}$. By applying a standard argument using that $\overline{P}^{d}_g$ is a GIT quotient, we conclude that there exists a map $\mu_{{\underline{d}}_S}:{\operatorname{{Pic}}}^{{\underline{d}}_S}_{{f_S}} \to P_G^d$ such that $\mu_{\widehat{{\underline{d}}_S}}$ factors a stated. \end{proof} \subsection{The strata of $\overline{P}^{d}_g$} Our goal is to find a stratification of $\overline{P}^{d}_g$ compatible with the one of $\overline{M}_g$. By \cite[Prop. 3.4.1]{ACP}, the stratum $M_G$ has the following expression \begin{equation} \label{pi} \widetilde{M}_G :=\Pi_{v\in V}M_{w(v),\deg(v)} \stackrel{\pi}{\longrightarrow} M_G= \widetilde{M}_G /{\operatorname{Aut}}(G) \end{equation} where $M_{w(v),\deg(v)}$ is the moduli space of smooth curves of genus $w(v)$ with $\deg(v)$ marked points representing the branches/half-edges over the nodes/edges. More generally, with the notation of \cite[Subsection 2.1]{ACP}, for every $S\subset E$, consider the $2|S|$-marked graph {\bf G-S}, whose underlying (unmarked) graph is $G-S$, and whose $2|S|$-marking is given by the half-edges corresponding to $S$. Then {\bf G-S} is stable as marked graph and we have a moduli space, $M_{\text{\bf{G-S}}}$, of stable curves with $2|S|$ marked points and dual graph {\bf G-S}. In particular, if $S=E$ then $ \widetilde{M}_G =M_{\text{\bf{G-E}}}$ and the map $\pi$ above factors: $$ \pi: \widetilde{M}_G\stackrel{\pi_S}{\longrightarrow} M_{\text{\bf{G-S}}}=\widetilde{M}_G /{\operatorname{Aut}}(\text{\bf{G-S}}) \longrightarrow M_G. $$ For our goal we need a universal curve over $ \widetilde{M}_G$, but it is well known that this may fail to exist over some $M_{w(v), \deg(v)}$. However (see \cite{GAC} for example), a universal curve exists over some finite cover of it. We choose a finite cover $M'_{w(v), \deg(v)}\to M_{w(v), \deg(v)}$ of large enough degree (the same for all pairs $w(v), \deg(v)$) so that we have a universal curve over each $M'_{w(v), \deg(v)}$. We let $\widetilde{M}_G'$ be the product of the $M'_{w(v), \deg(v)}$ for $v\in V$ so that, composing with \eqref{pi}, we have a finite map $ \pi':\widetilde{M}_G' \to M_G. $ The action of ${\operatorname{Aut}}(G)$ on $M_G$ lifts naturally to an action on $\widetilde{M}_G'$. We denote by $ {\mathcal C}_{w(v),\deg(v)}\to M'_{w(v), \deg(v)}$ the universal curve, and we have the following family $$ \widetilde{{\mathcal X}} _G: =\sqcup_{v\in V} {\mathcal C}_{w(v),\deg(v)}\longrightarrow \widetilde{M}_G', $$ together with $2|E|$ sections, $\sigma_h: \widetilde{M}_G' \to \widetilde{{\mathcal X}}_G$, indexed by the half-edges of $G$. Fix $S\subset E$. Let $\widetilde{{\mathcal X}} _G\to {\mathcal X}_G^S $ be the gluing along pairs $(\sigma_{h^+_e}, \sigma_{h^-_e})$ for every $e\not\in S$. Then ${\mathcal X}_G^S $ is a family over the space $Z_G^S:=\widetilde{M}'_G /{\operatorname{Aut}}(\text{\bf{G-S}})$. Let $$ f_S: {\mathcal X}_G^S \to Z_G^S $$ be this family of curves, all of whose fibers have dual graph $G-S$. Since $ Z_G^S$ is a finite cover of $M_{\text{\bf{G-S}}}$, the map $\pi'$ factors through finite maps: $$ \pi': \widetilde{M}'_G \longrightarrow Z_G^S\longrightarrow M_G. $$ Fixing a stable multidegree $\underline{d}^{O_S}$ on $G - S$, by Lemma~\ref{exclm2} we get a morphism $$\mu_{O_S}:{\operatorname{{Pic}}}_{f_S}^{{\underline{d}}^{O_S}} \longrightarrow P_G^d.$$ We define $P_{G}^{O_S}$ to be the image of this map. \begin{lemma} \label{PGqp} Let $G\in \Sg$ and $O_S\in \OPGb$ with $b=0,1$. Then $P^{O_S}_G$ is quasiprojective, irreducible of dimension $3g-3-|E(G)|+g(G-S)$. If $O_T\equiv O_S$ for some $O_T\in \OPGb$, then $P^{O_S}_G=P^{O_T}_G$. \end{lemma} \begin{proof} The morphism $\mu_{O_S} $ is finite because so is the morphism $Z_G^S\to M_G$. Moreover $\mu_{O_S} $ exhibits $P_G^{O_S}$ as the image of an irreducible quasiprojective variety of dimension $$ \dim{\operatorname{{Pic}}}^{{\underline{d}}^{O_S}}_{f_S}= \dim Z_G^S+g(G-S)=3g-3-|E(G)|+g(G-S) $$ (as $\dim Z_G^S=\dim M_G$). So the first part of the statement is proved. Now suppose $O_T\equiv O_S$, then $O_T = \alpha_* O_S$ for some $\alpha \in {\operatorname{Aut}}(G)$. Hence $\alpha_*{\underline{d}}^{O_S}={\underline{d}}^{O_{T}}$, and $\alpha$ induces an isomorphism between $Z_G^S$ and $ Z_G^{T}$, a corresponding isomorphism between ${\mathcal X}_G^S$ and ${\mathcal X}_G^T$, and an isomorphism ${\operatorname{{Pic}}}_{f_S}^{{\underline{d}}^{O_S}}\cong {\operatorname{{Pic}}}_{f_T}^{{\underline{d}}^{O_T}}$. The latter induces an isomorphism between the respective Poincar\'e line bundles. Therefore the images of $\mu_{O_S}$ and $\mu_{O_T}$ in $P^d_G$ get identified; see the second part of Remark~\ref{modprop}. \end{proof} We define for any $[O_S]\in \qOPGb$ $$ P_G^{[O_S]} := P_G^{O_S}, $$ by Lemma~\ref{PGqp}, this does not depend on the representative in $[O_S]$. \subsection{Stratifications of universal Jacobians in degree $g-1$ and $g$.} \begin{thm} \label{thmg-1} The following is a graded stratification of $\overline{P}^{g-1+b}_g$ by \ $\qOg$ $$ \overline{P}^{g-1+b}_g =\bigsqcup_{(G,[O_S])\in \qOg} P_G^{[O_S]}.$$ \end{thm} \begin{proof} We have $$ \overline{P}^{g-1+b}_g = \bigsqcup_{G\in \Sg} \Biggl(\ \bigsqcup_{[O_S] \in \qOPGb}P_G^{[O_S]}\Biggr)= \bigsqcup_{(G,[O_S])\in \qOgb} P_G^{[O_S]}.$$ Indeed, the only thing that might not be clear is that the union is disjoint. Suppose two different strata $P_G^{[O_S]}$ and $P_G^{[O_T]}$ intersect and let us show they coincide. Let $X\in \overline{M}_g$ be such that $P_G^{[O_S]}\cap P_G^{[O_T]}\cap \psi^{-1}(X)$ is not empty. Recall that the strata $P^{O_S}_X$ and $P^{O_T}_X$ are disjoint in $\overline{P}^{g-1+b}_X$. Since automorphisms of $X$ obviously map strata to strata in $\overline{P}^{g-1+b}_X$, the images via $\mu_X$ (see \eqref{muX}) of $P^{O_S}_X$ and $P^{O_T}_X$ are no longer disjoint if and only if there is an automorphism $\alpha_X$ of $X$ identifying them. Then one easily checks that the induced automorphism $\alpha$ on $G$ maps ${\overline{O}}_S$ to ${\overline{O}}_T$ in $\OG$. Hence $ [O_S] = [O_T]$. Lemma~\ref{PGqp} gives that $P_G^{[O_S]}$ is quasiprojective, irreducible, of dimension $$ \dim P_G^{[O_S]}= \dim P_G^{O_S} = 3g-3-|E(G)|+g(G-S), $$ and by Proposition~\ref{cOP} the right hand side is a rank on $\qOgb$. To complete the proof we must show that we have a stratification in the sense of Definition~\ref{stratdef}. We will do that in the next two propositions. \begin{prop} \label{prop1} Let $(G,{\overline{O}}_S),(H,{\overline{O}}_T)\in \Og$. If $(G,{\overline{O}}_S)\leq (H,{\overline{O}}_T)$ then $P_G^{[O_S]}\subset \overline{P_H^{[O_T]}} $. \end{prop} \begin{proof} Consider $\psi: \overline{P}_g^{g - 1 + b}\rightarrow \overline{M}_g$. For a fixed $X \in M_G$ we have $$P_G^{[O_S]} \cap \psi^{-1}([X]) = \bigcup_{{\overline{O}}_{S'} \equiv {\overline{O}}_S} \mu_X(P_X^{O_{S'}}),$$ with $\mu_X$ defined in \eqref{muX}. It suffices to show that for every such $X$ and every ${\overline{O}}_{S'} \equiv {\overline{O}}_S$, every point in $ P_X^{O_{S'}}$ is a specialization of line bundles parametrized by ${P_H^{O_T}}$, so that that $\mu_X(P_X^{O_{S'}})\subset \overline {P_H^{O_T}}$. By the proof of Proposition~\ref{cOP} we have that for any ${\overline{O}}_{S'} \equiv {\overline{O}}_S$ there is ${\overline{O}}_{T'} \equiv {\overline{O}}_T$ with ${\overline{O}}_{S'} \leq {\overline{O}}_{T'}$. Since $P_G^{[O_S]} = P_G^{[O_{S'}]}$ and $P_G^{[O_T]} = P_G^{[O_{T'}]}$ we can replace ${\overline{O}}_{S'}$ by ${\overline{O}}_S$ without loss of generality. By hypothesis, there exists a curve $Y$ dual to $H$ which specializes to $X$; let $\gamma:G\to H$ be the associated contraction. Under the corresponding specialization of compactified Picard varieties, $\overline{P}^{g-1+b}_Y$ specializes to $\overline{P}^{g-1+b}_X$. Now, $\overline{\gamma}_*{\overline{O}}_S\in \oOPHb$, hence ${\underline{d}}^{ \gamma_*O_S}$ is stable, and hence, by \ref{exclm}, $P_Y^{ \gamma_*O_S}$ parametrizes stably balanced line bundles on $\hat{Y}_R$ of degree $\widehat{{\underline{d}}^{\gamma_*O_S}}$, where $R=\gamma_*S$. We begin by showing that $P_Y^{ \gamma_*O_S}$ specializes to $P_X^{O_S}$. To the contraction $\gamma$ we associate the contraction $$ \hat{\gamma}: \hat{G}_S\longrightarrow \hat{H}_R=\hat{G}_S/\hat{S_0} $$ (where $\hat{S_0}=\delta_E^{-1}(S_0)$ for $\delta:\hat{G}_S\to G$). Now, with the notation introduced before \ref{exclm}, consider $\widehat{{\underline{d}}^{O_S}}$ and $\widehat{{\underline{d}}^{\gamma_*O_S}}$. We claim \begin{equation} \label{hat} \widehat{{\underline{d}}^{\gamma_*O_S}}=\hat{\gamma}_*\widehat{{\underline{d}}^{O_S}}. \end{equation} Let $v\in V(\hat{H}_R)$. If $v=v_e$ for $e\in R$ then $v_e$ is also an exceptional vertex of $\hat{G}_S$ mapped to $v_e$ by $\hat{\gamma}$. Hence both divisors appearing in \eqref{hat} have value $1$ on $v_e$. Now suppose $v\in V(H)$, then, by Proposition~\ref{fprop}, $$ (\widehat{{\underline{d}}^{\gamma_*O_S}})_v=({\underline{d}}^{\gamma_*O_S})_v=(\gamma_*{\underline{d}}^{O_S})_v+{\underline{c}}^{\gamma,S}_v =\sum_{z\in \gamma_V^{-1}(v)}{\underline{d}}^{O_S}_z+{\underline{c}}^{\gamma,S}_v=(\hat{\gamma}_*\widehat{{\underline{d}}^{O_S}})_v $$ where the last equality follows as ${\underline{c}}^{\gamma,S}_v$ is equal to the number of exceptional vertices of $\hat{G}_S$ that are mapped to $v$ by $\hat{\gamma}$. \eqref{hat} is proved. We can now apply Proposition~\ref{hbk2}, to obtain that any line bundle $\hat{L}\in {\operatorname{{Pic}}}(\hat{X}_S)$ such that ${\underline{\deg}}\hat{L}=\widehat{{\underline{d}}^{O_S}} $ is obtained as specialization of a line bundle $\hat{M}\in {\operatorname{{Pic}}}(\hat{Y}_R)$ such that $$ {\underline{\deg}} \hat{M}=\hat{\gamma}_*{\underline{\deg}}\hat{L}=\hat{\gamma}_*\widehat{{\underline{d}}^{O_S}}= \widehat{{\underline{d}}^{\gamma_*O_S}}. $$ This proves that $P_Y^{ \gamma_*O_S}$ specializes to $P_X^{O_S}$. Therefore $ \mu_X(P_X^{O_S})\subset \overline{P_H^{ \gamma_*O_S}}. $ Now, by Theorem~\ref{PX} and the hypothesis $\overline{\gamma}_*{\overline{O}}_S\leq{{\overline{O}}_T}$, in $\overline{P}^{g-1+b}_Y$ we have $ P_Y^{ \gamma_*O_S}\subset \overline{P_Y^{O_T}}. $ Hence $ \mu_X(P_X^{O_S})\subset \overline{P_H^{ \gamma_*O_S}}\subset \overline{P_H^{O_T}}. $ \end{proof} \begin{prop} \label{prop3} Let $(G,[O_S])$ and $ (H,[O_T])$ be in $[\mathcal{OP}_g^b]$. The following are equivalent \begin{enumerate}[(a)] \item \label{prop3a} $ P_G^{[O_S]}\cap \overline{P_H^{[O_T]}}\neq \emptyset$. \item \label{prop3b} $(G,[O_S])\leq (H,[O_T])$. \item \label{prop3c} $ P_G^{[O_S]}\subset \overline{P_H^{[O_T]}}$. \end{enumerate} \end{prop} \begin{proof} \eqref{prop3a} $\Rightarrow$\eqref{prop3b}. By hypothesis, we have a specialization of polarized curves, $ (\hat{Y}_T, \hat{M} )$ to $(\hat{X}_S, \hat{L} )$, where $X$ and $Y$ are curves dual to $G$ and $H$ respectively, and $ \hat{L} $ and $\hat{M} $ are stably balanced line bundles on $\hat{X}_S$ and $\hat{Y}_T$ such that ${\underline{\deg}}_{\XN_S} \hat{L} ={\underline{d}}^{O_{S'}}$ and ${\underline{\deg}}_{ Y^{\nu}_T} \hat{M} ={\underline{d}}^{O_{T'}}$ for some ${\overline{O}}_{S'} \in [O_S]$ and ${\overline{O}}_{T'} \in [O_T]$. It suffices to prove that ${\overline{O}}_{S'}\leq{\overline{O}}_{T'}$. To simplify the notation, from now on we drop the indices and write ${\overline{O}}_{S'}={\overline{O}}_S$ and ${\overline{O}}_{T'}={\overline{O}}_T$. We denote by $\hat{G}_S$ and $\hat{H}_T$ the dual graphs of $\hat{X}_S$ and $\hat{Y}_T$. By Proposition~\ref{hbk1}, the above specialization is associated to a contraction $$ \hat{\gamma}: \hat{G}_S \longrightarrow \hat{H}_T, $$ such that $ \hat{\gamma}_*{\underline{\deg}} \hat{L} ={\underline{\deg}} \hat{M} $. Now, every exceptional component of $\hat{Y}_T$ specializes to an exceptional component of $\hat{X}_S$, hence we have a specialization of $Y$ to $X$ and the associated contraction $\gamma:G\to H=G/S_0.$ We have an inclusion $T\subset S$ induced by $E(H)\subset E(G)$. Denote by $\hat{O}$ the orientation on $\hat{G}_S$ obtained from $O_S$ by orienting all edges adjacent to exceptional vertices towards the exceptional vertex. Then the degree of $\underline{d}^{\hat{O}}$ on each exceptional component is $1$ and $\underline{d}^{\hat{O}} = \widehat{(\underline{d}^{O_S})}$. We first assume $T=\emptyset$, then $ \hat{H}_T=H$ and we have a commutative diagram $$ \xymatrix@=.4pc{ &&&& &&&& \hat{G}_S \ar[rrrd]_{\delta} \ar[rrrrrr]^{\hat{\gamma}} &&&&&&H &&& &&&& \\ &&&& &&&&&&&G \ar [rrru]_{\gamma} &&& && } $$ Here $\delta$ is given as follows: every exceptional vertex $v_e$ in $\hat{G}_S$ has two adjacent edges $h_e$ and $j_e$, both $\hat{O}$-oriented towards $v_e$. Defining $\delta$ amounts to choosing one of the two for every exceptional vertex. If $e \in S_0$, we can contract any of the two, as $\hat{\gamma}$ contracts both. If $e \not \in S_0$ we choose the one contracted by $\hat{\gamma}$. This choice clearly makes the diagram commutative. Set $O' := \delta_* \hat{O} $ on $G$. Since $ \hat{\gamma}_*{\underline{\deg}} \hat{L} ={\underline{\deg}} \hat{M} $, i.e. $\hat{\gamma}_*(\underline{d}^{\hat{O}}) = \underline{d}^{O_{\emptyset}}$ we get $$\gamma_* O' = \gamma_* (\delta_* \hat{O}) = \hat{\gamma}_* (\hat{O}) \sim O_{\emptyset}$$ where the equivalence at the end follows from Proposition \ref{fprop} (\ref{dlm}), (with ${\underline{c}}^{\hat{\gamma}, \emptyset}=0$ because $O'$ is defined on the whole graph). By construction we have $O'_{|G - S} = O_S$, i.e. $O_S \leq O'$, and thus by Proposition \ref{fprop} (\ref{fprop4}): $$\gamma_* O_S \leq \gamma_* O' \sim O_{\emptyset},$$ which proves the claim in case $T = \emptyset$. In general, we have $T\subset S$ and, of course, $T\cap S_0=\emptyset$. Therefore the restriction of $\gamma$ to $G-T$ is $$ \gamma_{|G-T}:G-T \longrightarrow \frac{G-T}{S_0}=H-T. $$ Write $G'=G-T$, $H'=H-T$ and $\gamma'=\gamma_{|G-T}$. Then write $O'=(O_T)_{|H'}$ and $O'_{S'}=(O_S)_{|G'}$ with $S'=S\smallsetminus T$. By the previous case $\overline{\gamma'_*O'_{S'}}\leq \overline{O'}$, i.e. \begin{equation} \label{gammaprime} \gamma'_*O'_{S'}\sim O'_{|H'-\gamma'_*S'}. \end{equation} Now, $O_S$ is defined on $G-S\subset G-T$, hence $$ \gamma'_*O'_{S'}=(\gamma_{|G-T})_*(O_S)_{|G-T}=\gamma_*O_S. $$ Also, as $O_T$ is defined on $H'=H-T$, we have $$ O'_{|H'-\gamma'_*S'}=((O_T)_{|H-T})_{|H-T-\gamma'_*S'}=(O_T)_{H-\gamma_*S} $$ ($\gamma'_*S'\cup T=S'\smallsetminus S_0 '\cup T=S\smallsetminus S_0 =\gamma_*S$ as $T\cap S_0=\emptyset$). Combining with \eqref{gammaprime} gives $\gamma_*O_S\sim (O_T)_{H-\gamma_*S} $ and we are done with the implication \eqref{prop3a} $\Rightarrow$\eqref{prop3b}. \eqref{prop3b} $\Rightarrow$\eqref{prop3c}. By hypothesis, ${\overline{O}}_{S'}\leq {\overline{O}}_{T'}$ for some ${\overline{O}}_{S'}\in [{\overline{O}}_S]$ and ${\overline{O}}_{T'}\in [{\overline{O}}_T]$. By Proposition~\ref{prop1}, we have $ P_G^{[O_{S'}]}\subset \overline{P_H^{[O_{T'}]}}$, hence we conclude as follows $$ P_G^{[O_S]}= P_G^{[O_{S'}]}\subset \overline{P_H^{[O_{T'}]}}= \overline{P_H^{[O_T]}}. $$ \eqref{prop3c} $\Rightarrow$\eqref{prop3a} is obvious. \end{proof} Theorem~\ref{thmg-1} is proved, and so is Theorem~\ref{mainintro}. \end{proof} \noindent {\it Acknowledgements.} We are grateful to Spencer Backman, Roberto Fringuelli and Margarida Melo for useful conversations related to this paper.
\section{Introduction} \label{intro} The Worldwide LHC Computing Grid (WLCG) is one the most remarkable examples of High-Troughput Computing (HTC) distributed infrastructure for scientific applications. The WLCG is the global Grid that analyzes data from the Large Hadron Collider (LHC) at CERN, with 170 sites in 40 countries. Due to their size, complexity, reputation and required access by Internet these systems are continuously exposed to attackers. Authenticated users have the freedom to execute arbitrary code and to transfer arbitrary data that is required for their experiments. External or insider attackers may take advantage of the Grid functionality to carry out unauthorized activities such as running malware or mining cryptocoins. The Grid is a heterogeneous and dynamic environment where it is difficult to adapt traditional rule based Intrusion Detection Systems (IDS). \par The distributed usage of High-throughput Computing (HTC) farms for data processing tasks - known as Grid Computing - has been very successful in High Energy Physics (HEP), weather forecasting, brain research and astronomy research, just to mention a few examples. Scientists can submit jobs composed of custom code and experimental data. The computing Grid has been envisioned as an analogy for the electrical Grid, for computing resources on demand. The Worldwide LHC Computing Grid (WLCG) enables the scientists to analyze massive amounts of physics data and it allowed for the experimental validation of the existence of the Higgs boson \cite{grid_higss}. The WLCG integrates computer centers worldwide that provide computing and storage resource into a single infrastructure accessible by all Large Hadron Collider (LHC) physicists. Currently, it combines the power of nearly 170 sites in 40 countries, connected with 10-100 Gb links, with more than 600.000 processing cores and 700 PB of storage capacity. It is capable of processing more than 2 million jobs per day. The ALICE (A Large Ion Collider Experiment) Collaboration has built a dedicated detector to exploit the unique physics potential of nucleus-nucleus collisions at LHC energies. Its aim is to study the physics of strongly interacting matter at the highest energy densities reached so far in the laboratory \cite{Alice_experiment}. As a member of the WLCG, the ALICE experiment has developed the ALICE production environment (AliEn) \cite{bagnasco_alien:_2008}, implementing many components of the Grid computing technologies that are needed to store, process and analyze the collected data. Through AliEn, the computing centers that provide CPU and storage resources for ALICE can be seen and used as a single entity - any available node executes jobs and file access is transparent to the user, wherever in the world a file might be located. Figure \ref{fig:grid} represents the flow of data in the WLCG. \begin{figure}[h] \begin{center} \begin{minipage}{86mm} \includegraphics[width=85mm,scale=1.0]{real_time_grid.png} \end{minipage}\hspace{2pc}% \end{center} \caption{Real time grid data flow around the world} \label{fig:grid} \end{figure} \par Authorized users of Grid computing systems have the freedom to carry out research on experimental data. They are able to execute arbitrary code and transfer any required data. This means that potential insider attackers have the same capabilities. The focus of this study is on the security issues related to the Grid job execution environment inside site worker nodes. Frequently in HEP Grids \cite{Grid_HEP}, the jobs running in the worker nodes have access rights that are beyond of what is actually required, restricted only by one or several local Linux accounts. When multiple jobs are executed with the same account, an attacker with control over one job could tamper another user jobs, blaming the owner of any malicious activity. These processes could also have access to sensitive server data and restricted networks. Therefore, Security by Isolation (SbI) mechanisms for processes and networks are important requirements for Grid computing. \par An insider attacker may misuse the power of the Grid for activities not related to physics data analysis. Complex HTC infrastructure such as WLCG are attractive targets for external attackers as well. An attacker might take advantage of the Grid functionality to tamper with user jobs, escalate privileges, access sensitive server configuration data, setup a Denial of Service (DoS) attack or mine cryptocoins, to name a few of the possibilities. This could be accomplished by exploiting unknown or unfixed software or hardware vulnerabilities, listen to user network traffic to gather sensitive clear text information or by guessing weak user credentials among other possibilities. Millions of jobs might be running in Grids like the WLGC every day. The user's ability to run arbitrary code and the lack of proper isolation make detecting intrusions a more challenging task than in other systems. Traditional Intrusion Detection Systems (IDS) require rules written by security professionals. Those rules need to be updated constantly which requires an important amount of effort. Rule based IDS are difficult to adapt to very dynamic environments such as the Grid \cite{gomez1}. Machine Learning algorithms can help to automate the way IDS are built and updated, by using security monitoring data collected from the protected systems \cite{tsai_intrusion_2009}. In the Grid, the amount of this monitoring data is huge due to the number of running jobs. Deep Learning methods may help to analyze this data to improve the IDS detection accuracy. \par We introduce Arhuaco, a framework that adopts Linux Container (LC) technology to provide SbI and security monitoring by applying Deep Learning for detection and prevention of abnormal activities based on multiple sources of monitoring data such as network connections and system calls. Arhuaco gives researches the ability to generate complementary training data by a Recurrent Neural Network. This can be used to improve the detection performance and adapt the detector to new environments. A dataset for Machine Learning (ML) training of malware detection on Linux based Grid computing is described. Some of the most popular Grid systems are just starting to explore the usage of SbI and IDS for security monitoring \cite{wlcg}. As we describe in the related work section there are no studies that leverage the capabilities of Linux Container isolation and monitoring in combination with Deep Learning and data generation for Intrusion Detection. We also show in the next section that there is no tool implementing the mentioned techniques for Grid job payload monitoring in order to detect intrusions. We describe the design, implementation decisions and tests of our proposed methods in the ALICE Collaboration Grid, part of the WLCG. We demonstrate that the selected algorithms and techniques outperform other methods used on IDS for Grid Computing. \par This document is organized as follows. Section \ref{related} presents the state of the art on ML and isolation based security methods applied to distributed environments especially in Grid computing. Section \ref{background} provides background information on the SbI approach and an overview of the classification task in Machine Learning and generative models. Section \ref{design} and \ref{implementation} describe the Arhuaco design and implementation based on our ideas. Section \ref{results} shows the results obtained from testing our approach. Finally section \ref{discusion} and \ref{conclusions} summarize our findings and indicate directions of our future research. \section{Related work} \label{related} \subsection{Security by Isolation in Grid Computing} Virtual Machines (VM) have been suggested many times to solve the isolation problems in Grid computing \cite{VMS}. VMs are emulated machines with their own kernel while Linux Containers (LC) can share a single kernel. Several researchers - \cite{gomez1} and \cite{gomez2} - have proposed the usage of LCs to provide a level of isolation between the Grid jobs and the underlying system and network. Saving system resources in High-throughput Computing (HTC) applications is critical, and LC help to reduce the overall performance impact. \cite{Xavier:2013:PEC:2497369.2497577} presents a comparison of the performance of several virtualization technologies including VM, and shows that container based systems have a near-native performance of CPU, memory, disk and network. \cite{silberschatz_operating_2013} analyzes LCs and VMs and finds similar results in terms of performance and scalability. \cite{berzano_ground-up_nodate-2} shows a success real experience for LCs providing isolation in a Grid site at the ALICE High Level Trigger (HLT). Our study further extends this direction. In particular, we are interested in how this isolation mechanism can be integrated with a security monitoring system, that provides methods to enforce Intrusion Prevention and Detection in Grid computing. \subsection{Intrusion Detection} In \cite{liao_intrusion_2013} an extensive review of Intrusion Detection Systems is presented. Intrusion is defined as the attempt to compromise confidentiality, integrity and availability and Intrusion Detection as the process of monitoring the events occurring in a computer system or network, and analyzing them for signs of intrusions. The cited study presents several open source technologies as the most used solutions for IDS such as SNORT \cite{snort} and OSSEC \cite{ossec}. False positive and false negative are two very common metrics to assess the degree of accuracy. Relevant features can be sets of audit trails (e.g. system logs, system commands) on a host, network packets or connections, wireless network traffic and application logs. \par Machine Learning has been proposed in many studies to improve IDS. \cite{tsai_intrusion_2009} summarizes the state of the art on ML techniques applied to Intrusion Detection and prevention. It states that the most commonly used techniques in the topic have been K-nearest neighbor (K-NN), Support Vector Machines (SVM), Artificial Neural Networks, self-organizing maps, decision trees, Na\"ive Bayes networks, genetic algorithms and fuzzy logic for one single classifier approaches. On the other hand for hybrid classifiers, using several classifiers, neuro-fuzzy techniques, clustering-based approaches have been used especially for parameter tunning and classification. Single classifiers with K-NN and SVM are very popular, mainly the second one. For hybrid approaches an integrated framework, where a method is used for feature selection while another method is used for classification is common. KDD99 \cite{kdd99} is presented as the standard database for testing ML based IDS. \cite{wu_use_2010} shows an overview on the usage of computational intelligence research on IDS. According to the review, misuse detection approach is widely adopted in the majority of commercial systems, because it is simple and effective, but it can not detect novel or targeted attacks. The other common method is anomaly detection. It extracts patterns from behavioral habits of end users, or usage history of networks and hosts. In the intrusion detection field, supervised learning usually produces classifiers for misuse detection from class labeled training datasets. Unsupervised learning satisfies the requirement of anomaly detection, hence it is usually employed in anomaly detection. The authors present two benchmarks, the DARPA-Lincoln datasets \cite{DARPA98} and the KDD99 datasets \cite{kdd99} as the most utilized. According to their work, the most commonly used algorithms are Neural Networks like Feed forward Neural Networks, Radial basis function neural networks, Recurrent Neural Networks, Self-organizing maps and Adaptive resonance theory. \subsection{Methods used in Grid related Intrusion Detection} There are previously proposed methods for IDS in Grid computing. Some of them describe schemes that are not related to Machine Learning nor computational intelligence. For example \cite{tolba_gida:_2005} employs a relational grid monitoring architecture, \cite{feng_ghids:_2006} presents a bottleneck verification approach, \cite{smith_streaming_2009} describes a streaming database approach, \cite{ungureanu_grid-aware_2010} utilizes gossip algorithms, \cite{zhu_new_2006} represents a multi-agent approach, and \cite{ong_tian_choon_grid-based_2003} introduces a web services correlation service. On the other hand, some articles are focused on ML topics such as \cite{tolba_gida:_2005-1}, that adopts learning vector quantization Neural Networks, \cite{schulter_intrusion_2008} and \cite{vieira_intrusion_2009} utilize feed forward Neural Networks, \cite{jiancheng_self-adaptive_2007} applies auto immune systems and \cite{tolba_distributed_2005} also makes use of learning vector quantization neural networks, all of them with a single classifier approach. \cite{zhang_grid_2006} utilizes a hybrid approach, with a soft computing based self-organize map dimension reduction technique, a fuzzy Neural Network and a genetic algorithm. \par None of the previously presented studies applies Security by Isolation to further improve security incident detection. Neither of them makes use of Deep Learning approaches that allow researchers processing huge real time streams of data produced in Grids like the WLCG. In addition, we could not find the usage of generative methods by Recurrent Neural Networks to improve the training datasets. \subsection{Grid IDS related datasets} Grid computing is a unique environment with special requirements. We analyze the behavior of the job payloads. Therefore, using standard datasets for ML based IDS could be ineffective. We could not find any available dataset for IDS training in Grid computing. However several studies describe custom metrics employed. In \cite{tolba_gida:_2005} and \cite{smith_streaming_2009}, the authors generate a dataset consisting of one or more log files. \cite{feng_ghids:_2006} uses an operating system kernel module to gather system calls. In \cite{schulter_intrusion_2008} the measurements are extracted from audit data of low level IDS. To identify misuse committed by insider attackers, their system analyzes the behavior by resource usage data like CPU time and memory usage. The authors gather audit data from HIDS, also extracting operating system data throughout the grid middleware and the syslog protocol. In the implementation level they use OSSEC-HIDS and Snort. \cite{ungureanu_grid-aware_2010} uses Snort alerts as the input metrics by the intrusion detection exchange protocol. \cite{jiancheng_self-adaptive_2007} proposes user-level data built from user ID, role, type and quantity of resources being consumed, and system-level data is composed of CPU usage rate, states of main and the secondary memory and attributes of system files. The identification, type, priority, status of processes and the states of CPU when they are running are organized into process-level data. IP address and port number of source and destination, type of protocol, flags are grouped into network-level data. \cite{zhu_new_2006} analyses the network log data of its own monitoring area. In \cite{zhang_grid_2006} the extracted features are system calls (ID, return value, return status), process (ID, IPC ID, IPC permission, exit value, exit status) and file access (mode, path, file system, file name, argument length). The extracted information is normalized between 0 and 1 for the input of SOM. \cite{tolba_distributed_2005} describes a method using generated log files as a host based intrusion detection. None of the mentioned datasets was made publicly available for other researchers, therefore we decided to collect our own dataset. \subsection{Malware Detection} The focus of this study is to run Grid jobs securely and analyze the payloads behavior in order to detect intrusions. Therefore, we use Linux malware samples to test our environment and collect a dataset of malicious data. This is a more practical approach than creating our own set of binaries with a limited set of malicious characteristics. There are several web sites that collect malware samples and make them available for the research community such as \cite{virusshare} and \cite{virustotal}. In the same direction \cite{rieck_learning_2008-1} and \cite{rieck_automatic_2011} explore Machine Learning for malware classification, using system calls as main features for their classifier. \cite{gibert_llaurado_convolutional_2016} explores the usage of Deep Learning for static analysis of malware samples for classification. We use a similar approach, however, our goal is to provide real time misbehave detection in Grid computing, by analyzing huge flows of data that can be generated by the millions of jobs running in the Grid. \section{Background} \label{background} \subsection{Security by Isolation} \label{isolation} Security by Isolation is a technique that enforces component separation (hardware or software) in a way that if one of them is compromised by an attacker, other components still remain safe \cite{mansfield-devine_security_2010}. There are several implementations providing SbI such as Virtual Machines, Linux containers and the Unix multiuser scheme. There are even security focused Operation Systems \cite{secure-os} built with SbI as one of their core features such as \cite{Tails}, \cite{Qubes} and \cite{SubgrahpOS}. \subsection{Linux Containers} An LC is a set of processes running on top of a shared kernel \cite{Xavier:2013:PEC:2497369.2497577}. They are isolated from the rest of the machine and can not affect the host or other containers, with the exception of exploitable vulnerabilities in the kernel or the container engine. It takes advantage of namespaces to have a private view of the system (network interfaces, PID tree, mount points). Cgroups are also applied to have a limited assignment of resources. LC can be seen as an extension of the virtual memory space concept to a wide system scope. They provide a set of features that have advantages over other virtualization technologies. They are lightweight, fast on booting, have a small memory footprint, and close to bare metal performance. Figure \ref{fig:containers} describes a set containers working together, isolated and sharing the same kernel. In opposition, Virtual Machines have several kernels on top of a hypervisor. \begin{figure}[h] \begin{center} \begin{minipage}{80mm} \includegraphics[width=80mm]{docker.jpg} \end{minipage}\hspace{2pc}% \end{center} \caption{Linux Containers on top of a common kernel} \label{fig:containers} \end{figure} \subsection{Machine Learning for data classification} \label{classification} ML is a form of applied mathematics \cite{Goodfellow-et-al-2016} that tries to model how human intelligence works. One of its common application is the statistic estimation of complicated functions. ML is frequently applied in automatic classification of complex data, a task that traditionally has been carried out by human operators. We can define classification in ML as follows: the input data \(x\) is a vector of \(d\) elements \(x = (x_1 , . . . , x_d ) \in \mathbb{R}^d\) called a feature vector. To classify the input \(x\) means to evaluate a classification function \(C_W :\mathbb{R}_d \mapsto \{c_1 , ..., c_k \}\) on \(x\). The output is \(c_{k^\symbol{42}} = C_W (x)\), where \(k^\symbol{42} \in \{1 . . . k\}\); \(c_{k^\symbol{42}}\) is the class to which \(x\) corresponds, based on the model \(W\) \cite{Bost_machinelearning}. Different ML algorithms use different ways to find the model \(W\). We can assume a simple two classes decision problem, defined as: \begin{equation} \label{eq:objective} C(x)=W^T\phi(x)+b, \end{equation} where \(b\) is a bias parameter and \(\phi(x)\) is a feature-space transformation. The training dataset corresponds to \(N\) input vectors \(x^1,\ldots,x^N\), with target values \(c_1 ,\ldots, c_k\) where \(c_n\in\{normal,malicious\}\). The objective is normally defined as a loss function \(\mathcal{L}\) that represents the penalty for mismatching the training data. The loss \(\mathcal{L}(W)\) on parameters \(W\) is the average of the loss over the training examples \(x^1,\ldots,x^N\), as: \begin{equation} \label{eq:loss} \mathcal{L}(W) = \frac{1}{N}\sum_i\mathcal{L}(W,x^i). \end{equation} Training consists of finding the parameters \(W\) that result in an acceptably small loss, in the best case the smallest one (global minimum). \subsection{Support Vector Machines (SVM)} SVM are very popular for automated classification in Intrusion Detection Systems \cite{tsai_intrusion_2009}. We use them to compare the classification performance of our proposed Convolutional Neural Networks. SVM use hyperplane decision classifiers in a similar way to traditional perceptrons. However, the optimization objective is to maximize the margin, defined as the distance between the decision boundary and the training data that are closest to that hyperplane \cite{PML}. For Support Vector Machines the model \(W\) is made of \(k\) vectors in \(\mathbb{R}^d\) where \(W=\{w_i\}_{i=1}^k\). Here our objective is to optimize the parameters \(W\) and \(b\) such as: \begin{equation} \label{eq:training} c_n(W^T\phi(x^n)+b)\geq1, n=1,\ldots,N. \end{equation} The optimization problem can be expressed in a simpler way as: \begin{equation} \label{eq:min} \argmin_{w,b}{\frac{1}{2}\lvert\lvert W\rvert\rvert^2}. \end{equation} \subsection{Deep Learning} DL is a sub area of Machine Learning that has solved increasingly complicated applications with increasing accuracy \cite{Goodfellow-et-al-2016}. Deep Learning architectures such as Convolutional Neural Networks (CNN), Deep Belief Networks and Recurrent Neural Networks (RNN) have been utilized in computer vision, speech recognition, natural language processing, among other areas. They have produced some results comparable or even superior to human experts \cite{Schmidhuber}. CNNs were first proposed by \cite{Lecun}. They are similar to traditional Neural Networks but they use a convolution operation in one of the layers instead of matrix operations. They are especially useful for time series data and grid-like data topologies and have been very successful in practical applications such as image classification and were recently proposed for text classification \cite{convtext}. Figure \ref{fig:cnn} shows a diagram of a Convolutional Neural Network using sliding filters to analyze text (System calls) input data, where the convolution is applied in the first layer. A discrete convolution operation in Deep Learning can be defined as: \begin{equation} \label{eq:cnn} s(t) = (x*w)(t) = \sum_{a=-\infty}^{\infty}x(a)w(t-a), \end{equation} where \(x\) is an input measurement on time index \(t\), \(a\) is the age of a measurement, \(w\) is a weighting function (also known as the kernel) that depends on the age of measurement. \begin{figure*}[h] \begin{center} \begin{minipage}{\textwidth} \includegraphics[width=\textwidth,scale=1.0]{CNN.pdf} \caption{\label{fig:cnn}A Convolutional Network for text like data processing} \end{minipage}\hspace{1pc}% \end{center} \end{figure*} \par Subsequent layers in CNN are normally composed of classical Deep Neural Network full connected neurons. They are usually made of a higher amount of hidden layers, which require special kinds of methods for updating their neuron values. Sigmoid and rectified linear units (ReLUs) are common activation functions \(\phi(x)\) used by CNN. \subsection{Generative Models} \label{generative} Traditional Machine Learning models used for classification employ a discriminative approach, they process input data and give a probabilistic membership value to a certain class. On the other hand, there are ML methods that try to learn the probability distribution function that generates the training data (input data space) \cite{Goodfellow-et-al-2016}. Those methods are called generative and are useful in practical applications to create or simulate new training data. These methods have been recently used for instance to create new images from huge previous image datasets. \par Recurrent Neural Networks have been used as generative methods with important success in applications. Long Short Term Memory (LSTM) networks were chosen in this research. LSTM networks have an explicit memory cell and are able to capture long-term dependences in sequential data. Formally they can be defined as the following set of equations: \begin{equation} \label{eq:rnn} {\displaystyle {\begin{aligned} f_{t}&=\sigma _{g}(W_{f}x_{t}+U_{f}h_{t-1}+b_{f}),\\ i_{t}&=\sigma _{g}(W_{i}x_{t}+U_{i}h_{t-1}+b_{i}),\\ o_{t}&=\sigma _{g}(W_{o}x_{t}+U_{o}h_{t-1}+b_{o}),\\ c_{t}&=f_{t}\circ c_{t-1}+i_{t}\circ \sigma_{c}(W_{c}x_{t}+U_{c}h_{t-1}+b_{c}),\\ h_{t}&=o_{t}\circ \sigma _{h}(c_{t}), \end{aligned}}} \end{equation} where \(x_{t}\) is the input vector at a given iteration \(t\), \(h_{t}\) is an output vector, \(c_{t}\) is a cell state. \(W\) and \(U\) are parameter matrices and \(b\) a bias vector. \(f_{t}\), \(i_{t}\) and \(o_{t}\) are gate vectors, \(f_{t}\) is a forget gate vector, \(i_{t}\) is the input gate vector. Finally, \(o_{t}\) is the output gate vector. Further, we give more details on how we have adapted the LSTM network to our training data. \section{System design} \label{design} In this study, we propose the integrated usage of Security by Isolation (SbI) with Linux containers and Deep Learning methods to analyze real time monitoring data of processes running inside virtualized HTC infrastructure, as well as the utilization of generative methods to improve the required training data. We introduce a hybrid supervised classification approach using word2vec for feature selection and preprocessing and Convolutional Neural Networks (CNN) for discrimination between normal and malicious classes. Our study also employs Recurrent Neural Networks (RNN) for data generation on the training steps. Arhuaco was designed as a proof of concept implementation based on this proposed methods, with focus on Grid computing. Therefore it is designed to provide security with a Grid based threat model approach based on the one introduced in \cite{gomez1}. This can be applied to other types of distributed HTC environments. In a computing Grid, an adversary may have several goals: \begin{itemize} \item Steal sensitive data such as private encryption keys, user's certificates, tokens or credentials. \item Compromise user's machines to distribute malware and steal valuable user information. \item Carry out a Denial of Service attacks. \item Abuse the Grid computational resources for criminal or not allowed activities, for instance, to deploy botnets or mining crypto-coins. \item Damage the organization reputation by using resources to attack other organizations. \end{itemize} \par To achieve these goals, an attacker could use several methods: \begin{itemize} \item Exploit unknown or not fixed software/hardware vulnerabilities. \item Listen to user network to gather sensitive clear text information. \item Perform a man in the middle attack. \item Tamper with user's jobs. \item Escalate privileges. \item Access sensitive server configuration data. \end{itemize} \par In the next subsections, a detailed information about the design and implementation of Arhuaco is given, based on our proposed contributions. We also describe how our system works under the described threat model. \subsection{Linux Containers for Isolation} We require an isolation technology easily adaptable to the Linux powered Grid computing for High Energy Physics (HEP). Linux Containers (LC) were selected to provide SbI given their security vs performance balance \cite{ibm}. LCs provide in addition a very important feature, network isolation. They make it possible to create an encrypted virtual networks inside a physical or another virtual network, in order to restrict processes running inside to access sensitive assets. This is fundamental in Grid computing, where sites may be sharing resources with other projects or experimental infrastructure. For instance, there is a Grid site at the ALICE HLT cluster, sharing physical resources with the sensitive LHC experiment network \cite{berzano_ground-up_nodate}. Therefore virtual network isolation is used to avoid breaches. Another fundamental feature of Linux Containers for our this study is the monitoring power they grant. Since it is possible to encapsulate a set of processes with their own view of the entire system, it is also possible to capture specific per process metrics that allow us to analyze their isolated behavior. We are able to capture resource consumption data such as CPU, memory and disk, network connection data, and system calls for a specific container and as a consequence for each Grid job. Therefore, we can detect with better precision the source of a security incident or even collect forensics data for further analysis. Figure \ref{fig:isolation} is a schema of the desired isolation characteristics. On the left, Grid jobs run without isolation, being able to affect other jobs or the underlying system. On the right, Grid jobs are isolated by LCs, each one of them run in a reduced version of the whole system, so they have no access to other jobs or sensitive resources in the working nodes. \begin{figure}[h] \begin{center} \begin{minipage}{80mm} \includegraphics[width=80mm,scale=1.0]{isolation.jpg} \end{minipage}\hspace{2pc}% \end{center} \caption{Desired isolation scenario} \label{fig:isolation} \end{figure} \par Traditional Grid systems use batch engines such as Condor \cite{condorgrid} for scheduling jobs in distributed environments. To run containers instead of standard batch jobs, we need modern orchestration tools that concede us the ability to execute containers over a shared cluster. There are several popular alternatives including Google Kubernetes \cite{Kubernetes}, Apache Mesos \cite{Hindman:2011:MPF:1972457.1972488}, and Docker Swarm \cite{docker}. In the system implementation section, we describe the reason for selecting Docker Swarm to be the first container engine that Arhuaco interacts with. \subsection{Deep Learning for Grid job classification} Popular industrial IDS such as Snort and OSSEC \cite{snort} and \cite{ossec} use fixed rules and search for known attack signatures in order to find possible attacks. They have problems when unknown or slightly different intrusion methods are employed, so they need to be constantly updated \cite{Lazarevic03acomparative}. Machine Learning has been commonly suggested in Intrusion Detection for the modeling and analysis of log and network data for autonomous classification of security incidents. As depicted in Figure \ref{flow}, in this research we apply dynamic analysis of Grid jobs monitoring data for real time intrusion detection, which means analysis of operation system (Linux) processes. A supervised classification approach is implemented in Arhuaco. We propose the usage of a Convolutional Neural Network architecture based on the one introduced in \cite{convtext} for English sentences classification and utilized in \cite{gibert_llaurado_convolutional_2016} for static binary file classification according to their x86 machine code instructions. \begin{figure}[h] \begin{center} \begin{minipage}{80mm} \includegraphics[width=80mm,scale=1.0]{flow.jpg} \end{minipage}\hspace{2pc}% \end{center} \caption{Flow of Grid data processing for classification} \label{flow} \end{figure} \subsection{Feature extraction} As mentioned before, this study employs system calls and network connection traces as input data. They are encoded in a human readable format, thus Natural Language Processing (NLP) methods allow us to build a convenient language model. Recently introduced Deep Learning methods for NLP implement learning word vector representations by neural language models \cite{Bengio}. In these vectors, words are projected from a \(1-of-V\) encoding, where \(V\) is the number of different words available (vocabulary size), in a lower dimensional vector space using Neural Network hidden layers \cite{convtext}. Therefore, semantically close words in the training corpus are mathematically close in the lower dimensional vector space. The word2vec algorithm \cite{word2vec} was chosen for Arhuaco to create the input features. It is a predictive model for learning word embeddings. Word2vec vectors create suitable inputs for Convolutional Neural Networks since they allow to treat input data as matrices, similar to the array of pixels in an image. Here we refer to tokens instead of words since our dataset can also contain numbers, paths, IP addresses, among other type of data. \par As a preprocessing step for the traces, characters that do not increase the amount of available information are deleted. Each trace line of system calls is composed of the type of operation, the opcode number and all its parameters. For network connection information each line has the DNS request, IP addresses and ports used per connection. These lines have a variable size, therefore we take only the first \(m\) tokens per line, adding a padding token when a line is shorter. Then \(l\) consecutive lines are taken, which gives us a sequence of \(n=m \times l\) total tokens, from which we extract our input feature vector. \(a_i \in \mathbb{R}^k\) is a \(k\)-dimensional token vector corresponding to the \(i\)-th token in our sequence. This sequence can be described as: \begin{equation} \label{eq:concat} {\displaystyle {\begin{aligned} a_{1:n}=a_1 \oplus a_2 \oplus \ldots \oplus a_n, \end{aligned}}} \end{equation} where \(\oplus\) is the concatenation operator, and \(a_{i:i+j}\) is the concatenation of tokens \(a_i,a_{i+1}, . . . ,a_{i+j}\). These embedding vectors are the result of applying word2vec method on our text input data. \subsection{Convolutional Neural Network} In the context of this research, a convolution operation involves a kernel or filter \( G \in \mathbb{R}^{hk}\), which is applied to a window of \(h\) tokens to produce a new feature. For example, a feature \(z_i\) is generated from a window of words \(a_{i:i+h-1}\) by: \begin{equation} \label{eq:filter} {\displaystyle {\begin{aligned} z_i=f( G \cdot a_{i:i+h-1}+b), \end{aligned}}} \end{equation} where \(b \in \mathbb{R}\) is a bias term and \(f\) is a non-linear function. This filter is applied to each possible window of tokens in the sequence \(\{a_{1:h}, a_{2:h+1},..., a_{n-h+1:n}\}\) to produce a feature vector \( z= [ z_1, z_2,..., z_{n-h+1}]\), with \( z \in \mathbb{R}_{n-h+1}\). A max-over-time pooling operation is then applied to the feature vector, taking the maximum value \( z^*= \max{z} \) as the only feature resulting from this filter. The most important feature, one with the highest value, is kept for each feature map. The same process is repeated with multiple filters of different window sizes, to obtain multiple features. These features are passed to a fully connected \(ReLu\) layer whose output goes to the last dense layer with \(Sigmoid\) activation with outputs corresponding to the probability distribution over labels (normal and malicious in our problem setup). \par For the contrasted classification method - the Support Vector Machine (SVM) - we used the well established Bag of Words (BoW) model \cite{PML} to create its input feature vectors. In the BoW we first create a vocabulary with the list of all possible tokens is the training set. Then we reduce this vocabulary by using only the most used tokens. We created a vector where each component is the number of times a given token appears in the analyzed set. An alternative method is the Continuous Bag of Words (CBOW), which predicts target words from source context words. \subsection{Recurrent Neural Network (RNN) for training data generation} A character level language model has been selected as a generative method for Arhuaco. The objective of this model is to predict the next character in a sequence. Given a training corpus \((c_1,...,c_T)\), where \(c_i\) is a single character and \(T\) is the total number of characters. A Long Short Term Memory (LSTM) RNN is utilized to determine the sequence of its output vectors \((o_1,...,o_T)\) by a sequence of distributions \( P(c_{t+1} | c \leq t) = \sigma(o_t)\). Here \(\sigma\) is the \(softmax\) distribution defined by: \begin{equation} \label{eq:sigma} {\displaystyle {\begin{aligned} P(\sigma(o_t) = j) = \frac{\exp(o_{t}^{j})}{ \sum_k \exp(o^{k}_t)}. \end{aligned}}} \end{equation} The objective function is to maximize the total \(\log\) probability of the training sequence \(\sum _{t=0}^{T - 1} \log P(x_{t+1}|x \leq t)\). This implies that the LSTM learns a probability distribution over sequences. We can then sample from the conditional distribution \(P(x_{t+1}|x \leq t)\) to get the next character in a generated string and provide it as the next input to the LSTM \cite{sutskever_generating_2011-1}. After the training process has finished we can generate new data that can be used as extra training data in order to extend the generalization capabilities of a classification system \cite{gibert_llaurado_convolutional_2016}. \subsection{Arhuaco design architecture} A diagram of Arhuaco architectural components is shown in Figure \ref{poc}. The execution engine provides an interface with a selected container scheduling engine according to configuration parameters. Then, the executed containers are monitored, extracting real time data for security analysis. The data is processed by the previously described feature extraction mechanism. Furthermore, these preprocessed input feature vectors are sent to the classification and generative modules. They can provide feedback to each other. Any suspicious incident is processed by the response engine. This can be configured with predefined actions, such as sending alerts to administrators, stopping suspicious jobs, or collect information for offline analysis (forensic). \begin{figure}[h] \begin{center} \begin{minipage}{85mm} \includegraphics[width=85mm,scale=1.0]{poc.pdf} \end{minipage} \end{center} \caption{Proposed Arhuaco design architecture} \label{poc} \end{figure} \section{Implementation} \label{implementation} The Arhuaco prototype was developed in Python. It provides interfaces for Grid frameworks, container engines and data collection tools. Among the alternatives for Linux Container engines, to the most popular belong Docker \cite{docker}, Rocket \cite{rocket}, Singularity \cite{singularity}, and LXC \cite{lxc}. Arhuaco supports Docker in its first stage, given its broad adoption in industrial applications and its default security measures. To be able to execute grid jobs inside LCs, three solutions were tested: Kubernetes \cite{Kubernetes}, Apache Mesos \cite{hindman_mesos:_2011}, and Docker Swarm. Docker Swarm was chosen due to its simplicity and fast deployment in testing environments. In addition, it provides out of the box encrypted virtual networking. Further, we may create interfaces with other container scheduler engines. A testing ALICE Grid site based on AliEn \cite{bagnasco_alien:_2008}, the ALICE Grid middelware, was deployed in a local Linux cluster at the Goethe University in Frankfurt. It has 5 Ubuntu 14.04 nodes. A custom CentOS 6 based Docker image and an AliEn interface for Docker Swarm were developed. CVMFS \cite{CVMFS} was installed on the hosts and shared as a volume inside the AliEn containers to grant access to High Energy Physcics libraries. One job per container is executed by design, which is useful to increase the traceability between different jobs. Besides, it is the natural micro service model for Linux Containers. \par For the training and validation of our proposed classification and generative algorithms, a dataset composed of normal and malicious system call and network connection logs was collected. Instead of creating our own set of malicious binary samples we have used a set of 10.000 Linux malware samples downloaded from a security research web site \cite{virusshare}. This allows us to cover a bigger range of malicious activities that would be very time consuming and error prone to do manually. Regular Grid jobs were also collected from the ALICE Grid production environment, using our test Frankfurt site, to improve the training data. We ran the samples and collected the same set of metrics for both types of binaries. We executed them inside containers and used the isolation and monitoring features to collect every system call and network connection. These are some examples of the collected data: \begin{verbatim} Malware: * IP.x IP.y irc.qeast.net 1 C_INTERNET ... * file open fd 4 name /etc/passwd ... Grid job: * IP.z IP.w alice-disk-se.gridka.de 1 ... * file access res 2 ENOENT name /cvmfs/alice.cern.ch/x86 ... \end{verbatim} \par We utilized Sysdig \cite{sysdig} for collecting system calls and Bro IDS \cite{BRO} for network connection data. For executing the malware samples a testing environment without Internet access was deployed, using Inetsim \cite{Inetsim} for network connection emulation. We have also employed Cuckoo sandbox \cite{Cuckoo} to isolate and monitor these runs. Table \ref{tablefull} shows a summary of the collected dataset. In the Arhuaco online setup, once the training is finished, the system call and network traces collection is done in real time, as well as the classification. \begin{table} \caption{\label{tablefull}Full preprocessed available datasets} \begin{center} \begin{tabular}{ l p{0.2\linewidth}cc } \hline\noalign{\smallskip} Dataset & Normal & Malware \\ \noalign{\smallskip}\hline\noalign{\smallskip} System call & 12GB 127'100.000 lines & 8.2GB - 127'054.763 lines \\ Network & 868KB 20.733 lines & 108KB - 2.937 \\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} \begin{table} \caption{\label{tableshort}Used training and validation data after feature extraction} \begin{center} \begin{tabular}{ lcc } \hline\noalign{\smallskip} Dataset & Training & Validation \\ \noalign{\smallskip}\hline\noalign{\smallskip} System calls traces & 10'000.000 & 100.000 \\ Network traces & 20.000 & 2.000 \\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} Table \ref{tableshort} shows a summary of the obtained samples after the feature selection step. A representation of the implemented test as part of the ALICE Grid can be seen in Figure \ref{figureids}. \begin{figure}[h] \begin{center} \begin{minipage}{80mm} \includegraphics[width=80mm,scale=1.0]{alien.jpg} \end{minipage}\hspace{2pc}% \end{center} \caption{Proof of concept diagram in the ALICE GRID} \label{figureids} \end{figure} \par We have implemented the Deep Convolutional Neural Network (CNN), Support Vector Machine (SVM) and Recurrent LSTM Neural Network by using the Python library Keras \cite{chollet2015keras} with Theano \cite{theano} as a backend. Keras simplifies the development of Deep Learning algorithms and provides parallel computing capabilities powered by Theano. It also supports TensorFlow \cite{TensorFlow}. It is convenient for High-throughput Computing (HTC) applications, since it can share resources with other applications running in parallel, and it is strongly focused on using GPU to increase the parallel processing performance. Another Python library, Gensim \cite{rehurek_lrec} was employed for word2vec extraction of embedding vectors. Due to the huge size of the training corpus, it has the functionality to deal with data that does not fit in main memory. \par The CNN hyper-parameters have been selected by an empiric grid search. They are listed in Table \ref{cnnpar}. We use momentum and parameter decay to ensure the model convergence, and dropout to prevent overfitting. For the Support Vector Machine, we chose the \(Hinge\) loss function and the \(Adadelta\) optimizer. The parameters \(m\), \(l\) and \(n\) described in the previous section are shared among the two models. They are listed in Table \ref{sharedpar}. These last parameters were selected to keep a good balance between the classification accuracy of normal and malicious classes and the ability to detect intrusions in real time. For the LSTM Network, the chosen optimizer is Root Mean Square Propagation, with a learning rate of 0.01, and a categorical cross entropy as loss function. \begin{table} \caption{\label{cnnpar}Custom CNN parameters} \begin{center} \begin{tabular}{ lcc } \hline\noalign{\smallskip} Parameter & System calls & Network\\ \noalign{\smallskip}\hline\noalign{\smallskip} Embedding dimension & 20 & 10 \\ Filter sizes & 3, 4, 5 & 2, 3\\ Total number filters & 20 & 3 \\ \noalign{\smallskip}\hline\noalign{\smallskip} Optimization function & \multicolumn{2}{c}{SGD} \\ Learning rate & \multicolumn{2}{c}{0.001} \\ Momentum & \multicolumn{2}{c}{0.80} \\ Decay & \multicolumn{2}{c}{\(10e-6\)} \\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} \begin{table} \caption{\label{sharedpar}Shared SVM and CNN parameters} \begin{center} \begin{tabular}{ lccc } \hline\noalign{\smallskip} Dataset & \(m\) & \(l\) & \(n\) \\ \noalign{\smallskip}\hline\noalign{\smallskip} System call & 7 & 6 & 42 \\ Network & 5 & 1 & 5\\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} \section{Evaluation} \label{results} In this section, an empiric evaluation of the performance impact, classification ability and data generation effectiveness for the methods implemented in Arhuaco is described. Here the goal was to answer the following questions: \begin{itemize} \item Does using LC for isolation and system call monitoring create a big performance impact? If that is the case, is it critical in comparison to the increment in security provided? \item Does the CNN for classification of job traces provide better accuracy and false positives rates than the traditional SVM? \item Does the LSTM Network for data generation improve the training results? \end{itemize} \subsection{Evaluation methods} We have deployed two type of performance tests. The first with the Linpack benchmark as introduced in \cite{ibm} to test the throughput. The second measures the performance impact in processing times. For the first test, we ran Linpack jobs while for the secong the job is a production ALICE script. We have prepared 3 evaluation scenarios: running jobs on a Linux machine, then in Docker containers and finally in Docker containers with system call interception and processing by Arhuaco. In our performance analysis, the impact of collecting network data from the job is not measured. \par Loss, Accuracy (ACC) and False Positive Rate (FPR) are the measurements for the correctness of the compared classification methods. The overall performance of the trained classifiers is evaluated by the Accuracy. This measures the number of instances that were correct, which are both the True Positives and True Negatives, over the entire size of the dataset, which is the number of True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN). It is calculated as: \begin{equation} \label{eq:acc} Accuracy (ACC) = \frac{(TP+TN)}{(TP+TN+FP+FN)}, \end{equation} \begin{equation} \label{eq:fpr} False Positive Rate (FPR) = \frac{FP}{FP+TN}, \end{equation} where False Positives (FP) is the number of misclassified instances of a certain category over the number of all instances that are classified as that category. The ACC and FPR values are defined in the range \([0,1]\), where \(1\) is the best possible value for ACC and the worst for FPR. On the other hand, \(0\) is the best value for FPR and the worst for ACC. They can also be interpreted as percentage values in the range \([0\%,100\%]\). \subsection{Performance impact results} The performance evaluations were carried out in our Frankfurt testing Grid site. Each of the 5 machines has identical configuration: 4 Intel Xeon (64 bit) processors for a total 16 cores running at 2.27 GHz and 16 GB RAM. They all have Ubuntu 14.04 as the installed operating system. The container images are derived from CentOS 6, since this is the current recommended distribution to be used with the CERN HEP Grid libraries. \begin{table} \caption{\label{Linpack}Performance impact in throughput measurement} \begin{center} \begin{tabular}{ lc } \hline\noalign{\smallskip}s Setup & Linpack (GFLOPS)\\ \noalign{\smallskip}\hline\noalign{\smallskip} Native & 3.7664 \\ Docker & 3.7506 (-0.4\%) \\ Docker plus sysdig & 3.7463 (-0.5\%) \\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} \par Table \ref{Linpack} shows the performance of Linpack jobs on Linux, Docker and Docker plus Arhuaco monitoring. We have executed one job per CPU core, for a total of 16 jobs and have measured the resulting throughput. Figure \ref{perf} describes the results of the ALICE Grid job test. Up to 10 jobs instances in parallel were executed. The measurement was the execution time they spend to be completed. Each job does the same tasks, simulation, reconstruction and analysis of the same ALICE HEP data. \begin{figure}[h] \begin{center} \begin{minipage}{90mm} \includegraphics[width=90mm,scale=1.0]{performance.pdf} \end{minipage}\hspace{2pc}% \end{center} \caption{Performance impact comparison} \label{perf} \end{figure} \par The resulting throughput is almost identical for the 3 measured scenarios. This can be explained by the little involvement the containers and system call monitoring have in the floating point operations. For the execution time tests with ALICE jobs, there was a maximum performance impact of 8.634\% when using Docker in comparison to the Linux execution. This can be seen in the graphic when the number of ALICE jobs in parallel is equal to 9. For the Docker plus Arhuaco monitoring runs, the maximum performance impact was of 2.535\% in comparison to the Docker runs (when the number of parallel jobs are equal to 7). It is noticeable that there is not a big difference in using only Docker containers in comparison to Docker and Arhuaco monitoring. To further reduce the impact on the Grid jobs performance of the system call monitoring method, we provide several configuration options: the first is to analyze only a set of random jobs. The second option is to first analyze only network data and then in case of suspicious behavior activate the system calls collection. The third possibility is a secure mode were all the data is analyzed, which is the default mode. \subsection{Supervised classification results} Figure \ref{fig:sys_conv_accuracy} and Figure \ref{fig:sys_svm_accuracy} indicate the training and validation accuracy for the proposed Convolutional Neural Network (CNN) and the compared Support Vector Machine (SVM) on the analysis of system call traces, preprocessed by word2vec and BoF. The CNN validation curve is close to the training curve, approaching nearly 99\%. Since the SVM model is far smaller, a trend for over-fitting can be seen in the validation curve compared to the training curve. Figure \ref{fig:sys_cnn_svm_acc} and Figure \ref{fig:sys_cnn_svm_fpr} show a comparison for the ACC and FPR with the validation data. Clearly, the CNN provides a higher accuracy and lower False Positive Rate than the SVM. \begin{figure*}[!htb] \begin{center} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{sys_conv_accuracy.pdf} \caption{\label{fig:sys_conv_accuracy}Classification accuracy of the CNN applied to system calls} \end{minipage} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{sys_svm_accuracy.pdf} \caption{\label{fig:sys_svm_accuracy} Classification accuracy of SVM applied to system calls} \end{minipage} \end{center} \end{figure*} \begin{figure*}[!htb] \begin{center} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{sys_cnn_svm_acc.pdf} \caption{\label{fig:sys_cnn_svm_acc} Accuracy comparison of CNN vs SVM applied to system calls } \end{minipage} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{sys_cnn_svm_fpr.pdf} \caption{\label{fig:sys_cnn_svm_fpr} False Positive Rate comparison of CNN vs SVM applied to system calls } \end{minipage} \end{center} \end{figure*} \par Figure \ref{fig:net_conv_acc} and Figure \ref{fig:net_svm_acc} represent the the results for the classification of network traces with our proposed CNN and compared SVM method. As with the system calls case, the CNN shows similar results with the training and validation data, approaching 99\%. The SVM shows signs of over-fitting and a lower accuracy. In Figures \ref{fig:net_cnn_svm_acc} and \ref{fig:net_cnn_svm_fpr} we see the comparison of the validation data for accuracy and False Positive Rate. A better accuracy for the CNN is clear in this case as well, however, the SVM exhibits a better FPR. \begin{figure*}[!htb] \begin{center} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_conv_accuracy.pdf} \caption{\label{fig:net_conv_acc} Classification accuracy of CNN applied network data} \end{minipage} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_svm_accuracy.pdf} \caption{\label{fig:net_svm_acc} Classification accuracy of SVM applied to network data} \end{minipage} \end{center} \end{figure*} \begin{figure*}[!htb] \begin{center} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_cnn_svm_acc.pdf} \caption{\label{fig:net_cnn_svm_acc} Classification accuracy comparison of CNN vs SVM applied to network data} \end{minipage} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_cnn_svm_fpr.pdf} \caption{\label{fig:net_cnn_svm_fpr} Classification False Positive Rate of CNN vs SVM applied to network data} \end{minipage} \end{center} \end{figure*} \par Table \ref{results} summarizes the results obtained for applying the Convolutional Neural Network and Support Vector Machines on previously unseen testing data. A better accuracy and False Positive Rates for the CNN over the SVM is shown, except in the case of FPR for the network data. This validates the results we have obtained in the training steps and demonstrates the effectivenesses of using Convolutional Neural Networks for classification in Arhauco to detect intrusions, in comparison to utilizing Support Vector Machines, the most popular method used in Grid computing Intrusion Detection Systems. \begin{table} \caption{\label{results} Classification accuracy and FPR comparison of testing data} \begin{center} \begin{tabular}{ lcccc } \hline\noalign{\smallskip} \makecell{Testing \\ Dataset} & CNN Acc. & SVM Acc. & CNN FPR & SVM FPR\\ \noalign{\smallskip}\hline\noalign{\smallskip} \makecell{System \\ call} & 0.9657 & 0.9499 & 0.0632 & 0.0839 \\ \makecell{Network \\ traces} & 0.9733 & 0.8011 & 0.04004 & 0.0 \\ \noalign{\smallskip}\hline \end{tabular} \end{center} \end{table} \subsection{Generative model results} As shown in Table \ref{results}, the SVM classification results for network connection information produced the worst accuracy in all our tests. Therefore we utilized this same case to prove the effectiveness of the proposed generative technique. The Deep RNN was trained with the available network data corpus and then modified to generate 20\% new training data. The new data was concatenated to the original data to create a new training set. Further, the SVM is trained again to measure the new accuracy. The validation data utilized belongs to the original data. Figures \ref{fig:net_svm_accuracy-generated} and \ref{fig:net_svm_fpr-generated} provide a new comparison of the SVM accuracy and FPR after being trained with the additionally generated data. A noticeable improvement can be seen regarding the training with the original data in Figures \ref{fig:net_cnn_svm_acc} and \ref{fig:net_cnn_svm_fpr}. This demonstrates the practical benefits of using LSTM for modeling and generating data in the context of Intrusion Detection Systems. \begin{figure*}[!htb] \begin{center} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_svm_accuracy-generated.pdf} \caption{\label{fig:net_svm_accuracy-generated} Classification accuracy of SVM applied to network data with the newly generated data for training} \end{minipage} \begin{minipage}{0.49\textwidth} \includegraphics[width=\linewidth]{net_svm_fpr-generated.pdf} \caption{\label{fig:net_svm_fpr-generated} Classification False Positive Rate of SVM applied to network data with the newly generated data for training} \end{minipage} \end{center} \end{figure*} \par The obtained accuracy for the SVM trained with the newly generated data, applied to unseen network data from the original dataset was 0.8201. There was a 2.38\% improvement rate as expected with our approach, in comparison the original value from Table \ref{results}, 0.8011. This validates the results obtained in the training steps. \section{Discusion and future work} \label{discusion} Regarding the first question we have defined in our evaluation, the performance tests present an execution time overhead of 0.4\% when using Linux Containers in comparison with the Linux runs for the Linpack throughput test, and 0.5\% when using Arhuaco monitoring. This can be considered as a very small impact. The impact is more considerable when testing the execution time for the ALICE Grid job. The Docker container generates up to 8.634\% of overhead. It is higher, an extra 2.535\% when monitoring by Arhuaco is added on top. Although this overhead is not critical, we have implemented some ideas to reduce it. We have a two layers approach, based on user configuration. Arhuaco can detect malicious activities by first intercepting and analyzing network connections and then it can make a deeper analysis by a second layer using the system calls, after suspicious processes detection. Another configurable option is to randomly analyze a small set of jobs running in the Grid, which still can contribute to have an improved level of security. It is important to notice that containers are being increasingly utilized in Grid computing collaborations and as we have shown, adding extra monitoring and analysis by Arhuaco creates an acceptable performance impact. Another point to consider is that there are studies \cite{ibm} that compare Linux Containers against Virtual Machines (VMs). They demonstrate that VMs create a bigger overhead in the performance than LCs. \par The classification algorithm implemented in Arhuaco improves the detection of malicious activities running inside the grid, compared to traditionally employed methods, which responds to the second research question. Convolutional Neural Networks demonstrate a better classification ability than Support Vector Machines for system calls as well as for network connections in Grid jobs. Since our gathered malicious network data is rather small, we have successfully generated new data by a Recurrent Neural Network. We described how it allowed us to improve the classification results for the SVM, giving an answer to the third evaluation question. An interesting point to remark is that our approach of analyzing input as a text data by Natural Language Processing approaches can be easily extended from system calls and network data to inputs from other Intrusion Detection Systems or different sources of monitoring data. It could also be easily adapted beyond HTC, for instance to monitor Cloud services running in containers over orchestration engines such as Kubernetes and Mesos. \par We still have some limitations and topics for further analysis. We will investigate optimizations that we can introduce in Arhuaco for reducing the overhead. This seems feasible given the results for Linpack. Our framework has not been tested in a production environment yet. The obtained False Positive Rate, although small, is still significant if we consider the huge amount of jobs running in the Worldwide LHC Computing Grid, close to 300.000 at any given instant. We should improve the results in this area and also research into methods to inform about the possible security incidents detected. We will explore techniques to protect the privacy of our datasets in order to avoid leaks of sensitive information. We will also investigate in how to employ the distributed nature of the Grid to improve the distributed detection of intrusions. This can be useful for instance, to autonomously inform other Grid sites IDS about security incidents that could spread in the Grid. We are working on further enhancing the isolation provided in our containers by using kernel hardening such as grsecurity. Besides we are currently testing the integration with other container solutions and HTC engines. \section{Conclusions} \label{conclusions} We have presented Arhuaco, a security monitoring tool for High-Throughput Computing. It employs Security by Isolation for executing and monitoring Grid jobs inside Linux Containers based on multiple sources of monitoring data such as network connections and system calls. It applies Convolutional Neural Networks to classify Grid jobs data as normal or malicious. It also utilizes a Recurrent Neural Network to learn a data model in order to generate new training samples. The proposed algorithms implemented in Arhuaco improve the security incident detection in Grid computing systems, since it is able to identify the source of an intrusion with higher accuracy. Arhuaco can analyze the huge flow of real time data that monitoring Grid jobs generate. This makes Arhuaco suitable for environments such as the WLCG, the global Grid that analyzes data from the Large Hadron Collider (LHC) at CERN, where millions of jobs are executed every day. By a set of tests carried out in the ALICE Grid as part of the WLGC, we have shown how the proposed algorithms outperform other methods used in Intrusion Detection Systems for Grid Computing. \section*{Datasets and software} Arhuaco is under development. We are discussing the possibility to release it and the training dataset as Open Source software and data. \begin{acknowledgements} Authors are grateful for the support provided by the ALICE offline team, especially Costin Grigoras, Miguel Martinez Pedreira and the CERN security department especially Stefan Lueders and Romain Wartel. Authors are also grateful with the German Federal Ministry of Education and Research (Bundesministerium fur Bildung und Forschung - BMBF) and HGS-HIRe for their financial support. \end{acknowledgements} \bibliographystyle{spmpsci}
\section{Acknowledgments} This work was supported by the Midea Corporate Research Center University Program, the National Science Foundation under grants CNS-1408730 and CAREER IIS-1253549, and the IU Office of the Vice Provost for Research, the College of Arts and Sciences, and the School of Informatics, Computing, and Engineering through the Emerging Areas of Research Project ``Learning: Brains, Machines, and Children.'' We thank Katherine Spoon, as well as the anonymous reviewers, for helpful comments and suggestions on our paper drafts. \section{Conclusion} We presented a new Convolutional Neural Network framework for action recognition on extremely low resolution videos. We achieved state-of-the-art results on the HMDB51 and DogCentric datasets with a combination of four important components: (1) a fully-coupled network architecture to leverage high resolution images in training in order to learn a cross-domain transformation between low and high resolution feature spaces; (2) 3D convolutional components which extract compact and efficient spatiotemporal features for short video units; (3) a Recurrent Neural Network (RNN) which considers long-range temporal motion information; and (4) two network streams having both image frames and stacked dense optical flow fields as input, in order to take into account detailed motion features between adjacent video frames. We hope this paper inspires more work on extremely low resolution action recognition, and in methods to learn spatial-temporal features through sequential images more generally. \section{Experiments} We now evaluate and report results of each of the above methods on our problem of action recognition in very low resolution video sequences. \subsection{Datasets} We evaluated our proposed techniques on low resolution versions of the HMDB51~\cite{kuehne2011hmdb} and DogCentric~\cite{yumi2014first} benchmarks, which are among the most widely used datasets in action recognition at extremely low resolutions. The HMDB51 (Human Motion Database) dataset consists of 7,000 video clips from a variety of sources ranging from movies to YouTube videos, and is annotated with 51 action classes such as eating, smiling, clapping, bike riding, shaking hands, etc. Each clip is approximately 2-3 seconds long and is recorded at 30 frames per second. We follow prior work and report accuracies averaged over three splits of training and testing data. The DogCentric dataset is collected from wearable cameras mounted on dogs, and consists of about 200 videos categorized into 10 different actions (which include activities performed by the dog itself (e.g., drinking, walking, etc.) and interactions between the dog and people. In contrast to HMDB51 which captures actions from a third-person perspective, these videos capture actions of the camera wearer from a first-person viewpoint. \xhdr{Low Resolution Videos.} The above two datasets were recorded at a resolution of $240\times320$ pixels. Since our C3D network expects frames at a resolution of $112\times112$ pixels, we subsample the high resolution images (used only during training) to this size. To generate low resolution training and testing data, we resize the original videos to $12\times16$ using average downsampling, then upscale them back to $112\times112$ resolution using bi-cubic interpolation. We do not introduce any extra evidence into the interpolation operation to ensure the $112\times112$ videos have no more information than the $12\times16$ videos. Figure~\ref{fig:samples} shows several corresponding low and high resolution frames as examples. \subsection{Implementation Details} Our learning process consists of two stages: (1) training the C3D network and extracting features for video units; and (2) training our fully-coupled two-stream networks with the concatenated C3D features of each video as inputs. For the C3D networks, we followed Tran \textit{et al.}~\cite{tran2014learning} and used their publicly available pre-trained model and fine-tuned on the HMDB51 and DogCentric datasets in both high and low resolution. Since we also extracted C3D features for optical flow inputs, we fine-tuned another C3D model with high and low resolution optical flows. The network architecture had 8 convolution layers, 5 max-pooling layers, and 2 fully-connected layers. The length of each video unit was set to 16 frames. We used the output of the first fully-connected layer \emph{fc6} (which had 4096 dimensions) and stacked them together to form the video descriptor. We implemented the fully-coupled two-stream networks in PyTorch~\cite{pytorch} and used the C3D features and optical flow as inputs. As discussed before, we used mixed (high and low resolution) data in the training stage, but no high resolution information is used in testing. We used the root-mean-square propagation (RMSprop)~\cite{hinton2012neural} update rule to learn the network parameters with fixed learning rate $10^{-3}$ and weight decay $0.0005$. The whole training process stopped at 50 epochs, with the batch size set to 256. All our experiments were conducted on a system with a Nvidia Titan X Pascal graphics card. \begin{table*}\centering {{ { \ra{1.2} \begin{tabular}{@{}cccccccccc@{}} \toprule \multicolumn{7}{c}{Network Architecture} & & & \\ \cmidrule{1-7} Type & & C3D & & RNN & & Fusion & & \textbf{Accuracy} \\ \midrule \multirow{2}{*}{Temporal Network} & & pre-trained & & w/o GRU & & Sum Fusion & & 21.24\% \\ & & pre-trained & & uni-directional GRU & & Sum Fusion & & 24.11\% \\ \midrule \multirow{2}{*}{Spatial Network} & & pre-trained & & w/o GRU & & Sum Fusion & & 34.90\% \\ & & pre-trained & & uni-directional GRU & & Sum Fusion & & 39.15\% \\ \midrule \multirow{7}{*}{Two-stream Network} & & pre-trained & & w/o GRU & & Sum Fusion & & 38.56\% \\ & & pre-trained & & uni-directional GRU & & Sum Fusion & & 43.38\% \\ & & w/o pre-trained & & bi-directional GRU & & Sum Fusion & & \textbf{41.04}\% \\ & & pre-trained & & bi-directional GRU & & Sum Fusion & & \textbf{44.96}\% \\ & & pre-trained & & bi-directional GRU & & Max Fusion & & 42.02\% \\ & & pre-trained & & bi-directional GRU & & Concatenate Fusion & & 43.13\% \\ & & pre-trained & & bi-directional GRU & & Convolution Fusion & & 43.46\% \\ \bottomrule \end{tabular} } }} \vspace{8pt} \caption{Evaluation results of each component of our network architecture on the HMDB51 dataset.} \label{tab:self} \end{table*} \subsection{Evaluation} Table~\ref{tab:hmdb} shows results of the evaluation. Our full model featuring pre-trained C3D networks, the bi-directional GRU network, and the fully-coupled two-stream architecture with sum fusion achieves $44.96\%$ accuracy on the low resolution HMDB51 dataset and $73.19\%$ on the low resolution DogCentric dataset. Of course, these results are significantly worse than the best results on the high resolution versions of these datasets (e.g. around $80.7\%$ for HMDB51~\cite{carreira2017quo}). (We also tested our best model on action recognition on high resolution videos, and easily achieved over $68\%$ accuracy without any explicit tuning on network architecture and hyperparameters.) However, as shown in Tables~\ref{tab:hmdb} and~\ref{tab:dog}, our results do beat all state-of-the-art approaches on low resolution video, including Pooled Time Series (PoT) (which uses a combination of HOG, HOF, CNN features)~\cite{ryoo2015pooled}, Inverse Super Resolution (ISR)~\cite{ryoo2017privacy}, Semi-coupled Two-stream Fusion ConvNets~\cite{chen2017semi}, and Multi-Siamese Embedding CNNs~\cite{ryoo2017low}. Our best result outperforms these methods by 7.2\% (3.3\% without pre-training) on the HMDB51 dataset and 3.7\% on the DogCentric dataset. To see how well our model performs on different categories, we also present a confusion matrix in Figure~\ref{fig:confusion}. \subsection{Discussion} To evaluate the contribution of each component of our model, we also implemented multiple simpler baselines. \begin{figure} \begin{center} \includegraphics[width=8.5cm]{figures/confusion.jpg} \end{center} \caption{ Confusion matrix on the HMDB51 dataset using our best model. The x-axis denotes the predicted labels and the y-axis represents the ground truth labels for 51 action classes. } \label{fig:confusion} \end{figure} \vspace{6pt} \noindent \textbf{C3D Pre-training.} To more fairly compare our model with that of Chen \etal~\cite{chen2017semi}, we experimented with training the C3D networks from scratch on HMDB51, using the same architecture and hyperparameters as the pre-trained network. As shown in Tables~\ref{tab:self} and~\ref{tab:hmdb}, although the result is about $3.9\%$ worse without pre-training on the Sport-1M dataset, our model still achieves state-of-the-art results. \vspace{6pt} \noindent \textbf{GRU Networks.} To measure the contribution of the GRU networks to our overall approach, we tried replacing them with two fully-connected layers. To reduce the interference from the two-stream networks, we also implemented two one-stream networks each with the spatial and temporal features as inputs, and compared the results between the ones with and without the GRU, respectively. The results are presented in Table~\ref{tab:self}. It is clear that the models with GRU outperform by about $4.5\%$. We also tested uni- and bi-directional GRU architectures, and found that bi-directional GRUs perform slightly better, as shown in Table~\ref{tab:self}. \vspace{6pt} \noindent \textbf{Two-stream Networks.} After evaluating the GRU networks, we now turn to the two-stream architecture, where we believe that the pixel-level motion information acquired from optical flow can improve the model's ability in temporal feature encoding. As shown in Table~\ref{tab:self}, it is clear that the two-stream networks significantly outperform one-stream networks with both spatial ($4.2\%$ better) and temporal features ($19.2\%$ better), respectively. We also assessed the effect of our four different fusion methods: (1) sum fusion, (2) max fusion, (3) concatenate fusion, and (4) convolution fusion, as discussed in the previous section. The results summarized in Table~\ref{tab:self} show that sum fusion achieves the best performance. \begin{table}\centering {{ { \ra{1.2} \begin{tabular}{@{}lccc@{}} \toprule \textbf{Approach} & \textbf{Accuracy} \\ \midrule 3-layer CNN \cite{ryoo2017privacy} & 20.81\% \\ ResNet-31 \cite{he2016deep} & 22.37\% \\ PoT (HOG + HOF + CNN) \cite{ryoo2015pooled} & 26.57\% \\ ISR \cite{ryoo2017privacy} & 28.68\% \\ Semi-coupled Two-stream ConvNets \cite{chen2017semi} & 29.20\% \\ Multi-Siamese Embedding CNN \cite{ryoo2017low} & 37.70\% \\ \midrule \textbf{Ours} (w/o pre-trained C3D) & \textbf{41.04}\% \\ \textbf{Ours} (w/ pre-trained C3D) & \textbf{44.96}\% \\ \bottomrule \end{tabular} } }} \caption{Performance of our model compared to the state-of-the-art results on the HMDB51 dataset.} \label{tab:hmdb} \end{table} \begin{table}\centering {{ { \ra{1.2} \begin{tabular}{@{}lccc@{}} \toprule \textbf{Approach} & & \textbf{Accuracy} \\ \midrule PoT (HOG + HOF + CNN) \cite{ryoo2015pooled} & & 64.60\% \\ ISR \cite{ryoo2017privacy} & & 67.36\% \\ Multi-Siamese Embedding CNN \cite{ryoo2017low} & & 69.43\% \\ \midrule \textbf{Ours} (w/ pre-trained C3D) & & \textbf{73.19}\% \\ \bottomrule \end{tabular} } }} \vspace{7pt} \caption{Performance of our model compared to the state-of-the-art results on the DogCentric dataset.} \vspace{-10pt} \label{tab:dog} \end{table} \section{Introduction} Cameras are seemingly everywhere, from the traffic cameras in cities and highways to the surveillance systems in businesses and public places. Increasingly we allow cameras even into the most private spaces in our lives: gaming consoles like Microsoft Kinect~\cite{kinect} watch our living rooms, ``smart home'' devices like Amazon Echo Look~\cite{echolook} and Nest Cam~\cite{nestcam} monitor our homes, ``smart toys'' like the Fisher-Price Smart Toy Bear~\cite{toybear} entertain our children, ``smart appliances'' like the Samsung Family Hub~\cite{familyhub} watch and respond to our everyday actions, and cameras in mobile devices like smartphones and tablets see us even in our bedrooms. While these cameras have the promise of making our lives safer and simpler, including making possible more natural, context-aware interactions with technology, they also record highly sensitive information about people and their private environments. \begin{figure}[t] {{ \begin{minipage}[b]{1.0\linewidth} \centerline{\includegraphics[height=2.5cm, width=8.3cm]{figures/sample_images_1.jpg}} \centerline{\textcolor{black}{(a) Climb Stairs}}\smallskip \end{minipage} \begin{minipage}[b]{1.0\linewidth} \centerline{\includegraphics[height=2.5cm, width=8.3cm]{figures/sample_images_2.jpg}} \centerline{\textcolor{black}{(b) Fencing}}\smallskip \end{minipage} \begin{minipage}[b]{1.0\linewidth} \centerline{\includegraphics[height=2.5cm, width=8.3cm]{figures/sample_images_3.jpg}} \centerline{\textcolor{black}{(c) Ride Bike}}\smallskip \end{minipage} }} \vspace{-5pt} \caption{ Sample frames of extremely low resolution ($12\times16$ pixel) videos streams from the HMDB51 dataset. Original high resolution frames are shown in red. } \vspace{-5pt} \label{fig:teaser} \end{figure} To make matters worse, processing for many of today's devices is often performed by remote servers ``in the cloud.'' This means that even if a user trusts that a device is using recorded video solely for legitimate purposes (which is already a leap of faith, given cases of private data being used for marketing and other unscrupulous purposes~\cite{cnbc}), and that the device has been adequately protected against hacking (another leap of faith~\cite{placeraider,nsacamerahack,smarttoys}), a user must also trust a remote cloud provider and the interlying network that their data must traverse. Even a secure and trusted cloud provider may be forced to share data with a government by a court order or intelligence agency request~\cite{amazonmurder}. One way of addressing the privacy challenge is to transmit just the minimum amount of information needed for a computer vision task to be accurately performed. In the security community, solutions based on selective encryption of image content~\cite{puppies} and firmware-enforced access control~\cite{scannerdarkly} have been proposed to keep video data safer from hacks, but service providers must still be trusted with high-fidelity video content. Another strategy is to remove private details in imagery before they leave the device. While techniques like selective image blurring~\cite{blurcollaboration}, obscuring~\cite{markit}, and various other transformations~\cite{facemorph,visualprivacysurvey,cartooning} have been studied~\cite{viewerexperience2018chi}, these all require accurately defining and detecting private content, which is in itself a highly non-trivial problem (and thus these techniques are often not effective in practice~\cite{blurfails}). Perhaps the most effective approach is to simply avoid collecting high-fidelity imagery to begin with. For example, low resolution imagery may prevent specific details of a scene from being identified -- e.g.\ the appearance of particular people, or the identity of particular objects -- while still preserving enough information for a task like scene type recognition~\cite{torralba200880}. Particularly important in many home applications of cameras is action and activity recognition, to help give smart devices high-level contextual information about what is going on in the environment and how to react and interact accordingly. Several recent papers have shown that very low resolution videos (around $16\times12$ pixels) preserve enough information for fine-grained action recognition~\cite{dai2015towards,ryoo2017privacy,chen2017semi,ryoo2017low}. This is perhaps surprising, since even a human observer may have difficulty identifying actions from such little information (Figure~\ref{fig:teaser}). This raises the question of how much better action recognition on low resolution frames can progress. Existing work on low resolution action recognition tends to focus on modeling the spatial (appearance) information in each individual frame. For example, a common approach is to use high resolution training videos to learn a transformation between high and low resolution frames, to help recover lost visual information~\cite{ryoo2017privacy}. This has been implemented by either semi-coupled networks sharing convolutional filters between high and low resolution inputs~\cite{chen2017semi} or Multi-Siamese networks learning inherent properties of low resolution~\cite{ryoo2017low}. However, much (if not most) useful information about action recognition in low resolution video is in the \textit{motion} information, not in any single frame. In this paper, we propose a fully-coupled two-stream spatiotemporal network architecture to better take advantage of both local and global temporal features for action recognition in low resolution video. Our architecture incorporates motion information at three levels: (1) a two-stream network incorporates stacked optical flow images to capture subtle spatial changes in low resolution videos; (2) a 3D Convolution (C3D) network computes temporal features within local video intervals; (3) a Recurrent Neural Network (RNN) uses the extracted C3D features from videos and optical flow fields to model more robust longer-range features. Our experiments on two challenging datasets (HMDB51 and DogCentric) show that our model significantly outperforms the previous state-of-the-art. \section{Technical Approach} \begin{figure*} \begin{center} \includegraphics[width=17.5cm]{figures/overall_2.jpg} \end{center} \caption{ Visualization of our fully-coupled two-stream spatiotemporal networks. We feed RGB frames into the spatial stream (green) and corresponding stacked optical flow fields to the temporal stream (yellow). The GRU networks (blue) compute spatiotemporal information for the entire video using the extracted C3D features as inputs. In training, both C3D and GRU are fully-coupled with convolution filters shared between high and low resolution training videos, whereas only low resolution videos are used in testing. } \label{fig:overall} \end{figure*} We now present our approach for action recognition on extremely low resolution videos. Specifically, we first introduce the basic architecture of our spatiotemporal feature extractor, which uses a combination of 3D Convolutional (C3D) Networks and Recurrent Neural Networks (RNNs). Then, we discuss how to learn transferable features from high to low resolution videos, which is based on the assumption that high resolution \textit{training} videos are available. Finally, we explore four fusion methods to efficiently combine visual and motion information during recognition. \subsection{Spatiotemporal Feature Extractor} We assume we are given an input video sequence with $L$ frames that has captured a person or people performing a single action (e.g., kicking a ball, shaking hands, chewing food, etc.) and our goal is to recognize this action. Unlike prior work that has viewed each frame as a separate processing unit, we discretize the video into $T = L/\delta$ non-overlapping \textit{video units} $V_1, ... V_T$, each containing $\delta$ consecutive frames. Figure~\ref{fig:spatiotemporal} illustrates the general architecture of the extractor network. \xhdr{Spatial Feature Extractor.} Motivated by Buch \textit{et al.}'s work~\cite{sst_buch_cvpr17} on high resolution video, we propose a feature extractor to characterize appearance information in low resolution video units. In particular, we use the C3D network, which has proven to be well-suited for modeling sequential inputs such as videos~\cite{tran2014learning}. Since C3D uses 3D convolution and pooling operations that operate over both spatial and temporal dimensions, it is able to capture motion information within each input video unit. We successively feed each video unit $V_t$ to C3D, and extract its feature representation $x_t$ from the last fully-connected layer. \xhdr{Temporal Feature Extractor.} While the C3D network is able to encode local temporal features within each video unit, it cannot model across the multiple units of a video sequence. We thus introduce a Recurrent Neural Network (RNN) to capture global sequence dependencies of the input video and cue on motion information (e.g., trajectories). Although Long Short-Term Memory (LSTM)~\cite{hochreiter1997long} networks are the most widely used RNNs in video applications, we found that Gated Recurrent Units (GRUs)~\cite{chung2015gated} performed better in our application. The basic mechanism behind GRUs is similar to LSTMs, except that they do not use memory units to control the information flow, and they have fewer parameters which makes them slightly easier and faster to use both in training and testing. More formally, the GRU is trained to take the extracted C3D features $x_1, x_2, ..., x_T$ and output a sequence of hidden states $h_1, h_2, \cdots, h_T$, with learnable hidden layer parameters $W$, $U$, and $b$. Then, the GRU cell iterates the following operations for $t \in [1, T]$: \begin{equation} \begin{split} &z_t = \textrm{sigmoid} (W_z x_t + U_z h_{t-1} + b_z), \\ &r_t = \textrm{sigmoid} (W_r x_t + U_r h_{t-1} + b_r), \\ &n_t = \textrm{tanh} (W_h x_t + U_h (r_t \circ h_{t-1}) + b_h), \mbox{ and} \\ &h_t = z_t \circ h_{t-1} + (1 - z_t) \circ n_t, \end{split} \end{equation} where $\circ$ is the Hadamard product, and $z_t$, $r_t$, $n_t$, and $h_t$ are the reset, input, new gates, and hidden state for time $t$, respectively. The hidden state $h_t$ at each time $t$ is a feature vector representing encoded spatiotemporal information corresponding to the first $t$ video units, so $h_T$ incorporates features of the entire video. We use $h_T$ as input to a fully-connected layer with a softmax classifier to output the confidence score of each action class. We call the spatiotemporal feature extractor the \emph{spatial stream} of our two-stream networks. \subsection{Fully-coupled Networks} Low resolution recognition approaches in both image and video domains have achieved better performance by learning transferable features from high to low resolutions. This process can be done either using unsupervised pre-training on super resolution sub-networks~\cite{wang2016studying} or with partially-coupled networks~\cite{wang2016studying, chen2017semi} which are more flexible for knowledge transformation. Inspired by these results, we propose a fully-coupled network architecture where all parameters of both the C3D and GRU networks are shared between high and low resolutions in the (single) training stage. The key idea is that by viewing high and low resolution video frames as two different domains, the fully-coupled network architecture is able to extract features across them. Since high resolution video contains much more visual information, training on both resolutions helps improve learning spatial features; using high resolution in training can be thought of as data augmentation, since different techniques for sub-sampling produce different low resolution examplars from the same original high resolution image. \subsection{Two-stream Networks} In this subsection, we extend our single-stream networks to two-stream networks by adding a similar architecture but with optical flow fields as the input. Since motion features between consecutive low resolution video frames are often quite small, our model benefits from optical flow images to learn pixel-level correspondences of temporal features. We call this module the \emph{temporal stream}. Figure~\ref{fig:overall} shows the main architecture of our two-stream networks. In particular, we compute optical flow fields for both high and low resolution videos, following Chen \textit{et al.}~\cite{chen2017semi} and using the public MATLAB toolbox of Liu~\cite{liu2009beyond}. The optical flows are encoded as 3-channel HSL images, where hue and saturation are converted from optical flow vectors (x- and y-components) into polar coordinates and lightness is set to one. Before computing optical flow, we downsample the high resolution frames and upsample the low resolution frames to a common size of $112 \times 112$ pixels. We also explore four widely used fusion methods, which enable the model to leverage joint visual and motion information more effectively. Following the notational convention of Feichtenhofer \etal \cite{feichtenhofer2016convolutional}, a fusion function $f : \textbf{x}^a_t, \textbf{x}^b_t \to \textbf{y}_t$ fuses two feature maps $\textbf{x}^a_t \in \mathbb{R}^{H \times W \times D}$ and $\textbf{x}^b_t \in \mathbb{R}^{H' \times W' \times D'},$ at state $t$, to output a map $\textbf{y}_t \in \mathbb{R}^{H'' \times W'' \times D''},$ where $W$, $H$, and $D$ denote the width, height and number of channels, respectively. Different papers apply the fusion function to feature maps at different points in a deep network, while our model only applies it to the final hidden state $h_T$. Since the hidden state of a GRU is a $D$-dimensional vector, for simplicity, we drop the width, height and $t$ subscripts and assume that $D = D' = D''$. \begin{figure*} \begin{center} {{ {\hspace{1cm} \textbf{HMDB51}} \hspace{6.8cm} {\textbf{DogCentric}} \\[1ex] \begin{minipage}{12pt} \rotatebox{90}{ {\textbf{Optical flow fields \hspace{1.3in} Images \hspace{0.25in}}}} \end{minipage} \begin{minipage}{12pt} \rotatebox{90}{ {{Low resolution \hspace{0.7cm} High resolution \hspace{0.5cm} Low resolution \hspace{0.7cm} High resolution }} } \end{minipage} \begin{minipage}{0.93\textwidth} \includegraphics[width=1\textwidth]{figures/sample_images_4.jpg} \end{minipage} }} \end{center} \caption{ Examples of video frames from the HMDB51 (left) and DogCentric (right) datasets. \textit{First row:} high resolution images resized to 112$\times$112 pixels; \textit{Second row:} low resolution (12$\times$16 pixel) images upsampled to 112$\times$112 with bi-cubic interpolation; \textit{Third and fourth rows:} optical flow fields for high resolution and low resolution images, respectively, calculated from images rescaled to 112$\times$112. } \label{fig:samples} \end{figure*} We consider four different fusion techniques: \begin{enumerate} \item \textbf{Sum Fusion,} $\textbf{y}^{\textrm{sum}} = f^{\textrm{sum}}(\textbf{x}^a, \textbf{x}^b),$ computes the sum of two feature vectors over each channel $d$, \begin{equation} \label{eq:1} y^{\textrm{sum}}_d = x^a_d + x^b_d, \end{equation} where $1<d<D$ and $\textbf{x}^a, \textbf{x}^b, \textbf{y} \in \mathbb{R}^{D}$. Sum fusion is based on the assumption that dimensions of the two output vectors of a two-stream network correspond to one another. \item \textbf{Max fusion,} $\textbf{y}^{\textrm{max}} = f^{\textrm{max}}(\textbf{x}^a, \textbf{x}^b)$, computes the maximum of two feature vectors over each channel $d$, \begin{equation} \label{eq:2} y^{\textrm{max}}_d = \max\{x^a_d, x^b_d\}. \end{equation} In contrast to sum fusion, max fusion only keeps the feature with the higher response, but again assumes that corresponding dimensions are comparable. \item \textbf{Concatenation Fusion,} $\textbf{y}^{\textrm{cat}} = f^{\textrm{cat}}(\textbf{x}^a, \textbf{x}^b),$ stacks two feature vectors along the channel dimension, \begin{equation} \label{eq:3} y^{\textrm{cat}}_{2d} = x^a_d \quad \textrm{and} \quad y^{\textrm{cat}}_{2d-1} = x^b_d, \end{equation} where $\textbf{y} \in \mathbb{R}^{2D}$. Instead of defining the correspondence between two feature vectors by hand, concatenation fusion leaves this to be learned by the subsequent convolution layers. \item Finally, \textbf{Convolution Fusion,} $\textbf{y}^{\textrm{conv}} = f^{\textrm{conv}}(\textbf{x}^a, \textbf{x}^b)$, is similar to concatenation fusion, but is convolved with a learnable bank of filters $\textbf{f} \in \mathbb{R}^{2D \times D^o}$ and biases $b \in \mathbb{R}^{D^o}$ are appended after the concatenation fusion, \begin{equation} \label{eq:4} y^{\textrm{conv}} = y^{\textrm{cat}} * \textbf{f} + b, \end{equation} where $*$ denotes convolution and $D^o$ denotes the number of output channels. Filter $\textbf{f}$ provides a flexible way for the fusion method to measure the weighted combination of $\textbf{x}^a$ and $\textbf{x}^b$, and is able to project the channel dimension from $2D$ to $D^o$. In order to permit a fair comparison with other methods, we set $D^o = D$ and $D^o = 2D$ in our experiments. \end{enumerate} \section{Related Work} Most state-of-the-art techniques for action recognition in video use deep learning methods. At a very high level, there are two important types of evidence about action: appearance (spatial) features within individual frames, and motion (temporal) features that cue on distinctive movement patterns. Karpathy \textit{et al.}~\cite{karpathy2014large} were among the first to study deep learning-based action recognition, proposing a multiresolution CNN architecture that operates on individual frames without explicitly modeling temporal information. Simonyan and Zisserman~\cite{simonyan2014two} used a two-stream CNN framework to incorporate both feature types, with one stream taking RGB image frames as input and the other taking pre-computed stacked optical flows. The additional stream significantly improved action recognition accuracy, indicating the importance of motion features. Tran \textit{et al.}~\cite{tran2014learning} avoided the need for precomputing optical flow features through their 3D convolution (C3D) framework, which allows deep networks to learn temporal features in an end-to-end manner. Diba \textit{et al.}~\cite{diba2016deep} combined these two ideas into two-stream C3D networks, and also proposed a more robust fusion method for better temporal information encoding. Zhu \textit{et al.}~\cite{zhu2017action} avoid pre-computing optical flow, instead learning the motion features in an end-to-end framework with a hidden two-stream network. That approach is about ten times faster than having to pre-compute optical flow, but the accuracy is somewhat weaker. Most of these papers capture motion information over relatively short temporal intervals, although several recent papers generate action proposals for longer videos with a combination of C3D and Recurrent Neural Networks (RNNs)~\cite{escorcia2016daps, sst_buch_cvpr17, gao2017turn}. Several papers have focused on recognition in extremely low resolution (LR) imagery. This problem is considered more difficult, of course, since there is simply less visual information available at low resolutions~\cite{zou2012very}. Wang \textit{et al.}~\cite{wang2016studying} address low resolution object recognition by taking advantage of high resolution training images to learn a transformation between the two resolutions. Dai \textit{et al.}~\cite{dai2015towards} adapted this idea to action recognition in the video domain, specifically focusing on extracting and learning better low resolution features from limited information. Ryoo \textit{et al.}~\cite{ryoo2017privacy} defined low resolution to be around $16 \times 16$ to $12 \times 16$ pixels and decomposed high resolution training videos into multiple LR training videos by learning different resolution transformations. Chen \textit{et al.}~\cite{chen2017semi} used two-stream semi-coupled networks to design an end-to-end training network on both visual and motion information. By observing that two LR images taken from exactly the same scene can contain totally different pixel values, recent follow-up work by Ryoo \textit{et al.}~\cite{ryoo2017low} achieved state-of-the-art LR action recognition performance by learning an embedding representation with Multi-Siamese networks. We build on these previous methods that focus mostly on modeling and encoding spatial features from low resolution video frames, and propose an action recognition approach that incorporates stronger motion information. In particular, our model captures motion information within different temporal neighborhoods, including both sequential dependencies between consecutive frames and more global temporal features. We find that this, combined with a fully-coupled network that learns from high resolution training videos, yields stronger models that significantly outperform state-of-the-art methods. \begin{figure} \begin{minipage}[b]{1.0\linewidth} \centerline{\includegraphics[width=8.5cm]{figures/overall_1.jpg}} \end{minipage} \vspace{-8pt} \caption{ Visualization of our spatiotemporal features extractor, which uses a C3D network to capture spatial and temporal features for video units and an RNN to encode motion information across the entire video stream. } \label{fig:spatiotemporal} \end{figure}
\section{Introduction} AGN outflows, which could be powered by various mechanisms (e.g., radiation or magnetic pressure, and magnetocentrifugal forces), are a very important process in the evolution of quasars as well as the evolution of their host galaxies because 1) they may facilitate the extraction of angular momentum from accreting gas, allowing gas accretion to proceed \citep[e.g.,][]{bla82,emm92,kon94,eve05}, 2) they provide energy and momentum feedback to the interstellar medium (ISM) of host galaxy and to the intergalactic medium (IGM), and inhibit star formation activity \citep[e.g.,][]{spr05}, and 3) they may enrich the IGM with heavy elements \citep[e.g.,][]{ham97b, scan04, gab06, shenmadau12}. The outflowing matter from quasars is detected via absorption features in their spectra, which appear in addition to the plethora of absorption features produced by intervening objects (e.g., foreground galaxies, the IGM, and clouds in the Milky Way). The former, usually called {\it intrinsic} absorption lines, are observed in the spectra of about half of all quasars \citep[e.g.,][]{ves03, wis04, mis07a, nes08}, while the latter, usually called {\it intervening} absorption lines, are detected in virtually all quasar spectra. Intrinsic absorption lines are a powerful tool for probing the outflowing winds of quasars, which are difficult to observe directly \citep[e.g.,][]{wey91, ham97a, ara99, sri02, moe09, cap11, fil13}. However, a drawback of most studies of intrinsic quasar absorption lines is that they probe {\it only} a single sight line (i.e., one dimension) toward the nucleus of each quasar, while the physical conditions of the outflow are likely to depend on the polar angle relative to the axis of the quasar \citep[e.g.,][]{gan01,elv00}. Therefore, the structure of the outflowing winds (e.g., absorber's size, kinematic motions, and volume density) is still largely unknown. Multiple images of quasars produced by gravitational lensing provide a unique way for studying multiple sightlines through the same outflow \citep[e.g.,][]{tur01}. Lensed quasars with large image separation angles have a very good chance of revealing structural differences in the outflowing winds in the vicinity of the quasars themselves. In this sense, the following three lensed quasars are the most promising targets because they are lensed by a cluster of galaxies rather than by a single massive galaxy: SDSS~J1004+4112 with separation angle of 14$^{\prime\prime}\!\!$.6 \citep{ina03}, SDSS~J1029+2623 with 22$^{\prime\prime}\!\!$.5 \citep{ina06,ogu08}, and SDSS~J2222+2745 with 15$^{\prime\prime}\!\!$.1 \citep{dah13}. Among these, SDSS~J1029+2623 at $z_{em}=2.197$, the current record-holding lensed quasar whose images have the largest known angular separation, has proven to be an excellent target for the study of the structure of its outflow because there are clear absorption features detected at the blue wings of the \ion{C}{4}, \ion{N}{5}, and Ly$\alpha$ emission lines in the spectra of the lensed images \citep{ina06,ogu08}. \citet{mis13} obtained a high-resolution spectrum using the Subaru telescope and the High-Dispersion Spectrograph (HDS), and discovered several clear indications that the absorption lines indeed arise in the outflowing wind; partial coverage\footnote[10]{Absorbers do not cover the background flux source completely along our sightline.} and line-locking\footnote[11]{The red component of a doublet (such as \ion{C}{4}, \ion{Si}{4}, and \ion{N}{5}) is aligned with a blue component of the following doublet, which is a signature of a radiatively driven wind and only detectable if our sightline is almost parallel to the wind streamlines \citep{ben05,bow14}}. \citet{mis13} also discovered a clear difference between the broad absorption profiles in the spectra of the two lensed images. We observed SDSS~J1029+2623 again using Subaru/HDS \citep{mis14b} and the Very Large Telescope (VLT) with the Ultraviolet and Visual Echelle Spectrograph (UVES) \citep{mis16} about four years ($\sim$1460~days) after the first observation \citep[which is longer than the $\sim$774~day time-delay between the lensed images;][]{foh13}. We confirmed that the difference in absorption profile persists at the 3$\sigma$ level in the new spectra, which suggests that our sightlines to the lensed images are indeed passing through different regions of the outflowing wind at different angles (i.e., they are not a result of time variability due to the time delay between the images) \citep{mis14b}. The size of an absorbing gas cloud, $d$, at a distance of $r$ from the source should be smaller than the physical distance between the sightlines of the two lensed images, i.e., $d$ $\leq$ $r\,\theta^{\prime}$, to avoid covering the cylinders of both sightlines. In the above expression $\theta^{\prime}= (D_{\rm ol}/D_{\rm sl})\,\theta$ is the separation angle seen from the source with $\theta$ the observed angular separation between the images and $D_{\rm ol}$ and $D_{\rm sl}$ the angular diameter distances from the observer to the lens and from the source to the lens, respectively. This result places a direct constraint on the absorber's size in the direction perpendicular to the line of sight for the first time. In this paper, we carry out the same type of observations for the quasar, SDSS~J1001+5027, which is lensed not by a cluster of galaxies but by a single massive galaxy. Because the lensed images of this quasar have an angular separation of $\sim$3$^{\prime\prime}$ (about ten times smaller than that of SDSS~J1029+2623), the cylinders of sight to the two lensed images overlap almost completely at a small distance from the source. Thus we cannot observe the structure of the outflow from two different directions. Instead, we can effectively monitor the outflow at two epochs by virtue of the time-delay between the lensed images. Among $\sim$150 lensed quasars that have been discovered so far in the CfA-Arizona Space Telescope LEns (CASTLE)\footnote[12]{https://www.cfa.harvard.edu/castles/} and SDSS Quasar Lens Search (SQLS)\footnote[13]{http://www-utap.phys.s.u-tokyo.ac.jp/~sdss/sqls/} surveys, only SDSS~J1001+5027 satisfies all of the following criteria: 1) strong absorption troughs exist in the blue wings of broad emission lines (i.e., a promising candidate for blueshifted lines from an outflowing wind), 2) bright enough ($i$ $<$ 18), 3) the angular separation of the lensed images is at least three times the typical seeing size at Mauna Kea ($\theta$ $\ga$ 2.$^{\!\!\prime\prime}$0), 4) good target visibility from the Subaru telescope, and 5) good sensitivity in the optical band for the detection of \ion{C}{4} absorption lines at $\lambda_{\rm obs}$ $\sim$ 4000 -- 7000~\AA\ (i.e., $z_{em}$ $\sim$ 1.6 -- 3.5). Our goals are ($i$) to place new limits on the physical properties of the BAL absorbing clouds and their distance from the source and ($ii$) to identify narrow absorption lines (NALs) that originate in the outflowing wind based on identical line profiles measured in spectra of comparably high signal-to-noise ratio (hereafter S/N) from the two different sightlines. The paper is organized as follows. We describe the detailed properties of our target SDSS~J1001+5027 in \S2 and the observations and data reduction in \S3. The results and discussion are presented in \S4 and \S5. Finally, we summarize our conclusions in \S6. We use a cosmology with $H_{0}$=70 \kms~Mpc$^{-1}$, $\Omega_{m}$=0.3, and $\Omega_{\Lambda}$=0.7 throughout the paper. \section{The Lensed Quasar SDSS~J1001+5027} The quasar SDSS~J1001+5027 at $\zem=1.838$ was first reported in \citet{ogu05} as a lensed quasar with two images, A ($i$ = 17.36) and B ($i$ = 17.71), that had been originally selected as a lens candidate from the Sloan Digital Sky Survey (SDSS) \citep{yor00}. The redshift of the main lensing galaxy is spectroscopically determined as \zl\ = 0.415 \citep{ina12}. The image separation ($\theta=2^{\prime\prime}\!\!.86$) is slightly larger than the typical value for lensed quasars by a single massive galaxy ($\theta$ $\sim$1--2$^{\prime\prime}$). \citet{ogu05} discovered a possible second lensing galaxy and an enhancement of galaxy number density on a larger scale, within 60$^{\prime\prime}$ of the quasar images. These additional galaxies could contribute to the large image separation. Given the redshifts of the lensing galaxy and the source (i.e., the quasar), the separation angle of the light rays that form the images~A and B, {\it as seen from the source}, is evaluated as $\theta^{\prime}= 1.\!\!^{\prime\prime}37$, which is almost half the separation angle seen from our position. The time-delay between the images has also been measured. \citet{rat13} monitored the optical $R$-band light curves of images~A and B with measurements at 443 independent epochs for more than six years, and concluded that image~A leads B by 119.3$\pm$3.3~days after combining results from five different methods.\footnote[14]{\citet{agh17} also evaluated the time-delay as 117$^{+7.1}_{-3.7}$~days based on their own algorithm, which is in good agreement with the result by \citet{rat13}.} \citet{rus16} also obtained several possible mass models for the lensing object and determined a total magnification factor $\mu=3.51$\footnote[15]{This is a weighted average of magnification factors for their 13 mass models.} of the quasar images. Because the flux ratio of images~A and B is 1:0.77 \citep{ogu05}, we will use $\mu_{\rm A}$ = 1.99 and $\mu_{\rm B}$ = 1.52 as magnification factors for images~A and B respectively throughout the paper. Here, we estimate some of the physical parameters of the quasar that will be useful in our later discussion on our results. We first estimate the sizes of the broad emission line region (BELR), $R_{\rm BELR}$, and the continuum source, $R_{\rm cont}$, following \citet{mis13}. The former is calculated using the empirical relation between $R_{\rm BELR}$ and quasar luminosity \citep{mcl04}. The monochromatic luminosity of image~A at $\lambda_r$ = 3000\AA\ in the quasar rest-frame is measured by \citet{she11} as $\log \lambda L_{3000}$ = 46.52$\pm$0.01 erg~s$^{-1}$. After correcting for magnification we estimate $R_{\rm BELR}$ $\sim$0.4$^{+0.7}_{-0.3}$~pc, where the main source of uncertainty is the scatter in the empirical relation in \citet{mcl04}. As to the size of the continuum source, we take five times the Schwarzschild radius ($5R_S$ = 10$GM_{BH}/c^2$) following \citet{mis05}, where $M_{BH}$ is the mass of the central black hole of the quasar. Recent microlensing studies suggest that the size of the continuum source is larger than the estimate based on the Shakura-Sunyaev disk model \citep{sha73} by a factor of four \citep[e.g.][see also the discussion in \citealt{rod13}]{mor10}. In this paper, however, we use the original value without correcting it so as to compare the results of our current target SDSS~J1001+5027 to those of our previous target SDSS~J1029+2623 \citep{mis13,mis14b,mis16}. The virial mass of the central black hole is already calculated in \citet{she11}. After correcting for magnification, we obtain a black hole mass of $\log (M_{BH}/M_{\odot})$ = 9.66$\pm$0.06 and a continuum source size of $R_{\rm cont} = (2.2\pm 0.3)\times10^{-3}\;$pc, about 170 times smaller than $R_{\rm BELR}$. The Eddington ratio of the quasar corresponding to the above values is $L/L_E$ $\sim$ 0.15, which is a value of typical bright quasars, $L/L_E$ $\sim$ 0.07 -- 1.6 \citep{net07}. Based on the separation angle seen from the source, $\theta^{\prime}$, and the size of sources, $R_{\rm BELR}$ and $R_{\rm cont}$, we are also able to calculate the boundary distance, $r_{\rm b}$, i.e., the distance from the source where the two cylinders of sight for an extended object corresponding to the two images become fully separated with no overlap as introduced in \citet{mis13}. The boundary distance for SDSS~J1001+5027 is $r_b = 330^{+50}_{-40}$~pc if only the continuum source is the flux source or $60^{+100}_{-40}$~kpc if the BELR is also part of the background source. Both of these are considerably larger than those evaluated for the large-separation lensed quasar SDSS~J1029+2623 \citep[$\sim$3.5~pc and $\sim$1.2~kpc, respectively; see][]{mis16}. \begin{figure*} \begin{center} \includegraphics[width=15cm,angle=0]{fig1a_c.eps} \end{center} \caption{Normalized spectra and their 1$\sigma$ errors (lower traces) for images~A and B of SDSS~J1001+5027 in epoch E1, taken with Subaru/HDS, after sampling every 0.5\AA\ for display purposes only. Identification numbers from Table~\ref{tab:abslines} are shown above the corresponding absorption lines. Crosses denote data defects such as bad columns and bad pixels.\label{fig:spec}} \end{figure*} \begin{figure*} \addtocounter{figure}{-1} \begin{center} \includegraphics[width=15cm,angle=0]{fig1d_f.eps} \end{center} \caption{Continued.} \end{figure*} \section{Observations and Data Reduction} We conducted high-resolution spectroscopic observations of the two images of the lensed quasar SDSS~J1001+5027 using Subaru/HDS on 2016 January 27 and 2017 January 19 (epochs E1 and E2, hereafter) whose time separation ($\sim$358~days) is larger than the time delay between the images ($\sim$119~days) in the observed frame. We used a slit width of $0.\!\!^{\prime\prime}8$, which yielded a resolving power of $R$ $\sim$ 45,000. The wavelength coverage is 3820--4600 \AA\ on the blue CCD and 4680--5490~\AA\ on the red CCD, which includes the \ion{Si}{4}, \ion{C}{4}, and \ion{C}{3}] emission lines at the redshift of this quasar. Because the spectra were oversampled (i.e., there were 8 pixels per resolution element), we binned every 4 pixels in both spatial and dispersion directions (i.e., $\sim$0.05\AA\ per bin) to increase the S/N. The sky conditions were good. The total integration time was 12,000~s for each image in each epoch, except for image~B in epoch E1 whose integration time was slightly longer, $\sim$14400~s. We reduced the data in a standard manner with the IRAF software\footnote[16]{IRAF is distributed by the National Optical Astronomy Observatories, which are operated by the Association of Universities for Research in Astronomy, Inc., under cooperative agreement with the National Science Foundation.}. Wavelength calibration was performed with the help of a Th-Ar lamp spectrum. We carried out the flux calibration of the spectra using the spectrum of the spectrophotometric standard star Feige~34. The final S/N is about 9--16~bin$^{-1}$ at 4500\AA. The log of the observations is presented in Table~\ref{tab:obslog}. \begin{deluxetable*}{cccccccc} \tablecaption{Log of Observations \label{tab:obslog}} \tablewidth{0pt} \tablehead{ \colhead{Target} & \colhead{RA} & \colhead{Dec} & \colhead{$m_{\rm i}$} & \colhead{Obs Date} & \colhead{$R$} & \colhead{$T_{\rm exp}$} & \colhead{S/N$^a$} \\ \colhead{} & \colhead{(hh mm ss)} & \colhead{(dd mm ss)} & \colhead{(mag)} & \colhead{} & \colhead{} & \colhead{(sec)} & \colhead{(bin$^{-1}$)} } \startdata SDSS~J1001+5027~A & 10 01 28.61 & +50 27 56.9 & 17.36 & 2016 Jan 27 & 45000 & 12000 & 16 \\ & & & & 2017 Jan 19 & 45000 & 14400 & 15 \\ \hline SDSS~J1001+5027~B & 10 01 28.35 & +50 27 58.5 & 17.71 & 2016 Jan 27 & 45000 & 12000 & 11 \\ & & & & 2017 Jan 19 & 45000 & 12000 & 9 \enddata \tablenotetext{a}{Signal to noise ratio at $\lambda_{\rm obs}$ $\sim$ 4500\AA.} \end{deluxetable*} \section{Results} We show normalized spectra over the full wavelength range of our observations for images~A and B in Figure~\ref{fig:spec}. These spectra were binned every 0.5~\AA\ for display purposes, and the 1$\sigma$ errors are also shown. Because the blue wing of the \ion{C}{4} emission line is severely absorbed at $\lambda$ $\sim$4300~\AA, we cannot fit the continuum in that region directly. Instead, we model the continuum and emission line profile using a power law and two Gaussian profiles for the broad and narrow \ion{C}{4} emission components (Figure~\ref{fig:belfit}), which is a standard practice. We do not consider the \ion{He}{2}~$\lambda$1640 emission line that is located about 250\AA\ redward of the \ion{C}{4} emission line, because its contribution to the blue wing of the \ion{C}{4} emission line is negligible. The best-fitting models are very similar for the four spectra; FWHMs of broad and narrow emission components are 5890$\pm$390~\kms\ and 1180$\pm$125~\kms, respectively, which are close to the typical values of optically bright quasars at $z$$\sim$2, $\sim$4900~\kms\ and $\sim$1400~\kms\ \citep[e.g.,][and references therein]{browills94,mar96,sul17}. \begin{figure}[h] \begin{center} \includegraphics[width=8cm,angle=0]{fig2.eps} \end{center} \caption{Flux calibrated spectra around the \ion{C}{4} emission lines of images~A and B of the quasar SDSS~J1001+5027 in epoch~E1 (upper left and right) and epoch~E2 (lower left and right), with multi-component fits using two Gaussian components (i.e., broad and narrow emission lines) and power-law (i.e., continuum level). The green line shows the continuum fit, the magenta and blue lines show the two Gaussian components and the thick red line shows the sum of all of the above.\label{fig:belfit}} \bigskip \end{figure} In addition to the broad absorption feature above, we also detect narrower absorption features whose confidence level is greater than 5$\sigma$ in the normalized spectra of images~A and B in both epochs~E1 and E2, using the line detection code {\sc search}, written by Chris Churchill. We first identify doublet lines including \ion{C}{4} and \ion{Mg}{2} in the regions between the bluest edge of the observed spectrum ($\lambda$ $\sim$ 3820\AA) and the corresponding emission lines. In total, we identified one \ion{Mg}{2} and three \ion{C}{4} systems in the image~A spectrum, and two \ion{Mg}{2} and three \ion{C}{4} systems in the image~B spectrum in both epochs. At the redshift of these systems, we also detected 11 single metal absorption lines (\ion{Si}{2}~$\lambda$1527, \ion{Fe}{2}~$\lambda$1608, \ion{Al}{2}~$\lambda$1671, \ion{Al}{3}~$\lambda$1855, \ion{Al}{3}~$\lambda$1863, \ion{Fe}{2}~$\lambda$2344, \ion{Fe}{2}~$\lambda$2374, \ion{Fe}{2}~$\lambda$2383, \ion{Fe}{2}~$\lambda$2587, \ion{Fe}{2}~$\lambda$2600, and \ion{Mg}{1}~$\lambda$2853), as summarized in Table~\ref{tab:abslines}. The \ion{Mg}{2} system at the redshift of the lensing galaxy (\zabs\ $\sim$ 0.415) is detected only in the image~B spectrum, which is probably why the image~B spectrum is redder compared to the image~A spectrum, as noted in \citet{ogu05}. \begin{deluxetable*}{ccccccccrrr} \tablecaption{Narrow Absorption Lines in epoch E1 \label{tab:abslines}} \tablewidth{0pt} \tablehead{ \multicolumn{1}{c}{} & \multicolumn{3}{c}{Image~A} & \multicolumn{1}{c}{} & \multicolumn{3}{c}{Image~B} & \multicolumn{3}{c}{} \\ \cline{2-4} \cline{6-8} \colhead{Ion} & \colhead{\zabs} & \colhead{EW$_{\rm obs}$$^a$} & \colhead{ID} & \colhead{} & \colhead{\zabs} & \colhead{EW$_{\rm obs}$$^a$} & \colhead{ID} & \colhead{$D_{\perp}$$^b$} & \colhead{$\Delta v$$^c$} & \colhead{$|\Delta$EW$|^d$} \\ \colhead{} & \colhead{} & \colhead{(\AA)} & \colhead{} & \colhead{} & \colhead{} & \colhead{(\AA)} & \colhead{} & \colhead{(pkpc)} & \colhead{(\kms)} & \colhead{(\AA)} } \startdata \ion{Mg}{2}$\lambda$2796 & ... & ... & & & 0.4147 & 2.205$\pm$0.150 & 1 & 15.7 & ... & ... \\ \ion{Mg}{2}$\lambda$2803 & ... & ... & & & & 1.663$\pm$0.124 & 3 & & & ... \\ \hline \ion{Mg}{2}$\lambda$2796 & ... & ... & & & 0.4166 & 0.352$\pm$0.043 & 2 & 15.7 & ... & ... \\ \ion{Mg}{2}$\lambda$2803 & ... & ... & & & & 0.214$\pm$0.042 & 4 & & & ... \\ \hline \ion{Mg}{2}$\lambda$2796 & 0.8716 & 1.949$\pm$0.058 & 19 & & 0.8714 & 1.656$\pm$0.105 & 23 & 7.0 & 32.1 & 0.293$\pm$0.120 \\ \ion{Mg}{2}$\lambda$2803 & & 1.638$\pm$0.055 & 20 & & & 1.279$\pm$0.090 & 24 & & & 0.359$\pm$0.105 \\ \ion{Fe}{2}$\lambda$2344 & & 0.806$\pm$0.046 & 12 & & & 0.529$\pm$0.050 & 16 & & & 0.277$\pm$0.068 \\ \ion{Fe}{2}$\lambda$2374 & & 0.283$\pm$0.025 & 13 & & & 0.213$\pm$0.050 & 17 & & & 0.070$\pm$0.056 \\ \ion{Fe}{2}$\lambda$2383 & & 1.271$\pm$0.051 & 14 & & & 1.029$\pm$0.096 & 18 & & & 0.242$\pm$0.109 \\ \ion{Fe}{2}$\lambda$2587 & & 0.557$\pm$0.030 & 16 & & & 0.414$\pm$0.057 & 20 & & & 0.143$\pm$0.064 \\ \ion{Fe}{2}$\lambda$2600 & & 1.134$\pm$0.048 & 18 & & & 0.648$\pm$0.080 & 22 & & & 0.486$\pm$0.093 \\ \ion{Mg}{1}$\lambda$2853 & & 0.457$\pm$0.042 & 21 & & & 0.322$\pm$0.036 & 25 & & & 0.135$\pm$0.055 \\ \hline \ion{C}{4}$\lambda$1548 & 1.6067 & 3.076$\pm$0.171 & 2 & & 1.6067 & 3.213$\pm$0.264 & 6 & 1.0 & 0.0 & 0.137$\pm$0.315 \\ \ion{C}{4}$\lambda$1551 & & 2.307$\pm$0.160 & 3 & & & 2.190$\pm$0.232 & 7 & & & 0.117$\pm$0.282 \\ \ion{Si}{2}$\lambda$1527 & & 0.664$\pm$0.036 & 1 & & & 0.628$\pm$0.045 & 5 & & & 0.036$\pm$0.058 \\ \ion{Fe}{2}$\lambda$1608 & & 0.183$\pm$0.022 & 8 & & & 0.235$\pm$0.057 & 12 & & & 0.052$\pm$0.061 \\ \ion{Al}{2}$\lambda$1671$^e$ & & 0.677$\pm$0.031 & 11 & & & 0.670$\pm$0.046 & 15 & & & 0.007$\pm$0.055 \\ \ion{Al}{3}$\lambda$1855 & & 0.525$\pm$0.038 & 15 & & & 0.567$\pm$0.069 & 19 & & & 0.042$\pm$0.079 \\ \ion{Al}{3}$\lambda$1863 & & 0.445$\pm$0.034 & 17 & & & 0.522$\pm$0.062 & 21 & & & 0.077$\pm$0.071 \\ \hline \ion{C}{4}$\lambda$1548 & 1.6505 & 0.149$\pm$0.034 & 4 & & 1.6530 & 0.248$\pm$0.042 & 8 & 0.8 & $-$282.8 & 0.099$\pm$0.054 \\ \ion{C}{4}$\lambda$1551 & & 0.060$\pm$0.016 & 5 & & & 0.149$\pm$0.032 & 9 & & & 0.089$\pm$0.036 \\ \hline \ion{C}{4}$\lambda$1548 & 1.6766 & 0.129$\pm$0.028 & 6 & & 1.6766 & 0.386$\pm$0.053 & 10 & 0.7 & 0.0 & 0.257$\pm$0.060 \\ \ion{C}{4}$\lambda$1551 & & 0.070$\pm$0.023 & 7 & & & 0.219$\pm$0.050 & 11 & & & 0.149$\pm$0.055 \\ \hline \ion{C}{4}$\lambda$1548$^f$ & 1.7535 & 1.208$\pm$0.149 & 9 & & 1.7536 & 1.069$\pm$0.205 & 13 & 0.3 & $-$10.9 & 0.139$\pm$0.253 \\ \ion{C}{4}$\lambda$1551$^f$ & & 1.109$\pm$0.192 & 10 & & & 0.993$\pm$0.234 & 14 & & & 0.116$\pm$0.303 \enddata \tablenotetext{a}{Observed-frame equivalent width.} \tablenotetext{b}{Physical distance between two sightlines in the transverse direction.} \tablenotetext{c}{Velocity Offset between NALs detected in images~A and B (\vej($z_B$) $-$ \vej($z_A$)).} \tablenotetext{d}{Equivalent width difference between NALs detected in images~A and B.} \tablenotetext{e}{This line is blended with \ion{C}{4} BAL.} \tablenotetext{f}{This line is probably a part of \ion{C}{4} BAL.} \end{deluxetable*} \subsection{Broad Absorption Line} The broad P-Cygni profile of the \ion{C}{4} emission line was known from medium resolution spectra ($R$ $\sim$ 2000) of the quasar \citep{ogu05}. This broad absorption feature with FWHM of $\sim$7000~\kms\ appears fairly smooth in our high-resolution spectrum, which means that the feature is indeed intrinsically broad and smooth and cannot be attributed to intervening absorbers whose typical line width is much smaller (i.e., up to several hundreds of \kms). Because this feature satisfies the definition of a broad absorption line (BALs), with more than 10\%\ of the flux absorbed over at least a 2000~\kms\ range continuously \citep{wey91}, we refer to it as a BAL, hereafter. Corresponding BAL features in lines other than \ion{C}{4} are not detected at the same redshift in our spectra although the wavelength region corresponding to the \ion{Si}{4} BAL is severely affected by bad CCD columns\footnote[17]{There is no obvious broad absorption features detected in intermediate resolution spectra ($R$ $\sim$ 2000) at which \ion{Si}{4} BAL is expected to be located \citep{mor17}.}. In a UV spectrum of the quasar taken with HST/COS, \citet{mor17} also detected \ion{O}{6} (and possibly \ion{P}{5}) BALs. The offset velocity from the quasar emission redshift along the line of sight (i.e., the apparent ejection velocity) of the \ion{C}{4} BAL is \vej\ $\sim$ 2500--9500~\kms\ (positive values correspond to blueshifts). Examining the \ion{C}{4} BAL in more detail, we note that the feature consists of three separate troughs; one narrow and two broader components. We will call these BAL components c1, c2, and c3, as shown in Figure~\ref{fig:balcomp}. Only component c1 has the blue and red members of the doublet unblended from each other. A sharp feature in component c3 at $\lambda$ $\sim$4355~\AA\ is not part of the BAL feature but is instead an \ion{Al}{2}~$\lambda$1671 line from an intervening absorber at \zabs\ = 1.6067. \vspace{1cm} \begin{figure}[h] \begin{center} \includegraphics[width=8cm,angle=0]{fig3.eps} \end{center} \caption{Comparison of \ion{C}{4} BAL profiles in the normalized spectra between image~A and B in epoch E1 (upper left) and E2 (lower left) and between image~A (upper right) and image~B (lower right) in epochs E1 and E2. Three shaded areas denote the components c1, c2, and c3.\label{fig:balcomp}} \end{figure} We also monitored the variability of the absorption profile and strength of the \ion{C}{4} BAL using spectra in two epochs whose time separation is 358~days in the observed frame (i.e., $\sim$126 days in the quasar rest frame). Because the two cylinders of sight to the two lensed images overlap completely at the distance of the absorber (as we demonstrate later in \S 5.1), we effectively monitored the same absorber at four epochs using the observations of the two lensed images in two epochs; the relative time intervals of the four epochs are $\Delta t_{\rm obs}$ = 0, 119, 358, and 476~days. We evaluated the equivalent width (EW) of the \ion{C}{4} BAL with its 1$\sigma$ error, $\sigma$(EW), in our four spectra, to search for variability. Because our measurements of EW suffer not only photon-noise ($\sigma_{\rm phot}$) but also uncertainties in the placement of the continuum level ($\sigma_{\rm cont}$), we combine these two errors in quadrature to obtain the final 1$\sigma$ error. Following \citet{mis14a}, the latter error is calculated empirically as \begin{equation} \sigma_{\rm cont}(EW) = \frac{(\lambda_{\rm max}-\lambda_{\rm min})}{2\;(S/N)}, \label{eqn:sigcont} \end{equation} where $\lambda_{\rm max}-\lambda_{\rm min}$ is the wavelength width of the \ion{C}{4} BAL \citep[see the discussion in][]{mis14a}. We do not find clear variability in the total equivalent width of the \ion{C}{4} BAL between observing epochs, although there is a small difference between images~A and B in epoch~E2 as shown in Figure~\ref{fig:ewvar}a. However, once we separate the BAL feature into three components and measure their EW separately, we note that the broader components c2 and c3 show clear variability between epochs (see Figures~\ref{fig:balcomp} and \ref{fig:ewvar}b). It appears that the EW of the component c2 first decreased in 358~days and then increased in 119~days, while that of component c3 is almost stable in the first 358~days but suddenly increased in 119~days. Thus, the variability pattern is not synchronized. We will discuss a plausible scenario to explain this behavior in the following section. \vspace{1.0cm} \begin{figure}[h] \begin{center} \includegraphics[width=8cm,angle=0]{fig4.eps} \end{center} \caption{Monitoring result for EWs of whole range of the \ion{C}{4} BAL (top) and each component (bottom). The horizontal axis is the time delay from the first epoch in the observed frame (in days). The vertical axis is the observed EWs (with 1$\sigma$ errors).\label{fig:ewvar}} \end{figure} Of three components of the \ion{C}{4} BAL, only component c1 has the blue and red members of the doublet unblended, which enables us to apply partial coverage analysis. We examine whether the optical depth ratio of the doublet lines to see if it deviate from the value of 2:1 prescribed by atomic physics. Attributing any such deviation to dilution of absorption troughs by unocculted light from the background source allows us to find the fraction of the projected area of the source that is occulted by the absorber \citep[e.g.,][]{wam95,bar97,ham97a,gan99}. We can evaluate a covering factor (\cf), a fraction of background light occulted by the absorber, by using the equation, \begin{equation} \cf(\lambda) = \frac{\left[1-R_r(\lambda)\right]^{2}}{1+R_b(\lambda)-2R_r(\lambda)}, \label{eqn:cf} \end{equation} where $R_{b}$ and $R_{r}$ are the continuum normalized intensities of the stronger (bluer) and weaker (redder) members of the doublet \citep[see, for example][]{bar97}. We evaluate \cf\ values for each {\it bin} (not for each absorption component) as done in \citet{gan99}. We can also use the line fitting software package {\sc minfit} \citep{chu97,chu03} to fit absorption profiles with four parameters; absorption redshift (\zabs), column density ($\log N$ in \cmm), Doppler parameter ($b$ in \kms), and covering factor (\cf). If {\sc minfit} gives unphysical covering factors for some components, we rerun the code assuming \cf\ = 1 for those components following \citet{mis05}. As an example, the fitting result for the image~A spectrum in epoch~E1 by both methods is shown in Figure~\ref{fig:minfit}. The fit parameters for all four spectra are summarized in Table~\ref{tab:minfit}. Although the number of absorption components needed to fit the absorption profile depends on the S/N of each spectrum (from eight components for image~A in epoch~E1 to only one component for image~B in epoch~E1), the covering factors evaluated for each bin and for each absorption component are always consistent with each other in all spectra. This result gives us confidence that component c1 shows partial coverage with \cf\ $\sim$ 0.3, which is smaller than the value evaluated for \ion{O}{6} BAL detected in the UV spectrum (\cf\ $\sim$ 0.67; \citealt{mor17}). \begin{deluxetable*}{cccccc} \tablecaption{Line Parameters of \ion{C}{4} BAL \label{tab:minfit}} \tablewidth{0pt} \tablehead{ \colhead{epoch/image$^a$} & \colhead{\zabs$^b$} & \colhead{\vej$^c$} & \colhead{$\log N$} & \colhead{$b$$^d$} & \colhead{\cf$^e$} \\ \colhead{} & \colhead{} & \colhead{(\kms)} & \colhead{(\cmm)} & \colhead{(\kms)} & \colhead{} } \startdata E1/A & 1.7524 & 9507 & 14.12$\pm$0.31 & 7.8$\pm$2.0 & 0.17$^{+0.04}_{-0.04}$ \\ & 1.7526 & 9484 & 14.02$\pm$0.17 & 11.2$\pm$2.6 & 0.19$^{+0.04}_{-0.04}$ \\ & 1.7529 & 9452 & 14.12$\pm$0.09 & 13.2$\pm$1.5 & 0.34$^{+0.04}_{-0.04}$ \\ & 1.7531 & 9424 & 14.45$\pm$0.19 & 10.8$\pm$1.4 & 0.31$^{+0.05}_{-0.05}$ \\ & 1.7536 & 9375 & 14.35$\pm$0.06 & 27.6$\pm$3.2 & 0.36$^{+0.04}_{-0.04}$ \\ & 1.7540 & 9332 & 13.95$\pm$0.30 & 7.3$\pm$2.6 & 0.20$^{+0.08}_{-0.08}$ \\ & 1.7541 & 9312 & 14.20$\pm$0.43 & 5.7$\pm$1.8 & 0.28$^{+0.06}_{-0.06}$ \\ & 1.7544 & 9289 & 14.12$\pm$0.10 & 29.2$\pm$3.3 & 0.37$^{+0.05}_{-0.04}$ \\ \cline{1-6} E1/B & 1.7536 & 9373 & 15.53$\pm$0.15 & 72.3$\pm$6.0 & 0.29$^{+0.05}_{-0.05}$ \\ \cline{1-6} E2/A & 1.7531 & 9431 & 14.60$\pm$0.09 & 37.6$\pm$3.5 & 0.31$^{+0.05}_{-0.05}$ \\ & 1.7534 & 9395 & 16.63$\pm$3.23 & 10.6$\pm$6.0 & 0.14$^{+0.06}_{-0.06}$ \\ & 1.7542 & 9306 & 14.57$\pm$0.05 & 45.2$\pm$2.4 & 0.42$^{+0.05}_{-0.05}$ \\ \cline{1-6} E2/B & 1.7536 & 9375 & 13.90$\pm$0.21 & 25.0$\pm$3.2 & 0.63$^{+0.25}_{-0.20}$ \\ & 1.7542 & 9311 & 16.26$\pm$2.72 & 9.2$\pm$4.8 & 0.36$^{+0.09}_{-0.09}$ \enddata \tablenotetext{a}{Observed epoch (E1/E2) and lens image (A/B).} \tablenotetext{b}{Redshift of flux weighted line center.} \tablenotetext{c}{Ejection velocity from quasar emission redshift.} \tablenotetext{d}{Doppler parameter.} \tablenotetext{e}{Covering factor.} \end{deluxetable*} \vspace{1.0cm} \begin{figure}[h] \begin{center} \includegraphics[width=8cm,angle=0]{fig5.eps} \end{center} \caption{Results of partial coverage analysis applied to the component c1 of the \ion{C}{4} BAL detected in image~A of SDSS~J1001+5027 in epoch E1. The horizontal axis denotes the relative velocity from the flux-weighted center of the system ($\Delta v$) while the vertical axis is the normalized flux. The first two panels show the profiles of the blue and red members of a doublet (blue and red histograms) with the model profile produced by {\sc minfit} superposed (dashed line). The positions of the absorption components are marked with upward arrows in the bottom of each panel. The bottom panel shows the covering factors with their 1$\sigma$ errors, measured for each narrow component by {\sc minfit} (green circles) or for each bin (black dots).\label{fig:minfit}} \end{figure} \subsection{Narrow Absorption Lines} While BALs are very likely physically associated with quasars, NALs are more difficult to classify as intrinsic or intervening. There are several reliable criteria to distinguish intrinsic NALs from intervening NALs including time variability, line locking, and partial coverage \citep[e.g.,][]{bar97,ham97a}. Among these, the first two are applicable to our spectra, while we cannot use partial coverage analysis because our NALs are detected in regions of our spectra where the S/N is low.\footnote[18]{We can apply the analysis only for component c1 of the \ion{C}{4} BAL above because of its simple and deep absorption profile located in a higher S/N region.} None of the NALs show time variability (with one possible exception below) nor line-locking, while both of these effects are seen in several NALs in the spectra of the large-separation lensed quasar SDSS~J1029+2623 \citep{mis16}. In addition to these three methods of identifying intrinsic NALs, \citet{mis16} introduced a new method by exploiting multi-sightline observations. If NALs with identical line profiles are detected at the same redshift (i.e., at a common apparent ejection velocity from the quasar) along two sightlines with a large physical distance in the transverse direction, the corresponding absorber is very likely to be intrinsic to the quasar, because both cylinders of sight to the two lensed images can go through the same gas parcels only if these parcels are located in the vicinity of the flux source. For example, if an absorber is located at a distance of $\sim$1~pc from the source, the physical separation between the two sightlines ($\sim$10$^{-5}$~pc) is smaller than the typical size of a clump in the outflow, $d$ $\sim$10$^{-4}$~pc, as estimated in \citet{ham13}. However, this method is effective only if ($i$) it is applied to {\it metal} absorption lines such as \ion{C}{4} and \ion{Mg}{2} NALs\footnote[19]{\ion{H}{1} absorbers in the IGM (i.e., \lya\ forest) have a much larger projected size ($\sim$1~Mpc) than the physical distance between two lines of sight to SDSS~J1001+5027 ($\sim$1--10~kpc; see Table~\ref{tab:abslines}).}, ($ii$) the NALs to be compared are detected in same quality spectra (i.e., same spectral resolution, S/N ratio, and sampling), and ($iii$) the physical distance between two sightlines in the transverse direction at the apparent redshift of the absorber is comparable to or larger than the typical size of the metal absorbers (i.e., $\sim$0.05--5~kpc; \citealt{ste16})\footnote[20]{Intervening galaxies and their circum-galactic media (CGM) are the main intervening metal absorption line systems. Although the typical extent of the CGM from galaxies is $\sim$200--300~kpc \citep[e.g.,][]{che01,chu13,tur14}, their covering factor is not unity \citep[i.e., they have an inhomogeneous internal structure; e.g.,][]{kac12,bor14,koy17}. The typical size of {\it each} clump is estimated to be $\sim$4~kpc or $\sim$50~pc for \ion{Si}{4} and \ion{Mg}{2} absorbers, respectively \citep{ste16}. We can use the \ion{Si}{4} absorber size as a proxy for the \ion{C}{4} absorber size because of its similar ionization potential. Even if two cylinders of sight to the two lensed images pass through a single cloud, the corresponding absorption-line profiles in their spectra are not identical because their total column densities are unlikely to be same (e.g., one goes through the middle of the cloud, while the other does not.).} Our spectra of SDSS~J1001+5027 satisfy all of these requirements. Although some NAL pairs are detected at almost the same redshift along the two sightlines, their line profiles are clearly different from each other. Since none of the NAL profiles match between sightlines A and B toward SDSS~J1001+5027, we cannot identify any of the 6 NAL systems detected in the spectra as intrinsic ones based only on this method. \begin{figure*} \begin{center} \includegraphics[width=12cm,angle=270]{fig6.eps} \end{center} \caption{Comparison of normalized spectra around the \ion{Mg}{1} NAL detected at \zabs\ = 0.8716 in spectra of the images~A (upper left) and B (upper right) in epochs E1 (blue) and E2 (red). The histograms above the zero flux line are 1$\sigma$ flux errors. Normalized flux variations between the spectra in two epochs as a function of velocity ((E1$-$E2)/E1; solid histogram) are shown for images~A (lower left) and B (lower right) with 1, 2, and 4$\sigma$ flux uncertainties (dotted, dashed, and solid curves). The horizontal axis is the offset velocity from \zabs\ = 0.8716.\label{fig:nalvar}} \end{figure*} Only the \ion{Mg}{1} NAL of the \ion{Mg}{2} absorption system at \zabs\ = 0.8716 shows a hint of time variability with differences at the $\sim$4$\sigma$ significance level near the minimum of the line profile. The profile appears to become narrower in $\Delta t_{\rm obs}$ = 358~days ($\Delta t_{\rm rest}$ = 191~days at \zabs\ = 0.8716) between epochs~E1 and E2 (Figure~\ref{fig:nalvar}). However, the detection of variability is marginal because there are several noise spikes in the spectra near the \ion{Mg}{1} NAL with a similar significance level of variability. We need higher quality spectra to confirm the \ion{Mg}{1} variability. It is also remarkable that all NALs in the system at \zabs\ = 0.8716 including the \ion{Mg}{1} NAL show a velocity offset in the sense that NALs in the image~A are redshifted from those in the image~B between two sightlines with a projected separation of $\sim$7~kpc (Figure~\ref{fig:nalcomp}). We computed the flux-weighted line center as the first moment of the line profile for each NAL in the spectra of both images, and found that the line centers in both spectra have substantial offset velocities with $\Delta v$ = 30$\pm$8~\kms. We interpret both the {\it marginal} \ion{Mg}{1} variability and the velocity offset as the result of motion of gas within or around a foreground galaxy at \zabs\ = 0.8716. For example, the NAL system could originate in gas clouds that are tidally stripped by a galaxy merger or accreting onto or outflowing from a foreground galaxy. This would be one of only a few cases in which NALs of low-ionization species show any time variability \citep[e.g., ][and references therein]{hac13}. \begin{figure*} \begin{center} \includegraphics[width=18cm,angle=270]{fig7.eps} \end{center} \caption{Comparison of normalized spectra around detected NALs of the \ion{Mg}{2} system at \zabs\ $\sim$ 0.8716 in spectra of the images~A (blue) and B (red) in epoch E1. The horizontal axis is the offset velocity from the flux-weighted line center of \ion{Mg}{2} in the image~A (\zabs\ = 0.8716), and the vertical axis is the normalized flux. The histograms above the zero flux line are 1$\sigma$ flux errors. The numbers at the lower left corner of each panel denote the offset velocity of the NALs in image~A from that in image~B.\label{fig:nalcomp}} \end{figure*} \section{Discussion} \subsection{Broad Absorption Line} The \ion{C}{4} BAL shows variability in profile and strength between the two observing epochs along both sightlines. There are at least three possible origins for the variability; gas motion across our sightline \citep[e.g.,][]{ham08,gib08,viv12,viv14,viv16,kro17}, a change of ionization state of the absorber \citep[e.g.,][]{ham11,ara12,mis07b,tre13,fil13,hor16}, and a microlensing event \citep[e.g.,][]{gre06}. Among these, the last one is less likely because the microlensing effect of BELs in SDSS~J1001+5027 is almost negligible \citep{gue13}. The observed variability trends can place further constraints on the possible scenarios. The time variability is seen in only portions of the \ion{C}{4} BAL and its variability pattern depends on the absorber's ejection velocity from the source (Figure~\ref{fig:balcomp}). A change of incident ionizing flux, which would affect all components in concert, is clearly inconsistent with the observed behavior. In principle, the ionization state of the absorber could change because of changes in its density due to expansion or compression but such changes are very slow in view of the local sound speed. We estimate the sound speed to be $c_s\sim10\, T_4^{1/2}\;\kms$, where $T_4$ is the temperature scaled by $10^4\;$K, which is a typical value of the temperature of a photoionized gas. Using the covering factor evaluated above and assuming conservatively that only the continuum source is covered by the absorber we find that the absorber size is $a > \cf\,R_{\rm cont} \sim 7\times 10^{-4}\;$pc. Hence the characteristic time for changes in the density due to internal motions in the absorber is $\ge 70\;$years, which is two orders of magnitude longer than the observed variability time scale. The mismatch in time scales remains significant even if we attribute different troughs of the profile to different portions of the absorber; such portions must be substantial fractions of the entire absorber as the profile comprises only three troughs. Therefore, as the most plausible and natural explanation we take the bulk gas motion scenario that is typically adopted in the case that variability occurs in just a portions of BAL profiles like SDSS~J1001+5027 \citep[e.g.,][]{gib08,ham08,cap13}. In our preferred scenario for the variability the absorber is moving either in front of the continuum source or in front of the BELR at the local dynamical speed. The latter is implausible because it would imply a transverse (i.e., rotational) velocity greater than the speed of light, namely $v_{\rm rot} \geq R_{\rm BELR}/\Delta t_{\rm rest} > c$. Thus, the continuum source is the only plausible background source in this context, and the inferred rotational velocity is $v_{\rm rot} \geq R_{\rm cont}/\Delta t_{\rm rest}$. Taking $\Delta t_{\rm rest}=42\;$days, the interval over which the most substantial EW variation is observed (see Figure~\ref{fig:ewvar}), we find that $v_{\rm rot} \geq 18,200\;$\kms. Assuming Keplerian motion, the absorber's distance is then $r\leq 0.06$~pc. Based on intermediate resolution spectra ($R$ $\sim$ 2000), \citet{mor17} also discovered variability in the \ion{C}{4} BAL strength at the $4\sigma$ confidence level on a time scale of $\sim$0.29~yrs in the quasar rest frame, which gives a limit on the absorber's distance ($r < 0.4\;$pc), which is consistent with our estimate. According to this estimate, the absorber is in the inner parts of the BELR. Moreover, if we assume that the absorber's observed velocity offset is indeed its outflow velocity, then the absorber is bound to the black hole. The inferred absorber distance is much smaller than the boundary distance of the continuum source ($r_{\rm b}$ $\sim$ 325~pc). Thus, the cylinders of sight to the two lensed images overlap almost completely at the absorber's distance. In other words, they represent a common sightline, and we have indeed monitored the BAL profile at four epochs. A consequence of this scenario is that an absorber so close to the ionizing source should be highly ionized unless its density is also quite high. For example, the volume density of the BAL absorber is required to be $n_{\rm e}$ $\sim$ 10$^{13}$~\cmmm, if we assume a typical value of the ionization parameter for the C$^{3+}$ ion ($\log U$ $\sim$ $-$1.7) \citep{ham95}. This is much larger than the expected value (e.g., $n_{\rm e}$ $\sim$ 10$^8$~\cmmm\ in a mini-BAL absorber) \citep{ham13}. Nonetheless, there are known cases of dense absorbers located very close to the ionizing continuum source, e.g., Arp~102B \citep{era03} and FIRST~J104459.6+365605 \citep{dek01}. Another possibility is that there exists some shielding material between the continuum source and the absorber. The shielding material could be the warm absorber frequently detected in X-ray spectroscopy \citep[e.g.,][]{gal02,kro07}. \begin{deluxetable*}{ccccc} \tablecaption{Comparison of Two Lensed Quasars\label{tab:comp}} \tablewidth{0pt} \tablehead{ \colhead{} & \colhead{SDSS~J1029+2623} & \colhead{Ref.$^a$} & \colhead{SDSS~J1001+5027} & \colhead{Ref.$^a$} } \startdata \zem$^b$ & 2.197 & 1 & 1.841 & 10 \\ \zl$^c$ & 0.58 & 2 & 0.415 & 11 \\ $\theta$ (arcsec) $^d$ & 22.5 & 1 & 2.86 & 10 \\ $\theta^{\prime}$ (arcsec) $^e$ & 14.6 & 3 & 1.37 & 12 \\ $\mu_{\rm A}$ $^f$ & 10.4 & 4 & 1.99 & 10,12 \\ $\Delta t_{\rm obs}$ (days) $^g$ & 744 & 5 & 119 & 13 \\ $\log L_{\rm bol}$ (erg s$^{-1}$) $^h$ & 45.87 & 6,7 & 46.93 & 7,12 \\ $L_{\rm bol}/L_{\rm Edd}$ $^i$ & 0.11 & 6 & 0.15 & 12 \\ $\log M_{\rm BH}/M_{\odot}$ $^j$ & 8.72 & 6,7 & 9.66 & 7,12 \\ $R_{\rm BELR}$ (pc) $^k$ & 0.09 & 6,7,8 & 0.37 & 7,8,12 \\ $R_{\rm cont}$ (pc) $^l$ & 2.54$\times$10$^{-4}$ & 6,7,9 & 2.16$\times$10$^{-3}$ & 7,9,12 \\ \hline \vej (\kms) $^m$ & 0 -- 1600 & 6 & 2500 -- 9500 & 12 \\ FWHM (\kms) $^n$ & 1600 & 6 & 7000 & 12 \\ Absorption Profile $^o$ & NAL & 6 & BAL & 12 \\ Covering factor & \cf\ $<$ 1 & 6 & \cf\ $<$ 1 & 12 \\ Line locking & Yes & 6 & No & 12 \\ $r_b$(BELR) (kpc) $^p$ & 1.2 & 3 & 55.6 & 12 \\ $r_b$(cont) (pc) $^q$ & 3.5 & 3 & 325 & 12 \enddata \tablenotetext{a}{References. (1) \citet{ina06}, (2) \citet{ogu08}, (3) \citet{mis16}, (4) \citet{ogu13}, (5) \citet{foh13}, (6) \citet{mis13}, (7) \citet{she11}, (8) \citet{mcl04}, (9) \citet{mis05}, (10) \citet{ogu05}, (11) \citet{ina12}, (12) this paper, (13) \citet{rat13}} \tablenotetext{b}{Quasar emission redshift.} \tablenotetext{c}{Redshift of lensing galaxy.} \tablenotetext{d}{Observed separation angle.} \tablenotetext{e}{Separation angle seen from the source.} \tablenotetext{f}{Magnification factor of the brightest image.} \tablenotetext{g}{Time delay between images~A and B.} \tablenotetext{h}{Bolometric luminosity.} \tablenotetext{i}{Eddington Ratio.} \tablenotetext{j}{Black hole mass.} \tablenotetext{k}{Size of \ion{C}{4} broad emission line region.} \tablenotetext{l}{Size of the continuum source.} \tablenotetext{m}{Ejection velocity of outflowing wind.} \tablenotetext{n}{FWHM of associated absorption system.} \tablenotetext{o}{Category of absorption profile (BAL or NAL).} \tablenotetext{p}{Boundary distance considering BELR.} \tablenotetext{q}{Boundary distance considering only the continuum source.} \end{deluxetable*} \subsection{Narrow Absorption Lines} There are three non-associated\ \ion{C}{4} NAL systems along both of the two sightlines toward SDSS~J1001+5027 (\ion{C}{4} pairs, hereafter). These are systems with apparent ejection velocities greater than 5,000 \kms\ from the quasar emission redshift \citep[e.g.,][]{wey79}. In \citet{mis16}, we also detected 11 non-associated \ion{C}{4} pairs toward the large-separation lensed quasar SDSS~J1029+2623 \citep{mis16}. Among these 14 \ion{C}{4} pairs some could still be physically associated with the quasars even if their ejection velocity is greater than 5,000~\kms. Indeed, \citet{mis07a} estimated that about 20\%\ of non-associated \ion{C}{4} NALs are intrinsic to quasars based on a covering factor analysis. However, we found that no \ion{C}{4} pairs have common absorption profiles, which means all \ion{C}{4} systems (even if some of them are physically associated with the quasar) are located further from the source than the boundary distance, $r_{\rm b}$. Nonetheless, if some systems are intrinsic to the quasar, these results would be consistent with the geometrical model of the outflowing wind in \citet{mis14b,mis16}, in which broader absorption systems like BALs are located at $r \leq r_{\rm b}$, while intrinsic NALs are at $r \gg r_{\rm b}$. As for NALs with a large ejection velocity, only the continuum source can be the background source because their position in the spectrum is far away from the corresponding BELs. We detected neither time variability (with one possible exception discussed in the next paragraph) nor line-locking of any NAL systems as signs of intrinsic absorption lines in the non-associated lines in our spectra of SDSS~J1001+5027. The latter suggests our sightline is not parallel to the outflow wind that is radiatively accelerated with resonance line absorption even if some of them are intrinsic to the quasar. This is in contrast to the variable, intrinsic NALs found in quasar SDSS~J1029+2623 \citep{mis13,mis16}. The only absorption line that shows a hint of time variability in both strength and profile is the \ion{Mg}{1} NAL of the \ion{Mg}{2} absorption system at \zabs\ = 0.8716 (Figure~\ref{fig:nalvar}). This system is less likely to be intrinsic to the quasar because its offset velocity from the quasar (\vej\ $\sim$ 118,000~\kms) is quite large. Until now, there are only a few cases of variable intervening absorption lines with large offset velocities of \vej\ $>$ 66,000~\kms\ \citep[][and references therein]{hac13}. Assuming variability of the \ion{Mg}{1} NAL is due to gas motion across the sightlines, we can place an upper limit on the cloud's size as $d \leq v_{\rm trans} \, \Delta t_{\rm rest} \sim 22~(v_{\rm trans}/200~\kms)\;$AU, where we normalized the transverse velocity by the typical rotational velocity of intervening galaxies. This system could be an analog of low-ionized ($\log U \leq -7$) metal absorbers in a small sized ($\sim$ 10--100~AU), cold ($<$ 100~K), and high volume density ($n_{\rm H}$ $\sim$ 10$^3$--10$^6$~\cmmm) pocket of gas with a large molecular content which have been detected in the Milky Way \citep[e.g.,][]{dia89,fai98,ric03} as well as outside our Galaxy \citep[e.g.,][]{kan01,jon10,hac13,ber17}. Another mechanism for the possible variability of the \ion{Mg}{1} NAL is a change of ionization state. In this case, we can place constraints on the electron density as $n_e$ $\geq$ 5,800 \cmmm, assuming that the decrease in the ionizing flux causes recombination from Mg$^{+}$ to Mg$^{0}$ \citep[e.g.,][]{ham97a,nar04}. However, a change in ionization state is less likely because it rarely occurs in just a few years in foreground galaxies \citep{nar04}. \subsection{Multi-Sightline Observation for Lensed Quasars} We performed high-resolution spectroscopic observations for a small separation lensed quasar twice in this paper and for a large-separation lensed quasar SDSS~J1029+2623 three times in \citet{mis13,mis14b,mis16}. The parameters we evaluated for the quasars based on the above observations are summarized in Table~\ref{tab:comp}. As seen in Figure~10 of \citet{mis16} and Figure~\ref{fig:balcomp} of this paper, the absorption profiles in the two lensed images are similar, which means that in both cases there is a significant overlap of the two cylinders of sight to the two lensed image. Thus, the corresponding absorbers are probably located at a distance smaller than the boundary distance \citep[see Figure~13 of][]{mis16}. \subsubsection{Intrinsic NALs in SDSS~J1029+2623} As for the NAL clustering at \zabs\ $\sim$ \zem\ in the spectra of SDSS~J1029+2623 \citep[we called it a Proximity Absorption Line, or PAL, system in][]{mis16}, we discovered that all the troughs in the PAL varied in concert, which suggests the observed variability was not due to gas motion. Assuming the variability is due to a change of ionization, \citet{mis16} placed an upper limit on its distance from the source of $r < 620$~pc by interpreting the variability time scale to be the recombination time. This distance is consistent with those evaluated for other intrinsic NAL systems in quasars that are not lensed, a few hundred parsecs to several kiloparsec \citep[e.g.,][]{ham01,nar04,ara13,bor13}. At such a large distance, the BELR can be a background flux source that contributes along with the continuum source. Indeed, the residual flux at the bottom of the PAL is almost zero on the \ion{C}{4} emission line in the spectra. The boundary distance, assuming that both the continuum source and the BELR are background sources, is $r_{\rm b} \sim 1.2$~kpc \citep{mis16}. Thus, the NAL absorbers are viewed through distinct sightlines in large-separation lensed quasars with $\theta \geq 10^{\prime\prime}$ because their distance from the flux source is large enough (i.e., comparable to the boundary distance). Small-separation lensed quasars with $\theta\sim 1^{\prime\prime}$ may still provide views through distinct sightlines of NALs with very large offset velocities that are located far from the corresponding BELs in quasar spectra (i.e., only the continuum source is the background source.). \subsubsection{BAL in SDSS~J1001+5027} In contrast, BAL absorbers are usually located at a very small radial distance of order a parsec or much less \citep[e.g.,][]{cap11,cap13}. Assuming that the variability we have observed in the \ion{C}{4} BAL of SDSS~J1001+5027 is due to a gas motion, we placed an upper limit on the absorber's distance as $r \leq 0.06$--0.5~pc. At such a small distance, the BAL absorbers could co-exist with the BELR \citep[][see also \citealt{era03}]{kro17}. Even if only the continuum source is the background source, the corresponding boundary distance is much larger than the absorber's distance (see Table~\ref{tab:comp}). Thus, a multi-sightline observation is almost impossible for BAL absorbers in the vicinity of the BELR. However, large-separation lensed quasars may allow us to perform multi-sightline observation even for BAL absorbers if the absorbers are located far from the BELR and if the BAL troughs do not overlap with the BEL profiles. \section{Summary} Using the Subaru telescope, we performed high-resolution spectroscopy of the two images of the small-separation lensed quasar SDSS~J1001+5027 ($\theta = 2.^{\!\!\prime\prime}86$) twice in a time interval of about one year to see whether the broad \ion{C}{4} absorption lines are variable or not. We discuss the constraints on the radial distance and physical conditions of the absorber and compare them to those obtained for the large-separation lensed quasar SDSS~J1029+2623 ($\theta = 22.^{\!\!\prime\prime}5$). We also search for variability and compare profiles between the sightlines for NAL absorbers seen in our spectra. Our main findings are: \begin{itemize} \item We discovered variability in the \ion{C}{4} BALs in both lensed images. The observed variations are probably caused by gas motion around the background source (i.e., the continuum source) because the absorption components in the BAL profile do not vary in concert. We infer a rotational velocity of the absorber of $v_{\rm rot}$ $\geq$ 18,000~\kms, and a radial distance from the center of $r$ $\leq$ 0.06~pc assuming Keplerian motion. \item Because BAL absorbers are believed to be located very close to the flux source (at a distance of order parsecs or less, much smaller than the boundary distance), the sightlines of the images of small-separation lensed quasars, such as SDSS~J1001+5027, are not distinct. Nonetheless, the sightlines to NAL absorbers that are several kiloparsec away from the quasar are distinct \citep[as in SDSS~J1029+2623][]{mis13,mis14b,mis16}. \item In addition to the \ion{C}{4} BAL system, we detected 6 NAL systems at \zabs\ = 0.4147--1.7536, of which only the \ion{Mg}{2} system at \zabs\ = 0.8716 shows possible time variability in its \ion{Mg}{1} profile and a $\sim$30~\kms\ velocity shear between the sightlines whose physical separation is $\sim$ 7~kpc. This is probably due to motion of the absorbing gas located in an intervening galaxy. \end{itemize} For further investigations of the outflow's geometrical and physical conditions through multi-sightline observations, we should mainly target intrinsic NAL absorbers with a large offset velocity from quasar redshift (i.e., their distance from the flux source is large) rather than BAL systems in the vicinity of the source. As for BALs, we can use lensed quasar spectra taken at a single epoch to examine their variability, exploiting the time delay between the lensed images. \acknowledgments We would like to thank the anonymous referee for extensive comments, that helped improve the paper. We also would like to thank Ken Ohsuga and Mariko Nomura for their valuable comments. We also would like to thank Christopher Churchill for providing us with the {\sc minfit} and {\sc search} software packages. The research was supported by the Japan Society for the Promotion of Science through Grant-in-Aid for Scientific Research 15K05020 and partially supported by a MEXT Grant-in-Aid for Scientific Research on Innovative Areas (No. 15H05894). JCC and ME were supported by National Science Foundation grant AST-1312686.
\section{Introduction} Magnetic Resonance Imaging (MRI) provides detailed in-vivo insights about the morphology of the human brain, which is essential for studying development, aging, and disease~\citep{giedd_brain_1999, draganski_neuroplasticity:_2004, shaw_intellectual_2006, raznahan_prenatal_2012, alexander-bloch_imaging_2013, wachinger_whole-brain_2016, lerch_studying_2017}. In order to access measurements like volume, thickness, or shape of a structure, the neuroanatomy needs to be segmented, which is a time-consuming process when performed manually~\citep{fischl_freesurfer}. Computational tools have been developed that can fully automatically segment brain MRI scans by warping a manually segmented atlas to the target scan~\citep{fischl_freesurfer,ashburner_unified_2005,rohlfing_quo_2005,svarer_mr-based_2005}. Such approaches have two potential shortcomings: (i) the estimation of the 3D deformation field for warping is computationally intense, and (ii) lack of homologies may result in erroneous segmentations of the cortex~\citep{lerch_studying_2017}. Due to these drawbacks, existing atlas-based methods require hours of processing time for each scan and may result in sub-optimal solutions. We propose a method for the \emph{Quick segmentation of NeuroAnaTomy} (QuickNAT) in MRI T1 scans based on a deep fully convolutional neural network (F-CNN) that runs in seconds on GPUs, compared to hours for existing atlas-based methods. We believe that this speed up by several orders of magnitude can have a wide impact on neuroimaging: processing of large datasets can be performed on a single GPU workstation, instead of a computing cluster; quantitative morphological measurements can be derived from a scan within seconds, boosting its translation. Furthermore, the fast processing speed allows for sampling multiple segmentations in a reasonable amount of time to estimate segmentation uncertainty for automated quality control~\citep{roy2018inherent}. Beside its speed, QuickNAT produces state-of-the-art segmentation accuracy as demonstrated on multiple datasets covering a wide age range, different field strengths, and pathologies. Moreover, it yields effect sizes that are closer to those of manual segmentations and therefore offers advantages for group analyses. Finally, QuickNAT exhibits high test-retest accuracy making it useful for longitudinal studies. Deep learning models have had ample success over the last years, but require vast amounts of annotated data for effective training~\citep{lecun_deep_2015}. The task of semantic image segmentation is dominated by F-CNN models in computer vision~\citep{long_fully_2015}. The limited availability of training data with manual annotations presents the main challenge in extending F-CNN models to brain segmentation. To address this challenge, we introduce a new training strategy (Fig.~\ref{fig:training}) that exploits large brain repositories without manual labels and small repositories with manual labels. First, we apply existing software tools (e.g., FreeSurfer~\citep{fischl_freesurfer}) to segment scans without annotations. We refer to these automatically generated segmentations as \emph{auxiliary labels}, which we use to pre-train the network. Auxiliary labels may not be as accurate as expert annotations; however, they allow us to efficiently leverage the vast amount of initially unlabeled data for supervised training of the network. It also makes the network familiar with a wide range of morphological variations of different brain structures that may exist in a wide population. In the second step, we fine-tune (i.e., continue training) the previous network with smaller manually annotated data. Pre-training provides a good prior initialization of the network, such that scarce manual annotations are optimally utilized to achieve high segmentation accuracy. As a side note, we observed that a network trained only on FreeSurfer segmentations can produce more accurate results than FreeSurfer itself. QuickNAT consists of three 2D F-CNNs operating on coronal, axial and sagittal views followed by a view aggregation step to infer the final segmentation (Fig.~\ref{fig:viewAgg}). Each F-CNN has the same architecture and is inspired by the traditional encoder/decoder based U-Net architecture with skip connections~\citep{u-net}, enhanced with unpooling layers~\citep{deconvnet} (Fig.~\ref{fig:arch}). We also introduce dense connections~\citep{densenet} within each encoder/decoder block to aid gradient flow and to promote feature re-usability, which is essential given the limited amount of training data. The network is optimized using a joint loss function of multi-class Dice loss and weighted logistic loss, where weights compensate for high class imbalance in the data and encourage proper estimation of anatomical boundaries. The two main methodological innovations of QuickNAT are the training strategy with auxiliary labels and the F-CNN architecture. To the best of our knowledge, this is the first work to conduct such a large number of experiments on highly heterogeneous datasets to evaluate the robustness of an F-CNN for brain segmentation. The code and trained model are available as extensions of MatConvNet~\citep{vedaldi_matconvnet:_2015} at \url{https://github.com/abhi4ssj/QuickNATv2}. This is an extension of our early work \citep{roy_error_2017}, where we introduced the concept of pre-training with auxiliary labels. In this work, we improved upon the architecture, segment more brain structures and show exhaustive experiments for a wide range of possibilities to substantiate the effectiveness of the framework. \section{Methods} Given an input MRI brain scan $I$, we want to infer its segmentation map $S$, which indicates $27$ cortical and subcortical structures. Given a set of scans $\mathcal{I} = \{I_1, \dots I_n \}$ and its corresponding segmentations $\mathcal{S} = \{ S_1, \dots, S_n \}$, we want to learn a function $f_{seg}:I \rightarrow S$. We express this function as an F-CNN model, termed QuickNAT, which is detailed below. \subsection{Architectural Design} QuickNAT has an encoder/decoder like 2D F-CNN architecture with $4$ encoders and $4$ decoders separated by a bottleneck layer shown in Fig.~\ref{fig:arch}. The final layer is a classifier block with softmax. The architecture includes skip connections between all encoder and decoder blocks of the same spatial resolution, similar to the U-Net architecture~\citep{u-net}. These skip connections not only provide \revision{encoder feature information} to the decoders, but also provide a path of gradient flow from the shallower layers to deeper layers, improving training. In the decoder stages, instead of up-sampling the feature maps by convolution transpose like U-Net, we included un-pooling layers~\citep{deconvnet}. These ensure appropriate spatial mappings of the activation maps during up-sampling, which in turn improves segmentation accuracy, especially for small subcortical structures. \subsubsection{Dense Block} Each dense block consists of three convolutional layers (Fig.~\ref{fig:arch}). Every convolutional layer is preceded by a batch-normalization layer and a Rectifier Linear Unit (ReLU) layer. The first two convolutional layers are followed by a concatenation layer that concatenates the input feature map with outputs of the current and previous convolutional blocks. These connections are referred to as dense connections~\citep{densenet} which improves gradient flow during training and promote feature re-usability across different stages of convolution~\citep{densenet}. In addition, they help learning better representations promoting features learned by different convoltional layers within the same block to be different. The kernel size for these two convolutional layers is kept small, $5\times5$, to limit the number of parameters. Appropriate padding is provided so that the size of feature maps before and after convolution remains constant. The output channels for each convolution layer is set to $64$, which acts as a bottleneck for feature map selectivity. The input channel size is variable, depending on the number of dense connections. The third convolutional layer is also preceded by a batch normalization and ReLU, but has a $1\times1$ kernel size to compress the feature map size to $64$. A flow diagram of the dense block is illustrated in Fig.~\ref{fig:arch}. \begin{figure*}[t] \centering \includegraphics[width=0.65\textwidth]{architecture.png} \caption{Illustration of QuickNAT's encoder-decoder based fully convolutional architecture consisting of dense, bottleneck and classifier blocks shown in the zoomed view. The symbols corresponding to different network layers are also explained here.} \label{fig:arch} \end{figure*} \subsubsection{Encoding Path} The encoder path consists of a set of $4$ dense blocks, each followed by a $2\times2$ max-pooling block, which at each stage reduces the spatial dimension of the feature maps by half. During down-sampling by max-pooling, the indices corresponding to the maximum activations are saved and passed to decoder blocks for un-pooling. \subsubsection{Bottleneck} The bottleneck block consists of a $5\times5$ convolutional layer and a batch normalization layer to separate the encoder and decoder part of the network, restricting information flow between the encoder and decoder. \subsubsection{Decoding Path} The decoder path also consists of $4$ dense blocks. Each dense block is preceded by an un-pooling layer. This layer recovers the actual spatial locations corresponding to the maximum activations, which are lost during max-pooling in the encoders, and places them at the correct location during up-sampling~\citep{deconvnet}. This is very relevant when segmenting small subcortical structures. Another, advantage of up-sampling is that it does not require any learnable parameters in comparison to convolutional transpose used in U-Net~\citep{u-net}. The up-sampling is followed by a skip-connection, which concatenates the un-pooled feature map with the output feature map of the corresponding encoder before max-pooling. Skip connections add \revision{encoder features to the decoders for aiding segmentation} and thus allow gradients to flow from deeper to shallower regions of the network. The concatenated feature map is passed to the next dense block with similar architecture. \subsubsection{Classifier Block} The output feature map from the last decoder block is passed to the classifier block, which is basically a convolutional layer with $1\times1$ kernel size that maps the input to an $N$ channel feature map, where $N$ is the number of classes ($28$ in our case). This is followed by a softmax layer to map the activations to probabilities, so that all the channels represent probability maps for each of the classes. \subsection{Loss Function} We train QuickNAT by optimizing two loss functions simultaneously: (i) the weighted logistic loss, and (ii) the multi-class Dice loss. The logistic loss provides a pixel-wise probabilistic estimate of similarity between the estimated labels and the manually annotated labels. The Dice loss is inspired from the Dice overlap ratio, which estimates similarity between the estimated and manually annotated labels~\citep{v-net}. It was initially introduced for two-class segmentation and we extend it to multi-class segmentation in this work. Given the estimated probability $p_l(\mathbf{x})$ of pixel $\mathbf{x}$ belonging to class $l$ and the its actual class $g_l(\mathbf{x})$, the loss function is \begin{equation} \mathcal{L} = \underbrace{ -\sum_{\mathbf{x}} \omega(\mathbf{x}) g_l(\mathbf{x}) \log(p_{l}(\mathbf{x}))}_{\mathrm{Logistic Loss}} - \underbrace{\frac{2 \sum_{\mathbf{x}} p_{l}(\mathbf{x}) g_{l}(\mathbf{x})}{\sum_{\mathbf{x}} p_{l}^2(\mathbf{x}) + \sum_{\mathbf{x}} g_{l}^2(\mathbf{x})}}_{\mathrm{Dice Loss}}. \label{eq:cost} \end{equation} The first term is the multi-class logistic loss and the second term is the Dice loss. We introduce weights $\omega(\mathbf{x})$, which balance the relative importance of pixels in the loss. We use weights to address two challenges: (i) class imbalance, and (ii) errors in segmentations at anatomical boundaries. Given the frequency $f_l$ of class $l$ in the training data, i.e., the class prior probability, the indicator function $\mathbb{I}$, the training segmentation~$S$, and the 2D gradient operator $\nabla$, the weights are defined as \begin{equation} \omega(\textbf{x}) = \sum_l I( S(\mathbf{x})=l) \ \frac{median(\mathbf{f})}{f_l} + \omega_0 \cdot \mathbb{I}(|\nabla S(\mathbf{x})|>0) \label{eq:weight} \end{equation} with the vector of all frequencies $\mathbf{f} = [f_1, \ldots, f_N]$. The first term models median frequency balancing~\citep{segnet} and compensates for the class imbalance problem by up-weighting rare classes in the image. The second term puts higher weight on anatomical boundary regions to encourage correct segmentation of contours. $\omega_0$ is set to $\frac{2 \cdot median(f)}{f_{min}}$ to give higher priority to boundaries. \subsection{Model Learning} We train QuickNAT with stochastic gradient descent with momentum. The learning rate is chosen such that proper convergence on validation data is achieved. It is initially set to $0.1$ and reduced by one order after every $10$ epochs during pre-training. The training is conducted \revision{until the validation loss plateaus}. We use a constant weight decay of $0.0001$. Batch size is set to $4$, limited by the 12GB RAM of the NVIDIA TITAN X Pascal GPU. Momentum is set to a high value of $0.95$ to compensate for noisy gradients due to a small batch size. Our choice for the weight decay constant and momentum is based on settings for other modern CNNs. Prior to inputing scans into the network, they are processed with `\texttt{mri-convert --conform}' from the FreeSurfer pipeline~\citep{fischl_freesurfer}, which performs basic standardization and runs in about 1 second. \begin{figure*}[h] \centering \includegraphics[width=0.7\textwidth]{training.png} \caption{Illustration of the two-step training strategy for QuickNAT. First, we use an existing segmentation software (e.g., FreeSurfer) to automatically segment a large unlabeled corpus (IXI Dataset with $581$ scans). These labels are referred to as auxiliary labels and used to pre-train QuickNAT. Second, we fine-tune the network on $28$ scans from the multi-atlas label challenge, which were manually annotated by an expert. Fine-tuning does not start from scratch, but continues optimizing the pre-trained model from step 1, to maximally benefit from the scarce data with manual annotations.} \label{fig:training} \end{figure*} \subsection{Training with Limited Annotated Data} F-CNN models directly produce a segmentation for all image pixels in an end-to-end fashion without splitting the image into patches. Therfore, they can fully exploit the image context, avoid artificial partitioning of an image, and achieves an enormous speed-up. Yet, training F-CNNs is challenging because each image serves as a single training sample and consequently much larger datasets with manual labels are required than for patch-based approaches, where each image yields many patches. While the amount of unlabeled data rapidly grows, the access to labeled data is still limited due to the labor intense process of manual annotations. At the same time, the success of deep learning is mainly driven by supervised learning, while unsupervised approaches are still an active field of research. Data augmentation artificially increases the training dataset by simulating different variations of the same data, but it cannot encompass all possible anatomical variations observable in a population. We propose to process unlabeled data with existing software tools to create auxiliary labels. These auxiliary labels are not optimal; however, they allow us to use the vast amount of initially unlabeled data for supervised pre-training of the network, enforcing a strong prior. The training procedure consists of two main steps (Fig.~\ref{fig:training}): \begin{enumerate} \item \textbf{Pre-training on large unlabeled datasets with auxiliary labels:} In this step, we use a large neuroimaging dataset (IXI dataset~\footnote{http://brain-development.org/ixi-dataset/}) and process it with an existing tool to create auxiliary labels. The IXI dataset was acquired from three centers and is characterized by a high age range of participants and substantial anatomic variability. We apply the widely used FreeSurfer~\citep{fischl_freesurfer} to obtain auxiliary segmentations, but other tools could be used, depending on the application. We pre-train QuickNAT on this large dataset with auxiliary labels, which results in a network that imitates FreeSurfer segmentations. Pre-training enforces a strong prior on the network, where robustness to data heterogeneity is encouraged by the diversity of the IXI dataset. \item \textbf{Fine-tuning with limited manually labelled data:} In this step, we take the pre-trained model and fine-tune it with small data having manual annotations. Instead of learning all filters from scratch, fine-tuning only focuses on rectifying discrepancies between auxiliary and manual labels. We use data from the Multi-Atlas Labelling Challenge dataset~\citep{malc} for fine-tuning. During this, we lower the initial learning rate to $0.01$ and reduce it by an order of magnitude after every $5$ epochs until convergence. \end{enumerate} \subsection{Multi-View Aggregation} To also consider the third dimension in QuickNAT, we train a separate F-CNN for each of the three principal views: coronal, axial and sagittal (Fig.~\ref{fig:viewAgg}). The predictions for each these networks are combined into the final segmentation in a multi-view aggregation step. The final label for a voxel $\mathbf{x}$ is given by $L_{Pred}(\mathbf{x})$, which is computed as \begin{equation} L_{Pred}(\mathbf{x}) = \argmax_c ( \lambda_1 p_{Ax}(\mathbf{x}) + \lambda_2 p_{Cor}(\mathbf{x}) +\lambda_3 p_{Sag}(\mathbf{x}) ) \end{equation} \noindent where $p_{Ax}(\mathbf{x})$, $p_{Cor}(\mathbf{x})$, $p_{Sag}(\mathbf{x})$ are the predicted probability vectors for axial, coronal and sagittal views respectively, and $\lambda_1$, $\lambda_2$, $\lambda_3$ their corresponding fixed weights. The probability score for a particular structure reflects the certainty of the network in the prediction, which depends on how well the structure is represented in the corresponding view. Aggregating all the votes for a voxel $\mathbf{x}$ provides a regularization effect for the label prediction and reduces spurious predictions. The highly symmetric layout of the brain poses challenges for segmentation in sagittal slices, as it is not possible to differentiate slices from the left and right hemisphere. Thus, we assign structures from the left and right hemisphere the same label number for training on sagittal slices. This reduces the number of classes from 28 to 16. At testing, we re-map the probability maps from 16 to 28 structures by replicating probabilities for left and right. Due to this, we assign a lower value to $\lambda_3$ in comparison to $\lambda_1$ and $\lambda_2$. In our case, we set $\lambda_1,\lambda_2,\lambda_3$ to 0.4, 0.4 and 0.2, respectively, to give relatively equal importance to all views. \begin{figure*}[t] \centering \includegraphics[width=0.65\textwidth]{viewAgg.png} \caption{We show the multi-view aggregation step that combines segmentations from models trained on 2D slices along three principal axes: coronal, sagittal and axial. The final segmentation is obtained by combining the probability maps from all the three networks.} \label{fig:viewAgg} \end{figure*} \section{Experimental Datasets} We use nine brain MRI datasets in our experiments. We use five datasets with manual annotations to evaluate segmentation accuracy. Three datasets were used for testing reliability of the segmentation framework. Table~\ref{tab:dataset} summarizes the number of subjects per dataset, the age range, the diagnosis, and the annotated structures. Present diagnoses are Alzheimer's disease (AD), mild cognitive impairment (MCI), and psychiatric disorders. Details about acquisition protocol used in each of the datasets can be found in their respective references. All MRI datasets are publicly available. \noindent (i) \textbf{IXI dataset:} The dataset is collected from 3 different hospitals from London (Hammersmith hospital, Guy's hospital, institute of psychiatry) and consists of both 1.5T and 3.0T MRI T1 scans for 581 healthy subjects. The data was collected by Imperial College London and is available for download at \url{http://brain-development.org/ixi-dataset/}. \noindent (ii) \textbf{Multi-Atlas Labelling Challenge (MALC):} The dataset is part of the OASIS dataset~\citep{marcus_open_2007} and contains MRI T1 scans from 30 subjects with manual annotations for the whole brain~\citep{malc}. In the challenge, 15 volumes were defined for training and 15 for testing. We follow the same setup in our experiments. The dataset also includes follow-up scans from 5 subjects to evaluate inter-run consistency. Manual segmentations were provided by Neuromorphometrics, Inc. under academic subscription. \noindent (iii) \textbf{ADNI-29:} The dataset is a subset of 29 subjects from the Alzheimer's Disease Neuroimaging Initiative~\citep{jack_tracking_2013} (ADNI, \url{adni.loni.usc.edu}). The primary goal of ADNI has been to test whether serial MRI, PET, other biological markers, and clinical and neuropsychological assessment can be combined to measure progression of MCI and AD. Manual whole-brain segmentations were provided by Neuromorphometrics, Inc. under academic subscription. The dataset includes 15 controls and 14 Alzheimer's patients. Furthermore, 15 scans were acquired with 1.5T field strength and 14 scans with 3.0T, with balanced distribution of AD and controls. \noindent (iv) \textbf{Internet Brain Segmentation Repository (IBSR):} The dataset consists of 18 T1 MRI scans with manual segmentations of the whole brain~\citep{rohlfing2012image}. The MR scans and their manual segmentations were provided by the Center for Morphometric Analysis at Massachusetts General Hospital and are available at \url{http://www.cma.mgh.harvard.edu/ibsr/}. \noindent (v) \textbf{Child and Adolescent NeuroDevelopment Initiative (CANDI):} The dataset consists of 13 T1 MRI scans (8 male, 5 female) of children with psychiatric disorders, having minimum age of 5, maximum age of 15 and mean age of 10 years. Manual whole-brain segmentations were provided by Neuromorphometrics, Inc. under academic subscription. The dataset is publicly available at \cite{kennedy_candishare:_2012}. \noindent (vi) \textbf{Harmonized Protocol (HarP):} The European Alzheimer's Disease Consortium and ADNI~\citep{jack_tracking_2013} together provided a Harmonized Protocol (HarP) for manual hippocampal segmentation from MRI \citep{boccardi_training_2015}. It was defined by through an evidence-based Delphi panel that converged on a consensus definition. After standardization, a dataset with 131 volumes was released with manually annotated right/left hippocampus for development and evaluation of standard automated hippocampus segmentation algorithms. Special attention was paid for ensuring that the dataset is representative of physiological and pathological variability (age, dementia severity), field strength (1.5T and 3T) and scanner manufacturer (GE, Philips and Siemens). 45 scans were from AD subjects, 42 scans from Controls and 44 scans from MCI. \noindent (vii) \textbf{ALVIN:} \cite{kempton_comprehensive_2011}~released the ALVIN dataset in an attempt to standardize the evaluation of segmentation algorithms. The dataset consists of 7 young adult subjects and 9 subjects with Alzheimer's disease. The dataset does not provide manual segmentations but volume measurements of the ventricles. These volume measurements are available from a manual rater at two points in time to observe intra-observer variability. \noindent (viii) \textbf{Test-Retest (TRT) dataset:} This dataset was released to analyze reliability of segmentation frameworks for estimating volumes of brain structures~\citep{maclaren_reliability_2014}. The dataset consists of 120 MRI T1 scans from 3 subjects (40 scans per subject) in 20 sessions (2 scans per session) over the duration of 31 days. All the subjects were healthy aged 26-31 years. \noindent (ix) \textbf{Travelling Human Phantom (THP) dataset:} This dataset was released to check the reliability of automated segmentation frameworks in estimating volumes from scans acquired from different sites~\citep{magnotta_multicenter_2012}. In the study, 3 healthy subjects were scanned at 8 different centers in the USA using scanners from different vendors. All scans were acquired within a period of 30 days. The sites are: (1) Cleveland Clinic, (2) Dartmouth, (3) University of Iowa, (4) Johns Hopkins, (5) Massachusetts General Hospital, (6) University of California Irvine, (7) University of Minnesota, (8) University of Washington. In our experiments, we use FreeSurfer annotations from IXI for pre-training and manual annotations from MALC (provided by Neuromorphomrtrics Inc. under academic license) for fine-tuning. The definitions of anatomical structures between MALC and FreeSurfer are identical. Annotators at Neuromorphometrics Inc. follow the CMA (Center for Morphometric Analysis) protocol, which was also used in the creation of the FreeSurfer atlas. \revision{ADNI-29 and HarP are a subset from the Alzheimer's Disease Neuroimaging Initiative (ADNI) database (adni.loni.usc.edu). The ADNI was launched in 2003 as a public-private partnership, led by Principal Investigator Michael W. Weiner, MD. The primary goal of ADNI has been to test whether serial magnetic resonance imaging (MRI), positron emission tomography (PET), other biological markers, and clinical and neuropsychological assessment can be combined to measure the progression of mild cognitive impairment (MCI) and early Alzheimer's disease (AD). For up-to-date information, see www.adni-info.org.} \begin{table*}[t] \centering \caption{Summary of the datasets used for training and testing. Dataset characteristics are shown together with available manually annotated structures. Information regarding the diagnosis of IBSR dataset and Age information of THP dataset were not available.} \begin{tabular}{|p{1in}|c|p{1.3in}|c|c|} \hline \textbf{Dataset} & No. of Subjects & \revision{Age} & Diagnosis & Annotations\\ \hline \textbf{IXI} & 581 & $49.09\pm16.43$ & Normal & None \\ \hline \textbf{MALC} & 30 & $3416\pm20.40$ & CN/AD/MCI & Whole Brain \\ \hline \textbf{ADNI-29} & 29 & $75.87\pm5.86$ & CN/AD & Whole Brain \\ \hline \textbf{IBSR} & 18 & $29.05\pm4.80$ & - & Whole Brain \\ \hline \textbf{CANDI} & 13 & $10.00\pm3.13$ & Psychiatric Disorders & Whole Brain \\ \hline \textbf{ALVIN} & 16 & AD:~$77.4\pm2.4$, Young adults:~$23.8\pm4.1$ & CN/AD & Lateral Ventricle \\ \hline \textbf{HarP} & 131 & AD:~$74.2\pm7.8$, CN:~$76.2\pm7.4$, MCI:~$74.7\pm8.1$ & CN/MCI/AD & Hippocampus \\ \hline \textbf{TRT} & 3 (40 scans/subject) & 26-31 & Normal & None \\ \hline \textbf{THP} & 5 (Scans from 8 sites in USA) & - & Normal & None \\ \hline \end{tabular} \label{tab:dataset} \end{table*} \begin{table*}[t] \centering \caption{Summary of the experiments for evaluating segmentation accuracy (1-5) and reliability (6-8). For each experiment, the table indicates the datasets used for pre-training, fine-tuning and testing together with the number of scans in parentheses. We also list the purpose for each experiment.} \begin{tabular}{|p{1in}|c|c|c|c|p{1.8in}|} \hline \textbf{Evaluation} & \textbf{Experiment} & \textbf{Pre-training} & \textbf{Fine-tuning} & \textbf{Testing} & \textbf{Purpose of Experiment}\\ \hline \multirow{5}{*}{}{Segmentation Accuracy} & Experiment 1 & IXI (581) & MALC (15) & MALC (15) & Benchmark Challenge Dataset. \\ \cline{2-6} & Experiment 2 & IXI (581) & MALC (28) & ADNI (29) & Robustness to pathology, scanner field strength, group analysis by effect sizes. \\ \cline{2-6} & Experiment 3 & IXI (581) & MALC (28) & IBSR (18) & Robustness to low resolution data with wide age range. \\ \cline{2-6} & Experiment 4 & IXI (581) & MALC (28) & CANDI (13) & Robustness to children with psychological disorders. \\ \cline{2-6} & Experiment 5 & IXI (581) & MALC (28) & HarP (131) & Robustness of hippocampus segmentation in presence of dementia. \\ \hline \multirow{3}{*}{}{Segmentation Reliability} & Experiment 6 & IXI (581) & MALC (28) & ALVIN (16) & Reliable volume estimation of lateral ventricles for young and aged subjects (dementia). \\ \cline{2-6} & Experiment 7 & IXI (581) & MALC (28) & TRT (120) & Inter- and intra-session reliability. \\ \cline{2-6} & Experiment 8 & IXI (581) & MALC (28) & HTP (67) & Reliability across 8 centers with different scanners. \\ \hline \end{tabular} \label{tab:experiments} \end{table*} \section{Experiments and Results} We evaluate QuickNAT in a comprehensive series of eight experiments to assess accuracy, reproducibility, and sensitivity on a large variety of neuroimaging datasets, summarized in Tab.~\ref{tab:experiments}. In all experiments, we pre-train QuickNAT on 581 MRI volumes from the IXI dataset to get auxiliary segmentations from FreeSurfer~\citep{fischl_freesurfer}. We conducted 5 experiments to evaluate the segmentation accuracy (experiments 1 to 5; Sec.~\ref{sec:samedata} and Sec.~\ref{sec:diffdata}), and another 3 experiments (experiments 6 to 8; Sec.~\ref{sec:segreg}) to assess the reliability and consistency of QuickNAT segmentations. We divided Experiments 1-5 into two sets, (i) Training and testing on the same dataset (Sec.~\ref{sec:samedata}), and (ii) Training and testing on different dataset, i.e. cross dataset experiments (Sec.~\ref{sec:diffdata}). \subsection{Evaluation of segmentation accuracy with training and testing on same dataset} \label{sec:samedata} \subsubsection{Experiment 1: MALC} In the first experiment, we use the MALC data and replicate the setup of the original challenge~\citep{malc}. A problem associated with segmenting this dataset is that all the training volumes are from young adults while testing volumes include subjects with 70 years and older (maximum 90 years). To achieve good performance, the network therefore has to be robust to differences due to age. In this experiment, we compare the performance of QuickNAT with state-of-the-art methods and evaluate the impact of pre-training. Tab.~\ref{tab:malc} reports the results measured in Dice overlap score. First, we compare with the existing F-CNN models (FCN~\citep{long_fully_2015}, U-Net~\citep{u-net}). Along each column, we observe that for all the F-CNN models, pre-training with auxiliary labels followed by fine-tuning (termed `Fine-tuned' in Tab.~\ref{tab:malc}) yields significantly ($p<0.001$) better performance than training only with limited manually annotated data (termed `Only Manual' in Tab.~\ref{tab:malc}). Second, when comparing across rows, we observe that QuickNAT performs better than U-Net and FCN in every setting. QuickNAT significantly ($p<0.001$) outperforms U-Net and FCN by a margin of $5\%$ points and $12\%$ points mean Dice score after fine-tuning. Noteworthy is that QuickNAT not only is better when trained on the FreeSurfer labels (pre-trained model) but also when trained exclusively with limited manually annotated data. \begin{table*}[t] \centering \caption{Comparison of Dice scores of QuickNAT with state-of-the-art methods on 15 testing scans from MALC. Results of only using the pre-trained model on test data is referred as `\textbf{Pre-Trained}'. Results for training only with 15 manual data from scratch is referred as `\textbf{Only Manual}'. Results of using the pre-trained model and fine-tune it with 15 manual data is referred as `\textbf{Fine-tuned}'.} \begin{tabular}{|p{1.5in}|p{0.9in}|p{0.9in}|p{0.9in}|} \hline \textbf{Method} & \textbf{Pre-Trained} & \textbf{Only Manual} & \textbf{Fine-Tuned}\\ \hline \textbf{QuickNAT} & $0.798\pm0.097$ & $0.874\pm0.067$ & $\mathbf{0.901\pm0.045}$ \\ \hline \textbf{U-Net} & $0.681\pm0.193$ & $0.762\pm0.124$ & $0.857\pm0.079$ \\ \hline \textbf{FCN} & $0.579\pm0.245$ & $0.534\pm0.311$ & $0.778\pm0.121$ \\ \hline \textbf{DeepNAT} & \multicolumn{3}{c|}{$0.891$ for $25$ structures} \\ \hline \textbf{Spatial Staple} & \multicolumn{3}{c|}{$0.879\pm0.063$} \\ \hline \textbf{PICSL} & \multicolumn{3}{c|}{$0.898\pm0.050$} \\ \hline \end{tabular} \label{tab:malc} \end{table*} Next, we compare the fine-tuned QuickNAT model with state-of-the-art atlas-based methods PICSL~\citep{wang_multi-atlas_2013} (winner of challenge) and Spatial STAPLE~\citep{asman_formulating_2012} (top 5 in challenge), and state-of-the-art 3D CNN based deep learning method DeepNAT~\citep{wachinger_deepnat:_2017}. Our model outperforms Spatial STAPLE by a statistically significant margin ($p<0.05$). The 15 scans for training and the 15 scans for testing were consistent with the challenge definition, for a fair comparison. It outperforms PICSL by a small margin, which is not statistically significant. It also outperforms DeepNAT when comparing segmentations for only 25 structures. DeepNAT operates in 3D, however, on patches extracted from the image, which limits the context for prediction. A direct extension to a 3D full volume prediction, instead of patches, is limited by the current available amount of GPU memory. In addition to comparing of brain-wide Dice scores, we performed a structure-wise comparison (see Fig.~\ref{fig:malc_box}). Significant differences are highlighted with a star symbol ($\star$). No significant differences exist across any of the 27 structures to the challenge winner PICSL. QuickNAT has significantly higher Dice for many structures compared to Spatial STAPLE (14 of 27) and U-Net (23 of 27). \begin{figure*}[t] \centering \includegraphics[width=0.999\textwidth]{malc_whole_boxplot.png} \caption{Box-plot of Dice scores comparing QuickNAT with PICSL, Spatial STAPLE and U-Net on 15 test volumes of MALC dataset for all the 27 structures. Statistical significance ($p < 0.05$) in comparison to QuickNAT is indicated by a star symbol ($\star$). The p-values were estimates using two-sided Wilcoxon rank-sum test. WM indicates White Matter and GM indicates Grey Matter.} \label{fig:malc_box} \end{figure*} \noindent \textbf{Qualitative Analysis: } Sample segmentations are visualized in Fig.~\ref{fig:malc_seg} for QuickNAT (trained on small data), PICSL and QuickNAT (fine-tuned) along with the manual segmentation. A zoomed view of the segmentations is also presented. We indicate two important subcortical structures left putamen (brown) and left pallidum (white) with a white arrow. We can observe under-inclusion of left putamen for PICSL. We also observe many spurious misclassified regions in the background in QuickNAT (trained with limited data), which are absent for QuickNAT (fine-tuned). \begin{figure*}[t] \centering \includegraphics[width=0.8\textwidth]{malc_Seg.png} \caption{Qualitative results of QuickNAT trained with and without pre-training along with PICSL. A zoomed view shows left Putamen (dark brown) and left Pallidum (white) with a white arrow for all the cases indicating the superior segmentation performance of fine-tuned QuickNAT over others.} \label{fig:malc_seg} \end{figure*} \noindent \textbf{Speed: } Existing state-of-the-art atlas-based brain segmentation frameworks build upon 3D deformable volume registration, e.g., ANTs~\citep{avants2ducibl011reproe}. In pair-wise registrations, each image in the atlas is transformed to the test image. This results in long runtimes, since a single pair-wise registration takes about 2 hours on a 2GHz CPU machine~\citep{malc}. On MALC with 15 training images, the approximate segmentation time for both PICSL and Spatial STAPLE is 30h/vol. FreeSurfer has its own atlas and takes around 4h/vol. DeepNAT uses a 3D patch-based approach for segmentation, which takes around 1h/vol. In comparison to these models, QuickNAT segments a volume in 20s, which is orders of magnitude faster. We illustrate the segmentation time in Fig.~\ref{fig:speed} in logarithmic scale. The speed of QuickNAT can be further reduced to about 6s, if only one anatomical view instead of all three are used for segmentation. We observed the best segmentation performance on a single view for coronal view, with an overall Dice of $0.895\pm0.055$ compared to $0.901\pm0.045$ with view aggregation. \begin{figure}[h] \centering \includegraphics[width=0.49\textwidth]{speed.png} \caption{illustration of segmentation speed for QuickNAT, DeepNAT, FreeSurfer and PICSL in log scale, demonstrating its superior speed.} \label{fig:speed} \end{figure} \noindent \textbf{Inter-Run Consistency: } MALC includes a second MRI T1 scan for 5 patients to evaluate the consistency of the segmentation algorithm across acquisitions (test/retest). For quantification, we estimate the volumes of different structures for both runs and compute the volume distance ($d_V$) between them. \revision{This metric indicates the error in volume estimation after segmentation. It is defined as \begin{equation} d_V(V_a, V_e) = 2\frac{|V_a - V_e|}{V_a + V_e} \end{equation} where $V_a$ is the actual volume (estimated from manual segmentation) and $V_e$ is the estimated volume, for a given structure. Higher volume distance indicates poor estimation of volume and therefore an indirect measure of low segmentation quality.} Table~\ref{tab:malc_consis} reports mean volume distance for whole brain, hippocampus, amygdala, lateral ventricles, white matter and grey matter; comparing QuickNAT with PICSL and Spatial STAPLE. In case of whole brain, all values are very low with low standard deviation, indicating that each of the methods produces highly consistent results. For structures hippocampus, white matter, grey matter QuickNAT has a lower volume distance indicating its superiority over PICSL and Spatial STAPLE. For structures Lateral ventricle and amygdala, QuickNAT has poorer performance than PICSL and Spatial STAPLE, but within an acceptable range of $2-3\%$. \begin{table}[t] \footnotesize \centering \caption{Inter-Run Consistency reported by volume distance over 5 subjects from MALC Dataset chosen by the Challenge organizers.} \begin{tabular}{|p{0.8in}|p{0.65in}|p{0.65in}|p{0.65in}|} \hline \textbf{Structures} & \textbf{Spatial STAPLE} & \textbf{PICSL} & \textbf{QuickNAT}\\ \hline Whole Brain & $0.013\pm0.015$ & $0.018\pm0.018$ & $0.017\pm0.016$ \\ Hippocampus & $0.021\pm0.012$ & $0.041\pm0.026$ & $0.020\pm0.012$ \\ Amygdala & $0.011\pm0.009$ & $0.010\pm0.001$ & $0.025\pm0.012$ \\ Lat. Ventricles & $0.012\pm0.005$ & $0.015\pm0.010$ & $0.032\pm0.025$ \\ White Matter & $0.005\pm0.004$ & $0.012\pm0.005$ & $0.005\pm0.004$ \\ Grey Matter & $0.011\pm0.011$ & $0.019\pm0.006$ & $0.009\pm0.006$ \\ \hline \end{tabular} \label{tab:malc_consis} \end{table} \noindent \textbf{Importance of View Aggregation: } To evaluate the impact of view aggregation, we conducted 4 experiments with our model on 15 test volumes of MALC datasets: (i) Only coronal model, (ii) Only axial model, (iii) Aggregation of coronal and axial models, and (iv) Aggregation of coronal, axial and sagittal models. The results are reported in Table~\ref{tab:malc_viewagg}. We can observe that coronal is the best view. Aggregation with axial increases performance, with the best performance aggregating all the orthogonal views ($p<0.05$). \begin{table}[t] \centering \caption{Segmentation performance for different views and with different view aggregation.} \begin{tabular}{|p{1.7in}|p{1.2in}|} \hline \textbf{Views} & \textbf{Mean Dice score} \\ \hline Only Coronal & $0.895\pm0.055$ \\ Only Axial & $0.879\pm0.062$ \\ Coronal + Axial & $0.897\pm0.052$ \\ Coronal + Axial + Sagittal & $\mathbf{0.901\pm0.045}$ \\ \hline \end{tabular} \label{tab:malc_viewagg} \end{table} \subsection{Evaluation of segmentation accuracy with training and testing on different dataset} \label{sec:diffdata} In the following experiments, we evaluate the generalizability of QuickNAT by applying the network on datasets that have not been used for training. We increase the number of training scans from MALC from 15 to 28 and compare to FreeSurfer~\citep{fischl_freesurfer} and FSL~\citep{ashburner_unified_2005}, which are the most frequently used tools for neuroanatomical reconstruction. Note that manual annotations of the training/testing datasets follow the same protocol as the FreeSurfer atlas, defined by the Center for Morphometric Analysis at Massachusetts General Hospital. We assess accuracy with respect to the age of subjects, the presence of disease (Alzheimer's disease, AD), and the magnetic field strength (3.0T/1.5T). Finally, we evaluate the sensitivity of automated segmentation in comparison to manual segmentation in group analyses. \subsubsection{Experiment 2: ADNI-29} \label{sec:adni29} In this experiment, we test whole brain segmentation on 29 scans from the Alzheimer's Disease Neuroimaging Initiative (ADNI) that were manually annotated by Neomorphometrics Inc. ADNI~\citep{jack_alzheimers_2008} is one of the largest longitudinal neuroimaging studies to date. ADNI-29 contains whole brain segmentations for 14 AD patients and 15 controls from the ADNI dataset~\citep{jack_alzheimers_2008}. The dataset contains 15 1.5T scans and 14 3.0T scans. Beside measuring segmentation accuracy, we also use this dataset to evaluate the performance of QuickNAT in group analysis by computing effect sizes and p-values. We segmented all 29 scans by applying the already trained QuickNAT model. The mean Dice score on the dataset for FreeSurfer is $0.778\pm0.097$ and for QuickNAT $0.841\pm0.064$. QuickNAT outperforms FreeSurfer by 6\% points in Dice score with $p<10^{-7}$. Also, a structure-wise comparison is provided in Fig.~\ref{fig:adni_box}, where QuickNAT has significantly higher dice score than FreeSurfer for 24 out of 27 structures. We also deployed our `Pre-trained' network (trained with FreeSurfer auxiliary labels on IXI dataset) on this dataset, which resulted in a mean Dice score of $0.789\pm0.093$. Interestingly, this network, only trained on FreeSurfer annotations, achieves a $1.1\%$ points higher Dice score than FreeSurfer itself. We evaluated the effectiveness of our proposed training strategy of first pre-training followed by fine-tuning in Experiment 1 (Table~\ref{tab:malc}) on MALC dataset. On ADNI-29 which is an unseen dataset, we observed a similar trend where fine-tuning lead to $6\%$ points increase in global Dice score. We conducted another experiment, where we trained QuickNAT on the union of the IXI and MALC dataset. When applied to ADNI-29 we obtain a global Dice score of $0.814\pm0.080$, which is $3\%$ points less than our proposed final framework. This is evidence that a two step pre-training from scratch and fine-tuning is better than training on the combined data. \begin{figure*}[t] \centering \includegraphics[width=0.999\textwidth]{adni_whole_boxplot.png} \caption{Box-plot of Dice scores comparing QuickNAT with FreeSurfer on ADNI-29 Dataset consisting of 15 Control and 14 AD subjects for all the 27 structures. Statistical significance ($p < 0.05$) in comparison to QuickNAT is indicated by a star symbol ($\star$). The p-values were estimated using two-sided Wilcoxon rank-sum test. WM indicates White Matter and GM indicates Grey Matter. } \label{fig:adni_box} \end{figure*} To evaluate the robustness of QuickNAT across scans acquired from scanners with different field strengths (1.5T/ 3.0T), we compared the Dice score across the two groups. We did the same with FreeSurfer. The results are shown in Fig.~\ref{fig:adni_fs}. We observe that for both groups, QuickNAT outperforms FreeSurfer. We conducted the same experiment with Control and AD patients as groups to observe robustness to pathologies. The results are presented in Fig.~\ref{fig:adni_fs}, where also we observe a superior performance of QuickNAT. \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{adni_Field.png} \caption{Boxplot of Dice scores. To the left, Comparison of Dice scores for 1.5 Tesla and 3.0 Tesla field strengths for QuickNAT and FreeSurfer on ADNI-29. 15 scans were acquired at 1.5T and 14 scans at 3T. To the right, Comparison of Dice scores for AD and controls for QuickNAT and FreeSurfer on ADNI-29. 15 scans were acquired from controls and 14 from AD. The p-values were estimated using two-sided Wilcoxon rank-sum test. } \label{fig:adni_fs} \end{figure} Tables~\ref{tab:adni_effect} reports the effect sizes for the group analysis by comparing AD patients with controls. We only report values for hippocampus and amygdala due to their important role in AD pathology. The analyses are performed on volume estimates, where we normalize volume estimates by the intracranial volume. For computing effect sizes, we use Hedge's g and Glass $\Delta$. Since we have less than 50 subjects for each of the groups, we use variants of these metrics, customized for small sample size. We report effect sizes and corresponding confidence intervals, computed on the manual segmentations together with those from QuickNAT and FreeSurfer. We observe that for both metrics, QuickNAT is closer to the actual estimate than FreeSurfer. \begin{table*}[t] \small \centering \caption{Effect sizes and confidence intervals from manual segmentation, QuickNAT and FreeSurfer in terms of Hedge's g and Glass $\Delta$ for ADNI-29 dataset between controls and AD. } \begin{tabular}{|p{1.3in}|p{1in}|p{1in}|p{1in}|} \hline & \multicolumn{3}{c|}{Hedge's g}\\ & \textbf{Manual} & \textbf{QuickNAT} & \textbf{FreeSurfer}\\ \hline \textbf{Hippocampus Left} & $1.22 (0.37 - 1.99)$ & $1.18 (0.34 - 1.95)$ & $1.00 (0.18 - 1.76)$ \\ \textbf{Amygdala Left} & $1.11 (0.28 - 1.88)$ & $1.16 (0.32 - 1.94)$ & $0.92 (0.12 - 1.68)$ \\ \textbf{Hippocampus Right} & $1.26 (0.41 - 2.04)$ & $1.25 (0.40 - 2.03)$ & $1.06 (0.24 - 1.18)$ \\ \textbf{Amygdala Right} & $1.26 (0.41 - 2.04)$ & $1.40 (0.53 - 2.20)$ & $0.96 (0.15 - 1.72)$ \\ \hline & \multicolumn{3}{c|}{Glass $\Delta$}\\ & \textbf{Manual} & \textbf{QuickNAT} & \textbf{FreeSurfer}\\ \hline \textbf{Hippocampus Left} & $0.96 (0.11 - 1.81)$ & $0.88 (0.05 - 1.72)$ & $0.75 (0.05 - 1.57)$ \\ \textbf{Amygdala Left} & $0.94 (0.09 - 1.79)$ & $0.93 (0.09 - 1.77)$ & $0.83 (0.00 - 1.65)$ \\ \textbf{Hippocampus Right} & $1.00 (0.14 - 1.85)$ & $0.97 (0.12 - 1.82)$ & $0.83 (0.00 - 1.66)$ \\ \textbf{Amygdala Right} & $1.03 (0.17 - 1.89)$ & $1.09 (0.22 - 1.95)$ & $0.79 (0.03 - 1.61)$ \\ \hline \end{tabular} \label{tab:adni_effect} \end{table*} We also evaluate the performance of QuickNAT in finding significant associations between diagnostic groups and brain morphology. Towards this end, we use a standard linear regression model: Volume $\sim$ Age + Sex + Diagnosis, and compare the regression co-efficients of Diagnosis, in Table~\ref{tab:adni_pvalue}. The co-efficients of QuickNAT are closer to the ones from manual segmentation. \begin{table}[t] \scriptsize \centering \caption{Normalized volume estimates for manual, QuickNAT and FreeSurfer segmentations are used in a linear model, Volume $\sim$ Age + Sex + Disease, for the ADNI-29 dataset. The normalized regression co-efficient and p-values corresponding to variable Disease is reported below. } \begin{tabular}{|p{1.1in}|p{0.6in}|p{0.6in}|p{0.6in}|} \hline & \textbf{Manual} & \textbf{QuickNAT} & \textbf{FreeSurfer}\\ \hline \textbf{Hippocampus Left} & $1.136 (0.0012)$ & $1.136 (0.0012)$ & $1.015 (0.0031)$ \\ \textbf{Amygdala Left} & $1.013 (0.0058)$ & $1.124 (0.0009)$ & $0.954 (0.0068)$ \\ \textbf{Hippocampus Right} & $1.157 (0.0010)$ & $1.149 (0.0011)$ & $1.061 (0.0020)$ \\ \textbf{Amygdala Right} & $1.119 (0.0020)$ & $1.247 (0.0002)$ & $0.957 (0.0075)$ \\ \hline \end{tabular} \label{tab:adni_pvalue} \end{table} \subsubsection{Experiment 3: IBSR} \label{sec:ibsr} In this experiment, we test on 18 T1 MRI scans with manual whole brain segmentations from the Internet Brain Segmentation Repository (IBSR). Challenges of this dataset include lower resolution of 1.5mm in anterior-posterior direction (high slice thickness), low contrast, and a wide age range from 7 to 71 years. Results on IBSR show a higher mean Dice score for QuickNAT ($0.835\pm0.080$) than for FreeSurfer ($0.794\pm0.093$). Fig.~\ref{fig:ibsr_box} reports structure-wise Dice scores. QuickNAT results in higher Dice scores than FreeSurfer, which is significant for the brain-wide comparison ($p<10^{-7}$ and for 16 of the 27 structures. \begin{figure*}[t] \centering \includegraphics[width=0.999\textwidth]{ibsr_whole_boxplot.png} \caption{Box-plot of Dice scores comparing QuickNAT with FreeSurfer on IBSR Dataset consisting of 18 MRI T1 scans for all the 27 structures. Statistical significance ($p < 0.05$) in comparison to QuickNAT is indicated by a star symbol ($\star$). The p-values were estimated using two-sided Wilcoxon rank-sum test. WM indicates White Matter and GM indicates Grey Matter.} \label{fig:ibsr_box} \end{figure*} Next, we compare with the CNN-based segmentation method in~\cite{dolz_3d_2017}, who segment 4 structures (thalamus, caudate, putamen, pallidum). They train their model on ABIDE (Autism Brain Imaging Data Exchange) dataset and test on IBSR, which is similar to our cross-dataset experimental setup. Table~\ref{tab:ibsr} shows that QuickNAT results in about 2-3\% points higher Dice score, except for thalamus. Note however, that~\cite{dolz_3d_2017} use the `brain.mgz' output from FreeSurfer as input (skull stripped, intensity normalized), which takes hours to generate and facilitates learning due to better standardization of the scans. In contrast, we use `orig.mgz' as input, which takes less than a second to generate. \begin{table}[t] \small \centering \caption{Mean Dice scores of QuickNAT and~\cite{dolz_3d_2017} on IBSR for four subcortical structures segmented by~\cite{dolz_3d_2017}.} \begin{tabular}{|p{1in}|c|c|} \hline \textbf{Structures}& \textbf{\cite{dolz_3d_2017}} & \textbf{QuickNAT}\\ \hline \textbf{Thalamus} & $0.87$ & $0.87$ \\ \textbf{Caudate} & $0.84$ & $0.86$ \\ \textbf{Putamen} & $0.85$ & $0.88$ \\ \textbf{Pallidum} & $0.79$ & $0.81$ \\ \hline \end{tabular} \label{tab:ibsr} \end{table} \subsubsection{Experiment 4: CANDI} \label{sec:candi} In this experiment, a subset of 13 MRI T1 scans from the Child and Adolescent NeuroDevelopment Initiative (CANDI) dataset~\citep{kennedy_candishare:_2012} with scans from children with psychiatric disorders were used as testing subjects. Subject's age ranges from 5 to 15 years with a mean of 10 years. Annotations were provided by Neomorphometrics Inc. We applied the trained QuickNAT on the dataset and compared against FreeSurfer. This dataset is challenging because the subjects of this particular age range are not part the training set (MALC). Here we investigate the ability of the model to generalize across previously unseen age ranges. The mean Dice scores across all structures for QuickNAT is $0.842\pm0.084$, compared to FreeSurfer with $0.798\pm0.092$, which is 5\% points lower. Fig.~\ref{fig:candi_box} reports structure-wise Dice scores. QuickNAT results in higher Dice scores than FreeSurfer, which is significant for the brain-wide comparison ($p<10^{-17}$) and for 22 of the 27 structures. \begin{figure*}[t] \centering \includegraphics[width=0.999\textwidth]{candi_whole_boxplot.png} \caption{Box-plot of Dice scores comparing QuickNAT with FreeSurfer on CANDI Dataset consisting of 13 MRI T1 scans of children for all the 27 structures. Statistical significance ($p < 0.05$) in comparison to QuickNAT is indicated by a star symbol ($\star$). The p-values were estimated using two-sided Wilcoxon rank-sum test. WM indicates White Matter and GM indicates Grey Matter. } \label{fig:candi_box} \end{figure*} \subsubsection{Comparison with FSL} \label{fsl} We also compare to FSL FIRST, which is another publicly available tool for automated segmentation of some subcortical structures for T1 MRI scans~\citep{jenkinson_fsl_2012,patenaude_bayesian_2011}. We cannot directly compare our results to FSL as it only segments $15$ structures in the brain, whereas QuickNAT segments $27$ structures. For a fair comparison, we selected the common 13 structures which are segmented by FSL, QuickNAT, and FreeSurfer. These are Thalamus (L+R), Caudate (L+R), Putamen (L+R), Pallidum (L+R), Hippocampus (L+R), Amygdala (L+R) and BrainStem. We reported the performance of QuickNAT, FreeSurfer and FSL on the 3 datasets with whole-brain manual annotations (ADNI-29, CANDI, IBSR). We observed that FSL is prone to registration errors which leads to process termination or faulty segmentations. We note that FSL was used with its default settings for all the experiments, as recommended in its instruction manual. FreeSurfer and QuickNAT did not fail during segmentation. Thus, we report results once on all scans and once on those scans that FSL did not fail in Table~\ref{tab:fsl}. The failure rate of FSL is higher on IBSR (44\%) than on ADNI (17\%) or CANDI (23\%), indicating that it is susceptible to low quality scans. Considering all scans and a sub-set of 13 structures QuickNAT outperforms both FreeSurfer and FSL by a statistically significant margin ($p<0.001$). Excluding the scans where FSL failed, QuickNAT demonstrates superior performance for ADNI-29, while FSL is best for CANDI. In IBSR, FSL outperforms QuickNAT by a small margin of 0.08\% points, which is not statistically significant. A possible reason for the good performance of FSL on CANDI may be that FSL includes scans with age range (5-15 years) in its atlas. Scans of this age range were not included in training QuickNAT. The performance of QuickNAT can potentially be improved on young subjects with more training data from such an age range. \begin{table*}[t] \small \centering \caption{Comparison of QuickNAT, FSL and FreeSurfer for segmentation of 13 structures common to all on ADNI-29, CANDI and IBSR Dataset. The results including and excluding scans where FSL failed are presented separately, along with the failure rate of FSL.} \begin{tabular}{|p{1in}|p{1in}|c|c|c|c|} \hline & \textbf{Method} & \textbf{ADNI-29} & \textbf{CANDI} & \textbf{IBSR}\\ \hline \multirow{4}{*}{All scans} & \textbf{QuickNAT} & $\mathbf{0.825\pm0.027}$ & $\mathbf{0.819\pm0.028}$ & $\mathbf{0.820\pm0.035}$ \\ & \textbf{FreeSurfer} & $0.745\pm0.042$ & $0.780\pm0.025$ & $0.776\pm0.025$ \\ & \textbf{FSL} & $0.643\pm0.290$ & $0.647\pm0.369$ & $0.461\pm0.419$ \\ \cline{2-5} & \textbf{Failure of FSL} & 5 out of 29 (17\%) & 3 out of 13 (23\%) & 8 out of 18 (44\%) \\ \hline \multirow{2}{*}{Scans where FSL} & \textbf{QuickNAT} & $\mathbf{0.823\pm0.027}$ & $0.817\pm0.032$ & $0.817\pm0.035$ \\ & \textbf{FreeSurfer} & $0.745\pm0.045$ & $0.775\pm0.027$ & $0.772\pm0.022$\\ succeeded & \textbf{FSL} & $0.775\pm0.024$ & $\mathbf{0.841\pm0.013}$ & $\mathbf{0.825\pm0.013}$ \\ \hline \end{tabular} \label{tab:fsl} \end{table*} \subsubsection{Compilation of worst segmentation performance scans (Exp: 2,3,4)} In this section, we visualize the subjects with lowest segmentation accuracy (mean Dice score) for all datasets with whole-brain annotations and cross-dataset evaluation (IBSR, ADNI-29, CANDI), to identify the limits of QuickNAT. Segmentations are shown in Fig.~\ref{fig:worstcase}(a-c). The scan with the worst performance in IBSR dataset has a mean Dice score of $0.78$, which is 5\% points less than the overall Dice of the dataset. We observe that the scan has motion and ringing artifacts and low contrast (Fig.~\ref{fig:worstcase}(a)), which might have impaired performance. The worst performing ADNI-29 scan has a Dice score of $0.81$, which is 3\% points less than the overall Dice of dataset. The scan is from a 95-year-old patient with severe AD. The scan shows strong ringing artifacts, pronounced atrophy, and enlarged ventricles, shown in Fig.~\ref{fig:worstcase}(b). Such pathological data were not used for training, still QuickNAT generalizes well to such cases. The worst performing CANDI scan has a Dice score of $0.77$, which is 7\% points lower than the Dice score for the overall dataset. This is from a patient aged 5. The scan has severe motion artifacts and low contrast as shown in Fig.~\ref{fig:worstcase}(c). Looking at the segmentation results of QuickNAT on all of these challenging cases, we observe small errors, but it is striking that overall decent segmentation performance is decent. \begin{figure*}[t] \centering \includegraphics[width=0.999\textwidth]{worstcase.png} \caption{Illustration of scans for IBSR, ADNI and CANDI with the \emph{worst segmentation} performance. The MRI scans along with QuickNAT segmentations are shown. (a) IBSR scan has motion and ringing artifacts with poor contrast, (b) ADNI scan is from a 95-year-old subject with severe AD (prominent cortical atrophy and enlarged ventricles), (c) CANDI scan is from a 5-year-old subject, with severe motion artifacts and very low contrast. } \label{fig:worstcase} \end{figure*} \subsubsection{Experiment 5: HarP Dataset} We evaluate the hippocampus segmentation in the presence of dementia on a large dataset with manual annotations following the Harmonized Protocol (HarP) for hippocampus segmentation \citep{boccardi_training_2015}, developed by the European Alzheimer's Disease Consortium and ADNI. Similar to ADNI-29, it is a subset of the ADNI dataset~\citep{jack_alzheimers_2008}. Left and right hippocampi were segmented for $131$ subjects, balanced for controls, mild cognitive impairment (MCI), and AD. The hippocampus is an important brain structure, whose volume and shape changes are important biomarkers for disease and aging~\citep{bartsch_hippocampus_2015}. Segmenting the hippocampus is challenging because of small or absent signal gradient between it and its adjacent regions. The HarP dataset contains $131$ MRI T1 scans, which are balanced for controls, MCI and AD (42 CN, 44 MCI, 45 AD). The challenges associated with this dataset are: (i) subjects with neurodegenerative disease, and (ii) variations in the manual annotation protocol. Across all diagnostic groups (CN, MCI, AD), the volume distance to the manual segmentation is significantly lower for QuickNAT than FreeSurfer and the Dice scores are significantly higher (Fig.~\ref{fig:harp}). \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{HarP.png} \caption{The figure shows hippocampus segmentation performance on the HarP dataset, in terms of Dice score and volume distance for different diagnoses (42 Controls, 44 MCI, and 45 AD). Higher Dice score and correlation indicates better performance, while lower volume distance indicates better performance. The p-values were computed using two-sided Wilcoxon rank-sum test.} \label{fig:harp} \end{figure} \subsection{Evaluation of segmentation reliability} \label{sec:segreg} In the following experiments, we evaluate the segmentation reliability of QuickNAT with different experiments detailed below. \subsubsection{Experiment 6: ALVIN Dataset} In this experiment, we follow a comprehensive testing protocol for MRI neuroanatomical segmentation techniques as proposed for lateral ventricle segmentation, termed ALVIN~\citep{kempton_comprehensive_2011}. The dataset consists of 7 young adults and 9 patients with Alzheimer's disease. Lateral ventricles have been manually annotated at two time points to observe intra-observer variability and their volumes were reported. We compute volumes from QuickNAT segmentations and follow the evaluation protocol by reporting intra-class correlation coefficient (ICC)~\citep{kempton_comprehensive_2011}, in addition to volume distance (Methods). We compare with results of FreeSurfer and ALVIN reported in~\cite{kempton_comprehensive_2011}. On control subjects and AD patients, QuickNAT shows the best performance (Fig.~\ref{fig:alvin}). \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth]{alvin.png} \caption{The figure illustrates the performance of QuickNAT for ventricle volume estimation after segmentation and compares to FreeSurfer and ALVIN, on the dataset introduced by ALVIN. The performance is evaluated by estimating intra-class correlation (metric used in \cite{kempton_comprehensive_2011}) for both young adults (7 scans) and AD subjects (9 scans).} \label{fig:alvin} \end{figure} \subsubsection{Experiment 7: TRT Dataset} The dataset was released to test reliability of automated whole-brain segmentation algorithms in estimating volumes for some important brain structures using test re-test~\citep{maclaren_reliability_2014}. They acquired 120 MRI T1 scans from 3 subjects (40 scans per subject). The scans were acquired over 20 sessions (2 scans per session). All the scans were acquired within a period of 30 days. \cite{maclaren_reliability_2014} analyzed the coefficient of variation in volume estimates within one session (intra session $CV_s$) and the total variance over all 40 scans ($CV_t$). \revision{The metric co-efficient of variance, provides an extent of variability to the mean value.} The total coefficient of variation is computed as $CV_t = \frac{{\sigma}_t}{{\mu}_t}$, where $\sigma_t$ and $\mu_t$ are the standard deviation and mean of the estimates. This global variance considering all the estimates across session provides inter-session $CV_t$. The intra-session co-efficient of variation $CV_s$ is estimated by the root mean square of all the co-efficient of variance per session. Ideally as atrophy is almost negligible within the period of 30 days, the coefficient of variation in estimates should be zero. The lower the estimate, the better the estimator. We compare QuickNAT with FreeSurfer in this regard. The 8 structures considered in this experiment are consistent with the ones reported in~\cite{maclaren_reliability_2014}. The results of the experiment are reported in Table~\ref{tab:retest}. Both coefficients of variation $CV_s$ and $CV_t$ are within a tolerable range of less than 2\% for QuickNAT, but variations are quite high for FreeSurfer for some structures like thalamus (6\%), pallidum (5\%), amygdala (5\%) and putamen (4\%). In volume estimation of cerebral WM, FreeSurfer exhibits a better performance than QuickNAT with ($CV<1\%$). A possible reason might be the sophisticated surface processing and correction stage in FreeSurfer that follows the initial segmentation~\citep{dale_cortical_1999,fischl_cortical_1999}. Finally, having such low $CV$ estimates makes QuickNAT a promising tool for group analysis studies over large datasets with reliable estimation of biomarkers. It can also be effectively used in processing longitudinal scans to model disease progression. We excluded comparison with FSL in this experiment due to FSL registration errors in some volumes. \begin{table*}[t] \small \centering \caption{Variation in volume measurement per structure. QuickNAT is compared against FreeSurfer in terms of intra-session coefficient of variation ($CV_s$), inter-session total coefficient of variation ($CV_t$) and the absolute difference between them. Also, the mean volume estimates per structure are reported. It must be noted that volumes of both left and right hemispheres are combined to estimate the total volume for each structure. The estimates from FreeSurfer were taken from \cite{maclaren_reliability_2014}.} \begin{tabular}{|p{1.3in}|c|c|c|c|c|c|c|c|} \hline Structures & \multicolumn{2}{c|}{Mean Vol. (ml)} & \multicolumn{2}{c|}{Intra-session $CV_s$ (\%)} & \multicolumn{2}{c|}{Inter-session $CV_t$ (\%)} & \multicolumn{2}{c|}{$|CV_s-CV_t|$ (\%)}\\ \cline{2-9} & \textbf{FS} & \textbf{Q-NAT} & \textbf{FS} & \textbf{Q-NAT} & \textbf{FS} & \textbf{Q-NAT} & \textbf{FS} & \textbf{Q-NAT}\\ \hline Hippocampus & 8.90 & 7.56 & 2.77 & \textbf{0.73} & 2.92 & \textbf{0.80} & 0.16 & \textbf{0.09} \\ Lateral Ventricles & 10.10 & 14.42 & \textbf{1.58} & 2.33 & 3.40 & \textbf{3.04} & 1.82 & \textbf{0.95}\\ Amygdala & 3.80 & 2.18 & 4.69 & \textbf{1.91} & 5.21 & \textbf{2.39} & 0.53 & \textbf{0.50}\\ Putamen & 11.60 & 8.89 & 4.04 & \textbf{0.71} & 3.92 & \textbf{0.85} & \textbf{0.13} & 0.17\\ Pallidum & 3.20 & 3.36 & 5.25 & \textbf{1.32} & 5.42 & \textbf{1.42} & 0.17 & \textbf{0.12}\\ Caudate & 7.40 & 6.82 & 1.54 & \textbf{1.02} & 1.58 & \textbf{1.14} & \textbf{0.04} & 0.18\\ Thalamus & 12.90 & 16.22 & 5.98 & \textbf{0.77} & 6.06 & \textbf{0.93} & \textbf{0.08} & 0.19\\ Cerebral WM & 496.60 & 403.70 & \textbf{0.88} & 1.98 & \textbf{0.87} & 1.91 & \textbf{0.00} & 0.07\\ \hline \end{tabular} \label{tab:retest} \end{table*} \subsubsection{Experiment 8: HTP Dataset} In this experiment, we evaluated the reliability and robustness in estimating volumes across scans acquired from multiple centers, from the Human Travelling Phantom (HTP) dataset~\citep{magnotta_multicenter_2012}. The dataset includes scans from 5 healthy subjects travelling to 8 different medical centers in the USA. All scans were acquired within a period of 30 days, such that atrophy of structures due to normal aging is negligible. Each of the 8 imaging centers used MRI scanners manufactured by different vendors, different gradient specifications, different number of channels in the head coil etc. Ideally, the coefficient of variation ($CV$) of volume estimates across the sites should be zero; the lower the estimate, the more reliable and robust is the segmentation algorithm. A detailed explanation of the experimental setup is provided in~\cite{magnotta_multicenter_2012}. Overall, the dataset is challenging for segmentation, because it is very heterogeneous with strong variation of data quality across sites, where scans from some sites exhibit strong motion artifacts. We compared QuickNAT with FreeSurfer and reported the results in Table~\ref{tab:htp}. QuickNAT showed more robustness for hippocampus, putamen, pallidum, and thalamus, while FreeSurfer is better in lateral ventricles, amygdala, caudate, and cerebral WM. Overall, this challenging experiment demonstrated that QuickNAT and FreeSurfer are equally robust. \begin{table*}[t] \small \centering \caption{Coefficient of variation ($CV$) in volume estimation for the 8 structures for each subject, using QuickNAT (QN) and FreeSurfer (FS). Also, RMS $CV$ per structures for all the subjects is presented.} \begin{tabular}{|p{1.3in}|c|c|c|c|c|c|c|c|c|c|c|c|} \hline & \multicolumn{10}{c|}{Subject ID with $CV$} & \multicolumn{2}{c|}{RMS}\\ \cline{2-11} Structures & \multicolumn{2}{c|}{1} & \multicolumn{2}{c|}{2} & \multicolumn{2}{c|}{3} & \multicolumn{2}{c|}{4} & \multicolumn{2}{c|}{5} & \multicolumn{2}{c|}{$CV$}\\ \cline{2-13} & \textbf{FS} & \textbf{QN} & \textbf{FS} & \textbf{QN} & \textbf{FS} & \textbf{QN} & \textbf{FS} & \textbf{QN} & \textbf{FS} & \textbf{QN} & \textbf{FS} & \textbf{QN} \\ \hline Hippocampus & 8.49 & 4.66 & 1.41 & 1.09 & 2.39 & 2.18 & 3.57 & 1.19 & 2.69 & 4.06 & 4.47 & \textbf{3.02} \\ Lateral Ventricles & 8.28 & 14.8 & 5.25 & 8.43 & 2.37 & 6.32 & 2.85 & 6.62 & 12.9 & 15.1 & \textbf{7.45} & 10.9 \\ Amygdala & 4.1 & 10.4 & 2.25 & 5.08 & 5.33 & 4.98 & 2.16 & 2.99 & 5.58 & 5.31 & \textbf{4.15} & 6.29 \\ Putamen & 9.36 & 5.76 & 5.66 & 1.89 & 5.83 & 1.3 & 5.18 & 1.8 & 4.29 & 5.08 & 6.31 & \textbf{3.63} \\ Pallidum & 9.34 & 5.26 & 7.59 & 1.49 & 9.05 & 1.59 & 7.99 & 1.22 & 5.27 & 3.85 & 7.98 & \textbf{3.12} \\ Caudate & 5.12 & 15.3 & 2.83 & 5.72 & 3.13 & 1.47 & 2.45 & 4.27 & 3.01 & 6.75 & \textbf{3.44} & 8.18 \\ Thalamus & 2.74 & 1.43 & 4.21 & 1.11 & 2.7 & 2.55 & 2.42 & 2.36 & 5.33 & 3.49 & 3.65 & \textbf{2.35} \\ Cerebral WM & 3.09 & 3.43 & 1.64 & 3.45 & 2.59 & 4.8 & 2.2 & 3.79 & 4.14 & 4.28 & \textbf{2.86} & 3.99 \\ \hline \end{tabular} \label{tab:htp} \end{table*} \section{Discussion} \subsection{Comparison with Deep Learning Approaches} Recently, convolutional neural networks have been proposed for brain segmentation~\citep{chen_voxresnet:_2017, dolz_3d_2017, fedorov_almost_2017, wachinger_deepnat:_2017, moeskops2016automatic}. DeepNAT~\citep{wachinger_deepnat:_2017} reported competitive results on the MALC data, but as shown in Table~\ref{tab:malc}, QuickNAT yields significantly higher accuracy, while requiring only seconds (Fig.~\ref{fig:speed}). \cite{dolz_3d_2017} proposed a network for segmenting 8 structures based on skull-stripped and intensity normalized images, which facilitates the learning process but requires hours for processing. Nevertheless, a comparison on IBSR demonstrated higher accuracy for QuickNAT (Table~\ref{tab:ibsr}). The comparison to VoxResNet~\citep{chen_voxresnet:_2017} is not directly possible, because only 3 structures were segmented. MeshNET~\citep{fedorov_almost_2017} only uses FreeSurfer segmentations for training and testing, without any manual annotations, which makes it complicated to assess the actual performance. The methods in \cite{dolz_3d_2017} and \cite{fedorov_almost_2017} have limited comparison to existing segmentation approaches, while we compare with FreeSurfer, FSL, PICSL, SpatialSTAPLE, U-Net, FCN, and DeepNAT using an identical experimental setup. Notably, none of the methods have been used in a cross-dataset evaluation, i.e., training and testing on separate datasets, except for \cite{dolz_3d_2017}. By evaluating QuickNAT on 8 different datasets and performing reliability study on 3 datasets, we have presented the most comprehensive evaluation of a convolutional neural network for brain segmentation so far. In addition to the above mentioned articles, CNNs have also been proposed for the segmentation of pathological structures like brain tumors~\citep{pereira2016brain, havaei2017brain, kamnitsas2017efficient} or lesions~\citep{brosch2016deep, ghafoorian2017location, valverde2017improving}. \subsection{Pre-training with Auxiliary Labels} Although deep learning models have been shown to be highly effective, they are highly complex and require large annotated data for effective training~\citep{lecun_deep_2015}. Access to abundant annotated training data is challenging for medical applications due to the high cost of creating expert annotations. The problem is more prominent for F-CNNs, where each slice corresponds to one data point, in contrast to patch based approaches, where millions of patches can be extracted from a volume~\citep{wachinger_deepnat:_2017}. To address this issue, we introduced a training strategy that leverages large unlabeled data and small manual data to effectively train our fully convolutional model. We used FreeSurfer to automatically create segmentations from unlabeled data, which serve as auxiliary labels to pre-train our model. This pre-trained model, which mimics FreeSurfer, is fine-tuned with small manually annotated data to get the final model. Our results have shown that a model trained with this new strategy significantly outperforms a model that is only trained on manual data. Although we have demonstrated the application to brain segmentation, the proposed training strategy is generic and can be effectively used for other segmentation tasks as well. In a parallel research work, FreeSurfer generated labels were used to train a model for multiple cohorts for hippocampus segmentation, showing promising results~\citep{thyreau2018segmentation}. In Sec.~\ref{sec:adni29}, we observed another very interesting aspect of pre-training. On the ADNI-29 dataset, the pre-trained network achieved a higher accuracy than FreeSurfer itself. This is quite surprising given the fact that pre-training was conducted with annotations generated from FreeSurfer only. In other words, it seems that the network imitating FreeSurfer can perform better than FreeSurfer itself. The reason for such a behavior could be the large amount of data (IXI Dataset) that the pre-trained model has seen and that it learned to generalize from the noisy auxiliary annotations, emphasizing the potential of pre-training. \subsection{Architecture Design} The architecture of QuickNAT has been tailored to address the challenges associated with whole brain segmentation. The fully convolutional architecture offers faster processing and larger context than patch-based DeepNAT~\citep{wachinger_deepnat:_2017}, because all the voxels in a slice are labelled simultaneously. The dense connections within every encoder and decoder block promote feature re-usability in the network~\citep{densenet}, which optimizes model complexity by avoiding learning of similar feature maps in different layers. In the decoder blocks, upsampling is done using unpooling layers instead of convolutions, which does not involve any learnable parameters and enforces spatial consistency; an essential aspect for segmenting small subcortical structures. The network is learned by optimizing a combined weighted logistic and Dice loss function with stochastic gradient descent. To tackle class imbalance and provide reliable contour estimation of the structures, we up-weighted under-represented classes using median frequency balancing and emphasized anatomical boundaries. Our results have shown the significant improvement of the QuickNAT architecture, compared to state-of-the-art U-Net and FCN models. \subsection{Segmentation Accuracy} We have demonstrated the high accuracy of QuickNAT on a comprehensive set of 5 experiments that cover a wide range of variations in acquisition parameters and neuroanatomy. In experiments on the MALC dataset, we demonstrated that QuickNAT provides segmentations with similar accuracy and inter-run consistency to the best atlas-based methods (Table.~\ref{tab:malc} and Table.~\ref{tab:malc_consis}). In experiments with ADNI-29, we demonstrated the robustness of QuickNAT with respect to pathology and magnetic field strengths (Fig.~\ref{fig:adni_fs}). Moreover, effect sizes from QuickNAT are more similar to those from manual segmentations than FreeSurfer (Table~\ref{tab:adni_effect}). In experiments with IBSR, we demonstrated the robustness to data with lower resolution and low contrast (Fig.~\ref{fig:ibsr_box}). High segmentation accuracy on scans from young subjects was demonstrated on the CANDI dataset (Fig.~\ref{fig:candi_box}) and for hippocampus segmentation on the HarP dataset (Fig.~\ref{fig:harp}). Finally, we compared to FSL FIRST on a subset of structures that are identified by both (Table.~\ref{tab:fsl}). Notably, QuickNAT has not failed on any scan across all datasets and has not produced a single segmentation that had to be rejected. \subsection{Segmentation Reliability} In an additional set of 3 experiments, we evaluated the reliability of QuickNAT. We measured high reliability in lateral ventricle segmentation by following the testing protocol ALVIN. We observed high consistency for the segmentation of 8 structures on test-retest data with less than 2\% variation on most brain structures (Table.~\ref{tab:retest}). The test-retest data was acquired on the same scanner. We extended the evaluation to a more challenging dataset, where the same subject was scanned in various machines at different sites. As expected, the variation increased in this setup, but the reliability was comparable to FreeSurfer. The high reliability of QuickNAT compared to FreeSurfer is surprising, because the atlas used in FreeSurfer provides a strong spatial prior, which tends to improve reliability. However, our results showed that the more unconstrained, deep learning based segmentation can achieve higher reliability. \subsection{Limitations} As any brain segmentation method, QuickNAT has limitations. On the data of the human traveling phantom (HTP Dataset), we observed an increase in variance across centers. In a detailed investigation, we found that scans from one of the sites (Dartmouth) had strong motion artifacts, which deteriorated our segmentation performance, and in turn increased the variance. Motion artifacts present a challenge to many image processing tasks. If more than one source volume exists, motion correction could be applied, as is done in the FreeSurfer pipeline. We have experimented with scans from subjects in the age range 5 to 95. Outside this age range, additional experiments need to be conducted. Furthermore, we have shown scans with the worst segmentation performance in Fig.~\ref{fig:worstcase}, illustrating the limits of QuickNAT. Another limitation of QuickNAT is that it cannot deal with tissue classes that are not part of the training set, e.g., tumors. For QuickNAT to also work on tumor cases, we would need training data, where the tumor is annotated together with all the brain structures. To the best of our knowledge, such a dataset is not publicly available. \section{Conclusion} We have introduced QuickNAT, a deep learning based method for brain segmentation that runs in seconds, achieving superior performance with respect to existing methods and being orders of magnitudes faster in comparison to patch-based CNNs and atlas-based approaches. We have demonstrated that QuickNAT generalizes well to other, unseen datasets (training data different to testing) and yields high segmentation accuracy across diagnostic groups, scanner field strengths, and age, while producing highly consistent results. This high segmentation accuracy enhances group analyses by enabling effect sizes and significance values that better match those of manual segmentations. Also, with high test-retest accuracy it can be effectively used for longitudinal studies. QuickNAT can be highly impactful because of its fast processing time and robustness to neuroanatomical variability, allowing for an almost instantaneous access to accurate imaging biomarkers. \section*{Acknowledgment} Support for this research was provided in part by the Bavarian State Ministry of Education, Science and the Arts in the framework of the Centre Digitisation.Bavaria (ZD.B). We thank Neuromorphometrics Inc. for providing manual annotations, neuroimaging initiatives for sharing data, and NVIDIA corporation for GPU donation. We would also like to thank Dr. Sebastian P\"{o}lsterl for proofreading the manuscript and providing feedback. Data collection and sharing was funded by the Alzheimer's Disease Neuroimaging Initiative (ADNI) (National Institutes of Health Grant U01 AG024904) and DOD ADNI (Department of Defense award number W81XWH-12-2-0012). ADNI is funded by the National Institute on Aging, the National Institute of Biomedical Imaging and Bioengineering, and through generous contributions from the following: Alzheimer's Association; Alzheimer's Drug Discovery Foundation; Araclon Biotech; BioClinica Inc.; Biogen Idec Inc.; Bristol-Myers Squibb Company; Eisai Inc.; Elan Pharmaceuticals, Inc.; Eli Lilly and Company; EuroImmun; F. Hoffmann-La Roche Ltd and its affiliated company Genentech, Inc.; Fujirebio; GE Healthcare; IXICO Ltd.; Janssen Alzheimer Immunotherapy Research \& Development, LLC ; Johnson \& Johnson Pharmaceutical Research \& Development LLC; Medpace, Inc; Merck \& Co., Inc.; Meso Scale Diagnostics, LLC; NeuroRx Research; Neurotrack Technologies; Novartis Pharmaceuticals Corporation; Pfizer Inc.; Piramal Imaging; Servier; Synarc Inc.; and Takeda Pharmaceutical Company. The Canadian Institutes of Health Research is providing funds to support ADNI clinical sites in Canada. Private sector contributions are facilitated by the Foundation for the National Institutes of Health (www.fnih.org). The grantee organization is the Northern California Institute for Research and Education, and the study is coordinated by the Alzheimer's Disease Cooperative Study at the University of California, San Diego. ADNI data are disseminated by the Laboratory for Neuro Imaging at the University of Southern California. \section*{Appendix} \textbf{List of classes:} The brain structures segmented by QuickNAT are: (1) Cortical White Matter Left, (2) Cortical Grey Matter Left, (3) Cortical White Matter Right (4) Cortical Grey Matter Right, (5) Lateral Ventricle Left, (6) Cerebellar White Matter Left, (7) Cerebellar Grey Matter Left, (8) Thalamus Left, (9) Caudate Left, (10) Putamen Left, (11) Pallidum Left, (12) $3^{rd}$ ventricle, (13) $4^{th}$ ventricle, (14) Brainstem, (15) Hippocampus Left, (16) Amygdala Left, (17) Ventral DC Left, (18) Lateral Ventricle Right, (19) Cerebellar White Matter Right, (20) Cerebellar Grey Matter Right, (21) Thalamus Right, (22) Caudate Right, (23) Putamen Right, (24) Pallidum Right, (25) Hippocampus Right, (26) Amygdala Right, (27) Ventral DC Right. \textbf{Label remapping strategy:} QuickNAT segments 27 brain structures with IDs 1 to 27 as indicated above. For training, testing and evaluation purposes, we map the FreeSurfer labels and Manual Labels (provided by Neuromorphometrics Inc.) consistent to that of the QuickNAT IDs. The ID mapping strategy is detailed in Tab.~\ref{tab:label_remap}. For FreeSurfer, the mapping IDs are corresponding to `\texttt{aseg.mgz}', which does not contain cortical parcellations. For manual annotations, which has cortical parcellations, we first map all the parcels to a single cortex class. All the IDs greater than $100$ with even values are mapped to ID $210$ (Right hemisphere cortex). Similarly, all the IDs greater than $100$ with odd values are mapped to ID $211$ (left hemisphere cortex). After this the mapping to QuickNAT IDs are performed as per Tab.~\ref{tab:label_remap}. \begin{table*}[t] \small \centering \caption{Label Remapping Strategy} \begin{tabular}{|p{2in}|c|c|c|} \hline \textbf{Structures}& \textbf{QuickNAT} & \textbf{FreeSurfer} & \textbf{Manual}\\ \hline \textbf{Cortical White Matter Left} & $1$ & $2$ & $45$ \\ \textbf{Cortical Grey Matter Left} & $2$ & $3$ & $211$ \\ \textbf{Cortical White Matter Right} & $3$ & $41$ & $44$ \\ \textbf{Cortical Grey Matter Right} & $4$ & $42$ & $210$ \\ \textbf{Lateral Ventricle Left} & $5$ & $4$ & $52$ \\ \textbf{Cerebellar White Matter Left} & $6$ & $7$ & $41$ \\ \textbf{Cerebellar Grey Matter Left} & $7$ & $8$ & $39$ \\ \textbf{Thalamus Left} & $8$ & $10$ & $60$ \\ \textbf{Caudate Left} & $9$ & $11$ & $37$ \\ \textbf{Putamen Left} & $10$ & $12$ & $58$ \\ \textbf{Pallidum Left} & $11$ & $13$ & $56$ \\ \textbf{$3^{rd}$ ventricle} & $12$ & $14$ & $4$ \\ \textbf{$4^{th}$ ventricle} & $13$ & $15$ & $11$ \\ \textbf{Brainstem} & $14$ & $16$ & $35$ \\ \textbf{Hippocampus Left} & $15$ & $17$ & $48$ \\ \textbf{Amygdala Left} & $16$ & $18$ & $32$ \\ \textbf{Ventral DC Left} & $17$ & $28$ & $62$ \\ \textbf{Lateral Ventricle Right} & $18$ & $43$ & $51$ \\ \textbf{Cerebellar White Matter Right} & $19$ & $46$ & $40$ \\ \textbf{Cerebellar Grey Matter Right} & $20$ & $47$ & $38$ \\ \textbf{Thalamus Right} & $21$ & $49$ & $59$ \\ \textbf{Caudate Right} & $22$ & $50$ & $36$ \\ \textbf{Putamen Right} & $23$ & $51$ & $57$ \\ \textbf{Pallidum Right} & $24$ & $52$ & $55$ \\ \textbf{Hippocampus Right} & $25$ & $53$ & $47$ \\ \textbf{Amygdala Right} & $26$ & $54$ & $31$ \\ \textbf{Ventral DC Right} & $27$ & $60$ & $61$ \\ \hline \end{tabular} \label{tab:label_remap} \end{table*} \section{References} \bibliographystyle{elsarticle-harv}
\section{Introduction} Great attention has been devoted to theoretical and experimental study of dynamics of various systems of interacting nonlinear oscillators. Interesting effects, e.g. collective (synchronized) behavior,~\cite{pikovsky2003synchronization,filatrella2000highq} electromagnetic field induced dynamic metastable states,~\cite{jung2014multistability} solitons and breathers,~\cite{ustinov1998solitons,binder2000observation} just to name a few, were predicted and observed in diverse solid state systems. In the linear regime the dynamics of complex networks of interacting oscillators is characterized by a multiband dispersion relation $\omega_m(k)$, where $k$ is the wave vector of the extended linear excitations and $m$ is the band index. The dispersion relation can be probed by a resonant response of a system to a small external time-dependent perturbation.~\cite{jung2014multistability,macklin2015near} In Ref.~\onlinecite{lieb1989two} it was predicted that the spectrum of electronic excitations of the Lieb lattice contains a \emph{flatband}. Lately flatbands were identified theoretically in various one- and two-dimensional lattices~\cite{derzhko2007low,vidal2000interaction,douccot2002pairing,vidal2001disorder,leykam2013flat} and several methods to engineer flatbands were suggested.~\cite{flach2014detangling,dias2015origami,morales2016simple,maimaiti2017compact,ramachandran2017chiral,roentgen2017compact} Flat bands have been observed experimentally in magnetic and high-$T_c$ superconducting materials,~\cite{liu2013flat,dessau1993key} and they have been implemented in photon lattices,~\cite{vicencio2015observation} exciton-polariton condensates,~\cite{byrnes2014exciton} and arrays of superconducting Josephson junctions.~\cite{pop2008measurement} Dynamics of electrons, photons or phonons on lattices supporting flatbands shows interesting physical properties: magnetic phase transitions,~\cite{derzhko2007low} localization in absence of disorder --- appearance of \emph{compactons}: eigenstates strictly localized on few sites, destructive interference of electromagnetic waves propagating in such lattices. In presence of disorder or non-linearity the flatband spectrum leads to solitons with non-exponential tails,~\cite{gorbach2005compactlike} Fano resonances in the scattering of electromagnetic waves on nonlinearities,~\cite{flach2014detangling} and topological effects, e.g. preservation of topological flatbands in applied magnetic field.~\cite{aoki1996hofstadter} The case of Josephson junctions is of special interest since the current technology allows one to engineer arbitrary one- and two-dimensional lattices of coupled Josephson junctions. Furthermore, external magnetic fields allow one to change the ground state and the dispersion relation $\omega(k)$ of linear oscillations in these systems. E.g. it was shown theoretically that a simple diamond chain of identical Josephson junctions exhibits a classical (quantum) phase transition at specific strengths of the applied magnetic field.~\cite{douccot2002pairing,rizzi20064e,protopopov2004anomalous} This phenomenon was dubbed $4e$- condensation at variance with the usual $2e$-condensation occurring in simple Josephson junction arrays (lattices). Some evidences in support of such a $4e$-condensation have been reported in Ref.~\onlinecite{pop2008measurement}. In this paper we present a systematic study of dynamic and thermodynamic properties of \emph{frustrated Josephson junction arrays}. In these periodic arrays the Josephson couplings in a single cell can have alternating signs giving rise to frustration, which is quantified by a frustration parameter $f$, and the properties of the arrays, namely, resonant frequencies and ground states depend strongly on the value of $f$. In particular, we find a crossover between non-frustrated and frustrated regimes characterized by the critical value, $f=f_c$, and study in detail the frustrated regime, $f_c<f<1$. We show that the lowest band in the linear spectrum $\omega(k)$ turns flat at $f=f_c$, and this can be considered as the precursor of the crossover. The most spectacular difference between the non-frustrated and frustrated regimes is in the properties of the ground states. The ground state in non-frustrated regime is unique, with all Josephson phases equal to zero. In contrast, the ground state in frustrated regime is macroscopically degenerate and the Josephson phases can take two different sets of values in each cell of the array. Note that at variance with previous works in this field~\cite{douccot2002pairing,rizzi20064e,protopopov2004anomalous} where high degeneracy occurred at a single value of $f$, this highly degenerate ground state occurs in a range of frustration values, $f_c<f<1$. Experimental realizations of such arrays requires Josephson couplings of different signs. Such Josephson couplings are provided by the so-called $\pi$-Josephson junctions that can be fabricated on basis of superconductor-ferromagnet-superconductor junctions,~\cite{feofanov2010implementation} or various multi-junctions SQUIDS in externally applied magnetic field.~\cite{hilgenkamp2008pi} The paper is organized as follows: In Section II we introduce models of frustrated arrays of Josephson junctions: the diamond and the sawtooth chains. Next we define the Lagrangian, partition function and dynamic equations of the systems. In Section III we analyze the linearized dynamics of the frustrated arrays, derive the dispersion relation $\omega(k)$ and study its dependence on the frustration strength $f$. Section IV is devoted to the derivation of the thermodynamic spatial correlation functions as functions of temperature and frustration, and detailed discussion of the crossover between frustrated and non-frustrated regimes. Section V presents numerical support for the analytical results of the previous sections by the Monte-Carlo simulations. Section VI provides conclusions. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure1a.png} \includegraphics[width=0.95\columnwidth]{figure1b.png} \caption{(Color online) Schematic figure of frustrated networks of Josephson junctions (indicated by crosses): the diamond (top) and sawtooth (bottom) chains. The phases $\varphi$ of the vertices and the Josephson couplings $\alpha_{ij}$ in a single cell are shown.} \label{fig:schematic} \end{figure} \section{Model, Lagrangian, Partition function and Dynamic Equations} The diamond and the sawtooth chains are shown in Fig.~\ref{fig:schematic}. Every vertex $i$ of the network is characterized by a time-dependent phase, $\varphi_i(t)$. Nearest neighbor vertices are binded by Josephson type non-linear oscillators, and therefore, the Lagrangian of network is as follows: \begin{equation} \label{Lagrangian} L\{\varphi_i, \dot \varphi_i \} = E_J\left [\sum_i \frac{\dot \varphi_i^2}{2\omega_p^2} + \sum_{\langle ij\rangle} \alpha_{ij}\cos (\varphi_i - \varphi_j) \right ], \end{equation} where $\langle ij\rangle$ are the two nearest neighbor vertices coupled by a Josephson junction, $E_J$ and $\omega_p$ are the Josephson coupling strength and the plasma frequency, respectively. $\alpha_{ij}$ are the relative Josephson coupling strength of the $ij$-bond. The set of dynamic equations is then written as: \begin{equation} \label{DynamicEq} \frac{E_J}{\omega_p^2}\ddot \varphi_i(t) = \frac{\partial L}{\partial \varphi_i}. \end{equation} Thermodynamic properties are given by the partition function $Z$ that can be expressed through the path integral in the imaginary time-representation: \begin{equation} \label{PartFunction} Z = \int D[\varphi_n(\tau)] \exp \left [\frac{1}{\hbar}\int_0^{\hbar/(k_BT)}L\{\varphi_n, \dot \varphi_n, ~i\tau \} d \tau \right]. \end{equation} The spatial correlations in the network of Josephson junctions are characterized by the correlation functions, $C_p(n)$, that are defined as: \begin{gather} C_p(n) = \frac{1}{Z}\int D[\varphi_m(\tau)]\cos[p(\varphi_0 - \varphi_n)] \times\notag\\ \times \exp \left [\frac{1}{\hbar}\int_0^{\hbar/(k_BT)}L\{\varphi_m, \dot \varphi_m, ~i\tau \} d \tau \right]. \label{CorrFunction} \end{gather} Next we use the generic Eqs. (\ref{Lagrangian}--\ref{CorrFunction}) to analyze the dynamic and thermodynamic properties of the \emph{frustrated} arrays of coupled Josephson junctions. The frustrated arrays are characterized by specific distribution of Josephson coupling strengths, $\alpha_{ij}$, which display alternating signs of the couplings in every unit cell. \section{Linear Regime: Dispersion relation $\omega(k)$} \subsection{Diamond chain} The state of the diamond chain of Josephson junctions is described by three phases per unit cell, $\varphi_n=\{\varphi_{0,n}, \varphi_{+,n}, \varphi_{-,n} \}$ (see the top part of Fig.~\ref{fig:schematic}. The distribution of Josephson coupling strength in a single cell is chosen as $\alpha_1=\alpha_2=\alpha_3=1$ and $\alpha_4=\alpha$. The parameter $\alpha$ can take values from $1$ to $-1$. For convenience, we define the frustration parameter $\alpha=1 - 2f$ varying from $0$ (non-frustrated arrays) to $1$ (maximal frustration). The precise choice of $\alpha_4$ is not important, and it can be swapped with any other $\alpha_i$. As we linearize Eq.~\eqref{DynamicEq} around the uniform solution, the dynamic equations become \begin{align} \label{LinEquation-DC} \frac{1}{\omega_p^2}\ddot {\varphi}_{+,n} = & \,\,\varphi_{0,n} + \varphi_{0,(n+1)} - 2\varphi_{+,n} \;,\\ \frac{1}{\omega_p^2}\ddot {\varphi}_{-,n} = & \,\,(1 - 2f)\varphi_{0,n} + \varphi_{0,(n+1)} - 2(1 - f)\varphi_{-,n} \;,\notag\\ \frac{1}{\omega_p^2}\ddot {\varphi}_{0,n} = & \,\,\varphi_{+,n} + \varphi_{+,(n-1)} + (1-2f)\varphi_{-,n}\notag\\ + & \varphi_{-,(n-1)} - 2(2 - f)\varphi_{0,n} \;.\notag \end{align} Using periodicity of the system and applying the Fourier transform with respect to space and time, we obtain the dispersion relation $\omega^D(k)$ as solutions of the following transcendent equation ($ \alpha = 1 - 2f$): \begin{gather} -\frac{(\omega^D)^2}{\omega_p^2} + 3 + \alpha = \frac{4\cos^2 \left (\frac{k}{2} \right)}{2 - \omega^2} + \frac{(\alpha - 1)^2 + 4\alpha\cos^2 \left (\frac{k}{2} \right)}{-\omega^2 + 1 + \alpha} \label{TrEq-DC} \end{gather} This equation has three solutions $\omega_m^D(k)$, representing the three bands which are shown in Fig.~\ref{fig:DChain} for different values of the frustration parameter $f$. One can see that flatbands occur for two particular values of the frustration parameter, $f=0$ and $f=2/3$. In the latter case the flatband is \emph{the lowest band} of the spectrum, indicating the phase transition and the change of the ground state as the frustration parameter goes to the region $f>f^D_c=2/3$. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure2.jpg} \caption{(Color online) The dispersion relation $\omega^D(k)$ for the diamond chain of Josephson junctions for several values of the frustration parameter: $f=0$ (black lines), $f=0.55$ (blue line), $f=0.65$ (red line). Flat bands occur for $f=0$ and $f=2/3$. The flatband at $f=2/3$ is the lowest one and marks the transition.} \label{fig:DChain} \end{figure} \subsection{Sawtooth chain} Similarly to the previous subsection, here, we analyze the dynamics of the sawtooth chain of Josephson oscillators (see the bootom part of Fig.~\ref{fig:schematic}). The sawtooth chain is described by two phases per unit cell, $\varphi_n= \{\varphi_{0,n}, \varphi_{+,n} \}$. The Josephson couplings strengths in a single cell (as shown in Fig.~\ref{fig:schematic}) is fixed to $\alpha_1=\alpha_2=1$ and $\alpha_3=\alpha=1-2f$. The frustration parameter $f$ varies from $0$ to $1$. The linearized dynamic equations~\eqref{DynamicEq} for the sawtooth chain are \begin{align} \label{LinEquation-ST} \frac{1}{\omega_p^2}\ddot {\varphi}_{+,n} = & \,\,\varphi_{0,n} + \varphi_{0,(n+1)} - 2\varphi_{+,n} \;,\\ \frac{1}{\omega_p^2}\ddot {\varphi}_{0,n} = & \,\,\varphi_{+,n} + \varphi_{+,(n-1)} + (1 - 2f)\varphi_{0,n-1}\notag\\ + & (1 - 2f)\varphi_{0,(n+1)} - 2(1 - 2f)\varphi_{0,n} \;.\notag \end{align} The dispersion relation $\omega^{ST}(k)$ for time and space periodic solution reads \begin{equation} \label{Dispersion-Spectrum} \omega^{ST}(k) = \omega_p \left \{2 + 2\alpha\sin^2 \frac{k}{2} \pm \sqrt{4\alpha^2 \sin^4 \frac{k}{2} + 4\cos^2 \frac{k}{2}} \right \}^{1/2} \end{equation} There are two solutions for every $k$ corresponding to $2$ bands, shown in Fig.~\ref{fig:STchain} for several values of the frustration parameter $f$. The flatband occurs+ for two particular values of the frustration parameter, $f=0.25$ and $f=0.75$. Again, in the latter case the flatband is \emph{the lowest band} of the spectrum, and it marks the change of the ground state as the frustration parameter goes to the region $f>f^{ST}_c=3/4$. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure3.jpg} \caption{(Color online) The dispersion relation $\omega(k)$ for the sawtooth chain of Josephson junctions for several values of the frustration parameter: $f=0$ (black lines), $f=0.25$ (blue lines), $f=0.5$ (green lines), $f=0.75$ (red lines). The flatbands occurring at $f=0.25$ and $f=0.75$ (the lowest one) are shown.} \label{fig:STchain} \end{figure} \section{Thermodynamics of frustrated arrays of Josephson junctions: spatial correlation functions} In the classical regime the thermodynamic properties of the arrays of interacting Josephson junctions are described by the partition function \begin{equation} \label{PF-DC} Z = \int D\{\varphi_i\}\exp \left[-\frac{U}{k_B T} \right ], \end{equation} where the potential energy $U\{\varphi_n\}$ depends on the set of vertex phases. The correlation functions of interest are expressed as \begin{equation} \label{Corrfunction-DC} C_p(n) = \frac{1}{Z}\int D\{\varphi_i\}\exp \left \{-\frac{U}{k_BT}+ip[\varphi_{0,m}-\varphi_{0,m+n}]\right \} \end{equation} Note that due to the global symmetry $\varphi_n\to-\varphi_n$ respected by the energy $U$ the above expression is real. \subsection{Frustrated diamond chains} In a particular case of diamond chain the potential energy is written as \begin{gather} U\{\varphi_n\} = -E_J\sum_n \cos[\varphi_{+,n} - \varphi_{0,n}] + \cos[\varphi_{+,n} - \varphi_{0,n+1}]\notag\\ \label{Potenergy-DC} + \cos[\varphi_{-,n} - \varphi_{0,n+1}] + (1 - 2f)\cos[\varphi_{-,n} - \varphi_{0,n}] \end{gather} The correlation functions $C_p(n)$~\eqref{Corrfunction-DC} can be computed exactly for the chain by introducing new variables: $\varphi_{+,n}-\varphi_{0,n}=s_{1n}$, $\varphi_{0,n+1}-\varphi_{+,n}=s_{2n}$, $\varphi_{-,n}-\varphi_{0,n+1}=s_{3n}$ and $\varphi_{0,n}-\varphi_{-,n}=s_{4n}$. New variables satisfy a simple constraint, $ s_{1n}+s_{2n}+s_{3n}+s_{4n}=0$. Integrating over $s_{3n}$ and $s_{1n}-s_{2n}$ the spatial correlation functions evaluate to \begin{gather} C^{D}_p(n) = \left \{ \frac{F^{D}_p}{F^{D}_0} \right \}^n\qquad\alpha = 1 - 2f,\notag\\ \label{Corrfunction-DC-2} F^{D}_p = \int_0^{2\pi} du e^{ipu} I_0 \left [2K\cos \frac{u}{2} \right ] I_0 \left [K\sqrt{1+\alpha^2+2\alpha \cos u} \right ], \end{gather} where $K=E_J/(k_B T)$ and $I_0(z)$ is the modified Bessel function.~\cite{abramowitz1964handbook} For high temperatures $k_B T\gg E_J$ ($K \ll 1$) one obtains the expected strong suppression of correlations \begin{equation} \label{Corrfunction-DC-HT} C^D_p(n) \simeq \left[\eta_p(f)\frac{E_J}{k_B T} \right]^{2pn}, \end{equation} where $\eta_p(f)$ is a smooth function of order one that depends on both $p$ and $f$. For $p=1$ one has explicitly $\eta_1(f)=1-f$. The situation is less obvious in the low temperature regime as $k_B T\ll E_J$ ($K \gg 1$). The spatial decay of correlation functions strongly depends on the value of the frustration parameter $f$. Indeed, for $0<f<2/3$ the value $u \simeq 0$ gives a most important contribution to the integrals over $u$ in the Eq.~\eqref{Corrfunction-DC-2}, and therefore, the spatial correlation function displays long-range correlations as \begin{equation} \label{Corrfunction-DC-LT-Nofr} C^{D}_p(n) = \exp {\left [ -\frac{(1-f) k_BT}{(2-3f )E_J}p^2n \right ]}, ~~0<f<2/3 \end{equation} Thus, one can see that in this regime the correlation length $\xi_p$ defined as $1/\xi_p=-\ln[C_p(n)]/n $, increases as $\xi_p\simeq 1/T$ with the decrease of temperature $T$. However in the highly frustrated regime as $f^D_c=2/3 < f < 1$, the values $u=\pm u_0=\pm 2\arccos [\sqrt{(f)/[2 (2f-1)]}]$ give the most important contribution to the integrals over $u$ in Eq.~\eqref{Corrfunction-DC-2}, and we obtain a crossover to a regime of short-range correlations as \begin{equation} \label{Corrfunction-DC-LT-fr} C^{D}_p(n) = \exp {\left [ -\frac{\beta_p(f) k_B T}{E_J}p^2n \right ]} \{ cos (pu_0) \}^n, \end{equation} where $\beta_p(f)$ is a smooth function of $p$ of order one. The correlation functions, $C^{D}_{p=1,2}(n)$, computed for several values of temperature and frustration are shown in Fig.~\ref{fig:Dchain-Cf}. As one can see the critical frustration $f^D_c=2/3$ that determines the crossover from long-range to short-range correlations, coincides with the value of $f$ where the lowest band in the spectrum $\omega(k)$ of linear excitations turns flat. This corresponds to a transition from unique ground state $u=0$, to a highly degenerate ground state characterized by two possible values of $u=\pm u_0$ that can be chosen independently for every unit cell. However, as we turn to higher order correlation functions with $p>1$ we find that e.g. for frustration $f \simeq 1$ the value of $u \simeq \pi/2$ and the correlation function $C_2(n)$ displays a long-range behavior with sign alternation on adjacent cells. This indicates the $2e$-$4e$ transition predicted and analyzed in Refs.~\onlinecite{douccot2002pairing,rizzi20064e,protopopov2004anomalous}. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure4a.jpg} \includegraphics[width=0.95\columnwidth]{figure4b.jpg} \caption{(Color online) The typical spatial dependencies of the diamond chain correlation functions, $C^{D}_1(n)$ (solid lines) and $C^{D}_2(n)$ (dashed lines), for different temperatures (top) and frustrations (bo+ttom). Top: the parameters $k_BT=E_J$ (black line) $k_BT=0.1 E_J$ (blue line) and $k_B T=0.01 E_J$ (red line) and the frustration $f=0$ were chosen. Bottom: the frustration $f=0.5$ (black lines), $f=0.75$ (blue lines) and $f=1$ (red line), $k_BT=0.02 E_J$ were chosen.} \label{fig:Dchain-Cf} \end{figure} \subsection{Frustrated sawtooth chains} For the sawtooth chain of Josephson junctions the potential energy $U$ reads \begin{gather} U\{\varphi_n\}=-E_J\sum_n \cos[\varphi_{+,n} - \varphi_{0,n}] + \cos[\varphi_{+,n} - \varphi_{0,n+1}]\notag\\ \label{Potenergy-ST} + (1-2f)\cos[\varphi_{0,n} - \varphi_{0,n+1}] \end{gather} The correlation functions are computed similarly to the case of the diamond chain: the path integrals in the Eqs.~(\ref{PF-DC}--\ref{Corrfunction-DC}) are evaluated by introducing new variables $\varphi_{+,n}-\varphi_{0,n}=s_{1n}$, $\varphi_{0,n+1}-\varphi_{+,n}=s_{2n}$ and $\varphi_{0,n}-\varphi_{0,n+1}=s_{3n}$. The spatial correlation functions are expressed as ratios $C^{ST}_p(n)=(F^{ST}_p/F^{ST}_0)^n $, where \begin{equation} \label{Corrfunction-ST-2} F^{ST}_p = \int_0^{2\pi} du e^{ipu} I_0 \left [2K\cos \frac{u}{2} \right ] e^{ -K(1-2f)\cos u }, \end{equation} and $K$ and $I_0$ are the same as in the diamond chain case. For high temperatures $k_B T\gg E_J$ ($K \ll 1$) the correlation function $C^{ST}_1(n) \simeq [E_J/k_B T ]^{2n}$ shows fast exponential decay. In the low temperature regime as $k_B T\ll E_J$ ($K \gg 1$) the spatial decay of correlation functions strongly depends on frustration $f$ just like in the diamond chain case. Indeed, for $0<f<0.75$ the value $u \simeq 0$ gives the most important contribution to the integrals over $u$~\eqref{Corrfunction-ST-2}, and the spatial correlation function displays long-range correlations as \begin{equation} \label{Corrfunction-ST-LT-Nofr} C^{ST}_p(n) = \exp {\left [ -\frac{ k_BT}{(3-4f) E_J}p^2n \right ]}, ~~f<0.75 \end{equation} In the frustration regime $f^{ST}_c=0.75 <f< 1$ the values $u=\pm u_0=\pm 2\arccos [1/(4f-2)]$ give the most important contribution to the integrals over $u$ in~\eqref{Corrfunction-ST-2}, and we find a crossover to a regime of short-range correlations \begin{equation} \label{Corrfunction-ST-LT-fr} C^{ST}_p(n) = \exp {\left [ -\frac{ k_B T}{E_J}p^2n \right ]} \{ cos (pu_0) \}^n. \end{equation} The correlation functions, $C^{ST}_{p=1,3}(n)$, computed for low temperature and for several values of frustration are shown in Fig.~\ref{fig:STchain-Cf}. As for the diamond chain, the critical frustration $f^{ST}_c=3/4$ marks the crossover from long-range to short-range correlations and coincides with the value of $f$ where the lowest band in the spectrum $\omega(k)$ of linear excitations becomes flat. This indicates the transition from unique ground state $u=0$, to the highly degenerate ground state characterized by independent choice of any of the two values of $u=\pm u_0$ in every unit cell. However, as we turn to higher order correlation functions with $p>1$ we obtain that e.g. for $f \simeq 1$ the value of $u \simeq 2\pi/3$ and the correlation function $C_3(n)$ displays a long-range behavior. Notice here, that diamond chain $C_2(n)$ displays oscillating behavior with $n$ at $f=1$ while the sawtooth model $C_3(n)$ does not oscillate with $n$. This difference --- sign alternation --- does not seem to be related to the difference in geometry of the two models: diamond chain is bipartite while sawtooth chain is not. One can modify the diamond chain model by adding a coupling between $\varphi_{n,+}$ and $\varphi_{n,-}$, that breaks the chiral symmetry of the Hamiltonian, nevertheless the $C_2(n)$ still shows oscillations as a function of $n$. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure5.jpg} \caption{(Color online) The typical spatial dependencies of the sawtooth chain correlation functions, $C^{ST}_1(n)$ (solid lines) and $C^{TS}_3(n)$ (dashed lines) for different frustrations: $f=0.6$ (black line) and $f=1$ (red line). The parameter $k_BT=0.02 E_J$ was chosen.} \label{fig:STchain-Cf} \end{figure} \section{Spatial correlation functions: Monte-Carlo results} In order to check the analytical predictions we performed classical Monte-Carlo simulations using the Hamiltonians~\eqref{Potenergy-DC} and~\eqref{Potenergy-ST}, treating the vertex phases $\varphi_{*,n}$ as classical XY spins $\vec{s}_{*,n}=(\cos\varphi_{*,n}, \sin\varphi_{*,n})$. We used systems with $N=900$ (diamond chain) and $N=600$ (sawtooth chain) sites, each corresponding to 300 unit cells. A typical run consisted of a simulated annealing where the system was heated up from $k_B T = 0.01 E_J$ to $10 E_J$ in $100$ steps. A set of correlation functions $C_p(n)$ with $p=1\dots 8$ was computed during the annealing. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure6a.png} \includegraphics[width=0.95\columnwidth]{figure6b.png} \caption{(Color online) The spatial correlation functions of the first order, i.e. $p=1$, for diamond (top) and sawtooth (bottom) chains numerically computed for different temperatures $k_B T= 10 E_J$ (red), $0.99 E_J$(blue) and $0.01 E_J$ (brown). The frustration $f=0$ was used. } \label{fig:FM-correlators} \end{figure} The Monte-Carlo results fully support the analytical predictions. Indeed, for both the diamond and sawtooth chains the spatial correlations are clearly ferromagnetic for low frustration $f$ ($f<2/3$ for diamond and $f<3/4$ for sawtooth chains), i.e. the long-range spatial correlations develop in $C_1(n)$ as the temperature is lowered to zero. This behavior is shown in Fig.~\ref{fig:FM-correlators}. Once the frustration $f$ is large enough, both the diamond and the sawtooth models show spatial correlations in $C_1(n)$ that drop to zero beyond few nearest unit cells (see Fig.~\ref{fig:HighFrustrationCn}). This observation is quantified with the help of the correlation length $\xi_1$ extracted from the fitting $C_1(n)\propto\exp(-n/\xi_1)$ (see~\eqref{Corrfunction-DC-LT-Nofr} and~\eqref{Corrfunction-ST-LT-Nofr}). As expected $\xi_1$ grows with decreasing temperature for low frustration. However as $f> f^{D(ST)}_c$ , the length $\xi_1$ essentially drops to zero for all temperatures and remains of order one, i.e. of few unit cells in the highly frustrated phase $f\geq f^{D(ST)}_c$. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure7a.png} \includegraphics[width=0.95\columnwidth]{figure7b.png} \caption{(Color online) The numerically computed spatial correlation functions of the first order, i.e. $p=1$, for diamond (top) and sawtooth (bottom) chains at frustration $f=0.8$. The temperature $k_B T = 0.01 E_J$ was chosen. At variance with the low frustration, ferromagnetic regime, the correlation function vanishes beyond few unit cell distances. The observed fluctuations on larger distances are due to finite temperature and finite size effects. } \label{fig:HighFrustrationCn} \end{figure} \begin{figure} \includegraphics[width=0.95\columnwidth]{figure8a.png} \includegraphics[width=0.95\columnwidth]{figure8b.png} \caption{(Color online) The 2d plot showing the dependence of correlation length $\xi_1$ on frustration $f$ and temperature $T$ for diamond (top) and sawtooth (bottom) chains. It was extracted from the Monte-Carlo computation of the spatial correlations functions $C^{D(ST)}_1(n)$. The length $\xi_1$ decreases for a fixed temperature $T$ as frustration $f$ is increased and essentially it vanishes once the frustration exceeds the critical value $f^{D(ST)}_c$.} \label{fig:xi1TAlpha} \end{figure} However there are unexpected spatial correlations hidden in the higher order correlation functions $C_p(n)$ with $p>1$. Indeed, the Monte-Carlo simulation for the diamond chain with the largest frustration $f=1$, shows that the long-range correlations are restored in $C_2^{D}(n)$ for low temperatures. This result is displayed in Fig.~\ref{fig:DC-Cp12} (similar behavior is observed for the sawtooth chain (not shown)). While $C^{D}_1(n)$ decays to zero beyond $2$ unit cells, the $C_2(n)$ shows long-range oscillatory behavior with sign alternation. This is in good agreement with the analytical results (see Fig.~\ref{fig:Dchain-Cf}). \begin{figure} \includegraphics[width=0.95\columnwidth]{figure9.png} \caption{(Color online) The spatial correlation functions for the diamond chain, $C_p^D(n)$ for $p=1$ (red line) and $p=2$ (blue line) and $f=1$ at $k_B T=0.01 E_J$ . The correlation function with $p=1$ drops to zero beyond the second unit cell, while the $p=2$ correlation function shows long-range features. The fluctuations at large distances are due to stronger fluctuations in $d=1$ systems.} \label{fig:DC-Cp12} \end{figure} Similarly to the $p=1$ case (see Fig. \ref{fig:xi1TAlpha}) the long-range correlations developing at $f=1$ in the diamond and sawtooth chains can be quantified by the correlation lengths $\xi_2$ and $\xi_3$ ($C_p(n)\propto\exp(-n/\xi_p)$) respectively as shown in Fig.~\ref{fig:xinTAlpha}. In the low frustration phase $f < f^{D(ST)}_c$ both lengths grow with decreasing temperature reflecting the development of the ferromagnetic ordering, similarly to an increase of $\xi_1$. The growth is diminishing as the critical frustration $f^{D(ST)}_c$ value is approached and spatial correlations vanish. Upon entering the highly frustrated regime $f\geq f^{D(ST)}_c$ and approaching $f=1$ the lengths again start to show growth with decreasing temperature and a long-range ordering establishes at $f=1$, $T=0$. Similar effect is observed in higher order correlation functions for several other values of $f > f_c$ for both models. \begin{figure} \includegraphics[width=0.95\columnwidth]{figure10a.png} \includegraphics[width=0.95\columnwidth]{figure10b.png} \caption{(Color online) The density plot of the correlation length $\xi_2$ (top) and $\xi_3$ (bottom) vs. frustration $f$ and temperature $T$; brighter color corresponds to larger value of the correlation lengths. The data are extracted from the Monte-Carlo simulated $C_2(n)$ and $C_3(n)$ for the diamond and sawtooth chains respectively. For $f < f^{D(ST)}_c$ the $T$-dependence of $\xi_2$, $\xi_3$ follows that of $\xi_1$, reflecting ferromagnetic ordering. For $f >f^{D{ST}}_c$ the long-range order is developing in the higher order spatial correlation functions $C_2$ (diamond) and $C_3$ (sawtooth) as $f\to 1$.} \label{fig:xinTAlpha} \end{figure} \section{Conclusions} We have studied analytically and using Monte-Carlo simulations the static and dynamic properties of frustrated arrays of Josephson junction classical nonlinear oscillators. Such periodic arrays are characterized by Josephson coupling strengths in every cell that can have different signs. We have considered two models of such frustrated arrays, namely, the diamond and sawtooth chains (see Figs.~\ref{fig:schematic}). In the linear regime the dynamics of these arrays is determined by a multi-band dispersion relation $\omega(k)$ (see Figs.~\ref{fig:DChain} and~\ref{fig:STchain}). Such spectrum can be experimentally accessed through the analysis of the resonant response of the arrays to an applied small amplitude electromagnetic wave. We find that the spectrum of frustrated arrays consists of flatbands for particular values of frustration $f$. Moreover at the critical value of frustration $f_c$ the lowest band becomes flat, and the transition between non-frustrated and frustrated nonlinear regimes occurs at the same value of frustration. We identified the critical values of frustration $f^{D(ST)}_c$ for both diamond and sawtooth chains. The transition is reflected in the temperature and frustration dependencies of spatial correlation functions of different orders, $C_p(n)$. In particularly, we obtain that the Josephson junction diamond and sawtooth chains display the ferromagnetic order for low frustration, $f<f_c$, as all Josephson phases (the phase differences between nearest-neighbor vertices) are equal to zero. The ferromagnetic ground state is characterized by the exponential decay of the spatial correlation function $C_p(n)$, where the correlation length $\xi_1$ increases with the decreasing temperature. These results are presented in the top part of Fig.~\ref{fig:Dchain-Cf} (analytical results) and Fig.~\ref{fig:FM-correlators} (Monte-Carlo simulations). At $f=f_c$ the transition to the frustrated regime occurs. It is characterized by the appearance of the massive degeneracy of the ground state, where any of the two different configurations of the phases, that depend on the frustration value $f$, can be chosen independently for every cell. This results into a drastic suppression of spatial correlations in the correlation function $C_1(n)$ (see the bottom part of Fig.~\ref{fig:Dchain-Cf}(bottom) and Fig.~\ref{fig:STchain-Cf} (analytic results), and Fig.~\ref{fig:HighFrustrationCn} (Monte-Carlo simulations)). The dependence of correlation length $\xi_1$ on temperature and frustration is shown as a density plot in Fig.~\ref{fig:xi1TAlpha}. However, the long-range correlations are recovered in higher-order correlators $C_p(n)$ with $p>1$ deep in the frustration regime. Indeed, in the limit $f \to 1$ the long-range correlations have been identified for $C^D_2(n)$ for the diamond chain (see Figs.~\ref{fig:Dchain-Cf}(bottom),~\ref{fig:DC-Cp12} and~\ref{fig:xinTAlpha}(top)) and $C^{ST}_3(n)$ for the sawtooth chain (see Fig.~\ref{fig:STchain-Cf} and~\ref{fig:xinTAlpha}(bottom)). Furthermore, we found that the $C^D_2(n)$ changes sign in every cell. The long-range spatial correlations of high-order correlation functions indicate the presence of $2ne$-condensation ($n$ is larger than 1) in the frustrated arrays of Josephson junctions similarly to the model studied in Ref.~\onlinecite{douccot2002pairing} where the long-range correlations have been obtained in $C_2(n)$. It is instructive to compare these results to the previously studied models of frustrated arrays: the model elaborated in Ref.~\onlinecite{douccot2002pairing} shows a massively degenerate ground state only for a single value of the frustration, unlike our case, where the degeneracy appears in a whole region of values of frustration $f_c < f < 1$. It is worth noting, that the frustration strength $f=1$ for which $C_p$, $p=2$ and $p=3$ correlators show long-range order for the diamond and sawtooth chains respectively, is not unique. There are other values of frustration $f$ where higher order correlators $C_p(n)$ display long-range behavior at low temperatures. A few examples for the diamond chain are $f=0.75$ with $p=3$, $f\approx 0.71$ with $p=4$, $f=0.81$ with $p=5$, $f\approx 0.85$ with $p=7$ and $f\approx 0.78$ with $p=8$. Interestingly there are no oscillations in $C_5(n)$ for $f=0.81$. The geometry of the diamond and sawtooth chains studied strongly suggests that similar results hold for other corner sharing chains. The flatband construction of Ref.~\onlinecite{morales2016simple} relying on repetition of mini-arrays appears particularly promising. Finally, we note that quantum tunneling between two equivalent states in every cell can result in a unique ground state and a corresponding crossover between classical highly degenerated ground state and macroscopic quantum state at low temperatures. \begin{acknowledgments} The authors would like to thank S. Flach for useful discussions. M. V. F. acknowledges the financial support of the Ministry of Education and Science of the Russian Federation in the framework of Increase Competitiveness Program of NUST "MISiS" $K2-2017-067$ and the State Program 3.3360.2017. This work was also supported by the Institute for Basic Science in Korea (IBS-R024-D1). \end{acknowledgments}
\section{Introduction} \vspace{-2mm} Single image reflection separation aims to separate an observed image into a transmitted scene and a reflected scene. When two scenes are separated adequately, existing computer vision algorithms can better understand each scene since an interference of the other one is decreased. As there are various objects that may reflect surroundings, such as windows, glass, or ponding water, this is an important problem to the computer vision community. \begin{figure}[t] \centering \includegraphics[width=\linewidth]{teaser.png} \caption{ The proposed algorithm is able to separate an observed image into a transmitted scene and a reflected scene. % Convolutional neural networks are trained to generate both scenes conditioned on the category of two scenes based on adversarial learning. % Unlike previous approaches, a reflected scene can also be predicted reasonably. % The ground truth of each scene is shown in red boxes. } \label{fig:teaser} \end{figure} Although this problem has been studied for decades \cite{barrow1978computer}, it is still a challenging problem due to several reasons. First, it is an ill-posed problem as we need to infer two scenes based on an observed image. Numerous methods have been proposed to address this issue by making certain assumptions to make the problem tractable. However, the assumptions have been limited to specific cases and are not applicable to real-world images in general \cite{wan2017benchmarking}. For example, one of the mainstream approaches assumes that the edge distribution between the transmitted scene and reflected scene is different, i.e., the former tends to have sharper edges while the latter is relatively blurred \cite{arvanitopoulos2017single, li2014single, fan2017generic}. This type of blur occurs when the reflected scene is outside of the depth of field of the camera. However, cameras in recent years, such as the ones on smartphones, have small aperture and deep depth of field. Consequently, an observed image contains sharp edges of both scenes although the reflected scene is not in the same depth of the transmitted scene. In other words, the blur assumption does not hold in practice. Second, it is difficult to obtain ground-truth tuples of an observed scene $y$, a transmitted scene $t$, and a reflected scene $r$ as we cannot simply get rid of the obstructing glass and take pictures of two scenes in general circumstances\footnote{Note that a transmitted scene and a reflected scene represent a scene before the transmission and reflection, respectively.}. Therefore, it has been assumed that an observed image can be synthesized by combining two known images based on the physical model of the transmission and reflection. However, the exact physical model is unknown as it is complex and requires various factors, such as the thickness of glass, surface conditions, and angle of incidence, which are typically not at our disposal \cite{soares2014introduction}. As a consequence, simple approximations are used to model the reflection which limits the separation performance. For example, one of the most common approximated models is $y=wt+(1-w)r$, where $w$ is a scalar weight. However, it does not consider changes in $t$ and $r$ due to the glass. Third, conventional approaches mainly focus on reflection removal instead of reflection separation~\cite{han2017reflection, arvanitopoulos2017single, wan2016depth, xue2015computational}. Although these methods aim to suppress reflection artifacts to restore the transmitted scene, the contents of the reflection are usually not considered. While it may be difficult to reconstruct both scenes, it is important to infer both scenes jointly as they are entangled in a single observation. Furthermore, the recovered reflected scene itself may be useful for various applications such as surveillance and image understanding. To address above issues, we first propose to use a new assumption on the observed scene: the category of the transmitted and reflected scenes are known. It is a valid assumption in practice since we take a picture of an interested object or scene while knowing which is being reflected. Likewise, other ill-posed problems such as deblurring and super-resolution often make similar assumptions, e.g., in the cases of faces, text, and night scenes~\cite{pan2014deblurring, pan2014deblurring2, hu2014deblurring, yang2013structured}. As such, we demonstrate that it is not necessary to make other assumptions, e.g., a blurry reflected scene. In addition, our algorithm does not rely on a certain approximation model of the reflection as it may restrict the algorithm to a specific case. Instead, we leverage the fact that an observed image contains contents of the transmitted scene and reflected scene. It leads us to model an observed image using a feature space instead of a pixel-level combination. Based on the above assumption, we pose the reflection separation problem as a conditional image generation task (see Figure~\ref{fig:teaser}). Although image generation is a difficult problem, notable success has been achieved that transforms an input image into other domains or styles \cite{isola2017image, gatys2016image, zhu2017unpaired}. In this work, we use generative adversarial networks (GAN) \cite{goodfellow2014generative} to infer two scenes jointly based on a novel network architecture. By generating images, the proposed algorithm makes a key difference from previous methods of reflection separation as plausible reflected scenes can be obtained. Furthermore, the network can be trained in a weakly-supervised manner, i.e., only labels of transmitted and reflected scenes are needed. It enables us to train the network using real data without tedious effort gathering corresponding ground truths for $t$ and $r$. We carry out experiments on real data collected from the internet and synthetic data based on the Places dataset \cite{zhou2017places} which consists of 8 million images of 365 scenes. For both datasets, we evaluate the proposed algorithm against the state-of-the-art methods for single image reflection separation. Quantitative and qualitative results show that the proposed algorithm suppresses reflection artifacts on the transmitted scene and infers the reflected scene properly. \vspace{-2mm} \section{Related Work} \vspace{-2mm} As reflection separation is an ill-posed problem, additional information or assumptions are needed to make the problem tractable. In earlier methods, multiple images of a target scene taken under different conditions are used. For example, focus/defocus pairs \cite{schechner2000separation}, flash/non-flash pairs \cite{agrawal2005removing}, or different polarization angle pairs \cite{schechner2000polarization, kong2014physically} are utilized. For videos, it is possible to decorrelate the motion between the transmitted scene and reflected scene \cite{sarel2004separating, szeliski2000layer, gai2012blind}. However, it may be difficult to apply these methods in practice since multiple images captured from controlled experimental setups are not always available. Reflection separation using a single image has recently attracted increasing attention due to its practical importance, although the problem is more difficult than multiple-image cases. User annotations can guide the separation by formulating it as a constrained optimization problem which relies on a sparse gradient prior of natural images \cite{levin2007user}. For automatic single image reflection separation, existing methods focus on each of the following three different conditions. First, the depth of field (DoF) of a lens is shallow and the image is focused on a transmitted scene. It makes out-of-focus blur for a reflected scene when the distance from the window is not the same as the transmitted scene. Thus, blurry edges become useful cues for reflection separation. Wan \etal~\cite{wan2016depth} propose a pixel-wise DoF confidence map obtained by a multi-scale search. In \cite{yan2014separation}, a method based on a Markov random field and expectation maximization is proposed to filter out weak edges. The energy function of a Markov random field is composed of gradient profile sharpness and spatial smoothness of edges. A recent optimization based approach \cite{arvanitopoulos2017single} uses a Laplacian data fidelity term and an $l_0$ prior term to suppress reflections. Fan \etal~\cite{fan2017generic} propose a two-step deep architecture based on convolutional neural networks. Given an input image and an edge map, it first predicts edges of a target scene and then reconstructs the target scene based on the input image and predicted edges. \begin{figure*}[!t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \centering \subfloat[Baseline 1]{\includegraphics[width=0.25\linewidth]{net1}% \label{fig:net1}} \qquad \subfloat[Baseline 2]{\includegraphics[width=0.25\linewidth]{net2}% \label{fig:net2}} \qquad \subfloat[Baseline 3]{\includegraphics[width=0.315\linewidth]{net3}% \label{fig:net3}} \hfil \subfloat[Proposed network]{\includegraphics[width=0.6\linewidth]{net4}% \label{fig:net4}} \hfil \caption{ Proposed network architecture and baseline models for reflection separation. % We use color coding to indicate weight sharing. % Note that U-net architecture and discriminators are omitted for better visualization. % (a) Two separated generators for each of transmitted and reflected scenes. % (b) Sharing weights through a reconstruction branch. % (c) Additionally comparing contents of images using feature maps of a shared encoder. % (d) Predicting a mask map for a transmitted scene increases the flexibility of a network for handling real images. } \label{fig:nets} \end{figure*} Second, the DoF is deep and covers both transmitted and reflected scenes. Thus, the observed image contains sharp edges from both scenes. While this happens frequently, it is the most challenging issue due to the lack of visual clues for separation. Levin \etal~\cite{levin2003learning, levin2004separating} rely on a prior that gradient and local features of natural images are statistically sparse~\cite{fergus2006removing}. However, it is difficult to apply above methods when textures of an image become complex. Third, the DoF is deep and glass is relatively thick. Then, a ghost effect of the reflected scene is caused by light rays that penetrate the outer surface of the glass but reflect on the inner surface. Shih \etal~\cite{shih2015reflection} estimate a ghost kernel and use a Gaussian mixture model to separate the scenes. However, it is not applicable to other types of reflections that do not have notable ghost effects. \vspace{-2mm} \section{Proposed Algorithm} \vspace{-2mm} \begin{table*}[t] \centering \footnotesize \caption{Details of each network. \# Filter is the number of filters. BN is the batch normalization. Conv denotes a convolutional layer. F-Conv denotes a transposed convolutional layer that uses the fractional-stride.} \vspace{-2mm} \subfloat[Details of the \{encoding, discriminator\} network]{ \begin{tabular}{|c|c|c|c|c|c|} \hline Layer & \# Filter & Filter Size & Stride & Pad & BN \\ \hline Conv. 1 & 32 & $5\times5\times3$ & 2 & 2 & $\times$ \\ Conv. 2 & 64 & $5\times5\times32$ & 2 & 2 & \{$\times$, $\bigcirc$\} \\ Conv. 3 & 128 & $5\times5\times64$ & 2 & 2 & \{$\times$, $\bigcirc$\} \\ Conv. 4 & 256 & $5\times5\times128$ & 2 & 2 & \{$\times$, $\bigcirc$\} \\ Conv. 5 & 256 & $5\times5\times256$ & 2 & 2 & \{$\times$, $\bigcirc$\} \\ Conv. 6 & \{128,1\} & $1\times1\times256$ & 1 & 0 & $\times$ \\ \hline \end{tabular}% \label{tab:EnDi}% } \subfloat[Details of the \{mask prediction, generation\} network]{ \begin{tabular}{|c|c|c|c|c|c|} \hline Layer & \# Filter & Filter Size & Stride & Pad & BN \\ \hline Conv. 1 & $4\times4\times256$ & $1\times1\times128$ & 1 & 0 & $\bigcirc$ \\ F-Conv. 2 & 256 & $5\times5\times256$ & 1/2 & - & $\bigcirc$ \\ F-Conv. 3 & 256 & $5\times5\times128$ & 1/2 & - & $\bigcirc$ \\ F-Conv. 4 & 128 & $5\times5\times64$ & 1/2 & - & $\bigcirc$ \\ F-Conv. 5 & 64 & $5\times5\times32$ & 1/2 & - & $\bigcirc$ \\ F-Conv. 6 & 32 & $5\times5\times\{1,3\}$ & 1/2 & - & $\times$ \\ \hline \end{tabular}% \label{tab:DeGe}% } \label{tab:layers} \end{table*} Figure~\ref{fig:nets} shows design options of network architectures for a single image reflection separation. From baseline models to the proposed network, we discuss the limitations and remedies of each model. All networks basically have two generation branches; one for a transmitted scene and the other for a reflected scene. For realistic generations, we apply adversarial losses~\cite{goodfellow2014generative} using discriminators. Let $(G_t, D_t)$ and $(G_r, D_r)$ denote pairs of a generator and a discriminator for transmission and reflection branches, respectively. Then, an adversarial loss for the transmission branch is defined as follows: \begin{equation} \begin{aligned} \mathcal{L}_{adv}(G_t,D_t) = & \mathbb{E}_{y,t\sim p_{data}(y,t)}[\log D_t(y,t)] + \\ & \mathbb{E}_{y\sim p_{data}(y)}[\log (1-D_t(G_t(y))]. \end{aligned} \label{eq:cgan_loss} \end{equation} An adversarial loss for the reflection branch is defined in a similar way. The network architecture is described in Table~\ref{tab:layers}. \subsection{Reflection Separation using Synthetic Images} \vspace{-2mm} This approach trains a network to separate synthesized images and evaluate on real images. We first describe our synthesis schemes and then discuss network designs. \vspace{2pt} \noindent {\bf Preparing training images.} For training, $y$ is synthesized using two known images $t$ and $r$, and a synthesis model. We consider three state-of-the-art synthesis models \cite{arvanitopoulos2017single, shih2015reflection, fan2017generic}: \begin{compactitem} \item [\textbf{A blurring model}] $y=wt+(1-w)(k_b*r)$, \item [\textbf{A ghost model}] $y=t+k_g*r$, \item [\textbf{A clipping model}] \cite{fan2017generic}, \end{compactitem} where $w$ is a scalar weight, $k_b$ is a blurring kernel, $k_g$ is a ghost kernel, and $*$ denotes a convolution operation. These models assume blurry edges or ghost effects of a reflected scene to make the problem tractable. We aim to drop such assumptions and thus two more synthesis models are added, i.e., a linear model $y=wt+(1-w)r$ and a clipping model without blurring step. In addition, we change the ghost model as $y=wt+(1-w)\frac{k_g*r}{\max(k_g*r)}$ for training since the model in \cite{shih2015reflection} does not define $t$ and $r$ as the original scenes before the transmission and reflection\footnote{For the original ghost model, $y$ is outside of $[0,1]$ when $t\in[0,1]$ and $r\in[0,1]$ since $k_g*r\geq r$.}. There are parameters in each model, \eg, $w$ in the blurring model. For flexibility and generalization ability, we synthesize images using random parameters for each mini-batch. For example, we pick $w\in[0.5,0.7]$ uniformly at random while other methods use one or two fixed values \cite{arvanitopoulos2017single, li2014single}. In addition, we perform random left-right flipping and cropping for data augmentation. To the best of our knowledge, this is the first work that deals with these diverse reflection models. \begin{figure}[t] \centering \includegraphics[width=1.0\linewidth]{compare_baseline.png} \caption{ Examples of reflection separation results using baseline networks in Figure~\ref{fig:nets}. % Best viewed in color with a digital zoom. } \label{fig:compare_baseline} \end{figure} \vspace{2pt} \noindent {\bf Network design for synthetic image reflection separation.} The first baseline model simply maps an input image into two domains using an encoder and two domain-specific decoders based on the U-net architecture \cite{ronneberger2015u} as shown in Figure~\ref{fig:nets}(a). The loss function for this network is an extension of \cite{isola2017image} as follows: \begin{equation}\label{eq:loss1} \begin{aligned} & \mathcal{L}_1(G_t, G_r, D_t, D_r) = \mathcal{L}_{adv}(G_t, D_t) + \mathcal{L}_{adv}(G_r, D_r) \\ & \quad + \lambda_1\sum_{\alpha\in\{t,r\}}\mathbb{E}_{y,\alpha\sim p_{data}(y,\alpha)}[\|\alpha-G_\alpha(y)\|_1], \end{aligned} \end{equation} where $\lambda_1$ controls relative importance of objectives. It asks generators to not only fool discriminators but also to be similar to ground truth images. However, this simple extension renders numerous artifacts and fails to separate two scenes suitably, as shown in Figure~\ref{fig:compare_baseline}. We attribute this to a lack of communication between two generation branches. As two images should be generated jointly in our problem, we need extra channels to communicate with each other. To address this issue, we add a reconstruction branch, $G_y$, and share weights of the first few layers with generation branches as shown in Figure~\ref{fig:nets}(b). In this case, the loss function is: \begin{equation}\label{eq:loss2} \begin{aligned} & \mathcal{L}_2(G_t, G_r, G_y, D_t, D_r) = \mathcal{L}_{adv}(G_t, D_t) + \mathcal{L}_{adv}(G_r, D_r) \\ & \quad + \lambda_1\sum_{\alpha\in\{y,t,r\}}\mathbb{E}_{y,\alpha\sim p_{data}(y,\alpha)}[\|\alpha-G_\alpha(y)\|_1]. \end{aligned} \end{equation} Note that this is different from the weight sharing scheme of \cite{liu2016coupled}: early weights of two generation branches are shared (i.e., semantics between two domains are shared). On the other hand, in our problem, the semantics are often not shared between a transmitted scene and a reflected scene. Instead, both scenes share semantics with an observed image. Thus, by putting a reconstruction branch in the middle, all networks can communicate with each other during generation. This approach helps decrease artifacts and separates the scene better as shown in Figure~\ref{fig:compare_baseline}. The third model is shown in Figure~\ref{fig:nets}(c). It aims to make use of high-level information in addition to the pixel-level appearance to assess generated images. In this paper, we minimize the difference of contents between generated images and the input image. A straightforward solution is to put a constraint that generated images should reconstruct an input image as faithfully as possible using the synthesis model. However, it is a limited approach since the real synthesis models are unknown or non-differentiable, \eg,~\cite{fan2017generic}. To address this issue, we compare feature maps of the input and generated images. In Figure~\ref{fig:nets}(c), we introduce a new variable $w_y$ which estimates the ratio of contents between a transmitted scene and reflected scene in $y$. Using this parameter, a content loss between the observed scene and generated scenes is defined as follows: \begin{equation}\label{eq:content_loss} \begin{aligned} & \mathcal{L}_{content}(G_t, G_r) = \\ & \sum_i \frac{1}{V_i}\Big(\|f_i(y) - (w_y f_i(G_t(y)) + (1-w_y)f_i(G_r(y)))\|_2 \\ & \qquad\ + \|f_i(t)-f_i(G_t(y))\|_2 + \|f_i(r)-f_i(G_r(y))\|_2 \Big), \end{aligned} \end{equation} where $f_i$ and $V_i$ denote a feature map and a volume of the $i$-th layer of the encoder, respectively. It allows us to train the network for arbitrary synthesis models. The loss for the network is defined as follows: \begin{equation}\label{eq:loss} \begin{aligned} & \mathcal{L}(G_t, G_r, G_y, D_t, D_r) = \\ & \quad \mathcal{L}_{adv}(G_t, D_t) + \mathcal{L}_{adv}(G_r, D_r) + \\ & \quad \lambda_1\sum_{\alpha\in\{y,t,r\}}\mathbb{E}_{y,\alpha\sim p_{data}(y,\alpha)}[\|\alpha-G_\alpha(y)\|_1] + \\ & \quad \lambda_2\mathcal{L}_{content}(G_t, G_r), \end{aligned} \end{equation} where $\lambda_1=\lambda_2=100$ are used for all experiments. \subsection{Reflection Separation using Real Images} \vspace{-2mm} In this section, we describe how to train a network using real observations without ground truth images of the transmitted scene and reflected scene. Note that the discussed networks so far rely on synthetic images since it is difficult to obtain ground truths of corresponding $t$ and $r$. Even in the recent attempt for data collection \cite{wan2017benchmarking}, the original scene before reflection cannot be obtained. It limits the performance of reflection separation due to the difference between the real observation and synthesized images. \begin{figure}[t] \centering \includegraphics[width=1.0\linewidth]{ex_real.png} \caption{ Examples of cafe images taken from the outside. % Part of the cafe interior is not visible due to the reflection. } \label{fig:ex_real} \end{figure} One of the largest gaps between real and synthesized images is due to the combination weight $w$ in the synthesis model. For real images, reflected scenes are often dominant in certain regions of an observed image where transmitted signals are unrecognizable and can only be guessed. For example, as shown in Figure~\ref{fig:ex_real}, cafe interiors are not visible due to reflected buildings. However, state-of-the-art synthesis methods use a scalar $w$ to combine two scenes. To alleviate this issue, we predict a mask map using a new branch $G_m$ instead of a scalar $w_y$ as shown in Figure~\ref{fig:nets}(d). For each location, its value is between $[0,1]$ which represents a confidence score that the pixel belongs to a transmitted scene. As such, we have $G_m(y)\otimes y \simeq G_m(y)\otimes G_t(y) = G_{mt}(y)$ and $(1-G_m(y))\otimes y \simeq (1-G_m(y))\otimes G_r(y) = G_{mr}(y)$, where $\otimes$ denotes pixel-wise multiplication and $G_{mt}$ and $G_{mr}$ are defined for notational simplicity. The confidence map prediction branch and other generation branches are trained iteratively. The network can be trained in a weakly supervised manner, i.e., tuples of $(y,t,r)$ are given where $t$ and $r$ are images belonging to the same categories of transmitted and reflected scenes included in $y$, respectively. In this case, $t$ and $r$ are not conditioned on $y$. Thus, (\ref{eq:cgan_loss}) is changed to: \begin{equation}\label{eq:gan_loss} \begin{aligned} \mathcal{L}_{adv}(G_t,D_t) = & \mathbb{E}_{t\sim p_{data}(t)}[\log D_t(t)] + \\ & \mathbb{E}_{y\sim p_{data}(y)}[\log (1-D_t(G_t(y))]. \end{aligned} \end{equation} In addition, a loss function in (\ref{eq:loss}) should be changed for weakly supervised learning. By combining all the losses, the overall loss function becomes \begin{equation}\label{eq:loss_unsup} \small \begin{aligned} & \mathcal{L}(G_t, G_r, G_y, G_m, D_t, D_r) \\ & = \mathcal{L}_{adv}(G_t, D_t) + \mathcal{L}_{adv}(G_r, D_r) \\ & + \lambda_1\mathbb{E}_{y\sim p_{data}(y)}[\|y-G_y(y)\|_2] + \|G_m(y)\otimes y -G_{mt}\|_2 + \\ & \qquad\qquad\qquad\qquad \|(1-G_m(y))\otimes y - G_{mr}(y)\|_2] \\ & + \lambda_2\sum_i \frac{1}{V_i}\big(\|f_i(G_m(y)\otimes y) - f_i(G_{mt}(y))\|_2 + \\ & \qquad\qquad\qquad \|f_i((1-G_m(y))\otimes y) - f_i(G_{mr}(y))\|_2\big). \end{aligned} \end{equation} It only uses $t$ and $r$ to compute the adversarial loss which does not need the exact ground truth data of $y$. Note that it allows us to learn reflection separation problem without any approximations for synthetic images. \vspace{-2mm} \section{Experimental Results} \label{sec:exp} \vspace{-2mm} \begin{figure}[t] \centering \includegraphics[width=1.0\linewidth]{places_dataset.png} \caption{ Examples of the Places dataset. % It has a large number of categories and images in the same category are fairly diverse. } \label{fig:places_dataset} \end{figure} We first describe the experimental settings. We use the Places dataset which contains 8 million images of 365 scenes to synthesize images. As shown in Figure~\ref{fig:places_dataset}, it has diverse images that cover large variations in the lighting condition, viewpoint, distance to the scene, and a number of objects in the scene. For each experiment, two scenes are selected to synthesize training images. For real images, we collect 178 photos of a cafe taken from the outside, from the Internet. As shown in Figure~\ref{fig:ex_real}, the images contain challenging reflections. \begin{figure*}[!t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \centering \subfloat[Input $y$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_input_2}% \label{fig:syn_input}} \hspace{0.1pt} \subfloat[$G_t(y)$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_g1_2}% \label{fig:syn_g1}} \hspace{0.1pt} \subfloat[$G_r(y)$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_g2_2}% \label{fig:syn_g2}} \hspace{0.1pt} \subfloat[\cite{arvanitopoulos2017single} $t$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_cvpr_2}% \label{fig:syn_cvpr}} \hspace{0.1pt} \subfloat[\cite{fan2017generic} $t$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_iccv1_2}% \label{fig:syn_iccv1}} \hspace{0.1pt} \subfloat[\cite{fan2017generic} $r$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_iccv2_2}% \label{fig:syn_iccv2}} \hspace{0.1pt} \subfloat[Real $t$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_gt1_2}% \label{fig:syn_gt1}} \hspace{0.1pt} \subfloat[Real $r$]{\includegraphics[width=0.1\linewidth]{summary_airfield_hotelroom_synth_iccv_gt2_2}% \label{fig:syn_gt2}} \hfil \caption{ Single image reflection separation results on synthetic images of the Places dataset. % In this experiment, images are synthesized based on the clipping model \cite{fan2017generic}. % For every two rows, we show results with and without the blurry assumption for the same input pair. % } \label{fig:syn_results} \end{figure*} \begin{table*}[t] \centering \footnotesize \caption{ Quantitative results of single image reflection separation on the Places dataset. % For comparison, we run experiments using each author's publicly available implementation. % Note that \cite{shih2015reflection} does not work on other physical models and \cite{arvanitopoulos2017single} does not provide a reflection scene as an output. } \begin{tabular}{ccc|c|c|c|c|c|c|c|c|c|c|} \cline{4-13} & & & \multicolumn{5}{ c| }{Transmission} & \multicolumn{5}{ c| }{Reflection} \\ \cline{4-13} Dataset& Physical model & & \cite{li2014single} & \cite{shih2015reflection} & \cite{arvanitopoulos2017single} & \cite{fan2017generic} & Ours & \cite{li2014single} & \cite{shih2015reflection} & \cite{arvanitopoulos2017single} & \cite{fan2017generic} & Ours \\ \cline{1-13} \multicolumn{1}{ |c }{\multirow{10}{*}{\shortstack{$t$: Airfield,\\ $r$: Hotel room}} } & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{shih2015reflection}} } & \multicolumn{1}{ |c| }{PSNR} & 14.4 & 13.1 & 17.3 & 17.4 & \textbf{18.2} & 10.1 & 10.2 & - & 7.28 & \textbf{18.9} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.34 & 0.26 & 0.42 & 0.44 & \textbf{0.45} & 0.10 & 0.14 & - & 0.06 & \textbf{0.48} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{arvanitopoulos2017single}} } & \multicolumn{1}{ |c| }{PSNR} & 15.8 & - & 19.9 & 20.1 & \textbf{26.3} & 11.8 & - & - & 8.0 & \textbf{18.0} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.47 & - & 0.58 & 0.61 & \textbf{0.80} & 0.17 & - & - & 0.11 & \textbf{0.37} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\shortstack{\cite{arvanitopoulos2017single} without \\ blur assumption}} } & \multicolumn{1}{ |c| }{PSNR} & 13.8 & - & 17.4 & 17.4 & \textbf{21.5} & 10.0 & - & - & 7.2 & \textbf{17.5} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.31 & - & 0.41 & 0.42 & \textbf{0.63} & 0.10 & - & - & 0.05 & \textbf{0.45} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{fan2017generic}} } & \multicolumn{1}{ |c| }{PSNR} & 15.1 & - & 15.9 & 18.1 & \textbf{26.1} & 9.95 & - & - & 8.1 & \textbf{17.5} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.49 & - & 0.53 & 0.59 & \textbf{0.81} & 0.10 & - & - & 0.12 & \textbf{0.35} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\shortstack{\cite{fan2017generic} without \\ blur assumption}} } & \multicolumn{1}{ |c| }{PSNR} & 13.6 & - & 15.1 & 15.6 & \textbf{22.8} & 9.67 & - & - & 7.3 & \textbf{17.5} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.40 & - & 0.49 & 0.50 & \textbf{0.68} & 0.09 & - & - & 0.11 & \textbf{0.41} \\ \cline{1-13} % \multicolumn{1}{ |c }{\multirow{10}{*}{\shortstack{$t$: Skyscraper,\\ $r$: Conference room}} } & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{shih2015reflection}} } & \multicolumn{1}{ |c| }{PSNR} & 14.5 & 14.5 & 17.6 & 17.4 & \textbf{21.1} & 9.80 & 10.8 & - & 7.30 & \textbf{16.5} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.39 & 0.34 & 0.45 & 0.46 & \textbf{0.62} & 0.10 & 0.11 & - & 0.02 & \textbf{0.37} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{arvanitopoulos2017single}} } & \multicolumn{1}{ |c| }{PSNR} & 15.3 & - & 19.2 & 19.9 & \textbf{24.5} & 10.9 & - & - & 8.4 & \textbf{16.4} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.48 & - & 0.60 & 0.64 & \textbf{0.76} & 0.11 & - & - & 0.10 & \textbf{0.31} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\shortstack{\cite{arvanitopoulos2017single} without \\ blur assumption}} } & \multicolumn{1}{ |c| }{PSNR} & 14.3 & - & 17.0 & 16.7 & \textbf{20.4} & 9.70 & - & - & 7.1 & \textbf{16.8} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.35 & - & 0.42 & 0.41 & \textbf{0.57} & 0.08 & - & - & 0.01 & \textbf{0.40} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\cite{fan2017generic}} } & \multicolumn{1}{ |c| }{PSNR} & 14.6 & - & 15.3 & 17.2 & \textbf{23.1} & 10.0 & - & - & 8.1 & \textbf{15.7} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.46 & - & 0.51 & 0.58 & \textbf{0.73} & 0.07 & - & - & 0.09 & \textbf{0.28} \\ \cline{2-13} \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{\multirow{2}{*}{\shortstack{\cite{fan2017generic} without \\ blur assumption}} } & \multicolumn{1}{ |c| }{PSNR} & 12.9 & - & 14.5 & 15.6 & \textbf{20.7} & 9.24 & - & - & 7.3 & \textbf{16.3} \\ \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c }{} & \multicolumn{1}{ |c| }{SSIM} & 0.37 & - & 0.45 & 0.50 & \textbf{0.62} & 0.07 & - & - & 0.11 & \textbf{0.37} \\ \cline{1-13} \end{tabular} \label{tab:psnr_ssim} \end{table*} \begin{figure}[!t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \centering \subfloat[Airfield and beach]{\includegraphics[width=0.8\linewidth]{train_ab_test_ac_synth_cvpr2}% \label{fig:test_ac}} \\ \subfloat[Beach and street]{\includegraphics[width=0.8\linewidth]{train_ab_test_cd_synth_cvpr2}% \label{fig:test_cd}} \\ \subfloat[Beach and hotel room]{\includegraphics[width=0.8\linewidth]{train_ab_test_cb_synth_cvpr2}% \label{fig:test_cb}} \\ \subfloat[Sky and hotel room]{\includegraphics[width=0.8\linewidth]{train_ab_test_db_synth_cvpr2}% \label{fig:test_db}} \caption{ The proposed network is trained on airfield and hotel room and then tested on other categories. % Other categories are completely not fed to the network during training. % } \label{fig:test_other} \end{figure} For training, networks shown in Figure~\ref{fig:nets}(b), Figure~\ref{fig:nets}(c), and Figure~\ref{fig:nets}(d) share weights of the first three layers in the generator. For each mini-batch, we first resize images into $256\times256$ pixels. A rectangular patch is cropped with a height and a width sampled from $[192, 256]$ uniformly at random. Then, it is resized to $128\times128$ pixels for training. For the blurring model, we pick $w\in[0.5,0.7]$ and $\sigma$ of the Gaussian kernel between $[2,5]$. More quantitative and qualitative results are presented in the supplementary material. The source code will be made available to the public. \subsection{Synthetic Images} \vspace{-2mm} In this section, we show reflection separation results using a network trained on synthetic data. We evaluate the proposed algorithm against the state-of-the-art methods \cite{fan2017generic, arvanitopoulos2017single, shih2015reflection}. As they use different approximation methods to model the reflection, we provide results for all cases. Figure \ref{fig:syn_results} shows reflection separation results when the clipping model \cite{fan2017generic} is used to synthesize images. We alternatively use the blur assumption for each row. In most cases, the proposed network in Figure~\ref{fig:nets}(c) successfully removes reflection artifacts on the transmitted scene and recovers the reflected scene reasonably. In contrast, other methods generate unclear images of transmitted scenes and barely recognizable reflected scenes. When the blurry assumption is not used, all other methods fail to suppress reflections. In addition, they are sensitive to the synthesis model. The results show that other methods are designed specifically based on their assumptions. On the other hand, the proposed algorithm performs favorably in all cases. Table~\ref{tab:psnr_ssim} shows that the proposed algorithm performs favorably against other methods quantitatively. A network trained with two categories is evaluated for different types of scenes. Figure~\ref{fig:test_other} shows the results when the proposed network is trained on airfield and hotel room categories and then tested on various scenes using the blurring model \cite{arvanitopoulos2017single}. When a category of the reflected scene is changed as shown in Figure~\ref{fig:test_other}(a), or both are changed as shown in Figure~\ref{fig:test_other}(b), the transmitted scene is well restored while the reflected scene is not realistic. On the other hand, when the transmitted scene is changed as shown in Figure~\ref{fig:test_other}(c) and Figure~\ref{fig:test_other}(d), both scenes are recovered properly. These results indicate that the transmission branch learns how to remove blurry regions and generate the image based on the context of sharp regions while the reflection branch focuses on recovering the original scene from a blurry observation. However, as presented in the supplementary material, the network is not able to separate reflections on real images. The state-of-the-art methods based on the same synthesis models also fail to separate reflections. The findings are consistent with the observation in \cite{wan2017benchmarking} that existing methods do not perform well on real images. In addition, we put randomness while synthesizing training images to increase the generalization ability of the network as mentioned before. We attribute this failure to a non-realistic synthesis model. The separation performance can be improved when a realistic synthesis model is given since the proposed network can be trained with any synthesis methods. \begin{figure}[t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \centering \includegraphics[width=0.9\linewidth]{airfield_hotelroom_unsup2.png} \caption{Sample results from unsupervised reflection separation for synthetic images. } \label{fig:unsup} \end{figure} \begin{figure*}[!t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \centering \subfloat[Input $y$]{\includegraphics[width=0.1\linewidth]{realinput}% \label{fig:real_input}} \hspace{0.1pt} \subfloat[\cite{arvanitopoulos2017single} $t$]{\includegraphics[width=0.1\linewidth]{realcvpr}% \label{fig:real_cvpr}} \hspace{0.1pt} \subfloat[\cite{fan2017generic} $t$]{\includegraphics[width=0.1\linewidth]{realiccv1}% \label{fig:real_iccv1}} \hspace{0.1pt} \subfloat[\cite{fan2017generic} $r$]{\includegraphics[width=0.1\linewidth]{realiccv2}% \label{fig:real_iccv2}} \hspace{0.1pt} \subfloat[$G_t(y)$]{\includegraphics[width=0.1\linewidth]{realg1}% \label{fig:real_g1}} \hspace{0.1pt} \subfloat[$G_r(y)$]{\includegraphics[width=0.1\linewidth]{realg2}% \label{fig:real_g2}} \hspace{0.1pt} \subfloat[$G_m(y)$]{\includegraphics[width=0.1\linewidth]{realmask}% \label{fig:real_mask}} \hspace{0.1pt} \subfloat[$G_{mt}(y)$]{\includegraphics[width=0.1\linewidth]{realg1mask}% \label{fig:real_g1mask}} \hspace{0.1pt} \subfloat[$G_{mr}(y)$]{\includegraphics[width=0.1\linewidth]{realg2mask}% \label{fig:real_g2mask}} \hfil \caption{ Single image reflection separation results on real images. % } \label{fig:real_results} \end{figure*} \begin{figure}[!t] \captionsetup[subfloat]{farskip=2pt,captionskip=1pt} \captionsetup[subfloat]{font=scriptsize,labelfont=scriptsize} \centering \subfloat[Input $y$]{\includegraphics[width=0.155\linewidth]{realinput_sim}% \label{fig:real_input}} \hspace{0.1pt} \subfloat[$G_t(y)$]{\includegraphics[width=0.155\linewidth]{realg1_sim}% \label{fig:real_g1}} \hspace{0.1pt} \subfloat[$G_r(y)$]{\includegraphics[width=0.155\linewidth]{realg2_sim}% \label{fig:real_g2}} \hspace{0.1pt} \subfloat[$G_m(y)$]{\includegraphics[width=0.155\linewidth]{realmask_sim}% \label{fig:real_mask}} \hspace{0.1pt} \subfloat[$G_{mt}(y)$]{\includegraphics[width=0.155\linewidth]{realg1mask_sim}% \label{fig:real_g1mask}} \hspace{0.1pt} \subfloat[$G_{mr}(y)$]{\includegraphics[width=0.155\linewidth]{realg2mask_sim}% \label{fig:real_g2mask}} \hfil \caption{ Different separation results for the same input image. % } \label{fig:real_results_sim} \end{figure} For a weakly supervised reflection separation, the training data is split into two halves. The first half is used to synthesize $y$ and the second half is fed to the discriminator as real images for training. Figure~\ref{fig:unsup} shows that the proposed algorithm separates a synthesized scene well without any ground truth images of transmission and reflection. \vspace{-1mm} \subsection{Real Images} \vspace{-2mm} Figure~\ref{fig:real_results} shows results corresponding to the network in Figure~\ref{fig:nets}(d) trained with real data in a weakly supervised manner. Input images contain not only sharp or blurry reflections but also spatially non-uniform reflection regions. For example, at the second row of Figure~\ref{fig:real_results}(a), most parts of cafe interiors are not visible. If reflections are simply suppressed, then the remaining transmitted scene would be dark and less informative. Moreover, it is incorrect to return a dark transmitted scene in this case since we can observe that lights of the cafe are turned on. Therefore, it is challenging to separate real input images as we need to infer invisible regions at the same time. As the issue is not handled in state-of-the-art methods, they rarely suppress or separate reflections as shown in Figure~\ref{fig:real_results}(b), Figure~\ref{fig:real_results}(c) and Figure~\ref{fig:real_results}(d). On the other hand, the proposed network can decompose an input image into two reasonable scenes. Figure~\ref{fig:real_results}(e) and Figure~\ref{fig:real_results}(f) show restored transmitted scene and reflected scene. The confidence map of a transmitted scene is shown in Figure~\ref{fig:real_results}(g). Figure~\ref{fig:real_results}(h) and Figure~\ref{fig:real_results}(i) are masked scenes for better visualization of the confidence map. Single image reflection separation is an underdetermined problem which has many solution candidates. In Figure~\ref{fig:real_results_sim}, we show separation results for the same input image using two different random seeds. For each pair, while networks capture similar parts for realistic separations, generated images are different regarding to structure and appearance of the scene. \vspace{-2mm} \section{Conclusions} \vspace{-2mm} We propose an algorithm for single image reflection separation problem. As it is an ill-posed problem, we assume that categories of transmission and reflection scenes are known. It allows us to remove conventional assumptions, such as the blurry reflected scene, that are not realistic in many cases. We design convolutional neural networks based on adversarial losses to separate an observed image into the transmitted scene and reflected scene by generating them. Experimental results show that the proposed algorithm performs favorably against the state-of-the-art methods, particularly for recovering reflected scenes. For synthetic images, the transmitted scene is reliably restored without knowing the type of two scenes. In addition, we demonstrate that the network can be trained in a weakly-supervised manner, i.e., the network is trained on real images only. {\small \bibliographystyle{ieee}
\section{Introduction}\label{sec:intro} Our methods of data acquisition are such that we often obtain information on an exhaustive collection of possible explanatory variables. We know a priori that a large proportion of these are irrelevant for our purposes, but in the effort to cover all bases, we gather data on all what we can measure and rely on subsequent analysis to identify the relevant variables. For instance, to achieve a better understanding of biological processes behind a disease, we may evaluate variation across the entire DNA sequence and collect single nucleotide polymorphism (SNP) information, or quantify the expression level of all genes, or consider a large panel of exposures, and so on. We then expect the statistician or the scientist to sort through all these and select those important variables that truly influence a response of interest. For example, we would like the statistician to tell us which of the many genetic variations affect the risk of a specific disease, or which of the many gene expression profiles help determine the severity of a tumor. This paper is about this variable selection problem. We consider situations where we have observations on a response $Y$ and a large collection of variables $X_1, \ldots, X_p$. With the goal of identifying the important variables, we want to recover the smallest set $\mathcal{S} \subseteq \{1, \ldots, p\}$ such that, conditionally on $\{X_j\}_{j \in \mathcal{S}}$, the response $Y$ is independent of all the remaining variables $\{X_j\}_{j\not\in \mathcal{S}}$. In the literature on graphical models, the set $\mathcal{S}$ would be called the {\em Markov blanket} of $Y$. Effectively, this means that the explanatory variables $X_1,\dots,X_p$ provide information about the outcome $Y$ only through the subset $\{X_j\}_{j \in \mathcal{S}}$. To ensure reproducibility, we are interested in methods that result in the estimation of a set $\widehat{\Scal}$ with false discovery rate (FDR) control \cite{BH95}, in the sense that \[\textnormal{FDR} = \EE{\frac{\#\{ j : j \in \widehat{\Scal} \setminus \mathcal{S}\}}{\#\{j: j \in \widehat{\Scal}\}}}\leq q, \] i.e.~a bound on the expected proportion of our discoveries $\widehat{\Scal}$ which are {\em not} in the smallest explanatory set $\mathcal{S}$.\footnote{As is standard in the FDR literature, in this expected value we treat $0/0$ as $0$, to incur no penalty in the event that no variables are selected, i.e.~when $\widehat{\Scal}=\emptyset$.} (Here $q$ is some predetermined target error rate, e.g.~$q=0.1$.) In truth, there are not many variable selection methods that would control the FDR with finite-sample guarantees, especially when the number $p$ of variables far exceeds the sample size $n$. That said, one solution is provided by the recent model-X knockoffs approach of \citet{candes2016panning}, which is a new read on the earlier knockoff filter of \citet{barber2015}, see also \cite{barber2016}. One singular aspect of the method of model-X knockoffs is that it makes assumptions that are substantially different from those commonly encountered in the statistical literature. Most of the model selection literature relies on a specification of the model that links together the response and the covariates, making assumptions on $P_{Y\mid X}$, the distribution of $Y$ conditional on $X$---for instance, assuming that the form of this distribution follows a generalized linear model or some other parametrized model. In contrast, model-X knockoffs makes no assumption whatsoever on the relation between the response $Y$ and the variables $X = (X_1, \ldots, X_p)$; in other words, the distribution $P_{Y\mid X}$ of $Y$ conditional on $X$ is ``model free''. The price of this generality is that we need to be able to specify the distribution of the feature variables $X = (X_1, \ldots, X_p)$, which we denote by $P_X$. As argued in \cite{candes2016panning} and \cite{JansonPhD}, this ``shift'' of the burden of knowledge is interesting because we must recall that the object of inference is on how $Y$ relates to $X$, that is, on $P_{Y\mid X}$. It is, therefore, a strong premise to posit the form of this relationship $P_{Y\mid X}$ a priori---and indeed, there are many applications in which we objectively do not have any understanding of how $Y$ depends on $X$. Further, the shift is also appropriate whenever we know much more about the distribution of $X$ than on the conditional distribution of $Y \, | \, X$. For instance, it is easy to imagine applications in which we have many unlabeled samples---samples of $X$---whereas it may be much harder to acquire labeled data or samples with a given value of the response $Y$. A typical example is offered by genetic studies, where we now have available hundreds of thousands or even millions of genotypes across many different populations. At the same time, it may be difficult to recruit patients with a given phenotype (the response variable $Y$), and therefore, we have substantially more data with which to estimate $P_X$ than $P_{Y\mid X}$. The ease with which we can gather information about $X$ does not imply that we know the distribution $P_X$ exactly, but we often do have substantial information about this distribution. Returning to our genetic example, it has been shown that the joint distribution of SNPs may be accurately modeled by hidden Markov models (see \cite{SetD01,ZetS02,QetL02,Li2003} for some early formulations), and there certainly is an abundance of genotype data to estimate the various model parameters; compare for instance the success of a variety of methods for genotype imputation \cite{MH10, HetA12} based on such models. The purpose of this paper, then, is precisely to investigate common situations of this kind, namely, what happens when we run model-X knockoffs and only assume {\em some} knowledge of the distribution of $X$ rather than exact knowledge. Our contribution is a considerable extension of the original work on model-X knockoffs \cite{candes2016panning}, which assumed a perfect knowledge of the distribution of $X$ to achieve FDR control. Here, we develop a new theory, which quantifies very precisely the inflation in FDR when running the knockoff filter with estimates of the distribution of $X$ in place of the true distribution $P_X$. We develop non-asymptotic bounds which show that the possible FDR inflation is well-behaved whenever the estimated distribution is reasonably close to the truth. These bounds are general and apply to all possible statistics that the researcher may want to use to tease out the signal from the noise. We also develop converse results for some settings, showing that our bounds are fairly sharp in that it is impossible to obtain tighter FDR control bounds in full generality. Thus, our theory offers finite-sample guarantees that hold for any algorithm that the analyst decides to employ, assuming no knowledge of the form of the relationship between $Y$ and $X$ and only an estimate of the distribution of $X$ itself. On the other hand, since our bounds are worst-case, they may be pessimistic in the sense that the realized FDR in any practical situation may be much lower than that achieved in the worst possible case. Underlying our novel model-X knockoffs theory is a completely new mathematical analysis and understanding of the knockoffs inferential machine. The technical innovation here is essentially twofold. First, with only partial knowledge of the distribution of $X$, we can no longer achieve a perfect exchangeability between the test statistics for the null variables and for their knockoffs. Hence, we need tools that can deal with only a form of approximate exchangeability. Second, our methods to prove FDR control no longer rely on martingale arguments, and rather, involve leave-one-out type of arguments. These new arguments are likely to have applications far outside the scope of the present paper. \section{Robust inference with knockoffs} To begin with, imagine we have data consisting of $n$ \iid~draws from a joint distribution on $(X,Y)$, where $X = (X_1, \ldots, X_p) \in\mathbb{R}^p$ is the feature vector while $Y\in\mathbb{R}$ is the response variable. We will gather the $n$ observed data points into a matrix $\mathbf{X}\in\mathbb{R}^{n\times p}$ and vector $\mathbf{Y}\in\mathbb{R}^n$---that is, the pairs $(\mathbf{X}_{i,*},\mathbf{Y}_i)$ are \iid~copies of the pair $(X,Y)$. The joint distribution of $(X,Y)$ is unknown---specifically, we do not assume any information about the conditional distribution of $Y$ given $X$ as discussed above. We work under the assumption that $P_X$, the marginal distribution of $X$, is known only approximately. Since the Markov blanket of $Y$ may be ill-defined (e.g.~if two features are identical then the choice of the minimal set $\mathcal{S}$ may not be unique), we follow \cite{candes2016panning} and define $X_j$ to be a null variable if $X_j\independent Y\mid X_{-j}$, that is if $X_j$ is independent from the response $Y$ conditionally on all the other variables. (We use the terms ``features'' and ``variables'' interchangeably.) Under very mild identifiability conditions, the set of non-nulls is nothing other than the Markov blanket of $Y$. Writing $\mathcal{H}_0$ to denote the set of indices corresponding to null variables, we can then reformulate the error we would like to control as $\EE{|\widehat{\Scal}\cap \mathcal{H}_0| / |\widehat{\Scal}|} \leq q.$ \subsection{Exact model-X knockoffs} \label{sec:exact} Consider first an ideal setting where the distribution $P_X$ is known. The model-X knockoffs method~\cite{candes2016panning} is defined by constructing knockoff features satisfying the following conditions. $\widetilde{X}$ is drawn conditional on the feature vector $X$ without looking at the response $Y$ (i.e.~$\widetilde{X}\independent Y\mid X$), such that the joint distribution of $(X,\widetilde{X})$ satisfies a pairwise exchangeability condition, \begin{equation}\label{eqn:swap_distribution}(X,\, \widetilde{X})_{\swap({\mathcal{A}})} \stackrel{\textnormal{d}}{=} (X,\, \widetilde{X})\end{equation} for any subset ${\mathcal{A}}\subseteq\{1,\dots,p\}$, where $\stackrel{\textnormal{d}}{=}$ denotes equality in distribution. (In fact, to achieve FDR control, this condition only needs to hold for subsets ${\mathcal{A}}\subseteq\mathcal{H}_0$ containing only null variables.) Above, the family $(X, \, \widetilde{X})_{\swap({\mathcal{A}})}$ is obtained from $(X, \, \widetilde{X})$ by swapping the entries $X_j$ and $\widetilde{X}_j$ for each $j\in {\mathcal{A}}$; for example, with $p = 3$ and ${\mathcal{A}} = \{2,3\}$, \[ (X_1, X_2, X_3, \widetilde{X}_1, \widetilde{X}_2, \widetilde{X}_3) _{\swap{(\{2,3\})}} \, = \, (X_1, \widetilde{X}_2, \widetilde{X}_3, \widetilde{X}_1, X_2, X_3). \] As a consequence of the pairwise exchangeability property~\eqnref{swap_distribution}, we see that the null knockoff variables $\{\widetilde{X}_j\}_{j \in \mathcal{H}_0}$ are distributed in exactly the same way as the original nulls $\{X_j\}_{j \in \mathcal{H}_0}$ but some dependence is preserved: for instance, for any pair $j\neq k$ where $k$ is a null, we have that $(X_j, \widetilde{X}_k) \stackrel{\textnormal{d}}{=} (X_j, X_k)$. Given knowledge of the true distribution $P_X$ of the features $X$, our first step to implement the method of model-X knockoffs is to construct a distribution for drawing $\widetilde{X}$ conditional on $X$ such that the pairwise exchangeability property~\eqnref{swap_distribution} holds for all subsets of features ${\mathcal{A}}$. We can think of this mechanism as constructing some probability distribution $P_{\widetilde{X}\mid X}(\cdot|x)$, which is a conditional distribution of $\widetilde{X}$ given $X=x$, chosen so that the resulting joint distribution of $(X,\widetilde{X})$, which is equal to \[P_X(x) \, P_{\widetilde{X}\mid X}(\widetilde{x} | x),\] is symmetric in the pairs $(x_j,\widetilde{x}_j)$, and thus will satisfy the exchangeability property~\eqnref{swap_distribution}. Now, when working with data $(\mathbf{X},\mathbf{Y})$, we will treat each data point $(\mathbf{X}_{i,*},\mathbf{Y}_i)$ independently. Specifically, after observing the data $(\mathbf{X},\mathbf{Y})\in\mathbb{R}^{n\times p}\times \mathbb{R}^n$, the rows $\widetilde{\X}_{i,*}$ of the knockoff matrix are drawn from $P_{\widetilde{X}\mid X}(\cdot|\mathbf{X}_{i,*})$, independently for each $i$ and also independently of $\mathbf{Y}$. \figref{knockoff-mechanism-exact} shows a schematic representation of the exact model-X knockoffs construction. \begin{figure}[t] \begin{tikzpicture} \node (inputconditionals) at (0,10) {\begin{tabular}{@{}c@{}}Input: conditional distributions \\$P_j$, for $j=1,\dots,p$\end{tabular}}; \node (mechanism) at (0,8) [rectangle, rounded corners, text centered, draw=blue, fill=blue!10, thick] {\begin{tabular}{@{}c@{}}Mechanism\\ for producing\\ knockoff distribution\end{tabular}}; \node (outputPt) at (0,6) {\begin{tabular}{@{}c@{}}Output: distribution $P_{\widetilde{X}\mid X}$\\ for generating knockoffs\end{tabular}}; \draw[-latex] (inputconditionals.south) to (mechanism.north); \draw[-latex] (mechanism.south) to (outputPt.north); \draw[rounded corners,dashed] (-2.3,5) rectangle (2.3,11) node[above] at (0,11) {Distribution}; \node (data) at (5.25,10) {Input: features $\mathbf{X}_{i,*}\sim P_X$}; \node (usePt) at (5.25,8) [rectangle, rounded corners, text centered, draw=blue, fill=blue!10, thick] {Distribution $P_{\widetilde{X}\mid X}(\cdot|\mathbf{X}_{i,*})$}; \node (knockoffs) at (5.25,6) {\begin{tabular}{@{}c@{}}Output: knockoffs\\ $\widetilde{\X}_{i,*}\mid \mathbf{X}_{i,*} \sim P_{\widetilde{X}\mid X}(\cdot | \mathbf{X}_{i,*})$\end{tabular}}; \draw[-latex] (data.south) to (usePt.north); \draw[-latex] (usePt.south) to (knockoffs.north); \draw[rounded corners,dashed] (2.9,5) rectangle (7.65,11) node[above] at (5.25,11) {Data \ ($i=1,2,\dots,n$)}; \node (pairwise) at (11,8) {\begin{tabular}{@{}c@{}}$(\mathbf{X}_{ij},\widetilde{\X}_{ij},\mathbf{X}_{i,-j},\widetilde{\X}_{i,-j})$\\ satisfies exact pairwise\\ exchangeability~\eqnref{swap_j_only}.\end{tabular}}; \draw[-latex,thick] (outputPt.east) to [in=180,out=0] (usePt.west); \draw[-latex,thick] (data.east) to [in=180,out=0] ($(pairwise.west)!0.15!(pairwise.north west)$); \draw[-latex,thick] (knockoffs.east) to [in=180,out=0] ($(pairwise.west)!0.15!(pairwise.south west)$); \end{tikzpicture} \caption{Schematic representation of the exact model-X knockoffs construction. } \label{fig:knockoff-mechanism-exact} \end{figure} It is important to point out that mechanisms for producing the pairwise exchangeability property~\eqnref{swap_distribution} do exist and can be very concrete: \citet{candes2016panning} develop a general abstract mechanism termed the Sequential Conditional Independent Pairs (SCIP) ``algorithm'', which always produces exchangeable knockoff copies and can be applied to any distribution $P_X$. There are also fast algorithms for the case where $X$ follows either a Markov or a hidden Markov model \cite{sesia2017gene}, and simple algorithms for sampling knockoff copies of Gaussian features \cite{candes2016panning}. Looking ahead, all of these algorithms can be used in the case where $P_X$ is known only approximately, where the exchangeability property~\eqnref{swap_distribution} will be required to hold only with reference to the {\em estimated} distribution of $X$, discussed in \secref{approximate} below. For assessing a model selection algorithm, the knockoff feature vectors $\widetilde{\X}_j$ can be used as a ``negative control''---a control group for testing the algorithm's ability to screen out false positives, since $\widetilde{\X}_j$ is known to have no real effect on $\mathbf{Y}$. Although details are given in \secref{filter_Wjs}, it is helpful to build some intuition already at this stage. Imagine for simplicity that we wish to assess the importance of a variable by measuring the strength of the marginal correlation with the response, i.e.~we compute $Z_j = \big|\mathbf{X}_j^\top \mathbf{Y}\big|$. Then we can compare $Z_j$ with $\widetilde{Z}_j = \big|\widetilde{\X}_j^\top \mathbf{Y}\big|$, the marginal correlation for the corresponding knockoff variable. The crucial point is that the pairwise exchangeability property~\eqnref{swap_distribution} implies that if $j$ is null (recall that this means that $X_j$ and $Y$ are conditionally independent), then \[ (Z_j, \, \widetilde{Z}_j) \stackrel{\textnormal{d}}{=} (\widetilde{Z}_j, \, Z_j). \] This holds without any assumptions on the form of the relationship $P_{Y\mid X}$ between $Y$ and $X$ \cite{candes2016panning}. In particular, this means that the test statistic $W_j = Z_j - \widetilde{Z}_j$ is equally likely to be positive or negative. Thus to reject the null, we would need to observe a large positive value of $W_j$. As we will see in \secref{filter_Wjs}, this way of reasoning extends to any choice of statistic $Z_j$; whatever statistic we choose, knockoff variables obeying~\eqnref{swap_distribution} offer corresponding values of the statistic which can be used as ``negative controls'' for calibration purposes. Throughout this paper, we will pay close attention to the distribution we obtain when swapping only one variable and its knockoff (and do not swap any of the other variables). In this context, we can reformulate the broad exchangeability condition~\eqnref{swap_distribution} in terms of single variable swaps. \begin{proposition}[{\citet[Prop.~3.5]{candes2016panning}}]\label{prop:swap_j_only} The pairwise exchangeability property~\eqnref{swap_distribution} holds for a subset ${\mathcal{A}}\subseteq\{1,\dots,p\}$ if and only if \begin{equation}\label{eqn:swap_j_only} \big(X_j,\widetilde{X}_j,X_{-j},\widetilde{X}_{-j}\big) \stackrel{\textnormal{d}}{=} \big(\widetilde{X}_j,X_j,X_{-j},\widetilde{X}_{-j}\big) \end{equation} holds for all $j\in {\mathcal{A}}$. \end{proposition} \noindent In other words, we can restrict our attention to the question of whether a single given feature $X_j$ and its knockoff $\widetilde{X}_j$ are exchangeable with each other (in the joint distribution that also includes $X_{-j}$ and $\widetilde{X}_{-j}$). \subsection{Approximate model-X knockoffs and pairwise exchangeability} \label{sec:approximate} Now we will work towards constructing a version of this method when the true distribution $P_X$ of the feature vector $X$ is not known exactly. Here, we need to relax the pairwise exchangeability assumption, since choosing a useful mechanism $P_{\widetilde{X}\mid X}$ that satisfies this condition would generally require a very detailed knowledge of $P_X$, which is typically not available. This section builds towards \defref{exch_Qj} in two steps. \subsubsection{Exchangeabilty with respect to an input distribution $Q_X$} We are provided with data $\mathbf{X}$ and conditional distributions $Q_j(\cdot | x_{-j})$ for each $j$. We assume that the $Q_j$'s are fixed, i.e.~do not depend on the data set $(\mathbf{X},\mathbf{Y})$. As a warm-up, assume first that these conditionals are mutually compatible in the sense that there is a joint distribution $Q_X$ over $\mathbb{R}^p$ that matches these $p$ estimated conditionals---we will relax this assumption very soon. Then as shown in~\figref{knockoff-mechanism-approx}, we repeat the construction from~\figref{knockoff-mechanism-exact}, only with the $Q_j$'s as inputs. In words, the algorithm constructs knockoffs, which are samples from $P_{\widetilde{X}\mid X}$, a conditional distribution whose construction is based on the conditionals $Q_j$ or, equivalently, the joint distribution $Q_X$. In place of requiring that pairwise exchangeability of the features $X_j$ and their knockoffs $\widetilde{X}_j$ holds relative to the true distribution $P_X$ as in~\eqnref{swap_distribution} and~\eqnref{swap_j_only}, we instead require that the knockoff construction mechanism satisfy pairwise exchangeability conditions relative to the joint distribution $Q_X$ that it receives as input: \begin{equation}\label{eqn:swap_all_approx} \begin{aligned} \text{If $(X,\widetilde{X})$ is drawn as $X\sim Q_X$} \text{ and $\widetilde{X}\mid X \sim P_{\widetilde{X}\mid X}(\cdot|X)$, then}\\ (X,\, \widetilde{X})_{\swap({\mathcal{A}})} \stackrel{\textnormal{d}}{=} (X,\, \widetilde{X}), \quad \text{for any subset ${\mathcal{A}}\subseteq\{1,\dots,p\}$}. \end{aligned} \end{equation} When only estimated compatible conditionals are available, original and knockoff features are required to be exchangeable with respect to the distribution $Q_X$, which is provided as input (but not with respect to the true distribution of $X$, which is unknown). To rephrase, if the distribution of $X$ were in fact equal to $Q_X$, then we would have exchangeability. \subsubsection{Exchangeability with respect to potentially incompatible conditionals $Q_j$} We wish to provide an extension of \eqnref{swap_all_approx} to cover the case where the conditionals may not be compatible; that is, when a joint distribution with the $Q_j$'s as conditionals may not exist. To understand why this is of interest, imagine we have unlabeled data that we can use to estimate the distribution of $X$. Then we may construct $Q_j$ by regressing the $j$th feature $X_j$ onto the $p-1$ remaining features $X_{-j}$. For instance, we may use a regression technique promoting sparsity or some other assumed structure. In such a case, it is easy to imagine that such a strategy may produce incompatible conditionals. It is, therefore, important to develop a framework adapted to this setting. To address this, we shall work throughout the paper with the following definition: \begin{definition}\label{def:exch_Qj} $P_{\widetilde{X}\mid X}$ is {\em pairwise exchangeable with respect to $Q_j$} if it satisfies the following property: \begin{equation}\label{eqn:swap_j_only_approx} \begin{aligned} \text{For any distribution $D^{(j)}$ on $\mathbb{R}^p$ with $j$th conditional $Q_j$, if $(X,\widetilde{X})$ is drawn as $X\sim D^{(j)}$}\\ \text{and $\widetilde{X}\mid X \sim P_{\widetilde{X}\mid X}(\cdot|X)$, then } \big(X_j,\widetilde{X}_j,X_{-j},\widetilde{X}_{-j}\big) \stackrel{\textnormal{d}}{=} \big(\widetilde{X}_j,X_j,X_{-j},\widetilde{X}_{-j}\big). \end{aligned} \end{equation} Above, $D^{(j)}$ is the product of an arbitrary marginal distribution for $X_{-j}$ and of the conditional $Q_j$. \end{definition} \noindent In words, with estimated conditionals $Q_j$, we choose $P_{\widetilde{X}\mid X}$ to satisfy pairwise exchangeability with respect to these $Q_j$'s, for every $j$. (As before, we remark that this only needs to hold for $j\in\mathcal{H}_0$ to ensure FDR control, but since in practice we do not know which features are null, we require~\eqnref{swap_j_only_approx} to hold for every $j$.) To see why this is an extension of \eqnref{swap_all_approx}, note that if the $Q_j$'s are mutually compatible, then any algorithm operating such that~\eqnref{swap_j_only_approx} holds for each $j$, obeys \eqnref{swap_all_approx} as well. In particular, in the exact model-X framework setting where~\eqnref{swap_distribution} is satisfied, \propref{swap_j_only} implies that the distribution $P_{\widetilde{X}\mid X}$ is pairwise exchangeable with respect to $P_j$, i.e.~with respect to the true conditional distribution of $X_j$, for each $j$. \begin{figure}[t] \begin{tikzpicture} \node (inputconditionals) at (0,10) [rectangle, rounded corners, thick, text centered,draw=red] {\begin{tabular}{c}Input: conditional distributions \\$Q_j$, for $j=1,\dots,p$\end{tabular}}; \node (mechanism) at (0,8) [rectangle, rounded corners, text centered, draw=blue, fill=blue!10, thick] {\begin{tabular}{@{}c@{}}Mechanism\\ for producing\\ knockoff distribution\end{tabular}}; \node (outputPt) at (0,6) {\begin{tabular}{@{}c@{}}Output: distribution $P_{\widetilde{X}\mid X}$\\ for generating knockoffs\end{tabular}}; \draw[-latex] (inputconditionals.south) to (mechanism.north); \draw[-latex] (mechanism.south) to (outputPt.north); \draw[rounded corners,dashed] (-2.3,5) rectangle (2.3,11) node[above] at (0,11) {Distribution}; \node (data) at (5.25,10) {Input: features $\mathbf{X}_{i,*}\sim P_X$}; \node (usePt) at (5.25,8) [rectangle, rounded corners, text centered, draw=blue, fill=blue!10, thick] {Distribution $P_{\widetilde{X}\mid X}(\cdot|\mathbf{X}_{i,*})$}; \node (knockoffs) at (5.25,6) {\begin{tabular}{@{}c@{}}Output: knockoffs\\ $\widetilde{\X}_{i,*}\mid \mathbf{X}_{i,*} \sim P_{\widetilde{X}\mid X}(\cdot | \mathbf{X}_{i,*})$\end{tabular}}; \draw[-latex] (data.south) to (usePt.north); \draw[-latex] (usePt.south) to (knockoffs.north); \draw[rounded corners,dashed] (2.9,5) rectangle (7.65,11) node[above] at (5.25,11) {Data \ ($i=1,2,\dots,n$)}; \node (pairwise) at (11,8) [rectangle, rounded corners, thick, text centered,draw=red] {\begin{tabular}{@{}c@{}} $(\mathbf{X}_{ij},\widetilde{\X}_{ij},\mathbf{X}_{i,-j},\widetilde{\X}_{i,-j})$\\ satisfies pairwise exchangeability\\ with respect to $Q_j$~\eqnref{swap_j_only_approx}.\medskip\\ Approximately satisfies~\eqnref{swap_j_only}\\ if $P_j\approx Q_j$ (see \lemref{approx_pairwise}).\end{tabular}}; \draw[-latex,thick] (outputPt.east) to [in=180,out=0] (usePt.west); \draw[-latex,thick] (data.east) to [in=180,out=0] ($(pairwise.west)!0.15!(pairwise.north west)$); \draw[-latex,thick] (knockoffs.east) to [in=180,out=0] ($(pairwise.west)!0.15!(pairwise.south west)$); \end{tikzpicture} \caption{Schematic representation of the approximate model-X knockoffs construction. The two differences relative to \figref{knockoff-mechanism-exact} are circled in red.} \label{fig:knockoff-mechanism-approx} \end{figure} As far as generating knockoff copies obeying~\eqnref{swap_j_only_approx}, imagine we have a mechanism, which, when we input the distribution $P_X$ of $X$, will produce exchangeable knockoffs obeying~\eqnref{swap_distribution}. Supposing that the estimated conditionals $Q_j$ are all compatible with some joint distribution $Q_X$ on $X$, then if we instead provide $Q_X$ as input to this mechanism, it instead produces knockoff copies with the desired property. Hence, if the $Q_j$'s are mutually compatible, then all the mechanisms producing valid knockoffs under exact knowledge of $P_X$---we mentioned a few in the previous section---can be readily used for our purposes. Later in \secref{examples}, we will also give an example of a mechanism producing valid knockoffs satisfying~\eqnref{swap_j_only_approx} under incompatible $Q_j$'s. From this point on, we will assume without comment that for each $j$, either $X_j$ and $\widetilde{X}_j$ are both discrete variables or are both continuous variables, and abusing notation, in these two settings we will use $P_j(\cdot|x_{-j})$ and $Q_j(\cdot|x_{-j})$ to denote the conditional probability mass function or conditional density, respectively, for the true and estimated conditional distribution of $X_j$ given $X_{-j}=x_{-j}$. Furthermore, we assume that $P_j(\cdot|x_{-j})$ and $Q_j(\cdot|x_{-j})$ are supported on the same (discrete or continuous) set for any $x_{-j}$. Our theory can be generalized to the setting of mixed distributions and/or varying supports, but for clarity of the results we do not present these generalizations here. The construction of the knockoff features as in \figref{knockoff-mechanism-approx} yields the following approximate pairwise exchangeability result. \begin{lemma}\label{lem:approx_pairwise} Fix any feature index $j$ such that pairwise exchangeability with respect to $Q_j$~\eqnref{swap_j_only_approx} is satisfied. If $X_j,\widetilde{X}_j$ are discrete, then for any\footnote{Formally, this result holds only for $a,b$ lying in the support of $P_j (\cdot | X_{-j})$, which is assumed to be equal to the support of $Q_j (\cdot | X_{-j})$, as otherwise the ratio is $0/0$; we ignore this possibility here and throughout the paper since these results will be applied only in settings where $a,b$ do lie in this support.} $a,b$, \[\frac{\PPst{X_j = a,\widetilde{X}_j = b}{X_{-j},\widetilde{X}_{-j}}}{\PPst{X_j = b,\widetilde{X}_j = a}{X_{-j},\widetilde{X}_{-j}}} = \frac{P_j (a | X_{-j})Q_j(b | X_{-j})}{Q_j(a | X_{-j}) P_j (b | X_{-j})}.\] Furthermore, if index $j$ corresponds to a null feature (i.e.~$X_j\independent Y\mid X_{-j}$) and we additionally assume that $\widetilde{X}\mid X$ is drawn from $P_{\widetilde{X}\mid X}$ independently of $Y$, then the same result holds when we also condition on $Y$: \[\frac{\PPst{X_j = a,\widetilde{X}_j = b}{X_{-j},\widetilde{X}_{-j},Y}}{\PPst{X_j = b,\widetilde{X}_j = a}{X_{-j},\widetilde{X}_{-j},Y}} = \frac{P_j (a | X_{-j})Q_j(b | X_{-j})}{Q_j(a | X_{-j}) P_j (b | X_{-j})}.\] The conclusion in the continuous case is identical except with ratios of probabilities replaced with ratios of densities. \end{lemma} This lemma gives a useful formula for computing the ratio between the likelihoods of the two configurations $(X_j,\widetilde{X}_j)=(a,b)$ and $(X_j,\widetilde{X}_j)=(b,a)$ (after conditioning on the remaining data). It is important to observe that if we are working in the exact model-X framework, where $Q_j = P_j$, in this case the lemma yields \[\frac{\PPst{X_j = a,\widetilde{X}_j = b}{X_{-j},\widetilde{X}_{-j},Y}}{\PPst{X_j = b,\widetilde{X}_j = a}{X_{-j},\widetilde{X}_{-j},Y}} = 1\] for each null $j$; that is, the two configurations are equally likely. This result for the exact model-X setting is proved in~\citet[Lemma 3.2]{candes2016panning} and is critical for establishing FDR control properties. To see why this is so, let us return to our marginal correlation example from \secref{exact}. In the exact model-X setting, we see from the above display that for a null feature, the variables $X_j$ and $\widetilde{X}_j$ are exchangeable conditionally on everything else, namely, on $X_{-j}$, $\widetilde{X}_{-j}$, and $Y$. Likewise, $\mathbf{X}_j$ and $\widetilde{\X}_j$ (the two columns of the data matrix) are also conditionally exchangeable. This implies that $\big|\mathbf{X}_j^\top \mathbf{Y}\big|$ and $\big|\widetilde{\X}_j^\top \mathbf{Y}\big|$ are conditionally exchangeable as well and, therefore, marginally exchangeable as we claimed. When we use estimates $Q_j$ rather than the true conditionals $P_j$, however, this property is no longer true, since \lemref{approx_pairwise} shows that the ratio is no longer equal to $1$ in general. We can no longer use the knockoff statistics as exact negative controls; only as approximate controls. This is where the major difficulty comes in: if a knockoff statistic is only approximately distributed like its corresponding null, what is the potential inflation of the type-I error that this could cause? \subsection{The knockoff filter}\label{sec:filter_Wjs} After constructing the variables $\widetilde{\X}_j$, we apply the knockoff filter to select important variables. We here quickly rehearse the main ingredients of this filter and refer the reader to \cite{barber2015} and \cite{candes2016panning} for additional details; our exposition borrows from \cite{barber2016}. Suppose that for each variable $\mathbf{X}_j$ (resp.~each knockoff variable $\widetilde{\X}_j$), we compute a score statistic $Z_j$ (resp.~$\widetilde{Z}_j$), \begin{equation*} \label{eq:Z} (Z_1, \ldots, Z_p, \widetilde{Z}_1, \ldots, \widetilde{Z}_{p}) = z\big([\mathbf{X}, \, \widetilde{\X}], \, \mathbf{Y}\big), \end{equation*} with the idea that $Z_j$ (resp.~$\widetilde{Z}_{j}$) measures the importance of $X_j$ (resp.~$\widetilde{X}_j$) in explaining $Y$. Assume that the scores are ``knockoff agnostic'' in the sense that {switching} a variable with its knockoff simply {switches} the components of $Z$ in the same way. This means that \begin{equation}\label{eqn:swap_z} z\big([\mathbf{X}, \, \widetilde{\X}]_{\swap({\mathcal{A}})}, \, \mathbf{Y}\big) = z\big([\mathbf{X}, \, \widetilde{\X}], \, \mathbf{Y}\big) _{\swap({\mathcal{A}})},\end{equation} i.e.~swapping $X_1$ and $\widetilde{X}_1$ before calculating $Z$ has the effect of swapping $Z_1$ and $\widetilde{Z}_1$, and similarly swapping $X_2$ and $\widetilde{X}_2$ swaps $Z_2$ and $\widetilde{Z}_2$, and so on. Here, we emphasize that $Z_j$ may be an arbitrarily complicated statistic. For instance, it can be defined as the absolute value of a lasso coefficient, or some random forest feature importance statistic; or, we may fit both a lasso model and a random forest, and choose whichever one has the lowest cross-validated error. These scores are then combined in a single importance statistic for the variable $X_j$ as \begin{equation*} \label{eq:W} W_j = f_j(Z_j, \widetilde{Z}_j) \eqqcolon w_j\big([\mathbf{X}, \, \widetilde{\X}], \, \mathbf{Y}\big), \end{equation*} where $f_j$ is any anti-symmetric function, meaning that $f_j(v,u) = - f_j(u,v)$. As an example, we may have $W_j = Z_j - \widetilde{Z}_j$, where the $Z_j$'s and $\widetilde{Z}_j$'s are the magnitudes of regression coefficients estimated by the lasso at a value of the regularization parameter given by cross-validation, say. Again, any choice of anti-symmetric function $f_j$ and score statistic $Z_j$, no matter how complicated, is allowed. By definition, the statistics $W_j$ obey the {\em flip-sign property}, which says that swapping the $j$th variable with its knockoff has the effect of changing the sign of $W_j$ (since, by~\eqnref{swap_z} above, if we swap feature vectors $\mathbf{X}_j$ and $\widetilde{\X}_j$ then $Z_j$ and $\widetilde{Z}_{j}$ get swapped): \begin{equation} \label{eq:antisymmetry} w_j\big([\mathbf{X}, \, \widetilde{\X}]_{\swap({\mathcal{A}})}, \, \mathbf{Y}\big) = \begin{cases} w_j\big([\mathbf{X}, \, \widetilde{\X}],\mathbf{Y}\big), & j\not\in {\mathcal{A}},\\ - w_j\big([\mathbf{X}, \, \widetilde{\X}],\mathbf{Y}\big), & j\in {\mathcal{A}}. \end{cases} \end{equation} The $W_j$'s are the statistics that the knockoff filter will use. The idea is that large positive values of $W_j$ provide evidence against the hypothesis that the distribution of $Y$ is conditionally independent of $X_j$, while in contrast, if $j\in\mathcal{H}_0$, then $W_j$ has a symmetric distribution and, therefore, is equally likely to take on positive or negative values. In fact, it is equally valid for us to define $W_j=w_j\big([\mathbf{X}, \, \widetilde{\X}],\mathbf{Y}\big)$ for any function $w_j$ satisfying the flip-sign property~\eqnref{swap_z}, without passing through the intermediate stage of defining $Z_j$'s and $\widetilde{Z}_j$'s, and from this point on we do not refer to the feature importance scores $Z_j,\widetilde{Z}_j$ in our theoretical results. However, for better understanding of the intuition behind the method, we should continue to think of $W_j$ as comparing the apparent importance of the feature $\mathbf{X}_j$ versus its knockoff $\widetilde{\X}_j$ for modeling the response $\mathbf{Y}$. Now that we have test statistics for each variable, we need a selection rule. For the knockoff filter, we choose a threshold $T_0>0$ by setting\footnote{We want $T_0$ to be positive and the formal definition is that the minimum in \eqnref{knockoff_stoppingtime} is taken over all $t>0$ taking on values in the set $\{|W_1|, \ldots, |W_p|\}$.} \begin{equation}\label{eqn:knockoff_stoppingtime} T_0 = \min\left\{t > 0 : \frac{\#\{j: W_j \leq - t\}}{\#\{j: W_j\geq t\}} \leq q \right\}\;, \end{equation} where $q$ is the target FDR level. The output of the procedure is the selected model $ \widehat{\Scal} = \{j : W_j \geq T_0\}.$ In \cite{barber2015}, it is argued that the ratio appearing in the right-hand side of \eqref{eqn:knockoff_stoppingtime} is an estimate of the false discovery proportion (FDP) if we were to use the threshold $t$---this is true because $\PP{W_j\geq t} = \PP{W_j\leq -t}$ for any null feature $j\in\mathcal{H}_0$, and so we would roughly expect \begin{equation}\label{eqn:fdphat_intuition} \begin{aligned} \text{(\# false positives at threshold $t$)} = \#\{j\in\mathcal{H}_0: W_j \geq t\} & \approx \#\{j\in\mathcal{H}_0 : W_j \leq - t\}\\ & \leq \#\{j: W_j \leq - t\},\end{aligned} \end{equation} that is, the numerator in~\eqnref{knockoff_stoppingtime} is an (over)estimate of the number of false positives selected at the threshold $t$. Hence, the selection rule can be interpreted as a step-up rule stopping the first time our estimate falls below our target level. A slightly more conservative procedure, the knockoff+ filter, is given by incrementing the number of negatives by one, replacing the threshold in~\eqnref{knockoff_stoppingtime} with the choice \begin{equation} \label{eqn:knockoffplus_stoppingtime} T_+ = \min\left\{t > 0 : \frac{1+\#\{j: W_j \leq - t\}}{\#\{j: W_j\geq t\}} \leq q \right\}\;, \end{equation} and setting $\widehat{\Scal} = \{j: W_j\geq T_+\}$. Formalizing the intuition of our rough calculation~\eqnref{fdphat_intuition}, the false discovery rate control properties of these two procedures are studied in~\cite{barber2015} under an exact pairwise exchangeability setting. \section{FDR control results} \subsection{Measuring errors in the distribution} If the knockoff features are generated using a mechanism designed to mimic the estimated conditionals $Q_j$ rather than the true conditional distributions $P_j $, when can we hope for error control? Intuitively, if the conditional distributions $P_j $ and $Q_j$ are similar, then we might hope that the knockoff feature $\widetilde{\X}_j$ is a reasonably good control group for the original feature $\mathbf{X}_j$. In order to quantify this, we begin by measuring the discrepancy between the true conditional $P_j$ and its estimate $Q_j$. Define the random variable \begin{equation}\label{eqn:klj_define} \widehat{\textnormal{KL}}_j\coloneqq \sum_i \log\left(\frac{P_j (\mathbf{X}_{ij}|\mathbf{X}_{i,-j})\cdot Q_j(\widetilde{\X}_{ij}|\mathbf{X}_{i,-j})}{Q_j(\mathbf{X}_{ij}|\mathbf{X}_{i,-j})\cdot P_j (\widetilde{\X}_{ij}|\mathbf{X}_{i,-j})}\right),\end{equation} where the notation $\widehat{\textnormal{KL}}_j$ suggests the KL divergence. In fact, $\widehat{\textnormal{KL}}_j$ is the {\em observed} KL divergence between $(\mathbf{X}_j,\widetilde{\X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})$ and $(\widetilde{\X}_j,\mathbf{X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})$. To prove this, working in the discrete case for simplicity, \lemref{approx_pairwise} tells us that \[ \sum_i \log\left(\frac{P_j (\mathbf{x}_{ij}|\mathbf{x}_{i,-j})\cdot Q_j(\widetilde{\xx}_{ij}|\mathbf{x}_{i,-j})}{Q_j(\mathbf{x}_{ij}|\mathbf{x}_{i,-j})\cdot P_j (\widetilde{\xx}_{ij}|\mathbf{x}_{i,-j})}\right) = \log\left(\frac{\PP{(\mathbf{X}_j,\widetilde{\X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})=(\mathbf{x}_j,\widetilde{\xx}_j,\mathbf{x}_{-j},\widetilde{\xx}_{-j})}}{\PP{(\widetilde{\X}_j,\mathbf{X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})=(\mathbf{x}_j,\widetilde{\xx}_j,\mathbf{x}_{-j},\widetilde{\xx}_{-j})}} \right) \] for any $\mathbf{x}_j,\widetilde{\xx}_j,\mathbf{x}_{-j},\widetilde{\xx}_{-j}$. Therefore, we see that \[\EE{\widehat{\textnormal{KL}}_j}= \textnormal{d}_{\textnormal{KL}} \Big((\mathbf{X}_j,\widetilde{\X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j}) \, \big\| \, (\widetilde{\X}_j,\mathbf{X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})\Big),\] where $ \textnormal{d}_{\textnormal{KL}} $ is the usual KL divergence between distributions. In the exact model-X setting, where the knockoff construction mechanism $P_{\widetilde{X}\mid X}$ satisfies the pairwise exchangeability property~\eqnref{swap_distribution}, \propref{swap_j_only} immediately implies that $(\mathbf{X}_j,\widetilde{\X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})\stackrel{\textnormal{d}}{=}(\widetilde{\X}_j,\mathbf{X}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j})$ and, thus, $\EE{\widehat{\textnormal{KL}}_j}=0$. (In fact, since we are using the true conditionals $P_j$, or in other words $Q_j=P_j$, we would have $\widehat{\textnormal{KL}}_j = 0$ always.) In the approximate model-X framework, we can interpret $\widehat{\textnormal{KL}}_j$ as measuring the extent to which the pairwise exchangeability property~\eqnref{swap_j_only} is violated for a specific feature $j$. We will see in our results below that controlling the $\widehat{\textnormal{KL}}_j$'s is sufficient to ensure control of the false discovery rate for the approximate model-X knockoffs method. More precisely, we will be able to bound the false positives coming from those null features which have small $\widehat{\textnormal{KL}}_j$. \subsection{FDR control guarantee}\label{sec:fdr_thm} We now present our guarantee for robust error control with the model-X knockoffs filter. \begin{theorem}\label{thm:fdr_robust} Under the definitions above, for any $\epsilon\geq0$, consider the null variables for which $\widehat{\textnormal{KL}}_j \le \epsilon$. If we use the knockoff+ filter, then the fraction of the rejections that correspond to such nulls obeys \begin{equation} \label{eqn:FDReps} \EE{\frac{\big|\{j: j\in\widehat{\Scal}\cap \mathcal{H}_0\, \text{\em and } \, \widehat{\textnormal{KL}}_j\leq \epsilon\}\big|}{|\widehat{\Scal}|\vee 1}} \leq q \cdot e^\epsilon. \end{equation} In particular, this implies that the false discovery rate is bounded as \begin{equation} \label{eqn:FDRbound} \textnormal{FDR}\leq \min_{\epsilon\geq 0}\left\{q\cdot e^{\epsilon} + \PPround{\max_{j\in\mathcal{H}_0}\widehat{\textnormal{KL}}_j>\epsilon}\right\}. \end{equation} Similarly, for the knockoff filter, for any $\epsilon\geq 0$, a slightly modified fraction of the rejections that correspond to nulls with $\widehat{\textnormal{KL}}_j \le \epsilon$ obeys \[\EE{\frac{\big|\{j: j\in\widehat{\Scal}\cap \mathcal{H}_0 \, \text{\em and } \, \widehat{\textnormal{KL}}_j\leq \epsilon\}\big|}{|\widehat{\Scal}| + q^{-1}} }\leq q \cdot e^\epsilon,\] and therefore, we obtain a bound on a modified false discovery rate: \[\EE{\frac{\big|\widehat{\Scal}\cap\mathcal{H}_0\big|}{|\widehat{\Scal}| + q^{-1}}}\leq \min_{\epsilon\geq 0}\left\{q\cdot e^{\epsilon} + \PPround{\max_{j\in\mathcal{H}_0}\widehat{\textnormal{KL}}_j>\epsilon}\right\}.\] \end{theorem} \noindent In \secref{examples}, we will see concrete examples where $\max_{j=1,\dots,p}\widehat{\textnormal{KL}}_j$ is small with high probability, yielding a meaningful result on FDR control. A noteworthy aspect of this result is that it makes no modeling assumption whatsoever. Indeed, our FDR control guarantees hold in any setting---no matter the relationship $P_{Y\mid X}$ between $Y$ and $X$, no matter the distribution $P_X$ of the feature vector $X$, and no matter the test statistics $W$ the data analyst has decided to employ (as long as $W$ obeys the flip-sign condition). What the theorem says is that when we use estimated conditionals $Q_j$, if the $Q_j$'s are close to the true conditionals $P_j$ in the sense that the quantities $\widehat{\textnormal{KL}}_j$ are small, then the FDR is well under control. In the ideal case where we use the true conditionals, then $\widehat{\textnormal{KL}}_j = 0$ for all $j \in \mathcal{H}_0$, and we automatically recover the FDR-control result from \citet{candes2016panning}; that is, we get FDR control at the nominal level $q$ since we can take $\epsilon = 0$. It worth pausing to unpack our main result a little. Clearly, we cannot hope to have error control over {\em all} nulls if we have done a poor job in constructing some of their knockoff copies, because our knockoff ``negative controls'' may be completely off. Having said this, \eqnref{FDReps} tells us that that if we restrict our definition of false positives to only those nulls for which we have a reasonable ``negative control'' via the knockoff construction, then the FDR is controlled. Since we do not make any assumptions, this type of result is all one can really hope for. In other words, exact model-X knockoffs make the assumption that the knockoff features provide exact controls for each null, thus ensuring control of the false positives; our new result removes this assumption, and provides a bound on the false positives when counting only those nulls for which the corresponding knockoff feature provides an approximate control. In a similar fashion, imagine running a multiple comparison procedure, e.g.~the Benjamini--Hochberg procedure, with p-values that are not uniformly distributed under the null. Then in such a situation, we cannot hope to achieve error control over {\em all} nulls if some of the null p-values follow grossly incorrect distributions. However, we may still hope to achieve reasonable control over those nulls for which the p-value is close to uniform. As we remarked earlier, our FDR bounds apply universally (in a sense, they are worst-case bounds) and it is expected that in any practical scenario, the achieved FDR would be lower than that suggested by our upper bounds. In particular, our theorem applies to any construction of the statistics $W$, including adversarial constructions that might be chosen deliberately to try to detect the differences between the $X_j$'s and the $\widetilde{X}_j$'s. In practice, $W$ would instead be chosen to try to identify strong correlations with $Y$, and we would not expect that this type of statistic is worst-case in terms of finding discrepancies between the distributions of $X_j$ and $\widetilde{X}_j$. In fact, empirical studies \cite{candes2016panning,sesia2017gene} have already reported on the robustness of model-X knockoffs vis-\`a-vis possibly large model misspecifications when $W$ is chosen to identify a strong dependence between $X$ and $Y$. Finally, we close this section by emphasizing that the proof of \thmref{fdr_robust}, which is presented in \secref{proof}, employs arguments that are completely different from those one finds in the existing literature on knockoffs. We discuss the novelties in our techniques in \secref{proof}. \subsection{Bounding $\widehat{\textnormal{KL}}_j$ to control FDR}\label{sec:examples} To make our FDR control results more concrete, we will consider settings where accurate estimates $Q_j$ of the conditionals $P_j$ ensure that the $\widehat{\textnormal{KL}}_j$'s are bounded near zero. Examining the definition~\eqnref{klj_define} of $\widehat{\textnormal{KL}}_j$, we see that $\widehat{\textnormal{KL}}_j$ is a sum of $n$ \iid~terms, and we can therefore expect that large deviation bounds such as Hoeffding's inequality can be used to provide an upper bound uniformly across all $p$ features. Here we give two specific examples. \subsubsection{Bounded errors in the likelihood ratio} First, suppose that our estimates $Q_j$ of the conditional distribution $P_j$ satisfy a likelihood ratio bound uniformly over any values for the variables: \begin{equation}\label{eqn:delta_bound_wp1} \log\left(\frac{P_j (x_j\mid x_{-j})\cdot Q_j(x_j'\mid x_{-j})}{Q_j(x_j\mid x_{-j})\cdot P_j (x_j'\mid x_{-j})} \right)\leq \delta\end{equation} for all $j$, all $x_j,x'_j$, and all $x_{-j}$. In this setting, the following lemma, proved via Hoeffding's inequality, gives a bound on the $\widehat{\textnormal{KL}}_j$'s: \begin{lemma}\label{lem:boundederror} If the condition~\eqnref{delta_bound_wp1} holds uniformly for all $j$ and all $x_j,x'_j,x_{-j}$, then with probability at least $1-\frac{1}{p}$, \[\max_{j=1,\dots,p}\widehat{\textnormal{KL}}_j \leq \frac{n\delta^2}{2} + 2\sqrt{n\log(p)}\cdot \delta.\] \end{lemma} \noindent In other words, if $Q_j$ satisfies~\eqnref{delta_bound_wp1} for some $\delta = o\left(\frac{1}{\sqrt{n\log(p)}}\right)$, then with high probability every $\widehat{\textnormal{KL}}_j$ will be small. By \thmref{fdr_robust}, then, the FDR for model-X knockoffs in this setting is controlled near the target level~$q$. \subsubsection{Gaussian knockoffs} For a second example, suppose that the distribution of the feature vector $X$ is mean zero and has covariance $\Theta^{-1}$, where $\Theta$ is some unknown precision matrix. (We assume zero mean for simplicity, but these results can of course be generalized to an arbitrary mean.) Suppose that we have estimated $\Theta$ with some approximation $\widetilde{\Theta}$, and let $\Theta_j$ and $\widetilde{\Theta}_j$ denote the $j$th columns of these matrices. Our results below will assume that the error in estimating each column of $\Theta$ is small, i.e.~$\widetilde{\Theta}_j-\Theta_j$ is small for all $j$. Following \citet[eqn.~(3.2)]{candes2016panning}, the Gaussian knockoff construction consists of drawing $\widetilde{\X}$ from the distribution \begin{equation}\label{eqn:draw_knockoffs_Gaussian_sample} \widetilde{\X}_{i,*} \mid \mathbf{X}_{i,*} \sim \mathcal{N}_p\big( (\mathbf{I}_p - D\widetilde{\Theta})\mathbf{X}_{i,*}, (2D - D\widetilde{\Theta} D)\big),\end{equation} independently for each $i$, where $D=\diag\{d_j\}$ is a nonnegative diagonal matrix chosen to satisfy $2D - D\widetilde{\Theta} D\succeq 0$, or equivalently, $D\preceq 2\widetilde{\Theta}^{-1}$. Another formulation is that the distribution $P_{\widetilde{X}\mid X}(\cdot|X)$ for $\widetilde{X}$ conditional on $X$ is obtained by setting \begin{equation}\label{eqn:draw_knockoffs_Gaussian} \widetilde{X} \mid X \sim \mathcal{N}_p\big((\mathbf{I}_p - D\widetilde{\Theta}) X ,2D-D\widetilde{\Theta} D\big).\end{equation} If the true precision matrix of $X$ were given by $\widetilde{\Theta}$ (assumed to be positive definite), then we can calculate that the joint distribution of the pair $(X,\widetilde{X})$ has first and second moments given by \[\EE{\left(\begin{array}{c} X \\ \widetilde{X}\end{array}\right)} = \left(\begin{array}{c} 0 \\ 0 \end{array}\right), \quad \VV{\left(\begin{array}{c} X \\ \widetilde{X}\end{array}\right)} = \left(\begin{array}{cc} \widetilde{\Theta}^{-1} & \widetilde{\Theta}^{-1} - D \\ \widetilde{\Theta}^{-1} - D & \widetilde{\Theta}^{-1}\end{array}\right).\] In other words, for every $j$, $X_j$ and $\widetilde{X}_j$ are exchangeable if we only look at the first and second moments of the joint distribution. If the true distribution of $X$ is in fact Gaussian, again with mean zero and covariance $\widetilde{\Theta}^{-1}$, then a stronger claim follows---the joint distribution of $(X,\widetilde{X})$ is then multivariate Gaussian and therefore $(X,\, \widetilde{X})_{\swap({\mathcal{A}})} \stackrel{\textnormal{d}}{=} (X,\, \widetilde{X})$ for every subset $\mathcal{A}\subseteq [p]$. In other words, the knockoff construction determined by $P_{\widetilde{X}\mid X}$ satisfies pairwise exchangeability, as defined in~\eqnref{swap_all_approx}, with respect to the distribution $Q_X = \mathcal{N}_p(0,\widetilde{\Theta}^{-1})$. To frame this property in terms of conditionals, $Q_j$, rather than an estimated joint distribution, $Q_X$, we can calculate the estimated conditional distributions $Q_j(\cdot|X_{-j})$ as \begin{equation}\label{eqn:gaussian_Qj} X_j\mid X_{-j} \sim \mathcal{N}\left(X_{-j}^\top \left( \frac{- \widetilde{\Theta}_{-j,j}}{ \widetilde{\Theta}_{jj}}\right), \frac{1}{ \widetilde{\Theta}_{jj}}\right), \end{equation} where $\widetilde{\Theta}_{-j,j}\in\mathbb{R}^{p-1}$ is the column $\widetilde{\Theta}_j$ with entry $\widetilde{\Theta}_{jj}$ removed. As noted in \secref{approximate}, we may want to work with estimated precision matrices, which are not positive semidefinite (PSD). The rationale is that if $\widetilde{\Theta}$ is fitted by regressing each $X_j$ on the remaining features $X_{-j}$ to produce the $j$th column, $\widetilde{\Theta}_j$, then the result will not be PSD in general. If $\widetilde{\Theta}$ is not PSD, although there is no corresponding joint distribution, the conditionals $Q_j$~\eqnref{gaussian_Qj} are still well-defined as long as $\widetilde{\Theta}_{jj}>0$ for all $j$; they are just not compatible. (Note that symmetry is a far easier constraint to enforce, e.g.~by simply replacing our initial estimate $\widetilde{\Theta}$ with $(\widetilde{\Theta}+\widetilde{\Theta}^\top)/2$, which preserves desirable features such as sparsity that might be present in the initial $\widetilde{\Theta}$; in contrast, projecting to the PSD cone while enforcing sparsity constraints may be computationally challenging in high dimensions.) Our first result verifies that this construction of $P_{\widetilde{X}\mid X}$ satisfies pairwise exchangeability with respect to the conditional distributions $Q_j$ given in~\eqnref{gaussian_Qj}: \begin{lemma}\label{lem:gaussian_pairwise} Let $\widetilde{\Theta}\in\mathbb{R}^{p\times p}$ be a symmetric matrix with a positive diagonal, and let $P_{\widetilde{X}\mid X}$ be defined as in~\eqnref{draw_knockoffs_Gaussian}. Then, for each $j=1,\dots,p$, $P_{\widetilde{X}\mid X}$ is pairwise exchangeable with respect to the conditional distribution $Q_j$ given in~\eqnref{gaussian_Qj}---that is, the exchangeability condition~\eqnref{swap_j_only_approx} is satisfied. \end{lemma} In practice, we would construct Gaussian knockoffs in situations where the distribution of $X$ might be well approximated by a multivariate normal. The lemma below gives a high probability bound on the $\widehat{\textnormal{KL}}_j$'s in the case where the features are indeed Gaussian but with an unknown covariance matrix $\Theta^{-1}$. Here, Gaussian concentration results can be used to control the $\widehat{\textnormal{KL}}_j$'s, which then yields FDR control. (We note that recent work by \citet{fan2017rank} also studies the Gaussian model-X knockoffs procedure with an estimated precision matrix $\widetilde{\Theta}$, under a different framework.) \begin{lemma}\label{lem:Gaussian} Let $\Theta,\widetilde{\Theta}\in\mathbb{R}^{p\times p}$ be any matrices, where $\Theta$ is positive definite and $\widetilde{\Theta}$ is symmetric with a positive diagonal. Suppose that $\mathbf{X}_{i,*}\stackrel{\mathrm{iid}}{\sim} \mathcal{N}_p(0,\Theta^{-1})$, while $\widetilde{\X}\mid \mathbf{X}$ is drawn according to the distribution $P_{\widetilde{X}\mid X}$ given in~\eqnref{draw_knockoffs_Gaussian}. Define \[\delta_{\Theta} = \max_{j=1,\dots,p} (\Theta_{jj})^{-1/2}\cdot \norm{\Theta^{-1/2}(\widetilde{\Theta}_j -\Theta_j)}_2.\] Then with probability at least $1-\frac{1}{p}$, \[\max_{j=1,\dots,p}\widehat{\textnormal{KL}}_j \leq 4\delta_\Theta\sqrt{n\log(p)}\cdot (1+o(1)),\] where the $o(1)$ term refers to terms that are vanishing when we assume that $\frac{\log(p)}{n}=o(1)$ and that this upper bound is itself bounded by a constant. \end{lemma} \noindent (A formal bound making the $o(1)$ term explicit is provided in the proof.) In particular, comparing to our FDR control result, \thmref{fdr_robust}, we see that as long as the columnwise error in estimating the precision matrix $\Theta$ satisfies $\delta_\Theta = o\left(\frac{1}{\sqrt{n\log(p)}}\right)$, the FDR will be controlled near the target level $q$. \subsection{A lower bound on FDR} Next, we ask whether it is possible to prove a converse to our FDR control result, \thmref{fdr_robust}. We are interested in knowing whether bounding the $\widehat{\textnormal{KL}}_j$'s is in fact necessary for FDR control---or is it possible to achieve an FDR control guarantee even when the $\widehat{\textnormal{KL}}_j$'s are large? Our next result proves that, if there is a feature $j$ for which $\widehat{\textnormal{KL}}_j$ does not concentrate near zero, then we can construct an honest model selection method that, when assuming that the conditional distribution of $X_j\mid X_{-j}$ is given by $Q_j$, {\em fails} to control FDR at the desired level if the true conditional distribution is in fact $P_j$. By ``honest'', we mean that the model selection method would successfully control FDR at level $q$ if $Q_j$ were the true conditional distribution. Our construction does not run a knockoff filter on the data; it is instead a hypothesis testing based procedure, meaning that the $\widehat{\textnormal{KL}}_j$'s govern whether it is possible to control FDR in a general sense. Hence, our converse is information-theoretic in nature and not specific to the knockoff filter. \begin{theorem}\label{thm:lowerbound} Fix any distribution $P_X$, any feature index $j$, and any estimated conditional distribution $Q_j$. Suppose that there exists a knockoff sampling mechanism $P_{\widetilde{X}\mid X}$ that is pairwise exchangeable with respect to $Q_j$~\eqnref{swap_j_only_approx}, such that \[\PP{\widehat{\textnormal{KL}}_j \geq \epsilon} \geq c\] for some $\epsilon,c>0$ when $(\mathbf{X},\widetilde{\X})$ is drawn from $P_X\timesP_{\widetilde{X}\mid X}$. Then there exists a conditional distribution $P_{Y\mid X}$, and a testing procedure $\widehat{\Scal}$ that maps data $(\mathbf{X},\mathbf{Y})\in\mathbb{R}^{n\times p}\times \mathbb{R}^n$ to a selected set of features $\widehat{\Scal}(\mathbf{X},\mathbf{Y})\subseteq\{1,\dots,p\}$, such that: \begin{itemize} \item If the data points $(\mathbf{X}_{i,*},\mathbf{Y}_i)$ are \iid~draws from the distribution $Q_X \times P_{Y\mid X}$, where $Q_X$ is any distribution whose $j$th conditional is $Q_j$ (i.e.~our estimated conditional distribution $Q_j$ for feature $X_j$ is correct), then \[\textnormal{FDR}\big(\widehat{\Scal}\big) = q.\] \item On the other hand, if the data points $(\mathbf{X}_{i,*},\mathbf{Y}_i)$ are \iid~draws from the distribution $P_X\times P_{Y\mid X}$ (i.e.~our estimated conditional distribution $Q_j$ is not correct, as the true conditional distribution is $P_j$), then \[\textnormal{FDR}\big(\widehat{\Scal}\big) \geq q \big(1 + c (1 - e^{-\epsilon})\big).\] \end{itemize} \end{theorem} \noindent For the last case (where $P_X$ is the true distribution), if $c\approx 1$ (i.e.~$\widehat{\textnormal{KL}}_j\geq \epsilon$ with high probability) then $\textnormal{FDR}\big(\widehat{\Scal}\big)\gtrapprox q(2-e^{-\epsilon})$; when $\epsilon\approx 0$ is small, we have $2-e^{-\epsilon}\approx 1 + \epsilon \approx e^\epsilon$, thus matching the upper bound in \thmref{fdr_robust}. \section{Proof of \thmref{fdr_robust}} \label{sec:proof} Whereas all proofs of FDR control for the knockoff methods thus far have relied on martingale arguments (see \cite{barber2015,barber2016,candes2016panning}), here we will prove our main theorem using a novel leave-one-out argument. Before we begin, we would like to draw a loose analogy. To prove FDR controlling properties of the Benjamini--Hochberg procedure under independence of the p-values, \citet{storey2004} developed a very elegant martingale argument. Other proof techniques, however, operate by removing or leaving out one hypothesis (or one p-value); see \citet{ferreira2006} for example. At a very high level, our own methods are partially inspired by the latter approach. Fix $\epsilon > 0$ and for any threshold $t > 0$, define \[R_{\epsilon}(t) \coloneqq \frac{\sum_{j\in\mathcal{H}_0 } \One{W_j\geq t,\widehat{\textnormal{KL}}_j\leq \epsilon}}{1 + \sum_{j\in\mathcal{H}_0} \One{W_j\leq -t}}.\] Then, for the knockoff+ filter with threshold $T_+$, we can write \begin{align*} \frac{\big|\{j: j\in\widehat{\Scal}\cap \mathcal{H}_0\text{ and }\widehat{\textnormal{KL}}_j\leq \epsilon\}\big|}{|\widehat{\Scal}|\vee 1} & = \frac{\sum_{j\in\mathcal{H}_0 } \One{W_j\geq T_+,\widehat{\textnormal{KL}}_j\leq \epsilon}}{1 \vee\sum_j \One{W_j\geq T_+}} \\ & = \frac{1+\sum_j \One{W_j\leq -T_+}}{1\vee \sum_j \One{W_j\geq T_+}}\cdot \frac{\sum_{j\in\mathcal{H}_0} \One{W_j\geq T_+,\widehat{\textnormal{KL}}_j\leq\epsilon}}{1 + \sum_j \One{W_j\leq -T_+}}\leq q\cdot R_\epsilon(T_+),\end{align*} where the last step holds by definition of $R_{\epsilon}$ and the construction of the knockoff+ filter. If we instead use the knockoff filter (rather than knockoff+), then we use the threshold $T_0$ and obtain \[\frac{\big|\{j: j\in\widehat{\Scal}\cap \mathcal{H}_0\text{ and }\widehat{\textnormal{KL}}_j\leq \epsilon\}\big|}{q^{-1} + |\widehat{\Scal}|}=\frac{1 + \sum_j \One{W_j\leq -T_0}}{q^{-1}+\sum_j \One{W_j\geq T_0}}\cdot \frac{\sum_{j\in\mathcal{H}_0 } \One{W_j\geq T_0,\widehat{\textnormal{KL}}_j\leq\epsilon}}{1 + \sum_j \One{W_j\leq -T_0}}\leq q\cdot R_\epsilon(T_0),\] where the last step holds by definition of $R_{\epsilon}$ and the construction of the knockoff filter. Either way, then, it is sufficient to prove that $\EE{R_{\epsilon}(T)}\leq e^\epsilon$, where $T$ is either $T_+$ or $T_0$. For each null feature $j$ we will be conditioning on observing $\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}$, and on observing the {\em unordered} pair $\{\mathbf{X}_j,\widetilde{\X}_j\}$---that is, we observe both the original and knockoff features but do not know which is which. It follows from the flip-sign property that having observed all this, we know all the knockoff statistics $W$ except for the sign of the $j$th component $W_j$. Put differently, $W_{-j}$ and $|W_j|$ are both functions of the variables we are conditioning on, but $\sign(W_j)$ is not. Without loss of generality, label the unordered pair of feature vectors $\{\mathbf{X}_j,\widetilde{\X}_j\}$, as $\mathbf{X}^{(0)}_j$ and $\mathbf{X}^{(1)}_j$, such that \begin{itemize} \item if $\mathbf{X}_j = \mathbf{X}^{(0)}_j$ and $\widetilde{\X}_j = \mathbf{X}^{(1)}_j$, then $W_j\geq 0$; \item if $\mathbf{X}_j = \mathbf{X}^{(1)}_j$ and $\widetilde{\X}_j = \mathbf{X}^{(0)}_j$, then $W_j\leq 0$. \end{itemize} Next, define \[\widehat{\textnormal{KL}}'_j = \sum_{i=1}^n \log\left(\frac{P_j (\mathbf{X}^{(0)}_{ij}\mid \mathbf{X}_{i,-j})\cdot Q_j(\mathbf{X}^{(1)}_{ij}\mid\mathbf{X}_{i,-j})}{Q_j(\mathbf{X}^{(0)}_{ij}\mid \mathbf{X}_{i,-j})\cdot P_j (\mathbf{X}^{(1)}_{ij}\mid\mathbf{X}_{i,-j})}\right) = \sign(W_j)\cdot \widehat{\textnormal{KL}}_j,\] where the second equality holds whenever $|W_j|\neq 0$---this follows from the definition of $\widehat{\textnormal{KL}}_j$ and $(\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j)$. Furthermore, for a threshold rule $T=T(W)$ mapping statistics $W\in\mathbb{R}^p$ to a threshold $T\geq 0$ (i.e.~the knockoff or knockoff+ filter threshold), for each index $j=1,\dots,p$ we define \[T_j = T\Big((W_1,\dots,W_{j-1},|W_j|,W_{j+1},\dots,W_p)\Big) \geq 0,\] i.e.~the threshold that we would obtain if $\sign(W_j)$ were set to $+1$. The following lemma establishes a property of the $T_j$'s in the context of the knockoff filter: \begin{lemma}\label{lem:Tj} Let $T=T(W)$ be the threshold for either the knockoff or the knockoff+. For any $j,k$, \begin{equation}\label{eqn:leave_one_out_threshold} \text{if $W_j\leq -\min\{T_j,T_k\}$ and $W_k\leq -\min\{T_j,T_k\}$, then $T_j=T_k$.}\end{equation} \end{lemma} \noindent (More generally, this result holds for any function $T=T(W)$ that satisfies a ``stopping time condition'' with respect to the signs of the $W_j$'s, defined as follows: for any $t\geq0$, the event $\One{T\leq t}$ depends on $W$ only through (1) the magnitudes $|W|$, (2) $\sign(W_j)$ for each $j$ with $|W_j|<t$, and (3) $\sum_{j:|W_j|\geq t} \sign(W_j)$.) Now with $T$ being either the knockoff or knockoff+ thresholding rule, we have \begin{align} \notag&\EE{R_{\epsilon}(T)} =\EE{\frac{ \sum_{j\in\mathcal{H}_0}\One{W_j\geq T, \widehat{\textnormal{KL}}_j\leq \epsilon}}{1+\sum_{j\in\mathcal{H}_0} \One{W_j \leq -T}}}\\ \notag&= \sum_{j\in\mathcal{H}_0}\EE{\frac{ \One{W_j\geq T, \widehat{\textnormal{KL}}_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T}}}\text{\quad (since $T>0$ by definition, so if $W_j\geq T$ then $W_j\not\leq -T$)}\\ \label{eqn:Reps_step}&= \sum_{j\in\mathcal{H}_0}\EE{\frac{ \One{W_j\geq T_j, \widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k\in\mathcal{H}_0, k\neq j}\One{W_k \leq -T_j}}}\text{\quad (since if $W_j> 0$ then $T=T_j$ and $\widehat{\textnormal{KL}}_j=\widehat{\textnormal{KL}}'_j$)}\\ \notag&= \sum_{j\in\mathcal{H}_0}\EE{\EEst{\frac{ \One{W_j\geq T_j, \widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j}\One{W_k \leq -T_j}}}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}}\\ \label{eqn:eps_step}&= \sum_{j\in\mathcal{H}_0}\EE{\frac{ \PPst{W_j>0}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}\cdot \One{|W_j|\geq T_j, \widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}}, \end{align} where the last step holds since $W_{-j}$ and $|W_j|$ and $\widehat{\textnormal{KL}}'_j$ are all determined after observing the variables $\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}$; after conditioning on these variables, the only unknown is the sign of $W_j$. Next, fix any null $j$. Suppose that we observe $\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}$, so that we now know $W_{-j}$ and $|W_j|$ but not $\sign(W_j)$. Our goal is now to bound the conditional probability $\PPst{W_j>0}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}$. If $|W_j|=0$ then this probability is zero. If not, then by definition of $\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j$, \[\frac{\PPst{W_j>0}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}}{\PPst{W_j<0}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}} = \frac{\PPst{(\mathbf{X}_j,\widetilde{\X}_j)=(\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j)}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}}{\PPst{(\mathbf{X}_j,\widetilde{\X}_j)=(\mathbf{X}^{(1)}_j,\mathbf{X}^{(0)}_j)}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}}}.\] Since the observations $i=1,\dots,n$ are independent, this can be rewritten as \begin{multline*}\prod_{i=1}^n \frac{\PPst{(\mathbf{X}_{ij},\widetilde{\X}_{ij})=(\mathbf{X}^{(0)}_{ij},\mathbf{X}^{(1)}_{ij})}{\mathbf{X}^{(0)}_{ij},\mathbf{X}^{(1)}_{ij},\mathbf{X}_{i,-j},\widetilde{\X}_{i,-j},\mathbf{Y}_i}}{\PPst{(\mathbf{X}_{ij},\widetilde{\X}_{ij})=(\mathbf{X}^{(1)}_{ij},\mathbf{X}^{(0)}_{ij})}{\mathbf{X}^{(0)}_{ij},\mathbf{X}^{(1)}_{ij},\mathbf{X}_{i,-j},\widetilde{\X}_{i,-j},\mathbf{Y}_i}} \\ = \prod_{i=1}^n \frac{P_j (\mathbf{X}^{(0)}_{ij}\mid \mathbf{X}_{i,-j})\cdot Q_j(\mathbf{X}^{(1)}_{ij}\mid\mathbf{X}_{i,-j})}{Q_j(\mathbf{X}^{(0)}_{ij}\mid \mathbf{X}_{i,-j})\cdot P_j (\mathbf{X}^{(1)}_{ij}\mid\mathbf{X}_{i,-j})} = \exp(\widehat{\textnormal{KL}}'_j),\end{multline*} where the first equality holds by \lemref{approx_pairwise}. Rearranging terms, we have \[\PPst{W_j>0}{\mathbf{X}^{(0)}_j,\mathbf{X}^{(1)}_j,\mathbf{X}_{-j},\widetilde{\X}_{-j},\mathbf{Y}} = \frac{\exp(\widehat{\textnormal{KL}}'_j)}{1+\exp(\widehat{\textnormal{KL}}'_j)}.\] In passing, note that we here recover a key result from the knockoff literature: when $Q_j=P_j$ (i.e.~we are using the correct conditionals) then $\widehat{\textnormal{KL}}_j' = 0$ and the conditional probability above is equal to $1/2$. That is, for nulls, the $W_j$'s are conditionally equally likely to be positive and negative (and also unconditionally). Returning to the step~\eqnref{eps_step} above, our calculation implies that \begin{align*} \EE{R_{\epsilon}(T)} & \leq \sum_{j\in\mathcal{H}_0}\EE{\frac{ \frac{\exp(\widehat{\textnormal{KL}}'_j)}{1+\exp(\widehat{\textnormal{KL}}'_j)}\cdot \One{|W_j|\geq T_j, \widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}}\\ &\leq \frac{e^\epsilon}{1+e^\epsilon}\cdot \sum_{j\in\mathcal{H}_0}\EE{\frac{ \One{|W_j|\geq T_j, \widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}}\\ &\leq \frac{e^\epsilon}{1+e^\epsilon}\cdot \left(\sum_{j\in\mathcal{H}_0}\EE{\frac{ \One{W_j\geq T_j,\widehat{\textnormal{KL}}'_j\leq \epsilon}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}} +\sum_{j\in \mathcal{H}_0} \EE{\frac{ \One{W_j\leq -T_j}}{1+\sum_{k\in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}}\right)\\ &= \frac{e^\epsilon}{1+e^\epsilon}\cdot \left(\EE{R_{\epsilon}(T)} + \EE{\sum_{j \in \mathcal{H}_0} \frac{ \One{W_j\leq -T_j}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}}\right), \end{align*} by our earlier calculation~\eqnref{Reps_step} for $R_{\epsilon}$. Finally, the sum in this last expression can be simplified as follows: if for all null $j$, $W_j > -T_j$, then the sum is equal to zero, while otherwise, we can write \begin{multline*}\sum_{j\in \mathcal{H}_0} {\frac{ \One{W_j\leq -T_j}}{1+\sum_{k \in\mathcal{H}_0, k\neq j} \One{W_k \leq -T_j}}} = \sum_{j\in\mathcal{H}_0}\frac{\One{W_j\leq -T_j}}{1+\sum_{k\in\mathcal{H}_0,k\neq j}\One{W_k\leq -T_k}}\\ = \sum_{j \in \mathcal{H}_0} {\frac{ \One{W_j\leq -T_j}}{\sum_{k\in\mathcal{H}_0} \One{W_k \leq -T_k}}} = 1,\end{multline*} where the first step applies Lemma~\ref{lem:Tj}. Combining everything, we have shown that \[\EE{R_{\epsilon}(T)}\leq \frac{e^\epsilon}{1+e^\epsilon}\cdot\left(\EE{R_\epsilon(T)}+1\right).\] Rearranging terms gives $\EE{R_{\epsilon}(T)}\leq e^\epsilon$, which proves the theorem. \section{Discussion} In this paper, we established that the method of model-X knockoffs is robust to errors in the underlying assumptions on the distribution of the feature vector $X$, making it an effective method for many practical applications, such as genome-wide association studies, where the underlying distribution on the features $X_1,\dots,X_p$ can be estimated accurately. One notable aspect is that our theory is free of any modeling assumptions, since our theoretical guarantees hold no matter the data distribution or the statistics that the data analyst wishes to use, even if they are designed to exploit some weakness in the construction of knockoffs. Looking forward, it would be interesting to develop a theory for fixed statistics. For instance, if the researcher commits to using a pre-specified random forest feature importance statistic, or some statistic based on the magnitudes of lasso coefficients (perhaps calculated at a data-dependent value of the regularization parameter), then what can be said about FDR control? In other words, what can we say when the statistics $W$ only probe the data in certain directions? We leave such interesting questions for further research.
\section{Introduction} We call a tuple $I=(G,H,\mathcal{M}, \mathcal{S})$ a \emph{weaving-free interchange}, or simply \emph{an interchange}, if $\mathcal{M}$ is an embedding of a 2-coloured multigraph $G$ into an orientable surface $\mathcal{S}$ such that $G$ has the same number of black and white vertices and the embedding $\mathcal{M}$ has a face with a directed Hamiltonian cycle $H$ as its boundary walk \cite{kurauskas2015}. Here pairs of subsequent white and black vertices on $H$ model the roadways (groups of lanes with traffic flow in the same direction) that enter and exit the interchange respectively. The images under $\mathcal{M}$ of the edges of $G$ model the actual lanes inside the interchange. Finally, the Hamiltonian cycle $H$ corresponds to the perimeter of the interchange and bounds the corresponding outer face. $I$ is called \emph{$t$-way} if $G$ has $t$ black and $t$ white vertices. $I$ is \emph{complete} if there is an edge $uv$ for each white vertex $u$ and each black vertex $v$ (multiple edges are allowed). For even $n$, a construction for complete $n$-way interchanges with minimum genus was described in \cite{kurauskas2015}. The problem is equivalent to minimizing the genus of an embedding of $K_{n,n}$ such that one face is bounded by a Hamiltonian cycle. The solution implies one of the special cases of the conjecture on the minimum genus of a complete tripartite graph. After several decades of partial progress, see \cite{ellinghamstephens2009, esz2006, ksz2004}, the complete proof of the conjecture has been announced very recently by Ellingham, Stephens and Zha \cite{esz2018}. In this paper we impose an additional symmetry restriction. Symmetric embeddings or interchange layouts result by combining a number of identical pieces. This may be an advantage for aesthetical or practical reasons, especially when we have 3-dimensional realisations as in Theorem~\ref{thm.geometric.opt} below. Our first result yields the minimum genus of interchanges where the cyclic permutation of roads (shifting vertices along the Hamiltonian cycle by two positions) preserves the rotation system. This kind of combinatorial/topological symmetry is classically modelled by the voltage graph construction; for definitions we follow Gross and Tucker \cite{grosstucker1987}, see also Section~\ref{sec.combinatorial}. \begin{theorem}\label{thm.topsym} Let $n\ge 3$ be an integer. Let $\mathcal{M}$ be an embedding of $K_{n,n}$ derived from a loopless embedded voltage graph on two vertices and voltage group $\mathbb{Z}_n$. Suppose $\mathcal{M}$ has a face $F_H$ bounded by a Hamiltonian cycle. Let $p_1$ be the smallest prime divisor of $n$. The genus of $\mathcal{M}$ is at least $L_{C}(n)$ where \small \begin{align*} L_{C}(n) = \begin{cases} \frac{n(n-2)} 4, &\mbox{if $n$ is even}; \\ \lfloor \frac{n(n-1)} 4 \rfloor + 1 - \frac 1 2 \left( \frac n {p_1} + p_1\right), &\mbox{if } n \equiv 3\,(\bmod\,4), p_1 \ne n \mbox{ and } p_1^2 \nmid n; \\ \lfloor \frac{n(n-1)} 4 \rfloor + 1 - \frac 1 2 \left( \frac n {p_1} + 1\right), &\mbox{if } n \equiv 3\,(\bmod\,4) \mbox{ and } p_1^2 \mid n; \\ \frac{n(n-1)} 4 - 1, &\mbox{if }n \equiv 1\,(\bmod\,4), 3 \mid n \mbox { and } 9 \nmid n; \\ \lfloor \frac{n(n-1)} 4 \rfloor, &\mbox {otherwise}. \end{cases} \end{align*} \normalsize Furthermore, this lower bound is best possible, and the derived embedding $\mathcal{M}$ that achieves genus $L_{C}(n)$ and $F_H$ can be chosen so that $F_H$ is generated by a face of size 2 in the base embedding. \end{theorem} The fact that $L_{C}(n)$ depends on the prime divisors of $n$ may be seen as a remote link to the well established theory of regular embeddings of complete bipartite graphs $K_{n,n}$ where the symmetry requirement is much stronger \cite{jones2010}. Now let $\mathcal{M}$ be an embedding of a graph $G$ into a closed connected orientable surface $\mathcal{S}$ where $\mathcal{S}$ is itself embedded into $\mathbb{R}^3$ (we will denote the latter fact by $\mathcal{S} \subset \mathbb{R}^3$). For our second result we will work in the category of piecewise linear embeddings both for the graph in the surface, and the surface in the 3-dimensional space. The \emph{image} $\mathcal{M}(G)$ of $G$ is defined as the subset of $\mathcal{S}$ which consists of the union of the set $\mathcal{M}(V(G))$ of all points that $\mathcal{M}$ maps $V(G)$ to and the curves connecting these points which $\mathcal{M}$ maps the edges of $G$ to. The \emph{isometry group} ${\rm Iso}(\mathcal{M})$ of $\mathcal{M}$ consists of all Euclidean isometries $f: \mathbb{R}^3 \to \mathbb{R}^3$ which map $\mathcal{S}$ to $\mathcal{S}$, $\mathcal{M}(G)$ to $\mathcal{M}(G)$ and $\mathcal{M}(V(G))$ to $\mathcal{M}(V(G))$. We say that an embedding $\mathcal{M}$ has \emph{$n$-fold rotational symmetry} if \emph{both} the embedded graph and the underlying surface are invariant under the rotation $r$ by angle $2 \pi /n$ about some axis in $\mathbb{R}^3$, i.e., if $r \in {\rm Iso}(\mathcal{M})$. We call a road interchange $I=(G,H,\mathcal{M}, \mathcal{S})$ \emph{3-dimensional} if $\mathcal{S} \subset \mathbb{R}^3$. \emph{The symmetry group ${\rm Iso}(I)$ of $I$} consists of those $f \in {\rm Iso}(\mathcal{M})$ that fix the face bounded by $H$. The next is our main result about 3-dimensional road interchanges. \begin{theorem} \label{thm.geometric.opt} Let $n \ge 2$ be an integer. Let $\mathcal{M}$ be a piecewise linear embedding of $K_{n,n}$ into a closed connected orientable surface $\mathcal{S} \subset \mathbb{R}^3$ such that there is a face $F_H$ bounded by a Hamiltonian cycle. Suppose $\mathcal{M}$ has n-fold rotational symmetry that leaves the boundary of $F_H$ invariant. Then the genus of $\mathcal{S}$ is at least $L_{C}^{*}(n)$, where \begin{align*} L_{C}^{*}(n)=\begin{cases} \frac {n^2} 4 - 1, &\mbox{if } n\equiv0\,(\bmod \, 4); \\ \frac {n(n-1)} 4, &\mbox{if } n\equiv1\,(\bmod \, 4); \\ \frac {n (n-2)} 4, &\mbox{if } n\equiv2\,(\bmod \, 4); \\ \frac {n (n+1)} 4 - 1, &\mbox{if } n\equiv3\,(\bmod \, 4). \end{cases} \end{align*} Furthermore, if $n \ne 4$, this lower bound is best possible. \end{theorem} Of course, $L_{C}(n) \le L_{C}^{*}(n)$, but note that equality holds only in certain cases. A simple, but suboptimal lower bound for $L_{C}^{*}(n)$ can be obtained from Theorem~\ref{thm.topsym} and the fact that not every orientable surface can be embedded in $\mathbb{R}^3$ with a given symmetry group: in $\mathbb{R}^3$ we can only have embeddings that have symmetry groups of a $t$-prism for certain $t > 0$, the Platonic solids and their subgroups \cite{undine, tucker2014}. The correct lower bound follows from a new combinatorial argument that exposes a local obstruction that prevents a corresponding `quotient embedding' into a smaller genus surface, see Section~\ref{sec.geom.lower2}. Our constructions that achieve genus $L_{C}^{*}(n)$ can be called \emph{ring road interchanges}. For each entering motorway we construct a block with some `simple bridges' (handles). We connect the blocks into a ring. For $n \bmod 4 \in \{1,2\}$ the layout is particularly simple: in the inter-block connections the traffic always moves counter-clockwise and the lanes heading to each exit motorway are adjacent. For $n \bmod 4 \in \{0, 3\}$ and $n > 4$, the optimal constructions are similar, but they use a star-shaped bridge and some lanes where traffic between the blocks goes in the opposite, clockwise, direction, see Section~\ref{sec.geom.upper}. The case $n=4$ is an exception in Theorem~\ref{thm.geometric.opt}. We show below that the minimum genus in this case is $4$, and one of the embeddings of such genus is the 4-way Pinavia interchange \cite{jbk2010}, shown in Figure~\ref{fig.pinavia_embedding} below. The Hamiltonian cycle assumption can be relaxed in Theorem~\ref{thm.geometric.opt}. The result remains true if we only require that no vertex of $K_{n,n}$ is mapped to a fixed point and at least one point of the surface is a fixed point, see Lemma~\ref{lem.geometric.opt} below. \section{Definitions} A directed multigraph $G$ is a pair $(V, E)$, where $V$ and $E$ are disjoint sets together with a map $E \to V \times V$ assigning to each edge $e$ its endpoints $(u,v)$; we say that $e$ goes from $u$ to $v$. We use $V(G)=V$ and $E(G) = E$. When there is only one edge $e$ with endpoints $(u,v)$ we use notation $uv$ for $e$. Below when necessary we consider any 2-coloured bipartite multigraph $G$ as directed, by implicitly assuming all edges go from white vertices to black vertices. For a directed multigraph $G$ we let $U(G)$ denote the underlying undirected multigraph. We say that a directed multigraph $G_1$ and an undirected multigraph $G_2$ are \emph{isomorphic} if $G_2$ is isomorphic to $U(G_1)$. Let $\mathcal{M}$ be an embedding of a directed or undirected multigraph $G$ into a surface $\mathcal{S}$. We call a connected component of $\mathcal{S} \setminus \mathcal{M}(G)$ a \emph{region}. If a region of $\mathcal{M}$ is 2-cell, i.e. if it is homeomorphic to a disk, we call it a \emph{face} of $\mathcal{M}$. A well known fact is that there is a bijection between 2-cell embeddings of $G$ (up to homeomorphism) and \emph{rotation systems} for $G$, which are sets $\{ \pi_v: v \in V(G)\}$ where $\pi_v$ is a cyclic ordering of edges incident to $v$ \cite{grosstucker1987}. Let $\Gamma=(\Gamma, \star)$ be a group. Given a directed multigraph $G$ and a function $\alpha: E(G) \to \Gamma$, called a \emph{voltage function} or a \emph{voltage assignment}, the \emph{derived} graph $G'$ for voltage group $\Gamma$ is the directed multigraph $G'$ on the vertex set $V(G) \times \Gamma$ and edges $\{ ( (x,a), (y,a \star \alpha(e))) : e \in E(G),\, f(e) = (x,y)\}$. Here $f$ maps $e$ to its endpoints. $(G, \alpha)$ is called the \emph{voltage graph} or the \emph{base graph} for $G'$, and we call $\Gamma$ the \emph{voltage group}. If $G'$ is derived from $(G, \alpha)$ and $\Gamma$, we will say that its undirected version $U(G')$ also is. If $\mathcal{M}$ is a 2-cell embedding of $G$ into some surface $\mathcal{S}$ then $(G, \mathcal{M}, \mathcal{S}, \alpha)$ is called an \emph{embedded voltage graph}. The main point of the \emph{voltage graph} construction is that the embedding $\mathcal{M}$ of a base graph $G$ can be used to obtain a \emph{derived embedding} $\mathcal{M}'$ of the derived graph $G'$ \cite{grosstucker1987}. Each face of $\mathcal{M}'$ is generated by precisely one face of $\mathcal{M}$. Let $F$ be a face of $\mathcal{M}$ with boundary $e_1^{s_1} \dots e_k^{s_k}$. Here $s_i = 1$ if the direction of $e_i$ agrees with the direction of the boundary walk of $F$ and $s_i=-1$ otherwise. The \emph{net voltage} of $F$ is $\alpha(e_1)^{s_1} \star \dots \star \alpha(e_k)^{s_k}$, where $x^{-1}$ denotes the inverse of $x$ in $\Gamma$. We call the number of edges in the boundary walk of $F$ its \emph{size}. We call a face \emph{Hamiltonian} if its boundary is a Hamiltonian cycle. If $F$ has size $k$ and net voltage $g$, then there are $n/|g|$ faces in $\mathcal{M}'$ \emph{generated by} $F$, and each of these faces has size $k |g|$ \cite{grosstucker1987}. Here $|g|$ is the order of $g$ in $\Gamma$. The main base graph we will meet in this paper is the dipole graph $D_n$, that is, the bipartite multigraph on two vertices $\{v_w, v_b\}$ and $n$ parallel directed edges from $v_w$ to $v_b$. Here $v_w$ and $v_b$ stand for `white' and `black' vertex respectively, as we sometimes treat $D_n$ as 2-coloured. The only group $\Gamma$ we will meet below will be $\mathbb{Z}_n$ (the cyclic group of order $n$). Embedded voltage graphs obtained from $D_n$ can be alternatively represented by transition graphs \cite{esz2006, ellinghamstephens2009, ellingham2014}. For our purposes, a \emph{transition graph} of order $n$ is a directed (multi-)graph with vertex set $\mathbb{Z}_n$ and edge set consisting of the union of the edges of two directed Hamiltonian cycles $C_1$ and $C_2$. The edges of $C_1$ are called \emph{solid} edges and the edges of $C_2$ are called \emph{dotted} edges of $G$. An edge from $u$ to $v$ is denoted $u {\Rightarrow} v$ if it is solid, and $u {\rightarrow} v$ if it is dotted. The edges of $G$ are a disjoint union of edges of simple directed even cycles (i.e. without repeated vertices) in $G$ with alternating edge type. The \emph{net transition} $\alpha(C)$ of one such \emph{alternating cycle} (called \emph{boundary walk} in \cite{esz2006}) $C=(v_1, \dots, v_k)$ with edges $v_1 {\Rightarrow} v_2 {\rightarrow} v_3 {\Rightarrow} \dots v_k {\rightarrow} v_1$ is $\alpha(C) = - v_1 + v_2 - v_3 \dots + v_k$. \section{Proofs for combinatorial embeddings} \label{sec.combinatorial} In this section we prove Theorem~\ref{thm.topsym}. Let $I=(G, H, \mathcal{M}, \mathcal{S})$ be a complete $n$-way interchange. Write $H = (v_0, \dots,$ $v_{2n-1})$. Suppose \begin{itemize} \item[($\star$)] $\mathcal{M}$ has an orientation preserving automorphism $\sigma$ that maps $v_i$ to $v_{i+2}$ for each $i \in \mathbb{Z}_n$.\label{prop.star} \end{itemize} Then $\mathcal{M}$ is derived from an embedded voltage graph with two vertices and $m$ parallel edges, $m \ge n$, voltage group $\Gamma = {Z}_n$ and a voltage assignment $\alpha$ such that for each $x \in \mathbb{Z}_n$ there is $e \in E(B)$ with $\alpha(e) = x$, i.e. $\alpha$ is a surjection. It follows from ($\star$) that the base embedding can be chosen so that the face bounded by $H$ is generated by a face $F_0$ of size two. We can remove edges with repetitive voltage that do not lie on $F_0$ without increasing the genus until there are exactly $n$ edges of different voltage left. So for the minimum genus problem, we may assume $G$ is $K_{n,n}$ and $m=n$. Conversely, each graph derived from $D_n$ with $\Gamma=\mathbb{Z}_n$ and a bijective voltage assignment $\alpha: E(D_n) \to \mathbb{Z}_n$ such that at least one face of the derived graph is bounded by a Hamiltonian cycle and generated by a face of size 2 has property ($\star$). \subsection{Even \texorpdfstring{$n$}{Lg}} \begin{proofof}{Theorem~\ref{thm.topsym}, even $n$. } Let $(D_n, \mathcal{M}_0, \mathcal{S}_0, \alpha)$ be the base embedded voltage graph that yields $\mathcal{M}$. Let $F_0, F_1, \dots, F_k$ denote the faces of the $\mathcal{M}_0$ and for each face $F_i$ let $k_i$ and $g_i$ denote the size and net voltage of $F_i$. Consider the sums $\sum _{i=0}^k k_i$ and $\sum _{i=0}^k g_i$ : in both sums each edge is taken into account twice (once in both directions), therefore \begin{align} \sum_{i=0}^k k_i=2n \quad\mbox{and}\quad \sum_{i=0}^k g_i \equiv 0 \pmod{n}. \label{voltages} \end{align} For every $i=0,1,\dots, k$ the face $F_i$ generates $f_i=\frac{n}{|g_i|}$ faces in the derived graph, each of which has size $k_i \cdot |g_i|$. In order to obtain the lower bound for the genus of this embedding, we will seek to maximize the sum $f=\sum_{i=0}^k f_i$. Fix a face $F_0$ of $\mathcal{M}_0$ that generates Hamiltonian faces in $\mathcal{M}$. We call a face $F$, $F \ne F_0$ of $\mathcal{M}_0$ \emph{optimal} if it generates quadrangular faces in $\mathcal{M}$. All other faces $F$, $F \ne F_0$ will be called non-optimal. Without loss of generality we assume that $F_1, \dots, F_l$ are non-optimal and $F_{l+1}, \dots, F_k$ are optimal. $F_i$ is optimal iff $k_i \cdot |g_i|=4$. So we can split the optimal faces $F_i$ into two cases: \begin{enumerate}[(1)] \item $g_i \equiv 0$ ($f_i=n$) and $k_i=4$; \item $g_i \equiv \frac{n}{2}$ ($f_i=\frac{n}{2}$) and $k_i=2$. \end{enumerate} We denote $\sum_{j=1}^l k_j=2m$. For non-optimal faces $F_j$ we have $k_j \cdot |g_j| \geqslant 6$, hence we can split them into three cases: \begin{enumerate}[1)] \item $|g_j|=1, \, k_j \geqslant 6$ and $f_j=n \leqslant k_j \cdot \frac{n}{6}$; \item $|g_j|=2, \, k_j \geqslant 4$ and $f_j=\frac{n}{2} \leqslant k_j \cdot \frac{n}{8}$; \item $|g_j| > 2$ and $f_j \leqslant \frac{n}{3} \leqslant k_j \cdot \frac{n}{6}$. \end{enumerate} Therefore \begin{align} \sum_{j=1}^l f_j \leqslant \sum_{j=1}^l k_j \cdot \frac{n}{6}=\frac{mn}{3}. \label{onethird} \end{align} Now we rewrite \eqref{voltages} as follows: \begin{align} 0 \equiv \sum_{i=0}^k g_i &\equiv g_0 + \sum_{j=1}^l g_j + \frac{2n-k_0-2m}{2} \cdot \frac{n}{2} \nonumber \\ & \equiv \begin{cases} g_0 + \sum_{j=1}^l g_j &\text{ if } k_0/2+m \text{ is even}, \\ g_0 + \sum_{j=1}^l g_j+\frac{n}{2} &\text{ if } k_0/2+m \text{ is odd}. \end{cases} \label{hamvolt} \end{align} We can also rewrite the sum $f$: \begin{align} f=\sum_{i=0}^k f_i = f_0 + \sum_{j=1}^l f_j + \frac{2n-k_0-2m}{2} \cdot \frac{n}{2}. \label{faces} \end{align} First assume that $k_0=2$. Then $|g_0|=n$, $f_0=1$ and from \eqref{hamvolt} we have that $g_0$ cannot equal to 0 or $\frac{n}{2}$ when $n>2$, hence there is at least one non-optimal face in $\mathcal{M}_0$ (i.e. $l>0$). Let $\hat{\mathcal{M}_0}$ be an embedded voltage graph which gives the lowest derived graph embedding genus among all graphs $\mathcal{M}_0$ satisfying theorem conditions with $k_0=2$. Now for even $n$ it is easy to get a transition graph that yields an embedding of $K_{n,n}$ with two Hamiltonian faces and optimal genus $n (n-2)/4$. This can be done by generalizing examples of Ellingham \cite{ellingham2014}. In particular, we can take the cycles $(C_1, C_2)$ where $C_1$ is \[ \left(\frac n 2, \frac n 2 -1, \dots, 1, \frac n 2 + 1, \frac n 2 + 2, \dots, n-1, 0\right) \] and $C_2$ is \[ \begin{cases} \left(1, 2, -2, 4, -4, \dots, - \left(\frac n 2 -1\right), 0, -1, 3, -3, 5, -5, \dots, \frac n 2\right) &\mbox{if $n \equiv 2 \,(\bmod\,4)$}, \\ \left(1, 2, -2, 4, -4, \dots, \frac n 2, 0, -1, 3, -3, 5, -5, \dots, - \left(\frac n 2 -1\right) \right) &\mbox{if $n \equiv 0 \,(\bmod\,4)$}. \end{cases} \] Note that in each case the two Hamiltonian faces are generated by two alternating 2-cycles, or 2-faces in the corresponding voltage graph: they are $(2,1)$ and $(-1, 0)$. From this construction we have a lower bound $\hat{f}$ for the number of faces in the embedding derived from $\hat{\mathcal{M}_0}$: \begin{align} \hat{f}= 1+\sum_{j=1}^l f_j+\frac{n^2-n-mn}{2} \geqslant 1+1+\frac{n^2-n-n}{2} \label{upper} \end{align} It suffices to prove that in \eqref{upper} the equality holds. From \eqref{upper} and \eqref{onethird} \begin{align*} 1+\frac{(m-1)n}{2} &\leqslant \sum_{j=1}^l f_j \leqslant \frac{mn}{3}, \mbox{ therefore}\\ 6 & \leqslant n(3-m). \end{align*} As $m>0$, $m$ equals to 1 or 2. If $m=1$, then $l=1$ and from \eqref{hamvolt} we have that $g_1 \equiv -g_0 \pmod n$ so $f_1=1$ and the equality in \eqref{upper} holds. Similarly, if $m=2$ and $l=1$, then $1+\frac{n}{2} \leqslant \sum_{j=1}^l f_j=1$, a contradiction. We are left with the case when $m=2$ and $l=2$. We have that $k_1=k_2=2$ and $f_j \leqslant \frac{n}{3}$ for $j=1, \, 2$. As $1+\frac{n}{2} \leqslant f_1+f_2$, one of $f_1$ and $f_2$ must equal to $\frac{n}{3}$ and the other one belongs to $\{\frac{n}{3}, \frac{n}{4}, \frac{n}{5}\}$. Without loss of generality let $f_1=\frac{n}{3}$. If $\gcd(\frac{n}{2}, f_1, f_2)=r>1$, then from \eqref{faces} we get $\gcd (n, f_0) \geqslant r >1$, a contradiction. Therefore $\gcd(\frac{n}{2}, f_1, f_2)=1$ and when $f_2$ equals to $\frac{n}{3}$, $\frac{n}{4}$ or $\frac{n}{5}$, then $n$ must be 6, 12 or 30 respectively. In all these cases the equality \eqref{upper} holds. This ends our proof when $k_0=2$. We have seen that in this case the maximum number of faces $\hat{f}$ does not exceed the one of construction having all quadrangular faces except from two Hamiltonian faces which has a genus $g = \frac{n(n-2)}{4}$. As any construction with $k_0>2$ yields an embedding with at least two Hamiltonian faces, it also has a genus not smaller than $\frac{n(n-2)}{4}$. \end{proofof} \subsection{Odd \texorpdfstring{$n$}{Lg}} The proof for odd $n$ is a bit trickier; $L_{C}(n)$ itself is not as simple as for even $n$. We start with two lemmas that give examples of optimal genus. \begin{lemma}\label{lem.tg} For each odd $n$, $n \ge 3$, there is a transition graph that yields an embedding of $K_{n,n}$ of genus $\lfloor \frac{n(n-1)}4 \rfloor$ with a Hamiltonian face. \end{lemma} \begin{proof} A construction for $n\equiv 3\,(\bmod\, 4)$ is as follows. For $n=3$, we can trivially take a transition graph with cycles $C_1=(0,1,2)$ and $C_2=(0,2,1)$ which yields an embedding of $K_{3,3}$ with three Hamiltonian faces. We generalize this to $n\ge 7$ by taking \begin{align*} C_1=&\left(0,1, \dots, \frac{n-1} 2, n-1, n-2, \dots, \frac{n+1} 2\right) \mbox{ and} \\ C_2=&\left(0, \frac{n+1} 2, 2, \frac{n+1} 2+2, 4, \dots, n-1,\right. \\ &\quad\quad\left.\frac{n-1} 2, n-2, \frac{n-1} 2-2, n-4, \dots, 1 \right). \end{align*} This transition graph has three alternating cycles of length two: $(0,1)$, $((n+1)/2, 0)$ and $((n-1)/2, n-1)$. Their net transition is $1$, $(n-1)/2$ and $(n+1)/2$, respectively, and all these elements have order $n$ in $\mathbb{Z}_n$. The remaining alternating cycles are of the form $(x, x+1, (n+1)/2+x+2, (n+1)/2+x+1)$ or $(x+1, x+2, (n+1)/2+x, (n+1)/2+x+1)$, thus they have size 4 and net transition 0. The derived graph has 3 Hamiltonian faces and all other faces of size $4$. A transition graph for $n \equiv 1\,(\bmod\,4)$ is \begin{align*} C_1 = &\left(\frac {n-1} 2, \dots, 1, \frac{n+1} 2, \dots, n-1, 0\right) \mbox { and} \\ C_2 = &\left(\frac{n+1} 2, 0, n-1, \frac{n-1} 2 - 2, n-3, \frac{n-1} 2 - 4, \dots, \frac {n+1} 2 + 1,\right. \\ &\quad\quad\left.1, \frac{n+1} 2 + 2, 3, \frac{n+1} 2 + 4, \dots, \frac{n-1} 2 - 1, \frac{n-1} 2\right). \end{align*} \begin{figure}[h] \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.4\linewidth]{img/tg_4k_plus_3_black.pdf} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.4\linewidth]{img/tg_4k_plus_1_black.pdf} \end{subfigure} \caption{\label{fig.tg_odd} Transition graphs for $n=7$ and $n=9$ as in the proof of Lemma~\ref{lem.tg}.} \end{figure} Again it is easy to see that this transition graph has two alternating cycles $(n-1, 0)$ and $((n-1)/2, (n-1)/2-1)$, an alternating cycle $((n+1)/2, (n+1)/2 + 1, 1, (n+1)/2, 0, (n-1)/2)$ of length 6 and net transition $-n \equiv 0\,(\bmod\, n)$ and all other alternating cycles of length 4 and net transition 0. Thus the derived embedding has two Hamiltonian faces, $n$ faces of size $6$ and all other faces of size 4. By Euler's formula its genus is $L_{C}(n) = \lfloor n (n-1)/4 \rfloor$. Both cases are illustrated in Figure~\ref{fig.tg_odd}. \end{proof} \begin{lemma}\label{lem.opt_g1g2} Let $n \ge 25$, $n \equiv 3\,(\bmod\,4)$. Suppose $g_1, g_2 \in \mathbb{Z}_n \setminus \{0\}$ and $g_1 + g_2 + 1 = 0$. Then there exists a transition graph on $n$ vertices with 3 alternating 2-cycles of net transition $1$, $g_1$ and $g_2$ respectively, and all other alternating cycles of size 4 and net transition 0. \end{lemma} The corresponding derived graph is $K_{n,n}$ with one Hamiltonian face, $n/|g_i|$ faces of size $2|g_i|$ for $i\in\{1,2\}$ and all other faces of size 4. This graph has genus $\lfloor \frac{n(n-1)} 4 \rfloor + 1 - \frac 1 2 ( \frac n {|g_1|} + \frac n {|g_2|})$. \bigskip \begin{proof} Consider solutions of \begin{align}\label{eq.abcde} \begin{cases} a = g_1 - b\\ d = g_2 - c\\ e = b + c \ \end{cases} \end{align} with unknowns $a,b,c,d,e \in \mathbb{Z}_n$, operations modulo $n$ and a restriction that $a,b,c,d,e, -a,-b,-c,-d,-e$ are all distinct and avoid $\{0, 1, -1\}$. We claim that (\ref{eq.abcde}) always has a feasible solution. Indeed, let $b$ and $c$ be taken independently and uniformly at random from $\mathbb{Z}_n$. Define $a$, $d$ and $e$ according to (\ref{eq.abcde}). Let $A$ be the event that $-a,a$,$-b,b$, $0,-1,1$ are all distinct, and additionally $b \ne -g_2$. Since $n$ is odd, $x \in \mathbb{Z}_n \setminus \{0\}$ implies $x \ne -x$. Also for $y \in \mathbb{Z}_n$ there is a unique solution of $2x = y$, which we denote $y/2$. $A$ occurs if and only if $b \not \in \{0, \pm 1, -g_2\}$ and $a \not \in \{0, \pm 1, \pm b\}$, which is equivalent to the event $b \not \in \{0, -1, 1,$ $g_1, g_1 -1,$ $g_1 + 1, g_1/2, -g_2\}$. So \[ {\mathbb P}\,(A) \ge 1 - \frac 8 n. \] Similarly, let $B$ be the event that $a$, $b$, $c$, $d$, $e$, $1$ and their negations are distinct and non-zero. For $a$ and $b$ such that $A$ occurs \begin{align*} {\mathbb P}\,(B | a,b) &= {\mathbb P}\,(c \not \in \{0, \pm 1, \pm a, \pm b\} \cap d \not \in \{0, \pm 1, \pm a, \pm b, \pm c\} \cap \\ &\quad\quad\quad e \not \in \{0, \pm 1, \pm a, \pm b, \pm c, \pm d\}) \\ &= {\mathbb P}\,(c \not \in \{0, \pm 1, \pm a, \pm b, g_2, g_2 \pm 1, g_2 \pm a, g_2 \pm b, g_2 - g_1 +b, g_2/2, \\ & \quad\quad\quad -b, -b \pm 1, -b \pm a, -2b, -b/2, (g_2 - b)/2\}) \ge 1 - \frac {24} n. \end{align*} So for $n \ge 25$ \[ {\mathbb P}\,(B) = {\mathbb P}\,(B|A) {\mathbb P}\,(A) \ge \left(1- \frac 8 n\right) \left(1 - \frac {24} n\right) > 0. \] We further consider $(a,b,c,d,e)$ as a fixed solution of (\ref{eq.abcde}). Let $t=(n-1)/2$. Pick (we can always do it; in fact, we can do it in $e^{\Omega(n \ln n)}$ ways) a sequence $s_1=(v_0, v_1, \dots, v_t)$, such that \begin{enumerate} \item For each $x \in \mathbb{Z}_n \setminus \{0\}$, $s_1$ contains exactly one of $\{-x, x\}$. \item $v_0=0$, $v_1=1$, $v_k = a$, $v_{k+1}=b$, $v_l= c$, $v_{l+1} = d$ and $v_t = e$, where $k$ and $l$ are even and $1 < k < l < t$. \end{enumerate} Define $s_2=(-v_1, \dots, -v_t)$. Then the elements of $s_1$ and $s_2$ partition $\mathbb{Z}_n$. We will construct the transition graph by adding solid and dotted edges to an empty graph on vertex set $\mathbb{Z}_n$. First add directed paths of solid directed edges \begin{align*} &P_1=(v_0,v_1,\dots, v_k),\\ &P_2=(-v_1, -v_2, \dots, -v_k, v_{k+1}, v_{k+2}, \dots, v_l), \\ &P_3=(-v_{k+1}, -v_{k+2}, \dots, -v_l, v_{l+1}, v_{l+2}, \dots, v_t) \quad \mbox{and} \\ &P_4=(-v_{l+1}, -v_{l+2}, \dots, -v_t). \end{align*} Next, add dotted edges $(v_{k+1}, -v_k) $, $(v_{l+1}, -v_l)$ and $(v_1,v_0)$ (i.e., the edges $(b, -a)$, $(d, -c)$ and $(1,0)$). These edges complete three alternating 2-cycles of net transition $a+b = g_1$, $c+d = g_2$ and $1+0=1$ respectively, see Figure~\ref{fig.g1g2_odd}. Now for every $i \in \{1, \dots, t-1\} \setminus \{k, l\}$ add dotted directed edges $(v_{i+1}, -v_i)$ and $(-v_{i+1}, v_i)$, this yields an alternating 4-cycle $v_i {\Rightarrow} v_{i+1} {\rightarrow} -v_i {\Rightarrow} -v_{i+1} {\rightarrow} v_i$ of net transition $v_{i+1} + v_i - v_{i+1} - v_i = 0$. Since $k$ and $l$ are even and $t$ is odd, all the dotted edges added so far yield the following paths that go backwards alternating between $s_1$ and $s_2$: \begin{align*} &P_1'=(-v_t, v_{t-1}, -v_{t-2}, \dots, -v_{l+1}), \\ &P_2' =(v_t, -v_{t-1}, v_{t-1}, \dots, \\ & \quad \quad \quad \quad\quad\quad v_{l+1}, -v_l, v_{l-1}, -v_{l-2}, \dots, v_{k+1}, -v_k, v_{k-1}, \dots, -v_2, v_1, v_0), \\ &P_3'=(v_l, -v_{l-1}, \dots, -v_{k+1}) \quad \mbox{and} \\ &P_4'=(v_k, -v_{k-1}, \dots, -v_1). \end{align*} \begin{figure} \centering \includegraphics[width=0.75\linewidth]{img/g1g2.pdf} \caption{\label{fig.g1g2_odd} Construction of the proof of Lemma~\ref{lem.opt_g1g2} (adding cycles $A_1$ and $A_2$ would complete the transition graph).} \end{figure} Finally, add two alternating 4-cycles: \begin{align*} &A_1= c {\Rightarrow} {-b} {\rightarrow} {-e} {\Rightarrow} 0 {\rightarrow} c = (v_l, -v_{k+1}, -v_t, v_0)\quad\mbox{and} \\ &A_2 = e {\Rightarrow} {-d} {\rightarrow} a {\Rightarrow} {-1} {\rightarrow} e = (v_t, -v_{l+1}, v_k, -v_1). \end{align*} Notice that the edges of $A_1$ and $A_2$ complete a solid Hamiltonian cycle $(P_1P_2P_3P_4)$ and a dotted Hamiltonian cycle $(P_1'P_4'P_2'P_3')$, where for paths $A$, $B$ we use notation $AB$ to denote the concatenation of their vertices in the obvious way. To complete the proof, we have to check that $A_1$ and $A_2$ both have net transition $0$. The net transition of $A_1$ is $-c - b + e = 0$ since $e=b+c$. The net transition of $A_2$ is \[-e - d - a -1 = -(a+d + e +1) = - (a+d+b+c+1) = -(-1 + 1)=0.\] In the last step we used $a+b+c+d = g_1+g_2 = -1$, which follows from the first two equations of (\ref{eq.abcde}) and the theorem's assumption. \end{proof} \bigskip We are now ready to complete the proof of Theorem~\ref{thm.topsym}. \medskip \begin{proofof}{Theorem~\ref{thm.topsym}, odd $n$.} We continue with notation from the proof for even $n$. We first prove the lower bound. In the end of this proof we will show that it is optimal. Let $s_1, \dots, s_f$ be the sizes of the faces of $\mathcal{M}$. Let $v$, $e$, and $g$ denote the number of vertices, the number of edges and the genus of $\mathcal{M}$ respectively. Denote the \emph{excess} of $\mathcal{M}$ by \[ {\rm ex} = \sum_i (s_i - 4) = 2e - 4f = 2 n^2 - 4 f. \] By Euler's formula ${\rm ex} = 8g - 2e + 4v - 8 = 8g - 2n^2 + 8n - 8$. So using the definition of $L_{C}(n)$, in order to prove the inequality stated in the theorem, it suffices to show \begin{align}\label{eq.ex_to_show} {\rm ex} \ge \begin{cases} 6n - 4 - 4\left(p_1 + \frac n {p_1}\right), &\mbox{if } n \equiv 3\,(\bmod\,4), n \ne p_1 \mbox{ and } p_1^2 \nmid n, \\ 6n - 4 - 4\left(1 + \frac n {p_1}\right), &\mbox{if } n \equiv 3\,(\bmod\,4) \mbox{ and } (p_1^2 \mid n \mbox { or } n=p_1), \\ 6n - 16, &\mbox{if } n \equiv 1\,(\bmod\,4), 3 \mid n \mbox { and } 9 \nmid n, \\ 6n - 8, &\mbox{if } n \equiv 1\,(\bmod\,4) \mbox{ and } (3 \nmid n \mbox { or } 9 \mid n). \\ \end{cases} \end{align} Since $g$ is integer, we must have \begin{equation} \label{eq.div8} \begin{cases} 6n-8 - {\rm ex} \equiv 0\,(\bmod\,8) &\mbox{for } n \equiv 1\,(\bmod\,4), \\ 6n - 12 - {\rm ex} \equiv 0\,(\bmod\,8) &\mbox{for } n \equiv 3\,(\bmod\,4). \end{cases} \end{equation} With voltage group $\mathbb{Z}_n$ a face $F$ of size $k$ and voltage $h$ contributes \begin{equation}\label{eq.ex_face} {\rm ex}(F) = \frac n {|h|} (k|h| - 4) = n k - \frac {4n} {|h|} \end{equation} to the excess of the derived embedding. Note that since each face $F$ in $\mathcal{M}$ has size at least 4, ${\rm ex}(F) \ge 0$. Suppose there exists an embedding $\mathcal{M}$ of $K_{n,n}$ as in the statement of the theorem, but with genus smaller than $L_{C}(n)$, i.e. suppose that (\ref{eq.ex_to_show}) does not hold. Let $B=(D_n, \mathcal{M}_0, \mathcal{S}_0, \alpha)$ be the corresponding base graph as before. Note that the faces of $\mathcal{M}_0$ have even sizes and the orders of their voltages are divisors of $n$, in particular they are odd. Then $|g_0| = 2n/{k_0}$ and by (\ref{eq.ex_face}) ${\rm ex} \ge {\rm ex}(F_0) = k_0(n-2)$. For $k_0 \ge 8$ (\ref{eq.ex_to_show}) holds. It cannot be $k_0=6$ either, since in this case $3 \mid n$, so $n$ is not prime and by (\ref{eq.div8}), (\ref{eq.ex_to_show}) still holds. The only case where we could have equality in (\ref{eq.ex_to_show}) for $k_0=6$ is $n \equiv 1\,(\bmod\,4)$ and $9 \mid n$. Also $k_0 \ne 4$, since $4 \nmid 2n$. Thus for $B$ to be a counterexample we must have $k_0 = 2$, $|g_0|=n$ and ${\rm ex}(F_0) = 2n-4$. Since orders of elements are preserved under a group automorphism, we can assume without loss of generality that $g_0=1$. For any face of $\mathcal{M}_0$, we have that ${\rm ex}(F) = 0$ if and only if $F$ has size $4$ and voltage $0$. As before, we call such faces $F$ \emph{optimal}, and the remaining faces $F$, $F \ne F_0$ non-optimal. We assume that $F_1, \dots, F_l$ are all the non-optimal faces of $B$, and using $g_0 = 1$ and (\ref{voltages}) we have \begin{equation}\label{eq.gsum} 1 + g_1 + \dots + g_l = 0. \end{equation} For a non-optimal face we have $g_i = jn/|g_i|$ for some $j \in \{0, |g_i| - 1\}$, so \begin{equation}\label{eq.gcd} \gcd(n/|g_1|, \dots, n/|g_l|)=1. \end{equation} Let $F_i$ be non-optimal. As $K_{n,n}$ has no repeated edges, $g_i$ can only be zero if $k_i \ge 6$. Using (\ref{eq.ex_face}) we have ${\rm ex}(F_i) \ge 2n-4n/3 = 2n/3$. Thus if $B$ is a counterexample to (\ref{eq.ex_to_show}), then $2n-4 + 2 l n/3 \le {\rm ex}< 6n - 8$ which implies $l \le 5$. If $F_i$ has size $k_i \ge 8$, then \[ {\rm ex} \ge {\rm ex}(F_0) + {\rm ex}(F_i) \ge 2n -4 + k_i n - 4n \ge 6n -4 \] and again (\ref{eq.ex_to_show}) holds. Similarly, there cannot be any face of size $6$ and voltage $g$ with $g \bmod\,n \ne 0$, since in this case $|g| \ge 3$ and ${\rm ex} \ge 2n-4 + 6n - 4n/3 > 6n-8$. Using (\ref{eq.gsum}), the fact that the right side of (\ref{eq.ex_face}) increases with $|h|$ and the above observations we conclude that (\ref{eq.ex_to_show}) holds with inequality unless perhaps \begin{enumerate} \item some non-optimal face, say $F_1$, has size 6, $g_1=0$, $l = 3$, the other non-optimal faces $F_j$, $j \ge 2$ have size 2 and $|g_j| \in \{3, 5\}$ (in the case $l=2$, $|g_2| = n$ by (\ref{eq.gsum}), so (\ref{eq.ex_to_show}) holds with equality) or \item some non-optimal face, say $F_1$, has size $4$, $l = 2$ and $g_1,g_2 \in \{3,5\}$ (if $l=1$ and $|g_1|=n$ and (\ref{eq.ex_to_show}) holds with equality). \end{enumerate} Note that (\ref{eq.gcd}) implies that $n \le \prod_{i=1}^l |g_i|$. In particular, if a counterexample $B$ has a non-optimal face which has size 4 or 6, then $n \le 15$ and it can be easily checked using (\ref{eq.ex_face}) only that (\ref{eq.ex_to_show}) holds for all such $n$. So we may further assume that all non-optimal $F_i$ have $k_i = 2$. By (\ref{voltages}) $2n = 2 (l+1) + 4 n_{opt}$ where $n_{opt}$ is the number of optimal faces in $\mathcal{M}_0$. So $l = n - 1 - 2n_{opt}$ is even. By (\ref{eq.gsum}) $l>0$, therefore $l \in \{2,4\}$. Let us assume that $n=|g_0| \ge |g_1| \ge \dots \ge |g_l|$. If $l=4$, then $(|g_1|, \dots, |g_l|)$ cannot equal $(5,5,3,3)$ or $(7,5,3,3)$ as in these cases by (\ref{eq.gcd}) $n$ is 15 or 105 respectively, so by (\ref{eq.ex_face}) the inequality (\ref{eq.ex_to_show}) holds. For $(|g_1|, .., |g_l|) = (q, 5, 3, 3)$ with $q \ge 9$, we have by (\ref{eq.ex_face}), that ${\rm ex} > 6n-4$. Since the right side of (\ref{eq.ex_face}) is increasing in $|h|$, it follows by (\ref{eq.gcd}) that $|g_1|=q$ and $|g_2|=|g_3|=|g_4| = 3$, where either $q=n$ or $n= 3 q$ for some $q$ not a multiple of $3$. In the former case ${\rm ex} = 2 (2n-4) + 3 (2n - 4n/3) = 6n -8$, so (\ref{eq.ex_to_show}) holds with equality. In the latter case \[ {\rm ex} = 2n - 4 + 2n - 4n/q + 3(2n - 4n/3) = 6n - 16. \] Using (\ref{eq.div8}) this is only possible for $n \equiv 1\,(\bmod\,4)$, $3 \mid n$ and $9 \nmid n$, so in both cases (\ref{eq.ex_to_show}) holds with equality as well. It remains to consider the case $l=2$. Suppose $|g_1| = q$ and $|g_2|=p$ with $p \le q$. Recall that $p \ge 3$. By (\ref{eq.gcd}) we have $p q = n \gcd(p,q)$ and \[ {\rm ex} = 2n-4 + 2n - \frac {4n} q + 2n - \frac {4n} p = 6n - 4 - 4 a(p,q). \] where $a(p,q) = n/q + n/p$. As $a(p,q) = (p+q) / \gcd(p,q)$, it is even, so by (\ref{eq.div8}) such excess is only possible for $n \equiv 3\,(\bmod\,4)$. Thus \[ {\rm ex} \ge 6n - 4 - 4 \max_{(p,q)\in S} a(p,q) \] where the set $S$ consists pairs $(p,q)$ of divisors of $n$ with $\gcd(n/p, n/q) = 1$ and $p, q > 1$. For a prime $y$ and a positive integer $x$, let ${\rm mul}(x,y)$ denote the largest integer $k$ such that $y^k \mid x$. (\ref{eq.gcd}) implies that for each prime factor $r$ of $n$ either ${\rm mul}(p,r)={\rm mul}(n,r)$ or ${\rm mul}(q,r) = {\rm mul}(n,r)$. First note that $a(p, n) \le a(p_1, n)$ for any divisor $p$ of $n$ such that $p > 1$. $(p,q)=(p_1,n)$ will be our first candidate to minimize ${\rm ex}$. For such $(p,q)$ we have ${\rm ex} = 6n - 4 - 4 (1 + n/p_1)$ as in the second case of (\ref{eq.ex_to_show}). Now suppose $q < n$. If $\gcd(p,q) > 1$, let $r$ be a prime that divides both $q$ and $p$. If ${\rm mul}(q,r) = {\rm mul}(n,r)$ define $p' = p/r^{{\rm mul}(p,r)}$ and notice that $a(p',q) > a(p,q)$ and $(p',q) \in S$. (To see that $p'$ cannot equal $1$, note that this would imply ${\rm mul}(q,r) = {\rm mul}(n,r)$ for all $r \mid n$, so $q=n$.) Similarly, if ${\rm mul}(p,r) = {\rm mul}(n,r)$ we can define $q' = q/{\rm mul}(q,r)$ and get $a(p,q') > a(p,q)$. Repeating this for all $r$ that divide $\gcd(p,q)$ we obtain $(p',q') \in S$ such that $a(p',q') > a(p,q)$, $\gcd(p', q')=1$ and so $p' q'=n$. Without loss of generality we can further focus on the set $S_1$ of pairs $(p,q) \in S$ with $p \le q$, $pq = n$ and $\gcd(p,q) = 1$. When $p$ has at least two unique prime divisors, say $p=r^k b$ where $r$ is prime, $b>1$ and $r \nmid b$, we can define $p' = p/r^k$ and $q'=q r^k$. Then $a(p',q') = p/r^k + q r^k > p + q = a(p,q)$. Thus if $q < n$ \[ a(p,q) \le \max_{r} a(r^{{\rm mul}(n,r)}, n/r^{{\rm mul}(n,r)}) \] where the maximum is over all prime divisors of $n$. Suppose the smallest prime divisor $p_1$ of $n$ has multiplicity 1. If $n$ is prime, then $p_1=p=q=n$ and $a(p,q) = 2$ is the only possibility, in which case (\ref{eq.ex_to_show}) holds with equality. Otherwise, for $(p,q) \in S_1$, we have $p_1 \le p \le \sqrt n$. Since $f(s) = a(s, n/s) = s + n/s$ is decreasing in the interval $(0, \sqrt n\,]$, we have $a(p_1, n/p_1) > a(p, n/p)$ when $p > p_1$. So when ${\rm mul}(p_1, n) =1$ and $(p,q) \in S_1$ \[ a(p,q) \le \max(a(p_1, n/p_1), a(p_1, n)) = a(p_1, n/p_1). \] Now suppose $p_1^2$ divides $n$. Then a maximum $a(p,q)$ over $(p,q) \in S_1$ could be attained either with $p= r^t$ or $q=r^t$ for some prime divisor $r$ of $n$, $t={\rm mul}(n,r)$ and $q = n/p$ or with $p=p_1$ and $q=n$. We claim that it is always the latter. To see this, first note that this is true for $n$ a prime power. If $n$ is not a prime power, take $r$ that maximizes $a(r^t, n/r^t)$. Note that $r^t < b$, where $b=n/r^t$, otherwise we could replace $r$ with another prime divisor $r_2$ of $n$ and get a larger value of $a$. So $r < b$ and for $t \ge 2$ \begin{align*} a\left(r, n\right) - a\left(r^t, \frac n {r^t} \right) &= b r^{t-1} + 1 - b - r^t \\ &=(r^{t-1} - 1) (b-r) - (r-1) > 0 \end{align*} and $a(r^t,n/r^t) < a(r,n) \le a(p_1,n)$. For $t=1$, writing $n=p_1^2 r x$ we get \begin{align*} a(p_1, n) - a(r, n/r) &= p_1 r x + 1 - p_1^2 x - r \\ &=p_1(r-p_1)x + 1-r \ge p_1(r-p_1) + (1-r) \\ &=(p_1 - 1) (r-p_1-1) > 0. \end{align*} In both cases $a(r^t, n/r^t) < a(p_1, n)$. This finishes the proof of (\ref{eq.ex_to_show}). Let us show that (\ref{eq.ex_to_show}) is best possible. If $n$ is prime or $n \equiv 1 \,(\bmod\,4)$ and ($3 \nmid n$ or $9 \mid n$), Lemma~\ref{lem.tg} gives a construction of genus $L_{C}(n)$. Suppose $n \equiv 3 \,(\bmod\,4)$ and $p$ is not prime. The first few such $n$ are $15, 27, 35$. If $p_1^2 \nmid n$, let $(p,q) = (p_1, n/p_1)$, otherwise let $(p,q) = (p_1, n)$. Since $n/p$ and $n/q$ are relatively prime, by Euclid's algorithm we can find $g_1, g_2 \in \mathbb{Z}_n$ such that \begin{equation}\label{eq.gg1} g_1 + g_2 + 1 \equiv 0 \, (\bmod\,n), \quad |g_1|=p \quad \mbox{and} \quad |g_2| = q. \end{equation} For $n=15$ the transition graph corresponding to genus $L_{C}(15)=49$ embedding is given by \begin{align*} & C_1 = (0, 1, 2, -1, -2, 3, 4, -3, -4, 5, 6, 7, -5, -6, -7) \\ & C_2 = (7, -6, 5, -4, 3, -2, 1, 0, 4, -3, -7, 6, -5, 2, -1). \end{align*} It was found by computer and inspired Lemma~\ref{lem.opt_g1g2}. It corresponds to choices $g_1 = 5$, $g_2=9$ $a= (g_1-1)/2, b=a+1, c=(g_2 -1)/2, d=c+1$ and $s_1 = (0,1, \dots, 7)$ in that lemma. For other $n$, since they are larger than $25$, we can apply Lemma~\ref{lem.opt_g1g2}. Finally, suppose $n \equiv 1 \,(\bmod \, 4)$, $3 \mid n$ but $9 \nmid n$. The smallest such $n$ are $21, 33, 57$. Let $(p,q) = (3, n/3)$ and define $g_1, g_2$ by solving (\ref{eq.gg1}). Define $g_3=n/3$ and $g_4 = -n/3$. Then \[ g_1 + g_2 + g_3 + g_4 + 1 = 0. \] Construct a transition graph as in the proof of Lemma~\ref{lem.opt_g1g2}, but with the following modification: after choosing suitable $a$, $b$, $c$, $d$ and $e$, choose $f \in \mathbb{Z}_n$, such that $f \not \in \{ {-x}, x\}$ and $f \not \in \{x-n/3, {-x}-n/3\}$ for $x \in \{0, 1, a, b, c, d, e\}$, and $-f \ne f+n/3$. We have at least $n-27$ possibilities for $f$. Assuming $n > 27$, we construct a transition graph as in the proof of Lemma~\ref{lem.opt_g1g2} but additionally require that $v_m = f$ and $v_{m+1}=f+n/3$ for some $m$, $l+1 < m < t$, where $l, m$ and $t$ are as in Lemma~\ref{lem.opt_g1g2}. This construction has the same properties as the construction for $n=4k+3$, except now $t$ is even and the paths $P_3'$ and $P_4'$ have their endpoints switched, so the dotted edges make up two cycles instead of a single Hamiltonian cycle. We can remedy this by replacing the dotted edges $(v_{m+1}, -v_{m})$ and $(-v_{m+1}, v_{m})$ with $(v_{m+1}, - v_{m})$ and $(-v_{m+1}, -v_{m})$. This eliminates one alternating 4-cycle and introduces two new 2-cycles $(v_{m}, v_{m+1})$ and $(-v_{m}, -v_{m+1})$ with net transition $n/3$ and $-n/3$ respectively. Thus in the corresponding voltage graph we have 2-faces of orders $n/3, 3, 3,3,3$ and genus $L_{C}(n)$ as required. Finally, a similar construction also exists for $n=21$. The transition graph is given by \begin{align*} C_1 = (0, 1, 5, -1, -5, 9, 7, 6, 8, -9, -7, -6, -8, -2, 3, 10, -4, 2, -3, -10, 4) \\ C_2 = (4, 10, 3, 2, 5, -1, -4, -10, -3, -2, -8, 6, -7, 9, -5, 1, 0, 8, -6, 7, -9) \end{align*} \end{proofof} \section{Proofs for 3-dimensional embeddings} \subsection{Proof of the lower bound: the geometric part} \label{sec.geom.lower1} All surfaces in this section will be embedded in $\mathbb{R}^3$, compact and piecewise linear. A \emph{piecewise linear curve}, or simply a \emph{curve}, on a surface $\mathcal{S}$ is a piecewise linear map $f: [0,1] \to \mathcal{S}$. We call a curve a \emph{simple arc}, or simply an \emph{arc}, if it is injective. We call it a \emph{simple closed curve}, or simply a \emph{closed curve}, if it is injective on $[0,1]$ with an exception that $f(0) = f(1)$. We call a curve \emph{simple} if it is an arc or a closed curve. The endpoints of a (closed or non-closed) curve $f$ are $f(0)$ and $f(1)$, and we say that $f$ goes from $f(0)$ to $f(1)$. We say that a curve $f$ is \emph{internally disjoint} from a set $X$ if $f$ is closed or $f(x) \not \in X$ for all $x \in (0,1)$. For convenience, we make no distinction between a curve $f$ and its image $f([0,1])$ when it is clear from the context. Let $a$ and $b$ be two simple curves on a surface $\mathcal{S}$ such that no endpoint belongs to the other curve and $a \cap b$ is finite. Then each point in $x \in a \cap b$ can be classified as a touching or crossing, see \cite{juvanmalnicmohar1996, malnicnedela1995} and references therein. Fix an orientation of $\mathcal{S}$. Define the \textit{intersection sign} $\sigma(x,a,b) \in \{-1, 0, 1\}$ as shown in Figure~\ref{fig.intersection_type}. \begin{figure}[h] \centering \includegraphics[scale=0.75]{img/crossing_example.pdf} \caption{The sign $\sigma(x,a,b)$ of the intersection point $x$ between a solid black curve $a$ and a dotted red curve $b$.} \label{fig.intersection_type} \end{figure} More formally, in a small neighbourhood $U \subset \mathcal{S}$ of $x$, we can represent $a$ as a segment (i.e., an arc) $a_{in}$ that ends at $x$ and a segment $a_{out}$ that starts at $x$, so that $a_{in} \cap a_{out} = \{x\}$ and $a_{in} \cup a_{out} = a \cap U$. Similarly we can define $b_{in}$ and $b_{out}$. We set $\sigma(x, a,b) = -1$, if the cyclical clockwise ordering around $x$ of the segments incident to $x$ is $(a_{in}, b_{in}, a_{out}, b_{out})$. We set $\sigma(x, a,b)=1$ if the ordering is $(b_{out}, a_{out}, b_{in}, a_{in})$. Otherwise, we set $\sigma(x,a,b)=0$ (i.e. the intersection is a touching). In the case $x$ is an endpoint of either curve we may define $\sigma(x,a,b) = 0$; this case can always be avoided by a small local modification. Let $a$ be a simple curve on an oriented surface $\mathcal{S}$ and $C$ a finite set of pairwise disjoint simple curves on $\mathcal{S}$. Suppose $a$ shares with each curve in $C$ a finite number of points. We define \[ \sigma(a, C) = \sum_{b \in C} \sum_{x \in a \cap b} \sigma(x, a,b). \] Now let $\mathcal{M}$ be an embedding of a directed multigraph $G$ into a connected oriented surface $\mathcal{S} \subset \mathbb{R}^3$, and let $C$ be a set of pairwise disjoint simple curves on $\mathcal{S}$. For $e \in E(G)$ let $\mathcal{M}(e)$ be the simple curve on $\mathcal{S}$ assigned to $e$ by $\mathcal{M}$. Given a positive integer $n$, the \emph{voltage assignment} function $\alpha_{\mathcal{M}, C, n}: E(G) \to \mathbb{Z}_n$ is \emph{well defined} if for each edge $e \in E(G)$, $\mathcal{M}(e)$ shares with each curve in $C$ a finite number of points and $\mathcal{M}(G)$ is disjoint from the endpoints of each curve in $C$. In that case for $e \in E(G)$ we set \begin{equation}\label{eq.cutvolt} \alpha_{\mathcal{M},C, n}(e) = \sigma(\mathcal{M}(e), C) \bmod n. \end{equation} To study symmetric embeddings, and more generally immersions, of a surface into $\mathbb{R}^3$ we can use the following approach, see \cite{undine}. Given a surface $\mathcal{S}' \subset \mathbb{R}^3$ which is invariant under the action of a finite subgroup $\Gamma$ of orientation preserving Euclidean isometries in $\mathbb{R}^3$, we can define the quotient mapping $q$ from $\mathbb{R}^3$ to the orbifold $\mathbb{R}^3 / \Gamma$, the quotient space obtained by identifying each orbit of $\Gamma$ to a single point and equipped with a suitable topology. For $n$-fold rotational symmetry the corresponding quotient \emph{surface}, or orbifold, $\mathcal{S}' / \Gamma$ is a closed and orientable surface, and the map $q$ restricted to $S$ is a branched covering of $\mathcal{S}' / \Gamma$ with an even number of branch points. We additionally have an embedding of a graph $G'$ into $\mathcal{S}'$ and we ask that this embedding is invariant under $\Gamma$. As above, we can then define an embedding of a quotient graph $G$ in $\mathcal{S}' / \Gamma$. We will give a proof of the next rather straightforward proposition as we were unable to find a suitable equivalent in the literature. \begin{prop}\label{prop.cuts} Let $n\ge 3$ and $g' \ge 0$ be integers, and let $G$ be a directed connected multigraph and $G'$ a connected multigraph. The two statements below are equivalent. \begin{enumerate}[(a)] \item There is a piecewise linear embedding $\mathcal{M}'$ of $G'$ into a closed connected oriented surface $\mathcal{S}' \subset \mathbb{R}^3$ of genus $g'$ such that $\mathcal{M}'$ has $n$-fold rotational symmetry, some vertex of $\mathcal{S}'$ is a fixed point under the rotation, but no vertex of $G'$ is mapped to a fixed point. \item There is a piecewise linear embedding $\mathcal{M}$ of $G$ into a closed connected oriented surface $\mathcal{S} \subset \mathbb{R}^3$ together with a set $C$ of pairwise disjoint arcs or closed curves on $\mathcal{S}$, such that the number of arcs (non-closed curves) in $C$ is $t$, $t \ge 1$, the genus $g$ of $\mathcal{S}$ satisfies $n g + (n-1) (t-1)=g'$, $\alpha_{\mathcal{M}, C,n}$ is well defined and $G'$ is isomorphic to the graph derived from the voltage graph $(G, \alpha_{\mathcal{M}, C,n})$ and voltage group $\mathbb{Z}_n$. \end{enumerate} \end{prop} For a simple example with $G'$ a complete bipartite graph $K_{3,3}$ and $G$ a dipole $D_3$ see Figure~\ref{fig.sym3}. In the special case when $\mathcal{M}$ is 2-cell, $\mathcal{M}'$ is just the derived embedding from the embedded voltage graph $(G, \mathcal{M}, \mathcal{S}, \alpha_{\mathcal{M}, C,n})$ realised in $\mathbb{R}^3$ and voltage group $\Gamma=\mathbb{Z}_n$. When $\mathcal{S}'$ has no fixed points under the rotation, our proof below shows that (a) still implies (b) with $t=0$, however in the opposite direction we can end up with a disconnected surface $\mathcal{S}'$ even if $\mathcal{S}$ is connected. \bigskip \begin{proof} In this proof we only deal with oriented surfaces $\mathcal{S} \subset \mathbb{R}^3$ where each boundary component can be represented by a closed curve $c$ on $\mathcal{S}$. An arbitrary point $x \in c$ can be chosen as both the start and the end point. $c$ can be given two possible directions. The intersection of $c$ with a sufficiently small neighbourhood around $x$ (which is homeomorphic to a half-disk) in $\mathcal{S}$ can be represented by a segment $c_{out}$ outgoing from $x$ and a segment $c_{in}$ incoming to $x$. The clockwise ordering of these segments at $x$ does not depend on $x$. If the ordering is $(c_{out}, c_{in})$ we say that \emph{the points of $\mathcal{S}$ are on the right of $c$}. Otherwise, if the ordering is $(c_{in}, c_{out})$, we say that \emph{the points of $\mathcal{S}$ are on the left} of $c$. \textit {Proof of $(a)\!\implies\!(b)$.} Let $a$ be the $n$-fold rotation symmetry axis of $\mathcal{M}'$. Let $r: \mathbb{R}^3 \to \mathbb{R}^3$ be the rotation around $a$ by $2 \pi / n$. Fix any $n$ half-planes $P_0, \dots, P_{n-1}$ containing $a$ as their common boundary, such that $r(P_j) = P_{ (j+1) \bmod n}$. Denote $X_j=P_j \cap \mathcal{S}'$. $P_0, \dots, P_{n-1}$ make up the boundaries of $n$ infinite prisms $\Pi_0, \dots, \Pi_{n-1}$ with pairwise disjoint interiors, where $\Pi_j$ is bounded by (and includes the points of) $P_j$ and $P_{ (j+1) \bmod n}$. Let $\mathcal{S}_j = \Pi_j \cap \mathcal{S}'$. Since $\mathcal{M}'$ is piecewise linear and $\mathcal{S}'$ is a surface, we can choose $P_0, \dots, P_{n-1}$ so that \begin{itemize} \item For $j \in \{0, \dots, n-1\}$, $X_j$ is a union of a finite number of (images of) pairwise disjoint simple curves in $\mathcal{S}_j$ (and $\mathcal{S}'$). We assume the direction of each curve $c \in X_j$ is chosen so that the points of $\mathcal{S}_j$ are on the right of $c$. \item Each arc in $X_0$ starts and ends in $a$, and each curve in $X_0$ is internally disjoint from $a$. Define $B$ by $B=\mathcal{S}\cap a = X_0 \cap a$. Then $|B|$ is even and $|B|=2t$ where $t$ is the number of arcs in $X_0$. \item The curves in $X_0$ are internally disjoint from $\mathcal{M}'(V(G'))$. \item For each $e \in E(G')$, the curve $\mathcal{M'}(e)$ shares with $X_0$ a finite number of points. \end{itemize} Now for each $e \in E(G')$, the curve $c_e=\mathcal{M}'(e)$ is disjoint from $B$. Indeed, suppose on the contrary that $a$ and $\mathcal{M}'(e)$ contain a point $x$ in common. Then $x$ must belong to the interior of $c_e$, since $\mathcal{M}'(V(G'))$ contains no fixed points. If $c_e$ is tangent to $a$ at $x$, then, by considering the orbit (under the rotation) of the region incident to $e$, we see that since $n\ge 3$, $\mathcal{S}$ is not locally homeomorphic to the Euclidean plane at $x$ (see, e.g., proof of Theorem 78.1 of \cite{munkres}). Otherwise, by considering the orbit of $c_e$ in the neighbourhood of $x$, we see that $\mathcal{M}'$ is not a proper embedding, a contradiction. Identifying each point $x \in X_0$ with $r(x) \in X_1$ we obtain from $\mathcal{S}_0$ a quotient surface $\mathcal{S}$. $\mathcal{S}$ can be represented as a piecewise linear embedding in $\mathbb{R}^3$, for example, as the image of $\mathcal{S}_0$ under a piecewise linear approximation $\tilde{f}$ of a function $f: \Pi_0 \to \mathbb{R}^3$, where $f$ rotates $x$ around $a$ by angle $n \theta$ if $x$ is at angle $\theta$ with $P_0$. We further assume that $\mathcal{S} = \tilde{f}(\mathcal{S}_0)$. Note that $C = \tilde{f}(X_0) := \{\tilde{f} \circ c : c \in X_0\}$ is then a finite set of arcs (we call them \emph{cuts}) and closed curves (we call them \emph{cut loops}) on $\mathcal{S}$. Let $p$ map $x \in \mathbb{R}^3$ to the unique point $p(x) \in \Pi_0 \setminus P_1$ in the orbit of $x$ under the $n$-fold rotation and let $h = \tilde{f} \circ p$. Restricted to $\mathcal{S}'$, $h$ is a branched covering, the covered surface is $\mathcal{S}$ and $B$ is the set of branch points, each of order $n$. It is easy to see that $\mathcal{S}$ is closed and orientable. Since $\mathcal{S}'$ contains a fixed point under the rotation, it follows that $\mathcal{S}$ is connected. Since $\mathcal{M}'(V(G'))$ avoids fixed points, we have that this set is mapped to a set $V$ of size $|V(G')| / n$ by $h$. For any $e \in E(G')$ $\mathcal{M}'(e)$ can be considered a simple curve, so we can define a function $m_e$ by $m_e(x) = h(\mathcal{M}'(e)(x))$ $x \in [0,1]$. Since $\mathcal{M}'(e)$ avoids $B$, $m_e$ is a simple curve. As $n \ge 3$, the orbit of $\mathcal{M}'(e)$ under the rotation corresponds to $n$ distinct edges of $G'$, all of which are mapped to $m_e$ by $h$ (switch the direction of each such $\mathcal{M}'(f)$ to match the direction of $m_e$). Thus the images $m_e$ for $e \in E(G)$ define an embedding $\mathcal{M}$ of a connected directed graph $G$ with $|V(G')|/n$ vertices mapped to $V$ and with $|E(G)|/n$ edges into $\mathcal{S}$. Now for any $e \in E(G')$ with $e=st$ and $m_e$ going from $h(s)$ to $h(t)$ follow the curve $\mathcal{M}'(e)$ from $s$ to $t$. By the definition of $\sigma$, for any $i \in \mathbb{Z}_n$, $s \in \{-1,1\}$ we cross from $\mathcal{S}_i$ to $\mathcal{S}_{ (i+s) \bmod\,n}$ at a point $x \in \mathcal{S}'$ if and only if $\sigma(h(x), m_e, h \circ c) = s$, where $c$ is the curve of $X_i$ containing $x$. Summing over all points of intersection of $m_e$ with $X_0$ in $\mathcal{S}$, we get that an edge $e \in E(G')$ with $\mathcal{M}'(e)$ an arc from $r^{\beta}(u)$ to $r^{\gamma}(v)$ corresponds to an arc $m_e$ from $u$ to $v$ in $G$ such that $\gamma = \beta + \sigma(m_e, C) \bmod n$. So $G'$ is the graph derived from $(G, \alpha_{\mathcal{M}, C, n})$ and the voltage group $\mathbb{Z}_n$. Since $h$ has $2t$ branch points of order $n$, by the Riemann-Hurwitz formula, see, e.g., \cite{tucker2014}, the genus $g$ of $\mathcal{S}$ satisfies $g' = ng + (n-1) (t-1)$. \medskip \textit{Proof of $(b)\!\implies\!(a)$.} Cut $\mathcal{S}$ at each $c \in C$. We obtain a possibly disconnected surface $\tilde{S}$ with boundary, where each closed curve $c$ corresponds to two boundary components and each arc in $C$ to one boundary component. More precisely, by the surface classification theorem (e.g., \cite{munkres}), there exists a piecewise linear map $h: \mathbb{R}^3 \to \mathbb{R}^3$ and a piecewise linear surface $\tilde{\mathcal{S}}$ with boundary such that $h(\tilde{\mathcal{S}}) = \mathcal{S}$, restricted to $\tilde{\mathcal{S}} \setminus \cup_{c \in C} c$, $h$ is a homeomorphism and $\tilde{\mathcal{S}}$ is a sphere with some number $a \le g$ of simple handles and $b=2(|C|-t) + t = 2|C| - t$ boundary components. Fix an orientation of $\tilde{\mathcal{S}}$ which agrees with the orientation of $\mathcal{S}$ in the sense that rotations of any embedded graph are preserved under $h$. The direction of a curve $c \in C$ induces the direction of the boundary cycles of $\tilde{\mathcal{S}}$: for a closed curve we obtain one boundary cycle $c_L$, $h(c_L) = c$ where the points of $\tilde{\mathcal{S}}$ are on the right of $c_L$. Similarly we have another cycle $c_R'$, $h(c_R) = c$, where points of $\tilde{\mathcal{S}}$ are on the left of $c_R$. For an arc $c$ we have only one boundary cycle $c'$ in $\tilde{\mathcal{S}}$ such that $h(c') = c$. We assume that $c'$ is formed from two arcs $c_L'$ and $c_R'$ which have a common start point (mapped to the start point of $c$ by $h$) and a common endpoint (mapped to the endpoint of $c$ by $h$), i.e. $c' = c_{R}' * (c_{L}')^{-1}$, where $*$ denotes the concatenation of two curves and ${}^{-1}$ denotes inversion of the direction. We can carry out the following simple modification of $\tilde{\mathcal{S}}$. First take a half-plane $P_0$ in $\mathbb{R}^3$ with boundary, say, the $z$ axis. Let $r$ be the rotation around $z$ by $2\pi/n$. On $P_0$ place $|C|-t$ disks disjoint from $z$ and $t$ half-disks centered at the $z$ axis, all pairwise disjoint. For each of the $|C|-t$ closed curves $c \in C$ connect the $i$th boundary cycle $c_L$ using a cylindrical tube, disjoint from the rest of the surface, to the boundary $B_i$ of the $i$th disk on $P_0$ and similarly connect $c_R$ to $r(B_i)$ on the half plane $P_1=r(P_0)$. For $j$th arc $c \in C$, $j \in \{1, \dots, t\}$, use a cylindrical tube to connect $c'$ with the closed curve formed from the boundary $B_j'$ of the $j$th half disk on $P_0$ and its rotated image $r(B_j')$. It is easy to ensure the added parts are piecewise linear and the modified surface is contained in the infinite prism bounded by $P_0$ and $P_1$. So we can further assume that $\tilde{\mathcal{S}}$ has all boundary cycles on $P_0$ and $P_1$ as described above and for arcs $c'$, we have that $c_L'$ lies on $P_0$ and $c_R'$ lies on $P_1$, so that the start point and the endpoint of $c$ is mapped to the point with the smaller and the larger $z$-value in $B(i) \cap r(B_i)$ respectively. Let $\tilde{\mathcal{S}}_0 = \tilde{\mathcal{S}}$, $\tilde{\mathcal{S}}_i = r(\tilde{\mathcal{S}}_{i-1})$, for $i =1, \dots, n-1$. Note that the image of the curve $c_L^{i}$ (the copy of $c_L$ in $\tilde{\mathcal{S}}_i$) coincides with the image of $c_R^{i-1}$ (the copy of $c_R$ in $\tilde{\mathcal{S}}_{i-1}$), for $i \in \mathbb{Z}_n$. This yields a surface $\mathcal{S}'$, invariant under $r$, such that $\mathcal{S}$ is its (branched) covering surface embedded in $\mathbb{R}^3$. Note that $\mathcal{S}'$ is connected since $t \ge 1$, and the corresponding branched cover has at least two branch points. Similarly by adding $h^{-1}(\mathcal{M}(e))$ for $e \in E(G)$ and then taking the orbits of the added points under the group generated by $r$ we get a graph $G'$ embedded in $\mathcal{S}'$, on $n |V(G)|$ vertices and with $n|E(G)|$ edges, such that $\mathcal{M}(G)$ is the quotient space of $\mathcal{M}'(G')$ with respect to the $n$-fold rotation. To see that $G'$ is isomorphic to the voltage graph derived from $G$, go along an arc $y=\mathcal{M}'(e)$ for $e \in E(G)$, and note that for any $i, s \in \mathbb{Z}_n$, $s\in \{-1,1\}$, the curve $y$ passes from $\tilde{\mathcal{S}}_i$ to $\tilde{\mathcal{S}}_{(i+s)\bmod n}$ at a point $x$ if and only if $\sigma(x, y, c) = s$. Now the claim about the genus of $\mathcal{S}'$ follows from the Riemann-Hurwitz formula as above. \end{proof} \begin{prop}\label{prop.rotation} Let $\mathcal{M}$ be a piecewise linear embedding of a graph $G$ into a closed connected orientable surface $\mathcal{S} \subset \mathbb{R}^3$ such that there is a face $F_H$ bounded by a Hamiltonian cycle. Suppose $n=|V(G)| \ge 3$ and $\mathcal{M}$ has n-fold rotational symmetry that leaves the boundary of $F_H$ invariant. Then no point in $\mathcal{M}(V(G))$ lies on the rotational symmetry axis $a$. \end{prop} \begin{proof} If $x=\mathcal{M}(v)$ is a fixed point, then consider the orbit of the curve $c_e = \mathcal{M}(e)$ such that $e$ is on the boundary of $F_H$. We get that each of $n$ edges incident to $v$ belongs to the boundary of $H$. This is a contradiction, since $H$ contains $v$ only once. \end{proof} \subsection{Proof of the lower bound: the combinatorial part} \label{sec.geom.lower2} Recall that a \emph{region} of an embedding $\mathcal{M}$ of $G$ to $\mathcal{S}$ consists of all elements of an equivalence class of points that can be connected by a simple arc in $\mathcal{S} \setminus \mathcal{M}(G)$. A face is a region that is homeomorphic to an open disk in $\mathbb{R}^2$. We call the sum of lengths of all boundary walks of a region $R$ the (boundary) \emph{size} of $R$. We call $R$ a \emph{$k$-region}, if its size is $k$. \begin{lemma}\label{lem.geometric_lower} Let $n\ge 3$ be an integer. Let $\mathcal{M}$ be a piecewise linear embedding of $D_n$ into a closed connected oriented surface $\mathcal{S} \subset \mathbb{R}^3$ of genus $g$. Let $C$ be a finite set of pairwise disjoint simple curves in $\mathcal{S}$, $t$ of which are arcs, and $|C|-t$ of which are closed curves. Suppose $t \ge 1$ and the voltage function $\alpha_{\mathcal{M}, C, n}: E(D_n) \to \mathbb{Z}_n$ (\ref{eq.cutvolt}) is well defined and bijective. Then $n g + (n-1) (t-1) \ge L_{C}^{*}(n)$. \end{lemma} \begin{proof} Let $\alpha=\alpha_{\mathcal{M}, C, n}$. Suppose the claim is false, and take $\mathcal{M}$ and $C$ such that $t \ge 1$, $\alpha$ is bijective and $n g + (n-1) (t-1) < L_{C}^{*}(n)$. Then since $(n-1)(t-1) \ge 0$ and $t,g,n$ and $L_{C}^{*}(n)$ are integers \begin{align} \label{eq.g.assumed} g \le \left \lfloor \frac {L_{C}^{*}(n) -1} n \right\rfloor = \begin{cases} \frac {n-4} 4 &\mbox{for } n\equiv0\,(\bmod \, 4), \\ \frac {n-5} 4 &\mbox{for } n\equiv1\,(\bmod \, 4), \\ \frac {n-6} 4 &\mbox{for } n\equiv2\,(\bmod \, 4), \\ \frac {n-3} 4 &\mbox{for } n\equiv3\,(\bmod \, 4). \end{cases} \end{align} Since $D_n$ is bipartite, each region of $\mathcal{M}$ must have an even size. Let $k$ be the total number of 2-regions. $D_n$ has $n$ edges and $2$ vertices. It follows by Euler's formula that the number $r$ of regions is \begin{align*} r \ge 2- 2g - 2 + n =n-2g. \end{align*} Assume first $k < n - 2g$. Each edge either belongs to the boundary walks of two regions or to the boundary walks of the same region twice. Thus, the average size of those regions that have size at least 4 is \begin{align*} \frac {2n - 2k} {r - k} \le \frac {2n - 2k} {n- 2g - k}. \end{align*} On the other hand, this average must be at least 4. Thus \begin{align} 2n-2k \ge 4 (n- 2g - k) \nonumber \\ 2k \ge 2n - 8g \nonumber \\ k \ge n - 4g. \label{eq.k.lower} \end{align} The last inequality trivially holds also when $k \ge n-2g$. By our initial assumption, the number of arcs in $C$ satisfies \begin{align} \label{eq.t.upper} t<1 + \frac{L_{C}^{*}(n) - n g} {n-1}. \end{align} Let $R$ be a 2-region with boundary consisting of arcs $b=\mathcal{M}(e_1)$ and $c=\mathcal{M}(e_2)$ from the white vertex to the black vertex. $e_1$ and $e_2$ must be different edges, since $n > 1$. We use the following simple property: if a curve $a \in C$ does not have an endpoint in $R$, then $\sigma(\mathcal{M}, b, a)=\sigma(\mathcal{M}, c,a)$. If $a$ has just one endpoint in $R$, then $|\sigma(\mathcal{M}, b, a) - \sigma(\mathcal{M}, c,a)| = 1$. This property is a simple consequence of the definition of a region, the definition of $\sigma$ and the fact that $\alpha$ is well-defined (recall that we work in the piecewise-linear setting). Thus if no arc in $C$ has an endpoint in $R$, then $\alpha(e_1) = \alpha(e_2)$, which contradicts the assumption that $\alpha$ is bijective. This implies that each 2-region must have at least one of $2t$ total endpoints. Since regions are pairwise disjoint sets, by the pigeonhole principle we must have $2t \ge k$. In the case $n \equiv 3\, (\bmod\, 4)$, suppose $g = (n-3)/4$. Then (\ref{eq.t.upper}) implies $t=1$, so there are just two endpoints, but by (\ref{eq.k.lower}) the number of 2-regions is at least $3$, a contradiction. Thus we can further assume \begin{align} \label{eq.g.assumed2} g \le \frac {n-3} 4 - 1 & &\mbox{for } n\equiv3\,(\bmod \, 4). \end{align} From (\ref{eq.k.lower}) and (\ref{eq.t.upper}) we have \begin{align*} n - 4g \le k \le 2t < 2 + \frac{2L_{C}^{*}(n) - 2n g} {n-1} \end{align*} or \begin{align*} &g > \frac{(n-2)(n-1) - 2L_{C}^{*}(n)} {2n-4} = \begin{cases} \frac {n-4} 4, &\mbox{for } n = 0\, (\bmod\, 4), \\ \frac {n-5} 4 + \frac 1 2 - \frac 1 {2 (n-2)}, &\mbox{for } n = 1\, (\bmod\, 4), \\ \frac {n-6} 4 + 1, &\mbox{for } n = 2\, (\bmod\, 4), \\ \frac {n-3} 4 - \frac 1 2 - \frac 1 {2(n-2)}, &\mbox{for } n= 3\,(\bmod\, 4). \end{cases} \\ \end{align*} In all cases we have a contradiction to (\ref{eq.g.assumed}) and (\ref{eq.g.assumed2}). \end{proof} \subsection{Proof of the upper bound: optimal ring road constructions} \label{sec.geom.upper} We represent rotations of an embedding of a directed multigraph as cyclic sequences of symbols $e_{i_1}^{s_1} \dots e_{i_k}^{s_k}$. We have $s_j=-1$ if the edge $e_{i_j}$ is incoming and $s_j=1$ otherwise, also we shorten $e_i = e_i^1$. Similarly we denote faces of embedded directed multigraphs as cyclic permutations of the same form. In this case the symbol $e^{-1}$ indicates that the corresponding arc $\mathcal{M}(e)$ in the counter-clockwise facial walk is traversed in the opposite direction. For a degree 2 vertex $x$ in a multigraph \emph{smoothing} $x$ means connecting the neighbours of $x$ by an edge and removing $x$; this is extended to embedded or directed multigraphs in the obvious way. \begin{lemma} \label{lem.geomupper} For each integer $n \ge 2$ there is a 3-dimensional piecewise linear complete interchange that has $n$-fold rotational symmetry and genus at most $L_{C}^{*}(n)$. \end{lemma} \begin{proof} Consider a compact piecewise-linear orientable surface $\mathcal{B}=\mathcal{B}(n)$ embedded in $\mathbb{R}^3$, obtained by adding some number $g$, $g \ge 0$ handles to a rectangle with boundary $abcd$. Place a black point $v_b$ and a white point $v_w$ on the boundary segment $da$, so that $d$, $v_w$, $v_b$, $a$ are all distinct and occur in this order when going from $d$ to $a$. Take a permutation $\pi = \pi(n)= (\pi_1, \dots, \pi_{n-1})$ of $\{1, \dots, n-1\}$ and place points $\pi_{n-1}, \dots, \pi_1$ on the (interior of the) segment $cd$ in this order. Similarly, take a permutation $\pi' = \pi'(n)= (\pi_1', \dots, \pi_{n-1}')$ of $\{0, \dots, n-2\}$ which is related to the permutation $\pi$ through \begin{align}\label{eq.pi_prime} &\pi_i' = \pi_i - 1 &&\mbox{for } i \in \{1, n-1\}. \end{align} Place points $\pi_1', \dots, \pi_{n-1}'$ on the segment $ab$ in this order\footnote{In order to keep the notation simpler, we use symbols $\pi_1, \dots, \pi_n$ and $\pi_1', \dots, \pi_n'$ to refer both to two disjoint sets of points and to orderings of two overlapping sequences. The precise meaning should be interpreted from the context.}. The point $\pi_i$, if $\pi_i = k$, will model $n-k$ lanes incoming from motorways $K, K-1, \dots, K-(n-k)+1$ and exiting to motorway $K + k$. Here we think of motorways as indexed by $\mathbb{Z}_n$ and arranged in the counter-clockwise order, so that $K$ is (the index of) the current motorway, $K+1$ is the motorway to its right, etc. Suppose there exists an embedding $\mathcal{M}=\mathcal{M}(n)$ of a graph $G=G(n)$ with vertices mapped to $\pi_1, \dots, \pi_{n}$, $\pi_1', \dots, \pi_{n-1}'$, $v_w,v_b$ and edges mapped to the following arcs in $\mathcal{B}$: \begin{enumerate} \item[(a)] $\pi_t' v_b$, where $\pi_t' = 0$ (i.e., the unique group of $n-1$ lanes exiting at the current motorway $K$), \item[(b)] $v_w \pi_i$, for each $i \in \{1, \dots, n-1\}$ (i.e., the lanes from the current motorway $K$ to each of the $n-1$ groups of lanes on the ring road with different destinations), \item[(c)] for every $k \in \{1, \dots, n-2\}$ the unique arc $\pi_i' \pi_j$ such that $\pi_i' = \pi_j = k$ (i.e. the group of lanes from motorways $K-1, \dots, K - (n-k) + 1$ that continue on the ring road passing the current motorway $K$). \end{enumerate} Expand each arc $\pi_i' \pi_j$ defined in (c), if, say, $\pi_i' = \pi_j = k$ into $n-k-1$ disjoint `parallel' arcs. Also expand the point $\pi_i'$ into $n-k-1$ points, the starting points of these arcs, also placed on the boundary segment $ab$. By our definition, $\pi_i = \pi_i'+1= k + 1$. Replace the point $\pi_i$ by $n-k-1$ new points on the segment $cd$ (so that $n - (k+1) - 1$ of them are endpoints of the parallel arcs, and one point is the endpoint of the arc $v_w \pi_i$), so that the order of these points corresponds to the rotation at $\pi_i$. Next, add an edge $v_w v_b$ with its image subset of the segment $da$. We get an embedding $\mathcal{M}'$ of a new (expanded) graph $G'$ into $\mathcal{B}$ with degree 1 vertices corresponding to $n-1 + \dots + 1 = n (n-1)/2$ points on each of the boundary segments $ab$ and $cd$, 2 vertices of degree $n$ corresponding to $v_w$ and $v_b$, and the arcs consisting of the union of $v_w v_b$ and the arcs (a), (b) and (c) replaced using the above modification. Now make $n$ copies of $(\mathcal{B}, \mathcal{M}', G')$, $B_0'$, \dots, $B_{n-1}'$ and arrange them (using rotations and translations) counterclockwise into a `ring', so that each block is disjoint and we have $n$-fold rotational symmetry. For $i\in \mathbb{Z}_n$ identify the segment $b^{(i+1)}a^{(i+1)}$ of block $B_{i+1}'$ and the segment $d^{(i)} c^{(i)}$ of $B_{i}'$ with the corresponding sides of a new polygon $P_i = a^{(i+1)} b^{(i+1)} c^{(i)} d^{(i)}$; also connect the $k$-th point on $d^{(i)} c^{(i)}$ with the $k$-th point of $a^{(i)} b^{(i)}$, using a straight arc inside $P_i$ for each $k \in \{1, \dots, n(n-1)/2\}$. Make the surface closed by gluing a genus 0 surface with boundary $b^{(0)}c^{(0)} \dots b^{(n-1)} c^{(n-1)}$ and a genus 0 surface with boundary $d^{(n-1)}a^{(n-1)} \dots d^{(0)} a^{(0)}$. It easy to ensure the n-fold symmetry is preserved and newly added faces are piecewise linear. For any $K, k \in \mathbb{Z}_n$ and $k \ne 0$ follow the path $P_{K,k}$ from $v_w^{(K)}$ in $B_K'$ such that the first edge on this path corresponds to $v_w \pi_i$ with $\pi_i = k$ and ending at the first copy of $v_b$, say $v_b^{(j)}$ in $B_j'$. Each internal vertex on $P_{K,k}$ has degree two. Using (\ref{eq.pi_prime}) and simple induction we see that $j \equiv K+k \pmod n$. We get a 3-dimensional embedding of a subdivision of $K_{n,n}$ with $n$-fold rotation symmetry into a surface of genus $n g$. To ensure the underlying embedding of $K_{n,n}$ has a face bounded by a Hamiltonian cycle $v_w^{(n-1)} v_b^{(n-1)} \dots v_w^{(0)} v_b^{(0)}$ that contains a fixed point, for each $i \in \mathbb{Z}_n$ remove the path connecting $v_w^{(i)}$ with $v_b^{(i+1)}$ and add a new arc $v_w^{(i)} v_b^{(i+1)}$ that coincides with parts of the boundary segments $a^{(i)} d^{(i)}$ and $a^{(i+1)} d^{(i+1)}$ of $B_i'$ and $B_{i+1}$ respectively. Smooth all the degree 2 vertices in the resulting graph that are not copies of $v_w$ or $v_b$. We have obtained an embedding of $K_{n,n}$ with an $n$-fold rotation symmetry into a surface of genus $gn$. We call this embedding the \emph{ring road embedding} derived from $(\mathcal{B}, G, \mathcal{M})$. \m{Use Proposition~\ref{prop.cuts}?} To finish the proof for $n \bmod 4 \in \{1,2\}$ it suffices to show that the surface $\mathcal{B}(n)$ of genus $g=g(n)$, the graph $G(n)$ and its embedding $\mathcal{M}(n)$ into $\mathcal{B}(n)$ exist with \begin{align}\label{eq.g_block_upper} g \le \frac{L_{C}^{*}(n)} n = \begin{cases} \frac{n-1} 4 &\mbox{for } n \equiv 1\,(\bmod\,4); \\ \frac{n-2} 4 &\mbox{for } n \equiv 2\,(\bmod\,4). \end{cases} \end{align} \begin{figure} \centering \includegraphics[width=3cm]{img/block_6.pdf} \caption{The solution for $n=6$.} \label{fig.block6} \end{figure} \emph{Case $n \equiv 2\pmod4$.}\quad The construction for $n=2$ is trivial, so we assume $n \ge 6$. The building block of our construction is a (the?) solution for $n = 6$ with $\pi = \pi^{(6)}= (1,4,3,2,5)$, $\pi'=\pi^{(6)'}=(0,3,2,1,4)$, and the rotations\footnote{Note that for points on the boundary, rotations are not identical modulo cyclic shifts.} \begin{align*} &\pi_1: v_w \pi_4' && \pi_2: \pi_5' v_w && \pi_3: v_w \pi_2' &&\pi_4: \pi_3' v_w \nonumber \\ &\pi_2': \pi_3 && \pi_3': \pi_4 && \pi_4': \pi_1 && \pi_5': \pi_2 \nonumber && \\ &\pi_5: v_w && \pi_1': v_b &&v_w: \pi_3\pi_2\pi_5\pi_4\pi_1 && v_b: \pi_1'. \end{align*} This embedding has genus $(6-2)/4 = 1$ as required. It is shown in Figure~\ref{fig.block6}. We construct a solution for arbitrary $n$, $n \equiv 2\pmod 4$ by concatenating $(n-2)/4$ copies of the solution for $n=6$, see Figure~\ref{fig.ring_road_block}, right. The concatenation is defined as follows. We use permutations $\pi = \pi^{(n)}$ and $\pi' = \pi'^{(n)}$ as in (\ref{eq.pi_prime}), where \begin{align} \label{eq.pi_gen_2} & \pi_{4t+1} = 4t+1, && \pi_{4t+2} = 4t+4, && \pi_{4t+3} = 4t+3,\nonumber \\ &\pi_{4t+4} = 4t+2 && \mbox{for }t = 0, \dots, \left\lfloor n/4 \right \rfloor - 1 \mbox{ and} \\ &\pi_{n-1} = n-1.\nonumber \end{align} \begin{figure} \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.7\linewidth]{img/node_4k+1_pi2.pdf} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.7\linewidth]{img/node_4k+2_pi2.pdf} \end{subfigure} \caption{\label{fig.ring_road_block}Construction of a block $\mathcal{B}=\mathcal{B}(n)$ from block $\mathcal{B}(6)$, $n\equiv1\pmod 4$ (left) and $n\equiv2\pmod4$ (right).} \end{figure} We aim to construct an embedding with the following rotations for $t \in \{0, \dots, (n-2)/4 - 1\}$: \begin{align} &\pi_{4t+1}: v_w \pi_{4t+4}' && \pi_{4t+2}: \pi_{4(t+1)+1}' v_w && \pi_{4t+3}: v_w \pi_{4t+2}' && \pi_{4t+4}: \pi_{4t+3}' v_w \nonumber \\ &\pi_{4t+2}': \pi_{4t+3} && \pi_{4t+3}': \pi_{4t+4} && \pi_{4t+4}': \pi_{4t+1} && \pi_{4(t+1)+1}': \pi_{4t+2} \nonumber \\ & \pi_1': v_b && v_b: \pi_1' \nonumber \\ &\mbox{and} && \pi_{n-1}: v_w. \label{eq.rot_block_string} \end{align} We claim that for each $n$ such that $n=4k+2$, $\mathcal{B}(n)$ and $\mathcal{M}(n)$ can be chosen so that (\ref{eq.g_block_upper}), (\ref{eq.pi_gen_2}) and (\ref{eq.rot_block_string}) are satisfied. To prove this, we use induction on $k$. We have already shown the claim for $k=1$ with embedding $\mathcal{M}(6)$ into a surface $\mathcal{B}(6)$ of genus 1 with boundary rectangle $abcd$. Let $n=4k+2$ with $k \ge 2$ and suppose the claim is true for $n=4(k-1) + 2$, i.e., there is a required embedding $\mathcal{M}(n-4)$ into a surface $\mathcal{B}(n-4)$ with boundary rectangle $a'b'c'd'$ with permutations $\pi = \pi^{(n-4)}$, $\pi' = \pi'^{(n-4)}$ as in (\ref{eq.pi_gen_2}), rotations (\ref{eq.rot_block_string}), rotation at $v_w= v_w^{(n-4)}$: \[ v_w: \pi_{\sigma_1}^{(n-4)} \dots \pi_{\sigma_{n-4-1}}^{(n-4)} \] and genus at most $L_{C}^{*}(n-4)/(n-4) = L_{C}^{*}(n)/n - 1$. Now consider $\pi^{(n-4)}$ and $\pi'^{(n-4)}$ as permutations of $(5, \dots, n-1)$ and $(4, \dots, n-2)$ respectively, i.e., simply shift the sets permuted by $\pi^{(n-4)}$ and $\pi'^{(n-4)}$ by~4. Identify $bc$ with $a'd'$ and identify the points (and corresponding vertices) $v_w^{(n-4)}$ with $\pi^{(6)}_5$ and $v_b^{(n-4)}$ with $\pi'^{(6)}_5$. Here $v_w^{(t)}$ and $v_b^{(t)}$ denote the points $v_w$ and $v_b$ respectively in the corresponding embedding $\mathcal{M}(t)$. Contract the edge mapped to $\pi'^{(6)}_5 \pi_2^{(6)}$ and the edge mapped to $\pi^{(6)}_5 v_w^{n-4}$ ( smoothing the point $\pi'^{(6)}_5$ and pulling the point $\pi^{(6)}_5$ to $v_b$ ). We get a construction with boundary rectangle $ab'c'd$, the permutation \[ \tilde{\pi} = (\pi_1^{(6)}, \dots, \pi_4^{(6)}, \pi_1^{(n-4)}, \dots, \pi_{n-4-1}^{(n-4)}) \] on the segment $dc'$, and the permutation \[ \tilde{\pi}' = (\pi'^{(6)}_1, \dots, \pi'^{(6)}_4, \pi'^{(n-4)}_1, \dots, \pi'^{(n-4)}_{n-4-1}) \] on the segment $ab'$ and the following rotation at $v_w$: \begin{equation}\label{eq.rot_v_w} v_w: \pi_3^{(6)}\pi_2^{(6)} \pi_{\sigma_1}^{(n-4)} \dots \pi_{\sigma_{n-4-1}}^{(n-4)} \pi_4^{(6)}\pi_1^{(6)}. \end{equation} The rotation system of the resulting embedding $\tilde{M}$ satisfies (\ref{eq.pi_gen_2}) and (\ref{eq.rot_block_string}) with $\pi = \tilde{\pi}$ and $\pi'=\tilde{\pi}'$. Finally, the genus of $\tilde{M}$ is at most $1 + L_{C}^{*}(n)/n -1 = L_{C}^{*}(n)/n$. \emph{Case $n \equiv 1\pmod4$.}\quad We define $\pi=\pi^{(n)}$ as in (\ref{eq.pi_gen_2}), except we drop the last equality $\pi_{n-1}=n-1$. We define the rotations for $\pi_1, \dots, \pi_{n-1}$, $\pi_1', \dots, \pi_{n-1}'$ and $v_b$ as in (\ref{eq.rot_block_string}), except we drop the last equality, and for $t = (n-1)/4 - 1$, we replace the rotation at $\pi_{4 t + 2}=\pi_{n-3}$ with: \[ \pi_{4t + 2}: v_w. \] The rest of the proof is analogous to the proof in the case $n \equiv 2\pmod4$, so we omit it. Figure~\ref{fig.ring_road_block}, left, illustrates the construction. \textit{Case $n \equiv 3 \pmod 4$.}\quad For $n=3$ we use Proposition~\ref{prop.cuts} with the specific embedding $\mathcal{M}_1(3)$ of $D_3$ into a closed surface $\mathcal{S}_1(3)$ of genus 0 shown in Figure~\ref{fig.sym3}. \begin{figure} \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.4\linewidth]{img/quotient_3.pdf} \caption{} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.6\linewidth]{img/sym_3_black.pdf} \caption{} \end{subfigure} \caption{\label{fig.sym3} (a) The embedding $\mathcal{M}_1(3)$ of $D_3$ and a set $C$ of two cut arcs (dashed), such that $\alpha_{\mathcal{M}_1,C, 3}: E(D_3) \to \mathbb{Z}_3$ is bijective. (b) The resulting 3-fold symmetric embedding of $K_{3,3}$ with a face bounded by a Hamiltonian cycle.} \end{figure} For $n \ge 7$, start with the embedding $\mathcal{M}(n-1)$ given above. Expand it into the embedding $(\mathcal{B}, \mathcal{M}', G')$ with boundary $abcd$ as described in the first part of the proof. Identify the segment $ab$ with the segment $dc$. Also identify the $k$th point on $ab$ with the $k$th point of $dc$ for $k \in \{1, \dots, (n-1)(n-2)/2\}$, and smooth each of the identified points. Cap the two holes with boundaries $cb$ and $da$ respectively by gluing a new 1-face to each of them. We obtain an embedding $\mathcal{M}_1=\mathcal{M}_1(n-1)$ of a copy $G_1$ of $D_{n-1}$ into the surface $\mathcal{S}_1 = \mathcal{S}_1(n-1) \subset \mathbb{R}^3$ of genus $g \le L_{C}^{*}(n-1)/(n-1) = (n-3)/4$. It is easy to ensure that $\mathcal{M}_1$ is piecewise-linear: for example, if we bend the rectangle $abcd$ into a cylinder and then take its piecewise-linear approximation. Let $C_1 = \{X_1\}$ where $X_1$ is a cut (an arc in $\mathcal{S}_1$) that coincides with the segment $dc$. If we apply Proposition~\ref{prop.cuts} with $\mathcal{S}_1$, $\mathcal{M}_1$ and the group $\mathbb{Z}_{n-1}$, we obtain the solution for $n-1 \equiv 2\,(\bmod\,4)$ roads that we described above. Let us instead apply Proposition~\ref{prop.cuts} with the group $\mathbb{Z}_n$. The corresponding voltage function $\alpha_{\mathcal{M}_1, C_1, n}:E(G_1) \to \mathbb{Z}_{n}$ is injective; indeed by our construction the outgoing arc $e_k$ that corresponds to $v_w \pi_i$, $\pi_i = k$ crosses $X_1$ exactly $k$ times, each time with sign 1, so $\sigma(e_k, C_1) = k$. Thus the image of $\alpha_{\mathcal{M}_1, C_1, n}$ is $\{0, \dots, n-2\}$. \m{Tidy up the notation for faces and rotations for directed graphs.} Insert a new edge $e_{-1}$ to $G_1$ and map it to an arc from $v_w$ to $v_b$ parallel to $\mathcal{M}_1(e_0)$, so that the rotation at $v_w$ is $\dots e_0 e_{-1} \dots$ and the rotation at $v_b$ is $ \dots e_{-1}^{-1} e_0^{-1} \dots$. Now add a new cut $X_2$ disjoint from the image of $G_1$, that has only one point in common with $e_{-1}$ and $\sigma(e_{-1}, X_2) = -1$. We obtained an embedding $\tilde{\mathcal{M}}$ of $D_n$ into the surface $\mathcal{S}_1$ of genus $g \le (n-3)/4$ and $t=2$ cuts, so that $\alpha_{\tilde{\mathcal{M}}_1, \{X_1, X_2\}, n}: E(D_n) \to \mathbb{Z}_n$ is bijective. Now the proof follows by Proposition~\ref{prop.cuts}. \textit{Case $n \equiv 0 \pmod 4$.} The solution for $n=4$ is exceptional, so we assume $n \ge 8$. We first determine the rotation at $v_b$ in the embedding $\mathcal{M}_1(n-2)$ of the copy $G_1$ of $D_{n-2}$ into the `quotient' surface $\mathcal{S}_1(n-2)$. \begin{claim}\label{claim.rot_v_b} For $n \equiv 2\pmod 4$ in the embedding $\mathcal{M}_1(n)$ the rotation at $v_b$ is \m{curves and edges: same notation..} \begin{align} v_b: e_1^{-1} e_3^{-1} \dots e_{n-3}^{-1} e_{n-1}^{-1} e_{n-2}^{-1}e_{n-4}^{-1} \dots e_2^{-1} e_0^{-1}; \label{eq.rot_v_b} \end{align} Furthermore, $e_0^{-1}e_3e_5^{-1}e_2$ and $e_2^{-1}e_1e_3^{-1}e_4$ are among the faces of $\mathcal{M}_1(n)$. \end{claim} \begin{proof} Let $\mathcal{B}(n), G(n), \mathcal{M}(n)$ be obtained with $\pi = \pi^{(n)}$, $\pi' = \pi'^{(n)}$ as above. We say that $k \in \{0, \dots, n-2\}$ is \emph{joined from the left} on the ring road if either $k=0$ or in $\mathcal{M}(n)$ the rotation at $\pi_i$ where $\pi_i = k$ is $\pi_i: \pi_j' v_w$. Here $j$ is such that $\pi_j' = k$. Otherwise we say that $k$ is \emph{joined from the right}. Consider travelling from the motorway 0 to the motorway $n-1$ in the ring road embedding derived from $\mathcal{B}(n)$, $G(n)$ and $\mathcal{M}(n)$. At block $0$ we exit at the group of lanes corresponding to $\pi_j^{(0)}$ with $\pi_j = n-1$ (i.e. $j=n-1$). Next, we enter block $1$ at the point $\pi'^{(1)}_{n-1} = n-2$ and exit at $\pi^{(1)}_j$ such that $\pi_j=n-2$. We exit block $2$ at $\pi^{(2)}_j$ such that $\pi_j=n-3$, and so on. It follows that the rotation at $v_b^{(n-1)}$ in the ring road embedding is $r_{n-1}$ where $r_i$, $i \in \{0, \dots, n-1\}$ are defined by \begin{align*} r_i = \begin{cases} v_0, &\mbox{ if } i=0; \\ r_{i-1} v_i, &\mbox{ if $i \ge 1$ and $n-i-1$ is joined from the left};\\ v_i r_{i-1}, &\mbox{ if $i \ge 1$ and $n-i-1$ is joined from the right}. \end{cases} \end{align*} Here for a sequence $y=(y_1, \dots, y_k)$ and an element $x$ we use notation $yx = (y_1, \dots, y_k, x)$ and $xy = (x, y_1, \dots, y_k)$. Using (\ref{eq.rot_block_string}) we see that $n-i-1$ is joined from the right if $i \equiv 0 \pmod 2$ and joined from the left otherwise. Thus the rotation at $v_b^{(n-1)}$ in the ring road embedding is \[ v_b^{(n-1)}: v_w^{(n-2)} v_w^{(n-4)} \dots v_w^{(4)} v_w^{(2)} v_w^{(0)} v_w^{(1)} v_w^{(3)} \dots v_w^{(n-1)}. \] Since $v_w^{(i)} v_b^{(n-1)}$ in the ring road embedding is mapped by the covering projection to the arc $e_{n-1-i}$ in $\mathcal{M}_1$, it follows that the rotation at $v_b$ in $\mathcal{M}_1$ is (\ref{eq.rot_v_b}). By (\ref{eq.pi_gen_2}), (\ref{eq.rot_v_w}) and our construction, the rotation at $v_w$ in $\mathcal{M}_1$ is \[ v_w: e_0 e_3 e_4 \dots e_5 e_2 e_1. \] Thus using (\ref{eq.rot_v_b}), $\mathcal{M}_1$ has a face $e_0^{-1}e_3e_5^{-1}e_2$ and a face $e_2^{-1}e_1e_3^{-1}e_4$. \end{proof} \medskip \begin{figure} \centering \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.7\linewidth]{img/modification_4k_1.pdf} \caption{} \end{subfigure} \begin{subfigure}[b]{0.45\textwidth} \centering \includegraphics[width=0.7\linewidth]{img/modification_4k_2.pdf} \caption{} \end{subfigure} \caption{\label{fig.modification_4k}Left: faces $e_0^{-1}e_3e_5^{-1}e_2$ and $e_2^{-1}e_1e_3^{-1}e_4$ in the embedding $\mathcal{M}_1$ and the intersection of the cut arc $X_1$ with these faces (red dashes). Right: adding a new cut arc, replacing the arc $e_2$ and adding new arcs $e_{-1}$ and $e_{-2}$ to solve the case $n \equiv 0\pmod 4$.} \end{figure} Let $X_1$ be the cut arc in $\mathcal{S}_1=\mathcal{S}_1(n-2)$ defined above. Using Claim~\ref{claim.rot_v_b}, the fact that each crossing of an arc $e_k$ and $X_1$ has sign 1 and a simple geometric argument (Jordan-Schoeneflies theorem in the piecewise-linear case), we obtain the order $X_1$ enters and leaves the faces $e_0^{-1}e_3e_5^{-1}e_2$ and $e_2^{-1}e_1e_3^{-1}e_4$. The faces and the segments of $X_1$ intersecting them are shown, up to homeomorphism in Figure~\ref{fig.modification_4k}(a). Now in the face $e_0^{-1}e_3e_5^{-1}e_2$ add a new arc $e_{-1}$ from $v_w$ to $v_b$ parallel to $e_0$ and a new arc $e_2'$ parallel to $e_3$. Introduce a new cut arc $X_2$ that starts inside the newly created face $e_{-1}e_0^{-1}$, ends at the new face $e_3 e_2'^{-1}$ such that $X_2$ shares exactly one point with each of $e_2'$ and $e_{-1}$, $\sigma(e_2', X_2) = \sigma(e_{-1}, X_2) = -1$ and it is disjoint from the image of $G_1$ and $X_1$. Finally, remove the arc $e_2$ and add a new arc $e_{-2}$ from $v_w$ to $v_b$, so that $\sigma(e_2, X_2) = -1$ and the rotation at $v_b$ becomes \[ v_b: \dots e_0 e_{-1} e_{-2} e_{2'} e_3, \] see Figure~\ref{fig.modification_4k}(b). Let $C = \{X_1, X_2\}$. We have $\sigma(e_{-1}, C) = -1$, $\sigma(e_{-2}, C) = -2$ and $\sigma(e_{2'}, C) = 2$. By the earlier argument, $\sigma(e_k, C) = \sigma(e_k, \{X_1\}) =k$ for all $k \in \{0, \dots, n-3\} \setminus \{2\}$. Thus for the new embedding $\mathcal{M}_2$ of $D_n$ with arcs $e_{-2}, e_{-1}, e_0, e_1, e_2', e_3, \dots, e_{n-3}$ the voltage function $\alpha_{\mathcal{M}_2, C, n}: D_n \to \mathbb{Z}_n$ is bijective and the proof follows by Proposition~\ref{prop.cuts}. \end{proof} \subsection{Completing the proof for 3-dimensional embeddings} An embedding as in Theorem~\ref{thm.geometric.opt} has a face invariant under the $n$-fold rotational symmetry, and hence at least one point in that face is a fixed point under the rotation. Thus Theorem~\ref{thm.geometric.opt} follows from Proposition~\ref{prop.rotation} and the next result. \begin{lemma} \label{lem.geometric.opt} Let $n \ge 2$ be an integer. Let $\mathcal{M}$ be a piecewise linear embedding of $K_{n,n}$ into a closed connected orientable surface $\mathcal{S} \subset \mathbb{R}^3$. Suppose $\mathcal{M}$ has n-fold rotational symmetry such that no vertex of the graph is mapped to a fixed point but \begin{itemize} \item[($\bullet$)] some vertex of $\mathcal{S}$ is a fixed point. \end{itemize} Then the genus of $\mathcal{S}$ is at least $L_{C}^{*}(n)$. Furthermore, if $n \ne 4$, this lower bound is best possible and there exists a genus $L_{C}^{*}(n)$ embedding satisfying the assumption of Theorem~\ref{thm.geometric.opt}. \end{lemma} \begin{proof} The lemma is trivial for $n=2$. Suppose $n \ge 3$ and the embedding $\mathcal{M}$ of a complete bipartite graph $G$ into $\mathcal{S}$ satisfies all the assumptions of the statement. Use Proposition~\ref{prop.cuts} to obtain an embedding $\mathcal{M}_B$ of a base graph $G_B$ in a base surface $\mathcal{S}_B$ together with a set of curves $C$ in $\mathcal{S}_B$, such that $G$ is isomorphic to the graph derived from the voltage graph $(G_B, \alpha_{\mathcal{M}_B, C, n})$. Since $G$ is bipartite it follows that $|V(G_B)| = 2$, $|E(G_B)| = n$, and no edge is a loop. By inverting voltages if necessary, we can assume each edge of $G_B$ is oriented from one vertex, call it $v_w$, to another vertex, call it $v_b$. Next, since $G$ is derived from $G_B$, it must be that the image $\{\alpha_{\mathcal{M}_B, C, n}(e), e \in E(G_B)\}$ contains every element of $\mathbb{Z}_n$. By Proposition~\ref{prop.cuts} the genus of $\mathcal{S}$ is $ng + (n-1) (t-1)$, where $g$ is the genus of $\mathcal{S}_B$ and $t$, $t \ge 1$, is the number of arcs in $C$. Now Lemma~\ref{lem.geometric_lower} implies that the genus of $\mathcal{S}$ is at least $L_{C}^{*}(n)$. Finally, the upper bound, or the fact that for each $n \ge 3$, $n \ne 4$ there is a symmetric embedding of genus $L_{C}^{*}(n)$ follows by Lemma~\ref{lem.geomupper}. \end{proof} It remains to consider the special case $n=4$. \begin{figure}[t] \centering \includegraphics[width=0.3\linewidth]{img/pinavia_embedding2.pdf} \caption{$n=4$: the ``Pinavia'' interchange \cite{jbk2010}. } \label{fig.pinavia_embedding} \end{figure} \begin{lemma}\label{lem.geometric.4} In the case $n=4$ of both Lemma~\ref{lem.geometric.opt} and Theorem~\ref{thm.geometric.opt} the minimum genus is $4$. \end{lemma} \begin{proof} Suppose the minimum genus is $g' < 4$. Consider the genus $g$ embedding $\mathcal{M}$ of $D_4$ and the set $C$ with $t$ cut arcs obtained from a genus $g'$ counterexample using Proposition~\ref{prop.rotation} and Proposition~\ref{prop.cuts}. By Lemma~\ref{lem.geometric_lower}, we must have $g=0$ and $t=2$. That is, we have a $D_4$, two cut arcs and some number of cut loops embedded into the sphere, such that each arc of the embedded graph makes a different number (modulo 4) of intersections with the cut arcs, as defined by (\ref{eq.cutvolt}). Let the rotation at the white vertex be $v_w: e_0 e_1 e_2 e_3$. By Euler's formula, the set of regions of $\mathcal{M}$ consists of four 2-faces, let $F_i$ be bounded by $e_i$ and $e_{(i+1) \bmod 4}$. Write $\sigma_X = (\sigma(e_0, X), \sigma(e_1, X), \sigma(e_2,X), \sigma(e_3,X))$. Using the argument of the proof of Lemma~\ref{lem.geometric_lower}, each of the four endpoints of the cut arcs must be contained in a different face. By the same argument, the contributions of a single cut arc $c$ are $\sigma_c=(x, x+s, x, x)$ if the endpoints of $c$ are in $F_0$ and $F_1$, and $\sigma_c=(x, x+s, x+s, x)$ if the endpoints of $c$ are in $F_0$ and $F_2$. Here $x$ is some integer, $s \in \{1, -1\}$ and we considered two possible ways to pick the first edge for an intersection from each endpoint and two ways to direct $C$. Similarly, for a cut loop $c_1 \in C$, $\sigma_{c_1}=(z_1, z_1, z_1, z_1)$ for some integer $z_1$. Summing all contributions, the image of $\sigma_C$ is either $\{y, y+s_1+s_2\}$, or $\{y, y+s_1, y+s_2\}$ or $\{y, y+s_1, y+s_1+s_2, y+s_2\}$, for some $y \in \mathbb{Z}$ and $s_1, s_2 \in \{-1, 1\}$. Therefore the voltage function $\alpha_{\mathcal{M}, C, 4}$ is not bijective, a contradiction. Finally, one of the solutions of genus 4 is the Pinavia interchange, see Figure~\ref{fig.pinavia_embedding}. Another solution could be obtained by using the construction of Lemma~\ref{lem.geomupper}. \end{proof} \subsection{Other observations} One may ask what happens if we drop the assumption that $\mathcal{S}$ contains a fixed point. \begin{lemma} \label{lem.geometric.opt2} Let $n, \mathcal{M}, \mathcal{S}$ be as in Lemma~\ref{lem.geometric.opt}, but drop the assumption ($\bullet$). Then the genus of $\mathcal{S}$ is at least \begin{align*} \tilde{L}_{C}^{*}(n)= \begin{cases} \frac {(n-2)^2} 4, &\mbox{if } n\equiv0\,(\bmod \, 4); \\ \frac {n(n-1)} 4, &\mbox{if } n\equiv1\,(\bmod \, 4); \\ \frac {n (n-2)} 4, &\mbox{if } n\equiv2\,(\bmod \, 4); \\ \frac {n^2 - 3n + 4} 4, &\mbox{if } n\equiv3\,(\bmod \, 4), \end{cases} \end{align*} and this bound is best possible. \end{lemma} \begin{proof} Suppose $\mathcal{S}$ has no fixed points. As remarked in the comment after Proposition~\ref{prop.cuts}, the implication (a)$\implies$(b) still holds yielding an embedding $\mathcal{M}_B$ of $D_n$ into a surface $\mathcal{S}_B$ as in the proof of Lemma~\ref{lem.geometric.opt}, but now the family $C$ of curves contains $t=0$ arcs, so all curves in $C$ are loops. Using the same argument as in Lemma~\ref{lem.geometric_lower}, $\mathcal{M}_B$ can have no regions with boundary of size 2. Writing $r$ for the number of regions and $g$ for the genus of $\mathcal{S}_B$, we have by Euler's formula \begin{align*} g \ge \left \lceil \frac{2 - 2 - r + n} 2 \right \rceil \ge \left \lceil \frac{n - \lfloor \frac {2n} 4 \rfloor} 2 \right \rceil = \left \lceil \frac n 4 \right \rceil. \end{align*} So by the Riemann-Hurwitz formula the genus of $\mathcal{M}$ is \begin{align*} n g + (n-1)(t-1) = n g - (n-1) \ge \tilde{L}_{C}^{*}(n). \end{align*} Note that for $n \bmod 4 \in\{1,2\}$ we have $\tilde{L}_{C}^{*}(n) = L_{C}^{*}(n)$ and the proof follows by Lemma~\ref{lem.geometric.opt} (for such $n$ the last inequality is strict, so there are no minimal genus constructions without fixed points in $\mathcal{S}$). For $n \equiv 0 \,(\bmod\,4)$, $n \ge 8$ we construct an embedding $\mathcal{M}_B$ of $D_n$ into a torus with a set $C$ consisting of a single cut loop and genus $n/4$ as follows (see also Figure~\ref{fig.nonfix}~(a)). Start with the construction $\mathcal{B}(n-2)$ of the proof of Lemma~\ref{lem.geomupper}, and let $\pi^{(n-2)} = (\pi_1, \dots, \pi_{n-3})$ and $\pi'^{(n-2)} = (\pi_1', \dots, \pi_{n-3}')$ be the respective permutations. Extend these permutations by defining $\tilde{\pi} = (\pi_1, \dots, \pi_{n-3}, n-2, n-1)$ and $\tilde{\pi}' = (\pi_1', \dots, \pi_{n-3}', n-3, n-2)$ and add points $n-3, n-2$ on the segment $a b$ and the points $n-2, n-1$ on the segment $d c$ of $\mathcal{B}(n-2)$. Now identify $da$ with $cb$ in $\mathcal{B}(n-2)$ to get a cylinder with $(n-4)/4$ handles. Add edges $\tilde{\pi}_{n-2}' \tilde{\pi}_{n-3}$, $\tilde{\pi}'_{n-1} \tilde{\pi}_{n-2}$, $v_w \tilde{\pi}_{n-2}$, $v_w \tilde{\pi}_{n-1}$ and $v_w v_b$ so that the rotations are \begin{align*} & \tilde{\pi}'_{n-2}: \tilde{\pi}_{n-3} && \tilde{\pi}'_{n-1}: \tilde{\pi}_{n-2} && \tilde{\pi}_{n-3}: v_w \tilde{\pi}_{n-2}' \\ & \tilde{\pi}_{n-2}: \tilde{\pi}'_{n-1} v_w && \tilde{\pi}_{n-1}: v_w && v_w: v_b \dots \tilde{\pi}_1 \tilde{\pi}_{n-1} \tilde{\pi}_{n-2}. \end{align*} Now let $\mathcal{M}'$ be the embedding obtained by expanding the vertices $\tilde{\pi}_i, \tilde{\pi}'_i$, $i \in \{1, \dots, (n-1)\}$ similarly as in the proof of Lemma~\ref{lem.geomupper}. If we identify the edges $ab$ and $dc$, and let $C$ be the cut loop consisting of the single closed curve $\tilde{c}$ that coincides with $dc$, we get a base embedding $\mathcal{M}_B$ of genus $(n-4)/4 + 1 = n/4$ as required by the lower bound. We can see that $(b) \implies (a)$ from Proposition~\ref{prop.cuts} holds in this particular case even with $t=0$: construct $n$ copies of $\mathcal{M}'$ and glue them symmetrically into a ``torus with handles''. The resulting surface is connected and has genus of $n(n-4)/4 + 1 = \tilde{L}_{C}^{*}(n)$. The embedding obtained by gluing the copies of $\tilde{\pi}_i'$ and $\tilde{\pi}_i$ and smoothing the vertices of degree 2 is that of $K_{n,n}$ by the same argument as in the proof of Lemma~\ref{lem.geomupper}. For $n=4$ take $\tilde{\pi}=(1,2,3)$ and the rotations $v_w: (v_b, \tilde{\pi}_1, \tilde{\pi}_3,\tilde{\pi_2})$, $\tilde{\pi}_1: v_w \tilde{\pi}_2'$, $\tilde{\pi}_2: \tilde{\pi}_3' v_w$, $\tilde{\pi}_3: v_w$, $\tilde{\pi}_1': v_b$, $\tilde{\pi}_2': \tilde{\pi}_2$ and $\tilde{\pi}_3': \tilde{\pi}_3$. There is also an interesting genus 1 construction with rotational symmetry group $C_{2n}=C_8$ (not colour-preserving) and genus 1, see Figure~\ref{fig.nonfix}~(b-c). \begin{figure} \centering \centering \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[width=3cm]{img/node_4k+2_pi2_nofix.pdf} \caption{} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=2cm]{img/C8.pdf} \caption{} \end{subfigure} \begin{subfigure}[b]{0.3\textwidth} \centering \includegraphics[height=2cm]{img/C8_22_rendered3.png} \caption{} \end{subfigure} \caption{(a) The green dotted edges are added in the construction of $\mathcal{M}'$ for $n\equiv 0\,(\bmod\,4)$; (b) a genus 1 base embedding that gives a solution (c) for $n=4$ with symmetry $C_8$.} \label{fig.nonfix} \end{figure} Finally, the construction for $n=3\,(\bmod\,4)$ of genus $\tilde{L}_{C}^{*}(n)$ is obtained in a similar way as the construction for $n=1\,(\bmod\,4)$, except that we do not need to add the points $\tilde{\pi}_{n-2}$ and $\tilde{\pi}_{n-2}'$. \end{proof}
\section*{Divisibility of L-Polynomials for a Family of Curves} {\large Ivan Blanco--Chac\'on\\ School of Mathematics and Statistics, University College Dublin, Ireland \\ \bigskip Robin Chapman\\ Department of Mathematics, University of Exeter, Exeter, EX4~4QE, UK \\ \bigskip Stiof\'ain Fordham\\ School of Mathematics and Statistics, University College Dublin, Ireland \\ \bigskip Gary McGuire\footnote{email <EMAIL>. This paper appeared in the proceedings of Fq12, the 12th International Conference on Finite Fields and their Applications, 2015.} \\ School of Mathematics and Statistics, University College Dublin, Ireland} \end{center} \subsection*{Abstract} We consider the question of when the L-polynomial of one curve divides the L-polynomial of another curve. A theorem of Tate gives an answer in terms of jacobians. We consider the question in terms of the curves. The last author gave an invited talk at the 12th International Conference on Finite Fields and Their Applications on this topic, and stated two conjectures. In this article we prove one of those conjectures. \section{Introduction} \label{chapman:intro} Let $p$ be a prime and $q=p^f$ where $f$ is a positive integer and let $\mathbb{F}_q$ denote the finite field of order $q$. Let $X$ be a smooth projective variety over $\mathbb{F}_q$, of dimension $d$. Let $\overline X=X(\overline{\mathbb{F}}_q)$ be the corresponding variety over the algebraic closure of $\mathbb{F}_q$ and let $F\colon \overline X\rightarrow \overline X$ be the Frobenius morphism. The zeta function $\mathrm{Z}_X(t)$ of $X$ is defined by \[ \log \mathrm{Z}_X(t)= \sum_{m\ge 1} \frac{t^m}{m}N_m, \] where $N_m$ is the cardinality of the set $X(\mathbb{F}_{q^m})$: the points of $X$ with values in $\mathbb{F}_{q^m}$. Via the Weil conjectures (proved by Weil, Dwork, Grothendieck and others), one knows that $\mathrm{Z}_X(t)$ is a rational function and may be written in the form \begin{equation} \mathrm{Z}_X(t)=\frac{P_1(t)\cdots P_{2d-1}(t)}{P_0(t)\cdots P_{2d}(t)},\label{chapman:weil-conj} \end{equation} where each of the $P_i(t)=\det (1-F^\ast t; H^i(\overline X, \mathbb{Q}_\ell))$ are polynomials with coefficients in $\mathbb{Z}$ , where $H^i(\overline X , \mathbb{Q}_\ell)$ is the $i$th $\ell$-adic cohomology ($\ell \ne p$) of $\overline{X}$ with coefficients in $\mathbb{Q}_\ell$ and $F^\ast$ is the map on cohomology induced by $F$. In the case that $X=C$ is a curve then the zeta function of $C$ has the form \[ \mathrm{Z}_C(t)=\frac{\mathrm{L}_C(t)}{(1-t)(1-qt)}, \] and the numerator $\mathrm{L}_C(t)= P_1(t)$ is called the L-polynomial of $C$. We wish to consider the question of divisibility of L-polynomials. In previous papers \cite{chapman:AM}, \cite{chapman:AMR}, we have studied conditions under which the L-polynomial of one curve divides the L-polynomial of another curve. In this article we discuss two divisibility conjectures for specific families of curves, and prove one of them. \section{Two Families of Curves} A hyperelliptic curve $X$ of genus $g>1$ over $\mathbb{F}_q$ is the projective non-singular model of the affine curve \[ y^2+Q(x)y=P(x),\qquad P(x),Q(x)\in \mathbb{F}_q [x], \] where \[ 2g+1\le \max\{2\deg Q(x),\deg P(x)\}\le 2g+2. \] \subsection{The $C_k$ Family} For a positive integer $k$, define the curve $C_k$ over $\mathbb{F}_2$ to be the projective non-singular model of the curve with affine equation \[ y^2+y=x^{2^k+1}+x. \] The genus of $C_k$ is $2^{k-1}$, the affine model of $C_1$ is smooth everywhere, and the affine model of $C_k$ for $k>1$ has one singular point at $\infty$. \begin{conj}\label{chapman:conjck} The $\mathrm{L}$-polynomial of $C_k$ is divisible by the $\mathrm{L}$-polynomial of $C_1$. \end{conj} The first six L-polynomials over $\mathbb{F}_2$, computed and factored into irreducible factors over $\mathbb{Z}$ using MAGMA \cite{chapman:magma} are \begin{align*} C_1&\colon 2t^2 + 2t + 1\\ C_2&\colon (2t^2 + 2t + 1)(2t^2 + 1)\\ C_3&\colon ( 2t^2 + 2t + 1)(2t^2 - 2t + 1)(4t^4 + 4t^3 + 2t^2 + 2t + 1)\\ C_4&\colon (2t^2 + 2t + 1)^2 (2t^2 - 2t + 1)(2t^2 + 1)(16t^8 + 1)\\ C_5&\colon (2t^2 + 2t + 1)^2 (2t^2 - 2t + 1)^2(16t^8 - 16t^7 + 8t^6 - 4t^4 + 2t^2 - 2t + 1)\\ &\qquad \times (16t^8 + 16t^7 + 8t^6 - 4t^4 + 2t^2 + 2t + 1)^2\\ C_6&\colon (2t^2 - 1)^2 (2t^2 + 1)^4 (4t^4 - 2t^2 + 1)^3 (4t^4 + 2t^2 + 1)^2\\ &\qquad \times (2t^2 - 2t + 1)^3 (2t^2 + 2t + 1)^3 (4t^4 - 4t^3 + 2t^2 - 2t + 1)^2\\ &\qquad \times (4t^4 + 4t^3 + 2t^2 + 2t + 1)^3. \end{align*} \subsection{The $E_k$ Family} \indent For a positive integer $k$, define the curve $E_k$ over $\mathbb{F}_2$ to be the projective non-singular model of the curve with affine model \[ y^2+xy=x^{2^k+3}+x. \] The genus of $E_k$ is $2^{k-1}+1$ and similar to above, the affine model of $E_1$ is smooth everywhere, and the affine model of $E_k$ for $k>1$ has one singular point at $\infty$. \begin{conj}\label{chapman:conjdk} The $\mathrm{L}$-polynomial of $E_k$ is divisible by the $\mathrm{L}$-polynomial of $E_1$. \end{conj} In an invited talk at the Fq12 conference, the last author spoke about this topic and stated these two conjectures. Conjecture \ref{chapman:conjdk} is proposed and discussed in Ahmadi et al.\ \cite{chapman:AMR}. In this paper we will prove Conjecture \ref{chapman:conjck}. \section{Other Approaches} Here we discuss three possible approaches to proving the conjectures. The first two do not seem to work for Conjecture \ref{chapman:conjck}, but the third method does work as we will show in this paper. None of these methods appear to work for proving Conjecture \ref{chapman:conjdk}. \subsection{Number of Rational Points} The following theorem was proved in \cite{chapman:AM}. \begin{thm}[Ahmadi--McGuire]\label{chapman:AMBCC} Let $C(\mathbb{F}_q)$ and $D(\mathbb{F}_q)$ be smooth projective curves such that \begin{enumerate} \item $C(\mathbb{F}_q)$ and $D(\mathbb{F}_q)$ have the same number of points over infinitely many extensions of $\mathbb{F}_q$. \item The $\mathrm{L}$-polynomial of $C$ over $\mathbb{F}_{q^k}$ has no repeated roots, for all $k\geq 1$. \end{enumerate} Then there exists a positive integer $s$ such that the $\mathrm{L}$-polynomial of $D(\mathbb{F}_{q^s})$ is divisible by the $\mathrm{L}$-polynomial of $C(\mathbb{F}_{q^s})$. \end{thm} The first hypothesis holds for the curves $C_k$, but the second hypothesis does not. Thus we cannot use Theorem \ref{chapman:AMBCC} to prove Conjecture \ref{chapman:conjck}. To see that the first hypothesis holds, we use the following theorem proved by Lahtonen--McGuire--Ward \cite{chapman:LMW}. \begin{thm}\label{chapman:lmward} Let $K=\mathbb{F}_{2^n}$ where $n$ is a non-negative odd integer. Let \[ Q(x)=\mathrm{Tr}(x^{2^k+1}+x^{2^j+1}),\qquad\text{ for }0\leq j<k. \] Then if $\gcd(k\pm j,n)=1$, then the number of zeros of $Q$ in $K$ is \[ 2^{n-1}+ \left(\frac{2}{n}\right) 2^{(n-1)/2}, \] where $(\frac{2}{n})$ is the Jacobi symbol. \end{thm} If we put $j=0$ in Theorem \ref{chapman:lmward} then $Q(x)=\mathrm{Tr}(x^{2^k+1}+x)$. It follows that $C_1$ and $C_k$ have the same number of rational points over $\mathbb{F}_{2^m}$ for any $m$ with $\gcd(k,m)=1$. Therefore the first hypothesis of Theorem \ref{chapman:AMBCC} holds. The $C_k$ curves are supersingular so the L-polynomial of $C_1$ (which is $2t^2+2t+1$) has repeated roots over some extensions of $\mathbb{F}_2$, something that can also be seen directly. Therefore the second hypothesis of Theorem \ref{chapman:AMBCC} does not hold. \bigskip We remark that the second hypothesis of Theorem \ref{chapman:AMBCC} \emph{does} hold for the $E_k$ curves, see \cite{chapman:AMR}. However, we are unable to prove that the first hypothesis holds, although it is conjectured that it does. \bigskip A similar but different theorem was proved in \cite{chapman:AMR}. \begin{thm}[Ahmadi--McGuire--Rojas-Le\'on]\label{chapman:AMRL} Let $C$ and $D$ be two smooth projective curves over $\mathbb{F}_q$. Assume there exists a positive integer $k>1$ such that \begin{enumerate} \item $\#C(\mathbb{F}_{q^m})=\#D(\mathbb{F}_{q^m})$ for every $m$ that is not divisible by $k$, and \item the $k$-th powers of the roots of $\mathrm{L}_C(t)$ are all distinct. \end{enumerate} Then $\mathrm{L}_D(t)=q(t^k)\ \mathrm{L}_C(t)$ for some polynomial $q(t)$ in $\mathbb{Z}[t]$. \end{thm} We cannot use Theorem \ref{chapman:AMRL} to prove Conjecture \ref{chapman:conjck}, because the first hypothesis does not hold. It is not true that $C_1$ and $C_k$ have the same number of rational points over $\mathbb{F}_{2^m}$ for any $m$ not divisible by $k$ (or another integer). This can be seen by looking at small examples using a computer algebra package. It is interesting to compare the first hypothesis in Theorem \ref{chapman:AMRL} with the first hypothesis in Theorem \ref{chapman:AMBCC} (which does hold for $C_1$ and $C_k$). \subsection{The Kani--Rosen theorem} Let $X$ be an affine variety over a field $k$ with coordinate ring $A$. Given an action of an algebraic group $G$ on $X$, one may construct a so-called quotient variety $X/G$ given by $\mathrm{Spec}(A^G)$ where $A^G$ denotes the ring of invariants of $A$ with the induced action of $G$. If furthermore, $G$ is reductive then $A^G$ is finitely generated so $X/G$ is also an affine variety ($A^G$ will be reduced if $A$ is). Let $G$ be a finite subgroup of the automorphism group of a curve $C$ and let $\operatorname{Jac}(C)$ denote the Jacobian of $C$. The Kani--Rosen theorem \cite[thm.\ B]{chapman:KR} concerns isogenies and idempotents in the rational group algebra $\mathbb{Q}[G]$ and is useful is proving divisibility relations between L-polynomials. \begin{thm}[Kani--Rosen] Let $G \subseteq \mathrm{Aut}(C)$ be a (finite) subgroup such that $G=H_1 \cup H_2 \cup \ldots \cup H_r$ where the subgroups $H_i \subseteq G$ satisfy $H_i\cap H_j=\{1\}$ when $i\ne j$. Then there is an isogeny relation \[ \operatorname{Jac}(C)^{r-1}\times \operatorname{Jac}(C/G)^g \cong \operatorname{Jac}(C/H_1)^{h_1}\times \ldots \times \operatorname{Jac}(C/H_r)^{h_r}, \] where $g=|G|$ and $h_i=|H_i|$. \end{thm} For any subgroup $H$ of $G$ there is an idempotent \[ \varepsilon_H = \frac{1}{|H|}\sum_{h\in H} h. \] If $G$ is the Klein 4-group with subgroups $H_1, H_2, H_3$, we have the idempotent relation \[ \varepsilon_1 + 2\varepsilon_G=\varepsilon_{H_1}+\varepsilon_{H_2}+\varepsilon_{H_3}. \] Applying the Kani--Rosen theorem we get an isogeny \[ {\rm Jac}(C) \times {\rm Jac}({C/G})^2 \sim {\rm Jac}({C/H_1})\times {\rm Jac}({C/H_2})\times {\rm Jac}({C/H_3}). \] In order to apply this isogeny to $C_k$, we need two involutions in the automorphism group of $C_k$. We want involutions that are defined over $\mathbb{F}_2$. One is the hyperelliptic involution \[ \iota: (x,y)\mapsto (x,y+1) \] and the other is the map from \cite{chapman:GV} \[ \phi: (x,y)\mapsto (x+1,y+B(x)) \] where $B(x)=x+x^2+x^4+x^8+\cdots +x^{2^{k-1}}$. Then \[ \iota \circ \phi = \phi \circ \iota : (x,y) \mapsto (x+1,y+1+B(x)). \] Note that $\phi$ is an involution if and only if $B(1)=0$ if and only if $k$ is even. When $k$ is odd, $\phi$ has order 4 and $\phi^2=\iota$. When $k$ is even, $\phi$ and $\iota$ together generate a Klein 4-group in $\operatorname{Aut}(C_k)$. In fact we have the following. \begin{proposition} If $k$ is odd then there are no non-hyperelliptic involutions on $C_k$ of the form $(x,y)\mapsto (x+1,y+B(x))$ where $B(x)$ is a linearised polynomial $B(x)=\sum_{i\ge 0} a_ix^{2^i}$ with $a_i\in \mathbb{F}_2$. \end{proposition} \begin{proof} Such a $B(x)$ must satisfy $B(1)=0$ and $B(x)^2+B(x)=x^{2^k}+x$. The resulting conditions thus imposed on the coefficients $a_i$ mean that $B(x)=\sum_{i=0}^{k-1} x^{2^i}$ but then $B(1)\ne 0$ if $k$ is odd. \end{proof} Remark: It follows now from van der Geer and van der Vlugt \cite{chapman:GV} that this exhausts the subgroup of $\operatorname{Aut}_{\mathbb{F}_2}(C_k)$ fixing the branch points of $C_k\rightarrow \mathbb{P}^1$. Therefore, the first problem in using the Kani--Rosen theorem to prove Conjecture \ref{chapman:conjck} is that we only have the appropriate automorphism group for $k$ even. It therefore appears that for $k$ odd, one cannot use the Kani--Rosen theorem to prove the conjecture, at least not directly. \subsection{Kleiman--Serre} The following theorem is well-known in the area. \begin{thm}\label{chapman:KleimanSerre} (Kleiman--Serre) If there is a surjective morphism of curves $C \longrightarrow C'$ that is defined over $\mathbb{F}_q$ then $\mathrm{L}_{C'}(t)$ divides $\mathrm{L}_C(t)$. \end{thm} \begin{proof} (Sketch) Given a surjective morphism $f\colon C\rightarrow C'$ one obtains an induced map $f^\ast$ on the \'etale cohomology groups that is injective (Kleiman \cite[prop.\ 1.2.4]{chapman:Kleiman}). Given the interpretation of the polynomials $P_i(t)$ described in the introduction (equation \ref{chapman:weil-conj}) as determinants via the Weil conjectures, the result follows. \end{proof} We will use this result in the next section to prove Conjecture \ref{chapman:conjck}. \section{Proof of Conjecture \ref{chapman:conjck}} We prove Conjecture \ref{chapman:conjck} using Theorem \ref{chapman:KleimanSerre}. In fact we will prove something more general: that there is a map from $C_{k}$ to $C_l$ for any integer $l$ dividing $k$. Putting $l=1$ proves Conjecture \ref{chapman:conjck}. Before we construct the morphism we consider a simpler case as motivation. Let $A_k$ denote the smooth projective model of the affine curve defined over $\mathbb{F}_2$ \[ y^2+y=x^{2^k}+x. \] One can easily verify that the map \[ (x,y)\mapsto (\mathrm{Tr}_{nk/k}(x),y), \qquad \text{ for }\mathrm{Tr}_{nk/k}(x)=x+\sum_{i=1}^{n-1}x^{2^{ik}}, \] is a morphism $A_{nk}\rightarrow A_k$ for $n,k$ positive integers and $n>1$. The similarity between the curves $C_k$ and $A_k$ is apparent, however the morphism above differs quite radically from the one to be described below. \begin{thm}\label{chapman:ckdiv} Let $k>l$ be integers with $l$ dividing $k$. Then there is a non-constant morphism $C_k\longrightarrow C_l$ defined over $\mathbb{F}_2$. \end{thm} \begin{proof} Write $k=lr$ and set $q=2^l$. We claim that there is a morphism of the form $x\mapsto f(x)$, $y\mapsto y+g(x)$ from $C_k$ to $C_l$ where $f$ and $g$ are polynomials. For this to be the case it suffices that \begin{equation}\label{chapman:covering-condition} f(x)^{q+1}+f(x)=x^{q^r+1}+x+g(x)^2+g(x). \end{equation} Let us take \[ f(x)=\sum_{j=0}^{r-1}x^{q^j}, \] and \[ g(x)=\sum_{j=1}^{r-1}x^{q^j}+\sum_{0\le i<j\le r-1}\sum_{s=0}^{l-1}x^{2^l(q^i+q^j)}. \] Then \begin{eqnarray*} f(x)+f(x)^{q+1} &=&\sum_{j=0}^{r-1}x^{q^j} +\left(x+\sum_{j=1}^{r-1}x^{q^j}\right) \left(x^{q^r}+\sum_{j=1}^{r-1}x^{q^j}\right)\\ &=&\sum_{j=1}^{r-1}x^{q^j} +x+x^{1+q^r}+\sum_{j=1}^{r-1}x^{1+q^j}+\sum_{j=1}^{r-1}x^{q^r+q^j} +\sum_{j=1}^{r-1}x^{2q^j}, \end{eqnarray*} and \begin{eqnarray*} g(x)^2+g(x) &=&\sum_{j=1}^{r-1}x^{q^j}+\sum_{j=1}^{r-1}x^{2q^j} +\sum_{0\le i<j\le r-1}(x^{q^i+q^j}+x^{q(q^i+q^j)})\\ &=&\sum_{j=1}^{r-1}x^{q^j}+\sum_{j=1}^{r-1}x^{2q^j} +\sum_{0\le i<j\le r-1}x^{q^i+q^j} +\sum_{1\le i<j\le r}x^{q^i+q^j}\\ &=&\sum_{j=1}^{r-1}x^{q^j}+\sum_{j=1}^{r-1}x^{2q^j} +\sum_{j=1}^{r-1}x^{1+q^j} +\sum_{i=1}^{r-1}x^{q^i+q^r}. \end{eqnarray*} Subtracting these gives~(\ref{chapman:covering-condition}). \end{proof} \begin{corollary} Conjecture \ref{chapman:conjck} is true. \end{corollary} The Corollary follows from Theorem \ref{chapman:KleimanSerre} and Theorem \ref{chapman:ckdiv}. \bigskip We used Theorem \ref{chapman:KleimanSerre} to prove Conjecture \ref{chapman:conjck}. We remark that Theorem \ref{chapman:KleimanSerre} cannot be used to prove Conjecture \ref{chapman:conjdk}, because it is shown in \cite{chapman:AMR} that there is no morphism $E_2 \longrightarrow E_1$. Thus a proof of Conjecture \ref{chapman:conjdk} will probably use different methods. \bigskip As a final remark, we point out where the argument of Theorem \ref{chapman:ckdiv} breaks down in odd characteristic for the analogous curves \[ C_k^{(p)}:\qquad y^p-y=x^{p^k+1}+x, \] where $p$ is an odd prime. In the case $k=2$, $l=1$, in order to give a morphism of the form $(x,y)\mapsto (f(x),y+g(x))$ from $C_2^{(p)}$ to $C_1^{(p)}$ we need to find polynomials $f$ and $g$ with \[ f(x)^{p+1}+f(x)=x^{p^2+1}+x+g(x)^p-g(x). \] If we take $f(x)=x+x^p$ by analogy with Theorem~\ref{chapman:ckdiv}, then we require \[ x^{p^2+p}+x^{2p}+x^{p+1}+x^p=g(x)^p-g(x), \] but this is insoluble for polynomial $g$ unless $p=2$. Notwithstanding the above, the analogous conjecture for odd $p$ does appear to be true based on computations for small $k,p$. \begin{conj} Let $p$ be an odd prime. Then the L-polynomial of $C_1^{(p)}$ divides the L-polynomial of $C_k^{(p)}$. \end{conj} \paragraph{Acknowledgment} I.B.--C., S.F.\ and G.M.\ are supported by Science Foundation Ireland grant 13/IA/1914 and are members of the Computational and Adaptive Systems Laboratory (CASL) in University College Dublin. I.B.--C.\ is a member of the MICINN project MTM2010-17389. S.F.\ is partially supported by an Irish Department of Education scholarship.
\section{Introduction} \label{sect:intro} Sensitive searches with the Atacama Large Millimeter/submillimeter Array (ALMA) are steadily adding to the number of disks with dust levels typical of debris disks but hosting detected CO gas, now comprising 15 systems \citep{Zuckerman1995,Moor2011,Dent2014,Moor2015,Marino2016, Lieman-Sifry2016,Greaves2016,Matra2017b,Marino2017a,Moor2017}. All but two of these are relatively young ($\sim$10-100 Myr-old), which would naively suggest that the presence of CO is related to the protoplanetary era of disk evolution. However, the recent detections of CO around the 440 Myr-old star Fomalhaut \citep{Matra2017b} and the 1-2 Gyr-old star $\eta$ Corvi \citep{Marino2017a}, as well as the tentative detection around the 125-130 Myr-old eclipsing binary HD23642 \citep{Pericaud2017}, show that at least in some of the systems the CO cannot be primordial. Instead, the wide range of system ages advocates for CO replenishment through gas release from exocometary ices This exocomet scenario has now been confirmed as the origin of the observed CO gas in four systems, including relatively young stars $\beta$ Pictoris \citep{Dent2014,Matra2017a} and HD181327 \citep{Marino2016}, as well as Fomalhaut and $\eta$ Corvi. While the exact CO release mechanism itself remains unknown, the similarly clumpy CO and dust distributions in the disk around $\beta$ Pictoris suggest that collisions play an important role \citep{Dent2014}. A collisional cascade is expected to result in efficient gas release as long as the smallest grains blown out of the system by radiation pressure from the central star cannot retain their ice \citep{Matra2017b}. In this case, assuming steady state in both the collisional cascade and in the production/photodestruction of gas allows us to extract the CO ice fraction in exocomets from simple observables \citep{Zuckerman2012,Matra2015,Matra2017b}. This is a particularly powerful tool to probe the bulk volatile composition of exocomets, allowing us to place Solar System comets in the larger context of planetary systems around stars with different properties. In the debris disk systems where an exocometary origin of CO has been confirmed (two A- and one F-type stars), measured CO mass fractions of exocomets are consistent with Solar System comets \citep{Marino2016,Matra2017a,Matra2017b}. This consistency suggests similar comet formation conditions in the original protoplanetary disks and the Solar Nebula. The next step in investigating this similarity requires to both expand this sample of exocometary CO abundance measurements and probe relative ice abundances through detection of other molecules. As we discuss in this paper (\S\ref{sect:disc}), detection of other molecules can uniquely shed light on both the exocometary outgassing mechanism (where outgassing refers to any gas release process from solid bodies of any size) and the chemical history of cometary volatiles. Here we present the first molecular survey of the exocometary gas disk around $\beta$ Pictoris. In \S\ref{sect:obs}, we describe new SMA and archival ALMA observations of CO, CN, HCN, HCO$^+$, N$_2$H$^+$, H$_2$CO, H$_2$S, CH$_3$OH, SiO and DCN. The continuum and CO J=2-1 detections with the SMA as well as SMA and ALMA upper limits for all other molecules are presented in \S\ref{sect:res}. We interpret the observations with a steady state exocometary release model in \S\ref{sect:anal}. In particular, we focus on CN and CO as the longest-lived observable gas-phase species in the disk, and describe the connection between the constraint on the observed CN/CO flux ratio upper limit and an upper limit in the HCN/(CO+CO$_2$) ratio of outgassing rates. We compare this ratio with measurements from Solar System comets and discuss the implications of this comparison on the release mechanism and/or on the HCN/(CO+CO$_2$) ice abundance in the exocomets in \S\ref{sect:disc}. Finally, we use our exocometary release model to make predictions for molecular detection in future surveys from far-IR to radio wavelengths, and conclude with a summary in \S\ref{sect:concl}. \section{Observations} \label{sect:obs} \begin{deluxetable*}{lcc} \tablewidth{0pt} \tablecaption{SMA Observational Parameters} \tablehead{ \colhead{Parameter} & \colhead{2014 Nov 11} & \colhead{2015 Dec 15}} \startdata No. Antennas & 7 & 8 \\ $\tau_{\rm 225~GHz}$ & 0.07 & 0.04 \\ Pointing center & \multicolumn{2}{c}{ R.A. $05^{h}47^{m}17\fs0877$, Dec. $-51^{h}03^{m}59\fs44$ (J2000) } \\ Min/Max baseline & 6 to 67 meters & 6 to 67 meters \\ Gain Calibrators & J0522-364 (2.7 Jy) & J0522-364 (4.9 Jy) \\ & J0538-440 (1.7 Jy) & J0538-440 (1.5 Jy) \\ Passband Calibrator & 3C84, Uranus & 3C84, Uranus \\ Flux Calibrator & Callisto & Uranus \\ Spectral Lines & ~ & ~ \\ ~~transition, frequency & HCN J=3--2, 265.88643 GHz & CO J=2-1, 230.538 GHz \\ ~~ & HCO$^+$ J=3--2, 267.55763 GHz & CN N= 2-1, 226.87478 GHz \\ ~~ & N$_2$H$^+$ J=3--2, 279.51176 GHz & (J=5/2-3/2 component) \\ ~~ & H$_2$CO J=$4_{14}-3_{13}$, 281.52693 GHz & \\ Primary Beam FWHM & $43''$ & $55''$ \\ Synthesized Beam FWHM\tablenotemark{a} & $7\farcs7 \times 3\farcs3$, p.a. $12^{\circ}$ & $8\farcs7 \times 3\farcs7$, p.a. $-10^{\circ}$ \\ rms noise (line images) & 0.09 Jy beam$^{-1}$ @ 265.9 GHz & 0.06 Jy beam$^{-1}$ @ 230.5 GHz \\ & (for 0.92 km/s channels) & (for 1.06 km/s channels)\\ rms noise (continuum image) & 1.4 mJy beam$^{-1}$ & 0.57 mJy beam$^{-1}$ \\ \enddata \tablenotetext{a}{for natural weighting plus a $3''$ Gaussian taper in the east-west direction} \label{tab:obs_sma} \end{deluxetable*} \subsection{SMA} \label{sect:obssma} We observed the $\beta$~Pictoris debris disk with the Submillimeter Array (SMA) on Mauna Kea, Hawaii in two tracks in a compact antenna configuration to search for line emission from a suite of molecular species. Table~\ref{tab:obs_sma} provides a summary of the observational parameters. The first track was obtained on 2014 November 11 using 7 antennas. The ASIC correlator was configured with 128 channels (0.8125 MHz spacing) in each of 48 chunks that together spanned $\pm(4-8)$~GHz from an LO frequency of 273.732 GHz. This setup was aimed at simultaneous coverage of spectral lines of HCN and HCO$^+$ (LSB) and N$_2$H$^+$ and H$_2$CO (USB). The second track was obtained on 2015 December 15 with 8 antennas. The ASIC correlator was again configured with 128 channels (0.8125 MHz spacing) in each of 48 chunks, spanning $\pm(4-8)$~GHz from an LO frequency of 221.654 GHz. In addition, the partly deployed SWARM correlator (operating at $8/11$ speed) provided an additional 2 chunks of 16384 channels each ($0.8125/8$~MHz spacing) that spanned $\pm(8-12)$~GHz from the LO frequency with a gap centered at $10$~GHz of width $1.15$~GHz. This setup was aimed at simultaneous coverage of spectral lines of CO and CN (USB). The southern location of $\beta$~Pictoris (Dec. $-51\degr$) makes it a challenging target for the SMA, since it is available only at high airmass, rising above an elevation of 15 degrees for only about 3 hours. However, for both of these tracks the weather conditions were very good, with stable atmospheric phase and low opacity at 225~GHz as measured by the nearby tipping radiometer. The basic observing sequence consisted of a loop of 2 minutes each on the quasars J0522-364 and J0538-440 and 8 minutes on $\beta$~Pictoris. Passband calibration was obtained with observations of a combination of available strong sources. The absolute flux scale for the two tracks were set using observations of Callisto and Uranus, with an estimated accuracy of 20\%. All of the calibration was performed using the {\tt MIR\footnote{\url{https://www.cfa.harvard.edu/~cqi/mircook.html}}} software package. Continuum and spectral line imaging and clean deconvolution were done in the {\tt miriad} package. The 2014 dataset presented a systematic astrometric offset of $\sim 2.4\arcsec$ (a fraction of the $8\farcs7\times3\farcs7$ beam size) with respect to location of the star. We corrected this offset using the 274 GHz continuum image from the same 2014 dataset, by measuring the centroid of continuum emission and spatially shifting the image to ensure that this centroid lies at the expected stellar location. \subsection{ALMA} \label{sect:obsalma} We extracted ALMA Band 6 observations of $\beta$ Pictoris from the archive (project number 2012.1.00142.S) in order to search for line emission from several additional molecular species. In summary, observations were performed between 2013 and 2015 with the 12-m array in a compact and extended configuration, as well as with the Atacama Compact Array (ACA), with total on-source times of 28, 114, and 50 mins, respectively. We direct the reader to \citet{Matra2017a} for a detailed description of the calibration and CO imaging procedures. Two of the spectral windows were set in frequency division mode and allowed us to test for the presence of spectral line emission from H$_2$S (2$_{2,0}$-2$_{1,1}$, 216.710 GHz), CH$_3$OH (5$_{1,4}$-4$_{2,2}$, 216.946 GHz) SiO (J=5-4, 217.105 GHz) and DCN (J=3-2, 217.239 GHz), as well as CO (J=2-1, 230.538 GHz). We here repeated the imaging step for all molecules in the same way as previously done for the CO transition \citep{Matra2017a}; this resulted in 4 line datasets with a native channel spacing of 488.281 kHz (corresponding to a resolution of 1.35 km/s at the rest frequency of the SiO line). To allow direct comparison with CO (\S\ref{sect:filtering}), we applied a taper to the visibilities in order to produce datacubes with exactly the same synthesized beam size ($0\farcs30\times0\farcs26$, or 13.4$\times$10.7 au at the distance of $\beta$ Pictoris) and position angle (p.a., -83$\fdg$9) as the CO dataset. \section{Results} \label{sect:res} \subsection{SMA continuum and CO J=2-1 detections} \begin{figure*} \hspace{15mm} \includegraphics*[scale=0.49]{biplot.pdf} \vspace{-6mm} \caption{\textit{Left}: SMA 1.35 mm continuum image of the $\beta$ Pictoris disk. Contours represent [-2,2,4,6,8] times the rms noise level of 0.57 mJy beam$^{-1}$. \textit{Right}: Contours show the moment 0 (spectrally integrated) map of the CO J=2-1 line, at [-2,2,4,6] times the rms noise level of 0.18 Jy km s$^{-1}$ beam$^{-1}$. The colour scale (moment 1 map) represents the velocity field of the disk, i.e. the centroid velocity of the line (with respect to the star) at each spatial location. In both panels, the ellipse in the bottom left represents the synthesized beam.} \label{fig:biplot} \end{figure*} Continuum emission from dust within the $\beta$ Pictoris disk is detected in both SMA datasets at 222 and 274 GHz (1.35 and 1.09 mm). Figure~\ref{fig:biplot} (left) shows the SMA image with the highest signal-to-noise ratio (1.35 mm), presenting a double-peaked morphology consistent with the 1.09 mm dataset, as well as previous SMA 236 GHz \citep[1.27 mm,][]{Wilner2011} and ALMA 339 GHz \citep[0.89 mm,][]{Dent2014} datasets, interpreted as a belt viewed almost exactly edge-on. Flux density measurements from the SMA observations at 222 and 274 GHz are $21.0\pm3.0$~mJy and $25.9\pm6.4$~mJy, respectively (obtained by fitting a Gaussian to the visibilities at baselines shorter than 30~k$\lambda$). These values are consistent with the ALMA measurement at 339 GHz ($60\pm6$~mJy), given the large uncertainties and steep spectral index of the emission \citep[$\alpha\sim$2.81,][]{Ricci2015}. The previously reported SMA 236 GHz continuum measurement remains anomalously low ($13\pm1.4$~mJy), perhaps resulting from calibration challenges at very low elevations. CO J=2-1 emission is clearly detected in the SMA channel maps, centered around a velocity of $\sim 1.4$ km/s with respect to the rest frequency of 230.538 GHz in the Local Standard of Rest (LSR) reference frame. We created a moment 0 image (contours in Figure~\ref{fig:biplot}, right) by spectrally integrating the datacube within $\pm 7$ km/s of the stellar velocity (the latter being consistent with the centroid velocity reported above). We used this image to create a spatial mask large enough to include all of the emission from the disk. Then, we applied this mask to the original datacube as a spatial filter; in other words, we spatially integrated emission within this mask. This produced the 1D spectrum shown in Figure~\ref{fig:allmolspec} (top left, lilac line). The CO line profile is spectrally resolved and appears asymmetric; the enhancement at blueshifted radial velocities is consistent with previous ALMA observations showing that the majority of CO emission originates in a clump on the south-west (SW) side of the edge-on disk, where this SW side is rotating towards Earth \citep{Dent2014,Matra2017a}. This is confirmed by the moment 1 map (color map in Figure~\ref{fig:biplot} right), which shows the line-of-sight velocity centroid of CO emission at spatial locations where the disk is detected (at the 4$\sigma$ level). This centroid was obtained by fitting Gaussians to spectra at all spatial locations. Within the measurement uncertainties, the CO J=2-1 line shape and integrated line flux are consistent with the previous ALMA measurements (see ALMA CO spectrum as the lilac line in Figure~\ref{fig:allmolspec}, top right, as well as CO line fluxes in Table \ref{tab:mols}). \subsection{Upper limits from molecular survey: spectro-spatial filtering using CO as a template} \label{sect:filtering} \begin{figure*} \centering \includegraphics*[scale=0.5]{allmols1d_allobs.pdf} \vspace{-4mm} \caption{Spectra of the lines targeted in our SMA survey (left) and in archival ALMA data (right). For the CO J=2-1 line (top row), we show the effect of our spectro-spatial filtering technique (see \S\ref{sect:filtering}). Lilac represents the spectrum of the disk spatially integrated over a mask covering all significant emission from the disk. The red line is the result of our technique, which additionally shifts spectra to the zero velocity at each spatial location, leading to a significant S/N boost at the zero velocity. For all other species, we only display spectra after filtering in the same way as done for the CO. Note the different flux scale of the two columns, and of the CO J=2-1 line observed by ALMA with respect to all other lines. Line fluxes and upper limits are reported in Table \ref{tab:mols}.} \label{fig:allmolspec} \end{figure*} No significant signal is detected in the SMA datacubes created around the spectral location corresponding to the CN N=2-1, J=$\frac{5}{2}$-$\frac{3}{2}$ line (composed of the 3 blended F=$\frac{7}{2}$-$\frac{5}{2}$, $\frac{5}{2}$-$\frac{3}{2}$ and $\frac{3}{2}$-$\frac{1}{2}$ hyperfine transitions), HCN J=3-2, HCO$^{+}$ J=3-2 , N$_2$H$^{+}$ J=3-2 and H$_2$CO J=4$_{1,4}$-$3_{1,3}$ lines. Similarly, no significant emission is observed in the ALMA datacubes around the H$_2$S 2$_{2,0}$-2$_{1,1}$, CH$_3$OH 5$_{1,4}$-4$_{2,2}$, SiO J=5-4 and DCN J=3-2 lines. To optimize detectability, we implement a spectro-spatial filtering technique similar to that introduced in \citet{Matra2015} and subsequently applied to achieve CO detections in the HD181327, $\eta$~Corvi and Fomalhaut debris disks \citep{Marino2016, Marino2017a, Matra2017b}. The method involves choosing a prior on the spectro-spatial distribution of the gas emission, and using this prior to select pixels/channel combinations where emission is expected. This maximizes the signal-to-noise ratio by effectively removing noise-dominated pixels/channels. We demonstrate this technique by applying it first to the CO J=2-1 line already detected without need for filtering by both the SMA and ALMA. In practice, the process involves two steps. First, we apply spectral filtering by shifting all 1D spectra at each spatial location in the datacube by the negative of the centroid CO velocity displayed in the moment 1 map (Figure~\ref{fig:biplot}, right). This causes the spectra to align such that the bulk of the CO emission now lies at the stellar velocity at all spatial locations. Second, we apply spatial filtering by spatially integrating over the previously created mask covering the region where CO emission is detected. This produces the CO spectra shown in Figure~\ref{fig:allmolspec} (top, red line) for the SMA (left) and ALMA (right) observations. This technique significantly improves the signal-to-noise of the detection with respect to the CO spectra directly extracted from the spectral image cube (lilac lines). The improvement is clearer for the ALMA dataset since the line is better resolved both spectrally and spatially, increasing the number of spatial locations that are spectrally independent of one another. In other words, if the emission is better resolved spatially, then the spectral lines at each spatial location will be narrower, and the spectral shifting will produce a better alignment and consequential signal--noise ratio boost. For simplicity, we here assume emission from all molecules to have similar spectro-spatial distributions of emission as observed for the CO molecule (though see caveats in \S\ref{sect:pred}). This allows us to use the observed CO emission as a template for the spectro-spatial filtering technique. Figure~\ref{fig:allmolspec} shows the resulting filtered spectra for all observed molecules. There are no significant detections of any molecular lines other than CO. We measure the filtered integrated flux upper limits by multiplying the filtered spectrum's root mean square (RMS, measured away from the line frequency) by the number of independent spectral channels covering the line width across which CO is detected. The $3\sigma$ limits derived are listed in Table \ref{tab:mols}. As this assumes that all molecules have the same spectro-spatial distribution as CO, we also calculate upper limits in a more agnostic way by spatially integrating the unfiltered data cubes over regions where the mm continuum is detected, and spectrally integrating between $\pm$5 km/s of the stellar velocity (values in parentheses in Table 2). Whether these are more or less stringent than the CO-filtered limits depends on both the on-sky area over which the continuum versus CO are detected, and on the spectral width of the CO line before versus after spectral filtering, which differs for the SMA and ALMA datasets (see top row in Fig. \ref{fig:allmolspec}). \begin{deluxetable}{cccccc} \tabletypesize{\scriptsize} \tablecaption{Observations of molecular line emission around $\beta$ Pictoris at millimeter wavelengths \label{tab:mols}} \tablewidth{0pt} \tablehead{ \colhead{Species} & \colhead{Transition} & \colhead{Freq.} & \colhead{Line Flux} & \colhead{Instr.} & \colhead{Ref.} \\ \colhead{ } & \colhead{ } & \colhead{(GHz)} & \colhead{(Jy km/s)} & \colhead{ } & \colhead{ } } \startdata H$_2$S & 2$_{2,0}$-2$_{1,1}$ & 216.710 & $\leqslant$0.10 (0.18) & ALMA & 1 \\ CH$_3$OH & 5$_{1,4}$-4$_{2,2}$ & 216.946 & $\leqslant$0.11 (0.13) & ALMA & 1 \\ SiO & J=5-4 & 217.105 & $\leqslant$0.11 (0.16) & ALMA & 1 \\ DCN & J=3-2 & 217.239 & $\leqslant$0.13 (0.16) & ALMA & 1 \\ CO & J=2-1 & 230.538 & 4.5$\pm$0.5 & ALMA & 2 \\ & & & 3.9$\pm$0.8 & SMA & 1 \\ & J=3-2 & 345.796 & 5.8$\pm$0.6 & ALMA & 2, 3 \\ CN & N=2-1 & 226.875 & $\leqslant$1.0 (1.2) & SMA & 1 \\ HCN & J=3-2 & 265.886 & $\leqslant$2.0 (1.4) & SMA & 1 \\ HCO$^{+}$ & J=3-2 & 267.558 & $\leqslant$1.5 (1.1) & SMA & 1 \\ N$_2$H$^{+}$ & J=3-2 & 279.512 & $\leqslant$1.7 (1.2) & SMA & 1 \\ H$_2$CO & J=4$_{1,4}$-$3_{1,3}$ & 281.527 & $\leqslant$1.6 (1.2) & SMA & 1 \\ \enddata \tablecomments{For CN, the upper limits refer to the J=$\frac{5}{2}$-$\frac{3}{2}$ transition. Line flux upper limits reported are at the 3$\sigma$ level, after spectro-spatial filtering. Values in parentheses are upper limits obtained from spatial integration over the region where the continuum is detected at a level $>2\sigma$ in each respective dataset.} References: (1) This work; (2) \citet{Matra2017a}; (3) \citet{Dent2014} \end{deluxetable} \section{Analysis} \label{sect:anal} We investigate how to connect the line flux upper limits measured in \S\ref{sect:res} to exocometary ice compositions relative to CO, the only molecular species detected so far in exocometary gas disks. In particular, we aim to understand the significance of these upper limits in relation to Solar System cometary compositions. We put a special emphasis on the CN/CO ratio upper limit and its consequences for HCN and CO in $\beta$ Pictoris' exocometary ices, for reasons which will become apparent in \S\ref{sect:lifetimes}. \subsection{Expanding the steady state cometary release model} \label{sect:expandmodel} In order to understand the factors that affect remote detection of molecular species released in the gas phase from exocometary ices, we use the steady state exocometary gas release model of \citet{Matra2015,Matra2017b} and expand it to include molecular species other than CO. Within the framework of this model, the mass production rate $\dot{M_{\rm i}^+}$ of molecular species i will equal its destruction rate $\dot{M_{\rm i}^-}$, \begin{equation} \dot{M_{\rm i}^+}=m_{\rm i}\dot{N_{\rm i}^+}=\dot{M_{\rm i}^-}=\frac{M_{\rm i}}{\tau_{\rm i}^-}, \end{equation} where $m_{\rm i}$ is its molecular mass in kg, $\dot{N_{\rm i}^+}$ its production rate in number of molecules per second, $M_{\rm i}$ its observed gas mass, and $\tau_{\rm i}^-$ its destruction timescale in the gas phase, which we here assume to be dominated by photodissociation, neglecting any other gas phase chemical reactions ($\tau_{\rm i}^-=\tau_{\rm i, phd}^-$). Then, the gas mass of species i we would expect to observe relative to CO is \begin{equation} \frac{M_{\rm i}}{M_{\rm CO}}=\frac{\tau_{\rm i, phd}^-m_{\rm i}}{\tau_{\rm CO, phd}^-m_{\rm CO}}\frac{\dot{N_{\rm i}^+}}{\dot{N_{\rm CO}^+}}. \end{equation} If CO and species i are released in the gas at the same rate \textit{per molecule} (an assumption that we will revisit in \S\ref{sect:depl}) we can directly link an observed gas mass ratio to an ice abundance ratio in the exocomets. Furthermore, this relation shows the crucial impact of the photodissociation timescale on the observable mass of exocometary gas species (see \S\ref{sect:lifetimes}). The next step is to link the molecular gas mass to line fluxes for given transitions as observed in this work. Following e.g. Eq. 2 in \citet{Matra2015}, and assuming optically thin transitions (see \S\ref{sect:pred}), \begin{equation} \label{eq:releaseratetoflux} \frac{F_{\nu_{\rm u\rightarrow l, i}}}{F_{\nu_{\rm u\rightarrow l, CO}}}=\frac{ A_{\rm u\rightarrow l, i}}{A_{\rm u\rightarrow l, CO}}\frac{x_{\rm u, i}}{x_{\rm u, CO}}\frac{\tau_{\rm i, phd}^-}{\tau_{\rm CO, phd}^-}\frac{\dot{N_{\rm i}^+}}{\dot{N_{\rm CO}^+}}, \end{equation} where, for both CO and species i, $F_{\nu_{\rm u\rightarrow l}}$ are integrated line fluxes in Jy km/s, $A$ and $x_{\rm u}$ are Einstein A coefficients and upper level fractional populations of the observed transition. We note that the steady state relation in Eq. \ref{eq:releaseratetoflux} remains the same for daughter molecular species such as CN and OH, as long as their production is dominated by a single parent species (such as HCN and H$_2$O). \subsection{The effect of photodissociation: lifetime of Solar System cometary molecules} \label{sect:lifetimes} \begin{figure*} \vspace{-0mm} \hspace{-2mm} \includegraphics*[scale=0.65]{phdcombo_8.pdf} \vspace{-5mm} \caption{\textit{Left:} Unshielded photodissociation timescales of molecular gas species observed in Solar System comets. Species are listed in order of their timescale, from longest lived to shortest lived, and are therefore in the same vertical order as the corresponding lines (though note that the C$_2$H$_2$ line overlaps with the CH$_3$OH line). The transparency of solid lines is set to indicate their log-scale abundance in Solar System cometary ice with respect to H$_2$O, darker for more abundant species. The purple line is for N$_2$, by far the least abundant of all listed species from measurements in comet 67P \citep{Rubin2015}. Orange dashed lines represent daughter species (CN, OH) or species that we observed but are not detected in Solar System comets (SiO). \textit{Right:} Example of our derivation of photodissociation timescales for CO; the top panel shows cross sections at relevant wavelengths obtained from the \citet{Heays2017} database. The bottom panel shows the mean intensity felt by a molecule at 85 AU in the $\beta$ Pic disk (assuming the gas to be optically thin to UV photons). We show contributions from both the ISRF and the star, highlighting the difference between the observed stellar flux of $\beta$ Pictoris and that expected from a model of the same spectral type as the star. } \label{fig:timescales} \end{figure*} In Figure~\ref{fig:timescales} (left), we present unshielded photodissociation timescales for molecules observed around $\beta$ Pic as well as other species observed to be abundant in Solar System comets. We do not include HCO$^+$ and N$_2$H$^+$ as these ions, if present at all, would likely recombine through free electrons faster than they photodissociate; taking the example of HCO$^+$, using an electron density of 10$^2$-10$^3$ cm$^{-3}$ \citep{Matra2017a}, temperatures between 20 and 100 K and reaction rates from the KIDA \footnote{\url{http://kida.obs.u-bordeaux1.fr}} database \citep{Wakelam2012}, its recombination timescale is 0.2 to 5 days, much shorter than the $3.7\times10^3$ yr photodissociation timescale at 85 AU from the star. Photodissociation timescales for all molecules were calculated using photodissociation cross sections from \citet[][]{Heays2017}\footnote{\url{http://home.strw.leidenuniv.nl/~ewine/photo/}} and references therein, neglecting isotope-selective photodissociation for rarer isotopologues. The radiation field includes both the observed spectrum of the $\beta$ Pic star and the interstellar radiation field (ISRF). The stellar spectrum (A. Brandeker, priv. comm.) was obtained by superimposing observed spectra from HST/STIS \citep{Roberge2000} and FUSE \citep{Bouret2002,Roberge2006} on the photospheric model spectrum of \citet{Fernandez2006}. For the ISRF we adopted the formulation of \citet{Draine1978} with the long wavelength expansion of \citet{vanDishoeck2006}. We note that the $\beta$ Pictoris star is surprisingly active for an A star, with X-ray observations presenting evidence for thermal emission from a cool corona \citep{Hempel2005, Gunther2012}, as well as UV chromospheric emission \citep{Deleuil2001, Bouret2002}. The latter effectively causes a considerable UV flux `excess' compared to a typical main sequence A-star; this acts to shorten the survival lifetime of molecules against photodissociation, particularly for molecules whose photodissociation bands lie at shorter UV wavelengths (such as CO, see Figure~\ref{fig:timescales}, top right). This leads to a considerable change in the unshielded CO photodissociation timescale for the $\beta$ Pictoris gas disk; Figure~\ref{fig:timescales} (bottom right) shows that photodissociation at the clump radial location ($\sim$85 AU) has a significant contribution by the strong UV field of $\beta$ Pictoris as well as by the ISRF \citep[where the latter would instead dominate for a typical A5V stellar model, ][]{Kamp2000}. We therefore revise the unshielded CO photodissociation lifetime from 120 yrs \citep{Kamp2000, Dent2014} down to 42 yrs. We note that dust shielding is negligible for optically thin dust in debris disks \citep[e.g.][]{Kamp2000}, and H$_2$, if at all present, should have a low enough column density not to provide shielding either \citep{Matra2017a}. CO is however abundant enough that self-shielding cannot be neglected \citep{Matra2017a}. When this is taken into account, the CO lifetime increases from 42 to $\sim$105 yrs. This is accounted for in all calculations involving CO. We neglect self-shielding and shielding by CO for all other molecules due to their unknown spatial distributions and shielding functions. Neglecting self-shielding should be a good approximation given the much lower predicted abundance of molecules other than CO. Overall, Figure~\ref{fig:timescales} (left) shows that the harsh UV radiation field around $\beta$ Pic causes photodestruction of the vast majority of volatile species to take place in timescales of days to months. Therefore, photodissociation alone can explain most of our upper limits, as we confirm more quantitatively in \S\ref{sect:pred}, where we make predictions for future surveys (see Figure~\ref{fig:molpreds}, right). N$_2$, CO and CN are by far the longest lasting molecules with unshielded photodissociation timescales of 96, 42 and 16 years, at least an order of magnitude longer than for any other molecular species. This means that the only observable molecule with a survival timescale similar to that of the detected CO is CN, which we therefore focus on for the rest of this work. In Solar System comets CN gas is produced mainly by photodissociation of HCN gas \citep{Fray2005}; we will here assume that the same applies for exocomets around $\beta$ Pictoris. One potential caveat to this assumption is that although for simplicity we have neglected gas-phase chemical production/destruction pathways other than photodissociation, CN could be destroyed by reaction with atomic oxygen \ion{O}{1}, which has been detected in the disk around $\beta$ Pictoris \citep[e.g.][]{Brandeker2016, Kral2016}. Unfortunately, the detection being unresolved spectrally and spatially combined with excitation and optical depth effects make number density estimates at the locations where CN is expected to lie very uncertain. Nonetheless, combining a number density value of $2\times10^2$ cm$^{-3}$ at 85 AU from the best-fit dynamical evolution model of \citet{Kral2016} with a reaction rate of $5\times10^{11}$ cm$^{3}$ s$^{-1}$ from the KIDA database yields a reaction timescale of $\sim$3 years. This is shorter than the CN photodissociation timescale (16 years), indicating that reaction with oxygen could introduce an uncertainty of a factor of a few to our calculations, increasing the inferred HCN/CO outgassing ratio. Given the uncertainty on the oxygen abundance, however, we opt to neglect this destruction pathway of CN in this work. \subsection{The effect of molecular excitation including fluorescence} \label{sect:exc} The only unknowns remaining to link the observed $F_{\rm CN\ N=2-1,\ J=5/2-3/2}$ / $F_{\rm CO\ J=2-1}$ flux ratio to the $\dot{N_{\rm HCN}^+}$/$\dot{N_{\rm CO}^+}$ ratio of the HCN and CO outgassing rates are the fractional populations of the upper levels $x_{\rm N=2,\ J=5/2,\ CN}$ and $x_{\rm J=2,\ CO}$ of the observed line transitions. \citet{Matra2015} showed that, at least for CO, the assumption of local thermodynamic equilibrium (LTE) is unlikely to apply in the low gas-density environments present in debris disks. This prediction was confirmed by CO line ratio observations in $\beta$ Pictoris \citep{Matra2017a}, and observations of atomic gas species \citep{Kral2016,Kral2017}. To determine the CO and CN level populations we therefore carry out a full non-local thermodynamic equilibrium (NLTE) calculation which includes solving the equations of statistical equilibrium for both molecules. NLTE level populations depend on the local radiation field within the disk, and on the local density of the dominant collider species (here taken to be electrons) $n_{e^-}$ and the local kinetic temperature $T_k$. We direct the reader to \citet{Matra2015} for details. \begin{figure} \hspace{-6.5mm} \includegraphics*[scale=0.31]{CNoverCOuplevfracpops_vs_ncoll_Tk_bPic.pdf} \vspace{-8mm} \caption{Fractional populations $x$ of the upper level of the observed transitions for CO (dashed lines) and CN (solid lines), assuming the radiation field felt by molecules at 85 AU from the star. Fainter lines show the case where fluorescence is not taken into account. In general, the populations depend on the density of the dominant collider species \citep[here electrons, x axis,][]{Matra2015}, and the kinetic temperature of the gas (colours). Increasingly darker colours indicate increasingly lower temperatures. \label{fig:CNvsCOfracpops} \end{figure} Thin dashed and solid lines in Figure~\ref{fig:CNvsCOfracpops} show the resulting dependence of the CO and CN upper level fractional populations $x$ on the electron density and temperature in the gas disk, when applying our previous NLTE model \citep{Matra2015}. Upper level populations vary between two limiting regimes, where excitation of the molecules is dominated by either radiation (far left, low $n_{\rm e^-}$) or collisions (i.e. LTE, far right, high $n_{\rm e^-}$). As expected, the calculated excitation of the considered CO and CN levels drops by several orders of magnitude in the radiation-dominated regime. This is because the model so far included only low-energy rotational transitions at far-IR/mm wavelengths, which can only be excited by the faint CMB and disk continuum emission. In Appendix \ref{app:a}, we expand this NLTE excitation model to include vibrational and electronic as well as rotational levels for both CO and CN. This allows us to account for the effect of fluorescence, which in low-density regimes such as Solar System comets and exocometary gas disks, where radiation can dominate excitation, becomes an important excitation mechanism. Fluorescence works through absorption of stellar UV (IR) photons from low rotational levels in the ground electronic and vibrational state to excited electronic (vibrational) levels. This is followed by rapid relaxation to the ground electronic and vibrational state, but to higher rotational levels than the molecule started from. As we can see in Fig. \ref{fig:rotpops} (e.g. green versus red lines), this effectively leads to enhanced population of rotational levels above ground, where this can be orders of magnitude higher compared to when fluorescence is not considered. We note that fluorescence matters only in the low-density, radiation-dominated regime (left in Fig. \ref{fig:CNvsCOfracpops}, thick versus thin lines), whereas populations in the LTE, collision-dominated regime (right in Fig. \ref{fig:CNvsCOfracpops}) remain unchanged. The extent to which fluorescence impacts molecular excitation depends on the stellar flux received by the molecule and its spectral shape from UV to IR wavelengths. In general, we find that taking fluorescence into account is crucial when using NLTE excitation models to derive molecular gas masses from observed fluxes. This impacts previous CO mass measurements where this effect was not taken into account; while the exact impact depends on the UV and IR flux received by a molecule which is different for each observed system, the overall effect of the enhanced excitation will be to lower the upper limits in the range of NLTE-derived masses. The total CO mass around $\beta$ Pic remains largely unchanged as it is tightly constrained observationally through the J=3-2/J=2-1 CO line ratio. For completeness, we report an updated value of $3.6^{+0.9}_{-0.6}\times10^{-5}$ M$_{\oplus}$, calculated in the same way as \citet{Matra2017a}. Including fluorescence will also lower the electron densities derived in Fig. 11 of that work by a factor of a few, bringing them closer to the model predictions of \citet{Kral2016}, and flatten their radial distribution in the inner regions of the CO disk. Taking fluorescence at the clump location into account, we find that the ratio in fractional upper level populations between CN and CO varies between 0.49 and 0.71, with the lowest value for electron densities of 10$^2$-10$^3$ cm$^{-3}$ and temperatures above 50 K. We note that this electron density - temperature dependence of the ratio between CN and CO fractional upper level populations is much weaker than for each individual upper level population, due to the similarity in the structure of rotational energy levels between CO and CN. \subsection{Deriving the HCN/(CO+CO$_2$) ratio of outgassing rates} \label{sect:hcnovco} Plugging CN/CO ratios of upper level populations, photodissociation timescales and observed fluxes into Eq. \ref{eq:releaseratetoflux} allows us to derive an upper limit on the HCN/CO ratio of outgassing rates, which will carry the same dependence on electron density and temperature as the ratio between the CN and CO fractional populations mentioned above (coloured lines in Fig. \ref{fig:CNvsCOfracpops}). The lowest CN/CO ratio in upper level fractional populations sets the most conservative upper limit of 2.5\% on the HCN/CO ratio of outgassing rates An important point to make is that CO gas is also produced via rapid photodissociation of CO$_2$ gas. This implies that if CO$_2$ is being released from cometary ice together with CO, which we deem likely (see discussion in \S\ref{sect:depl}), the CO gas observed has contributions from both the CO and CO$_2$ ice reservoirs. From now on, we therefore consider our upper limit of 2.5\% to trace the HCN/(CO+CO$_2$) rather than the HCN/CO ratio of outgassing rates. With this limit, in \S\ref{sect:disc} we draw the comparison between $\beta$ Pictoris and Solar System comets, and discuss the origin of a potential abundance discrepancy. \section{Discussion} \label{sect:disc} \subsection{HCN/(CO+CO$_2$) outgassing rates in $\beta$ Pictoris exocomets vs. Solar System comets} \label{sect:depl} \begin{figure} \hspace{-6.5mm} \includegraphics*[scale=0.37]{HCNoverCOiceratio_bPic_vs_comets.pdf} \vspace{-8mm} \caption{Comparison between our measured upper limit on the HCN/(CO+CO$_2$) ratio of outgassing rates in $\beta$ Pictoris (red) with Solar System comets. For Solar System comets, symbols represent the HCN/(CO+CO$_2$) outgassing ratios (orange, where available) or HCN/CO outgassing ratios (blue) reported by \citet{LeRoy2015} and references therein. We use filled circles where a single value is reported, and vertical bars where a range of values is reported. Upward and downward pointing triangles represent lower and upper limits, respectively. Green points are HCN/CO measurements for comets observed at large distances from the Sun \citep[Hale-Bopp at 4.6-6.8 AU, Chiron at 8.5-11 AU, and 29P at 5.8 AU,][]{Womack2017}, where different thermal outgassing rates are expected for CO and HCN.} \label{fig:HCNoverCOoutgasrat} \end{figure} Figure~\ref{fig:HCNoverCOoutgasrat} shows our conservative upper limit of 2.5\% on the ratio of the HCN/(CO+CO$_2$) outgassing rate in $\beta$ Pic (red) compared to HCN/(CO+CO$_2$) and HCN/CO values measured in Solar System comets from \citet{LeRoy2015} and references therein (orange and blue symbols, respectively). We find that the upper limit we set in $\beta$ Pic is at the low end of the values derived for comets as they approach the Earth in our own Solar System. Although our current upper limit per se does not yet indicate a significant depletion compared to Solar System values, we here consider how a low value (and, if confirmed in future, a true depletion) could be linked to either the outgassing mechanism itself, or to the intrinsic HCN/(CO+CO$_2$) abundance in the ice. The spatial distribution of CO provides an important clue about the gas release mechanism, as CO emission is peaked at a clump located $\sim$85 AU from the star \citep{Dent2014,Matra2017a} that coincides with a dust enhancement most clearly observed in mid-IR imaging \citep{Telesco2005}. This dust enhancement should be associated with higher collisional rates compared to the rest of the belt, and it strongly suggests both the CO and dust enhancements originate from collisions, directly or indirectly. The measured outgassing rates of molecular species (integrated over all grain sizes) should reflect the ice composition \textit{as long as both ice species are released as gas before they reach the bottom size of the collisional cascade} \citep{Matra2017b}. Whether this is the case depends on the details of the release process. Gas may be released during collisions through at least three mechanisms: (1) direct collisional release of species that should have already sublimated at the temperature characteristic of the belt, but were trapped beneath a layer of refractories or within other ice matrices prior to the collision; (2) thermal sublimation following collisional heating due to e.g. hypervelocity impacts \citep[e.g.][]{Czechowski2007}, or (3) UV photodesorption of resurfaced ice, which was previously buried below a layer of refractories \citep{Grigorieva2007}. While CO is considered a supervolatile and is most likely fully lost by the time grains reach the blow-out size \citep{Matra2017b}, HCN is not and will not sublimate even at the temperature of the smallest grains in the $\beta$ Pic belt (which dominate the emission and lead to a directly measurable value of $\sim$86 K from the spectral energy distribution). Such temperature dependence on the relative outgassing rates is observed in Solar System comets, where sublimation drives the outgassing and causes the HCN/CO ratio of outgassing rates to decrease with increasing distance from the Sun \citep{Womack2017}. For comparison, we note that $\beta$ Pictoris is much more luminous than our own Sun \citep[$L_{\star}$=8.7 L$_{\odot}$,][]{KennedyWyatt2014}, and that we are observing exocometary CO at distances of $\sim$50-220 of AU, where blackbody temperatures are in the range $\sim$30-70 K. The same temperatures are attained in the Solar System at a distances of 19-39 AU from the Sun, i.e. from the orbit of Uranus out to the Kuiper belt. This means that $\beta$ Pic's exocomets are much colder than observed active comets in our Solar System, even compared to the distantly active ones mentioned above (observed at $\sim$5-11 AU from the Sun). This implies that we would expect CO but not HCN to sublimate from $\beta$ Pic's exocomets. The question is then whether thermal sublimation is the dominant gas release mechanism in the $\beta$ Pic disk. Given the strong UV field from the central A-type star, UV photodesorption of ice resurfaced after collisions is a promising mechanism to release ice species less volatile than CO to the gas phase. The calculations of \citet[][]{Grigorieva2007} show that the timescale for complete UV photodesorption of a pure H$_2$O ice grain is shorter than the collision timescale for grains below $\sim$20 $\mu$m in size. Assuming HCN has a similar photodesorption yield as water, and neglecting any trapping within a refractory layer, this implies that all of the HCN ice will be released from grains before reaching the smallest size in the collisional cascade. A similar argument applies to CO$_2$, which has a volatility in between that of CO and HCN \citep{Matra2017b}. UV photodesorption is therefore most likely at play, and if dominant that would imply that HCN and CO$_2$ should be released in the gas phase together with CO, at rates reflecting their ice abundances. Even if HCN does not photodesorb and survives in the ice-phase on the smallest grains in the cascade, it can be thermally sublimated as these unbound grains collide on their way out of the system \citep{Czechowski2007}. This is because stellar radiation pressure accelerates them to sufficiently high velocities for collisions to provide sufficient heating for sublimation. Application of this model to the $\beta$ Pic disk shows that this process can release ice (of unspecified composition) in the gas phase \citep{Czechowski2007}, with gas production rates of the same order as those estimated for CO in the belt. Then, similarly to UV photodesorption, and as long as all ice species are fully sublimated in each impact, high velocity collisions of unbound grains would also produce gas release rates reflecting ice abundances. In summary, a low HCN/(CO+CO$_2$) ratio of outgassing rates could be attributed to the gas release mechanism only if this is driven by low velocity collisions, as this induces release of trapped supervolatiles alone. However, we would expect outgassing of all molecules independent of their sublimation temperatures if UV photodesorption and/or high velocity collisions with unbound grains are the dominant outgassing mechanisms. Detailed modeling results \citep{Grigorieva2007,Czechowski2007} show that these processes are most likely at play for small grains in the $\beta$ Pic belt. Then, unless most CO is being released through low velocity \textit{non-catastrophic} collisions between large bodies at the top of the cascade \citep[which are not taken into account by our model, see][]{Matra2017b}, we would expect ratios of outgassing rates to reflect cometary ice abundances. These can then be directly compared with relative abundances from Solar System comets, measured as they come close enough to the Sun for their ratios of outgassing rates to reflect ice compositions. In the scenario where outgassing in the $\beta$ Pic belt is dominated by UV photodesorption or high velocity collisions of small grains, our upper limit on the HCN/(CO+CO$_2$) ratio of outgassing rates for $\beta$ Pic's exocomets suggests an HCN/(CO+CO$_2$) ice abundance ratio that is at the low end of the range observed in Solar System comets, although still not exceptionally low. Future, deeper observations (Sect. \S\ref{sect:pred}) are required to conclusively determine whether the abundance of $\beta$ Pic's exocomets is truly abnormal compared to Solar System comets. Determining the abundance of HCN in exocomets is especially interesting because of its connections to the origins of life chemistry \citep[e.g.][]{Powner2009}. The large scatter in HCN abundances observed amongst Solar System comets \citep[][and references therein]{Mumma2011}, together with observation of cyanides in protoplanetary disks \citep{Oberg2015, Guzman2017, Huang2017}, indicate that cometary cyanides may not be directly inherited from the ISM, but undergo active chemical processing during the epoch of planet formation. Whether the endpoint of this chemistry is different for different planetary systems is yet unclear and can only be resolved by future, deeper observations of exocometary cyanides. \subsection{Predictions for molecular surveys of gas-bearing debris disks} \label{sect:pred} \begin{figure*} \hspace{-3mm} \includegraphics*[scale=0.4]{molpredictionsplusresults.pdf} \vspace{-8mm} \caption{\textit{Left:} Predicted flux ratios compared to the detected CO J=2-1 line in the $\beta$ Pic disk, for Solar System cometary species observable at far-IR to radio wavelengths. For each species, vertical bars represent the expected flux ratios for the range of abundances with respect to CO observed in Solar System comets. Dashed vertical bars assume optically thin emission, whereas solid vertical bars take into account the optical thickness of the line (where this is only significant for OH). LTE excitation is assumed for all species, with a temperature of 52 K. The transition with the best `effective S/N' (see main text) is selected for each species. Green horizontal bars show the 3$\sigma$ threshold achievable with available facilities (SOFIA, ALMA, and the VLA) for 1h of integration and typical weather. Lighter green bars assume unresolved emission (best case scenario), whereas darker ones consider the loss in sensitivity expected for resolving the disk if it has the same on-sky extent as the CO disk, for the lowest spatial resolution of the instrument at the frequency in question (worst case scenario). Labels on the top x axis show the instrument and frequency best suited for detection of each species. \textit{Right:} The same predictions are now compared to the upper limits (red triangles) achieved in this work for molecular transitions observed with the SMA, ALMA and \textit{Herschel}. } \label{fig:molpreds} \end{figure*} To guide future observations, we use Eq. \ref{eq:releaseratetoflux} to calculate expected line flux ratios around $\beta$ Pictoris for all common cometary species taking into account the range of abundances observed in the Solar System. We make two main assumptions. First, we assume all species are co-located with CO, leading to similar spatial distributions and excitation conditions. Since the bulk of the CO emission originates from the SW clump at 85 AU from the star, we use the stellar radiation field at 85 AU as representative of the bulk of the gas disk. Second, we calculate the excitation of all species using the LTE approximation \citep[apart from CO itself, where the level populations are very well constrained by the existing J=3-2/J=2-1 line ratio,][]{Matra2017a}. Figure~\ref{fig:CNvsCOfracpops} shows that the LTE assumption does not affect the calculated populations of CN and CO by more than a factor of a few for low-energy levels, but we cannot exclude that this may have a significant effect for other molecules and higher transitions. We vary the gas kinetic temperature between 52 K \citep[as predicted by thermodynamical models at the clump location,][]{Kral2016} and 210 K \citep[as the upper limit estimated through the resolved CO scale height at the clump location,][]{Matra2017a}. We focus on molecular transitions observable with currently available facilities at far-IR to radio wavelengths, namely the Stratospheric Observatory for Infrared Astronomy (SOFIA), ALMA and the Karl G. Jansky Very Large Array (VLA). We select the best observable transition for each temperature and molecule to be that with the highest `effective S/N'. We construct this by dividing a transition's flux ratio with respect to CO (as calculated above) by the sensitivity of each telescope facility considered, at the frequency of the given transition. In addition, we consider the telescope's resolution by dividing this effective S/N by $\sqrt{N_{\rm beams}}$, where $N_{\rm beams}$ is the number of resolution elements covering the gas disk. As this acts to penalize facilities that over-resolve the gas disk, we choose a resolution closest to the CO disk's on-sky diameter \citep[$\sim16.5\arcsec$][]{Matra2017a} for the ALMA and VLA interferometers. This is a conservative approach as the spectral stacking technique described in \S\ref{sect:filtering} \citep[][Loomis et al. in press]{Matra2015} should significantly alleviate the sensitivity loss caused by over-resolving the disk. Having selected the best transition for each molecule and temperature, we show its range of fluxes expected for Solar System cometary abundances in Figure~\ref{fig:molpreds}, left (vertical bars). We only show predictions for a single temperature of 52 K, as we find that the maximum effective S/N achievable for most species is largely independent of temperature (since e.g. for higher temperatures, higher transitions will emit more strongly and can then be selected for observations). These predictions can then be compared with each telescope's 3$\sigma$ detection thresholds (green bars), where these also take into account that the disk will be resolved (darker as opposed to lighter bars for unresolved emission). We find CN (as expected), but also HCN and OH to be promising molecules for detection around $\beta$ Pic. This is largely due to their transitions having Einstein A coefficients orders of magnitude larger than CO, compensating for their lower gas masses caused by their shorter photodissociation timescales. Since the predicted line fluxes can, in a few cases, be up to orders of magnitude higher than CO, we need to consider that these transitions may be optically thick, particularly since CO itself has modest optical depth at the clump location ($\tau_{\rm CO\ J=2-1}\sim$0.12). To estimate optical depth, we first take the CO column density at the clump location as determined through J=3-2/J=2-1 line ratio observations \citep{Matra2017a}. Then, we scale this by the abundance ratio of molecule $i$ with respect to CO in the gas, to find the column density of molecule $i$. This can be combined with LTE fractional populations to solve for the optical depth through its definition \citep[Eq. 3,][]{Matra2017a}, scaling the velocity width of the line to the Doppler-broadened width of the molecule in question. We find that the predictions, when accounting for optical depth effects (solid as opposed to dotted vertical bars in Figure~\ref{fig:molpreds}), change significantly only for the OH $^2\Pi_{3/2}\ \rm{J}=5/2^+-3/2^-$ line at 2.51 THz. Overall, if cometary volatiles are being released at rates reflecting their ice composition, and if their composition reflects that of Solar System comets, we expect CN and HCN to be readily detectable with ALMA around $\beta$ Pictoris. Given that CN photodissociation takes place through photons of a similar wavelength to those causing CO photodissociation, we expect the CN/CO flux prediction to hold for exocometary gas disks around different stars as well. An interesting result of our calculation is that OH detection should be possible with SOFIA. This encouraged us to check the \textit{Herschel} Science Archive, where we found unpublished PACS observations of $\beta$ Pictoris covering the OH line. We extracted the point-source-corrected spectrum from the central 7$\arcsec$ spaxel of the PACS Level 3 data product\footnote{\textit{Herschel} Observation ID: 1342198170}, and scaled it to the total flux of the central 3x3 spaxels. Then, we carried out continuum subtraction through a second order polynomial, leading to a measured RMS noise level of 0.24 Jy. Given the coarse spectral resolution of the data (295.2 km/s at 119.3 $\mu$m), we assume the line is unresolved to set a 3$\sigma$ upper limit on the integrated line flux of 2.1$\times$10$^2$ Jy km/s. We find that this is already at the very low end of our predicted range. However, given the significant optical thickness of the line, our prediction is very sensitive to the choice of OH temperature or spatial distribution, which may be oversimplified here. We find detection of rotational lines from the H$_2$$^{18}$O water isotopologue, hydrogen sulfide (H$_2$S) and ammonia (NH$_3$) to be very unlikely with current instrument capabilities, although ammonia may be detectable in future with the sensitivity improvement brought by the Next Generation Very Large Array\footnote{\url{http://library.nrao.edu/public/memos/ngvla/NGVLA_17.pdf}}. On the other hand, we can already probe Solar System cometary levels for molecules such as the main isotopologue of water (H$_2$O), heavy water (HDO), formaldehyde (H$_2$CO) and methanol (CH$_3$OH), which could be detected if their respective ices are at the high abundance end of Solar System composition compared to CO. We note that for these species, like OH, the short photodissociation timescale would cause an even more pronounced clump compared to CO observations (an aspect which we have neglected here for simplicity). This would mean that molecular emission would have a higher optical depth than predicted here. At the same time, the more compact emission would be less over-resolved compared to CO, leading to higher spatially integrated S/N, and lower upper limits as derived here through our spectro-spatial filtering technique. Finally, we note that an increased optical depth \textit{to UV photons} could also prolong the survival lifetime of these molecules, leading to more favourable conditions for detection in future surveys. \section{Conclusions} \label{sect:concl} We have presented the first molecular survey of the exocometary gas disk around $\beta$ Pictoris with the SMA, and combined it with archival ALMA data to obtain coverage of 10 different molecular species, namely CO, CN, HCN, HCO$^+$, N$_2$H$^+$, H$_2$CO, H$_2$S, CH$_3$OH, SiO and DCN. We reported continuum and CO J=2-1 detections and used upper limits on all other species as the basis to expand an exocometary release model beyond CO. We obtain the following conclusions: \begin{enumerate} \item The (optically thin) line fluxes for a given molecule depend on its exocometary outgassing rate, its photodissociation lifetime (neglecting other gas-phase chemical reactions), its intrinsic line strength, and the fractional population of the upper level of the transition (Eq. \ref{eq:releaseratetoflux}). Knowledge of this upper level population requires NLTE excitation modelling which we here expand to include the effect of fluorescence. We find that the latter produces orders of magnitude higher excitation in the low gas density, NLTE regime, and needs to be taken into account for robust derivation of gas masses from observed line fluxes. \item CO is the longest-lived cometary molecule against photodissociation that is observable at millimeter wavelengths. This long lifetime explains, in part, why it is the only one that has been detected so far. Other observable molecules have survival lifetimes several orders of magnitude below that of CO, except for CN. This makes CN the most promising molecule for detection in debris disks after CO. \item CN is a daughter molecule, which we assumed to be produced mostly through photodissociation of HCN gas released from the ice phase. CO gas on the other hand, is both a parent and daughter species produced by CO$_2$ photodissociation. Therefore, we used our upper limit on the CN/CO flux ratio to derive an upper limit on the HCN/(CO+CO$_2$) ratio of outgassing rates of 2.5\%. This is still consistent with, although below most of the values measured in Solar System comets as observed near Earth. If deeper CN and/or HCN observations push this HCN/(CO+CO$_2$) outgassing rate upper limit down to a significant depletion compared to Solar System comets, we show that this may be caused by either the outgassing mechanism or a true depletion in the ice abundance. \item Outgassing ratios of molecular species reflect their ice compositions as long as ices cannot survive on grains down to the blow-out size in the collisional cascade and be removed from the system. This is likely the case in $\beta$ Pictoris, as 1) collisions will allow ice layers to resurface, where they become subject to rapid UV photodesorption \citep{Grigorieva2007}, and 2) the smallest unbound grains will undergo hypervelocity collisions on the way out of the system leading to vaporization of any ice that may have survived on these grains \citep{Czechowski2007}. In general, these processes will allow release of molecules less volatile than CO that would otherwise survive in the ice phase on the smallest grains and be dynamically removed by radiation pressure from the central star. \item Then, unless non-catastrophic collisions at the top of the cascade are the dominant gas release mechanism, a low HCN/(CO+CO$_2$) outgassing rate is attributed to a low HCN/(CO+CO$_2$) abundance in the exocometary ice. If confirmed by deeper observations, this would indicate that active cyanide chemistry during planet formation produces a wide variety of cometary compositions across planetary systems. \item We present predictions for future detection of cometary species around $\beta$ Pictoris, assuming Solar System abundances and LTE excitation. We find that ALMA should readily detect CN and HCN line emission, even for the most HCN-poor Solar System abundances. Other species such as H$_2$O, HDO, H$_2$CO, CH$_3$OH and DCN may be detectable, depending on their specific composition, spatial distribution and excitation conditions. \item Finally, we report \textit{Herschel} archival upper limits on the OH $^2\Pi_{3/2}\ \rm{J}=5/2^+-3/2^-$ line at 2.51 THz that are already at the very low end of the range predicted assuming LTE and Solar System cometary H$_2$O abundances. The line is optically thick and hence the flux prediction is sensitive to the assumed on-sky distribution and temperature of OH gas, which are likely oversimplified here. Further modelling taking these effects into account is needed to evaluate whether this upper limit indicates an underabundance of water in $\beta$ Pic's exocomets, and whether SOFIA may be able to detect OH from photodestruction of water in exocometary gas disks. \end{enumerate} \acknowledgments The authors are grateful to A. Brandeker and W.-F. Thi for providing the spectrum of the star and the complete rate matrix of CO including vibrational and electronic levels. The authors would also like to thank Quentin Kral and Gianni Cataldi for helpful notes on the submitted manuscript. LM acknowledges support from the Smithsonian Institution as a Submillimeter Array (SMA) Fellow. KI\"O acknowledges support from the Simons Collaboration on Origins of Life (SCOL). The Submillimeter Array is a joint project between the Smithsonian Astrophysical Observatory and the Academia Sinica Institute of Astronomy and Astrophysics and is funded by the Smithsonian Institution and the Academia Sinica. This paper makes use of ALMA data ADS/JAO.ALMA\#2012.1.00142.S. ALMA is a partnership of ESO (representing its member states), NSF (USA) and NINS (Japan), together with NRC (Canada), NSC and ASIAA (Taiwan), and KASI (Republic of Korea), in cooperation with the Republic of Chile. The Joint ALMA Observatory is operated by ESO, AUI/NRAO and NAOJ. \textit{Herschel} is an ESA space observatory with science instruments provided by European-led Principal Investigator consortia and with important participation from NASA. \facility{SMA, ALMA, \textit{Herschel}}. \software{ MIR, miriad \citep{Sault1995}, CASA \citep{McMullin2007}, Matplotlib \citep{Hunter2007} } \bibliographystyle{apj}
\section{Introduction} \noindent A new paradigm for cold dark matter was recently suggested in Refs.~\cite{Khoury:2014tka,Berezhiani:2015bqa,Berezhiani:2015pia}. It was shown that the galactic velocity curves can be explained by the presence of a superfluid the phonons of which are weakly coupled to baryonic matter. A hybrid scenarios of cold dark matter and MOND (Modify Newtonian Potential) then arose. At the same time, it was shown that, contrary to the MONDs proposals, this kind of ``MOND superfluid dark matter'' is compatible with very constraining observations from clusters (in particular the Bullet cluster). The model is based on a non-relativistic effective Lagrangian, which {\it a posteriori} appears to be a phenomenologically healthy framework. But issues regarding the UV completion of the model have not yet solved in the literature. In particular, it was shown that the relativistic completion of the effective non-relativistic Lagrangian is a non-perturbative model with complicated highly non-linear interactions involving derivatives and polynomial mixed terms. Another unsolved aspect, which should be connected to the previous one, concerns the genesis of MOND superfluid dark matter. While in the traditional WIMPs or axion cold dark matter paradigms, the genesis mechanism is well known, in MOND superfluid is still unclear how such a state of matter could emerge in the early Universe. In this letter, we show that the model developed in Refs.~\cite{Khoury:2014tka,Berezhiani:2015bqa,Berezhiani:2015pia} exhibits a {\it non-Wilsonian} UV behavior. In particular, we show that the model belongs to the class of theories that are unitarized by the production of classical non-perturbative configurations in the scattering amplitudes. This is a mechanism dubbed {\it classicalization} by {\it Dvali and Gomez}, which was largely studied in many non-linear models \cite{Dvali:2010jz,Dvali:2012mx,Bajc:2011ey,Percacci:2012mx,Vikman:2012bx,Addazi:2015ppa}. In MOND superfluid model, the UV cutoff appears just around $1\, \rm meV$. This means that the theory predicts the production of classical configurations just around $1\, \rm meV$. This should also shed new light on the superfluid dark matter genesis mechanism. As shown in \cite{Khoury:2014tka,Berezhiani:2015bqa,Berezhiani:2015pia}, from best fits of galactic rotational curves, the phonon mass should be around ${1\div 10}\, \rm eV$ \footnote{It is tempting to suggest that the superfluid state is a neutrino superfluid, in which the condensation mechanism is triggered by a hidden non-linear electrodynamics sector coupled to neutrinos. This mechanism also connects the generation of the neutrino mass with the cosmological constant \cite{Alexander:2009yb,Addazi:2016oob}. }. Light Particles composing the superfluid can be generically produced as hot dark matter in the early Universe, arising from decays after the inflaton reheating. Their density ratio over baryonic density is directly controlled by their coupling with the inflaton --- or with other intermediate particles in which the inflaton decays. With these assumptions, these particles should scatter at energies always much higher than the cut-off scale. Consequently, classicalons are formed in each scattering until the late Universe, when the thermal bath lower to $T\simeq 1\div 10^{-1}\, \rm meV$. These processes can be then interpreted as the formation of the superfluid state. For $E>\!\!>1~ {\rm eV}$, the formation and evaporation of classicalons may produce many soft particles, which partition the center of mass (CM) energy into a large number of emitted particles. Emitted particles should then be so soft to easily undergo a Bose-Einstein condensation mechanism. On the other hand, when the CM energy is above the threshold $E_{CM}\geq {\rm few}\, {\rm eV}$, the classicalon cannot evaporate into many particles, and states that are produced have a very tiny kinetic energy. Thus, the unitarization mechanism from classicalization may also be claimed to catalyze the production of the superfluid dark matter state. We emphasize that the appearance of light thermal relict particles can be made consistent with observations, only because of the mediation provided by classicalization effects. Indeed, as shown in Ref.~\cite{Berezhiani:2015bqa}, the light particles instantiating the superfluid dark matter picture shall be emitted through the mechanism of axion-like vacuum displacement. But the latter necessarily requires a temperature scale that is dependent of the parameter $\Lambda$ introduced in Ref.~\cite{Berezhiani:2015bqa}. We further notice that the details of classicalization are independent on the higher orders of the derivatives involved in the definition of the specific Lagrangian. Our analysis of the model introduced in Ref.~\cite{Berezhiani:2015bqa} shall not then be considered as the only working example of classicalizing theory, as we will specify in the next section. The paper is organized as follows. In Sec.~\ref{classic} we summarize the main ideas behind the concept of classicalization. In Sec.~\ref{mod} we introduce the superfluid cold dark matter model, as developed in Refs.~\cite{Khoury:2014tka,Berezhiani:2015bqa,Berezhiani:2015pia}. In Sec.~\ref{cas} we describe the production of the superfluid state from a cooling cascade, focusing on the energy partition processes. In Sec.~\ref{bo}, taking into account the thermal history of the Universe, we describe the phase transition to the superfluid state. Finally, in Sec.~\ref{co}, we spell our conclusions and discuss the novelty of this analysis. \section{Classicalization in a nutshell} \label{classic} \noindent In order to understand the phenomenon of classicalization, we take into account as in Ref.~\cite{Dvali:2010jz} a real scalar field $\phi$ sourced by a current $J$ and governed by the theory \begin{eqnarray} \label{classex} &&\mathcal{L}(\phi, J)=\mathcal{L}(\phi) + \frac{\phi}{M_*} J\,,\label{classex} \\ &&\mathcal{L}(\phi)=(\partial_\mu \phi)^2 + \frac{\phi}{M_*} \, (\partial_\mu \phi)^2 + \frac{\phi}{M^5_*} \, (\partial_\mu \phi)^4 + \dots \,. \nonumber \end{eqnarray} The non-linear terms in $\mathcal{L}(\phi)$ provide an example of the self-sourcing of the $\phi$ field. At the perturbative level, these terms entail violation of unitarity at CM energies $\sqrt{s}\!>\!\!>\! M_*$, but at the non-perturbative level the same admit restoration of unitarity via classicalization. For the theory in Eq.~(\ref{classex}), it is straightforward to show how classicalization takes place. As customary, we consider a source localized within a region of size $L$, with a strength of positive power in $1/L$. This is the case, for instance, of energy-momentum type sources, as well as the case of the cubic self-coupling in Eq.~(\ref{classex}), and is enough to reproduce classicalization from scattering of $\phi$ particles at high energies. We may focus on the scattering of wave packets of $\phi$ at a CM energy $\sqrt{s}\!>\!\!>\! M_*$, and let the particles scatter with transferred momentum $1/L$, at a minimum distance $L$. As far as $L>L_*=1/M_*$, perturbatively wave-packets are dealt with as quantum states. However, the main idea underlying the analysis in Eq.~(\ref{classex}) is that when wave-packets are localized within a distance $r_*=L_*^2\sqrt{s}$, the physical system enters a classical regime through the development of classical configurations, i.e. it classicalizes. In other words, self-sourcing implies that the localization of quanta of CM energy $\sqrt{s}\!>\!\!>\!M_*$ cannot happen at distances shorter than $r_*=L_*^2\sqrt{s}$. To prove classicalization one may consider a simple argument \cite{Dvali:2010jz}. Let us localize particles of CM energy $\sqrt{s}=1/L\!>\!\!>\!M_*$ within a sphere or radius $R\!<\!\!<\!r_*$. Cubic self-interactions trigger production of an effective localized source for $\phi$ that behaves like $J\sim M_*/L$. Consequently, linearizing the equation of motion for $\phi$ in the weak field regime entails the equation of motion $\Box \phi + \dots =\delta(r) L_*/L\,.$ The presence of an energy source for $\phi$ implies that a gaussian flux for $\nabla \phi$ is generated, and thus the radial dependence for $\phi$, i.e. $$\phi(r)\sim \frac {L_*}{L \,r}\,,$$ can be recovered. Consequently, approaching the localization region $\phi(r)$ increases, until the field becomes of order $M_*$ at a distance $r_*=L_*^2/L$. In other words, a source of energy $\sqrt{s}=1/L\!>\!\!>\!M_*$ extends over an effective distance $r_*\!>\!\!>\! L_*$, thus becoming a classical. This has profound consequences, which require to step out from the intuitions developed in the perturbative approach. In the latter framework, one might think that high-energy scattering happening at $\sqrt{s}\!>\!\!>\!M_*$ will be governed by hard-collisions, and that the momentum transfer will be proportional to $\sqrt{s}$. Instead, as agued above, the high-energy processes entail formation of classical systems of radius $r_*=L_*^2 \sqrt{s}$. These latter may then undergo a cascade of decays into many particles states. In other words, the $2\rightarrow 2$ particles scattering processes will be characterized by amplitudes that are very suppressed at very high transferred momenta, and dominated by soft transferred momenta interactions at $\sim 1/r_*$. Classicalization, which is triggered by sources $\sqrt{s}=1/L\!>\!\!>\!M_*$, then happens at very high energies, but is characterized by a long-distance dynamics that corresponds to momenta $1/r_*\!<\!\!<\!M_*$. This implies that higher-order corrections are under control, and non-quadratic terms like the ones appearing in Eq.~\eqref{classex} do not change the dynamics of classicalization. To better show this, we consider the generic Lagrangian terms \begin{equation} \label{ho} \frac{1}{M_*^{n+4k-4}} \phi^n (\partial_\mu \phi \partial^\mu \phi)^k\,, \end{equation} which generalize the ones appearing in Eq.~\eqref{classex}. Considering the asymptotic behavior at large $r$ to be $\phi(r)\sim1/(M_*L r)$, terms like in Eq.~\eqref{ho} contribute as \begin{equation} \label{hoe} \frac{1}{M_*^{n+4k-4}} \phi^n (\partial_\mu \phi \partial^\mu \phi)^k\,\sim\, \frac{1}{M_*^{2n+6k-4} L^{2k+n} r^{4k+n}} \,. \end{equation} This allows to define the radius $$r_{n,k}=L_*\left( \frac{L_*}{L}\right)^{\frac{2k+n-2}{4k+n-4}}\,,$$ at which non-linear terms become of the same order of the linear term --- characterized by $n=0$ and $k=1$. One may immediately observe that $r_*$ represent the largest of the $r_{n,k}$ scales. In particular, assuming $k=1$ --- i.e. no higher-order kinetic terms appear in the Lagrangian --- the scales $r_{n,1}$ are all equal to $r_*$. The addition of higher order derivatives for $k>1$ can only lower the value of $r_{n,k}$, which would eventually become smaller than $r_*$. Nonetheless, lower $k$ terms will have to be present anyway in the Lagrangian considered, setting up to $r_*$ the classicalization scale. In other words, the scale $r_*$ is determined by the leading non-linear terms, the higher non-linear ones only affecting the dynamics of $\phi$ at distances $r\!<\!\!<\!r_*$. This argument is enough to ensure that the size of the $r_{n,k}$ radii cannot change the size of the classical configuration, and consequently cannot play an important role in scattering processes at large $s$. \section{The Model} \label{mod} \noindent In this section we show how the classicalization phenomenon can work for superfluid dark matter, using the same analysis' techniques introduced in Refs.~\cite{Dvali:2010jz,Dvali:2012mx}, and then deployed in Ref.~\cite{Bajc:2011ey}. We start from the relativistic Lagrangian proposed in Refs. \cite{Berezhiani:2015bqa,Berezhiani:2015pia}, namely \begin{eqnarray} \label{L} \mathcal{L}=&&-\frac{1}{2}\left(|\partial_{\mu}\Phi|^{2}+m^{2}|\Phi|^{2}\right) \nonumber\\ &&-\frac{\Lambda^{4}}{6(\Lambda_{c}^{2}+|\Phi|^{2})^{6}}\left(|\partial_{\mu}\Phi|^{2}+m^{2}|\Phi|^{2} \right)^{3} \,. \end{eqnarray} The equation of motion in presence of a constant localized source term $Q\,\delta^{4}(x-y) \,\Phi$ entering the Lagrangian is \begin{eqnarray} \label{L} Q\delta^{4}(x-y)=&&\left(\Box-m^{2}\right)\Phi \\ &&\!\!\!\!\!\!\!+12\partial^{\mu} \{U(\Phi)\left(|\partial \Phi|^{2}+m^{2}|\Phi|^{2} \right)^{2}|\partial \Phi|\} \nonumber\\ &&\!\!\!\!\!\!\!-2U'(\Phi)\left(|\partial\Phi|^{2}+m^{2}|\Phi|^{2}\right)^{3} \nonumber\\ &&\!\!\!\!\!\!\!-12m^{2}U(\Phi)\left( |\partial \Phi|^{2}+m^{2}|\Phi|^{2}\right)^{2}\Phi \nonumber\,, \end{eqnarray} where \begin{eqnarray} U(\Phi)\equiv \frac{\Lambda^{4}}{6(\Lambda^{2}+|\Phi|^{2})^{6}} \end{eqnarray} and $J$ is the source's current. The last term in equation (\ref{L}) has a perturbative expansion \begin{eqnarray} \frac{\Lambda^{4}}{\Lambda_{c}^{12}}\sum_{k=0}^{6}\frac{(-1)^{k}(k+5)!}{k! 5!}\left(\frac{|\Phi|}{\Lambda_{c}}\right)^{2k} \left(|\partial \Phi|^{2}+m^{2}|\Phi|^{2} \right)^{3}\,. \nonumber \end{eqnarray} These are operators of the form \begin{eqnarray} \label{ope} \frac{1}{M_{*}^{n+4k-4}}|\Phi|^{n}|\partial_{\mu}\Phi|^{2k} \,, \end{eqnarray} in which $\Lambda_{c}\simeq \Lambda$ and $M_{*}\simeq \Lambda \simeq 1\, \rm meV$ is assumed. In what follows we describe the scattering of quanta of the effective dark matter field, in first approximation, by the contact-interaction terms associated to the operators in \eqref{ope}. We then describe the asymptotic limit of the operators in terms of the energy of the quanta in the center of mass (CM) of the colliding system. The asymptotic behavior of $\Phi$ at large $r$ is $(M_{*}L)^{-1}r^{-1}$, where $L\simeq E_{CM}^{-1}$ and $E_{CM}$ is the CM energy. Operators then contribute asymptotically to scattering amplitudes as \begin{eqnarray} (M_{*}^{2n+6k-4}L^{2k+n}r^{4k+n})^{-1}\,, \end{eqnarray} in which $L=E_{CM}^{-1}<\!\!<L_{*}$ and we have defined $L_{*}=M_{*}^{-1}$. Notice that non-linear terms diverge at short-distances, in the limit $r\rightarrow 0$, and that in this limit derivative terms contribute as $L_{*}/r$. In the limit $r>\!\!>L_{*}$, these terms remain subdominant. When $M_{*}\simeq \Lambda$, derivative terms remain subdominant for distances of the order of the Hubble radius $(\Lambda \sim 1 \, \rm meV)$. We can now recast the Lagrangian \eqref{L} in terms of the fluctuations around the classical solution, namely \begin{eqnarray} \Phi=\Phi_{cl}+\delta \Phi\,, \end{eqnarray} and then find the perturbed action \begin{eqnarray} \label{Act} \!\!\!\!\!\int \!\! d^{4}x[\mathcal{L}_{cl}-\delta \Phi Q \delta^{4}(x-y)\!+\!\frac{1}{2}\delta \Phi O \delta \Phi+\mathcal{L}_{int}(\delta \Phi)]\,, \end{eqnarray} where $O$ is the quadratic operator associated to the Lagrangian (\ref{L}), and $Q$ has been rewritten as a constant source $J$ localized in $y$. The operator $O$ has a complicated expression, but fortunately for our purposes, we may only consider the asymptotic forms of these operators in the large distance limit and in the short distance one. In the large distance limit, it is easy to show that the operator $O$ converges to \begin{eqnarray} \label{O1} O(r\rightarrow \infty)\rightarrow -\left(\frac{\partial^{2}}{\partial r^{2}}+\frac{2}{r}\frac{\partial}{\partial r}+\frac{L^{2}}{r^{2}}\right)\,, \end{eqnarray} which corresponds to free-propagating scalars. In \eqref{O1} $L$ stands for the differential representation of the angular momentum operator. In the opposite regime, one obtains a series of polynomially divergent terms \begin{eqnarray} \label{O2} O(r\rightarrow 0)\rightarrow \frac{1}{r^{4k+n}} \left(c_{1}\frac{\partial^{2}}{\partial r^{2}}+c_{2}\frac{2}{r}\frac{\partial}{\partial r}+c_{3}\frac{L^{2}}{r^{2}}\right)\,, \end{eqnarray} $c_{1,2,3}$ being numerical prefactors that are irrelevant for the following arguments, which are based on asymptotic limits. This suggests that the two asymptotic limits are interpolated by a classical solitonic solution, dubbed classicalon. In our case, to find an analytic solution is very challenging. Solutions can indeed be founded only numerically. However, in the case of a similar but simpler higher-derivative theory, with similar asymptotic behaviors, as a $\frac{1}{4}M_{*}^{-2}(\partial \Phi)^{4}$ theory, a classical solution can be found by imposing the following ansatz inside the equation of motion: \begin{equation} \label{soll} \partial_{\mu}\Phi_{cl}=\frac{(x-y)_{\mu}}{|x-y|}M_{*}^{2}\mathcal{F}\Big(\frac{|x-y|}{r_{0}(Q)} \Big)\,, \end{equation} with \begin{equation} \label{radius} r_{0}(Q)=\sqrt{\frac{Q}{M_{*}^{2}\Omega_{2}}}\, , \end{equation} with $\mathcal{F}$ still generic. Plugging Eq.(\ref{soll}) into the EoM, one obtains for $\mathcal{F}$ the form \begin{equation} \label{plugging} \mathcal{F}(\rho)=\Big(\sqrt{\frac{1}{27} + \frac{1}{2\rho^{6}}} +\frac{1}{2\rho^{3}} \Big)^{1/3}-\Big(\sqrt{\frac{1}{27} + \frac{1}{2\rho^{6}}} -\frac{1}{2\rho^{3}} \Big)^{1/3}\,, \end{equation} where $\rho=\frac{|x-y|}{r_{0}(Q)}$. The classical solitonic field associated to the classicalon can be expanded in plane waves as follows: \begin{equation} \label{plan} \Phi_{cl}= \int \frac{d^{3}k}{\sqrt{(2\pi)^{3}2\omega_{k}}}\Big(e^{ikx}\alpha_{k}+e^{-ikx}\alpha_{k}^{*}\Big)\,. \end{equation} In the framework of such an expansion, the classicalon can be represented by a coherent state $|class\rangle$. The Fourier expansion coefficients of $\phi_{cl}$ are defined as the classicalon expectation values of the Fock space annihilation/creation operators $\hat{C}_{k},\hat{C}_{k}^{\dagger}$, which read \begin{equation} \label{asolosol} \langle class | \hat{C}_{k}|class\rangle =\alpha_{k},\quad {\rm for} \quad [\hat{C}_{k},\hat{C}^{\dagger}_{k'}]=\delta_{k,k'}\, . \end{equation} Let us note that $\hat{C}$ and $\hat{C}^{\dagger}$ are not the annihilation/creation operators of the asymptotic propagating fields in the initial Lagrangian. In stead, they create and destroy classicalon quanta, which evidently have different dispersion relations then free fields. In general, a state $|class\rangle$ is composed of a tensor product of coherent states with different four-momenta $k$, namely \begin{equation} \label{jakal} |\alpha_{k}\rangle=e^{-\frac{1}{2}|\alpha_{k}|^{2}}e^{\alpha_{k}\hat{C}^{\dagger}}|0\rangle=e^{-\frac{1}{2}|\alpha_{k}|^{2}}\sum_{n_{k}=0}\frac{\alpha_{k}^{n_{k}}}{\sqrt{n_{k}!}}|n_{k}\rangle\, , \end{equation} where $|n_{k}\rangle$ is the Fock state with $n$-field of $k$-momenta. In this framework, the number operators is defined as $N=\int_{k}\alpha_{k}^{*}\alpha_{k}$. The production of a classicalon configuration cannot be simply calculated from a $in\rightarrow out$ tree level S-matrix, where the $|in\rangle$ and $|out\rangle$ states are just asymptotic free field states. In fact, the production and evaporation of a classicalon configuration will generate a large number of entangled quanta, which must be in the same coherent state. In other words, the transition that must be evaluated for our purposes --- showing the unitarity of scatterings from classicalon production --- is the $in\rightarrow classical$ transition. Fortunately, such a transition can be easily related to an $in\rightarrow out$ S-matrix, calculable within the standard quantum field theories techniques, by the relation \begin{equation} \label{jaaj} \langle in|S|class\rangle = \langle in|S|out\rangle \langle out|class\rangle\, . \end{equation} In other words, we must just evaluate the transition element $\langle out|class\rangle$. Replacing $|out\rangle$ with any arbitrary number of particles with the same momenta, this transition element can be written as $|n(k)\rangle=(a^{\dagger}(k))^{n(k)}/(\sqrt{n(k)!}|0\rangle$ (where $a^{\dagger}$ is the free quanta creation operator). This implies that, for a generic $n(k)$, one obtains \begin{equation} \label{jaa} \langle n(k)| coherent\rangle=e^{-\frac{N}{2}}+{\rm subleading\,\,\, terms}\, . \end{equation} We emphasize that from the perspective of the classicalon quanta, any $|out \rangle$ state is empty of classicalon quanta (created by $C^{\dagger}$). In the next subsection, we will show that the classicalon production lead to the unitarization of a sub-set of operators in the initial Lagrangian. Similar considerations can be extended to other operators with more technical difficulty issues. \subsection{Scattering amplitude analysis} \noindent To derive amplitudes in a more controllable way, we consider a $U(N_{f})$ global flavor symmetry. We introduce a multiplet of scalar real fields transforming in the adjoint representation $U(N_{f})$, namely $\Phi \equiv \Phi^{a}t_{a}$, and label with $t_{a}$ the symmetry generators of $U(N_{f})$, fulfilling $[t^{a},t^{b}]=i\sqrt{2}f^{abc}t^{c}$, with $f^{abc}$ the totally antisymmetric structure constants of $U(N_{f})$. We then consider the subset of operators, with flavor symmetry, \begin{equation} \label{phin} c_{n}(\partial \Phi)^{T}\cdot \frac{1}{M_{*}^{2n}}(s\{\Phi\})^{2n}\cdot (\partial \Phi)\,, \end{equation} where $c_{n}=(-1)^{n}(n+5)!/(n! 5!)$, corresponding to fixing $k=1$ in Eq.(\ref{ope}). The $s\{\Phi\}$ has an group-indices structure of the form \begin{equation} s\{\Phi\}^{ab}=-if^{cab}\Phi^{c}\,, \end{equation} while ``dot" in Eq.\ref{phin} denotes the contraction of indices in the adjoint representation. It is worth emphasizing that this assumption does not change the low-energy analysis carried out by Berezhiani \& Khoury. In this flavored version of the model, every possible Feynman diagram can be automatically included through the powerful spinor helicity formalism. All the interaction vertices are controlled by the structure constants $f^{abc}$. Very much in the same way of Yang-Mills theories or pion amplitude models, it is then straightforward to demonstrate that any tree level on-shell amplitude has the simple group structure $$\mathcal{M}^{a_{1}a_{2},..a_{n}}(p_{1},p_{2},...,p_{n})=$$ \begin{equation} \label{MauMd} \sum_{\sigma \in S_{n}/Z_{n}}\langle t^{a_{\sigma(1)}} t^{a_{\sigma(2)}} ...t^{a_{\sigma(n)}} \rangle \mathcal{M}_{\sigma}(p_{1},p_{2},...,p_{n})\, , \end{equation} where brackets $\langle \ \dots \ \rangle$ denote the Killing form on the group, i.e. the trace on the algebra elements. All the momenta are conventionally introduced with the incoming signature, and the sum is taken over $1,2,...,n$ permutations, modulo $Z_{n}$-cyclic permutations. The same structure of Eq.(\ref{MauMd}) can be obtained for generic interactions vertices $V^{a_{1},...a_{n}}_{n}(p_{1},...,p_{n})$. After some tedious but straightforward algebra, flavor ordered interaction vertices are found to have the form: $$V_{2n+1}(p_{1},....,p_{n+1})=0\, , $$ $$V_{2n}(p_{1},...,p_{n})=$$ \begin{equation} \label{Generic} \frac{c_{n}}{M_{*}^{2n-1}}\sum_{k=1}(-1)^{k-1}\frac{(2n-2)!}{(k-1)!(2n+k-1)!}\sum_{i=1}^{2n}(p_{i}\cdot p_{i+k})\, . \end{equation} Moving from the vertex structures, we can now calculate the flavor ordered amplitudes. The kinematic structure of the eight-point amplitudes, written in terms of the Mandelstam variables $s_{ij}=(p_i+p_j)^2$, then reads $$M_{*}^{6}\mathcal{M}(1,....,8)= a_{1}\frac{(s_{12}+s_{23})(s_{14}+s_{47})(s_{56}+s_{67})}{s_{13}s_{57}}+$$ \begin{equation} +a_{2}\frac{(s_{12}+s_{23})(s_{14}+s_{45})(s_{67}+s_{78})}{s_{13}s_{68}} \end{equation} $$+a_{3}\frac{(s_{12}+s_{23})(s_{45}+s_{47}+s_{56}+s_{58}+s_{67}+s_{78})}{s_{13}}$$ $$+a_{4}s_{12}+a_{5}s_{14}+{\rm cycl}\, ,$$ where $a_{i}$ are numerical prefactors that are not relevant for our purposes. Similarly, the ten-point amplitude casts $$M_{*}^{8}\mathcal{M}(1,..,10)=-\frac{s_{12}+s_{23}}{s_{12}}\Big\{$$ $$+b_{1}\frac{(s_{14}+s_{49})(s_{58}+s_{69})(s_{67}+s_{78})}{s_{59}s_{68}}$$ $$+b_{2}\frac{(s_{14}+s_{45})(s_{18}+s_{69})(s_{67}+s_{78})}{s_{15}s_{68}}$$ $$+b_{3}\frac{(s_{18}+s_{49})(s_{45}+s_{58})(s_{67}+s_{78})}{s_{48}s_{68}}$$ $$+b_{4}\frac{(s_{14}+s_{45})(s_{16}+s_{67})(s_{18}+s_{89})}{s_{15}s_{17}}$$ $$+b_{5}\frac{(s_{14}+s_{45})(s_{16}+s_{69})(s_{78}+s_{89})}{s_{15}s_{79}} $$ $$+b_{6}\frac{(s_{18}+s_{49})(s_{47}+s_{58})(s_{56}+s_{67})}{s_{48}s_{57}}$$ $$+b_{8}\frac{(s_{16}+s_{49})(s_{45}+s_{56})(s_{78}+s_{89})}{s_{46}s_{79}} $$ $$+ b_{9}\frac{(s_{14}+s_{18}+s_{45}+s_{49}+s_{58}+s_{69})(s_{67}+s_{78})}{s_{68}}$$ $$-b_{10}\Big(\frac{(s_{18}+s_{49})(s_{45}+s_{47}+s_{56}+s_{58}+s_{67}+s_{78})}{s_{48}}$$ $$+\frac{(s_{14}+s_{16}+s_{45}+s_{47}+s_{56}+s_{67})(s_{18}+s_{89})}{s_{17}}$$ $$+\frac{(s_{14}+s_{16}+s_{45}+s_{49}+s_{56}+s_{69})(s_{78}+s_{89})}{s_{79}}$$ $$+\frac{(s_{14}+s_{45})(s_{16}+s_{18}+s_{67}+s_{69}+s_{78}+s_{89})}{s_{15}}$$ $$+\frac{(s_{14}+s_{49})(s_{56}+s_{58}+s_{67}+s_{69}+s_{78}+s_{89})}{s_{59}}\Big)$$ $$+b_{11}s_{14}+k_{12}s_{16}+k_{13}s_{18}+k_{14}s_{45}$$ $$+b_{15}s_{47}+k_{16}s_{49}+k_{17}s_{56}+k_{18}s_{58}$$ \begin{equation} \label{jaja} b_{19}s_{67}+b_{20}s_{69}+b_{21}s_{78}+b_{22}s_{89}\Big\}\,, \end{equation} where $b_{i}$ are numerical prefactors again not relevant for our purposes. It is worth to note that both 8 and 10 point amplitudes are maximized if all final states have the same final energy, as a democratic redistribution of the CM energy on all of them. Following the kinematical structure of these amplitudes, up to a generic $N+2$ large number of insertions, one can easily obtain the leading order amplitude \begin{equation} \label{amplitude} M_{*}^{N}\mathcal{M}(1,2,...N+2)=K_{N+2}\, s+O(1/N)\,, \end{equation} where $K_{N+2}\sim O(1)$ is a constant not relevant for our purposes, and the CM energy $\sqrt{s}$ is democratically distributed into final state momenta. This implies that, after integrating on the phase-space, the corresponding cross section $2\rightarrow N$ will behave as follows \begin{equation} \label{MNNd} \sigma=\sigma_{0} N!\Big(e^{2}\frac{s}{N^{2}M_{*}^{2}}\Big)^{N}\sim \sigma_{0}\frac{1}{(N-1)!}\Big(c \frac{s}{M_{*}^{2}} \Big)^{N}\, , \end{equation} where $\sigma_{0}$ is a $O(1)\, M_{*}^{-2}$ quantity. \\ To account for a final coherent state describing classicalons, we shall evaluate the CM energy $\sqrt{s}$ on the latter state, and then insert into Eq.~(\ref{MNNd}) the scaling factor determined in Eq.~\eqref{jaaj}. For relativistic particles, the energy scales as the momentum, and the expectation value on a coherent state of the momentum scales as $\sqrt{N}$. Consequently, $s$ will scale with $N$ --- this property of classicalons was also discussed in details in Ref.~\cite{Dvali:2012en} --- and the cross section will grow as \begin{equation} \label{sigma} \sigma \sim \sigma_{0} \, \frac{N^{N}}{N!}\,, \end{equation} namely is exponential increasing with the particles' multiplicity of the classicalon. Including now the factor determined in Eq.~\eqref{jaaj}, we obtain an extra exponential suppression in the cross-section, which matches the exponential factor at numerator, i.e. \begin{equation} \label{jajaj} \sigma(2\rightarrow N_{Class})\sim M_{*}^{-2}e^{-N}\frac{N^{N}}{N!}\rightarrow M_{*}^{-2}\,. \end{equation} The latter expression hence saturates the unitarity bound\footnote{A similar cross section behaviour was already observed in the case of pions, described by a similar non-linear sigma model \cite{pion1,pion2}} for $N\!>\!\!>\!1$ (in the well known Stirling approximation). These considerations can be easily extended to other higher-order operators in our Lagrangian, as well as for the aforementioned $(\partial \phi)^{4}$ theory. Another interesting process is the production of a classicalon through decays of massive particles. As well known, in standard quantum field theory a $1\rightarrow N$ decay process entails the amplitude \begin{eqnarray} \label{Gamma} &&d\Gamma= \\ &&\frac{1}{M_{1}} \! \Big(\prod_{f}\frac{d^{3}p_{f}}{(2\pi)^{3}2E_{f}}\Big) \! |\mathcal{M}(m_{A}\rightarrow \{p_{f}\}|^{2}(2\pi)^{4}\delta^{4}\! (p_{A} \!-\! \sum p_{f} \! )\, , \nonumber \end{eqnarray} where $f$ denotes all N final states and $M_{1}$ the decaying particle mass. As explained above, the standard perturbative quantum field theory process is related to the $1\rightarrow classicalon$ transition, through an exponential phase --- see Eq.~\eqref{jaaj}. As noticed previously, the integration of the phase space scales as $E^{2N}/M_{*}^{2N}$, with the total energy equal to the decaying particle mass, i.e. $M_{1}^{2N}/M_{*}^{2N}$. Then, considering bosonic indinstinguibility, we must include a $N!$ factor on the denominator. Finally, the coherent state phase enters as $e^{-N}$, so that we infer the following decay rate: \begin{equation} \label{Gamma} \Gamma(1\rightarrow N_{Class})\sim \frac{M_{1}}{N!}e^{-N}\Big(c_{1}\frac{M_{1}}{M_{*}}\Big)^{2N}\sim \Gamma_{0}e^{-N+c_{1}\frac{M_{1}^{2}}{M_{*}^{2}}}\,. \end{equation} The decay rate then starts to be exponentially suppressed, with $N$ higher than a critical number value $\bar{N}\sim (M_{1}/M_{*})^{2}$, as naively expected. \section{Production of the superfluid state from a cooling cascade} \label{cas} Let us consider a process involving $N'+2$ scalar particles $\Phi$ of the type \begin{equation} p_{1},p_{2}\ \ \longrightarrow \ \ p_{1'},p_{2'},...,p_{N'-1},p_{N'}\,. \label{ndecay} \end{equation} For $E_{CM}>\!\!>\Lambda'$, this process is catalyzed by the formation of the classicalon. In the early Universe, the center of mass energy $E_{CM}\simeq T$, where $T$ is the thermal bath temperature. The final states are injected in the early Universe with an average kinetic energy lower than the initial CM energy/temperature. This amounts to a cool down of the temperature of the early Universe by scattering processes. In particular, any two initial particles with energy $T$ that undergo a process like in \eqref{ndecay}, induce a decay in $N'$ new particles of lower energies, which then re-scatter in cascade's processes that cool down the temperature of the dark sector. The entire transition is described by the thermal/quantum superposition of all possible cascade's processes \begin{eqnarray} &p_{1'},p_{2'}\rightarrow p_{1''},p_{2''},...,p_{N''-1},p_{N''} \nonumber \\ & \dots \nonumber \\ &p_{N'-1},p_{N'}\rightarrow p_{1^{N'}},p_{2^{N'}},...,p_{N^{N'}},p_{N^{N'}} \nonumber \\ & \dots \nonumber \\ &+{\rm permutations}\,, \nonumber \\ \end{eqnarray} where for permutations we consider all the possible $1', i'$ scatterings with $i'=1',...,N'$, and so forth in the cascade's process. The total transition rate is given by \begin{eqnarray} \langle\{p_{1},...,p_{M}\}\rangle\rightarrow \langle \{p_{1},...,p_{N}\} \rangle\,, \end{eqnarray} describing the entire cascade of the initial thermal bath into soft quanta. The thermal/quantum average over all the possible channels is expected to be the $2\rightarrow N$ scattering $$1,2\rightarrow 1', 2',...,N'\,,$$ where $$s_{12}=T^{2}, \qquad s_{ij}=\frac{T^{2}}{N^{'2}},\qquad i,j\neq 1,2\,.$$ This means that the temperature of the dark sector rapidly cools down to $T'\sim T/\sqrt{N}$. Now, the number of emitted particles with the same final energy cannot be infinite because a process producing only IR soft particles cannot be possible. Indeed, the total number of emitted particles is bounded by their own mass scale $m_{\Phi}$, namely $$\sqrt{N}\sim \frac{T}{m_{\Phi}}.$$ Because of the non-linearity of the Lagrangian in Eq.(\ref{L}), one must consider an infinite set of non-perturbative vertices in the cascade, turning the complete calculation into an impossible task. The direct proportionality of $N$ with the temperature implies that the thermally averaged cross section $2\rightarrow N_{Class}$ recasts as \begin{equation} \label{crros} \langle\sigma\rangle_{T}\sim M_{*}^{-2}\frac{1}{\Gamma(1+c_{3}\frac{T^{2}}{m_{\phi}^{2}})}e^{-c_{1}\frac{T^{2}}{m_{\phi}^{2}}}\Big(c_{2}\frac{T^{2}}{m_{\phi}^{2}}\Big)^{\Big(c_{2}\frac{T^{2}}{m_{\phi}^{2}}\Big)}\,, \end{equation} where the Euler gamma-function is introduced replacing the factorial, and $c_{1,2,3}$ are $O(1)$ constants. As clarified in the Sec.~\ref{classic}, the system classicalizes through scattering processes in which the transferred momenta are greater than the cut-off scale $M_*$. In the case under scrutiny here, specified in Sec.~\ref{mod}, $M_*=\Lambda\simeq 1 {\rm meV}$ corresponds to the cut-off scale of the effective theory introduced by Berezhiani and Khoury in Ref.~\cite{Berezhiani:2015bqa}. Formation of classicalons is then triggered at distances well larger than the scale individuated by $L_*=1/M_*=1/\Lambda$. Following this line of thought, we may envisage that the production of a state of classicalons can be directly attained also in other stages of the Universe's expansion, when different energy scales are taken into account. For instance, considering the inflationary scenario, reheating can trigger formation of classicalons at an energy scale proportional to the reheating temperature dictated by the specific model taken into account. Classicalons that are formed will then evaporate at the end of reheating, through the very same classicalization processes we described, restoring the standard picture at later cosmic times. \section{Boltzmann equations} \label{bo} \noindent In this section we take into account the cosmological evolution of the $\Phi$ number density and the formation at late times of the condensate state of non-relativistic $\Phi$-particles. The evolution of the number density is described by the Boltzmann's equation, \begin{equation} \label{Booo} \frac{dn_{\Phi}}{dt}+3Hn_{\Phi}=\sum_{i}\Gamma_{i}\,, \end{equation} with $$\Gamma_{i}=\int f_{\Phi}(p_{1})f_{\Phi}(p_{2})d\sigma_{i}\,,$$ in which we focus on $i=1,2\rightarrow N$ processes, and we take $f_{\Phi}$ to be Bose-Einstein functions with a negligible chemical potential $$f_{\Phi,i}(p)=(e^{\beta E_{\Phi,i}(p)}-1)^{-1}.$$ Inside the $\Gamma_{i}$, for $E>m_{\Phi}$, the cross section ``classicalize" to a constant, as in Eq.~(\ref{crros}). Consequently, the integration over $1,2$ momenta with the Bose-Einstein distributions just trivializes to a $O(1)$ constant multiplying Eq.~(\ref{crros}). The cascade cooling process depends on the initial $T$ parameter. Essentially, this process starts with the first production of $\Phi$-fields in the early Universe. For example, if the $\Phi$ particles were produced after the inflaton reheating, a natural temperature scale would turn out to be of the order of $T_{1}\simeq T_{re}\simeq 10^{9}\, {\rm GeV}\,.$ However, an overproduction problem could be encountered here. The energy density of the $\Phi$-particles cannot exceed the cosmological critical density bound. Therefore, it must hold that \begin{equation} \label{mphi} m_{\Phi}n_{\Phi}^{0}<\rho_{c}\,, \end{equation} in which $n_{\Phi}^{0}$ stands for the number density during recombination, and $\rho_{c}=1.053 75(13)\times 10^{-5}\,h^{2}\, {\rm GeV/cm}^{3}$ (according to last Planck data \cite{PDG}) denotes the cosmological critical density. \\ We notice that during the reheating, the decay time of the inflaton into classicalons scales as \begin{equation} \label{scale} \tau=kM_{1}^{-1}e^{+\Big(c_{2}\frac{T}{M_1}\Big)-c_{1}\frac{M_{1}^{2}}{M_{*}^{2}}}\, , \end{equation} where $k$ depends on the specific couplings of the inflaton with $\Phi$, i.e. it is model dependent. For $\bar{N}\simeq c_{1}\frac{M_{1}^{2}}{M_{*}^{2}}+\log k$, the characteristic time of decay is very short, and the reheating of the inflaton into classicalons becomes very efficient. \begin{figure}[t] \centerline{ \includegraphics [height=5.1cm,width=0.9\columnwidth]{AAAMDENSITY.pdf}} \vspace*{-1ex} \caption{The evolution of the number density of $\Phi$ particles is displayed. From $T_{1}$ to $T_{c}$ the relativistic dilution factor is compensated by the cascade processes. On the other hand, after the phase transition at $T_{c}\simeq {1\div 10\,\rm eV}$ and the formation of the superfluid state, $\Phi$-particles are regarded as non-relativistic quanta of a classical state that is scaling as $T^{-3}$ along the Universe expansion. This means that after the critical temperature, the $\Phi$ field starts to behave as a cold dark superfluid.} \label{plot} \end{figure} The results of the $n$(T) evolution from the Boltzmann's equations are displayed in Fig.~3, having used the {\it ansatz} $\sigma=\langle \sigma(2\rightarrow N)\rangle_{\Phi_{\rm cl},T}$. We may give the following interpretation to the behavior that is shown. Le us consider two thermal epochs, namely $T_{1}>\!\!>m_{\Phi}$ and $T_{0}>\!\!>m_{\Phi}$, with $T_{0}<T_{1}$. During this thermal window, the $\Phi$ modes are strongly coupled each other and cannot freely propagate. Indeed, they are organized in classicalon states. This means that every $N\rightarrow N'$ process should be viewed as a thermally averaged classicalon-classicalon transition. Since the number of the $\Phi$ modes produced in each classicalon transition, namely $\langle N\rangle$, is proportional to the square of the average CM energy, in turn proportional to the square of the temperature, their number density scales with the Universe expansion as $n_{\Phi}\!\sim\! T^{5}$ in temperature. During this stage, particle are relativistic. We emphasize that this scaling is different from the one of free relativistic particles, $n_{\Phi}\!\sim\! T^{3}$. Therefore, the energy density of dark matter scales as $\rho=\rho_{0}\,T^{6}$. \\ The right dark matter abundance can be obtained tuning the $k$-coupling of the inflaton to the classicalon. From the inflation energy scale, down to an energy scale few orders of magnitude above the particle mass, the dilution of the energy density scales as $\rho_{\Phi}/\rho_{I}\propto (T_{\Phi}/T_{I})^{6}$. Conservatively, we can estimate $T_{\Phi}$ as the temperature at which the inflaton decays in a coherent state that encodes a critical $N$ number of $\Phi$ particles, i.e. $T_{\Phi}=N\,m_{\Phi}$, still with $N\!>\!\!>\!1$. This means that at the reheating, where $\rho_{re}=k\rho_0$, the scaling can be found $\rho_{\Phi}/\rho_{I}=1/k \, [(N m_{\Phi})/T_{re}]^{6}$, where $T_{re}$ stands for the reheating temperature after inflation and $k$ is the inflaton coupling to the classicalon. If the number $N\!>\!\!>\!T_{re}/m_{\Phi}$, then the classicalon will be completely diluted and washed out, i.e. it cannot provide a good candidate of dark matter. There exists a critical number $N_{c}=T_{re}/m_{\Phi}\simeq 10^{18}$ at which the classicalon is no more diluted. This means that in the self-criticality phase, the production of quanta is compensated by the expansion of the Universe. Nonetheless, when the temperature cools down, new species of particles that compose the classicalon cannot be produced anymore. The classicalon will then cool down as cold superfluid dark matter, at smaller energy scales than the critical one at which $\Phi$ modes can be still be produced. In other words, the energy density will start scaling as $T^{3}$. \\ After this critical phase is reached, the DM energy-density can be estimated to be $\rho_{DM}\!\simeq\! k\rho_{\varphi}(T_{0}/T_{c})^{3}$, where $\rho_{\varphi}$ is the inflaton energy density, which we denote with $\rho_{\varphi}\simeq 3\,H_{I}^{2}/(8 \pi G)$, the temperature at the recombination epoch is $T_{0}$, and $T_{c}$ is the classicalon phase transition temperature. The energy-density of the inflaton field is enormous compared to other energy densities. Consequently, the dilution factor is very small, since the mass of $\Phi$ can be at least one order of magnitude larger the $T_{0}$. Roughly, the energy density of the inflaton can be estimated to be $\rho_{\phi}\simeq 10^{-1}M_{Pl}^{2}H_{I}\simeq 10^{36}\times 10^{20}\, {\rm GeV}^{4}$. On the other hand, the DM energy density is only $\rho_{\rm DM} \sim 0.1\rho_{c}\sim 10^{-6}{\rm GeV/cm}^{3}\sim 10^{-49}{\rm GeV}^{4}$, with $\rho_{c}$ critical energy density. This entails a large fine tuning of the coupling constant $k$, which is constrained to assume a value of about $10^{-105}$. A coupling so small can be understood in terms of effective operators of large dimension, such as $(1/\Lambda)^{N-3}\varphi\, \Phi^{N}$. Nonetheless, for $T_{c}\simeq 2m_{\Phi}\simeq 1\div 10\, {\rm eV}$, the $\Phi$ particles become non-relativistic, and the phase transition takes place. In other words, the $\Phi$ particles can softly form a superfluid state. \section{Conclusions} \label{co} \noindent Superfluid dark matter was proposed in order to reconcile the intriguing success of MOND on galactic scales with the ${\rm \Lambda CDM}$ model, which is instead successful on cosmological scales. Within this scenario, dark matter consists of self-interacting axion-like condensates localized inside the galaxies. The superfluid phonons, weakly coupled to ordinary baryons, mediate an effective MOND acceleration. In superfluid dark matter, the effective MOND gravitational potential of a galaxy is different from the one of a galaxy cluster. Indeed, dark matter has a higher temperature in clusters, and a sizable part of axion-like particles are de-confined from the condensate state. Such a model was engineered in a phenomenologically healthy, non-relativistic effective, formulation. The problem of the UV completion of this model was not solved yet. In this paper, we have shown that a Wilsonian UV completion is not necessary for this model, and that superfluid dark matter ``self-unitarizes'' itself, undergoing ``classicalization" phenomena. Classicalization is an alternative to the Wilsonian UV completion, in which the formation of classical non-perturbative configuration, at a certain critical energy scale, unitarizes the scattering amplitudes of the classicalizing theory. In the case of superfluid dark matter, the classicalization mechanism can be directly related to the production of the superfluid condensate. In other words, the UV self-completion of the model is also related to another unsolved issue, namely how superfluid dark matter was generated in our Universe. In the model under scrutiny, the critical scale for the formation of the classical state is of about the {\rm meV}-scale, related to the cosmological constant scale. This means that every axion-like particle, which undergoes scatterings until the very late Universe, will form a classical state. The classical state will evaporate in a large number of soft axion-like particles. Nonetheless, this unitary process can efficiently happen at energies that are very far from the mass scale of the axion-like particle. In other words, this can happen if the average center of mass energy (the temperature of the Universe) is much larger than the axion-like mass. In order to fit correctly the galactic rotational curves, an axion-like mass of about $1-10\,{\rm eV}$ is necessary. This basically means that at energies larger than $1-10\,{\rm eV}$, but close to the recombination epoch, the classical state cannot evaporate into soft axion-like particles. Such a process exactly corresponds the formation of a superfluid dark matter condensate. This provides a new dark matter formation mechanism, related to classicalization, that is alternative to standard ones, as for instance WIMP thermal productions. \\ \acknowledgements \noindent We acknowledge the anonymous Referee for useful comments that helped to clarify the content of this paper. We also would like to thank Alexander Vikman for interesting discussions on classicalization and superfluid dark matter.
\section{{Introduction}\label{sec:Intro}} In the course of evolution, proteins may substitute the vast majority of their amino acids without losing their three-dimensional structure and their biological functionality. Rapidly growing sequence databases provide us with ample examples of such evolutionary related, i.e.~homologous proteins, frequently already classified into protein families and aligned into large multiple-sequence alignments (MSA). Typical pairwise sequence identities between homologous proteins go down to 20-30\%, or even below \cite{finn2013pfam}. Such low sequence identities are astonishing since even very few random mutations may destabilize a protein or disrupt its functionality. Assigning a newly sequenced gene or protein to one of these families helps us to infer functional annotations. Structural homology modeling, e.g., belongs to the most powerful tools for protein-structure prediction \cite{webb2014protein,arnold2006swiss}. However, beyond the transfer of information, the variability of sequences across homologs itself contains information about evolutionary pressures acting in them, and statistical sequence models may unveil that information \cite{durbin1998biological,de2013emerging}. A first level of information is contained in the variability of individual residues: low variability, i.e. conservation, frequently identifies functionally or structurally important sites in a protein. This information is used by so-called profile models \cite{durbin1998biological}, which reproduce independently the amino-acid statistics in individual MSA columns. They belong to the most successful tools in bioinformatics; they are at the basis of most techniques for multiple-sequence alignment and homology detection, partially as profile Hidden Markov models accounting also for amino-acid insertions and deletions \cite{eddy1998profile}. A second level of information is contained in the co-variation between pairs of residues, measurable via the correlated amino-acid usage in pairs of MSA columns \cite{de2013emerging,cocco2017inverse}. Co-variation cannot be captured by profile models, as they treat residues independently. To overcome this limitation, global statistical models with pairwise couplings -- exploiting residue conservation and covariation -- have recently become popular. Methods like the direct coupling analysis (DCA) \cite{weigt2009identification,morcos2011direct}, PsiCov \cite{jones2012psicov} or Gremlin \cite{balakrishnan2011learning} allow for the prediction of residue-residue contacts using sequence information alone, and can be used to predict three-dimensional protein structures \cite{marks2012NATBIOTECH,ovchinnikov2017protein} and to assemble protein complexes \cite{schug2009high,ovchinnikov2014robust,hopf2014elife}. Currently, these methods are the central element of various of the best-performing residue-contact predictors in the CASP competition for protein structure prediction \cite{jones2015metapsicov,wang2017accurate}. Despite their success in practical applications, not much is known about the reasons for this success and their intrinsic limitations. Typically, two hypotheses are made: {\it (i)} The correlated amino-acid usage in two MSA columns may result from a direct residue-residue contact in the protein structure, causing coordinated amino-acid changes to maintain the protein's stability. It may also result indirectly via intermediate residues, making the direct use of covariation for contact prediction impractical. The success of global models is attributed to their capacity to extract direct couplings from indirect correlations. {\it (ii)} Using the maximum-entropy principle, the simplest models reproducing pairwise residue covariation depend on statistical couplings between residue pairs. Whether or not this model is sufficient to capture also higher-order covariation remains currently unclear. So far, these two points have not been investigated systematically. The reason is relatively simple: The inference of pairwise models exactly reproducing the empirical conservation and covariation statistics extracted from an MSA requires to sum over all $20^L$ sequences of aligned length $L$, an unfeasible task for sequences of typical sizes $L=50-500$. Approximation schemes like mean-field approximation \cite{morcos2011direct}, Gaussian approximation \cite{jones2012psicov}, or pseudo-likelihood maximisation \cite{balakrishnan2011learning,ekeberg2013improved} have been introduced; they perform very well in contact prediction. Their approximate character prohibits, however, the analysis of higher-order correlations and collective effects, since even the pairwise statistics are not well reproduced. More precise approaches have been proposed recently \cite{sutto2015residue,haldane2016structural,barton2016ace}, but their high computational cost has limited applications mostly to anecdotal cases so far. Understanding these basic questions is essential for understanding the success of global coevolutionary models beyond ``black box'' applications, but also for recognising their current limitations and thus potentially to open a way towards improved statistical modeling schemes. To this end, we implement a highly precise approach for parameter inference in pairwise statistical models. Applying this approach to a number of very large protein families (containing sufficient sequences to reliably measure higher-order statistical features), we demonstrate that indirectly generated pair correlations are highly collective effects of entire networks of direct couplings, which are based on the structural vicinity between residues. However, the most interesting finding of the paper is the unexpected accuracy of DCA at reproducing higher-order statistical features, which are not fitted by our approach. These non-fitted features include connected three-point correlations, the distance distributions between natural sequences and between artificial sequences sampled from the model, or the clustered organisation of sequences in sequence space. Currently we do not find indications, that more involved models (e.g.~including three-residue interactions) are needed to reproduce the full sequence statistics: pairwise models are not only necessary as argued above, but seem to be sufficient to describe the sequence variability between homologous proteins. \section*{Results} \subsection*{Direct coupling analysis -- methodology and approximate solutions } The aim of global coevolutionary sequence models as constructed by DCA is to provide a protein family-specific probability distribution \begin{equation} \label{eq:potts_def} P({\underline A}) \ \propto\ \exp\left( \sum_{j>i} J_{ij}(A_i,A_j) + \sum_{i=1}^N h_i(A_i) \right) \end{equation} for all full-length amino-acid sequences $\underline{A} = (A_1,\ldots,A_L)$. To model sequence variability in an MSA, couplings $J_{ij}(A,B)$ and biases (fields) $h_i(A)$ have to be fitted such that model $P(\underline A)$ reproduces the empirically observed frequencies $f_i(A)$ of occurrence of amino acid $A$ in the $i$th MSA column, and co-occurrence $f_{ij}(A,B)$ of amino acids $A$ and $B$ in positions $i$ and $j$ of the same sequence. In other words, the DCA model has to satisfy \begin{equation} \label{eq:maxent_def} P_i(A) = f_i(A) \quad \text{and} \quad P_{ij}(A,B) = f_{ij}(A,B) \end{equation} for all columns $i,j$ and all amino acids $A,B$, with $P_i$ and $P_{ij}$ being marginal distributions of model $P(\underline A)$, cf. {\it Methods} and Sec.~1 of the {\it Supplement}. Eq.~(\ref{eq:maxent_def}) has two important consequences. First, a precisely inferred DCA model reproduces also pairwise connected correlations (or covariances) $c_{ij}(A,B) = f_{ij}(A,B) - f_i(A)f_j(B)$ found in the MSA. This is a crucial difference with profile models, which show vanishing connected correlations by construction. Second, the inference of $P(\underline A)$ via Eq.~(\ref{eq:maxent_def}) does \emph{not} use all the information contained in the MSA, but only the pairwise statistics. For this reason, model $P(\underline A)$ has \emph{a priori} no reason to reproduce any higher order statistics contained in the alignment. In particular, even though a model of the form of Eq.~(\ref{eq:potts_def}) will contain higher-order correlations, such as three-residue correlations, these may differ significantly from those found in the original MSA. To infer DCA parameters, we need to estimate marginal probabilities for single positions and position pairs from model $P(\underline A)$. Exact calculations of these marginals require to perform exponential sums over $q^L$ terms, with L being the sequence length, and $q=21$ enumerating amino acids and the alignment gap. These sums are infeasible even for short protein sequences, and have been replaced by approximate expressions, e.g. via mean-field \cite{morcos2011direct}, Gaussian \cite{jones2012psicov}, or pseudo-likelihood approximations \cite{balakrishnan2011learning,ekeberg2013improved}. These approximations are sufficiently accurate for residue-contact prediction, which is topological in nature: only the existence of a strong direct statistical coupling has to be detected, not necessarily its precise numerical value. As a consequence, these methods do not reproduce the empirical frequencies and thus do not satisfy Eq.~(\ref{eq:maxent_def}), cf.~Fig.~\ref{fig:fig1} for pseudo-likelihood maximisation (plmDCA \cite{ekeberg2013improved}). More precise methods based on an adaptive cluster expansion \cite{barton2016ace} or Boltzmann machine learning using Markov-chain Monte Carlo sampling \cite{ackley1985learning} for estimating marginal distributions have been proposed recently \cite{sutto2015residue,haldane2016structural}. While decreasing deviations from Eq.~(\ref{eq:maxent_def}) substantially (\emph{i.e.} fitting quality), they are typically much more computationally expensive and not suitable for large-scale application to hundreds or thousands of protein families. \subsection*{Accurate fitting is needed to reproduce the empirical residue covariation in homologous protein families} \begin{figure*}[h!] \begin{center} \includegraphics[width=0.95\textwidth]{figure1-eps-converted-to.pdf} \end{center} \caption{{\bf Fitting accuracy and contact prediction for DCA models inferred using pseudo-likelihood maximisation (plmDCA) and Boltzmann-machine learning (bmDCA):} While the Potts model inferred by plmDCA (panel A) fails to reproduce the one- and two-residue frequencies (orange / blue) and the connected two-point correlations (black) in the PF00072 protein family, the model inferred using our bmDCA algorithm (panel B) is very accurate. Slight deviations visible for very small frequencies in log-scale (upper right insert) are results of the $\ell_2$-regularisation penalising strongly negative couplings. Despite these differences, the contact predictions (panel C for plmDCA, panel D for bmDCA) relying on the strongest $2L=224$ DCA couplings (with $|i-j|>4$) are close to identical: native contacts (all-atom distance below 8\AA) are shown in black, predicted contacts in blue (true positives) or red (false positives). Very similar results are observed across all studied protein families, cf.~Sec.~5.1 and 5.5 of the \textit{Supplement}.} \label{fig:fig1} \end{figure*} Since the aim of the current paper is to unveil the way DCA disentangles direct couplings and indirect correlations, and to investigate if it captures higher-order statistical observables estimated from the MSA, we have implemented an efficient version of Boltzmann machine (BM) learning described in {\it Methods} and, in full detail, in Sec.~2 of the {\it Supplement}. In short, BM learning estimates the pairwise marginal distributions of $P(\underline A)$ by Monte-Carlo sampling, and iteratively updates model parameters until Eq.~(\ref{eq:maxent_def}) is satisfied. In contrast to approximations such as applied in plmDCA, the inference of parameters using BM learning can be made arbitrarily accurate, provided that Monte-Carlo samples are large enough and sufficient iterations are performed. In analogy to earlier notation, we will use bmDCA for the resulting implementation of DCA. As is shown in Fig.~\ref{fig:fig1} and in Table 1, bmDCA reaches very accurate fitting, approaching the statistical uncertainties related to the finite sample size (i.e., the sequence number in each MSA), even for the very large protein families studied here. Obviously bmDCA has a higher computational cost than plmDCA: While plmDCA achieves inference typically in few minutes, bmDCA needs few hours to several days for one family, in dependence of the sequence length and the required fitting accuracy. Interestingly, the increased fitting accuracy does not improve the contact prediction beyond the one of plmDCA, the currently best unsupervised DCA contact predictor, cf.~Fig.~\ref{fig:fig1}.C+D. Couplings $J_{ij}(A,B)$ are highly correlated between PLM and BM (Pearson correlations of 90\% - 98\% across all studied protein families), in particular large couplings are robust and lead to very similar contact predictions. However, the model statistics depends collectively on all ${\cal O}( q^2 L^2)$ parameters and can thus differ substantially even for small differences in the individual parameters. This sensitivity (so-called criticality) has also been observed in other models inferred from large-scale biological data, cf.~\cite{mora2011biological}. \begin{table*}[h!] \begin{center} \resizebox{\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|} \hline \multicolumn{4}{|c|}{\textbf{protein family}} & \multicolumn{2}{c|}{\textbf{fitting quality}} & \multicolumn{2}{c|}{\textbf{contact prediction}} & \multicolumn{2}{c|}{\textbf{three-point correlations}} & \multicolumn{3}{c|}{\textbf{collectivity of correlations}} \\ \hline Pfam & $L$ & $M$ & PDB & PLM & BM & PLM & BM & PLM & BM & corr(DI,MI) & corr(L2I,MI) & $\nu$ \\ \hline PF00004 & 132 & 39277 & 4D81 & 0.630 & \textbf{0.954} & \textbf{0.672} & \textbf{0.672} & 0.333 & \textbf{0.980} & 0.33 & 0.42 & 1.2 \\ \hline PF00005 & 137 & 68891 & 1L7V & 0.546 & \textbf{0.948} & \textbf{0.599} & 0.586 & 0.718 & \textbf{0.978} & 0.51 & 0.65 & 1.4 \\ \hline PF00041 & 85 & 42721 & 3UP1 & 0.897 & \textbf{0.973} & \textbf{0.715} & 0.671 & 0.893 & \textbf{0.991} & 0.61 & 0.77 & 1.7 \\ \hline PF00072 & 112 & 73063 & 3ILH & 0.670 & \textbf{0.978} & 0.836 & \textbf{0.842} & 0.803 & \textbf{0.988} & 0.52 & 0.69 & 1.4\\ \hline PF00076 & 69 & 51964 & 2CQD & 0.868 & \textbf{0.977} & \textbf{0.877} & 0.833 & 0.963 & \textbf{0.993} & 0.53 & 0.72 & 1.5\\ \hline PF00096 & 23 & 38996 & 2LVH & 0.954 & \textbf{0.987} & 0.657 & \textbf{0.711} & ND & ND & 0.95 & 0.99 & 2.3 \\ \hline PF00153 & 97 & 54582 & 2LCK & 0.800 & \textbf{0.967} & \textbf{0.601} & 0.563 & 0.517 & \textbf{0.986} & 0.45 & 0.57 & 1.1 \\ \hline PF01535 & 31 & 60101 & 4G23 & 0.902 & \textbf{0.994} & 0.630 & \textbf{0.739} & 0.120 & \textbf{0.996} & 0.70 & 0.91 & 1.5\\ \hline PF02518 & 111 & 80714 & 3G7E & 0.624 & \textbf{0.970} & \textbf{0.423} & 0.396 & -0.228 & \textbf{0.986} & 0.47 & 0.60 & 1.6 \\ \hline PF07679 & 90 & 36141 & 1FHG & 0.823 & \textbf{0.955} & \textbf{0.826} & \textbf{0.826} & 0.797 & \textbf{0.993} & 0.48 & 0.58 & 1.8\\ \hline \end{tabular} } \end{center} \caption{{\bf Results for the 10 selected protein families:} The first four columns give the ID of the selected protein families together with the sequence length L, alignment depth M and a representative protein structure. The fitting quality measures the Pearson correlation between connected two-point correlations in the natural data, and in a sample drawn from the Potts models inferred by plmDCA and bmDCA (better quality emphasised in boldface). The contact prediction gives the fraction of true positives (all-atom distance $<$ 8\AA) within the first 2L predictions. Columns 9 and 10 provide the Pearson correlation between connected three-point correlations observed in natural and in sampled sequences (due to the dominance of insignificantly small terms, only those with $c_{ijk}^{MSA}(A,B,C)>0.01$ are considered). PF00096, with only 23 aligned positions is the shortest considered protein family, has no significant three-point correlations, neither in the data nor in the Potts model. The last three columns quantify the collective nature of correlations: the Pearson correlation of direct information / mutual information as compared to the length-two information / mutual information, and the exponent of the approximate power-law decay of the strongest paths (in terms of their path information) with their ranking.} \end{table*} \subsection*{Indirect correlations result collectively from networks of direct couplings} bmDCA provides a highly accurate approach to describe the sequence variability of homologous proteins via a pairwise coevolutionary model. This implementation allows us to ask fundamental questions about how DCA works, its capacities and its possible limitations, without being biased by the specificities of approximate DCA implementations. The success of global models as inferred by DCA is typically attributed to the idea that they disentangle statistical correlations, which are empirically observed in an MSA and measured via the mutual information (MI), into a network of direct couplings between residues. The strongest direct couplings are biologically interpretable as residue-residue contacts in the three-dimensional protein structure. However, this idea, even if stated in many papers on the subject, has never been examined in detail, and important questions remain unanswered: can indirect effects be explained by a few strong coupling chains, or are they distributed over networks of numerous small couplings? Are these networks structurally interpretable, i.e.~in relation to a protein’s contact map? \subsubsection*{Correlations are mediated collectively by distributed networks of coevolutionary couplings} To answer the first question, we need to quantify the correlation induced by a coupling chain of arbitrary length, connecting any two residues. To this aim, we take inspiration from the concept of direct information (DI) introduced in \cite{weigt2009identification}. DI is a proxy of the strength of the direct interaction $J_{ij}$ between two residue positions $i$ and $j$; it measures the correlation that $i$ and $j$ would have if they were only connected by $J_{ij}$, cf.~Fig.~\ref{fig:fig2}.A. To measure the indirect correlation between $i$ and $j$ induced via a chain of intermediate residues, we introduce the concept of path information (PI), as illustrated again in Fig.~\ref{fig:fig2}.A and defined in {\it Methods}. Now, for each protein family, we extracted the 100 most correlated residue pairs (highest MI). Using a modification of Dijkstra's shortest-path algorithm \cite{dijkstra1959note} -- which becomes approximate due to the non-additivity of PI but delivers highly reliable results as shown in Sec.~3 of the {\it Supplement} -- we extracted for each residues pairs the 15 strongest coupling paths (highest PI) connecting the two residues. In Fig.~\ref{fig:fig2}.B, we show that the decrease of the average strength of the $k$th strongest path is compatible with a slowly decreasing power law, $\langle PI(k) \rangle \propto k^{-\nu}$, with exponents $\nu$ between 1.1 and 2.3. While this fit is only approximate, as visible by the strong deviations for the strongest path at $k=1$, its slow decay clearly shows that the correlation between two residues typically is not mediated by one or few coupling chains. On the contrary, indirect effects emerge collectively, in the sense that a large number of partially overlapping coupling chains have to be taken into account, each one contributing only a small fraction to the total correlation. It is important to note that the strongest path (rank $k=1$) is on average much stronger than the others and clearly does not fall onto a power law. For the overwhelming majority of the pairs, this strongest path is the direct one containing only one coupling. Its contribution to the total correlation is, on average, about 12,5\% of the total MI. This average is dominated by the shortest protein families, PF00096 and PF01535, who are expected to show less collectivity due to their small number $L$ of aligned residues. \begin{figure*}[h!] \begin{center} \includegraphics[width=0.95\textwidth]{figure2.pdf} \end{center} \caption{{\bf Collective nature of the correlation between two residue positions:} Panel A illustrates the correlation measures used in this work. While the mutual information MI depends collectively on the entire network of coevolutionary couplings, the direct information DI is obtained by taking into account only the single direct coupling between the sites of interest (e.g. 1 and 3 in the figure). All other couplings are formally set to zero. The path information PI is the direct generalisation of DI to the correlation mediated by a single path (e.g. $[1,2,4,3]$ in the figure). The length-two information L2I measures the collective effect of the direct coupling and all length-two paths (e.g. $[1,k,3]$ with $k=2,4,5$). Panel B shows a log-log plot of the average ratio of path information to mutual information (black curve: all families, coloured curves: individual behavior of families) as a function of the rank of the corresponding path, showing a very slow (approximately power-law) decay. This illustrates the fact that indirect correlations do not depend on a single (or very few) coupling chains, but are distributed over coupling networks. Panel C shows, for the 25 highest ranking residue pairs according to DI, L2I and MI, the fraction of pairs of distance below $d$, as a function of $d$. The scale on the $y$-axis is logarithmic, and chosen in a way that functions of the form $1-e^{-d/d_0}$ will appear as straight lines, the insert shows a standard linear scale. For DI and PI, these curves show a clear exponential convergence to 1, with characteristic distance scales of 3.6 resp. 4.4\AA. MI does not show any exponential behavior, and thus no characteristic distance scale.} \label{fig:fig2} \end{figure*} \subsubsection*{On the structural basis of coevolutionary coupling networks} As a consequence of the last section, we need to consider the collective effect of multiple paths rather than trying to biologically interpret individual paths beyond the direct one. While this is technically very hard in general, the collective effect of all paths of length two is efficiently computable, cf.~{\it Methods}. The corresponding correlation measure, named here length-two information (L2I) and illustrated in Fig. ~\ref{fig:fig2}.A, adds the $L-2$ possible indirect paths of length 2 (one intermediate residue) to the direct path between two residue positions. As expected, L2I captures a much higher fraction of the full mutual information than DI, cf.~Table 1. However, a large fraction of the mutual information is not yet covered. It is contributed by longer coupling chains: L2I depends only on $2L-3$ out of the $L(L-1)/2$ couplings between residue pairs. Consistent with this observation, the correlation of L2I with MI is much larger in small proteins, and decreases when going to larger proteins. L2I allows for an interesting structural interpretation. It is well established that large DI are good predictors for native residue contacts. Is large L2I a good predictor of second neighbours in the protein structure, i.e.~of residue pairs which are “two contacts away”? To investigate this question, the blue line in Fig.~\ref{fig:fig2}.C displays the fraction of true positive predictions (positive predictive value, averaged over the protein ensemble) within the highest 25 DI as a function of a distance cutoff $d$, which varies between 1\AA\ and 25\AA. It starts at 0 for small $d$, and approaches 1 exponentially with a scaling $1-\exp(-d/d_0)$ of characteristic length $d_0 = 3.6$\AA. At 8\AA\ distance (typically used as contact definition in DCA studies), an accurate prediction of about 85\% true positives (TP) and only 15\% false positives (FP) is reached. Measuring the cut-off dependent positive predictive value for the length-two information L2I, we find again an exponential behavior but with characteristic length $d_0 = 4.4$\AA. The fraction of TP therefore reaches 85\% only between 11 and 12\AA, a distance compatible with second structural neighbours. The finding that the top DI are dominated by direct contacts, and large L2I by residue pairs which are up to second neighbours in the structure, further underlines the structural basis of coevolutionary constraints as captured by DCA. We also note that the full correlation MI -- depending on coupling chains of all possible lengths -- does not imply an exponential behavior in Fig.~\ref{fig:fig2}, and no characteristic length scale can be identified. \subsection*{Pairwise coevolutionary models accurately reproduce the residue variability beyond the fitted two-residue statistics} Profile models assuming independent residues are not able to extract the full information contained in the MSA of a protein family. In particular, the inclusion of pairwise coevolutionary couplings is required for the prediction of intra- or inter-protein residue-residue contacts, which has become the most important application of coevolutionary modeling. Furthermore, studies about protein mutational effects \cite{levy2017potts} and the prediction of protein-protein interactions \cite{szurmant2018inter} have underlined the importance of pairwise couplings. Is there information hidden in large MSA, which cannot be captured by pairwise models? Does one need to include higher-order couplings into the modeling? The highly accurate inference of pairwise models obtained by bmDCA, reproducing faithfully the empirical first- and second-order statistics, allows to address these questions systematically. To this aim, we use MCMC samples from the inferred models to {\it compare statistical observables, which are not a direct consequence of the fitted covariances}. These comparisons unveil the astonishing capacity of bmDCA to capture local and global statistical features, which are not explicitly fitted by the model: pairwise couplings are not only necessary for characterising sequence variability between homologs, but they also seem to be sufficient. \begin{figure*}[h!] \begin{center} \includegraphics[width=0.95\textwidth]{figure3-eps-converted-to.pdf} \end{center} \caption{{\bf Non-fitted statistical observables are captured by DCA:} Panels A-C: Natural sequences (PF00072 -- A) and MCMC samples from inferred profile (B) and bmDCA(C) models are projected on the first two principal components of the natural MSA. Panels D-E: Three-point correlations of samples of the profile (D) and bmDCA (E) models, as compared to the three-points correlations in the natural sequences. Panels F-G: Histograms of all pairwise Hamming distances between natural or MCMC sampled sequences, for profile (F) and bmDCA (G) models. Surprisingly bmDCA is able to reproduce all three non-fitted statistical properties of the natural MSA, with the difference of the small distances between close homologs, while the profile model not taking into account residue-residue couplings does not. This suggests that accurately inferred pairwise models are necessary and sufficient to capture the residue variability in families of homologous proteins. Similar results are observed across all studied protein families, as is documented in Secs. 5.2-5.4 of the \textit{Supplement}.} \label{fig:fig3} \end{figure*} First, we observe that the {\it three-residue statistics} is accurately reproduced by our model including only pairwise couplings: Fig.~\ref{fig:fig3} (cf.~{\it Supplement}, Sec. 5.2, for other families) shows a density-coloured scatter plot of the connected three-point correlations of the natural sequences vs. the MCMC sample drawn from the model. Correlations are high across all protein families for the pairwise model, with close to perfect Pearson correlations ranging from 0.978 to 0.997, cf.~Table 1. Profile models, which by definition do not have any connected three-point correlation, can be seen as null model testing the strength of three-point correlations emerging due to finite sampling. As is shown in Fig.~\ref{fig:fig3}.D, they are at least one order of magnitude smaller than those found empirically, underlining the significance of our findings. The only exception is family PF00096, where no significant connected three-point correlations are detectable in the MSA or in the sample. Note that we use connected correlations $c_{ijk}(A,B,C) = f_{ijk}(A,B,C)-f_{ij}(A,B) f_k(C) - f_{ik}(A,C) f_j(B) - f_{jk}(B,C) f_i(A) +2 f_i(A)f_j(B)f_k(C)$, which are intrinsically harder to reproduce than three-point frequencies $f_{ijk}(A,B,C)$. Note also that our result is far from being obvious: a Gaussian model with the same covariances would have vanishing three-point correlations, while the sequence data and the sample from our DCA model do not. Further more, it is easy to construct models with discrete variables, whose three-point correlations are not reproduced by a pairwise DCA model. This is shown in Sec.~4 of the {\it Supplement}, via analytical calculations and numerical simulations. To complement the three-point statistics, we investigated more global quantities. The first one is the clustered organisation of protein families in sequence space. Fig.~\ref{fig:fig3}.A shows all sequences mapped onto their first two principal components for PF00072 (cf.~{\it Supplement} for other families). We observe a clear clustering into at least three distinct subfamilies, which identify different functional subclasses of the PF00072 protein family (single domain vs. multi-domain architectures with distinct DNA-binding domains). A sample drawn from a profile model does not reproduce this clustered structure (panel B), while the MCMC sample of the bmDCA model does, including the fine structure of the clusters (C). Again, this structure is not a simple consequence of the empirical covariance matrix as a sample from a Gaussian model with the same covariances would not show any clustering. As a last measure, we compared the pairwise Hamming distances between sequences in the natural MSA and in the model-generated sequences. Again the pairwise bmDCA model is needed to reproduce the bulk of the empirical distribution of pair distances. Interestingly, a difference between the two becomes visible in the small-distance tail of the histograms in Fig.~\ref{fig:fig3}.G: while natural sequences may be close to identical due to a close phylogenetic relation, small sequence distances are never observed in an equilibrium sample of the bmDCA model, i.e., a part of the phylogenetic bias present in the MSA is avoided by the bmDCA model. \section*{Discussion} This paper unveils a number of reasons behind the success of global pairwise models in extracting information from the sequence variability of homologous protein sequences. First, we show that residue-residue correlations actually result from the collective variability of many residues, and are not the result of a few strong coupling chains. Therefore local statistical measures taking into account only a small numbers of residues at a time (like correlation measures) are necessarily limited in their capacity to represent the data, and global modeling approaches are needed. One of the most astonishing findings is that many features of the data, which are not explicitly fitted by a pairwise modeling, are nevertheless well reproduced by the inferred models. This includes higher-order correlations, like the connected three-point correlations considered here, and more general aspects of the distribution of amino-acid sequences like the histogram of pairwise Hamming distances between pairs of sequences or the clustered organisation of the sample in sequence space. Interestingly, only the small distances between phylogenetically closely related sequences are not reproduced in a sample drawn from the inferred DCA model. This capacity to reproduce the sequence variability beyond the fitted empirical observables distinguishes the DCA model (fitting one- and two-residue frequencies) from profile models of independent residues (fitting only one-residue frequencies). While the restriction to pairwise models was initially motivated by the limited availability of sequence data -- three-point correlations require to estimate frequencies for $21^3 = 9261$ combinations of amino acids or gaps -- we find that even for large MSA pairwise models seem to be sufficient to capture collective effects beyond residue pairs. Note that this argument does not rule out the existence of higher-order residue effects in the underlying evolutionary processes shaping the sequence variability in homologous protein families (cf.~\cite{merchan2016sufficiency,schmidt2017three}). However, their statistical signature is not strong enough to be detectable via deviations from the behavior of a pairwise model, even in the large families considered here. Random samples drawn from a DCA model based exclusively on the knowledge of the empirical one- and two-residue statistics appear to be statistically indistinguishable from natural sequences. This finding is particularly interesting in the context of work made few years ago by the Ranganathan lab \cite{socolich2005evolutionary,russ2005natural}. Using the small WW domain, they applied a number of diverse procedures to scramble MSA of natural sequences to produce artificial sequences. Scrambling MSA columns to maintain residue conservation while destroying residue correlations, lead in all tested cases to non-folding amino-acid sequences. A procedure maintaining also pairwise correlations lead to a substantial fraction of folding and functional proteins. Later on it has been observed that the functional artificial sequences actually have the highest probabilities within pairwise coevolutionary models \cite{balakrishnan2011learning}. These findings open interesting roads to evolution-guided protein design \cite{reynolds2013evolution}. Note, however, that the finite size of the input MSA requires to use regularised inference, which penalizes large absolute parameter values. It leads to a small bias visible in Fig.~\ref{fig:fig1}.B: small pair frequencies are slightly but systematically overestimated by DCA. This may smoothen the inferred statistical model, cf.~\cite{Otwinowski03062014} for the related case of inferring epistatic fitness landscapes. As a consequence ``bad'' sequences may be given high probabilities in our model. Based on the findings presented in Figs.~\ref{fig:fig1}.B and \ref{fig:fig3}, we expect these effects to be minor. When increasing the regularisation strength beyond parameters used in this work, the clustered structure of sampled sequences (Fig.~\ref{fig:fig3}.C) disappears gradually. Data in large MSA allow to use small regularisation, thereby simultaneously limiting overfitting of statistical noise and reducing biases in parameter inference. This may be impossible for small MSA, so the ongoing growth of sequence databases is key for the wide applicability of global statistical sequence models. One potentially important limitation remains: the distribution of sequences in sequence space is not only determined by functional constraints acting on amino-acid sequences, but also by phylogenetic relations between sequences. Natural sequences are, even beyond the very closely related sequences not reproduced by the DCA model, far from being an independent sample of all possible amino-acid sequences. They are correlated due to finite divergence times between homologs, and due to the human selection bias in sequenced species. Any model reproducing the full empirical statistics of the MSA describes therefore a mixture of functional and phylogenetic correlations, while an ideal model would contain the functional ones and discard the phylogenetic ones. How these can be disentangled remains an important open question. \section*{Methods} \subsection*{Protein families} We have selected 10 protein families of known three-dimensional structure which belong to the largest 20 Pfam families \cite{finn2013pfam}, which are not repeat proteins (i.e. they are not just frequent because repeated many times on the same protein), and have an aligned sequence length below 200 amino acids (for computational reasons), cf. Table 1. Sequences with more than 50 alignment gaps are removed. The resulting sequence numbers are reported in Table 1. The main reason to include only large Pfam families is the possibility to accurately estimate three-point correlations. For each triplet of residue positions, there are $21^3 = 9261$ combinations of amino acids or gaps. Non-systematic tests in smaller protein families show that our main findings of the paper translate directly to these families. \subsection*{Boltzmann machine learning} DCA infers a Potts model \begin{equation} P(A_1,...,A_L) = \frac1{Z} \exp\left\{ \sum_{i<j} J_{ij}(A_i,A_j) + \sum_i h_i(A_i) \right\} \end{equation} reproducing the single- and two-residue frequencies found in the input MSA: \begin{eqnarray} \sum_{\{A_k|k\neq i\}} P(A_1,...,A_L) &=& f_i(A_i) \nonumber\\ \sum_{\{A_k|k\neq i,j\}} P(A_1,...,A_L) &=& f_{ij}(A_i,A_j) \end{eqnarray} with empirical frequencies $f_i(A_i)$ and $f_{ij}(A_i,A_j)$ defined respectively as the fraction of sequences in the MSA having amino acid $A_i$ (resp. $A_i$ and $A_j$) in column $i$ (resp. in columns $i$ and $j$) (cf.~Sec.~1 of the {\it Supplement} for a precise definition of these frequency counts, including a sequence weighting to reduce phylogenetic biases). For the sake of contact prediction, this inference can be done with efficient approximation schemes like mean-field of pseudo-likelihood maximisation. The objectives of this work -- to understand the collective variability of the residues -- require a more precise inference based on the classical ideas of Boltzmann-machine learning \cite{ackley1985learning}. It consists of an iterative procedure where\\ (i) for a given set of model parameters $\{J_{ij}, h_i\}$, Markov chain Monte Carlo (MCMC) sampling is used to estimate the one- and two-point frequencies of the model;\\ (ii) parameters are adjusted when the estimated model frequencies deviate from the empirical ones.\\ To reduce finite-sample effects, the model parameters are subject to an $\ell_2$-regularisation. The likelihood function is convex, guaranteeing convergence to a single globally optimal solution, which reproduces the empirical one- and two-point frequencies with arbitrary accuracy. The direct implementation of Boltzmann-machine learning is computationally very slow. We have therefore introduced a reparameterization of the model, which allows to replace the gradient ascent of the likelihood by a faster pseudo-Newtonian method. Technical details of the implementation are described in Sec.~2 of the {\it Supplement}. \subsection*{From direct couplings to indirect correlations} \subsubsection*{Quantifying the strength of a coupling chain} To quantify the strength of a coupling chain, we generalize the direct information introduced in \cite{weigt2009identification}. There, the direct probability \begin{equation} \label{eq:Pdir_def} \begin{split} &P^{dir}_{ij}(A_i, A_j) = \\ &\exp\{ J_{ij}(A_i,A_j) + \tilde{h}_i(A_i) + \tilde{h}_j(A_j) \}/Z_{ij}\, . \end{split} \end{equation} was defined as the hypothetical distribution of two residues $i$ and $j$ connected only by the inferred direct coupling $J_{ij}$ and having the empirical single-residue frequencies $f_i(A_i)$ and $f_j(A_j)$, thereby removing all indirect effects from model $P$. Parameters $\tilde{h}_i$ and $\tilde{h}_j$ are to be adjusted to ensure correct marginals. The \emph{path probability} between positions $i_1$ and $i_{L+1}$ through the length-$L$ path $[i_1, i_2\ldots i_{L+1}]$ is a direct generalisation: \begin{equation} \label{eq:Ppath_def} \begin{split} &P^{path}_{[i_1\dots i_{L+1}]}(A_{i_1},A_{i_{L+1}}) = \\ &\sum_{\{A_{i_2}\ldots A_{i_L}\}} f_{i_1}(A_{i_1}) \prod_{l=1}^L P^{dir}_{i_{l+1}i_l}(A_{i_{l+1}} \vert A_{i_l})\, , \end{split} \end{equation} with $P^{dir}_{ij}(A_i \vert A_j) = P^{dir}_{ij}(A_i, A_j) / f_j(A_j)$. Eq.~\ref{eq:Ppath_def} contains the product of direct probabilities for all links in the path, in analogy to a Markov chain. The sum over all configurations taken by intermediate sites $[i_2 \ldots i_L]$ is performed efficiently by dynamic programming; the definition guarantees the empirical marginals in all sites on the path. To measure the correlation mediated by direct links or indirect paths, we use variants of the mutual information based on the direct and path probabilities. To this aim we define the \emph{direct information} (DI) as \begin{equation} \label{eq:DI_def} \begin{split} DI_{ij} &=\\ &\sum_{A_{i},A_{j} =1}^q P^{dir}_{ij}(A_{i},A_{j}) \log \frac{P^{dir}_{ij}(A_{i},A_{j})}{f_i(A_{i})f_j(A_{j})}\, , \end{split} \end{equation} and the \emph{path information} (PI) as \begin{equation} \label{eq:PI_def} \begin{split} PI_{[i \ldots j]} &=\\ &\sum_{A_{i},A_{j} =1}^q P^{path}_{[i \ldots j]}(A_{i},A_{j}) \log \frac{P^{path}_{[i \ldots j]}(A_{i},A_{j})}{f_i(A_{i})f_j(A_{j})} \, . \end{split} \end{equation} The full \emph{mutual information} (MI) is defined by replacing $P^{dir}$ or $P^{path}$ by $f_{ij}$. \subsubsection*{The joint effect of paths of length 2} Quantifying the strength of a group of indirect effects between two sites $i$ and $j$ is in general non trivial. However, it is possible if one only considers all chains of couplings that go through at most one intermediary site $k$. In other words, one can combine the direct path $[i j]$ and all the chains of the form $[i k j]$ ($k\neq i,j$) into a single probability distribution: \begin{equation} \label{eq:Length2_def} P^{L2}_{ij}(A_i,A_j) \propto \frac{P^{dir}(A_i,A_j)}{z_i(A_i) z_j(A_j)}\cdot\prod_{k\neq i,j} P^{path}_{[i\,k\,j]}(A_i,A_j), \end{equation} where $z_i$ and $z_j$ ensure $P^{L2}_{ij}$ to have marginals $f_i$ and $f_j$. The path probabilities can be simply multiplied since each intermediate residue $k$ appears only once, and they become conditionally independent for given $(A_i,A_j)$. The correlation resulting from this combination of paths is the mutual information of $P^{L2}_{ij}$, called $L2I$. \section{Supplementary Material} Supplementary text and figures are available at Molecular Biology and Evolution online (http://www.mbe.oxfordjournals.org/). Code and raw data can be accessed via Github (https://github.com/matteofigliuzzi/bmDCA). \section{Acknowledgments} MW acknowledges funding by the ANR project COEVSTAT (ANR-13-BS04-0012-01), and by the European Union's H2020 research and innovation programme MSCA-RISE-2016 under grant agreement No. 734439 INFERNET. This work was undertaken partially in the framework of CalSimLab, supported by the grant ANR-11-LABX-0037-01 as part of the "Investissements d'Avenir" program (ANR-11-IDEX-0004-02). \bibliographystyle{unsrt
\section{Divide-and-conquer method in the HODLR format} \label{sec:dc_hodlr} In this section we give the overall spectral divide-and-conquer method for computing the eigenvalue decomposition of a symmetric banded matrix $A\in {\mathbb R}^{n\times n}$. For completeness, we also include a pseudocode given in Algorithm~\ref{alg:hsdc}. In the following we discuss several details related to its implementation and provide the structure of the eigenvectors matrix. \begin{algorithm}[ht!] \caption{Spectral divide-and-conquer algorithm in the HODLR format ({\tt hSDC})} \label{alg:hsdc} \textbf{Input:} A symmetric banded or HODLR matrix $A\in {\mathbb R}^{n\times n}$. \textbf{Output:} A structured matrix $Q$ containing the eigenvectors of $A$ and a diagonal matrix $\Lambda$ containing the eigenvalues of $A$. \begin{algorithmic}[1] \Function {$[Q,\Lambda] = $\tt hsdc} {$A$} \If{$n \leq n_{\stp}$} \State $[Q, \Lambda] = {\tt eig}(A)$. \label{heig} \Else \State Compute $\mu = {\tt median}(\diag (A))$. \label{hshift} \State Compute $\Pi_{<\mu}$ and $\Pi_{>\mu}$ in the HODLR format by applying Algorithm~\ref{alg:hdwh} to $A-\mu I$. \label{hsp2} \State Compute column indices $C_{<\mu}$ and $C_{>\mu}$ by applying Algorithm~\ref{alg:cholp_col_sel} to $\Pi_{<\mu}$ and $\Pi_{>\mu}$. \label{hindices} \State Compute $Q_{<\mu}$ and $Q_{>\mu}$ by applying Algorithm~\ref{alg:basis_complete} to $\Pi_{<\mu}, C_{<\mu}$, and $\Pi_{>\mu}, C_{>\mu}$. \label{honb} \State Form $A_{<\mu} = Q_{<\mu}^{T}*_{\h}A*_{\h}Q_{<\mu}$ and $A_{>\mu} = Q_{>\mu}^{T}*_{\h}A*_{\h}Q_{>\mu}$. \label{hdc} \State Call recursively {$[Q_1, \Lambda_1]$ = \tt hsdc}$(A_{<\mu})$ and {$[Q_2, \Lambda_2]$ = \tt hsdc}$(A_{>\mu})$. \State Set $Q \gets \begin{bmatrix} Q_{<\mu} & Q_{>\mu} \end{bmatrix}*_{\h} \begin{bmatrix} Q_1 &0 \\ 0 &Q_2\end{bmatrix} $ and $\Lambda = \begin{bmatrix} \Lambda_1 & 0 \\ 0 & \Lambda_2 \end{bmatrix}$. \EndIf \EndFunction \end{algorithmic} \end{algorithm} \subsection{Computing the shift} The purpose of computing shift $\mu$ is to split a problem of size $n$ into a two smaller subproblems of roughly the same size. In this work, the computation of a shift is performed by computing the median of $\diag(A)$, as proposed in~\cite{NakaHigh2013}. Although this way of estimating the median of eigenvalues may not be optimal, it is a cheap method and gives reasonably good results. For more details regarding the shift computation, we refer the reader to a discussion in~\cite{NakaHigh2013}. Moreover, we note that it remains an open problem to develop a better strategy for splitting the spectrum. \subsection{Terminating the recursion} We stop the recursion when the matrix attains the minimal prescribed size $n_{\operatorname{stop}}$, and use {\sc Matlab}{} built-in function {\tt eig} to perform the final step of diagonalization. In a practical implementation, we set $n_{\operatorname{stop}}$ depending on the breakeven point of {\tt hQDWH} relative to {\tt eig} obtained in~\cite{KressnerSus2017}. \subsection{Matrix of eigenvectors} For simplicity, without loss of generality we assume that for size of a given matrix $A$ holds $n = 2^s n_{\stp}$, for $s\in {\mathbb N}$. We say that Algorithm~\ref{alg:hsdc} performed level $l$ divide step, with $0\leq l < s$, if all matrices of size $n/2^l$ had been subdivided. The eigenvectors matrix is given as an implicit product of orthonormal HODLR matrices. After level $l$ divide step of Algorithm~\ref{alg:hsdc}, structured matrix $Q$ has the form $$Q = Q^{(0)}*_{\h}Q^{(1)}*_{\h}\cdots *_{\h}Q^{(l)}. $$ $Q^{(i)} \in {\mathbb R}^{n\times n}$, $0 \leq i\leq l $, is a block-diagonal matrix with $2^{i}$ diagonal blocks, where each diagonal block is an orthogonal matrix of the form $[H_1 \hskip 2pt H_2]$, with $H_1, H_2$ orthonormal HODLR matrices computed in Line~\ref{honb} of Algorithm~\ref{alg:hsdc}. The computation of the eigenvectors matrix is completed by computing $Q^{(s)}$, a block-diagonal orthogonal matrix with $2^s$ orthogonal dense diagonal blocks that are computed in Line~\ref{heig} of Algorithm~\ref{alg:hsdc}. The overall storage required to store $Q$ equals to the sum of memory requirements for matrices $Q^{(i)}, 0\leq i \leq s$. Assume that the off-diagonal ranks occurring in matrices $Q^{(i)}$, $ 0\leq i < s$, are bounded by $\tilde{k}$. To determine the storage, we use that $Q^{(i)}$, for $0\leq i<s$, has $2^i$ diagonal blocks of the form $[H_1 \hskip 2pt H_2]$, where the storage of both $H_1$ and $H_2$ requires ${\mathcal O}(\tilde{k}\frac{n}{2^{i}}\log_2 \frac{n}{2^{i}})$ memory. Hence we get that the storage for matrices $Q^{(i)}$, $0\leq i<s$, adds up to \begin{align} \sum_{l=0}^{s-1} \tilde{k} 2^{l+1}\frac{n}{2^{l}}\log_2{\frac{n}{2^l}} &= 2\tilde{k} n\sum_{l = 0}^{s-1} \log_2 \frac{n}{2^l} = 2\tilde{k} n\left(s\log_2 n - \frac{(s-1)s}{2} \right)\nonumber\\ &= \tilde{k} n \log^2_2 \frac{n}{n_{\stp}} + \log_2\frac{n}{n_{\stp}} (\log_2 n_{\stp} +1/2)\label{eq:storage_Q}\text{.} \end{align} Moreover, the storage of $Q^{(s)}$ requires $2^s n^2_{\stp} = n n_{\stp}$ units of memory. Hence, from the latter and~\eqref{eq:storage_Q} follows that the overall memory needed for storing $Q$ is ${\mathcal O}(\tilde{k} n\log^2n)$. \subsection{Computational complexity} Now we derive the theoretical complexity of Algorithm~\ref{alg:hsdc}, based on the complexity of operations given in Table~\ref{table:complexity_HODLR}. The numerical results in section~\ref{sec:experiments} give an insight how the algorithm behaves in practice, and confirm theoretical results. We first note that for a HODLR matrix of size $m$ and rank $k$ the complexity of one divide step, computed in Line~\ref{hshift}--Line~\ref{hdc}, is ${\mathcal O}(k^2m\log_2^2m)$. When performing level $l$ divide step, the computation involves $2^l$ HODLR matrices of size $n/2^l\times n/2^l$. Denoting with $\tilde{k}$ an upper bound for the off-diagonal ranks appearing in the process, similarly as in the previous section we derive the complexity of our algorithm: \begin{align*} \sum_{l=0}^{s-1} \tilde{k}^2 2^{l}\frac{n}{2^{l}}\log_2^2{\frac{n}{2^l}} &= \tilde{k}^2 n\sum_{l = 0}^{s-1} \log_2^2 \frac{n}{2^l} = \tilde{k}^2 n\left(s\log_2 n (\log_2 n_{\stp} +1) + \frac{(s-1)s(2s-1)}{6} \right)\nonumber\\ &\approx {\mathcal O}(\tilde{k}^2 n \log^3_2 n)\label{eq:alg_complexity} \text{.} \end{align*} At the final level of recursive application of Algorithm~\ref{alg:hsdc}, when the algorithm is applied to matrices of size not larger than $n_{\stp}$, the complexity comes from diagonalizing $2^s$ dense matrices, i.e., equals to ${\mathcal O}(nn^2_{\stp})$. Thus the overall complexity of Algorithm~\ref{alg:hsdc} is ${\mathcal O}(\tilde{k}^2 n\log^3n)$. \section{Spectral divide-and-conquer} \label{sec:dc_sp} In this section we recall the spectral D\&C method by Nakatsukasa and Higham~\cite{NakaHigh2013} for a symmetric $n\times n$ matrix $A$ with spectral decomposition~\eqref{eq:sp_decomposition}. We assume that the eigenvalues are sorted in ascending order and choose a shift $\mu \in {\mathbb R}$ such that \[ \lambda_1\leq \cdots\leq\lambda_{\nu} < \mu <\lambda_{\nu+1}\leq\cdots\leq \lambda_{n}, \qquad \nu \approx n/2. \] The relative spectral gap associated with this splitting of eigenvalues is defined as $${\rm gap} = \frac{\lambda_{\nu+1} - \lambda_{\nu}}{\lambda_n - \lambda_1}.$$ The spectral projector associated with the first $\nu$ eigenvalues is the orthogonal projector onto the subspace spanned by the corresponding eigenvectors. Given~\eqref{eq:sp_decomposition}, it takes the form \[ \Pi_{<\mu} = Q\begin{bmatrix} I_{\nu} &0\\ 0 & 0 \end{bmatrix}Q^{T}. \] Note that \[ \Pi_{<\mu}^{T} = \Pi_{<\mu}^2 = \Pi_{<\mu}, \qquad \trace(\Pi_{<\mu}) = \rank(\Pi_{<\mu}) = \nu. \] The spectral projector associated with the other $n-\nu$ eigenvalues is given by \[ \Pi_{>\mu} = Q\begin{bmatrix} 0 &0\\ 0 & I_{n-\nu} \end{bmatrix}Q^{T} \] and satisifies analogous properties. The method from~\cite{NakaHigh2013} first computes the matrix sign function $$ \sign(A-\mu I) = Q\begin{bmatrix} -I_{\nu} &0\\ 0 &I_{n-\nu} \end{bmatrix}Q^{T}$$ and then extracts the spectral projectors via the relations \[ \Pi_{<\mu} = \frac{1}{2}(I - \sign(A-\mu I)), \qquad \Pi_{>\mu} = I-\Pi_{<\mu}. \] The ranges of these spectral projector are invariant subspaces of $A-\mu I$ and, in turn, of $A$. Letting $Q_{<\mu} \in {\mathbb R}^{n\times \nu}$ and $Q_{>\mu}\in {\mathbb R}^{n\times (n-\nu)}$ denote arbitrary orthonormal bases for $\range(\Pi_{<\mu})$ and $\range(\Pi_{>\mu})$, respectively, we therefore obtain \begin{equation} \label{eq:block_eig} \begin{bmatrix}Q_{<\mu}&Q_{>\mu}\end{bmatrix}^{T}A\begin{bmatrix}Q_{<\mu}&Q_{>\mu}\end{bmatrix} = \begin{bmatrix} A_{<\mu} &0\\ 0 &A_{>\mu} \end{bmatrix}, \end{equation} where the eigenvalues of $A_{<\mu} = Q_{<\mu}^{T}AQ_{<\mu}$ are $\lambda_1,\ldots,\lambda_\nu$ and the eigenvalues of $A_{>\mu} =Q_{>\mu}^{T}AQ_{>\mu}$ are $\lambda_{\nu+1},\ldots,\lambda_n$. Applying the described procedure recursively to $A_{<\mu}$ and $A_{>\mu}$ leads to Algorithm~\ref{alg:sdc_eig}. When the size of the matrix is below a user-prescribed minimal size $n_{\stp}$, the recursion is stopped and a standard method for computing spectral decompositions is used, denoted by {\tt eig}. \begin{algorithm}[h!] \caption{\text{Spectral D\&C method}} \label{alg:sdc_eig} \textbf{Input:} Symmetric matrix $A\in {\mathbb R}^{n\times n}$. \\ \textbf{Output:} Spectral decomposition $A = Q\Lambda Q^T$. \begin{algorithmic}[1] \Function {$[Q,\Lambda] =\ $\tt sdc}{$A$} \If{$n \le n_{\operatorname{stop}}$} \State Return $[Q,\Lambda] = {\tt eig}(A)$. \Else \State Choose shift $\mu$. \label{shift} \State Compute sign function of $A-\mu I$ and extract spectral projectors $\Pi_{<\mu}$ and $\Pi_{>\mu}$. \label{sp} \State Compute orthonormal bases $Q_{<\mu}, Q_{>\mu}$ of $\range(\Pi_{<\mu})$, $\range(\Pi_{>\mu})$.\label{onb} \State Compute $A_{<\mu} = Q_{<\mu}^{T}AQ_{<\mu}$ and $A_{>\mu} = Q_{>\mu}^{T}AQ_{>\mu}$. \label{dc} \State Call recursively $[Q_1,\Lambda_1] = {\tt sdc}(A_{<\mu})$ and $[Q_2,\Lambda_2] = {\tt sdc}(A_{>\mu})$. \State Set $Q \gets \begin{bmatrix} Q_{<\mu} Q_1 & Q_{>\mu} Q_2 \end{bmatrix}$, $\Lambda = \begin{bmatrix} \Lambda_1 & 0 \\ 0 & \Lambda_2 \end{bmatrix}$. \EndIf \EndFunction \end{algorithmic} \end{algorithm} In the following sections, we discuss how Algorithm~\ref{alg:sdc_eig} can be implemented efficiently in the HODLR format. \section{Computation of invariant subspace basis in the HODLR format} \label{sec:invariant_subspace} This section addresses the efficient extraction of a basis for the range of a spectral projector $\Pi_{<\mu}$ given in the HODLR format. Assuming that $\rank (\Pi_{<\mu}) = \nu$, the most straightforward approach to obtain a basis for $\range(\Pi_{<\mu})$ is to simply take its first $\nu$ columns. Numerically, this turns out to be a terrible idea, especially when $A$ is banded. \begin{example} \label{example:badcond} \rm Let $n$ be even and let $A\in {\mathbb R}^{n\times n}$ be a symmetric banded matrix with bandwidth $b$ and eigenvalues distributed uniformly in $[-1, \hskip 3pt -10^{-1}]\cup [10^{-1}, \hskip 3pt 1]$. In particular, $\rank(\Pi_{<0}) = n/2$. Figure~\ref{fig:condition_first_half} shows that the condition number of the first $n/2$ columns of $\Pi_{<0}$ grows dramatically as $n$ increases. By computing a QR decomposition of these columns, we obtain an orthonormal basis $Q_{1} \in {\mathbb R}^{n\times n/2}$. This basis has perfect condition number but, as Table~\ref{table:condition_first_half} shows, it represents a r ather poor approximation of $\range(\Pi_{<0})$. \begin{figure}[tbhp] \begin{center} \includegraphics[width=0.4\textwidth]{figures/cond_number_half} \end{center} \caption{Condition number of the first $n/2$ columns of the spectral projector $\Pi_{<0}$ for the matrix described in Example~\ref{example:badcond} with bandwidths $b = 1,2,4,8$.} \label{fig:condition_first_half} \end{figure} \begin{table}[h!] \caption{Angles (in radians) between $\range(\Pi_{<0})$ and $\range(Q_{1})$, with $Q_{1}$ an orthonormal basis for $\range(\Pi_{<0}(:, 1:\frac{n}{2}))$.} \label{table:condition_first_half} \centering \begin{tabular}[t]{c||c} $n$ &$\measuredangle(\range(\Pi_{<0}),\range(Q_{1})))$\\ \hline \hline $64$ &$4.4916e-02$\\ $256$ &$1.5692e+00$\\ $1024$ &$1.5700e+00$ \\ $4096$ &$1.5707e+00$\\ \hline \end{tabular} \end{table} \end{example} There exist a number of approaches that potentially avoid the problems observed in Example~\ref{example:badcond}, such as applying a QR factorization with pivoting~\cite[Chapter 5.4]{GolVanL2013} to $\Pi_{<0}$. None of these approaches has been realized in the HODLR format. In fact, techniques like pivoting across blocks appear to be incompatible with the format. In the following, we develop a new algorithm for computing a basis for $\range(\Pi_{<\mu})$ in the HODLR format, which consists of two steps: (1) We first determine a set of well-conditioned columns of $\Pi_{<\mu}$ by performing a Cholesky factorization with \emph{local} pivoting. As we will see below, the number of obtained columns is generally less but not much less than $\nu$. (2) A randomized algorithm is applied to complete the columns to a basis of $\range(\Pi_{<\mu})$. \subsection{Column selection by block Cholesky with local pivoting} The spectral projector $\Pi_{<\mu}$ is not only symmetric positive semidefinite but it is also idempotent. The (pivoted) Cholesky factorization of such matrices has particular properties. \begin{theorem}[{\cite[Theorem 10.9]{Higham1996}}] \label{thm:cholp} Let $B\in {\mathbb R}^{n\times n}$ be a symmetric positive semidefinite matrix of rank $r$. Then there is a permutation matrix $P$ such that $P^TBP$ admits a Cholesky factorization: \begin{equation*} P^TBP = R^T R, \quad R = \begin{bmatrix} R_{1} &R_{2}\\ 0 &0\end{bmatrix}, \end{equation*} where $R_{1}$ is a $r\times r$ upper triangular matrix with positive diagonal elements. \end{theorem} Note that, by the invertibility of $R_{1}$, the first $r$ columns of $BP$ as well as $[R_{1}\quad R_{2}]^T$ form a basis for $\range(B)$. The latter turns out to be orthonormal if $B$ is idempotent. \begin{lemma}[{\cite[Corollary 1.2.]{MolerStew1978}}] \label{thm:on_columns} Suppose, in addition to the hypotheses of Theorem~\ref{thm:cholp}, that $B^2 = B$. Then $$[R_{1}\quad R_{2}]\begin{bmatrix}R^{T}_{1}\\ R^{T}_{2}\end{bmatrix} = I_r.$$ \end{lemma} The algorithm described in~\cite[Chapter 10]{Higham1996} for realizing Theorem~\ref{thm:cholp} chooses the maximal diagonal element as the pivot in every step of the standard Cholesky factorization algorithm. In turn, the diagonal elements of the Cholesky factor are monotonically decreasing and it is safe to decide which ones are considered zero numerically. Unfortunately, this algorithm, which will be denoted by {\tt cholp} in the following, cannot be applied to $\Pi_{<\mu}$ because the diagonal pivoting strategy destroys the HODLR format. Instead, we use {\tt cholp} only for the (dense) diagonal blocks of $\Pi_{<\mu}$. To illustrate the idea of our algorithm, we first consider a general symmetric positive semidefinite HODLR matrix $M$ of level $1$, which takes the form \begin{equation*} \label{eq:HODLR1} M = \begin{pmatrix} M_{11} & U_1 V_2^T\\ V_2 U_1^T &M_{22}\\ \end{pmatrix} \end{equation*} with dense diagonal blocks $M_{11}$, $M_{22}$. Applying {\tt cholp} to $M_{11}$ gives a decomposition $P_1^T M_{11} P_1 = R_{11}^T R_{11}$, with the diagonal elements of $R_{11}$ decreasing monotonically. As $M$, and in turn also $M_{11}$, will be chosen as a principal submatrix of $\Pi_{<\mu}$, Lemma~\ref{thm:on_columns} implies that $\|R_{11}\|_2 \le 1$. In particular, the diagonal elements of $R_{11}$ are bounded by $1$. Let $s_1$ denote the number of diagonal elements not smaller than a prescribed threshold $\delta$. As will be shown in Lemma~\ref{lemma:invR} below, choosing $\delta$ sufficiently close to $1$ ensures that $R_{11}(1:s_1,1:s_1)$ is well-conditioned. Letting $\pi_1$ denote the permutation associated with $P_1$ and setting $C_1 = \pi_1(1:s_1)$, we have \[ M_{11}(C_1,C_1) = R_{11}(1:s,1:s)^T R_{11}(1:s,1:s). \] The Schur complement of this matrix in $M$ (without considering the rows and columns neglected in the first block) is given by \begin{equation} \label{eq:sc} S = M_{22} - V_2 U_1(C_1,:)^T M_{11}(C_1,C_1)^{-1} U_1(C_1,:)V_2^{T} = M_{22} - \tilde R_{12}^T \tilde R_{12}, \end{equation} where the rank of $\tilde R_{12} := R_{11}(1:s_1,1:s_1)^{-T} U_1(C_1,:) V_2^{T}$ is not larger than the rank of $U_1 V_2^T$. We again apply {\tt cholp} to $S$ and only retain diagonal elements of the Cholesky factor $R_{22}$ larger or equal than $\delta$. Letting $C_2$ denote the corresponding indices and setting $s_2 = |C_2|$, $C= C_1 \cup (n_1+C_2)$, where $n_1$ is the size of $M_{11}$, we obtain the factorization \[ M(C,C) = \tilde R^T \tilde R \quad \text{with} \quad \begin{bmatrix} R_{11}(1:s_1,1:s_1) & \tilde R_{12}(:,C_2) \\ 0 & R_{22}(1:s_2,1:s_2) \end{bmatrix}. \] For a general HODLR matrix, we proceed recursively in an analogous fashion, with the difference that we now form submatrices of HODLR matrices (see section~\ref{sec:hodlr_arithmetics}) and the operations in~\eqref{eq:sc} are executed in the HODLR arithmetic. The procedure described above leads to Algorithm~\ref{alg:cholp_col_sel}. Based on the complexity of operations stated in Table~\ref{table:complexity_HODLR}, the cost of the algorithm applied to an $n\times n$ spectral projector $\Pi_{<\mu} \in \h_{n\times n}(k)$ is ${\mathcal O}(k^2n\log^2 n)$. In Line~\ref{line:sc} we update a HODLR matrix with a matrix given by its low-rank representation. This operation essentially corresponds to the addition of two HODLR matrices. Recompression is performed when computing all off-diagonal blocks, while dense diagonal blocks are updated by a dense matrix of the corresponding size. In Line~\ref{line:sc} we also enforce symmetry in the Schur complement. \begin{algorithm}[ht!] \caption{Incomplete Cholesky factorization with local pivoting for HODLR matrices} \label{alg:cholp_col_sel} \textbf{Input:} Positive semidefinite HODLR matrix $M\in \h_{n\times n}(k)$ of level $p$, tolerance $\delta > 0$. \\ \textbf{Output:} Indices $C \subset [1,n]$ and upper triangular HODLR matrix $\tilde R$ such that $M(C,C) \approx \tilde R^T\tilde R$, with $\tilde r_{ii} \geq \delta$ for $i = 1,\ldots,|C|$. \begin{algorithmic}[1] \Function {$[C,\tilde R] =$ \tt hcholp$\_${\tt inc}}{$M$} \If{$p = 0$} \State Compute $[R, \pi] = {\tt cholp}(M)$ such that $M(\pi,\pi) = R^T R$. \State Set $s$ such that $r_{11}\ge \delta, \ldots, r_{ss}\ge \delta$ and $r_{s+1,s+1} < \delta$ (or $s = n$). \State Return $C = \pi(1:s)$ and $\tilde R = R(1:s,1:s)$. \Else \State Partition $M = \begin{pmatrix} M_{11} & U_1 V_2^T\\ V_2 U_1^T &M_{22}\\ \end{pmatrix}$. \State Call recursively $[C_1,\tilde R_{11}] = \text{\tt hcholp$\_${\tt inc}}(M_{11})$. \State Compute $\tilde U_1 = \tilde R_{11}^{-T} U_1(C_1,:)$. \label{line:u1} \State Compute $S = M_{22} -_{\h} V_2 \tilde U_1^T \tilde U_1 V_2^T$. \label{line:sc} \State Call recursively $[C_2,\tilde R_{22}] = \text{\tt hcholp$\_${\tt inc}}(S)$. \State Return $C = C_1 \cup (n_1 + C_2)$ and HODLR matrix $\tilde R = \begin{bmatrix} \tilde R_{11} & \tilde U_1 V_2(C_2,:)^T \\ 0 & \tilde R_{22} \end{bmatrix}$. \EndIf \EndFunction \end{algorithmic} \end{algorithm} \subsubsection{Analysis of Algorithm~\ref{alg:cholp_col_sel}} The indices $C$ selected by Algorithm~\ref{alg:cholp_col_sel} applied to $\Pi_{<\mu}$ need to attain two goals: (1) $\Pi_{<\mu}(:,C)$ has moderate condition number, (2) $|C|$ is not much smaller than the rank of $\Pi_{<\mu}$. In the following analysis, we show that the first goal is met when choosing $\delta$ sufficiently close to $1$. The attainment of the second goal is demonstrated by the numerical experiments in section~\ref{sec:experiments}. Our analysis needs to take into account that Algorithm~\ref{alg:cholp_col_sel} is affected by error due to truncation in the HODLR arithmetic. On the one hand, the input matrix, the spectral projector $\Pi_{<\mu}$ computed by Algorithm~\ref{alg:hdwh}, is not exactly idempotent: \begin{equation} \label{eq:error_idempotent} \Pi^2_{<\mu} = \Pi_{<\mu} + F, \end{equation} with a symmetric perturbation matrix $F$ of small norm. On the other hand, the incomplete Cholesky factor $\tilde R$ returned by Algorithm~\ref{alg:cholp_col_sel} is inexact as well: \begin{equation} \label{eq:error_chol} \Pi_{<\mu}(C, C) = \tilde R^T \tilde R + E, \end{equation} with another symmetric perturbation matrix $E$ of small norm. For a symmetric matrix $\Pi_{<\mu}$ satisfying~\eqref{eq:error_idempotent}, Theorem 2.1 in~\cite{MolerStew1978} shows that \begin{equation} \Vert \Pi_{<\mu} \Vert_2 \leq 1+ \Vert F\Vert_2. \label{eq:bound_norm_sp} \end{equation} The following lemma establishes a bound on the norm of the inverse of $\Pi_{<\mu}(C, C)$. \begin{lemma} \label{lemma:invR} With the notation introduced above, set $\varepsilon_{\h} = \|E\|_2 + \|F\|_2$ and $r = \vert C\vert$, and suppose that $1-\delta^2 + \varepsilon_{\h}< 1/r$. Then $\|\Pi_{<\mu}(C, C)^{-1}\|_2 \le \frac{1}{r}\frac{1}{\delta^2 - 1 + 1/r - \varepsilon_{\h}}$. \end{lemma} \begin{proof} Using~\eqref{eq:error_chol} and~\eqref{eq:bound_norm_sp}, we obtain \[ \|\tilde R^T\tilde R\|_2 \le \|\Pi_{<\mu}(C, C)\|_2 + \|E\|_2 \le \|\Pi_{<\mu}\|_2 + \|E\|_2 \le 1 + \varepsilon_{\h}. \] We now decompose $\tilde R = D+T$, such that $D$ is diagonal with $d_{ii} = \tilde r_{ii} \ge \delta$ and $T$ is strictly upper triangular. Then \[ \|D^2 + T^TD+DT + T^TT \|_2 \le 1 + \varepsilon_{\h}. \] Because the matrix on the left is symmetric, this implies \[ \lambda_{\max}( D^2 + T^TD +DT + T^TT) \le 1 + \varepsilon_{\h} \ \Rightarrow\ \lambda_{\max}( T^TD +DT + T^TT) \le 1 -\delta^2 + \varepsilon_{\h}. \] On the other hand, \[ \lambda_{\min}( T^TD +DT + T^TT) \ge \lambda_{\min}( T^TD +DT) \ge -(r-1) \lambda_{\max} ( T^TD +DT ) \ge - (r-1)(1 -\delta^2 + \varepsilon_{\h}), \] where the second inequality uses that the trace of $T^TD +DT$ is zero and hence its eigenvalues sum up to zero. In summary, \[ \|T^TD +DT + T^TT\|_2 \le (r-1)(1 -\delta^2 + \varepsilon_{\h}), \] and $\Pi_{<\mu}(C, C) = D^2 + \tilde E$ with $\|\tilde E\|_2 \le (r-1)(1 -\delta^2) + r\varepsilon_{\h}$. This completes the proof because \begin{eqnarray*} \|\Pi_{<\mu}(C, C)^{-1}\|_2 &\le& \|D^{-2}\|_2 \|( I + D^{-2} \tilde E)^{-1}\|_2 \le \frac{1}{\delta^2 - (r-1)(1 -\delta^2) - r\varepsilon_{\h}} \\ &=& \frac{1}{r}\frac{1}{\delta^2 - 1 + 1/r - \varepsilon_{\h}}, \end{eqnarray*} where the inverse exists under the conditions of the lemma. \end{proof} The following theorem shows that the columns $\Pi_{<\mu}(:, C)$ selected by Algorithm~\ref{alg:cholp_col_sel} have an excellent condition number if $\delta$ is sufficiently close to one and the perturbations introduced by the HODLR arithmetic remain small. \begin{theorem} \label{thm:cond_chol} Let $C$ denote the set of $r$ indices returned by Algorithm~\ref{alg:cholp_col_sel} and suppose that the conditions~\eqref{eq:error_idempotent} and~\eqref{eq:error_chol} as well as the condition of Lemma~\ref{lemma:invR} are satisfied. Then it holds for the $2$-norm condition number of $\Pi_{<\mu}(:, C)$ that \begin{equation*} \kappa(\Pi_{<\mu}(:, C)) \leq \frac1r \frac{1 + \varepsilon_{\h}}{\delta^2 - 1 + 1/r - \varepsilon_{\h}} = 1+2r(1-\delta) + \mathcal O((1-\delta)^2 + \varepsilon_{\h}). \end{equation*} \end{theorem} \begin{proof} By definition, $\kappa(\Pi_{<\mu}(:, C)) = \Vert \Pi_{<\mu}(:, C)\Vert_2 \Vert \Pi_{<\mu}(:, C)^{\dagger}\Vert_2$. From~\eqref{eq:bound_norm_sp} we get \begin{equation} \label{eq:column_norm} \Vert \Pi_{<\mu}(:, C)\Vert_2 \leq \Vert \Pi_{\mu} \Vert_2 \leq 1+ \Vert F\Vert_2. \end{equation} To bound the second factor, we note that $ \Vert \Pi_{<\mu}(:, C)^{\dagger} \Vert_2 \le \Vert \Pi_{<\mu}(C, C)^{-1} \Vert_2$ and apply Lemma~\ref{lemma:invR}. Using the two bounds, the statement follows. \end{proof} The condition of Lemma~\ref{lemma:invR}, $1-\delta^2 \lesssim 1/r$, requires $\delta$ to be very close to $1$. We conjecture that this condition can be improved to a distance that is proportional to $1/\log_2 r$ or even a constant independent of $r$. The latter is what we observe in the numerical experiments; choosing $\delta$ constant and letting $r$ grow does not lead to a deterioration of the condition number. \subsection{Range correction} As earlier, let $C$ denote a set of indices obtained by Algorithm~\ref{alg:cholp_col_sel} for a threshold $\delta$, and $r = \vert C\vert$. We recall that the dimension of the column space of $\Pi_{<\mu}$ can be easily computed knowing that $\trace(\Pi_{<\mu}) = \rank(\Pi_{<\mu}) = \nu$. If $r = \nu$, then it only remains to perform the orthogonalization to get an orthonormal basis of $\range(\Pi_{<\mu})$. However, depending on the choice of $\delta$, in practice it can occur that the cardinality of $C$ is smaller than $\nu$, which implies that the selected columns cannot span the column space of $\Pi_{<\mu}$. In this case additional vectors need to be computed to get a complete orthonormal basis for $\range(\Pi_{<\mu})$. An orthonormal basis for $\range(\Pi_{<\mu}(:, C))$ in the HODLR format can be computed using a method suggested in~\cite{Lintner2002}, and it is given as \begin{equation} \label{eq:onb_delta} \Pi_{<\mu}(:, C)*_{\h} \tilde{R}^{-1}. \end{equation} The biggest disadvantage of the method in~\cite{Lintner2002} is the loss the orthogonality in badly conditioned problems, caused by squaring of the condition number when computing $\tilde{R}$. However, choosing only well-conditioned subset of columns of $\Pi_{<\mu}$ allows us to avoid dealing with badly conditioned problems, and thus prevents potential loss of orthogonality in~\eqref{eq:onb_delta}. In case $r < \nu$, we complete the basis~\eqref{eq:onb_delta} to an orthonormal basis for $\range(\Pi_{<\mu})$, by computing an orthonormal basis of the orthogonal complement of $\range(\Pi_{<\mu}(:, C))$ in $\range(\Pi_{<\mu})$. First we detect the orthogonal complement of $\range(\Pi_{<\mu}(:, C))$ in $\range(\Pi_{<\mu})$. \begin{lemma} \label{thm:orth_complement_cdelta} If $(\range (\Pi_{<\mu}(:, C)))^{\bot}$ is the orthogonal complement of $\range (\Pi_{<\mu}(:, C))$, then \begin{equation*} \label{eq:complement_delta} R^{\bot}_{\Pi_{<\mu}, C} : = (\range (\Pi_{<\mu}(:, C)))^{\bot}\cap \range(\Pi_{<\mu}) \end{equation*} is the orthogonal complement of $\range (\Pi_{<\mu}(:, C))$ in the vector space $\range(\Pi_{<\mu})$. Moreover, $\dim(R^{\bot}_{\Pi_{<\mu}, C}) = \rank(\Pi_{<\mu}) - r$. \end{lemma} \begin{proof} The statements follow directly from the definition of $R^{\bot}_{\Pi_{<\mu}, C}$. \end{proof} Using~\eqref{eq:onb_delta} we construct an orthogonal projector \begin{equation} \label{eq:orth_projection_compl} P_{C^{\bot}} = I - \Pi_{<\mu}(:, C)*_{\h} \tilde{R}^{-1}*_{\h}(\Pi_{<\mu}(:, C)*_{\h} \tilde{R}^{-1})^T \end{equation} onto $(\range (\Pi_{<\mu}(:, C)))^{\bot}$. From~\eqref{eq:onb_delta} it steadily follows that $\range (P_{C^{\bot}} \Pi_{<\mu}) = R^{\bot}_{\Pi_{<\mu}, C}$. Thus computing an orthonormal basis for $P_{C^{\bot}} \Pi_{<\mu}$ will allow us to obtain a complete orthonormal basis for $\range(\Pi_{<\mu})$. To this end, we employ a randomized algorithm~\cite{HalkoMartinsson2011} to compute an orthonormal basis of dimension $ \nu - r$ for $\range(P_{C^{\bot}} \Pi_{<\mu})$: (1) we first multiply $P_{C^{\bot}} \Pi_{<\mu}$ with a random matrix $X\in {\mathbb R}^{n\times (\nu - r +p)}$, where $p$ is an oversampling parameter; (2) we compute its QR decomposition. As singular values of $\Pi_{<\mu}$ are either unity or zero, multiplication with the orthogonal projector $P_{C^{\bot}}$, generated by the linearly independent columns $C$, gives a matrix whose singular values are well-separated as well. In particular, the resulting matrix has $\nu - r$ singular values equal to $1$, and the others equal to zero. Indeed, in exact arithmetics $P_{C^{\bot}} \Pi_{<\mu}$ has the exact rank $\nu - r$, and then oversampling is not required~\cite{HalkoMartinsson2011}. However, due to the formatted arithmetics, we use a small oversampling parameter $p$ to improve accuracy. As we require only $ \nu -r$ columns to complete the basis for $\range(\Pi_{<\mu})$, finally we keep only the first $\nu - r$ columns of the orthonormal factor. A pseudo-code for computing a complete orthonormal basis for $\range(\Pi_{<\mu})$ is given in Algorithm~\ref{alg:basis_complete}. Note that $\Pi_{<\mu}(:, C)$ is a rectangular HODLR matrix, obtained by extracting columns with indices $C$ of a HODLR matrix, as explained in section~\ref{sec:hodlr}. This implies that the complexity of operations stated in Table~\ref{table:complexity_HODLR} carries over for the operations involving HODLR matrices in Algorithm~\ref{alg:basis_complete}. The complexity of the algorithm also depends on the number of the missing basis vectors. However, in our experiments we observe that $\nu - r$ is very small with respect to $\nu$ and $n$ for choice of $\delta$ we use, which makes the cost of operations in Line~\ref{basis_comp_project} and Line~\ref{qr_correct} negligible. In the setup when $\nu\approx n/2$, the overall complexity of Algorithm~\ref{alg:basis_complete} is governed by solving a triangular system in Line~\ref{orth_updated} or Line~\ref{orth}, i.e. it is ${\mathcal O}(k^2 n\log^2n)$. \begin{algorithm}[ht!] \caption{Computation of a complete orthonormal basis for $\range(\Pi_{<\mu})$} \label{alg:basis_complete} \textbf{Input:} Spectral projector $\Pi_{<\mu}\in {\mathbb R}^{n\times n}$ in the HODLR format with $\rank(\Pi_{<\mu}) = \nu$, column indices $C$ and the Cholesky factor $\tilde R$ returned by Algorithm~\ref{alg:cholp_col_sel}, an oversampling parameter $p$. \\ \textbf{Output:} Orthonormal matrix $Q_{<\mu}\in {\mathbb R}^{n\times \nu}$ such that $\range(Q_{<\mu}) = \range(\Pi_{<\mu})$. \begin{algorithmic}[1] \If{$\vert C\vert < \nu$} \State Generate a random matrix $X \in {\mathbb R}^{n\times (\nu - r +p)}$, for $r = \vert C\vert$. \State $ Z = \Pi_{<\mu} X - \Pi_{<\mu}(:, C)(\tilde{R}^{-1}(\tilde{R}^{-T}(\Pi_{<\mu}(C,:)(\Pi_{<\mu}X))))$. \label{basis_comp_project} \State Compute $[Q_c, \sim,\sim] = {\tt qr}(Z,0)$. \label{qr_correct} \State Return $Q_{<\mu} = [\Pi_{<\mu}(:, C)*_{\h}\tilde{R}^{-1}\quad Q_c(:, 1:\nu - r)]$. \label{orth_updated} \Else \State Return $Q_{<\mu} = [\Pi_{<\mu}(:, C)*_{\h}\tilde{R}^{-1}]$. \label{orth} \EndIf \end{algorithmic} \end{algorithm} \subsubsection{Storing additional columns} When range correction is performed, we additionally need to store tall-and-skinny matrix $Q_c$ from Algorithm~\ref{alg:basis_complete}. The idea is to incorporate columns of $Q_c$ into an existing HODLR matrix $\Pi_{<\mu}(:, C)*_{\h}\tilde{R}^{-1}$ of size $n\times r$ to get a HODLR matrix of size $n\times \nu$. More specifically, we append $\nu - r$ columns after the last column of $\Pi_{<\mu}(:, C)*_{\h}\tilde{R}^{-1}$, by enlarging all blocks of $\Pi_{<\mu}(:, C)*_{\h}\tilde{R}^{-1}$ that contain the last column. Recompression is performed when updating the off-diagonal blocks. It is expected that the off-diagonal ranks in the updated blocks grow, however, numerical experiments in section~\ref{sec:experiments} demonstrate that the increase is not significant. \section{Conclusion} \label{sec:conclusion} In this work we have proposed a new fast spectral divide-and-conquer algorithm for computing the complete spectral decomposition of symmetric banded matrices. The algorithm exploits the fact that spectral projectors of banded matrices can be efficiently computed and stored in the HODLR format. We have presented a fast novel method for selecting well-conditioned columns of a spectral projector based on a Cholesky decomposition with pivoting, and provided a theoretical justification for the method. This method enables us to efficiently split the computation of the spectral decomposition of a symmetric HODLR matrix into two smaller subproblems. The new spectral D\&C method is implemented in the HODLR format and has a linear-polylogarithmic complexity. In the numerical experiments, performed both on synthetic matrices and matrices coming from applications, we have verified the efficiency of our method, and have shown that it is a competitive alternative to the state-of-the-art methods for some classes of banded matrices. \section{Introduction} \label{sec:introduction} Given a large symmetric banded matrix $A\in \mathbb{R}^{n\times n}$, we consider the computation of its \textit{complete} spectral decomposition \begin{equation} \label{eq:sp_decomposition} A = Q\Lambda Q^T,\quad \Lambda = \diag(\lambda_1,\lambda_2,\ldots, \lambda_n), \end{equation} where $\lambda_i, i = 1,\ldots,n$ are the eigenvalues of $A$ and the columns of the orthogonal matrix $Q\in {\mathbb R}^{n\times n}$ the corresponding eigenvectors. This problem has attracted quite some attention from the early days of numerical linear algebra until today, particularly when $A$ is a a tridiagonal matrix. A number of applications give rise to banded eigenvalue problems. For example, they constitute a critical step in solvers for \emph{general} dense symmetric eigenvalue problems. Nearly all existing approaches, with the notable exception of~\cite{NakaHigh2013}, first reduce a given dense symmetric matrix to tridiagonal form. This is followed by a method for determining the spectral decomposition of a tridiagonal matrix, such as the QR algorithm, the classical divide-and-conquer (D\&C) method or the algorithm of multiple relatively robust representations (MRRR). All these methods have complexity ${\mathcal O}(n^2)$ or higher; simply because all $n$ eigenvectors are computed and stored explicitly. On a modern computing architecture with a memory hierarchy, it turns out to be advantageous to perform the tridiagonalization based on successive band reduction~\cite{BiscLangSun2000}, with a symmetric banded matrix as an intermediate step~\cite{AuckBlumBungHuck2011,BienIgualKressPet2011,HaidLtaiDong2011,HaidSolcGates2013,SoloBallDemmHoef016}. In this context, it would be preferable to design an eigenvalue solver that works directly with banded matrices, therefore avoiding the reduction from banded to tridiagonal form. Such a possibility has been explored for classical D\&C in~\cite{Arbenz1992,HaidLtaiDong2012}. However, the proposed methods seem to suffer from numerical instability or an unsatisfactory complexity growth as the bandwidth increases. In this paper we propose a new and fast approach to computing the spectral decomposition of a symmetric banded matrix. This is based on the spectral D\&C method from~\cite{NakaHigh2013}, which recursively splits the spectrum using invariant subspaces extracted from spectral projectors associated with roughly half of the spectrum. In previous work~\cite{KressnerSus2017}, we have developed a fast method for approximating such spectral projectors in a hierarchical low-rank format, the so called HODLR (hierarchically off-diagonal low-rank) format~\cite{Ambikasaran2013}. However, the extraction of the invariant subspace, requires to determine a basis for the range of the spectral projector. This represents a major challenge. We present an efficient algorithm for computing an orthonormal basis of an invariant subspace in the HODLR format, which heavily exploits properties of spectral projectors. The matrix of eigenvectors is stored implicitly, via orthonormal factors, where each factor is an orthonormal basis for an invariant subspace. Our approach extends to general symmetric HODLR matrices. Several existing approaches that use hierarchical low-rank formats for the fast solution of eigenvalue problems are based on computing (inexact) LDL$^{T}$ decompositions in such a format, see~\cite[sec. 13.5]{Hackbusch2015} for an overview. These decompositions allow to slice the spectrum of a symmetric matrix into smaller chunks and are particularly well suited when only the eigenvalues and a few eigenvectors are needed. To the best our knowledge, the only existing fast methods suitable for the complete spectral decomposition of a large symmetric matrix are based on variations the classical D\&C method by Cuppen for a symmetric tridiagonal matrix~\cite{Cuppen1980/81}. One recursion of the method divides, after a rank-one perturbation, the matrix into a $2\times 2$ block diagonal matrix. In the conquer phase the rank-one perturbation is incorporated by solving a secular equation for the eigenvalues and applying a Cauchy-like matrix to the matrix of eigenvectors. Gu and Eisenstat~\cite{Gu1995} not only stabilized Cuppen's method but also observed that the use of the fast multipole method for the Cauchy-like matrix multiplication reduced its complexity to ${\mathcal O}(n^2)$ for computing all eigenvectors. Vogel et al.~\cite{VogelXiaCauBal2016} extended these ideas beyond tridiagonal matrices, to general symmetric HSS (hierarchically semiseparable) matrices. Moreover, by representing the matrix of eigenvectors in factored form, the overall cost reduces to ${\mathcal O}(n \log^2 n)$. While our work bears similarities with~\cite{VogelXiaCauBal2016}, such as the storage of eigenvectors in factored form, it differs in several key aspects. First, our developments use the HODLR format while~\cite{VogelXiaCauBal2016} uses the HSS format. The later format stores the low-rank factors of off-diagonal blocks in a nested manner and thus reduces the memory requirements by a factor $\log n$ \emph{if} the involved ranks stay on the same level. However, one may need to work with rather large values of $n$ in order to gain significant computational savings from working with HSS instead of HODLR. A second major difference is that the spectral D\&C method used in this paper has, despite the similarity in name, little in common with Cuppen's D\&C. One advantage of using spectral D\&C is that it conveniently allows to compute only parts of the spectrum. A third major difference is that~\cite{VogelXiaCauBal2016} incorporates a perturbation of rank $r>1$, as it is needed to process matrices of bandwidth larger than one by sequentially splitting it up into $r$ rank-one perturbations. The method presented in this paper processes higher ranks directly, avoiding the need for splitting and leveraging the performance of level 3 BLAS operations. While the timings reported in~\cite{VogelXiaCauBal2016} cover matrices of size up to $10\,240$ and appear to be comparable with the timings presented in this paper, our experiments additionally demonstrate that our newly proposed method allows for conveniently dealing with large-scale matrices. The rest of the paper is organized as follows. In section~\ref{sec:dc_sp}, we recall the spectral divide-and-conquer algorithm for computing the spectral decomposition of a symmetric matrix. Section~\ref{sec:hodlr} gives a brief overview of the HODLR format and of a fast method for computing spectral projectors of HODLR matrices. In section~\ref{sec:invariant_subspace} we discuss the fast extraction of invariant subspaces from a spectral projector given in the HODLR format. Section~\ref{sec:dc_hodlr} presents the overall spectral D\&C algorithm in the HODLR format for computing the spectral decomposition of a banded matrix. Numerical experiments are presented in section~\ref{sec:experiments}. \section{Numerical experiments} \label{sec:experiments} In this section, we show the performance of our {\sc Matlab}{} implementation of the spectral divide-and-conquer method in the HODLR format for various matrices. All computations were performed in {\sc Matlab}{} version R2016b on a machine with the dual Intel Core i7-5600U 2.60GHz CPU, $256$ KByte of level 2 cache and $12$ GByte of RAM. In order to draw a fair comparison with respect to highly optimized {\sc Matlab}{} built-in functions, all experiments were carried out on a single core. The memory requirements shown in Example~\ref{ex:scalability} are obtained experimentally, using {\sc Matlab}{} built-in functions. In all experiments, we set the truncation tolerance to $\epsilon = 10^{-10}$, the minimal block-size $n_{\min} = 250$ for tridiagonal matrices and $n_{\min} = 500$ for $b$-banded matrices with $b>1$. Moreover, the stopping tolerance in the {\tt hDWH} algorithm is set to $\varepsilon = 10^{-15}$. In Algorithm~\ref{alg:basis_complete} we use the oversampling parameter $p = 10$. We use breakeven points in~\cite{KressnerSus2017} to set the termination criterion in Algorithm~\ref{alg:hsdc}. For tridiagonal matrices we use $n_{\stp} = 3250$, for $2$-banded matrices $n_{\stp}= 1750$ and $n_{\stp} = 2500$ for $b$-banded with $b > 2$. The efficiency of our algorithm is tested on a set of matrices coming from applications, as well as on various synthetic matrices. \subsection{Generation of test matrices} \label{sec:matrix_gen} To generate synthetic matrices, we employ the procedure explained in~\cite[section $6$]{KressnerSus2017} that uses a sequence of Givens rotations to obtain a symmetric banded matrix with a prescribed bandwidth and spectrum, starting from a diagonal matrix containing $n$ eigenvalues. As the accuracy of computed spectral projectors depends on the relative spectral gap, we generate matrices such that $\gap$ is constant whenever the spectrum is split in half. We generate such a spectrum by first dividing the interval $[-1,1]$ into $[-1,-\gap]\cup [\gap, 1]$ and then recursively applying the same procedure to both subintervals. In particular, interval $[c,d]$ is split into $[c, \frac{c+d}{2} - \frac{d-c}{2}\gap]\cup [\frac{c+d}{2}+\frac{d-c}{2}\gap,d]$. The recursive division stops when the number of subintervals is $\leq n/n_{\stp}$. To each subinterval we assign equal number of eigenvalues coming from a uniform distribution. We observed similar results for eigenvalues coming from a geometric distribution, but we omit them to avoid redundancy. \begin{example}[\bfseries{Percentage and conditioning of selected columns}] \label{ex:percentage_cond_sel_col} \rm We first investigate the percentage of selected columns throughout Algorithm~\ref{alg:hsdc} depending on a given threshold $\delta$, together with the condition number of the selected columns. We show results for matrices of size $n = 10240$, with bandwidths $b=1$ and $b=8$, and spectral gaps $\gap = 10^{-2}$ and $\gap = 10^{-6}$, generated as described above. In this example we ensure that in all divide steps of Algorithm~\ref{alg:hsdc} the gap between separated parts of the spectrum corresponds to $\gap$, by computing the shift $\mu$ as the median of eigenvalues of a considered matrix. In each divide step in Algorithm~\ref{alg:hsdc} we compute the percentage of selected columns, and finally we show their average for each $\delta$. Moreover, we present a maximal condition number of the selected columns in the whole divide-and-conquer process for a given $\delta$. As expected, smaller values of $\delta$ lead to a higher percentage of selected columns, but this leads to a higher condition number as well. Figure~\ref{fig:tridiag_perc_cond} and Figure~\ref{fig:band_8_perc_cond} show that already for $\delta \geq 0.4$ we get a good trade-off between the percentage of selected columns and the condition number. This also implies that the off-diagonal ranks in the eigenvectors matrix remain low. \begin{figure}[tbhp] \begin{center} \includegraphics[width=0.45\textwidth]{figures/barplot_tridiag_1e-2} \includegraphics[width=0.45\textwidth]{figures/barplot_tridiag_1e-6} \end{center} \caption{Example~\ref{ex:percentage_cond_sel_col}. Percentage of selected columns and their condition number for a tridiagonal matrix with eigenvalues in $[-1,1]$ with relative spectral gap $\gap = 10^{-2}$ (left) and $\gap = 10^{-6}$ (right).} \label{fig:tridiag_perc_cond} \end{figure} \begin{figure}[tbhp] \begin{center} \includegraphics[width=0.45\textwidth]{figures/barplot_band8_1e-2} \includegraphics[width=0.45\textwidth]{figures/barplot_band8_1e-6} \end{center} \caption{Example~\ref{ex:percentage_cond_sel_col}. Percentage of selected columns and their condition number for a $8$-banded matrix with eigenvalues in $[-1,1]$ with relative spectral gap $\gap = 10^{-2}$ (left) and $\gap = 10^{-6}$ (right).} \label{fig:band_8_perc_cond} \end{figure} \end{example} \begin{example}[\bfseries{Breakeven point relative to {\tt eig}}] \label{ex:breakeven_point} \rm Our runtime comparisons are performed on generated $n\times n$ banded matrices. We examine for which values of $n$ Algorithm~\ref{alg:hsdc} outperforms {\tt eig}. In Table~\ref{table:break_even_point} we show breakeven points for banded matrices constructed as in section~\ref{sec:matrix_gen}, with $\gap \in \lbrace 10^{-1},10^{-2}, 10^{-3}, 10^{-4}\rbrace$. We use the threshold parameter $\delta = 0.4$. For $b=2$ and $b=4$ banded matrices our algorithm becomes faster than {\tt eig} for relatively small $n$. This is due to the fact that {\sc Matlab}{}'s {\tt eig} first performs tridiagonal reduction. Our results show the benefit of avoiding the reduction of a banded matrix to a tridiagonal form, especially when the bandwidth is small. However, for tridiagonal matrices the breakeven point is relatively high. \begin{table}[ht!] \caption{Breakeven point of hSDC relative to {\tt eig} applied for banded matrices with various bandwidths and spectral gaps.} \label{table:break_even_point} \centering {\renewcommand{\arraystretch}{1} \begin{tabular}{c||c||c||c||c} \backslashbox[5mm]{gap}{b} &$1$ &$2$ &$4$ &$8$ \\ \hline \hline $10^{-1}$ &$n = 10000 $ &$n = 2100$ &$n= 3000$ &$n=5300$ \\ \hline $10^{-2}$ &$n = 14000 $ &$n = 2500$ &$n= 3800$ &$n=7400$ \\ \hline $10^{-3}$ &$n = 16000$ &$n = 2800$ &$n= 4900$ &$n=8000$ \\ \hline $10^{-4}$ &$n = 17000 $ &$n = 3000$ &$n= 5200$ &$n=8600$ \\ \end{tabular} } \end{table} \end{example} \begin{example}[\bfseries{Accuracy for various matrices}] \label{ex:accuracy} \rm In this example, we test the accuracy of the computed spectral decomposition. Denoting with $Q = [q_1, \ldots, q_n]$ and $\Lambda = \diag(\lambda_1, \ldots, \lambda_n)$ the output of Algorithm~\ref{alg:hsdc}, and with $\tilde{Q} = [\tilde{q}_1, \ldots, \tilde{q}_n]$ and $\tilde{\Lambda} = \diag(\tilde{\lambda}_1, \ldots, \tilde{\lambda}_n)$ the eigenvalue decomposition obtained using {\sc Matlab}{}'s {\tt eig}, we consider four different error metrics: \begin{itemize} \item the largest relative error in the computed eigenvalues: $e_{\lambda} = \underset{i}{\max}\hskip 3pt \vert \lambda_i - \tilde{\lambda}_i\vert/\Vert A\Vert_2, $ \item the largest relative residual norm: $e_{\operatorname{res}} = \underset{i}{\max}\hskip 3pt \Vert Aq_i - \lambda_i q_i\Vert_2/\Vert A\Vert_2,$ \item the loss of orthogonality: $ e_{\operatorname{orth}} = \underset{i}{\max} \Vert Q^T q_i - e_i\Vert_2,$ \item the largest error in the computed eigenvectors : $e_{Q} = \underset{i}{\max}\hskip 3pt \vert 1 - \cos \measuredangle (q_i,\tilde{q}_i) \vert$. \end{itemize} In the subsequent experiments we set $\delta = 0.4$. \begin{enumerate} \item First we show the accuracy of the newly proposed algorithm for tridiagonal matrices. For matrices of size smaller than $3250$, we use $n_{\stp} = 500$, which allows us to perform at least one divide step in Algorithm~\ref{alg:hsdc}. We consider some of the matrices suggested in~\cite{MarqVomeDemmParl2009}: \begin{itemize} \item the BCSSTRUC1 set in the Harwell-Boeing Collection~\cite{Davis2007}. Considered problems are in fact generalized eigenvalue problems, with $M$ a mass matrix and $K$ a stiffnes matrix. Each problem is transformed into an equivalent standard eigenvalue problem $L^{-1}KL^{-T}x = \lambda x$, where $L$ denotes the Cholesky factor of $M$. Finally, matrices are reduced to tridiagonal form via {\sc Matlab}{} function {\tt hess}. \item The symmetric Alemdar and Cannizzo matrices, and matrices from the NASA set~\cite{Davis2007}. Considered matrices are reduced to tridiagonal form using {\sc Matlab}{} function {\tt hess}. \item The $(1,2,1)$ symmetric tridiagonal Toeplitz matrix. \item The Legendre-type tridiagonal matrix. \item The Laguerre-type tridiagonal matrix. \item The Hermite-type tridiagonal matrix. \item Symmetric tridiagonal matrices with eigenvalues coming from a random $(0,1)$ distribution and a uniform distribution on $[-1,1]$. \end{itemize} In Table~\ref{table:error_test_matrices} we report the observed accuracies. The results are satisfactory, and the errors are roughly of order of the truncation tolerance $\epsilon = 10^{-10}$. We also mention that the percentage of selected columns, as well as the condition number of selected columns throughout Algorithm~\ref{alg:hsdc} were along the lines the results presented in Example~\ref{ex:percentage_cond_sel_col}. \begin{table}[tbhp] \caption{Accuracy of hSDC for tridiagonal matrices from Example~\ref{ex:accuracy}.} \centering {\renewcommand{\arraystretch}{1} \begin{tabular}{c||c||c|c|c|c|c} &matrix &$n$ &$e_{\lambda}$ &$e_{\operatorname{res}}$ & $e_{\operatorname{orth}}$ &$e_{Q}$ \\ \hline \hline \multirow{3}{*}{\begin{sideways}\tiny{BCSSTRUC1}\end{sideways}} &\text{bcsst08} &$1074$ &$4.4\cdot 10^{-14}$ &$ 2.2\cdot 10^{-12}$ &$5.6\cdot 10^{-10}$ &$ 5.6\cdot 10^{-12}$\\ \cline{2-7} &\text{bcsst09} &$1083$ &$5.2\cdot 10^{-11}$ &$2.3\cdot 10^{-11}$ &$7.8\cdot 10^{-10}$ &$6.3\cdot 10^{-12}$\\ \cline{2-7} &\text{bcsst11} &$1474$ &$1.8\cdot 10^{-11}$ &$1.4\cdot 10^{-10}$ &$2.6\cdot 10^{-9}$ &$7.3\cdot 10^{-11}$\\ \cline{2-7} \hline \hline \multirow{4}{*}{\begin{sideways}\tiny{NASA}\end{sideways}} &\text{nasa1824} &$1824$ &$3.2\cdot 10^{-12}$ &$ 6.8\cdot 10^{-9}$ &$2.5\cdot 10^{-9}$ &$ 1.5\cdot 10^{-10}$\\ \cline{2-7} &\text{nasa2146} &$2146$ &$1.5\cdot 10^{-10}$ &$2.9\cdot 10^{-9}$ &$1.8\cdot 10^{-9}$ &$7.1\cdot 10^{-11}$\\ \cline{2-7} &\text{nasa2190} &$2190$ &$1.5\cdot 10^{-12}$ &$2.1\cdot 10^{-12}$ &$6.7\cdot 10^{-10}$ &$4.1\cdot 10^{-11}$\\ \cline{2-7} &\text{nasa4704} &$4704$ &$8.9\cdot 10^{-12}$ &$2.9\cdot 10^{-10}$ &$9.8\cdot 10^{-9}$ &$ 5.3\cdot 10^{-10}$\\ \hline \hline &\text{Cannizzo matrix} &$4098$ &$ 3.4\cdot 10^{-11}$ &$ 8.3\cdot 10^{-10}$ &$1.5\cdot 10^{-9}$ &$2.6\cdot 10^{-10}$\\ \cline{2-7} &\text{Alemdar matrix} &$6245$ &$1.25\cdot 10^{-9}$ &$7.4\cdot 10^{-8} $ &$2.5\cdot 10^{-9}$ &$ 2.8\cdot 10^{-10}$\\ \hline \hline &\text{(1,2,1) matrix} &$10000$ &$ 2.4\cdot 10^{-10}$ &$1.6\cdot 10^{-9}$ &$2.5\cdot 10^{-11} $ &$1.3\cdot 10^{-11}$ \\ \cline{2-7} \cline{2-7} &\text{Clement-type} &$10000$ &$1.75\cdot 10^{-10}$ &$2.3\cdot 10^{-9}$ &$2.6\cdot 10^{-9}$ &$1.4\cdot 10^{-10}$\\ \hline \hline &\text{Legendre-type} &$10000$ &$2.4\cdot 10^{-11}$ &$2.7\cdot 10^{-10}$ &$9.6\cdot 10^{-11}$ &$2.7\cdot 10^{-11}$\\ \cline{2-7} &\text{Laguerre-type} &$10000$ &$3.4\cdot 10^{-11}$ &$1.9\cdot 10^{-10}$ &$3.7\cdot 10^{-9}$ &$4.3\cdot 10^{-11}$\\ \cline{2-7} &\text{Hermite-type} &$10000$ &$9.8\cdot 10^{-11}$ &$3.1\cdot 10^{-9}$ &$9.3\cdot 10^{-10}$ &$3.2\cdot 10^{-11}$\\ \hline \hline &\text{ Random normal $(0,1)$} &$10000$ &$6.9\cdot10^{-10}$ &$4.5\cdot 10^{-8}$ &$ 7.5\cdot 10^{-9}$ &$1.1\cdot 10^{-10} $ \\ \cline{2-7} &\text{Uniform in $[-1,1]$} &$10000$ &$1.1\cdot 10^{-11}$ &$2.1\cdot 10^{-9}$ &$3.5\cdot 10^{-10}$ &$1.8\cdot 10^{-11}$\\ \hline \end{tabular} } \label{table:error_test_matrices} \end{table} \item Now we examine the dependency of the error measures on the decreasing spectral gap. We construct $8$-banded matrices of size $n = 10240$ with $\gap = 10^{-i}, i = 1,\ldots, 10$ using a method from section~\ref{sec:matrix_gen}. As in Example~\ref{ex:percentage_cond_sel_col}, we ensure that the gap between two separated parts of spectrum in all divide steps of Algorithm~\ref{alg:hsdc} is the prescribed $\gap$. Figure~\ref{fig:error_vs_gap_tridiag} shows that our algorithm preforms well for matrices with larger spectral gaps, and confirms the expected behaviour of errors. The error growth is a result of the decreasing accuracy when computing spectral projectors associated with decreasing spectral gaps. For gaps of order $\leq 10^{-9}$ the algorithm breaks down due to indefinitness of a matrix in Line~\ref{alg_chol1} of Algorithm~\ref{alg:hdwh}. \begin{figure}[tbhp] \begin{center} \includegraphics[width=0.45\textwidth]{figures/accuracy_vs_gap_band} \end{center} \caption{Example~\ref{ex:accuracy}. Behaviour of the errors with respect to a decreasing spectral gap for banded matrices.} \label{fig:error_vs_gap_tridiag} \end{figure} \end{enumerate} \end{example} \begin{example}[\bfseries{Scalability}] \label{ex:scalability} \rm For $n\times n$ tridiagonal matrices, generated as in section~\ref{sec:matrix_gen} with $\gap = 10^{-2}$, we demonstrate the performance of our algorithm with respect to $n$. Again we use the threshold parameter $\delta = 0.4$. We show that the asymptotic behaviour of our algorithm matches the theoretical bounds both for the computational time and storage requirements. Figure~\ref{fig:scale_tridiag_1e-2} (left) shows that time needed to compute the complete spectral decomposition follows the expected ${\mathcal O}(n\log^3(n))$ reference line, whereas Figure~\ref{fig:scale_tridiag_1e-2} (right) demonstrates that the memory required to store the matrix of eigenvectors is ${\mathcal O}(n\log^2(n))$. \begin{figure}[tbhp] \begin{center} \includegraphics[width=0.45\textwidth]{figures/time_tridiag_1e-2} \includegraphics[width=0.45\textwidth]{figures/storage_tridiag_1e-2} \end{center} \caption{Example~\ref{ex:scalability}. Performance of the hSDC algorithm with respect to $n$ for tridiagonal matrices. Left: Computational time. Right: Memory requirements.} \label{fig:scale_tridiag_1e-2} \end{figure} \end{example} \section{Computation of spectral projectors in HODLR format} \label{sec:hodlr} In this section, we briefly recall the HODLR format and the algorithm from~\cite{KressnerSus2017} for computing spectral projectors in the HODLR format. \subsection{HODLR format} Given an $n\times m$ matrix $M$ let us consider a block matrix partitioning of the form \begin{equation} \label{eq:toplevelpartitioning} M =\left[ \begin{array}{c|c} M^{(1)}_{11} & M^{(1)}_{12} \\ \hline M^{(1)}_{21} & M^{(1)}_{22}\\ \end{array} \right]. \end{equation} This partitioning is applied recursively, $p$ times, to the diagonal blocks $M^{(1)}_{11}$, $M^{(1)}_{22}$, leading to the hierarchical partitioning shown in Figure~\ref{fig:h_hodlr_matrices}. We say that $M$ is a \emph{HODLR matrix} of level $p$ and HODLR rank $k$ if all off-diagonal blocks seen during this process have rank at most $k$. In the HODLR format, these blocks are stored, more efficiently, in terms of their low-rank factors. For example, for $p=2$, the HODLR format takes the form \begin{equation*} \label{eq:toplevelpartitioning2} M = \left[ \begin{array}{c|c} \small \begin{array}{c|c} M^{(2)}_{11} & U_1^{(2)} \big( V_2^{(2)} \big)^T \\ \hline U_2^{(2)} \big( V_1^{(2)} \big)^T & M^{(2)}_{22} \end{array} & U_1^{(1)} \big( V_2^{(1)} \big)^T \\ \hline U_2^{(1)} \big( V_1^{(1)} \big)^T & \small \begin{array}{c|c} M^{(2)}_{33} & U_3^{(2)} \big( V_4^{(2)} \big)^T \\ \hline U_4^{(2)} \big( V_3^{(2)} \big)^T & M^{(2)}_{44} \end{array} \end{array} \right]. \end{equation*} The definition of a HODLR matrix of course depends on how the partitioning~\eqref{eq:toplevelpartitioning} is chosen on each level of the recursion. This choice is completely determined by the integer partitions \begin{equation} \label{eq:integerpart} n = n_1 + n_2 + \cdots n_{2^p}, \qquad m = m_1 + m_2 + \cdots + m_{2^p}, \end{equation} corresponding to the sizes $n_j\times m_j$, $j = 1,\ldots, 2^p$, of the diagonal blocks $M_{11}^{(p)}, \ldots, M_{2^p,2^p}^{(p)}$ on the lowest level of the recursion. Given specific integer partitions~\eqref{eq:integerpart}, we denote the set of HODLR matrices of rank $k$ by $\mathcal{H}_{n\times m}(k)$. \begin{figure}[ht!] \centering \begin{tikzpicture}[scale=0.55] \fill[gray] (2,6)--(3.5,6)--(3.5,4)--(2,4); \fill[gray] (0,9)--(0,6)--(2,6)--(2,9); \fill[gray] (3.5,4)--(5.5,4)--(5.5,2)--(3.5,2); \fill[gray] (5.5,2)--(7,2)--(7,0)--(5.5,0); \draw (0,0) rectangle (7,9); \draw (0,0) rectangle (3.5, 4); \draw (3.5,0) rectangle (7, 4); \draw (0,4) rectangle (3.5, 9); \draw (0,6)--(3.5,6); \draw (2,4)--(2,9); \draw (3.5,2)--(7,2); \draw (5.5,0)--(5.5,4); \end{tikzpicture} \quad \begin{tikzpicture}[scale=0.55] \fill[gray] (0,9)--(1,9)--(1,7)--(0,7); \fill[gray] (1,7)--(2,7)--(2,6)--(1,6); \fill[gray] (2,6)--(3,6)--(3,5)--(2,5); \fill[gray] (3,5)--(3.5,5)--(3.5,4)--(3,4); \fill[gray] (3.5,4)--(4.5,4)--(4.5,3)--(3.5,3); \fill[gray] (4.5,3)--(5.5,3)--(5.5,2)--(4.5,2); \fill[gray] (5.5,0.75)--(6.5,0.75)--(6.5,2)--(5.5,2); \fill[gray] (6.5,0.75)--(7,0.75)--(7,0)--(6.5,0); \draw (0,0) rectangle (7,9); \draw (0,0) rectangle (3.5, 4); \draw (3.5,0) rectangle (7, 4); \draw (0,4) rectangle (3.5, 9); \draw (0,6)--(3.5,6); \draw (2,4)--(2,9); \draw (3.5,2)--(7,2); \draw (5.5,0)--(5.5,4); \draw (0,7)--(2,7); \draw (1,6)--(1,9); \draw (3,4)--(3,6); \draw (2,5)--(3.5,5); \draw (3.5,3)--(5.5,3); \draw (4.5,2)--(4.5,4); \draw (5.5,0.75)--(7,0.75); \draw (6.5,0)--(6.5,2); \end{tikzpicture} \quad \begin{tikzpicture}[scale=0.55] \draw (0,0) rectangle (7,9); \draw (0,0) rectangle (3.5, 4); \draw (3.5,0) rectangle (7, 4); \draw (0,4) rectangle (3.5, 9); \draw (0,6)--(3.5,6); \draw (2,4)--(2,9); \draw (3.5,2)--(7,2); \draw (5.5,0)--(5.5,4); \draw (0,7)--(2,7); \draw (1,6)--(1,9); \draw (3,4)--(3,6); \draw (2,5)--(3.5,5); \draw (3.5,3)--(5.5,3); \draw (4.5,2)--(4.5,4); \draw (5.5,0.75)--(7,0.75); \draw (6.5,0)--(6.5,2); \draw (0,7.5)--(1,7.5); \draw (0.5,7)--(0.5,9); \draw (1,6.5)--(2,6.5); \draw (1.5,6)--(1.5,7); \draw (2,5.5)--(3,5.5); \draw(2.5,5)--(2.5,6); \draw (3,4.5)--(3.5,4.5); \draw (3.25,4)--(3.25,5); \draw (3.5,3.5)--(4.5,3.5); \draw (4,3)--(4,4); \draw (4.5,2.5)--(5.5,2.5); \draw (5,2)--(5,3); \draw (6.75,0)--(6.75,0.75); \draw (6.5,0.25)--(7,0.25); \draw (5.5,1.25)--(6.5,1.25); \draw (6.15,0.75)--(6.15,2); \fill[gray] (0.5,7)--(1,7)--(1,7.5)--(0.5,7.5); \fill[gray] (0,9)--(0,7.5)--(0.5,7.5)--(0.5,9); \fill[gray] (1.5,6)--(2,6)--(2,6.5)--(1.5,6.5); \fill[gray] (1,7)--(1,6.5)--(1.5,6.5)--(1.5,7); \fill[gray] (2.5,5)--(3,5)--(3,5.5)--(2.5,5.5); \fill[gray] (2,6)--(2,5.5)--(2.5,5.5)--(2.5,6); \fill[gray] (3.25,4)--(3.5,4)--(3.5,4.5)--(3.25,4.5); \fill[gray] (3,5)--(3,4.5)--(3.25,4.5)--(3.25,5); \fill[gray] (4,3)--(4.5,3)--(4.5,3.5)--(4,3.5); \fill[gray] (3.5,4)--(3.5,3.5)--(4,3.5)--(4,4); \fill[gray] (5,2)--(5.5,2)--(5.5,2.5)--(5,2.5); \fill[gray] (4.5,3)--(4.5,2.5)--(5,2.5)--(5,3); \fill[gray] (6.15,1.25)--(6.5,1.25)--(6.5,0.75)--(6.15,0.75); \fill[gray] (5.5,2)--(5.5,1.25)--(6.15,1.25)--(6.15,2); \fill[gray] (6.75,0)--(7,0)--(7,0.25)--(6.75,0.25); \fill[gray] (6.5,0.75)--(6.5,0.25)--(6.75,0.25)--(6.75,0.75); \end{tikzpicture} \caption{Illustration of HODLR matrices for $p=2$, $p=3$, and $p=4$. The diagonal blocks (grey) are stored as dense matrices, while the off-diagonal blocks (white) are stored in terms of their low-rank factors. } \label{fig:h_hodlr_matrices} \end{figure} \subsection{Operations in the HODLR format} \label{sec:hodlr_arithmetics} Assuming that the integer partitions~\eqref{eq:integerpart} are balanced, $p ={\mathcal O}(\log \tilde n)$ with $\tilde n = \max\{n,m\}$, and $k = {\mathcal O}(1)$, the storage of $M \in \mathcal H_{n\times m}(k)$ in the HODLR format requires $\mathcal O( \tilde n \log \tilde n)$ memory. Various matrix operations with HOLDR matrices can be preformed with linear-polylogarithmic complexity. Table~\ref{table:complexity_HODLR} summarizes the operations needed in this work; we refer to, e.g.,~\cite{Ballani2016,Hackbusch2015} for more details. In order to perform operations including two HODLR matrices, the corresponding partitions ought to be compatible. The operations listed in Table~\ref{table:complexity_HODLR} with subscript $\h$ employ recompression in order to limit the increase of off-diagonal ranks. In this paper recompression is done adaptively, such that the $2$-norm approximation error in each off-diagonal block is bounded by a prescribed truncation tolerance $\epsilon$. For matrix addition, recompression is done only after adding two off-diagonal blocks, whereas multiplying HOLDR matrices and computing the Cholesky decomposition requires recompression in intermediate steps. \begin{table}[ht!] \caption{Complexity of operations involving HODLR matrices: $M\in \mathcal H_{n\times n}(k)$ symmetric positive definite, $T\in \h_{m\times m}(k)$ triangular and invertible, $M_1,M_2 \in \mathcal H_{n\times m}(k)$, $M_3\in \h_{m\times p}(k)$, $B\in {\mathbb R}^{m\times p}$, $v\in {\mathbb R}^m$.} \label{table:complexity_HODLR} \centering \begin{tabular}{rcl} \hline Operation & &Computational complexity \\ \hline Matrix-vector multiplication: $M_1 v$ & & $\mathcal{O}(k\tilde{n}\log \tilde{n})$, with $\tilde{n} = \max\lbrace n,m \rbrace$ \\ Matrix addition: $M_1 +_{\mathcal{H}} M_2$ & & $\mathcal{O}(k^2\tilde{n}\log \tilde{n})$, with $\tilde{n} = \max\lbrace n,m \rbrace$ \\ Matrix-matrix multiplication: $M_2 *_{\mathcal{H}} M_3$ & & $\mathcal{O}(k^2\tilde{m}\log^2 \tilde{m})$, with $\tilde{m} = \max\lbrace n,m,p \rbrace$ \\ Cholesky decomposition: $\h\operatorname{-Cholesky}(M)$ & & $\mathcal{O}(k^2 n\log^2 n)$ \\ Solution of triangular system: $T^{-1} B$ & &$\mathcal{O}(k m\log m)$ \\ Multiplication with $(\text{triangular})^{-1}$: $M_1 *_{\mathcal{H}} T^{-1}$ & & $\mathcal{O}(k^2\tilde{n}\log^2 \tilde{n})$, with $\tilde{n} = \max\lbrace n,m \rbrace$ \\ \hline \end{tabular} \end{table} In this work we also need to extract submatrices of HODLR matrices. Let $M\in \mathcal H_{n\times n}(k)$, associated with an integer partition $n = n_1 + \cdots + n_{2^p}$, and consider a subset of indices $C \subset \{1,\ldots,n\}$. Then the submatrix $M(C,C)$ is again a HODLR matrix. To see this, consider the partitioning~\eqref{eq:toplevelpartitioning} and let $C = C_1 \cup C_2$ with $C_1 = C \cap [1, n_1^{(1)}]$ and $C_2 = C \cap [n_1^{(1)}+1, n]$, where $n^{(1)}_1$ is the size of $M^{(1)}_{11}$. Then \begin{eqnarray*} M(C,C) &=& \left[ \begin{array}{c|c} M^{(1)}_{11}(C_1,C_1) & M^{(1)}_{12}(C_1,C_2) \\ \hline M^{(1)}_{21}(C_2,C_1) & M^{(1)}_{22}(C_2,C_2) \\ \end{array} \right] \\ &=& \left[ \begin{array}{c|c} M^{(1)}_{11}(C_1,C_1) & U_1^{(2)}(C_1,:) \big( V_2^{(2)}(C_2,:) \big)^T \\ \hline U_2^{(2)}(C_2,:) \big( V_1^{(2)}(C_1,:) \big)^T & M^{(1)}_{22}(C_2,C_2) \\ \end{array} \right]. \end{eqnarray*} Hence, the off-diagonal blocks again have rank at most $k$. Applying this argument recursively to $M^{(1)}_{11}(C_1,C_1)$, $M^{(1)}_{22}(C_2,C_2)$ establishes $M(C,C) \in \mathcal H_{m\times m}(k)$, associated with the integer partition \[ |C| =: m = m_1 + m_2 + \cdots m_{2^p}, \] where $m_1$ is the cardinality of $C \cap [1,n_1]$, $m_2$ is the cardinality of $C \cap [n_1+1,n_1+n_2]$, and so on. Note that it may happen that some $m_j = 0$, in which case the corresponding blocks in the HODLR format vanish. Formally, this poses no problem in the definition and operations with HOLDR matrices. In practice, these blocks are removed to reduce overhead. \subsection{Computation of spectral projectors in the HODLR format} The method presented in~\cite{KressnerSus2017} for computing spectral projectors of banded matrices is based on the dynamically weighted Halley iteration from~\cite{NakaBaiGygi2010, NakaHigh2013} for computing the matrix sign function. In this work, we also need a slight variation of that method for dealing with HODLR matrices. Given a symmetric non-singular matrix $A$, the method from~\cite{NakaBaiGygi2010} uses an iteration \begin{equation} \label{eq:dwh_iteration} X_{k+1} = \frac{b_k}{c_k}X_k + \Big( a_k - \frac{b_k}{c_k}\Big)X_k(I+c_k X^T_k X_k)^{-1}, \quad X_0 = A/\alpha, \end{equation} that converges globally cubically to $\sign(A)$. The parameter $\alpha > 0 $ is such that $\alpha\gtrsim \Vert A \Vert_2$. The parameters $a_k, b_k, c_k$ are computed by \begin{equation} \label{eq:qdwh_parameters_abc} a_k = h(l_k),\quad b_k = (a_k-1)^2/4, \quad c_k = a_k + b_k - 1, \end{equation} where $l_k$ is determined by the recurrence \begin{equation} \label{eq:qdwh_parameter_l} l_k = l_{k-1}(a_{k-1} + b_{k-1}l^{2}_{k-1})/(1 + c_{k-1}l^{2}_{k-1}), \quad k \geq 1, \end{equation} with a lower bound $l_{0}$ for $\sigma_{\min}(X_0)$, and the function $h$ is given by \begin{equation*} h(l) = \sqrt{1+ \gamma} + \frac{1}{2}\sqrt{8 - 4\gamma + \frac{8(2 - l^2)}{l^2\sqrt{1 + \gamma}}},\quad \gamma = \sqrt[3]{\frac{4(1 - l^2)}{l^4}}. \end{equation*} In summary, except for $\alpha$ and $l_0$ the parameters determining~\eqref{eq:dwh_iteration} are simple and cheap to compute. The algorithm {\tt hQDWH} presented in~\cite{KressnerSus2017} for banded $A$ is essentially an implementation of~\eqref{eq:dwh_iteration} in the HODLR matrix arithmetic, with one major difference. Following~\cite{NakaHigh2013}, the first iteration of {\tt hQDWH} avoids the computation of the Cholesky factorization for the evaluation of $(I+c_0 X^T_0 X_0)^{-1} = (I+c_0/\alpha^2 A^2)^{-1}$ in the first iteration. Instead, a QR decomposition of a $2n\times n$ matrix $\begin{bmatrix}\sqrt{c_0} X_0 \\ I\end{bmatrix} $ is computed. This improves numerical stability and allows us to safely determine spectral projectors even for relatives gaps of order $10^{-16}$. For reasons explained in~\cite[Remark 3.1]{KressnerSus2017}, existing algorithms for performing QR decompositions of HODLR matrices come with various drawbacks. When $A$ is a HODLR matrix, Algorithm~\ref{alg:hdwh} therefore uses a Cholesky decomposition (instead of a QR decomposition) in the first step as well. In turn, as will be demonstrated by numerical experiments in section~\ref{sec:experiments}, this restricts the application of the algorithm to matrices with relative spectral gaps of order $10^{-8}$ or larger. We do not see this as a major disadvantage in the setting under consideration. The relative gap is controlled by the choice of the shift $\mu$ in our D\&C method and tiny relative spectral gaps can be easily avoided by adjusting $\mu$. The inexpensive estimation of $\alpha,l_0$ for banded $A$ is discussed in~\cite{KressnerSus2017}. For a HODLR matrix $A$, we determine $\alpha$ and $l_0$ by applying a few steps of the (inverse) power method to $A^2$ and $A^2/\alpha^2$, respectively. \begin{algorithm}[h!] \caption{\text{hDWH algorithm}} \label{alg:hdwh} \textbf{Input}: Symmetric HODLR matrix $A\in {\mathbb R}^{n\times n}$, truncation tolerance $\epsilon>0$, stopping tolerance $\varepsilon>0$. \\ \textbf{Output}: Approximate spectral projectors $\Pi_{<0}$ and $\Pi_{>0}$ in the HODLR format. \begin{algorithmic}[1] \If{$A$ is banded} \State Compute $\Pi_{<0}$ and $\Pi_{>0}$ using the {\tt hQDWH} algorithm~\cite{KressnerSus2017}. \Else \State Compute initial parameters $\alpha\gtrsim \Vert A \Vert_2$ via power iteration on $A^2$ and $l_0 \lesssim \sigma_{\min}(A/\alpha)$ via inverse power iteration on $A^2/\alpha^2$. \State $X_0 = A/\alpha$. \State $k = 0$. \While{$\vert 1 - l_k\vert > \varepsilon$} \label{alg_stopping} \State Compute $a_k$, $b_k$, $c_k$ according to the recurrence~\eqref{eq:qdwh_parameters_abc}. \State $W_k = \h\operatorname{-Cholesky}(I + c_kX_k^{T}*_{\h}X_k)$. \label{alg_chol1} \State $Y_k = X_k*_{\h}W_k^{-1}$. \State $V_k = Y_k *_{\h} W_k^{-T}$. \State $X_{k+1} = \frac{b_k}{c_k}X_k +_{\h} \left(a_k - \frac{b_k}{c_k}\right)V_k$. \label{alg_chol} \State $k = k+1$. \State Compute $l_k$ according to the recurrence~\eqref{eq:qdwh_parameter_l}. \EndWhile \State Set $U = X_k$. \label{alg_sign} \State Return $\Pi_{<0} =\frac{1}{2}(I -U)$ and $\Pi_{>0} =\frac{1}{2}(I +U)$. \label{alg_sp} \EndIf \end{algorithmic} \end{algorithm} Assuming that a constant number of iterations is needed and that the HOLDR ranks of all intermediate quantities are bounded by $k$, the complexity of Algorithm~\ref{alg:hdwh} is ${\mathcal O}(k^2n\log^2 n)$.
\section{Introduction} {\it Introduction :} Quantum two-level system stores quantum information (qubit), being the basic building block in quantum information science and engineering. However, in many physical systems, including atom and ion systems \cite{rydberg molecule, ion trap}, superconducting qubits~~\cite{DRAG_first, DRAG_EXP1}, and quantum dots~\cite{QD multi}, nature provides imperfect two-level systems, that are the two-level subspace, weakly coupled to the remaining Hilbert space of a multi-level system. Leakage transitions to unwanted energy levels are often a critical source of control errors in many physical implementations. Pulse shaping and optimal control theories have been developed to deal with the leakages and as a result to increase gate operation fidelities: there have been a plethora of model considerations for many coupled qubit systems including nuclear spins~\cite{RyanPRA2008}, superconducting qubits~\cite{SporlPRA2007,RebentrostPRA2009}, and atoms~\cite{DoriaPRL2011,TheisPRA2016}, to list a few. However, not many of them are realizable due to the current technical limit of pulse-shaping hardware. Alternatively analytic waveform designing based on physical models has been considered: one example suitable for weakly coupled nonlinear qubits is the method known as derivative removal by adiabatic gate (DRAG)~\cite{DRAG_first, DRAG_theory1, DRAG_theory2}, developed and widely adopted in superconducting qubit implementations~\cite{DRAG_EXP1, DRAG_EXP2_opt}; another is the multiple-pulse approach known as Majorana decomposition method~\cite{vitanovPRL2013, Majorana decomposition2} proposed and experimentally demonstrated recently~\cite{Majorana decomposition exp}. Short-pulse control schemes~\cite{QD ultrafast} are often taken for quantum systems with a limited coherence time, but they could lead to rather significant leakage, especially as control bandwidth is increased comparable to intraband energies. In that regards, leakage suppression scheme is particularly necessary for quantum gates operating in the non-adiabatic interaction regime. For example, the time scales of ultrafast optical interactions are particularly promising for extremely fast gate operations on atomic and ion systems~\cite{ultrafast qubit op}, but both the DRAG and Majorana decomposition methods are unsuitable: the first requires too complex waveforms intractable in current technologies and the second only works for specific target states without individual coupling control. In this paper, we consider leakage suppression by subsequent pulsed operations. We take an approach of transition pathway engineering to remove the leakage with a programmed pulse sequence. In a three-level system, it is found that an additional pulse is sufficient for leakage suppression during any qubit preparation (from the ground-state to an arbitrary state) and two pulses for any qubit rotation (from an arbitrary state to an arbitrary state). The experiments performed with cold rubidium atoms and ultrafast laser pulses show a good agreement with the prediction. {\it System :} We consider a three-level system ($|0\rangle$, $|1\rangle$, and $|2\rangle$ with energies $0$, $\hbar\omega_{1}$, and $\hbar\omega_{2}$, respectively) in the ladder-type configuration, in which the first two levels are the qubit states and the third is the leakage state. The interaction Hamiltonian $H$ (in unit of $\hbar\equiv 1$) for an electric-field $E(t)=E_0(t)\cos(\omega_L t+\phi)$ reads after the rotation wave approximation: \begin{equation} {H = \sum_{i = 0}^{2}{\Delta_{i}}\Pi_i+\sum_{\substack{i,j = 0 \\ i<j}}^{2}{\frac{\lambda_{ij}}{2}\left(\Omega_x~\sigma_{ij}^{(x)}-\Omega_y~\sigma_{ij}^{(y)}\right)}}, \label{eq1} \end{equation} where $\Pi_i = |i\rangle\langle i|$ and {$\sigma_{ij}^{(k)}$} are the identity and Pauli matrices, respectively, for $k=x,y,z$ and $i,j = 0,1,2$. $\Omega_x$ and $\Omega_y$ are the real and imaginary parts of the Rabi oscillation frequency defined by $\Omega = \mu_{01} E_0 \exp(i\phi)$ between the first and second levels, where $\mu_{01}$ is the dipole moment. Scaled dipole moments are given by $\lambda_{ij}=0$ except $\lambda_{01} = 1$ and $\lambda_{12} = \lambda$; and detunings are $\Delta_{1} = \omega_{1}-\omega_L$ and $\Delta_{2} = \omega_{2}-2\omega_L$. Should the quantum information be carried by the first two states, $|0\rangle$ and $|1\rangle$, (e.g., initial state $|\psi(t=0)\rangle = a_i|0\rangle+b_i|1\rangle$), the Hamiltonian can be divided into two parts, the qubit system Hamiltonian $H_{q}$ and the leakage coupling Hamiltonian $H_{l}$, respectively given by \begin{subequations} \begin{eqnarray} H_{q} &=& \sum_{i = 0}^{2}{\Delta_{i}}\Pi_i+{\frac{\lambda_{01}}{2}(\Omega_x~\sigma_{01}^{(x)}-\Omega_y~\sigma_{01}^{(y)})}, \\ H_{l} &=& {\frac{\lambda_{12}}{2}(\Omega_x~\sigma_{12}^{(x)}-\Omega_y~\sigma_{12}^{(y)})}. \end{eqnarray} \end{subequations} The unitary matrix for the total system dynamics can be also conveniently divided into two parts, i.e., $U\equiv U^{(q)}U^{(l)}$, where $U^{(q)}$ (the qubit dynamics) and $U^{(l)}$ (the leakage dynamics) are respectively governed by the following equations: \begin{subequations} \begin{eqnarray} i\frac{dU^{(q)}}{dt} &=& H_{q}U^{(q)}, \label{schrodinger_boundary} \\ i\frac{dU^{(l)}}{dt} &=& U^{(q)\dagger}H_{l}U^{(q)}U^{(l)} \equiv H'_{I}U^{(l)}. \end{eqnarray} \end{subequations} The resulting effective leakage Hamiltonian $H'_I$ is \begin{eqnarray} &H'_{I}& = \frac{\lambda}{2}(\Omega^{\ast} U_{10}^{(q)}e^{i\Delta_2 t}\sigma_{02}^{-}+\Omega {U^{(q)}_{10}}^{\dagger} e^{-i\Delta_2 t}\sigma_{02}^{+})\nonumber\\ &+&\frac{\lambda}{2}(\Omega^{\ast} U_{11}^{(q)} e^{i\Delta_2 t}\sigma_{12}^{-}+\Omega {U^{(q)}_{11}}^{\dagger} e^{-i\Delta_2 t}\sigma_{12}^{+}). \label{effective hamiltonian} \end{eqnarray} where $U_{ij}^{(q)}$ are the effective couplings defined by Eq.~\eqref{schrodinger_boundary} and $\sigma_{ij}^{\pm} = (\sigma_{ij}^{(x)} \pm i\sigma_{ij}^{(y)})/2$. So, the leakage dynamics is governed not only by the electric-field ($\lambda\Omega$) but also by the qubit dynamics ($U^{(q)}$). When $\lambda$ is small (weakly-coupled leakage), the leakage is obtained by eliminating the first-order perturbation terms of the Dyson series, or \begin{equation} c_{l} = -a_i\frac{i\lambda}{2} \int^{\infty}_{-\infty} \Omega^{\ast} U^{(q)}_{10}e^{i\Delta_2 t}dt -b_i\frac{i\lambda}{2} \int^{\infty}_{-\infty} \Omega^{\ast} U^{(q)}_{11}e^{i\Delta_2 t}dt, \label{first order exact} \end{equation} where $c_{l}$ is the leakage state coefficient after the interaction. Then, the qubit operation fidelity~\cite{geometry ori, fidelity2, fidelity} is defined by \begin{eqnarray} \mathcal{F} &=& |\langle \psi(0)| U^{(q)\dagger}U^{(q)}U^{(l)}|\psi(0)\rangle|\simeq 1-\frac{1}{2}|c_{l}|^2, \label{fidelity} \end{eqnarray} up to the first-order perturbation of the leakage. \begin{figure*}[tbh] \centerline{\includegraphics[width=0.80\textwidth]{Figure1}} \caption{(Color online) {(a)} Leakage suppression condition ($c_{l}=0$) of the two-pulse scheme in Eq.~\eqref{two_pulse} for various laser bandwidths. The short-pulse approximation (SPA) solution in Eq.~\eqref{two_pulse_condition} (thick solid line) is shown in comparison with Eq.~\eqref{two_pulse} for pulses with various bandwidths ($\Delta\omega_{\rm FWHM}/\Delta_2 = 2.5, 3.4, \cdots, 15$). Our experiment corresponds to $\Delta\omega_{\rm FWHM}=3.4\Delta_2$ which is well approximated by the SPA solution up to $\Theta\sim 1.5\pi$. (b) Leakage-state population ($P_{l}$) is compared before and after the leakage suppression, where the SPA solution in Eq.~\eqref{two_pulse_condition} is used for various laser bandwidths. The numerical calculation is performed with $\lambda = 0.34$ (atomic rubidium condition, see Experiment).} \label{figure1} \end{figure*} {\it Leakage suppression with two pulses :} Now we consider leakage suppression ($c_{l}=0$) with two pulses, which can be achieved for arbitrary final qubit-states from initial ground state (i.e., $a_i=1$). We define the two pulses by $E_1=E_0 \exp(-t^2/\tau^2)$ and $E_2=\gamma E_0 \exp(-(t-t_d)^2/\tau^2)$, with corresponding Rabi frequencies $\Omega_1$ and $\Omega_2$, respectively. When the time-dependent pulse-area is defined by $A(t) = \int^{t}_{-\infty}\mu_{12}{(1+\gamma)E_0}\exp(-t'^2/\tau^2)dt'$, the corresponding time-dependent pulse-areas are given by $A(t)/(1+\gamma)$ and $\gamma A(t-t_d)/(1+\gamma)$. For the total pulse-area given by $\Theta = A(\infty)$, the target state becomes $|\psi_f\rangle = \cos {\Theta}/{2} |0\rangle-i\sin {\Theta}/{2} |1\rangle$. The carrier envelope phase (CEP) is assumed to be zero (i.e., $\phi=0$), without loss of generality. Then, Eq.~\eqref{first order exact} becomes \begin{widetext} \begin{eqnarray} c_{l} = &-&\int^{\infty}_{-\infty}\frac{\lambda\Omega_1 (t)}{2} \sin{\frac{A(t)}{2(1+\gamma)}} e^{i\Delta_2 t}dt - \int^{\infty}_{-\infty}\frac{\lambda\Omega_2 (t_1)}{2} \cos{\frac{A(\infty)}{2(1+\gamma)}}\sin{\frac{\gamma A(t_1)}{2(1+\gamma)}}e^{i\Delta_2 (t_1+t_{d})}dt_1\nonumber\\ &-&\int^{\infty}_{-\infty}\frac{\lambda\Omega_2 (t_1)}{2} \sin{\frac{A(\infty)}{2(1+\gamma)}}\cos{\frac{\gamma A(t_1)}{2(1+\gamma)}}e^{i\Delta_2 (t_1+t_{d})}dt_1, \label{two_pulse} \end{eqnarray} \end{widetext} where $t_1 = t-t_d$. An algebraic solution for this leakage suppression ($c_{l}=0$) is then obtained as \begin{equation} \gamma = \left(1-\frac{2}{\Theta}\cos^{-1}{\frac{1+\cos{\frac{\Theta}{2}}}{2}}\right)\left(\frac{2}{\Theta}\cos^{-1}{\frac{1+\cos{\frac{\Theta}{2}}}{2}}\right)^{-1} \label{two_pulse_condition} \end{equation} with time-delay phase {$\phi_d\equiv {\Delta_2} t_d=\pi$}, that sets the three terms in Eq.~\eqref{two_pulse} all in phase, for short laser pulses with laser bandwidth considerably bigger than the two-photon detuning ${\Delta_2}$ under which the interaction phase ${\Delta_2} t$ is maintained constant during the interaction (short-pulse approximation). In Fig.~\ref{figure1}, the solution in Eq.~\eqref{two_pulse_condition} is compared with the time-dependent Schr\"{o}dinger equation calculation for various laser bandwidths ($\Delta\omega_{\rm FWHM}$, electric-field bandwidth), which shows that the full coverage of a Rabi half-cycle, $\Theta\in [0,\pi]$, is experimentally achievable with this leakage suppression scheme. Leakage suppression in other systems such as V-type and $\Lambda$-type three-level systems can be also considered similarly. It is found that the $\Lambda$-type systems provide the same leakage suppression condition as Eq.~\eqref{two_pulse_condition}. In the V-type systems, for example with $\lambda_{12} = 0$ but $\lambda_{02} = \lambda$ in Eq.~\eqref{eq1}, the condition is obtained in a slightly different form as \begin{equation} \gamma({\rm V}) = \left(1-\frac{2}{\Theta}\sin^{-1}{\frac{\sin{\frac{\Theta}{2}}}{2}}\right)\left(\frac{2}{\Theta}\sin^{-1}{\frac{\sin{\frac{\Theta}{2}}}{2}}\right)^{-1}. \label{two_pulse_condition_V} \end{equation} {\it Leakage suppression with three pulses :} In general, qubit gate operations require initial state independent operations. In this case, both $a_i$ and $b_i$ in Eq.~\eqref{first order exact} are nonzero, so the leakage suppression needs two additional pulses, or total three pulses. When the three pulses are defined by $E_1=\alpha E_0 \exp(-t^2/\tau^2)$, $E_2=\beta E_0 \exp(-(t-t_{d1})^2/\tau^2)$, and $E_3=(1-\alpha-\beta) E_0 \exp(-(t-t_{d2})^2/\tau^2)$, the leakage suppression ($c_{l}=0$) under the short pulse approximation is given by two equations: \begin{widetext} \begin{subequations} \begin{eqnarray} (1-e^{i\phi_{d1}})\cos{\frac{\alpha\Theta}{2}}+(e^{i\phi_{d1}}-e^{i\phi_{d2}})\cos{\frac{(\alpha+\beta)\Theta}{2}} +e^{i\phi_{d2}}\cos{\frac{\Theta}{2}} &=& 1,\\ (1-e^{i\phi_{d1}}) \sin{\frac{\alpha\Theta}{2}}+(e^{i\phi_{d1}}-e^{i\phi_{d2}})\sin{\frac{(\alpha+\beta)\Theta}{2}} +e^{i\phi_{d2}}\sin{\frac{\Theta}{2}} &=& 0, \end{eqnarray} \end{subequations} \end{widetext} where $\alpha\Theta$ and $\beta\Theta$ are the pulse-areas; $\phi_{d1,2}$ are the phase delay due to the pulse intervals. One simple example is obtained for $\phi_{d1} = \pi$ and $\phi_{d2} = 0$ as \begin{subequations} \begin{eqnarray} 2\cos{\frac{\alpha\Theta}{2}}-2\cos{\frac{(\alpha+\beta)\Theta}{2}}+\cos{\frac{\Theta}{2}} = 1,\\ 2\sin{\frac{\alpha\Theta}{2}}-2\sin{\frac{(\alpha+\beta)\Theta}{2}}+\sin{\frac{\Theta}{2}} = 0. \end{eqnarray} \label{special case} \end{subequations} The fidelity $\mathcal{F}(\alpha,\beta)$ after $X(\pi)$ rotation is plotted in Fig.~\ref{figure2}, respectively for three distinct initial states: (a) the ground state $(a_i, b_i)=(1, 0)$, (b) a superposition state $(1/\sqrt{2}, 1/\sqrt{2})$, and (c) the excited state $(0, 1)$. The high fidelity ($\mathcal{F}>0.99$) pattern on the $(\alpha, \beta)$ plane depends on initial states; however, the optimal solutions (stars in the figures) from Eq.~\eqref{special case} are the same. As a function of $\Theta$, the optimal solution is plotted in Fig.~\ref{figure2}(d). \begin{figure}[tbh] \centerline{\includegraphics[width=0.5\textwidth]{Figure2}} \caption{(Color online) (a-c) Fidelity map $\mathcal{F}(\alpha, \beta)$ for $X(\pi)$-rotation initiated from three characteristic states: (a) the ground state ($a_i = 1$, $b_i = 0$), (b) the superposition state ($a_i = 1/\sqrt{2}$, $b_i = 1/\sqrt{2}$), and (c) the excited state ($a_i = 0$, $b_i = 1$). The high fidelity regions calculated by TDSE are plotted, where white stars indicate the Eq.~\eqref{special case} solution point ($\alpha = 0.27$, $\beta = 0.46$, common in all three figures) for $X(\pi)$-rotation. (d) The solutions of Eq.~\eqref{special case} for $(\alpha,\beta$). The TDSE calculations in (a) are performed with $\lambda = 0.34$ (atomic rubidium) and $\omega_{\rm FWHM} = 15\Delta_2$ (near the SPA condition).} \label{figure2} \end{figure} {\it Experiment :} Experimental verification was performed with atomic rubidium 5S$_{1/2}$, 5P$_{3/2}$ and 5D states ($|0\rangle$, $|1\rangle$, and $|2\rangle$, respectively). The resonance frequency between 5S and 5P states is $\lambda = 780$~nm and between 5P$_{3/2}$ and 5D states is 776~nm, where the 5D fine-structure sub-levels are treated as one through Morris-Shore transformation{~\cite{MStransform}}. Experiment setup is described in our previous works~\cite{LimSR2014, LeeOL2015}. In brief, $^{87}$Rb cold atoms were prepared in a magneto optical trap (MOT) and to ensure uniform laser-atom interaction the size of the atomic cloud was kept about 80\% of laser field diameter~\cite{LeeOL2015}. Short laser pulses were produced from a Ti:sapphire mode-locked laser amplifier operating at 1~kHz repetition. The sequence of two or three pulses was programmed with an acousto-optic programmable dispersive filter (AOPDF)~\cite{AOPDF}. The center frequency was $\lambda_{\rm center} = 780$~nm and the bandwidth was $\Delta w_{\rm FWHM} = 4.5\times 10^{13}$~rad/s (corresponding to $\tau = 75$~fs), where the bandwidth was limited by the one-photon transition to 5P$_{1/2}$. The time delay between pulses was about 714~fs, corresponding to 2$\Delta t_d$ = 3.1$\pi$, and the relative phase was kept less than $\pi/10$ due to experimental imperfection. The pulse-area of the control pulse was controlled with a half-wave plate placed between a pair of cross polarizers. Probing the leakage state (5D) population was performed by ionizing the 5D state atoms with a 780~nm probe pulse after the resonance frequencies of 5S-5P$_{3/2}$ and 5P$_{3/2}$-5D were eliminated using a knife edge in the pulse compressor of the laser amplifier. The ion signal was collected by a microchannel plate (MCP). Three-photon ionization signal was subtracted from data using ion signals without the probe pulse which detected three-photon ionization only. The entire experiment was repeated at a rate of 2~Hz. The experimental result of the two-pulse leakage suppression is shown in Fig.~\ref{Experiment}(a), where the two-photon leakage to 5D state is plotted as a function of the total pulse-area ($\Theta$) and the relative amplitude ($\gamma$) between the two pulses. In comparison, corresponding numerical TDSE calculation is plotted in Fig.~\ref{Experiment}(b). In the both figures, the dashed lines represent the leakage suppression condition in Eq.~\eqref{two_pulse_condition}, showing a qualitatively good agreement. In Fig.~\ref{Experiment}(c), the leakages ($P_l=|c_{l}|^2$) after a half ($\Theta = \pi$, blue) and full ($\Theta = 2\pi$, red) Rabi cycles are respectively plotted as a function of $\gamma$, where the data are extracted along the vertical lines in Figs.~\ref{Experiment}(a) and \ref{Experiment}(b). \begin{figure}[thb] \centerline{\includegraphics[width=0.35\textwidth]{Figure3}} \caption{(Color online) (a) Experimental result, where the leakage state (5D) population is measured as a function of the total pulse area ($\Theta$) and the relative amplitude ($\gamma$). White dashed line represents the leakage suppression condition under the short-pulse approximation from Eq.~\ref{two_pulse_condition}. (b) Corresponding numerical calculation. (c) Comparison between the experiment (diamonds) and theory (solid lines) for $\Theta=\pi$ and $2\pi$, extracted along the white dotted lines in (a) and (b). } \label{Experiment} \end{figure} In Fig.~\ref{exp_fidelity}, the qubit rotation fidelity is estimated for our leakage suppression scheme. Using the experimentally measured leakages $P_l=|c_f|^2$ extracted along the short-pulse approximation condition (white dashed line) in Fig.~\eqref{Experiment}(a), the first-order perturbation fidelity (circles), defined in Eq.~\eqref{fidelity}, is calculated using the data extracted, and compared with the corresponding theoretical line (solid line). Direct TDSE calculations for the fidelity without the assumption of the first-order perturbation are also shown for the two-pulse scheme (green dotted line) and for the single transform-limited pulse case (blue dashed line). The estimated infidelity less than 0.025 is achieved in the $\Theta$ range from zero up to $2\pi$, using the two-pulse leakage suppression scheme. \begin{figure}[thb] \centerline{\includegraphics[width=0.45\textwidth]{Figure4}} \caption{(Color online) Qubit-rotation fidelity $\mathcal{F}(\Theta)$. Experimental fidelity $\mathcal{F} \simeq 1-P_l/2$ in Eq.~\eqref{fidelity}, the first-order perturbation approximation, is estimated (circles) using the data from Fig.~\ref{Experiment}(a), overlapped with the corresponding theoretical estimation (solid line). In comparison, TDSE calculation for the exact fidelity $\mathcal{F} = |\langle \psi(0)| U^{(q)\dagger}U^{(q)}U^{(l)}|\psi(0)\rangle|$ is shown for the two-pulse leakage suppression scheme (green dotted line) and for the single transform-limited pulse case (blue dashed line).} \label{exp_fidelity} \end{figure} {\it Conclusion :} We proposed a pulsed leakage suppression scheme and verified its validity using a proof-of-principle experimental demonstration. The leakage transition in a three-level atomic rubidium system was successfully removed through coherent destructive interference coherently controlled with an ultrafast pulse sequence. The technique promises high-fidelity (exceeding $\mathcal{F} >$ 0.98) qubit rotations, requiring only phase-maintained and amplitude-controlled two pulses, for qubit rotations of a ground-state qubit, or three pulses, for general qubit rotations from an arbitrary initial state. It is expected that this coherent control scheme can be further simplified with a compressed single pulse~\cite{ZYZ rotation} and applicable not only for high fidelity quantum control but also for extremely high-speed quantum operations. \begin{acknowledgements} This research was supported by Samsung Science and Technology Foundation [SSTF-BA1301-12]. \end{acknowledgements}
\section{Introduction} Let $R$ be a finite irreducible root system and denote by ${\mathcal A}$ the associated set of (affine) alcoves. In the article \cite{FieLanWallCross} we endowed ${\mathcal A}$ with a topology and defined a category ${\mathbf S}$ of sheaves of ${\mathcal Z}$-modules on ${\mathcal A}$, where ${\mathcal Z}$ is the structure algebra of $R$ over a field $k$. In this article we relate ${\mathbf S}$ to the representation theory of algebraic groups, i.e. we show that if $k$ is algebraically closed and if its characteristic is bigger than the Coxeter number of $R$, then one can calculate the irreducible characters of any reductive algebraic group $G$ over $k$ with root system $R$ from data in ${\mathbf S}$. Here is what we show in this article in more precise terms. For any alcove $A\in{\mathcal A}$ we construct a ``standard object'' ${\mathscr V}(A)$ in ${\mathbf S}$. As ${\mathbf S}$ is a full subcategory of the abelian category of sheaves of ${\mathcal Z}$-modules on ${\mathcal A}$, it inherits an exact structure, i.e. a notion of short exact sequences. We consider the full subcategory ${\mathbf B}$ of ${\mathbf S}$ that contains all objects that admit a finite filtration with subquotients isomorphic to various ${\mathscr V}(A)$, possibly shifted in degree. We call ${\mathbf B}$ the category of {\em objects admitting a Verma flag}. We then show that for each alcove $A$ there exists a unique projective object ${\mathscr B}(A)$ in ${\mathbf S}$ that admits an epimorphism onto ${\mathscr V}(A)$. Moreover, we prove that each ${\mathscr B}(A)$ admits a Verma flag. The occurence of ${\mathscr V}(A)$ as a subquotient in a filtration of ${\mathscr B}(B)$ is independent of the choice of the filtration and is denoted by $({\mathscr B}(B):{\mathscr V}(A))$. As the category ${\mathbf S}$ admits a grading, this is actually a polynomial in ${\mathbb Z}[v,v^{-1}]$. Now suppose that $k$ is algebraically closed with characteristic $p$ larger than the Coxeter number of $R$. Let $G$ be the connected, almost simple, simply connected algebraic group associated with $R$ over $k$. Fix a maximal torus $T$ in $G$ and denote by $X$ its character lattice. Denote by $\fg$ the Lie algebra of $G$. Consider the category ${\mathbf C}$ of restricted, $X$-graded representations of $\fg$ as it is defined in \cite{Soe95}. In this category one has standard objects $Z(\lambda)$ (the baby Verma modules) and projective objects $Q(\mu)$, and both sets are parametrized by elements in $X$. Each projective object admits a finite fitration with subquotients being isomorphic to baby Verma modules, and again the multiplicity $(Q(\mu):Z(\lambda))$ is independent of choices. One can obtain the irreducible rational characters of $G$ via known results from these multiplicities (cf. \cite{FieBull} for an overview). From the (rational) characters of $G$ one can deduce the characters of any reductive group with root system $R$ via classical results. It is even sufficient to know the numbers $(Q(\mu):Z(\lambda))$ in the case that $\mu+\rho$ and $\lambda+\rho$ are contained in a regular orbit of the affine Weyl group ${\widehat\CW}_p:={\mathcal W}\ltimes p{\mathbb Z} R$ acting on $X$, where $\rho\in X$ is the half-sum of positive roots and ${\mathcal W}$ is the finite Weyl group. Let us fix such a regular orbit ${\mathscr O}$ in $X$. Then there is a natural bijection $\sigma\colon{\mathscr O}\xrightarrow{\sim}{\mathcal A}$ that associates to $\gamma\in{\mathscr O}$ the unique alcove that contains $\gamma/p$. The main result in this article is that for $\lambda,\mu\in{\mathscr O}$ one has $$ (Q(\mu-\rho):Z(\lambda-\rho))=({\mathscr B}(\sigma(\mu)):{\mathscr V}(\sigma(\lambda)))(1). $$ Note that on the right hand side $(\cdot)(1)$ denotes the evaluation of a Laurent polynomial at $1\in{\mathbb Z}$. The above result is obtained via the categorical equivalence established by Andersen, Jantzen and Soergel in their seminal work on Lusztig's conjecture \cite{AJS}. However, we hope that the new approach developed in this article and its companion article \cite{FieLanWallCross} will ultimately result in a simplified proof of the categorical equivalence of Andersen, Jantzen and Soergel. \subsection{Acknowledgements} Both authors were partially supported by the DFG grant SP1388. \section{Topologies on the space of alcoves and the structure algebra} In this section we quickly review the topology on the set of alcoves that we considered in \cite{FieLanWallCross}. We add some new results that were not needed in that article. In particular, we study sections of the action of the root lattice on the set of alcoves. We also recall the definition of the structure algebra of our datum. \subsection{Alcoves}\label{subsec-alcoves} Let $V$ be a real vector space and $R\subset V$ a finite irreducible root system with a system of positive roots $R^+\subset R$. Denote by $\alpha^\vee\in V^{\ast}={\operatorname{Hom}}_{\mathbb R}(V,{\mathbb R})$ the coroot associated with $\alpha\in R$. Let $X:=\{\lambda\in V\mid \langle \lambda,\alpha^\vee\rangle\in{\mathbb Z}\text{ for all $\alpha\in R$}\}$ and $X^\vee:=\{v\in V^\ast\mid \langle\alpha,v\rangle\in{\mathbb Z}\text{ for all $\alpha\in R$}\}$ be the weight and the coweight lattice, resp. For $\alpha\in R^+$ and $n\in{\mathbb Z}$ define $$ H_{\alpha,n}:=\{\mu\in V\mid \langle \mu,\alpha^\vee\rangle = n\} \text{ and } H_{\alpha,n}^\pm:=\{\mu\in V\mid \pm\langle \mu, \alpha^\vee\rangle>\pm n\}, $$ where $\langle\cdot,\cdot\rangle\colon V\times V^\ast\to {\mathbb R}$ is the natural pairing. The connected components of $V\setminus\bigcup_{\alpha\in R^{+},n\in{\mathbb Z}}H_{\alpha,n}$ are called {\em alcoves}. Denote by ${\mathcal A}$ the set of alcoves. Denote by $s_{\alpha,n}\colon V\to V$, $\lambda\mapsto \lambda-(\langle \lambda,\alpha^\vee\rangle-n)\alpha$ the affine reflection with fixed point hyperplane $H_{\alpha,n}$. The {\em affine Weyl group} is the group ${\widehat\CW}$ of affine transformations on $V$ generated by the set $\{s_{\alpha,n}\}_{\alpha\in R^+,n\in{\mathbb Z}}$. It contains the translations $t_\gamma\colon V\to V$, $\mu\mapsto \mu+\gamma$ for $\gamma\in {\mathbb Z} R$. The action of ${\widehat\CW}$ on $V$ preserves the set of hyperplanes $H_{\alpha,n}$ and induces an action on the set ${\mathcal A}$. For $\alpha\in R^+$ denote by $s_{\alpha}=s_{\alpha,0}$ the (${\mathbb R}$-linear) reflection at the hyperplane $H_{\alpha,0}$, and let ${\mathcal W}\subset{\widehat\CW}$ be the subgroup generated by the set $\{s_\alpha\}_{\alpha\in R^+}$. This subgroup is called the {\em finite Weyl group}, and ${\widehat\CW}={\mathcal W}\ltimes{\mathbb Z} R$. \subsection{Base rings} Let $k$ be a field and denote by $X^\vee_k=X^\vee\otimes_{\mathbb Z} k$ the $k$-vector space associated with the lattice $X^\vee$. For $v\in X^\vee$ we denote by $v$ its canonical image $v\otimes 1$ in $X^\vee_k$. We assume that $k$ satisfies the following condition. \begin{GKM} The characteristic of $k$ is not $2$ and $\alpha^\vee\not\in k\beta^\vee$ in $X_k^\vee$ for all $\alpha,\beta\in R^+$, $\alpha\ne \beta$. \end{GKM} Let $S=S(X^\vee_k)$ be the symmetric algebra of the $k$-vector space $X^\vee_k$. Let $T$ be a unital, commutative and flat $S$-algebra. Then the left multiplication with $\alpha^\vee$ on $T$ is non-zero for all $\alpha\in R^+$. \begin{definition} \begin{enumerate} \item Let $I_T\subset R^+$ be the set of all $\alpha$ such that $\alpha^\vee$ is {\em not} invertible in $T$. \item Denote by ${\widehat\CW}_T$ the subgroup of ${\widehat\CW}$ generated by the sets $\{t_\gamma\}_{\gamma\in{\mathbb Z} R}$ and $\{s_{\alpha,n}\}_{\alpha\in I_T, n\in{\mathbb Z}}$. \item Let $R_T^+$ be the set of all $\alpha\in R^+$ such that ${\widehat\CW}_T$ contains $s_{\alpha,n}$ for some (equivalently, all) $n\in{\mathbb Z}$.\item We call $T$ {\em saturated} if $I_T=R_T^+$. \item A {\em base ring} is a unital, commutative, flat, saturated $S$-algebra. We say that $T$ is {\em generic}, if $R_T^+=\emptyset$, and {\em subgeneric}, if $R_T^+=\{\alpha\}$ for some $\alpha\in R^+$. \end{enumerate} \end{definition} If $T$ is generic, then ${\widehat\CW}_T={\mathbb Z} R$. If $T$ is subgeneric, then ${\widehat\CW}_T=\{{\operatorname{id}}_V,s_{\alpha}\}\ltimes{\mathbb Z} R$ for $\alpha\in R_T^+$. Consider $S$ as an evenly graded algebra with $S_2=X_k^\vee$. We will sometimes assume that a base ring $T$ is, in addition, a graded $S$-algebra (the most important case is $T=S$). In this case, all $T$-modules are assumed to be graded, and homomorphisms between $T$-modules are assumed to be graded of degree $0$. For a graded module $M=\bigoplus_{n\in{\mathbb Z}} M_n$ and $l\in{\mathbb Z}$ we define the shifted graded $T$-module $M[l]$ by $M[l]_n=M_{l+n}$. \subsection{Topologies on ${\mathcal A}$} Fix a base ring $T$. \begin{definition} \begin{enumerate} \item We denote by $\preceq_T$ the partial order on the set ${\mathcal A}$ that is generated by $A\preceq_T B$, if either $B=t_\gamma(A)$ with $\gamma\in{\mathbb Z} R$, $0\le\gamma$, or if $B=s_{\alpha,m}(A)$, where $\alpha\in R_T^+$ and $m\in{\mathbb Z}$ are such that $A\subset H_{\alpha,m}^-$. \item A subset ${\mathcal J}$ of ${\mathcal A}$ is called {\em $T$-open} if it is an order ideal with respect to $\preceq_T$, i.e. if $A\in{\mathcal J}$ and $B\preceq_T A$ imply $B\in{\mathcal J}$. \end{enumerate} \end{definition} Here, $\le$ denotes the usual order on ${\mathbb Z} R$, i.e. $\lambda\le\mu$ if and only if $\mu-\lambda$ is a sum of positive roots. The collection of $T$-open subsets in ${\mathcal A}$ clearly defines a topology, and we denote by ${\mathcal A}_T$ the resulting topological space. Note that arbitrary intersections of open subsets in this topology are open again. We will often use the notation $\{\preceq_T A\}$ for the set $\{B\in{\mathcal A}\mid B\preceq_T A\}$. The sets $\{\succeq_T A\}$, $\{\prec_T A\}$, etc. are defined similarly. For a subset ${\mathcal T}$ of ${\mathcal A}$ we set $$ {\mathcal T}_{\preceq_T}:=\bigcup_{A\in{\mathcal T}}\{\preceq_T A\}\text{ and } {\mathcal T}_{\succeq_T}:=\bigcup_{A\in{\mathcal T}}\{\succeq_T A\}. $$ Then ${\mathcal T}_{\preceq_T}$ is the smallest $T$-open subset of ${\mathcal A}$ that contains $T$, and ${\mathcal T}_{\succeq_T}$ is the smallest $T$-closed subset of ${\mathcal A}$ that contains ${\mathcal T}$. \begin{lemma}\label{lemma-top} \begin{enumerate} \item A subset ${\mathcal K}$ of ${\mathcal A}_T$ is locally closed if and only if $A,C\in{\mathcal K}$ and $A\preceq_T B\preceq_T C$ imply $B\in{\mathcal K}$. \item If ${\mathcal K}\subset{\mathcal A}_T$ is locally closed, then ${\mathcal K}_{{\preceq_T}}\setminus{\mathcal K}$ is open. \end{enumerate} \end{lemma} \begin{proof} Part (1) is an easy consequence of the definition. We prove (2). Let $A$ be an element in ${\mathcal K}_{{\preceq_T}}\setminus{\mathcal K}$. Then there is some $C\in{\mathcal K}$ with $A{\preceq_T} C$. Suppose $B{\preceq_T} A$. Then $B\in{\mathcal K}_{{\preceq_T}}$. Now $B\in{\mathcal K}$ would imply $A\in{\mathcal K}$ by (1), hence $B\in{\mathcal K}_{{\preceq_T}}\setminus{\mathcal K}$. \end{proof} We now collect two results that were proven in \cite{FieLanWallCross}. \begin{lemma}[{\cite[Lemma 3.12]{FieLanWallCross}}] The connected components of ${\mathcal A}_T$ coincide with the ${\widehat\CW}_T$-orbits. \end{lemma} In particular, if $T$ is a generic base ring, then ${\widehat\CW}_T={\mathbb Z} R$, so the connected components of ${\mathcal A}_T$ are just the ${\mathbb Z} R$-orbits. If $T$ is a subgeneric base ring, then every connected component of ${\mathcal A}_T$ splits into two ${\mathbb Z} R$-orbits $x$ and $y$. If $\alpha\in R^+$ is such that $R_T^+=\{\alpha\}$, then $y=s_{\alpha,0}x$ (cf. Lemma 3.14 in \cite{FieLanWallCross}). We will use lower case Latin letters such as $x,y,w$ for ${\mathbb Z} R$-orbits in ${\mathcal A}$. For arbitrary connected components or unions of components we use upper case Greek letters such as $\Lambda$ or $\Omega$. We denote by $C({\mathcal A}_T)$ the set of connected components of ${\mathcal A}_T$. \begin{lemma}\label{lemma-indtop}\cite[Lemma 3.10]{FieLanWallCross} The topology on a ${\mathbb Z} R$-orbit $x\subset{\mathcal A}_T$ induced via the inclusion is independent of $T$. \end{lemma} More specifically, a subset ${\mathcal J}$ of $x$ is open if and only if $A\in{\mathcal J}$ and $\gamma\in{\mathbb Z} R$, $\gamma\ge 0$ imply $A-\gamma\in {\mathcal J}$. \subsection{The map $\alpha\uparrow\cdot$} Let $\alpha\in R^+$, and let $A\in{\mathcal A}$. Let $n\in{\mathbb Z}$ be minimal such that $A\subset H_{\alpha,n}^-$. Define $$ \alpha\uparrow A:=s_{\alpha,n} A. $$ Then $\alpha\uparrow(\cdot)$ is a bijection on the set ${\mathcal A}$. We denote by $\alpha\downarrow(\cdot)$ its inverse. Suppose that $T$ is subgeneric with $R_T^+=\{\alpha\}$. Let $\Lambda\subset{\mathcal A}_T$ be a connected component that splits into the ${\mathbb Z} R$-orbits $x$ and $y$. For $A\in x$ we then have $\alpha\uparrow A\in y$. \begin{lemma} \label{lemma-upmin} Suppose that $T$ is subgeneric and let $\Lambda=x\cup y$ be as above. Let $A\in x$. Then $\alpha\uparrow A$ is the unique $\preceq_T$-minimal alcove in $\{\succeq_TA\}\cap y$. In particular, the set $\{A,\alpha\uparrow A\}$ is locally closed in ${\mathcal A}_T$. \end{lemma} Note that for general $T$ it is not always true that $\alpha\uparrow A$ is the minimal element in its ${\mathbb Z} R$-orbit with $\alpha\uparrow A \succeq_T A$. \begin{proof} Let $B$ be a minimal element in $\{\succeq_TA\}\cap y$. Then there is a sequence $A=A_0\preceq_T A_1\preceq_T\cdots\preceq_T A_n=B$ such that $A_i=A_{i-1}+\mu$ for some $\mu>0$ or $A_i=s_{\alpha,m}A_{i-1}$ for some $m\in{\mathbb Z}$. The fact that $s_{\alpha,m}(x)=y$ and the minimality of $B$ imply that the second case can occur only but then must occur for $i=n$. Hence $B=s_{\alpha,m}(A+\mu)$ for some $m\in{\mathbb Z}$ and $\mu\ge 0$. The minimality implies that $s_{\alpha,m}(A+\mu)=\alpha\uparrow(A+\mu)=(\alpha\uparrow A)+\mu$. Applying the minimality for the third time shows $\mu=0$. \end{proof} \subsection{Induced topologies and sections}\label{subsec-toponV} Fix $\mu\in X$ and let ${\mathcal K}_\mu\subset{\mathcal A}$ be the set of all alcoves that contain $\mu$ in their closure. Endow ${\mathcal K}_\mu$ with the topology induced via the inclusion into ${\mathcal A}_T$. For a connected component $\Lambda$ of ${\mathcal A}_T$ set $\Lambda_\mu:=\Lambda\cap{\mathcal K}_\mu$. Then ${\mathcal K}_\mu=\bigcup_{\Lambda\in C({\mathcal A}_T)}\Lambda_\mu$ is the decomposition into connected components. Denote by ${\mathcal W}_\mu\subset{\widehat\CW}$ the stabilizer of $\mu$. It is generated by the reflections $s_{\alpha,\langle\mu,\alpha^\vee\rangle}$ with $\alpha\in R^+$, and ${\mathcal K}_\mu$ is a ${\mathcal W}_\mu$-orbit. Set ${\mathcal W}_{T,\mu}={\mathcal W}_\mu\cap{\widehat\CW}_T$. As each connected component $\Lambda$ of ${\mathcal A}_T$ is a ${\widehat\CW}_T$-orbit, each connected component $\Lambda_\mu$ is a ${\mathcal W}_{T,\mu}$-orbit. Now denote by ${\mathcal V}$ the set of ${\mathbb Z} R$-orbits in ${\mathcal A}$, and let $\pi\colon{\mathcal A}\to{\mathcal V}$ be the orbit map. We often denote by $\overline A$ or $\overline\Lambda$ the image of $A\in{\mathcal A}$ or $\Lambda\subset{\mathcal A}$ under $\pi$. Standard arguments show that ${\widehat\CW}={\mathcal W}_\mu\ltimes{\mathbb Z} R$ and ${\widehat\CW}_T={\mathcal W}_{T,\mu}\ltimes{\mathbb Z} R$. As ${\mathcal A}$ is a principal homogeneous ${\widehat\CW}$-set, it follows that $\pi|_{{\mathcal K}_\mu}\colon{\mathcal K}_\mu\to{\mathcal V}$ is a bijection. We call the topology on ${\mathcal V}$ obtained from the topology on ${\mathcal K}_\mu$ considered above via this bijection the {\em $(T,\mu)$-topology}, and we denote the resulting topological space by ${\mathcal V}_{T,\mu}$. So a subset ${\mathcal L}$ of ${\mathcal V}$ is {\em $(T,\mu)$-open} if and only if there exists a $T$-open subset of ${\mathcal A}$ such that ${\mathcal L}=\pi({\mathcal K}_\mu\cap{\mathcal J})$. Note that this topology only depends on the ${\mathbb Z} R$-orbit of $\mu$. From the above we obtain that ${\mathcal V}_{T,\mu}=\bigcup_{\Lambda\in C({\mathcal A}_T)}\pi(\Lambda_\mu)$ is the decomposition of ${\mathcal V}_{T,\mu}$ into connected components. Now fix $\Lambda\in C({\mathcal A}_T)$ and let $A\in\Lambda_\mu$ be a $\preceq_T$-minimal element, and denote by ${\mathcal S}_{T,\mu}\subset{\mathcal W}_{T,\mu}$ the set of reflections at hyperplanes having a codimension $1$ intersection with the closure of $A$. Again, standard arguments show that $({\mathcal W}_{T,\mu},{\mathcal S}_{T,\mu})$ is a Coxeter system (it is the Coxeter system associated with the root system $R_T^+$). We denote by $\le_{T,\mu}$ the corresponding Bruhat order on ${\mathcal W}_{T,\mu}$. \begin{lemma} \label{lemma-tauiso} Let $A\in\Lambda_\mu$ be as above. Then the map $\tau\colon {\mathcal W}_{T,\mu}\to \Lambda_\mu$, $w\mapsto w(A)$ is an isomorphism of partially ordered sets. In particular, the element $A$ is the unique minimal element in $\Lambda_\mu$. \end{lemma} \begin{proof} We have already argued that $\tau$ is a bijection. The Bruhat order on ${\mathcal W}_{T,\mu}$ is generated by the relations $w\le_{T,\mu} s_{\alpha,\langle\mu,\alpha^\vee\rangle}w$ for $\alpha\in R_T^+$ and $w\in{\mathcal W}_{T,\mu}$ such that $w(\alpha)\in R_T^+$. Now $w(\alpha)\in R_T^+$ if and only if $w(A)\subset H_{\alpha}^-$, which is the case if and only if $w(A)\preceq_Ts_{\alpha}w(A)$. As the restriction of $\preceq_T$ to $\Lambda_\mu$ is generated by these relations, the claim follows. \end{proof} ${\mathcal K}$ be a subset of ${\mathcal A}_T$. \begin{definition} We say that ${\mathcal K}$ is a {\em section} if the following holds: \begin{enumerate} \item $\pi|_{\mathcal K}\colon{\mathcal K}\to{\mathcal V}$ is injective. \item ${\mathcal K}_{\preceq_T}=\bigcup_{\gamma\ge 0}{\mathcal K}-\gamma$ and ${\mathcal K}_{\succeq_T}=\bigcup_{\gamma\ge 0}{\mathcal K}+\gamma$. \end{enumerate} \end{definition} If ${\mathcal K}$ is a section, then properties (1) and (2) imply ${\mathcal K}={\mathcal K}_{\preceq_T}\cap{\mathcal K}_{\succeq_T}$, so ${\mathcal K}$ is locally closed. \begin{lemma}\label{lemma-specset1} The set $\Lambda_\mu$ is a section. \end{lemma} \begin{proof} It is clear that $\pi|_{\Lambda_\mu}$ is injective. We need to prove the defining property (2) of a section. As $\Lambda$ is a connected component, the sets $(\Lambda_\mu)_{\preceq_T}$ and $(\Lambda_\mu)_{\succeq_T}$ are contained in $\Lambda$. Let $A\in\Lambda_\mu$ and suppose that $B\preceq_T A$. For a point $v_A\in A$ denote by $v_B$ the unique element in $B\cap {\widehat\CW}_T(v_A)$. Then $v_A-v_B\in{\mathbb R}_{\ge0}R^+$ by the arguments that we used in the proof of Lemma 3.10 in \cite{FieLanWallCross}. By letting $v_A$ move towards $\mu$ we obtain an element $\mu^\prime\in X$ in the closure of $B$ with $\mu-\mu^\prime\ge 0$. Hence $B\in\Lambda_{\mu^\prime}=\Lambda_\mu-(\mu-\mu^\prime)\subset \bigcup_{\gamma\ge 0}\Lambda_\mu-\gamma$. Similarly one shows $(\Lambda_\mu)_{\succeq_T}=\bigcup_{\gamma\ge0}\Lambda_\mu+\gamma$. \end{proof} \subsection{A right action of ${\widehat\CW}$ on ${\mathcal A}$} Denote by $A_e\in{\mathcal A}$ the unique alcove that contains $0\in V$ in its closure and is contained in the dominant Weyl chamber $\{\mu\in V\mid \langle \mu,\alpha^\vee\rangle>0\text{ for all $\alpha\in R^+$}\}. $ Then the map ${\widehat\CW}\to{\mathcal A}$, $w\mapsto A_w:=w(A_e)$ is a bijection. The right action of ${\widehat\CW}$ on ${\mathcal A}$ is then obtained by transport of structure, i.e. $(A_x)w:=A_{xw}$ for all $x,w\in{\widehat\CW}$. It commutes with the left action. As every connected component of ${\mathcal A}_T$ is a ${\widehat\CW}_T$-orbit, the right action of ${\widehat\CW}$ permutes the set of connected components. Let ${\widehat\CS}\subset{\widehat\CW}$ be the set of reflections at hyperplanes that have a codimension $1$ intersection with the closure of $A_e$ (these reflections are called the simple affine reflections). We are especially interested in the right action of the elements in ${\widehat\CS}$ on the set ${\mathcal A}$. Let $T$ be a base ring. For $C\in{\mathcal A}$ denote by $\lambda_C$ the barycenter in $V$ of $C$. \begin{lemma}\label{lemma-specalc} Let $A,B\in{\mathcal A}$ with $\langle\lambda_B-\lambda_A,\alpha^\vee\rangle>0$ for all $\alpha\in R^+$. Then there are simple reflections $s_1$, \dots, $s_n\in{\widehat\CS}$ such that $A=Bs_1\cdots s_n$ and for all $i=1\dots,n$, the alcoves $Bs_1\cdots s_{i-1}$ and $Bs_1\cdots s_i$ are either $\preceq_T$-incomparable, or $Bs_1\cdots s_{i}\preceq_T Bs_1\cdots s_{i-1}$. \end{lemma} \begin{proof} Set $\delta=\lambda_B-\lambda_A$. There are interior points $x\in B$, $y\in A$ such that $y=x-\delta$ and such that the straight line segment from $x$ to $y$ does not pass through the intersection of at least two hyperplanes. Hence there exists a sequence of alcoves $A=A_0, A_1,\cdots, A_n=B$ such that $A_{i}$ and $A_{i+1}$ share a wall for all $i=0,\dots, n-1$. \end{proof} Let us fix $s\in{\widehat\CS}$ now. Here is another result that is not true for general base rings. \begin{lemma}\label{lemma-Asuparrow} Suppose that $T$ is subgeneric and let $\alpha\in R^+$ be such that $R_T^+=\{\alpha\}$. Let $\Lambda$ be a connected component that satisfies $\Lambda=\Lambda s$. For any $A\in\Lambda$ we then have $As\in\{\alpha\uparrow A,\alpha\downarrow A\}$. \end{lemma} \begin{proof} Note that $A$ and $As$ are not contained in the same ${\mathbb Z} R$-orbit and $\{A,As\}$ is a $\preceq_T$-interval by Lemma 6.1 in \cite{FieLanWallCross}. The claim follows now from Lemma \ref{lemma-upmin}. \end{proof} We say that a subset ${\mathcal T}$ of ${\mathcal A}$ is {\em $s$-invariant} if ${\mathcal T}={\mathcal T} s$. For general subsets ${\mathcal T}$ define $$ {\mathcal T}^\sharp={\mathcal T}\cup{\mathcal T} s\text{ and }{\mathcal T}^\flat={\mathcal T}\cap{\mathcal T} s. $$ Then ${\mathcal T}^\sharp$ is the smallest $s$-invariant set that contains ${\mathcal T}$, and ${\mathcal T}^\flat$ is the largest $s$-invariant subset of ${\mathcal T}$. \begin{lemma}[{\cite[Lemma 6.2, Lemma 6.3]{FieLanWallCross}}] \label{lemma-sharpflat} Let ${\mathcal J}$ be a $T$-open subset of ${\mathcal A}_T$. \begin{enumerate}\item Then ${\mathcal J}^\sharp$ and ${\mathcal J}^\flat$ are $T$-open. \item Suppose that ${\mathcal J}$ is contained in a connected component $\Lambda$ of ${\mathcal A}_T$ that satisfies $\Lambda=\Lambda s$. If $B\in{\mathcal J}^\sharp\setminus{\mathcal J}$, then $Bs\preceq_T B$. If $B\in{\mathcal J}\setminus{\mathcal J}^\flat$, then $B\preceq_TBs$. \end{enumerate} \end{lemma} \subsection{The structure algebra}\label{subsec-strucalg} Here is the main algebraic ingredient of our theory. \begin{definition}\label{def-strucalg} \begin{enumerate} \item For a subset ${\mathcal L}$ of ${\mathcal V}$ set $$ {\mathcal Z}_S({\mathcal L}):=\left\{(z_x)\in\bigoplus_{x\in {\mathcal L}}S\left|\begin{matrix}\, z_x\equiv z_{s_{\alpha} x}\mod\alpha^\vee \\ \text{ for all $x\in{\mathcal L}$ and $\alpha\in R^+$ } \\ \text{ with $s_{\alpha} x\in{\mathcal L}$}\end{matrix}\right\}\right.. $$ \item For a base ring $T$ define ${\mathcal Z}_T({\mathcal L}):={\mathcal Z}_S({\mathcal L})\otimes_ST$. \end{enumerate} \end{definition} We write ${\mathcal Z}_S$ and ${\mathcal Z}_T$ instead of ${\mathcal Z}_S({\mathcal V})$ and ${\mathcal Z}_T({\mathcal V})$. Mostly we fix a base ring $T$ and use the even handier notation ${\mathcal Z}({\mathcal L}):={\mathcal Z}_T({\mathcal L})$ and ${\mathcal Z}={\mathcal Z}_T$. If the base ring $T$ is a graded $S$-algebra, then ${\mathcal Z}$ is a graded $T$-algebra and again we assume, in this case, all ${\mathcal Z}$-modules to be graded. As $T$ is flat as an $S$-module, we obtain a natural inclusion ${\mathcal Z}_T({\mathcal L})\subset\bigoplus_{x\in{\mathcal L}} T$. Consider the projection $p^{\mathcal L}\colon\bigoplus_{x\in{\mathcal V}} T\to\bigoplus_{x\in{\mathcal L}} T$ along the decomposition. This induces a homomorphism ${\mathcal Z}\to{\mathcal Z}({\mathcal L})$. Set ${\mathcal Z}^{{\mathcal L}}:=p^{\mathcal L}({\mathcal Z})$. So this is a sub-$T$-algebra of ${\mathcal Z}({\mathcal L})$. Clearly, for ${\mathcal L}^\prime\subset{\mathcal L}$ we have an obvious surjective homomorphism ${\mathcal Z}^{{\mathcal L}}\to{\mathcal Z}^{{\mathcal L}^\prime}$. For a flat homomorphism $T\to T^\prime$ of base rings the natural homomorphism $\bigoplus_{x\in{\mathcal L}}T\to\bigoplus_{x\in{\mathcal L}}T^\prime$ induces an isomorphism ${\mathcal Z}_T^{{\mathcal L}}\otimes_TT^\prime\cong{\mathcal Z}_{T^\prime}^{\mathcal L}$. \begin{lemma}[{\cite[Lemma 4.6]{FieLanWallCross}}]\label{lemma-candec} The direct sum of the homomorphisms $p^{\overline\Lambda}$ induces an isomorphism ${\mathcal Z}\xrightarrow{\sim}\bigoplus_{\Lambda\in C({\mathcal A}_T)}{\mathcal Z}(\overline\Lambda)$. Hence, ${\mathcal Z}^{\overline\Lambda}={\mathcal Z}(\overline\Lambda)$. \end{lemma} We call ${\mathcal Z}=\bigoplus_{\Lambda\in C({\mathcal A}_T)}{\mathcal Z}^{\overline\Lambda}$ the {\em canonical decomposition} of ${\mathcal Z}$. \subsection{${\mathcal Z}$-modules} For $\alpha\in R^+$ define $T^{\alpha}:=T[\beta^{\vee-1}\mid\beta\in R^+,\beta\ne\alpha] $ and $T^\emptyset:=T[\beta^{\vee-1}\mid \beta\in R^+]$. Let $M$ be a ${\mathcal Z}$-module. \begin{definition} $M$ is called \begin{enumerate} \item {\em root torsion free} if the left multiplication with $\alpha^\vee$ on $M$ is injective for all $\alpha\in R^+$, i.e. if the canonical map $M\to M\otimes_TT^{\emptyset}$ is injective, and \item {\em root reflexive} if $M$ is root torsion free and $M=\bigcap_{\alpha\in R^+}M\otimes_TT^{\alpha}$ as subsets in $M\otimes_TT^{\emptyset}$. \end{enumerate} \end{definition} Let $M$ be a root torsion free $T$-module. For a subset ${\mathcal L}$ of ${\mathcal V}$ we define $M^{{\mathcal L}}:={\mathcal Z}^{{\mathcal L}}\otimes_{{\mathcal Z}} M$. This is a root torsion free ${\mathcal Z}$-module again by Lemma 4.5 in \cite{FieLanWallCross}, and we denote by $p^{{\mathcal L}}\colon M\to M^{{\mathcal L}}$ the homomorphism $m\mapsto 1\otimes m$. Let $T\to T^\prime$ be a flat homomorphism of base rings. Let $M$ be a ${\mathcal Z}_T$-module. Then $M\otimes_TT^{\prime}$ is a ${\mathcal Z}_{T^\prime}$-module and we have a canonical isomorphism $M^{\mathcal L}\otimes_TT^\prime\cong(M\otimes_TT^{\prime})^{{\mathcal L}}$. In the case ${\mathcal L}=\{x\}$ we write $M^x$ instead of $M^{\{x\}}$ and call this the {\em stalk} of $M$ at $x$. \begin{definition} We say that $M$ is {\em ${\mathcal Z}$-supported inside ${\mathcal L}$} if $p^{\mathcal L}\colon M\to M^{{\mathcal L}}$ is an isomorphism. \end{definition} \begin{remark}\label{rem-Zsupp} If $f\colon M\to N$ is a homomorphism between ${\mathcal Z}$-modules and $N$ is ${\mathcal Z}$-supported on ${\mathcal L}$, then $f$ factors uniquely over $p^{{\mathcal L}}\colon M\to M^{{\mathcal L}}$. \end{remark} \subsection{$s$-invariants in ${\mathcal Z}$}\label{sec-sinvZ} Let $s\in{\widehat\CS}$. Note that the right action of ${\widehat\CW}$ on ${\mathcal A}$ preserves (left) ${\mathbb Z} R$-orbits, hence it induces a right action of ${\widehat\CW}$ on ${\mathcal V}$. Again we call a subset ${\mathcal L}$ of ${\mathcal V}$ {\em $s$-invariant} if ${\mathcal L}={\mathcal L} s$. Let ${\mathcal L}\subset{\mathcal V}$ be $s$-invariant. Denote by $\eta_s\colon\bigoplus_{x\in{\mathcal L}}T\to\bigoplus_{x\in{\mathcal L}}T$ the homomorphism given by $\eta_s(z_x)=(z^\prime_x)$, where $z^\prime_x=z_{xs}$ for all $x\in{\mathcal L}$. This preserves the subalgebra ${\mathcal Z}^{\mathcal L}$ (cf. \cite[Lemma 6.6]{FieLanWallCross}). We denote by ${\mathcal Z}^{{\mathcal L},s}$ the subalgebra of $\eta_s$-invariant elements, and by ${\mathcal Z}^{{\mathcal L},{-s}}$ the sub-${\mathcal Z}^{{\mathcal L},s}$-module of $\eta_s$-antiinvariant elements. \begin{lemma} \label{lemma-transsinv} \cite[Lemma 6.8, \ Lemma 6.10]{FieLanWallCross} Let ${\mathcal L}\subset{\mathcal V}$ be $s$-invariant. \begin{enumerate} \item ${\mathcal Z}^{{\mathcal L},-s}\cong{\mathcal Z}^{{\mathcal L}, s}[-2]$ as ${\mathcal Z}^s$-modules. Hence ${\mathcal Z}^{{\mathcal L}}\cong{\mathcal Z}^{{\mathcal L},s}\oplus{\mathcal Z}^{{\mathcal L},-s}[-2]$ as a ${\mathcal Z}^{{\mathcal L},s}$-module. \item For any root torsion free ${\mathcal Z}$-module $M$ that is ${\mathcal Z}$-supported on ${\mathcal L}$ there is a canonical isomorphism $$ {\mathcal Z}\otimes_{{\mathcal Z}^s}M\cong{\mathcal Z}^{{\mathcal L}}\otimes_{{\mathcal Z}^{{\mathcal L},s}} M. $$ In particular, ${\mathcal Z}\otimes_{{\mathcal Z}^s}M$ is again ${\mathcal Z}$-supported on ${\mathcal L}$. \end{enumerate} \end{lemma} Note that the grading shift in the above theorem only makes sense in the case that $T$, and hence ${\mathcal Z}$, is a graded $S$-algebra. In the non-graded setup, the statements of the lemma hold with the shifts omitted. \begin{lemma} \label{lemma-decZ}\cite[Lemma 6.11]{FieLanWallCross} Suppose that $\Lambda\in C({\mathcal A}_T)$ satisfies $\Lambda\ne \Lambda s$. Then the composition ${\mathcal Z}^{\overline{\Lambda\cup\Lambda s},s}\subset{\mathcal Z}^{\overline{\Lambda\cup\Lambda s}}={\mathcal Z}^{\overline\Lambda}\oplus{\mathcal Z}^{{\overline{\Lambda s}}}\xrightarrow{pr_\Lambda}{\mathcal Z}^{\overline\Lambda}$ is an isomorphism of $T$-algebras. \end{lemma} \subsection{Graded free quotients of the structure algebra} \label{subsec-quotZ} For a graded free $S$-module $M\cong\bigoplus_{n\in{\mathbb Z}} S[n]^{r_n}$ of finite rank we set $p(M)=\sum_{n\in{\mathbb Z}} r_nv^{-n}\in{\mathbb Z}[v, v^{-1}]$. This is the {\em graded rank} of $M$. Let $\mu\in X$ and recall the definition of the $(T,\mu)$-topology on ${\mathcal V}$ defined in Section \ref{subsec-toponV}. \begin{proposition}\label{prop-Zlocfree} Let ${\mathcal Y}$ be $(T,\mu)$-open in ${\mathcal V}$. \begin{enumerate} \item The inclusion ${\mathcal Z}_S^{\mathcal Y}\subset{\mathcal Z}_S({\mathcal Y})$ is an isomorphism after applying the functor $(\cdot)\otimes_ST$. \item ${\mathcal Z}_S({\mathcal Y})$ is a graded free $S$-module of graded rank $p({\mathcal Z}_S({{\mathcal Y}}))=\sum_{x\in{\mathcal Y}} v^{2n_{T,x}}$, where $n_{T,x}$ is the number of $\alpha\in R_T^+$ with $s_{\alpha}(x)\le_{T,\mu} x$. \end{enumerate} \end{proposition} \begin{proof} As ${\mathcal V}_{T,\mu}$ splits into the connected components $\overline{\Lambda_\mu}$ and as ${\mathcal Z}_S\otimes_ST=\bigoplus_{\Lambda\in C({\mathcal A}_T)}{\mathcal Z}_S({\overline\Lambda})\otimes_ST$ we can assume that ${\mathcal Y}\subset\overline{\Lambda_\mu}$ for some $\Lambda\in C({\mathcal A}_T)$. Let $A\in\Lambda_\mu$ be minimal. By Lemma \ref{lemma-tauiso} the map $\tau\colon{\mathcal W}_{T,\mu}\to\Lambda_\mu$, $w\mapsto w(A)$ is an isomorphism of partially ordered sets. Hence ${\mathcal X}=\tau^{-1}(\pi^{-1}({\mathcal Y})\cap\Lambda_\mu)$ is an order ideal in ${\mathcal W}_{T,\mu}$ with respect to the Bruhat order $\le_{T,\mu}$. Now ${\mathcal Z}_S(\overline{\Lambda_\mu})$ is the structure algebra of the moment graph ${\mathcal G}_{T}$ associated with the root system $R_T^+$, and ${\mathcal Z}_S^{{\mathcal Y}}$ is hence its image under the projection $\bigoplus_{x\in{\mathcal W}_{T,\mu}}S\to\bigoplus_{x\in{\mathcal X}} S$ along the decomposition. It is proven in \cite{LanJoA} that for all $k$ satisfying the GKM-condition, the Braden--MacPherson sheaf on the Bruhat graph associated with the root system $R_T^+$ has stalk multiplicities $1$. This means it coincides with the structure sheaf. This means that ${\mathcal Z}_S(\overline{\Lambda_\mu})$ and ${\mathcal Z}_S({\mathcal X})$ can be interpreted as the global and the local sections of the Braden--MacPherson sheaf on ${\mathcal G}_T$ (note that here we can refer to local sections as ${\mathcal X}$ is an order ideal). The Braden--MacPherson sheaf is flabby. In particular, together with the identifications above this implies that ${\mathcal Z}_S(\overline{\Lambda_\mu})\to{\mathcal Z}_S({\mathcal Y})$ is surjective. Lemma \ref{lemma-candec} implies that ${\mathcal Z}_S\to{\mathcal Z}_S(\overline{\Lambda_\mu})={\mathcal Z}_S(\overline\Lambda)$ is surjective after applying the functor $(\cdot)\otimes_S T$. The last two statements imply that ${\mathcal Z}_S\to{\mathcal Z}_S({\mathcal Y})$ is surjective after applying $(\cdot)\otimes_ST$, hence (1). By \cite[Corollary 6.5]{FieTAMS}, the Braden--MacPherson sheaves on the moment graph ${\mathcal G}_T$ admits a Verma flag, i.e. the local sections are graded free $S$-modules of finite rank. Using the above identifications again shows that ${\mathcal Z}_S({\mathcal Y})$ is a graded free $S$-module of finite rank. It remains to prove the statement about the multiplicities. We prove this by induction on the number of elements in ${\mathcal Y}$. If ${\mathcal Y}$ is empty, then ${\mathcal Z}_S({\mathcal Y})=\{0\}$ and $p({\mathcal Z}_S({\mathcal Y}))=0$ in accordancewith the alleged equation. Suppose ${\mathcal Y}$ is non-empty. Then there is an element $w$ in ${\mathcal Y}$ such that ${\mathcal Y}^{\prime}={\mathcal Y}\setminus\{w\}$ is $(T,\mu)$-open again (because the topology on ${\mathcal V}$ is induced by a partial order on ${\mathcal K}_\mu$). By what we have shown above, the kernel of the (surjective) homomorphism ${\mathcal Z}_S({\mathcal Y})\to{\mathcal Z}_S({\mathcal Y}^\prime)$ can be identified with the sections of the structure algebra of ${\mathcal G}_T$ that vanish when restricted to ${\mathcal X}^{\prime}=\tau^{-1}(\pi^{-1}({\mathcal Y}^\prime)\cap\overline{\Lambda_\mu})$, i.e. with the graded $S$-module $\alpha_1^\vee\cdots\alpha^\vee_n S$, where $\{\alpha_1,\dots,\alpha_n\}$ is the subset in $R_T^+$ containing all $\alpha$ with the property $s_\alpha(w)\le_{T,\mu} w$. Hence $p({\mathcal Z}_S({\mathcal Y}))=p({\mathcal Z}_S({\mathcal Y}^\prime))+v^{2n}$ and the claim follows by induction. \end{proof} \section{(Pre-)Sheaves on ${\mathcal A}_T$} In this section we review the construction of the categories ${\mathbf S}_T$ and ${\operatorname{pSh}}_T$ of (pre-) sheaves of ${\mathcal Z}_T$-modules on ${\mathcal A}_T$. Again, the main reference is \cite{FieLanWallCross}. We add some new results on morphisms in ${\operatorname{pSh}}_T$. Then we study the exact structure on ${\mathbf S}_T$ that is inherited by its inclusion into the abelian category of sheaves of ${\mathcal Z}_T$-modules on ${\mathcal A}_T$. \subsection{Preliminaries} Fix a base ring $T$. Let ${\mathscr M}$ be a presheaf of ${\mathcal Z}={\mathcal Z}_T$-modules on the topological space ${\mathcal A}_T$. For any open subset ${\mathcal J}$ of ${\mathcal A}_T$ we write ${\mathscr M}{({\mathcal J})}$ for the ${\mathcal Z}$-module of sections of ${\mathscr M}$ over ${\mathcal J}$. We often write $\Gamma({\mathscr M})$ for the space ${\mathscr M}({\mathcal A})$ of global sections of ${\mathscr M}$. For an inclusion ${\mathcal J}^\prime\subset{\mathcal J}$ denote by $r_{{\mathcal J}}^{{\mathcal J}^\prime}\colon {\mathscr M}({\mathcal J})\to{\mathscr M}{({\mathcal J}^\prime)}$ the restriction homomorphism. Most often we write $m|_{{\mathcal J}^\prime}$ instead of $r_{\mathcal J}^{{\mathcal J}^\prime}(m)$. If the base ring $T$ is graded, so is the $T$-algebra ${\mathcal Z}$, and then we assume that all local sections are graded. If ${\mathscr M}$ is such a presheaf, we obtain, for $n\in{\mathbb Z}$, the shifted presheaf ${\mathscr M}[n]$ by applying the shift $(\cdot)[n]$ to all local sections. \begin{definition} Let ${\mathscr M}$ be a presheaf of ${\mathcal Z}$-modules on ${\mathcal A}_T$. \begin{enumerate}\item We say that ${\mathscr M}$ is {\em finitary} if ${\mathscr M}(\emptyset)=0$ and if there exists a finite subset ${\mathcal T}$ of ${\mathcal A}$ such that for any $T$-open subset ${\mathcal J}$ the restriction ${\mathscr M}({\mathcal J})\to{\mathscr M}(({\mathcal J}\cap {\mathcal T})_{\preceq_T})$ is an isomorphism. \item We say that ${\mathscr M}$ is {\em root torsion free} if any ${\mathcal Z}$-module of local sectio ns is root torsion free. \item We say that ${\mathscr M}$ is {\em root reflexive} if any ${\mathcal Z}$-module of local section is root reflexive.\end{enumerate} \end{definition} \subsection{The support condition} Let ${\mathscr M}$ be a root torsion free presheaf. If ${\mathcal L}$ is a subset of ${\mathcal V}$, then we can define a new presheaf ${\mathscr M}^{{\mathcal L}}$ by composing with the functor $(\cdot)^{\mathcal L}$. Again we write ${\mathscr M}^x$ instead of ${\mathscr M}^{\{x\}}$. Denote by $i_x\colon x\to{\mathcal A}$ the inclusion. \begin{definition} We say that ${\mathscr M}$ satisfies the {\em support condition} if the natural morphism ${\mathscr M}^x\to i_{x\ast}i_x^\ast{\mathscr M}^x$ is an isomorphism of presheaves for all $x\in{\mathcal V}$. \end{definition} Explicitely, this means that for any $x\in{\mathcal V}$ and any $T$-open subset ${\mathcal J}$, the homomorphism ${\mathscr M}({\mathcal J})^x\to{\mathscr M}(({\mathcal J}\cap x)_{\preceq_T})^x$, i.e. the $x$-stalk of the restriction homomorphism, is an isomorphism. The following may justify the notion ``support condition''. \begin{lemma}\label{lemma-suppcond} \cite[Lemma 5.2]{FieLanWallCross} Let ${\mathscr M}$ be a root torsion free and flabby presheaf. Then ${\mathscr M}$ satisfies the support condition if and only if the following holds. For any inclusion ${\mathcal J}^\prime\subset{\mathcal J}$ of $T$-open sets the kernel of the restriction homomorphism ${\mathscr M}({\mathcal J})\to{\mathscr M}{({\mathcal J}^\prime)}$ is ${\mathcal Z}$-supported on $\pi({\mathcal J}\setminus{\mathcal J}^\prime)$. \end{lemma} \begin{definition} Denote by ${\operatorname{pSh}}={\operatorname{pSh}}_T$ the full subcategory of the category of presheaves of ${\mathcal Z}$-modules on ${\mathcal A}_T$ that contains all objects ${\mathscr M}$ that are flabby, finitary, root torsion free and satisfy the support condition. \end{definition} Let ${\mathscr M}$ be a presheaf of ${\mathcal Z}$-modules on ${\mathcal A}_T$. The canonical decomposition ${\mathcal Z}=\bigoplus_{\Lambda\in C({\mathcal A}_T)}{\mathcal Z}^{\overline\Lambda}$ induces a direct sum decomposition ${\mathscr M}=\bigoplus_{\Lambda\in C({\mathcal A}_T)}{\mathscr M}^{\overline\Lambda}$ of presheaves on ${\mathcal A}_T$. \begin{lemma}[{\cite[Lemma 5.4]{FieLanWallCross}}] \label{lemma-supdirsum} If ${\mathscr M}$ is an object in ${\operatorname{pSh}}$, then ${\mathscr M}^{\overline\Lambda}$ is supported as a presheaf on $\Lambda$ for all $\Lambda\in C({\mathcal A}_T)$. \end{lemma} Recall that ${\mathscr M}$ is {\em supported as a presheaf} on ${\mathcal T}\subset{\mathcal A}$ if the restriction homomorphism ${\mathscr M}({\mathcal J})\to{\mathscr M}(({\mathcal J}\cap{\mathcal T})_{\preceq_T})$ is an isomorphism for all $T$-open subsets ${\mathcal J}$. The following two results did not appear in \cite{FieLanWallCross}. \begin{lemma}\label{lemma-supp2} Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$ that is supported as a presheaf on the locally closed subset ${\mathcal K}$ of ${\mathcal A}_T$. Then the ${\mathcal Z}$-module ${\mathscr M}({\mathcal J})$ is ${\mathcal Z}$-supported on $\pi({\mathcal J}\cap{\mathcal K})$ for any $T$-open subset ${\mathcal J}$. \end{lemma} \begin{proof} Set ${\mathcal O}:={\mathcal K}_{\preceq_T}\setminus{\mathcal K}$. This is a $T$-open subset of ${\mathcal A}$ by Lemma \ref{lemma-top}. Consider the restriction homomorphisms ${\mathscr M}({\mathcal J})\to{\mathscr M}({\mathcal J}\cap{\mathcal K}_{\preceq_T})\to{\mathscr M}({\mathcal J}\cap{\mathcal O})$. As ${\mathcal J}\cap{\mathcal K}_{\preceq_T}\cap{\mathcal K}={\mathcal J}\cap{\mathcal K}$ the first homomorphism is an isomorphism. As ${\mathcal J}\cap{\mathcal O}\cap{\mathcal K}=\emptyset$ and as ${\mathscr M}$ is finitary, ${\mathscr M}({\mathcal J}\cap{\mathcal O})={\mathscr M}(\emptyset)=0$. By Lemma \ref{lemma-suppcond}, ${\mathscr M}({\mathcal J})$ is ${\mathcal Z}$-supported on $\pi(({\mathcal J}\cap{\mathcal K}_{\preceq_T})\setminus({\mathcal J}\cap{\mathcal O}))=\pi({\mathcal J}\cap{\mathcal K})$. \end{proof} \begin{lemma} \label{lemma-homs2} Suppose ${\mathcal K}\subset{\mathcal A}_T$ is a section. Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$ supported on ${\mathcal K}$, and let ${\mathscr N}$ be an object in ${\operatorname{pSh}}$ supported on ${\mathcal K}_{\succeq_T}$. \begin{enumerate} \item For any inclusion ${\mathcal J}^\prime\subset {\mathcal J}$ of $T$-open sets the restriction homomorphism ${\mathscr M}({\mathcal J})\to{\mathscr M}({\mathcal J}^{\prime})$ induces an isomorphism ${\mathscr M}({\mathcal J})^{\pi({\mathcal J}^\prime\cap{\mathcal K})}\xrightarrow{\sim}{\mathscr M}({\mathcal J}^\prime)$. \item The global section functor induces an isomorphism ${\operatorname{Hom}}_{{\operatorname{pSh}}}({\mathscr M},{\mathscr N})\xrightarrow{\sim}{\operatorname{Hom}}_{{\mathcal Z}}(\Gamma({\mathscr M}),\Gamma({\mathscr N}))$. \end{enumerate} \end{lemma} \begin{proof} (1) From Lemma \ref{lemma-supp2} and Remark \ref{rem-Zsupp} we obtain a homomorphism ${\mathscr M}({\mathcal J})^{\pi({\mathcal J}^\prime\cap{\mathcal K})}\to{\mathscr M}({\mathcal J}^\prime)$. As ${\mathscr M}$ is flabby, this homomorphism is surjective. We now show that the kernel of ${\mathscr M}({\mathcal J})\to{\mathscr M}({\mathcal J}^\prime)$ is ${\mathcal Z}$-supported on the complement of $\pi({\mathcal J}^\prime\setminus{\mathcal K})$ in ${\mathcal V}$, which yields the injectivity of the former homomorphism. As ${\mathscr M}$ is supported on ${\mathcal K}$, the above homomorphism identifies with the restriction homomorphism ${\mathscr M}(({\mathcal J}\cap{\mathcal K})_{\preceq_T})\to{\mathscr M}(({\mathcal J}^\prime\cap{\mathcal K})_{\preceq_T})$. By Lemma \ref{lemma-suppcond}, its kernel is hence ${\mathcal Z}$-supported on $\pi(({\mathcal J}\cap{\mathcal K})_{\preceq_T}\setminus({\mathcal J}^\prime\cap{\mathcal K})_{\preceq_T})$, so we need to show that $\pi(({\mathcal J}\cap{\mathcal K})_{\preceq_T}\setminus({\mathcal J}^\prime\cap{\mathcal K})_{\preceq_T})\cap\pi({\mathcal J}^\prime\cap{\mathcal K})=\emptyset$. Let $A\in{\mathcal J}^\prime\cap{\mathcal K}$ and suppose that $A+\tau\in({\mathcal J}\cap{\mathcal K})_{\preceq_T}$. Then $A+\tau\in{\mathcal K}_{\preceq_T}$. As ${\mathcal K}$ is a section, we have ${\mathcal K}_{\preceq_T}=\bigcup_{\gamma\ge 0}{\mathcal K}-\gamma$ and ${\mathcal K}+\gamma\cap{\mathcal K}+{\gamma^\prime}=\emptyset$ for $\gamma\ne\gamma^\prime$. So $\tau\le 0$ and hence $A+\tau\in({\mathcal J}^\prime\cap{\mathcal K})_{\preceq_T}$, which proves our claim. (2) The injectivity of the homomorphism induced by the global section functor follows from the fact that ${\mathscr M}$ is flabby. It remains to prove that the homomorphism is surjective. So let $g\colon \Gamma({\mathscr M})\to\Gamma({\mathscr N})$ be a homomorphism of ${\mathcal Z}$-modules. Let ${\mathcal J}$ be open in ${\mathcal A}_T$. By Lemma \ref{lemma-supp2}, ${\mathscr N}({\mathcal J})$ is ${\mathcal Z}$-supported on $\pi({\mathcal J}\cap{\mathcal K}_{\succeq_T})$. We claim that this coincides with $\pi({\mathcal J}\cap{\mathcal K})$. Clearly $\pi({\mathcal J}\cap{\mathcal K})\subset\pi({\mathcal J}\cap{\mathcal K}_{\succeq_T})$. The converse inclusion follows from the defining property ${\mathcal K}_{\succeq_T}=\bigcup_{\gamma\ge0}{\mathcal K}+\gamma$ of a section and the fact that $A+\gamma\in{\mathcal J}$ implies $A\in{\mathcal J}$ for $\gamma\ge 0$. Hence the composition $\Gamma({\mathscr M})\xrightarrow{g}\Gamma({\mathscr N})\to{\mathscr N}({\mathcal J})$ factors over $\Gamma({\mathscr M})\to \Gamma({\mathscr M})^{\pi({\mathcal J}\cap{\mathcal K})}$, and so, using (1), induces a homomorphism $f({\mathcal J})\colon {\mathscr M}({\mathcal J})\xleftarrow{\sim}\Gamma({\mathscr M})^{\pi({\mathcal J}\cap{\mathcal K})}\to {\mathscr N}({\mathcal J})$. So we constructed a homomorphism ${\mathscr M}({\mathcal J})\to{\mathscr N}({\mathcal J})$ for any open subset ${\mathcal J}$. Clearly these are compatible with restrictions, and hence yield a morphism $f\colon{\mathscr M}\to{\mathscr N}$ of presheaves with $\Gamma(f)=g$. \end{proof} \subsection{Admissible families and rigidity} Suppose that ${\mathbb T}$ is a family of subsets in ${\mathcal A}$. \begin{definition}\label{def-adm} We say that ${\mathbb T}$ is a {\em $T$-admissible family}, if it satisfies the following. \begin{itemize} \item ${\mathcal A}\in{\mathbb T}$. \item Each element in ${\mathbb T}$ is $T$-open. \item ${\mathbb T}$ is stable under finite intersections. \item For any open $T$-subset ${\mathcal J}$ and any $x\in{\mathcal V}$, there is some ${\mathcal J}^\prime\in{\mathbb T}$ with ${\mathcal J}\cap x={\mathcal J}^\prime\cap x$. \end{itemize} \end{definition} Here are some examples of admissible families. \begin{lemma} \cite[Lemma 3.16, Lemma 6.4 and Lemma 6.5]{FieLanWallCross} \begin{enumerate} \item For $s\in{\widehat\CS}$, the set of $s$-invariant $T$-open subsets of ${\mathcal A}$ is $T$-admissible. \item Let $T\to T^\prime$ be a homomorphism of base rings. Then the set of $T$-open subsets in ${\mathcal A}$ is $T^\prime$-admissible. \item Let $T\to T^\prime$ be a homomorphism of base rings and $s\in{\widehat\CS}$. Then the set of $s$-invariant $T$-open subsets in ${\mathcal A}$ is $T^\prime$-admissible. \end{enumerate} \end{lemma} The following result is the reason why the above is a useful notion. \begin{proposition}\label{prop-rig} \cite[Proposition 5.7]{FieLanWallCross} Suppose that ${\mathbb T}$ is a $T$-admissible family. Let ${\mathscr M}$ and ${\mathscr N}$ be objects in ${\operatorname{pSh}}$. Suppose we are given a homomorphism $f^{({\mathcal J})}\colon {\mathscr M} {({\mathcal J})}\to {\mathscr N} {({\mathcal J})}$ of ${\mathcal Z}$-modules for each ${\mathcal J}\in{\mathbb T}$ in such a way that for any inclusion ${\mathcal J}^\prime\subset{\mathcal J}$ of sets in ${\mathbb T}$ the diagram \centerline{ \xymatrix{ {\mathscr M} {({\mathcal J})}\ar[rr]^{f^{({\mathcal J})}}\ar[d]_{r_{\mathcal J}^{{\mathcal J}^\prime}}&&{\mathscr N} {({\mathcal J})}\ar[d]^{r_{{\mathcal J}}^{{\mathcal J}^\prime}}\\ {\mathscr M} {({\mathcal J}^\prime)}\ar[rr]^{f^{({\mathcal J}^\prime)}}&&{\mathscr N} {({\mathcal J}^\prime)} } } \noindent commutes. Then there is a unique morphism $f\colon {\mathscr M} \to {\mathscr N} $ in ${\operatorname{pSh}}$ such that $f{({\mathcal J})}=f^{({\mathcal J})}$ for all ${\mathcal J}\in{\mathbb T}$. \end{proposition} \subsection{Base change} Suppose that $T\to T^\prime$ is a flat homomorphism of base rings. The following statement defines and characterizes a base change functor $\cdot\boxtimes_TT^\prime$ from ${\operatorname{pSh}}_T$ to ${\operatorname{pSh}}_{T^\prime}$. \begin{proposition}\label{prop-defbox} \cite[Proposition 5.8]{FieLanWallCross} There is a unique functor $\cdot\boxtimes_TT^\prime\colon {\operatorname{pSh}}_T\to{\operatorname{pSh}}_{T^\prime}$ with the following property. For any $T$-open subset ${\mathcal J}$ in ${\mathcal A}$ there is an isomorphism $({\mathscr M}\boxtimes_TT^\prime)({\mathcal J})\cong{\mathscr M}({\mathcal J})\otimes_TT^\prime$ of ${\mathcal Z}_{T^\prime}$-modules that is functorial in ${\mathscr M}$ and compatible with the restriction homomorphisms for an inclusion of $T$-open subsets. \end{proposition} The following defines the most relevant category for our purposes. \begin{definition}\label{def-C} Denote by ${\mathbf S}={\mathbf S}_T$ the full subcategory of the category ${\operatorname{pSh}}_T$ that contains all objects ${\mathscr M}$ that have the property that for all flat homomorphisms $T\to T^\prime$ of base rings the presheaf ${\mathscr M}\boxtimes_TT^\prime$ is a root reflexive sheaf on ${\mathcal A}_{T^\prime}$. \end{definition} \subsection{An exact structure on ${\mathbf S}$ } The category ${\mathbf S}$ is not abelian. One reason for this is that the objects in ${\mathbf S}$ are supposed to be torsion free, which prohibits the existence of general cokernels. However, the category ${\mathbf S}$ is a full subcategory of a category of sheaves of ${\mathcal Z}$-modules on ${\mathcal A}_T$, hence it inherits an exact structure. Here we collect some first properties of this exact structure. \begin{lemma}\label{lemma-ses1} Let $0\to{\mathscr A}\to{\mathscr B}\to{\mathscr C}\to 0$ be a sequence in ${\mathbf S}$. Then the following statements are equivalent: \begin{enumerate} \item The sequence is exact (i.e. exact in the category of sheaves of ${\mathcal Z}$-modules on ${\mathcal A}_T$). \item For any open subset ${\mathcal J}$ of ${\mathcal A}_T$, the sequence $ 0\to{\mathscr A}({\mathcal J})\to{\mathscr B}({\mathcal J})\to{\mathscr C}({\mathcal J})\to 0 $ is exact in the category of ${\mathcal Z}$-modules (i.e. the sequence is exact as a sequence of presheaves). \item For any $A\in{\mathcal A}_T$, the sequence $ 0\to{\mathscr A}({\preceq_T A})\to{\mathscr B}({\preceq_T A})\to{\mathscr C}({\preceq_T A})\to 0 $ is exact in the category of ${\mathcal Z}$-modules. \end{enumerate} \end{lemma} \begin{proof} Recall that a sequence of sheaves is exact if and only if the induced sequences on all stalks are exact. Hence (1) and (3) are equivalent. Moreover, (3) is a special case of (2). And (1) implies (2) by standard arguments (using the flabbiness of ${\mathscr A}$). \end{proof} Note that, in particular, presheaf-(co-)kernels and sheaf-(co-)kernels for morphisms in the category ${\mathbf S}$ coincide. \section{Restriction functors and subquotients} In this section we consider two constructions on objects in ${\mathbf S}$ that did not appear in \cite{FieLanWallCross}. We define the restriction functor $(\cdot)|_{{\mathcal O}}$ for an open subset ${\mathcal O}$ (more precisely, the functor $i_\ast i^\ast$ for the inclusion $i\colon{\mathcal O}\to{\mathcal A}_T$), and a subquotient functor $(\cdot)_{[{\mathcal O}\setminus{\mathcal O}^\prime]}$ associated with an inclusion ${\mathcal O}^\prime\subset{\mathcal O}$ of open subsets. \subsection{The restriction functor} Fix a base ring $T$. Let ${\mathcal O}\subset{\mathcal A}_T$ be an open subset and denote by $i\colon{\mathcal O}\to{\mathcal A}_T$ the inclusion. Then ${\mathcal O}$ inherits the structure of a topological space. Given a presheaf ${\mathscr M}$ on ${\mathcal A}_T$ we define the presheaf ${\mathscr M}|_{\mathcal O}:=i_\ast i^\ast{\mathscr M}$ on ${\mathcal A}_T$. More explicitely, for an open subset ${\mathcal J}$ the local sections are $$ {\mathscr M}|_{\mathcal O}({\mathcal J})={\mathscr M}({{\mathcal J}\cap{\mathcal O}}), $$ and the restriction homomorphism is $r_{{\mathcal J}\cap{\mathcal O}}^{{\mathcal J}^\prime\cap{\mathcal O}}$ for ${\mathcal J}^\prime\subset{\mathcal J}$. For ${\mathcal O}^\prime\subset{\mathcal O}$ there is an obvious morphism ${\mathscr M}|_{{\mathcal O}}\to{\mathscr M}|_{{\mathcal O}^\prime}$ of presheaves. Note that if ${\mathscr M}$ is a sheaf, then ${\mathscr M}|_{\mathcal O}$ is also a sheaf. \begin{lemma}\label{lemma-admres} Let ${\mathcal O}$ be an open subset of ${\mathcal A}_T$. \begin{enumerate} \item If ${\mathscr M}$ is a flabby presheaf satisfying the support condition, then ${\mathscr M}|_{{\mathcal O}}$ satisfies the support condition as well. \item If ${\mathscr M}$ is an object in ${\operatorname{pSh}}$, then so is ${\mathscr M}|_{\mathcal O}$. \item For a flat homomorphism $T\to T^\prime$ of base rings and an object ${\mathscr M}$ of ${\operatorname{pSh}}$ we have $({\mathscr M}\boxtimes_TT^\prime)|_{\mathcal O}=({\mathscr M}|_{\mathcal O})\boxtimes_TT^\prime$ functorially in ${\mathscr M}$. \item If ${\mathscr M}$ is an object in ${\mathbf S}$, then so is ${\mathscr M}|_{\mathcal O}$. \end{enumerate} \end{lemma} \begin{proof} (1) Clearly ${\mathscr M}|_{\mathcal O}$ is a flabby presheaf. Hence we can use the statement in Lemma \ref{lemma-suppcond}. So let ${\mathcal J}^\prime\subset {\mathcal J}$ be open in ${\mathcal A}_T$. We need to show that the kernel of ${\mathscr M}({\mathcal J}\cap{\mathcal O})\to{\mathscr M}({\mathcal J}^\prime\cap{\mathcal O})$ is ${\mathcal Z}$-supported on $\pi({\mathcal J}\setminus{\mathcal J}^\prime)$. But as ${\mathscr M}$ satisfies the support condition, this kernel is ${\mathcal Z}$-supported even on the subset $\pi(({\mathcal J}\cap{\mathcal O})\setminus({\mathcal J}^\prime\cap{\mathcal O}))$ of $\pi({\mathcal J}\setminus{\mathcal J}^\prime)$. (2) Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$. It is clear that ${\mathscr M}|_{{\mathcal O}}$ is finitary, flabby and root torsion free. By (1) it also satisfies the support condition. (3) Let ${\mathcal J}$ be a $T$-open. Then $({\mathscr M}|_{{\mathcal O}})\boxtimes_TT^\prime({\mathcal J})={\mathscr M}|_{{\mathcal O}}({\mathcal J})\otimes_TT^\prime={\mathscr M}({\mathcal J}\cap{\mathcal O})\otimes_TT^\prime=({\mathscr M}\boxtimes_TT^\prime)({\mathcal J}\cap{\mathcal O})=({\mathscr M}\boxtimes_TT^\prime)|_{\mathcal O}({\mathcal J})$ functorially in ${\mathscr M}$. As ${\mathscr M}|_{\mathcal O}\boxtimes_TT^\prime$ and $({\mathscr M}\boxtimes_TT^\prime)|_{\mathcal O}$ are objects in ${\operatorname{pSh}}$ by the above, the statement (3) follows from Proposition \ref{prop-rig} and the fact that the $T$-open sets form a $T^\prime$-admissible family. (4) It is clear that ${\mathscr M}|_{\mathcal O}$ is root reflexive if ${\mathscr M}$ is, and that it is a sheaf if ${\mathscr M}$ is a sheaf. The claim follows from this and the above statements. \end{proof} \subsection{Subquotients} Let ${\mathscr M}$ be a presheaf of ${\mathcal Z}$-modules on ${\mathcal A}_T$. Recall that for a locally closed subset ${\mathcal K}$, the set ${\mathcal K}_{\preceq_T}\setminus{\mathcal K}$ is open by Lemma \ref{lemma-top}. \begin{definition} Define ${\mathscr M}_{[{\mathcal K}]}$ as the kernel in the category of presheaves of the natural morphism ${\mathscr M}|_{{\mathcal K}_{\preceq_T}}\to{\mathscr M}|_{{\mathcal K}_{\preceq_T}\setminus{\mathcal K}}$. \end{definition} More explicitely, ${\mathscr M}_{[{\mathcal K}]}({\mathcal J})$ is the kernel of the restriction morphism ${\mathscr M}({\mathcal J}\cap{\mathcal K}_{\preceq_T})\to{\mathscr M}({\mathcal J}\cap({\mathcal K}_{\preceq_T}\setminus{\mathcal K}))$ for any open set ${\mathcal J}$, and the restriction morphism is induced by the restriction morphism ${\mathscr M}({\mathcal J}\cap{\mathcal K}_{\preceq_T})\to{\mathscr M}({\mathcal J}^\prime\cap{\mathcal K}_{\preceq_T})$ for a pair ${\mathcal J}^\prime\subset{\mathcal J}$. \begin{remark}\label{rem-suppcond2} \begin{enumerate} \item Suppose that ${\mathscr M}$ is a finitary sheaf. Then ${\mathscr M}$ is supported on ${\mathcal K}$ if and only if ${\mathscr M}={\mathscr M}_{[{\mathcal K}]}$ (easy exercise). In particular, ${\mathscr M}_{[{\mathcal K}]}$ is supported on ${\mathcal K}$. \item If ${\mathscr M}$ is a flabby presheaf and satisfies the support condition, then it follows from Lemma \ref{lemma-suppcond} that each local section of ${\mathscr M}_{[{\mathcal K}]}$ is ${\mathcal Z}$-supported on $\pi({\mathcal K})\subset{\mathcal V}$. \end{enumerate} \end{remark} \begin{lemma} \label{lemma-reshoms} Let ${\mathcal K}$ be a locally closed subset of ${\mathcal A}_T$. Let ${\mathscr M}$ be an object in ${\mathbf S}$. \begin{enumerate} \item Suppose ${\mathcal O}^\prime\subset{\mathcal O}\subset{\mathcal A}_T$ are open sets with ${\mathcal K}={\mathcal O}\setminus{\mathcal O}^\prime$. Then the morphism ${\mathscr M}|_{{\mathcal O}}\to{\mathscr M}|_{{\mathcal K}_{\preceq_T}}$ induces an isomorphism $$ \ker({\mathscr M}|_{{\mathcal O}}\to {\mathscr M}|_{{\mathcal O}^\prime})\cong {\mathscr M}_{[{\mathcal K}]}. $$ \item There is a cofiltration ${\mathscr M}_{[{\mathcal K}]}={\mathscr M}_0\supset {\mathscr M}_1\supset\dots\supset {\mathscr M}_{n+1}=0$ in the category of sheaves with ${\mathscr M}_{i-1}/{\mathscr M}_{i}\cong{\mathscr M}_{[A_i]}$ for some $A_i\in{\mathcal K}$ such that $A_j\preceq A_i$ implies $j\le i$. \end{enumerate} \end{lemma} \begin{proof} (1) is an exercise in sheaf theory, and (2) follows from (1). \end{proof} \begin{lemma}\label{lemma-propres} Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$ and let ${\mathcal K}\subset{\mathcal A}_T$ be locally closed. \begin{enumerate} \item ${\mathscr M}_{[{\mathcal K}]}$ is finitary and root torsion free. If ${\mathscr M}$ is root reflexive, then so is ${\mathscr M}_{[{\mathcal K}]}$. \item If ${\mathscr M}$ is a sheaf, then ${\mathscr M}_{[{\mathcal K}]}$ is a flabby sheaf. \item For a flat homomorphism $T\to T^\prime$ we have $({\mathscr M}\boxtimes_TT^\prime)_{[{\mathcal K}]}\cong{\mathscr M}_{[{\mathcal K}]}\boxtimes_TT^\prime$. \item If ${\mathscr M}$ is an object in ${\mathbf S}$, then so is ${\mathscr M}_{[{\mathcal K}]}$. \end{enumerate} \end{lemma} \begin{proof} Set ${\mathcal O}={\mathcal K}_{\preceq_T}\setminus{\mathcal K}$. (1) It is clear that ${\mathscr M}_{[{\mathcal K}]}$ is finitary. For any open subset ${\mathcal J}$, ${\mathscr M}_{[{\mathcal K}]}({\mathcal J})$ is the kernel of ${\mathscr M}({\mathcal J}\cap{\mathcal K}_{\preceq_T})\to{\mathscr M}({\mathcal J}\cap{\mathcal O})$. As a submodule of a root torsion free module, ${\mathscr M}_{[{\mathcal K}]}({\mathcal J})$ is root torsion free, and as the kernel of a homomorphism between root reflexive modules it is root reflexive. (2) If ${\mathscr M}$ is a sheaf, then so are ${\mathscr M}|_{{\mathcal K}_{\preceq_T}}$ and ${\mathscr M}|_{{\mathcal O}}$. As a kernel of a homomorphism of sheaves, ${\mathscr M}_{[{\mathcal K}]}$ is a sheaf (note that even the presheaf kernel is a sheaf). Now let ${\mathcal J}$ be open in ${\mathcal A}_T$, and let $m\in{\mathscr M}_{[{\mathcal K}]}({\mathcal J})$ be a section. Then $m$ is a section in ${\mathscr M}({\mathcal J}\cap{\mathcal K}_{\preceq_T})$ with the property that $m|_{{\mathcal J}\cap{\mathcal O}}=0$. As ${\mathscr M}$ is a sheaf, there is a section $m^\prime\in{\mathscr M}(({\mathcal J}\cap{\mathcal K}_{\preceq_T})\cup{\mathcal O})$ with $m^\prime|_{{\mathcal J}\cap{\mathcal K}_{\preceq_T}}=m$ and $m^\prime|_{{\mathcal O}}=0$. As ${\mathscr M}$ is flabby, there is a section $m^{\prime\prime}\in{\mathscr M}({\mathcal K}_{\preceq_T})$ with $m^{\prime\prime}|_{({\mathcal J}\cap{\mathcal K}_{\preceq_T})\cup{\mathcal O}}=m^\prime$. Then $m^{\prime\prime}$ is a global section of ${\mathscr M}_{[{\mathcal K}]}$ and is a preimage of $m$. Hence ${\mathscr M}_{[{\mathcal K}]}$ is flabby. (3) Let ${\mathcal J}$ be a $T$-open subset. By definition, ${\mathscr M}_{[{\mathcal K}]}({\mathcal J})$ is the kernel of $a\colon{\mathscr M}({\mathcal J}\cap {\mathcal K}_{\preceq_T})\to{\mathscr M}({\mathcal J}\cap{\mathcal O})$, and $({\mathscr M}\boxtimes_TT^\prime)_{[{\mathcal K}]}({\mathcal J})$ is the kernel of $b\colon{\mathscr M}\boxtimes_TT^\prime({\mathcal J}\cap {\mathcal K}_{\preceq_T})\to{\mathscr M}\boxtimes_TT^\prime({\mathcal J}\cap{\mathcal O})$ (by Lemma \ref{lemma-reshoms}). By the characterizing property of the base change functor, $b=a\otimes_TT^\prime$. As $T\to T^\prime$ is flat, we obtain an identification $\ker b=(\ker a)\otimes_TT^\prime$, i.e. $({\mathscr M}_{[{\mathcal K}]}\boxtimes_TT^\prime)({\mathcal J})={\mathscr M}_{[{\mathcal K}]}({\mathcal J})\otimes_TT^\prime=({\mathscr M}\boxtimes_TT^\prime)_{[{\mathcal K}]}({\mathcal J})$ which is compatible with the restriction for an inclusion of $T$-open subsets. From Proposition \ref{prop-rig} we obtain an isomorphism ${\mathscr M}_{[{\mathcal K}]}\boxtimes_TT^\prime\cong({\mathscr M}\boxtimes_TT^\prime)_{[{\mathcal K}]}$. (4) After having proven (1), (2) and (3) it suffices to show that ${\mathscr M}_{[{\mathcal K}]}$ satisfies the support condition. For this we use Lemma \ref{lemma-suppcond}. So let ${\mathcal J}^\prime\subset{\mathcal J}$ be open subsets. Then the kernel of ${\mathscr M}_{[{\mathcal K}]}({\mathcal J})\to{\mathscr M}_{[{\mathcal K}]}({\mathcal J}^\prime)$ is contained in the kernel of ${\mathscr M}|_{{\mathcal K}_{\preceq_T}}({\mathcal J})\to{\mathscr M}|_{{\mathcal K}_{\preceq_T}}({\mathcal J}^\prime)$. The latter is ${\mathcal Z}$-supported on $\pi({\mathcal J}\setminus{\mathcal J}^\prime)$, as ${\mathscr M}|_{{\mathcal K}_{\preceq_T}}$ satisfies the support condition. Hence so is the former. \end{proof} \subsection{Exactness and subquotients} \begin{lemma}\label{lemma-ses2} Let $0\to{\mathscr A}\to{\mathscr B}\to{\mathscr C}\to 0$ be a sequence in ${\mathbf S}$. Then the following statements are equivalent: \begin{enumerate} \item The sequence is exact. \item For any open subset ${\mathcal O}$ of ${\mathcal A}_T$ the sequence $0\to{\mathscr A}|_{{\mathcal O}}\to{\mathscr B}|_{{\mathcal O}}\to{\mathscr C}|_{{\mathcal O}}\to 0 $ is an exact sequence of sheaves on ${\mathcal A}_T$. \item For any locally closed subset ${\mathcal K}$ of ${\mathcal A}_T$ the sequence $ 0\to{\mathscr A}_{[{\mathcal K}]}\to{\mathscr B}_{[{\mathcal K}]}\to{\mathscr C}_{[{\mathcal K}]}\to 0 $ is an exact sequence of sheaves on ${\mathcal A}_T$. \item For any $A\in{\mathcal A}_T$, the sequence $ 0\to{\mathscr A}_{[A]}\to{\mathscr B}_{[A]}\to{\mathscr C}_{[A]}\to 0 $ is an exact sequence of sheaves on ${\mathcal A}_T$. \end{enumerate} \end{lemma} \begin{proof} By Lemma \ref{lemma-ses1} a sequence of sheaves is exact if and only if all induced local section sequences are exact. This shows that (1) and (2) are equivalent. (1) and (4) are special cases of (3), and (4) and the snake lemma imply (3), as for each object ${\mathscr M}$ in ${\mathbf S}$ its subquotient ${\mathscr M}_{[{\mathcal K}]}$ is an extension of the subquotients ${\mathscr M}_{[A]}$ with $A\in{\mathcal K}$. Suppose (1) holds. Then all sequences of local sections are exact. The snake lemma implies that all induced sequences of local sections of $0\to{\mathscr A}_{[{\mathcal K}]}\to{\mathscr B}_{[{\mathcal K}]}\to{\mathscr C}_{[{\mathcal K}]}\to 0$ are exact, hence another application of Lemma \ref{lemma-ses1} shows that (1) implies (3). \end{proof} \subsection{On morphisms in ${\mathbf S}$} Let ${\mathcal I}$ be a closed subset of ${\mathcal A}_T$. Note that ${\mathcal I}_{\preceq_T}=\Lambda$, where $\Lambda$ is the union of the connected components of ${\mathcal A}_T$ that have non-empty intersection with ${\mathcal I}$. For an object ${\mathscr M}$ in ${\operatorname{pSh}}$ its restriction to $\Lambda$ is a direct summand (cf. Lemma \ref{lemma-supdirsum}). It follows that we can consider ${\mathscr M}_{[{\mathcal I}]}$ as a sub-presheaf of ${\mathscr M}$. \begin{lemma}\label{lemma-homs1} Let ${\mathscr M}$ and ${\mathscr N}$ be objects in ${\mathbf S}$ and suppose that ${\mathscr M}$ is supported on ${\mathcal K}$. Then the image of any morphism $f\colon{\mathscr M}\to{\mathscr N}$ is contained in ${\mathscr N}_{[{\mathcal K}_{\succeq_T}]}$, i.e. the canonical homomorphism ${\operatorname{Hom}}_{{\operatorname{pSh}}}({\mathscr M},{\mathscr N}_{[{\mathcal K}_{\succeq_T}]})\to{\operatorname{Hom}}_{\operatorname{pSh}}({\mathscr M},{\mathscr N})$ is an isomorphism. \end{lemma} \begin{proof} Let ${\mathcal O}$ be the open complement of ${\mathcal K}_{\succeq_T}$ in ${\mathcal A}_T$. For an arbitrary open subset ${\mathcal J}$ the diagram \centerline{ \xymatrix{ {\mathscr M}({\mathcal J})\ar[r]^{f({\mathcal J})}\ar[d]&{\mathscr N}({\mathcal J})\ar[d]\\ {\mathscr M}({\mathcal O}\cap{\mathcal J})\ar[r]^{f({\mathcal O}\cap{\mathcal J})}&{\mathscr N}({\mathcal O}\cap{\mathcal J}) } } \noindent commutes. As ${\mathscr M}$ is supported on ${\mathcal K}$, ${\mathscr M}({\mathcal O}\cap{\mathcal J})=0$, hence the image of $f({\mathcal J})$ is contained in the kernel of ${\mathscr N}({\mathcal J})\to{\mathscr N}({\mathcal O}\cap{\mathcal J})$, which is ${\mathscr N}_{[{\mathcal K}_{\succeq_T}]}({\mathcal J})$. \end{proof} \section{Wall crossing functors} In this section we review the construction and the basic properties of the wall crossing functor $\vartheta_s\colon{\operatorname{pSh}}_T\to{\operatorname{pSh}}_T$ associated with a simple affine reflection $s$. We recall one of the main results in \cite{FieLanWallCross}, namely that $\vartheta_s$ preserves the subcategory ${\mathbf S}_T$. We show that $\vartheta_s$ is self-adjoint up to a shift, and that it commutes with the restriction and the subquotient functors associated with $s$-invariant sets. The main result in this section, however, is that the wall crossing functors are exact on ${\mathbf S}_T$. This, together with their self-adjointness, shows that wall crossing preserves projectivity in ${\mathbf S}_T$. \subsection{The characterizing property of the wall crossing functor} Fix a base ring $T$ and $s\in{\widehat\CS}$. Let ${\mathscr M}$ be a presheaf of ${\mathcal Z}={\mathcal Z}_T$-modules on ${\mathcal A}_T$. We define a new presheaf $\epsilon_s{\mathscr M}$ of ${\mathcal Z}$-modules on ${\mathcal A}_T$ by setting $$ \epsilon_s{\mathscr M}({\mathcal J})={\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathscr M}({\mathcal J}^\sharp) $$ for any open subset ${\mathcal J}$ of ${\mathcal A}_T$, with restriction homomorphism ${\operatorname{id}}\otimes r_{{\mathcal J}^\sharp}^{{\mathcal J}^{\prime\sharp}}$ for an inclusion ${\mathcal J}^\prime\subset{\mathcal J}$. In general, $\epsilon_s{\mathscr M}$ is not an object in ${\operatorname{pSh}}$, even if ${\mathscr M}$ is, as it does not in general satisfy the support condition. \begin{theorem} \label{thm-wc} \cite[Theorem 7.1 \& Theorem 7.9 ]{FieLanWallCross} \begin{enumerate} \item There is an up to isomorphism unique functor $\vartheta_s\colon{\operatorname{pSh}}\to{\operatorname{pSh}}$ that admits a natural transformation $\epsilon_s\to\vartheta_s$ such that for any $s$-invariant open subset ${\mathcal J}$ of ${\mathcal A}_T$ and any ${\mathscr M}\in{\operatorname{pSh}}$ the corresponding homomorphism $$ \epsilon_s{\mathscr M}({\mathcal J})\to\vartheta_s{\mathscr M}({\mathcal J}) $$ is an isomorphism of ${\mathcal Z}$-modules. \item The functor $\vartheta_s$ preserves the subcategory ${\mathbf S}$ of ${\operatorname{pSh}}$. \end{enumerate} \end{theorem} The functor $\vartheta_s$ is called the {\em wall crossing functor} associated with $s$. \subsection{Properties of $\vartheta_s$} Recall the homomorphism $\eta_s\colon{\mathcal Z}\to{\mathcal Z}$ that we defined in Section \ref{sec-sinvZ}. For a ${\mathcal Z}$-module $M$ denote by $M^{s-tw}$ the ${\mathcal Z}$-module that has the same underlying abelian group as $M$, but with the ${\mathcal Z}$-action twisted by $\eta_s(z)$, i.e. $z\cdot_{M^{s-tw}} m=\eta_s(z)\cdot_M m$ for $z\in{\mathcal Z}$ and $m\in M$. Let $\Lambda$ be a union of connected components of ${\mathcal A}_T$. Then $\Lambda s$ is again a union of connected component of ${\mathcal A}_T$. Suppose $\Lambda\cap\Lambda s=\emptyset$. Then the map $\gamma_s\colon \Lambda\to\Lambda s$, $A\mapsto As$ is a homeomorphism of topological spaces (cf. \cite[Lemma 6.1]{FieLanWallCross}). Hence the pull-back functor $\gamma_s^{\ast}$ is an equivalence between the categories of (pre-)sheaves of ${\mathcal Z}$-modules on $\Lambda s$ and (pre-)sheaves of ${\mathcal Z}$-modules on $\Lambda$. Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$ supported on $\Lambda s$. We denote by $\gamma_s^{[\ast]}{\mathscr M}$ the presheaf of ${\mathcal Z}$-modules on ${\mathcal A}_T$ that we obtain from $\gamma_s^\ast{\mathscr M}$ by composing with the functor $(\cdot)^{s-tw}$. Hence, for any open subset ${\mathcal J}$ of $\Lambda$ we have $$ (\gamma_s^{[\ast]}{\mathscr M})({\mathcal J})={\mathscr M}({\mathcal J} s)^{s-tw}. $$ Then we have the following. \begin{lemma}\label{lemma-propwc1} \cite[Lemma 7.3]{FieLanWallCross} Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$ supported on a union of connected components $\Lambda$ that satisfies $\Lambda\cap\Lambda s=\emptyset$. Then $$ (\vartheta_s{\mathscr M})^{\overline\Lambda}\cong{\mathscr M}^{\overline\Lambda}\oplus \gamma_s^{[\ast]}({\mathscr M}^{{\overline{\Lambda s}}}). $$ \end{lemma} We now add results that we haven't proven in \cite{FieLanWallCross}. \begin{lemma} \label{lemma-selfadj} The functor $\vartheta_s\colon {\operatorname{pSh}}\to{\operatorname{pSh}}$ is self-adjoint up to a shift, i.e. $$ {\operatorname{Hom}}_{{\operatorname{pSh}}}(\vartheta_s{\mathscr M},{\mathscr N})\cong{\operatorname{Hom}}_{{\operatorname{pSh}}}({\mathscr M},\vartheta_s{\mathscr N}[2]) $$ functorially in ${\mathscr M}$ and ${\mathscr N}$. \end{lemma} \begin{proof} By \cite[Proposition 5.2]{FieTAMS} the functor ${\mathcal Z}\otimes_{{\mathcal Z}^s}\cdot$ is self-adjoint up to a shift, i.e. ${\operatorname{Hom}}_{{\mathcal Z}}({\mathcal Z}\otimes_{{\mathcal Z}^s}M,N)\cong{\operatorname{Hom}}_{{\mathcal Z}}(M,{\mathcal Z}\otimes_{{\mathcal Z}^s} N[2])$ functorially on the level of ${\mathcal Z}$-modules. Let ${\mathcal J}$ be an $s$-invariant open subset of ${\mathcal A}_T$. As $\vartheta_s({\mathscr X})({\mathcal J})\cong {\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathscr X}({\mathcal J})$ functorially for any object ${\mathscr X}$ of ${\operatorname{pSh}}$, there is a functorial isomorphism $$ \phi_{\mathcal J}\colon{\operatorname{Hom}}_{{\mathcal Z}}((\vartheta_s {\mathscr M}){({\mathcal J})}, {\mathscr N}({\mathcal J}))={\operatorname{Hom}}_{{\mathcal Z}}({\mathscr M}({\mathcal J}),(\vartheta_s {\mathscr N}){({\mathcal J})[2]}) $$ for all ${\mathscr M}$ and ${\mathscr N}$ in ${\operatorname{pSh}}$. Moreover, for an inclusion ${\mathcal J}^\prime\subset{\mathcal J}$ of $s$-invariant subsets we can identify the two commutative diagrams \centerline{ \xymatrix{ (\vartheta_s {\mathscr M}){({\mathcal J})}\ar[r]^f\ar[d]&{\mathscr N}({\mathcal J})\ar[d]\\ (\vartheta_s {\mathscr M}){({\mathcal J}^\prime)}\ar[r]^{f^\prime}&{\mathscr N}{({\mathcal J}^\prime)} } \quad \xymatrix{ {\mathscr M}{({\mathcal J})}\ar[rr]^{\phi_{\mathcal J}(f)}\ar[d]&&(\vartheta_s {\mathscr N}){({\mathcal J})}[2]\ar[d]\\ {\mathscr M}{({\mathcal J}^\prime)}\ar[rr]^{\phi_{{\mathcal J}^\prime}(f^\prime)}&&(\vartheta_s {\mathscr N}){({\mathcal J}^\prime)}[2]. } } \noindent Proposition \ref{prop-rig} now shows that the diagrams uniquely define morphisms $\vartheta_s{\mathscr M}\to {\mathscr N}$ and ${\mathscr M}\to\vartheta_s{\mathscr N}[2]$, resp. Hence we obtain an isomorphism $ {\operatorname{Hom}}_{{\operatorname{pSh}}}(\vartheta_s {\mathscr M},{\mathscr N})={\operatorname{Hom}}_{{\operatorname{pSh}}}({\mathscr M}, \vartheta_s {\mathscr N}[2])$. \end{proof} \begin{proposition}\label{prop-propwc2} Let ${\mathscr M}$ be an object in ${\mathbf S}$. \begin{enumerate} \item Let ${\mathcal O}\subset {\mathcal A}_T$ be an $s$-invariant open subset. Then $(\vartheta_s{\mathscr M})|_{\mathcal O}\cong\vartheta_s({\mathscr M}|_{\mathcal O})$ functorially in ${\mathscr M}$. \item Let ${\mathcal K}\subset{\mathcal A}_T$ be a locally closed $s$-invariant subset. Then $ (\vartheta_s{\mathscr M})_{[{\mathcal K}]}\cong \vartheta_s({\mathscr M}_{[{\mathcal K}]}) $ functorially in ${\mathscr M}$. \end{enumerate} \end{proposition} \begin{proof} (1) The $s$-invariance of ${\mathcal O}$ implies that for any $T$-open, $s$-invariant subset ${\mathcal J}$ we have \begin{align*}(\vartheta_s{\mathscr M})|_{\mathcal O}({\mathcal J})&=\vartheta_s({\mathscr M})({\mathcal O}\cap{\mathcal J})\cong\epsilon_s{\mathscr M}({\mathcal O}\cap{\mathcal J})\\ &={\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathscr M}({\mathcal O}\cap{\mathcal J})\\ &={\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathscr M}|_{\mathcal O}({\mathcal J})=\epsilon_s({\mathscr M}|_{\mathcal O})({\mathcal J})\\ &\cong\vartheta_s({\mathscr M}|_{\mathcal O})({\mathcal J}) \end{align*} functorially in ${\mathscr M}$. The claim now follows from Proposition \ref{prop-rig} and the fact that $s$-invariant open sets form an admissible family. (2) Write ${\mathcal K}={\mathcal O}\setminus{\mathcal O}^\prime$ with ${\mathcal O}^\prime\subset{\mathcal O}$ $s$-invariant and open in ${\mathcal A}_T$. Applying $\vartheta_s$ to the exact sequence $0\to{\mathscr M}_{[{\mathcal K}]}\to{\mathscr M}|_{{\mathcal O}}\to{\mathscr M}|_{{\mathcal O}^\prime}\to 0$ yields a sequence $$ \vartheta_s({\mathscr M}_{[{\mathcal K}]})\to\vartheta_s({\mathscr M}|_{{\mathcal O}})\to\vartheta_s({\mathscr M}|_{{\mathcal O}^\prime}). $$ By (1) we can identify the morphism $\vartheta_s({\mathscr M}|_{{\mathcal O}})\to\vartheta_s({\mathscr M}|_{{\mathcal O}^\prime})$ with $(\vartheta_s{\mathscr M})|_{{\mathcal O}}\to(\vartheta_s{\mathscr M})|_{{\mathcal O}^\prime}$. By definition, $(\vartheta_s{\mathscr M})_{[{\mathcal K}]}$ is the kernel of the latter morphism. Hence we obtain a morphism $\delta\colon\vartheta_s({\mathscr M}_{[{\mathcal K}]})\to (\vartheta_s{\mathscr M})_{[{\mathcal K}]}$ such that the diagram \centerline{ \xymatrix{ &\vartheta_s({\mathscr M}_{[{\mathcal K}]})\ar[d]^\delta\ar[r]&\vartheta_s({\mathscr M}|_{{\mathcal O}})\ar[d]^\sim\ar[r]&\vartheta_s({\mathscr M}|_{{\mathcal O}^\prime})\ar[d]^\sim&\\ 0\ar[r]&(\vartheta_s{\mathscr M})_{[{\mathcal K}]}\ar[r]&(\vartheta_s{\mathscr M})|_{{\mathcal O}}\ar[r]&(\vartheta_s{\mathscr M})|_{{\mathcal O}^\prime}\ar[r]&0 } } \noindent commutes. For an $s$-invariant open subset ${\mathcal J}$ in ${\mathcal A}_T$ we have $\vartheta_s (\cdot)({\mathcal J})\cong{\mathcal Z}\otimes_{{\mathcal Z}^s}(\cdot({\mathcal J}))$. Lemma \ref{lemma-transsinv} implies that ${\mathcal Z}\otimes_{{\mathcal Z}^s}(\cdot)$ is an exact endofunctor on the category of ${\mathcal Z}$-modules. Hence the sequence $$ 0\to \vartheta_s({\mathscr M}_{[{\mathcal K}]})({\mathcal J})\to\vartheta_s({\mathscr M}|_{{\mathcal O}})({\mathcal J})\to\vartheta_s({\mathscr M}|_{{\mathcal O}^\prime})({\mathcal J})\to 0 $$ is exact (we use Lemma \ref{lemma-ses1}). From this we obtain that $\delta({\mathcal J})\colon \vartheta_s({\mathscr M}_{[{\mathcal K}]})({\mathcal J})\to(\vartheta_s{\mathscr M})_{[{\mathcal K}]}({\mathcal J})$ is an isomorphism. Proposition \ref{prop-rig} now implies that $\delta$ is an isomorphism. \end{proof} Here is another result on how wall crossing interacts with subquotients. \begin{lemma} \label{lemma-subquotex} Let ${\mathscr M}$ be an object in ${\mathbf S}$ and $A\in{\mathcal A}$. Denote by $\Lambda$ the connected component of ${\mathcal A}_T$ that contains $A$. \begin{enumerate} \item Suppose $\Lambda\ne\Lambda s$. Then for any open subset ${\mathcal J}\subset\Lambda$ we have an isomorphism $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})\cong {\mathscr M}_{[A,As]}({\mathcal J}^\sharp)$ of ${\mathcal Z}^s$-modules that is functorial in ${\mathscr M}$ and compatible with restrictions. \item Suppose that $\Lambda=\Lambda s$. Let ${\mathcal J}\subset\Lambda$ be open. \begin{enumerate} \item If $A\preceq_T As$, then there is an isomorphism $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})\cong {\mathscr M}_{[A,As]}({\mathcal J}^\sharp)$ of ${\mathcal Z}^s$-modules that is functorial in ${\mathscr M}$ and compatible with restrictions. \item If $As\preceq_T A$, then there is an isomorphism $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})\cong {\mathscr M}_{[A,As]}({\mathcal J}^\flat)[-2]$ of ${\mathcal Z}^s$-modules that is functorial in ${\mathscr M}$ and compatible with restrictions. \end{enumerate} \end{enumerate} \end{lemma} \begin{proof} Note that in all cases ${\mathcal K}=\{A,As\}$ is a locally closed $s$-invariant subset of ${\mathcal A}_T$. If $\Lambda\ne\Lambda s$, then ${\mathcal K}$ splits as a topological space into the discrete union of $\{A\}$ and $\{As\}$. Otherwise $A$ and $As$ are $\preceq_T$-comparable, and $\{A,As\}$ is an interval (cf. Lemma 6.1 in \cite{FieLanWallCross}). (1) In this case we have $(\vartheta_s{\mathscr M})_{[A,As]}\cong(\vartheta_s{\mathscr M})_{[A]}\oplus(\vartheta_s{\mathscr M})_{[As]}$. As ${\mathcal J}\subset\Lambda$ and as $(\vartheta_s{\mathscr M})_{[A]}$ is supported on $\Lambda$, we have $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})=(\vartheta_s{\mathscr M})_{[A]}({\mathcal J}^\sharp)$. Hence we can identify $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})$ with the sub-${\mathcal Z}$-module of $(\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J}^\sharp)$ that is supported on $\pi(A)\subset\pi(\Lambda)$. Since $(\vartheta_s{\mathscr M})_{[A,As]}=\vartheta_s({\mathscr M}_{[A,As]})$ by Proposition \ref{prop-propwc2}, we have \begin{align*} (\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J}^\sharp)&={\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathscr M}_{[A,As]}({\mathcal J}^\sharp)\\ &={\mathcal Z}^{\overline{\Lambda\cup\Lambda s}}\otimes_{{\mathcal Z}^{\overline{\Lambda\cup\Lambda s},s}}{\mathscr M}_{[A,As]}({\mathcal J}^\sharp). \end{align*} We now obtain an isomorphism $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})\cong{\mathscr M}_{[A,As]}({\mathcal J}^\sharp)$ as a ${\mathcal Z}^{\overline{\Lambda\cup\Lambda s},s}$-module, hence as a ${\mathcal Z}^s$-module, from Lemma \ref{lemma-decZ}. (2) Lemma \ref{lemma-sharpflat} states that $B\in{\mathcal J}^\sharp\setminus{\mathcal J}$ implies $Bs\preceq_T B$. If $A\preceq_TAs$, then $B\in{\mathcal J}^{\sharp}\setminus{\mathcal J}$ implies $\pi(B)\ne\pi(A)$. By the same lemma $B\in{\mathcal J}\setminus{\mathcal J}^\flat$ implies $B\preceq_TBs$. In the case $As\preceq_T A$ we hence have $\pi(A)\ne\pi(B)$ for all $B\in{\mathcal J}\setminus{\mathcal J}^\flat$. As $(\vartheta_s{\mathscr M})_{[A]}$ is ${\mathcal Z}$-supported on $\pi(A)$, Lemma \ref{lemma-suppcond} implies that $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J}^\sharp)\to (\vartheta_s{\mathscr M})_{[A]}({\mathcal J})$ is an isomorphism in the case $A\preceq_T As$, and that $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})\to (\vartheta_s{\mathscr M})_{[A]}({\mathcal J}^\flat)$ is an isomorphism if $As\preceq_T A$. Hence we can assume from the beginning that ${\mathcal J}={\mathcal J}^\sharp$ in the first case, and ${\mathcal J}={\mathcal J}^\flat$ in the second case. In any case, ${\mathcal J}$ is then $s$-invariant. Denote by $A_1$ and $A_2$ the alcoves such that $A_2\preceq_TA_1$ and $\{A_1,A_2\}=\{A,As\}$. Then there is a short exact sequence $$ 0\to(\vartheta_s{\mathscr M})_{[A_1]}\to (\vartheta_s{\mathscr M})_{[A,As]}\to (\vartheta_s{\mathscr M})_{[A_2]}\to 0 $$ of sheaves. Lemma \ref{lemma-ses1} implies that $$ 0\to(\vartheta_s{\mathscr M})_{[A_1]}({\mathcal J})\to (\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J})\to (\vartheta_s{\mathscr M})_{[A_2]}({\mathcal J})\to 0 $$ is an exact sequence of ${\mathcal Z}$-modules, and Remark \ref{rem-suppcond2} implies that $(\vartheta_s{\mathscr M})_{[A_1]}({\mathcal J})$ is the maximal ${\mathcal Z}$-submodule of $(\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J})$ that is ${\mathcal Z}$-supported on $x:=\pi(A_1)$, and $(\vartheta_s{\mathscr M})_{[A_2]}({\mathcal J})$ is the maximal quotient of $(\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J})$ that is ${\mathcal Z}$-supported on $y:=\pi(A_2)$. Note that $y=xs$, so ${\mathcal L}:=\{x,y\}$ is $s$-invariant. By Proposition \ref{prop-propwc2}, $(\vartheta_s{\mathscr M})_{[A,As]}=\vartheta_s({\mathscr M}_{[A,As]})$. As ${\mathcal J}$ is $s$-invariant, we deduce \begin{align*} (\vartheta_s{\mathscr M})_{[A,As]}({\mathcal J})&=\vartheta_s({\mathscr M}_{[A,As]})({\mathcal J})={\mathcal Z}\otimes_{{\mathcal Z}^s}({\mathscr M}_{[A,As]}({\mathcal J}))\\ &={\mathcal Z}^{\{x,y\}}\otimes_{{\mathcal Z}^{\{x,y\},s}}{\mathscr M}_{[A,As]}({\mathcal J}), \end{align*} as ${\mathscr M}_{[A,As]}({\mathcal J})$ is ${\mathcal Z}$-supported on $\{x,y\}$. By Lemma \cite[Lemma 4.4]{FieLanWallCross}, $ {\mathcal Z}^{\{x,y\}}=\{(z_x,z_y)\in T\oplus T\mid z_x\equiv z_y\mod\alpha^\vee\}, $ where $\alpha\in R^+$ is the unique positive root that satisfies $xs=s_{\alpha}x$. Hence ${\mathcal Z}^{\{x,y\},s}=T(1,1)$. The maximal sub-${\mathcal Z}$-module of ${\mathcal Z}^{\{x,y\}}$ supported on $x$ is hence $T(\alpha^\vee,0)$ and the maximal quotient ${\mathcal Z}$-module of ${\mathcal Z}^{\{x,y\}}$ that is supported on $y$ is ${\mathcal Z}^{\{x,y\}}/T(\alpha^\vee,0)$. The claim follows. \end{proof} We can now show that wall crossing functors are exact. \begin{proposition} For all $s\in{\widehat\CS}$ the functor $\vartheta_s\colon{\mathbf S}\to{\mathbf S}$ is exact. \end{proposition} \begin{proof} Let $0\to{\mathscr A}\to{\mathscr B}\to{\mathscr C}\to 0$ be a short exact sequence in ${\mathbf S}$. By Lemma \ref{lemma-ses2} it suffices to show that the sequence $0\to(\vartheta_s{\mathscr A})_{[A]}\to(\vartheta_s{\mathscr B})_{[A]}\to(\vartheta_s{\mathscr C})_{[A]}\to 0$ is exact for all $A\in{\mathcal A}$. From Lemma \ref{lemma-ses1} we deduce that this is equivalent to show that the sequence $0\to(\vartheta_s{\mathscr A})_{[A]}({\mathcal J})\to(\vartheta_s{\mathscr B})_{[A]}({\mathcal J})\to(\vartheta_s{\mathscr C})_{[A]}({\mathcal J})\to 0$ is exact for all open subsets ${\mathcal J}$. Lemma \ref{lemma-subquotex} allows us to identify this sequence with the sequence $0\to{\mathscr A}_{[A,As]}(\tilde {\mathcal J})\to {\mathscr B}_{[A,As]}(\tilde {\mathcal J})\to{\mathscr C}_{[A,As]}(\tilde {\mathcal J})\to0$, where ${\widetilde{\CJ}}$ is either $={\mathcal J}$, $={\mathcal J}^\sharp$ or $={\mathcal J}^\flat$. In either case, another application of Lemma \ref{lemma-ses1} and Lemma \ref{lemma-ses2} shows that the last sequence is exact. \end{proof} \section{Constructing objects in ${\operatorname{pSh}}$ from ${\mathcal Z}$-modules} Let ${\mathcal K}$ be a section in ${\mathcal A}_T$. Consider the category ${\mathbf Z}_{\mathcal K}$ of root torsion free ${\mathcal Z}$-modules that are ${\mathcal Z}$-supported on $\pi({\mathcal K})$, and the full subcategory ${\operatorname{pSh}}_{{\mathcal K}}$ of ${\operatorname{pSh}}$ that contains all objects that are supported on ${\mathcal K}$ as presheaves. In this section we construct an equivalence ${\mathscr M}_{\mathcal K}\colon{\mathbf Z}_{{\mathcal K}}\xrightarrow{\sim}{\operatorname{pSh}}_{{\mathcal K}}$. The functor ${\mathscr M}_{\mathcal K}$ then allows us to introduce for $A\in{\mathcal K}$ the ``standard object'' ${\mathscr V}(A)$ in ${\operatorname{pSh}}$ as the image of the corresponding standard object in the category of ${\mathcal Z}$-modules. The objects ${\mathscr V}(A)$ are actually contained in ${\mathbf S}$. A second most important class of objects are the ``special objects'' ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$. It is non-trivial that the special objects are contained in ${\mathbf S}$ as well, and we will later prove that they are even projective. They will serve as the starting points of the construction of all projective objects in ${\mathbf S}$ via the wall crossing functors. \subsection{The functor ${\mathscr M}_{\mathcal K}(\cdot)$} Fix a base ring $T$ and let ${\mathcal K}\subset{\mathcal A}_T$ be a section. \begin{definition}\label{def-Zcat} \begin{enumerate} \item Denote by ${\mathbf Z}_{\mathcal K}={\mathbf Z}_{T,{\mathcal K}}$ the full subcategory of the category of all ${\mathcal Z}$-modules that are root torsion free and ${\mathcal Z}$-supported on $\pi({\mathcal K})$. \item Denote by ${\operatorname{pSh}}_{\mathcal K}={\operatorname{pSh}}_{T,{\mathcal K}}$ the full subcategory of ${\operatorname{pSh}}$ that contains all objects that are as presheaves supported on ${\mathcal K}$. \end{enumerate} \end{definition} Let $M$ be an object in ${\mathbf Z}_{\mathcal K}$. For an open subset ${\mathcal J}$ of ${\mathcal A}_T$ set ${\mathscr M}_{\mathcal K}(M)({\mathcal J}):=M^{\pi({\mathcal K}\cap{\mathcal J})}$, and for an inclusion ${\mathcal J}^\prime\subset{\mathcal J}$ let the restriction be the natural homomorphism $M^{\pi({\mathcal K}\cap{\mathcal J})}\to M^{\pi({\mathcal K}\cap{\mathcal J}^\prime)}$ associated with the inclusion $\pi({\mathcal K}\cap{\mathcal J}^\prime)\subset\pi({\mathcal K}\cap{\mathcal J})$. We obtain a presheaf ${\mathscr M}_{\mathcal K}(M)$ of ${\mathcal Z}$-modules. \begin{lemma} \label{lemma-imM} For any object $M$ of ${\mathbf Z}_{\mathcal K}$, the presheaf ${\mathscr M}_{\mathcal K}(M)$ is an object in ${\operatorname{pSh}}_{\mathcal K}$. \end{lemma} \begin{proof} It is clear that ${\mathscr M}_{\mathcal K}(M)$ is supported, as a presheaf, on ${\mathcal K}$, and ${\mathscr M}_{\mathcal K}(M)(\emptyset)=M^{\emptyset}=0$. Hence ${\mathscr M}_{\mathcal K}(M)$ is finitary. It is clearly flabby and it is root torsion free as $M^{{\mathcal L}}$ is root torsion free for any ${\mathcal L}\subset{\mathcal V}$ (cf. Lemma 4.7 in \cite{FieLanWallCross}). It remains to show that ${\mathscr M}_{\mathcal K}(M)$ satisfies the support condition. For this we have to show that the homomorphism ${\mathscr M}({\mathcal J})^x\to {\mathscr M}(({\mathcal J}\cap x)_{\preceq_T})^x$ is an isomorphism for all $x\in{\mathcal V}$ and all $T$-open subsets ${\mathcal J}$. By definition, this homomorphism is $(M^{\pi({\mathcal J}\cap{\mathcal K})})^x\to (M^{\pi(({\mathcal J}\cap x)_{\preceq_T}\cap{\mathcal K})})^x$. Now for any subset ${\mathcal L}$ of ${\mathcal V}$ we have $(M^{{\mathcal L}})^x=M^x$, if $x\in{\mathcal L}$, and $=0$ otherwise. But one easily shows that $x\in\pi(({\mathcal J}\cap x)_{\preceq_T}\cap{\mathcal K})$ if and only if $x\in\pi({\mathcal J}\cap {\mathcal K})$. \end{proof} \begin{proposition} \label{prop-equivcat} The global section functor $\Gamma$ and the functor ${\mathscr M}_{\mathcal K}(\cdot)$ yield mutually inverse equivalences ${\operatorname{pSh}}_{\mathcal K}\xrightarrow{\sim}{\mathbf Z}_{\mathcal K}$ of categories. \end{proposition} \begin{proof} If ${\mathscr M}$ is in ${\operatorname{pSh}}_{\mathcal K}$, then $\Gamma({\mathscr M})$ is root torsion free and ${\mathcal Z}$-supported on $\pi({\mathcal K})$ by Lemma \ref{lemma-supp2}. It is hence an object in ${\mathbf Z}_{\mathcal K}$. It remains to show that $\Gamma$ and ${\mathscr M}_{\mathcal K}$ are inverse functors. For $M\in{\mathbf Z}_{\mathcal K}$ we have $\Gamma({\mathscr M}_{\mathcal K}(M))=M^{\pi({\mathcal A}\cap{\mathcal K})}=M^{\pi({\mathcal K})}=M$ functorially. Hence $\Gamma\circ{\mathscr M}_{\mathcal K}\cong{\operatorname{id}}_{{\mathbf Z}_{\mathcal K}}$. Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}_{\mathcal K}$ and let ${\mathcal J}$ be open in ${\mathcal A}_T$. By Lemma \ref{lemma-homs2} the restriction homomorphism induces an isomorphism $\Gamma({\mathscr M})^{\pi({\mathcal J}\cap{\mathcal K})}\xrightarrow{\sim}{\mathscr M}({\mathcal J})$, which yields an isomorphism ${\mathscr M}_{\mathcal K}(\Gamma({\mathscr M}))\xrightarrow{\sim}{\mathscr M}$ that is clearly functorial. Hence ${\mathscr M}_{\mathcal K}\circ\Gamma\cong{\operatorname{id}}_{{\operatorname{pSh}}_{\mathcal K}}$. \end{proof} \subsection{${\mathscr M}_{\mathcal K}$, base change and wall crossing} The following result introduces more classical wall crossing and base change functors on the category ${\mathbf Z}_{\mathcal K}$. \begin{lemma} \begin{enumerate} \item For any $s\in{\widehat\CS}$ such that ${\mathcal K}$ is $s$-invariant, the functor ${\mathcal Z}\otimes_{{\mathcal Z}^s}(\cdot)$ is a functor from ${\mathbf Z}_{\mathcal K}$ to ${\mathbf Z}_{\mathcal K}$. \item For any flat homomorphism $T\to T^\prime$ of base rings, the functor $(\cdot)\otimes_TT^\prime$ is a functor from ${\mathbf Z}_{T,{\mathcal K}}$ to ${\mathbf Z}_{T^\prime,{\mathcal K}}$. \end{enumerate}\end{lemma} \begin{proof} It follows from Lemma \ref{lemma-transsinv} that ${\mathcal Z}\otimes_{{\mathcal Z}^s} M$ is root torsion free and ${\mathcal Z}$-supported on ${\mathcal K}$ for any object $M$ in ${\mathbf Z}_{\mathcal K}$, hence (1). As the functor $(\cdot)\otimes_TT^\prime$ for a flat homomorphism $T\to T^\prime$ preserves root torsion freeness and the ${\mathcal Z}$-support, (2) follows. \end{proof} We now show that the functor ${\mathscr M}_{\mathcal K}$ intertwines the wall crossing and the base change functors on ${\mathbf Z}_{\mathcal K}$ and on ${\operatorname{pSh}}_{\mathcal K}$. \begin{lemma} \label{lemma-firstpropM} Let $M$ be an object in ${\mathbf Z}_{\mathcal K}$. \begin{enumerate} \item For $T\subset T^\prime$ we have ${\mathscr M}_{\mathcal K}(M)\boxtimes_TT^\prime\cong{\mathscr M}_{\mathcal K}(M\otimes_TT^\prime)$ functorially in $M$. \item Suppose that ${\mathcal K}$ is $s$-invariant. Then $\vartheta_s({\mathscr M}_{\mathcal K}(M))\cong{\mathscr M}_{\mathcal K}({\mathcal Z}\otimes_{{\mathcal Z}^s}M)$. \end{enumerate} \end{lemma} \begin{proof} (1) For any $T$-open subset ${\mathcal J}$ we have isomorphisms \begin{align*} {\mathscr M}_{{\mathcal K}}(M)\boxtimes_TT^\prime({\mathcal J})&\cong {\mathscr M}_{\mathcal K}(M)({\mathcal J})\otimes_TT^\prime\\&=M^{\pi({\mathcal J}\cap{\mathcal K})}\otimes_TT^\prime\\&=(M\otimes_TT^\prime)^{\pi({\mathcal J}\cap{\mathcal K})}\\&={\mathscr M}_{{\mathcal K}}(M\otimes_TT^\prime)({\mathcal J}) \end{align*} and each isomorphism is compatible with restriction homomorphisms. The fact that the $T$-open sets form a $T^\prime$-admissible family and Proposition \ref{prop-rig} prove the claim. (2) Let ${\mathcal J}\subset{\mathcal A}$ be $s$-invariant and $T$-open. Then \begin{align*} \vartheta_s{\mathscr M}_{\mathcal K}(M)({\mathcal J}) &={\mathcal Z}\otimes_{{\mathcal Z}^s} {\mathscr M}_{\mathcal K}(M)({\mathcal J})\\ &={\mathcal Z}\otimes_{{\mathcal Z}^s} M^{\pi({\mathcal K}\cap{\mathcal J})}\\ &=({\mathcal Z}\otimes_{{\mathcal Z}^s} M)^{\pi({\mathcal K}\cap{\mathcal J})}={\mathscr M}_{\mathcal K}({\mathcal Z}\otimes_{{\mathcal Z}^s} M)({\mathcal J}). \end{align*} (For the third step we used Lemma \ref{lemma-transsinv}.) Now the claim follows from the fact that the $s$-invariant subsets form a $T$-admissible familiy and Proposition \ref{prop-rig}. \end{proof} \subsection{The standard objects} Our first example of sheaves constructed using the functor ${\mathscr M}_{\mathcal K}$ are the following {\em standard} (or skyscraper) sheaves. Let $A\in{\mathcal A}$ and let ${\mathcal K}\subset{\mathcal A}_T$ be a section with $A\in{\mathcal K}$ (note that the special sections $\Lambda_\mu$ cover ${\mathcal A}$, so there always is a section containing $A$). Define $$ {\mathscr V}(A)={\mathscr V}_T(A):={\mathscr M}_{\mathcal K}({\mathcal Z}^{\pi(A)}). $$ Explicitely, this is given as follows. Let ${\mathcal J}\subset{\mathcal A}_T$ be open. Then $$ {\mathscr V}(A)({\mathcal J})=\begin{cases} {\mathcal Z}^{\pi(A)},&\text{ if $A\in{\mathcal J}$},\\ 0,&\text{ if $A\not\in{\mathcal J}$} \end{cases} $$ together with the obvious non-trivial restriction homomorphisms. In particular, the object ${\mathscr V}(A)$ does not depend on the choice of ${\mathcal K}$. \begin{lemma} Let $A\in{\mathcal A}$.\begin{enumerate} \item ${\mathscr V}(A)$ is an object in ${\mathbf S}$. \item For a flat homomorphism $T\to T^\prime$ of base rings we have ${\mathscr V}_T(A)\boxtimes_TT^\prime={\mathscr V}_{T^\prime}(A)$. \end{enumerate} \end{lemma} \begin{proof} From the above it is apparent that ${\mathscr V}(A)$ is a root reflexive sheaf (note that ${\mathcal Z}^{\pi(A)}\cong T$ as a $T$-module). Moreover, using Lemma \ref{lemma-firstpropM} we obtain ${\mathscr V}_T(A)\boxtimes_TT^\prime={\mathscr M}_{{\mathcal K}}({\mathcal Z}_T^{\pi(A)})\boxtimes_TT^\prime\cong{\mathscr M}_{{\mathcal K}}({\mathcal Z}_T^{\pi(A)}\otimes_TT^\prime)={\mathscr M}_{{\mathcal K}}({\mathcal Z}_{T^\prime}^{\pi(A)})={\mathscr V}_{T^\prime}(A)$, hence (2). It follows that ${\mathscr V}(A)$ is actually an object in ${\mathbf S}$. \end{proof} \subsection{Extensions of standard objects} We finish this section with a result on the extension structure of the ${\mathscr V}(A)$'s. Let $A,B\in{\mathcal A}$. \begin{lemma} \label{lemma-ses3} Let $0\to{\mathscr V}(A)\xrightarrow{f}{\mathscr X}\xrightarrow{g}{\mathscr V}(B)\to 0$ be a non-split exact sequence in ${\mathbf S}$. Then $B\preceq_T A$ and there exists some $\alpha\in R^+_T$ with $\pi(B)=s_\alpha\pi(A)$. \end{lemma} \begin{proof} We refer to the sequence in the above claim by $(\ast)$. We first show $\pi(A)\ne\pi(B)$. So suppose the contrary. If $\pi(A)=\pi(B)=x$, then all sheaves appearing in the sequence above are sheaves of ${\mathcal Z}^x=T$-modules. We define now a subsheaf ${\mathscr Y}$ of ${\mathscr X}$ such that $f|_{\mathscr Y}\colon{\mathscr Y}\to{\mathscr V}(B)$ is an isomorphism. Let ${\mathcal J}$ be open in ${\mathcal A}_T$. If $A\not\in{\mathcal J}$, set ${\mathscr Y}({\mathcal J}):={\mathscr X}({\mathcal J})$, if $B\not\in{\mathcal J}$, set ${\mathscr Y}({\mathcal J})=0$ (note that if $A,B\not\in{\mathcal J}$, then ${\mathscr X}({\mathcal J})=0$). Now consider ${\mathcal J}_0=\{\preceq_TA\}\cup\{\preceq_TB\}$. Then ${\mathscr V}(B)({\mathcal J}_0)=T$ is a projective ${\mathcal Z}^x$-module, hence the sequence $$0\to{\mathscr V}(A)({\mathcal J}_0)\xrightarrow{f({\mathcal J}_0)}{\mathscr X}({\mathcal J}_0)\xrightarrow{g({\mathcal J}_0)}{\mathscr V}(B)({\mathcal J}_0)\to 0 $$ splits (non-canonically). Fix such a splitting, i.e. a homomorphism $h\colon {\mathscr B}(B)({\mathcal J}_0)\to{\mathscr X}({\mathcal J}_0)$ with the property $g({\mathcal J}_0)\circ h={\operatorname{id}}_{{\mathscr V}(B)({\mathcal J}_0)}$, and let ${\mathscr Y}({\mathcal J}_0)$ be the image of $h$. If ${\mathcal J}$ is an arbitrary open subset that contains $A$ and $B$, then ${\mathcal J}_0\subset{\mathcal J}$ and the restrictions from ${\mathcal J}$ to ${\mathcal J}_0$ of ${\mathscr V}(A)$, ${\mathscr X}$ and ${\mathscr V}(B)$ are isomorphisms. Hence we can define ${\mathscr Y}({\mathcal J})$ as the preimage of ${\mathscr Y}({\mathcal J}_0)$ in ${\mathscr X}({\mathcal J})$. It is clear from the construction that ${\mathscr Y}$ is indeed a sub(pre-)sheaf and that $f|_{\mathscr Y}$ is an isomorphism of (pre-)sheaves. But this means that the sequence in the claim splits, contrary to the assumption. Hence $\pi(A)\ne\pi(B)$. As ${\mathscr X}$ is non-split and ${\mathscr X}({\mathcal J})$ is the intersection of ${\mathscr X}\boxtimes_TT^{\alpha}({\mathcal J})={\mathscr X}({\mathcal J})\otimes_TT^{\alpha}$ over all $\alpha\in R^+$ for all ${\mathcal J}$ open in ${\mathcal A}_T$, there must be some $\alpha$ such that $A$ and $B$ are contained in the same connected component of ${\mathcal A}_{T^{\alpha}}$. But this implies $\pi(B)=s_\alpha\pi(A)$ and $\alpha\in R_T^+$. \end{proof} \section{Verma flags and graded characters} We now introduce the subcategory ${\mathbf B}_T$ of ${\mathbf S}_T$ that contains all objects whose local sections are not only reflexive, but actually (graded) free modules over the base ring $T$. It is the category of ``objects admitting a Verma flag''. It can also be defined as the subcategory in ${\mathbf S}_T$ of objects admitting a finite filtration with subquotients being isomorphic to various standard sheaves ${\mathscr V}(A)$, possibly shifted in degree. To any object in ${\mathbf B}_T$ we can associate a (possibly graded) character. We show that the wall crossing functors preserve the category ${\mathbf B}_T$, and we study their effect on graded characters. We end the section with a result on the extensions of standard objects. \subsection{Verma flags} Fix a base ring $T$ and let ${\mathscr M}$ be an object in ${\mathbf S}={\mathbf S}_T$. \begin{definition} \begin{enumerate} \item We say that ${\mathscr M}$ {\em admits a Verma flag} if for any flat homomorphism $T\to T^\prime$ and for any $T^\prime$-open subset ${\mathcal J}$ the object ${\mathscr M}\boxtimes_TT^\prime({\mathcal J})$ is a (graded) free $T^\prime$-module of finite rank. \item We denote by ${\mathbf B}={\mathbf B}_T$ the full subcategory of ${\mathbf S}$ that contains all objects that admit a Verma flag. \item For an object ${\mathscr M}$ in ${\mathbf B}$ we define its {\em $\preceq_T$-support} by $$ {\operatorname{supp}}_{\preceq_T}{\mathscr M}:=\{A\in{\mathcal A}\mid {\mathscr M}_{[A]}\ne 0\}. $$ \end{enumerate} \end{definition} \begin{lemma} \label{lemma-Vflag} Let ${\mathscr M}$ be an object in ${\mathbf S}$. The following are equivalent. \begin{enumerate} \item ${\mathscr M}$ admits a Verma flag. \item ${\mathscr M}|_{\mathcal O}$ admits a Verma flag for any open subset ${\mathcal O}$ of ${\mathcal A}_T$. \item ${\mathscr M}_{[{\mathcal K}]}$ admits a Verma flag any locally closed subset ${\mathcal K}$ of ${\mathcal A}_T$. \item ${\mathscr M}_{[A]}({\mathcal J})$ admits a Verma flag for any $A\in{\mathcal A}$. \end{enumerate} \end{lemma} \begin{proof} (1) is a special case of (2), and as the local sections of ${\mathscr M}|_{{\mathcal O}}$ are local sections of ${\mathscr M}$, (1) implies (2). (1) is also a special case of (3). Suppose (1) holds. Then the short exact sequence $$ 0\to{\mathscr M}_{[{\mathcal K}]}({\mathcal J})\to{\mathscr M}|_{{\mathcal K}_{\preceq_T}}({\mathcal J})\to{\mathscr M}|_{{\mathcal K}_{\preceq_T}\setminus{\mathcal K}}({\mathcal J})\to 0 $$ splits as a sequence of $T$-modules, as the $T$-module on the right is (graded) free (as (1) implies (2)). As the $T$-module in the middle is free as well, the $T$-module on the left is also free. Hence (1) implies (3). (4) is a special case of (3) and it implies (3) as ${\mathscr M}_{[{\mathcal K}]}$ is a successive extension of the ${\mathscr M}_{[A]}$ with $A\in{\mathcal K}$. \end{proof} \begin{lemma}\label{lemma-Vflag2} Let ${\mathscr M}$ be an object in ${\mathbf S}$ and $A\in{\mathcal A}$ and suppose that ${\mathscr M}={\mathscr M}_{[A]}$. Then the following are equivalent. \begin{enumerate} \item ${\mathscr M}$ admits a Verma flag. \item ${\mathscr M}$ is isomorphic to a finite direct sum of (shifted) copies of ${\mathscr V}(A)$. \item $\Gamma({\mathscr M})$ is (graded) free as a $T$-module of finite rank. \end{enumerate} If either of the above statements holds, then the (graded) multiplicity of ${\mathscr V}(A)$ in ${\mathscr M}$ coincides with the (graded) multiplicity of $T$ in $\Gamma({\mathscr M})$. \end{lemma} \begin{proof} First note that ${\mathscr M}={\mathscr M}_{[A]}$ implies that ${\mathscr M}({\mathcal J})=\Gamma({\mathscr M})$ if $A\in{\mathcal J}$, and ${\mathscr M}({\mathcal J})=0$ otherwise. Hence (1) and (3) are equivalent. Note that ${\mathscr M}_{[A]}$ is, by Remark \ref{rem-suppcond2}, a sheaf of ${\mathcal Z}^{\pi(A)}$-modules and supported as a presheaf on $\{A\}$. Using Proposition \ref{prop-equivcat} we deduce that $\Gamma({\mathscr M}_{[A]})$ is graded free as a $T$-module if and only if there is an isomorphism between ${\mathscr M}_{[A]}$ and a direct sum of (shifted in degree) copies of ${\mathscr V}(A)$. Hence (2) and (3) are equivalent, and the last statement follows as well. \end{proof} Let $s$ be a simple affine reflection. \begin{lemma} The wall crossing functor $\vartheta_s$ preserves the subcategory ${\mathbf B}$ of ${\mathbf S}$. \end{lemma} \begin{proof} This follows from the fact that, if ${\mathscr M}$ admits a Verma flag, then ${\mathscr M}_{[A,As]}({\mathcal J})$ is a (graded) free $T$-module for any $A\in{\mathcal A}$ and all open subset ${\mathcal J}$ by Lemma \ref{lemma-Vflag} and Lemma \ref{lemma-Vflag2}, hence, by Lemma \ref{lemma-subquotex}, so is $(\vartheta_s{\mathscr M})_{[A]}({\mathcal J})$ for any open subset ${\mathcal J}$ and any $A\in{\mathcal A}$, so $\vartheta_s{\mathscr M}$ admits a Verma flag, again by Lemma \ref{lemma-Vflag2}. \end{proof} We add a rather technical statement that we need later on. \begin{lemma}\label{lemma-sheafrefl} Let ${\mathscr M}$ be an object in ${\operatorname{pSh}}$. Then ${\mathscr M}$ is an object in ${\mathbf S}$ and admits a Verma flag if and only if the following holds. \begin{enumerate} \item For any flat base change $T\to T^\prime$, the local sections of the presheaf ${\mathscr M}\boxtimes_TT^\prime$ on $T^\prime$-open subsets form a graded free $T$-module. \item For any flat base change $T\to T^\prime$ such that $T^\prime$ is either generic or subgeneric, ${\mathscr M}\boxtimes_TT^\prime$ is a sheaf. \end{enumerate} \end{lemma} \begin{proof} The two properties above are part of the definition of ${\mathbf S}$ and of objects admitting a Verma flag, hence we only have to show the ``if''-part. So assume that the two properties hold. Let $T\to T^\prime$ be a flat homomorphism of base rings. Let ${\mathcal J}$ be a $T^\prime$-open subset. Assumption (1) implies that ${\mathscr M}\boxtimes_TT^\prime({\mathcal J})=\bigcap_{\alpha\in R^+}{\mathscr M}\boxtimes_TT^\prime({\mathcal J})\otimes_{T^\prime}T^{\prime\alpha}$. Now fix $\alpha\in R^+$. If $T^{\prime\alpha}$ is generic, then we have a homomorphism $T^{\emptyset}\to T^{\prime\alpha}$ and $$ {\mathscr M}\boxtimes_TT^{\prime}({\mathcal J})\otimes_{T^\prime}T^{\prime\alpha}={\mathscr M}\boxtimes_TT^{\emptyset}({\mathcal J})\otimes_{T^\emptyset}T^{\prime\alpha}. $$ (Note that ${\mathcal J}$ is $T^{\emptyset}$-open as well.) If $T^{\prime\alpha}$ is subgeneric, then we have a homomorphism $T^{\alpha}\to T^{\prime\alpha}$ and $$ {\mathscr M}\boxtimes_TT^{\prime}({\mathcal J})\otimes_{T^\prime}T^{\prime\alpha}={\mathscr M}\boxtimes_TT^{\alpha}({\mathcal J})\otimes_{T^\alpha}T^{\prime\alpha}. $$ Using (2) we deduce that ${\mathscr M}\boxtimes_TT^{\prime}({\mathcal J})$ is the intersection of local sections over ${\mathcal J}$ of {\em sheaves}. It follows that ${\mathscr M}\boxtimes_TT^\prime$ is a sheaf as well. \end{proof} \subsection{Graded multiplicities} We will only consider graded characters in the case $T=S$. Recall the definition of graded characters of $S$-modules in Section \ref{subsec-quotZ}. Suppose ${\mathscr M}$ is an object in ${\mathbf S}={\mathbf S}_S$. By Lemma \ref{lemma-Vflag} and Lemma \ref{lemma-Vflag2}, for any $A$ there is an isomorphism ${\mathscr M}_{[A]}\cong\bigoplus_{n\in{\mathbb Z}}{\mathscr V}(A)[n]^{r_n}$ for some well defined $r_n\in{\mathbb Z}_{\ge0}$ (almost all of them $=0$). Define $$ ({\mathscr M}:{\mathscr V}(A)):=\sum_{n\in{\mathbb Z}} r_n v^{-n}\in{\mathbb Z}[v, v^{-1}]. $$ In particular, $({\mathscr M}:{\mathscr V}(A))=({\mathscr M}_{[A]}:{\mathscr V}(A))$ and $({\mathscr V}(A)[n]:{\mathscr V}(A))=v^{-n}$ for all $n\in{\mathbb Z}$. Moreover, from Lemma \ref{lemma-Vflag2} we deduce $$ ({\mathscr M}:{\mathscr V}(A))=p(\Gamma({\mathscr M}_{[A]}))\in{\mathbb Z}[v,v^{-1}]. $$ Now fix $s\in{\widehat\CS}$. \begin{lemma}\label{lemma-charcross} For all ${\mathscr M}$ in ${\mathbf B}$ we have $$ (\vartheta_s{\mathscr M}:{\mathscr V}(A))=\begin{cases} v^2({\mathscr M}:{\mathscr V}(A))+v^2({\mathscr M}:{\mathscr V}(As)),&\text{ if $As\preceq_S A$}\\ ({\mathscr M}:{\mathscr V}(A))+({\mathscr M}:{\mathscr V}(As)),&\text{ if $A\preceq_S As$.} \end{cases} $$ \end{lemma} \begin{proof} We have already shown that $\vartheta_s{\mathscr M}$ admits a Verma flag. It follows from Lemma \ref{lemma-subquotex} that $\Gamma((\vartheta_s{\mathscr M})_{[A]})$ is isomorphic, as a graded $S$-module, to $\Gamma({\mathscr M}_{[A,As]})[r]$, where $r=0$ if $A\preceq_S As$ and $r=-2$ if $As\preceq_S A$. The multiplicity statement hence follows from Lemma \ref{lemma-Vflag2}. \end{proof} \section{Projective objects in ${\mathbf S}$} In this section we prove that the category ${\mathbf S}$ contains enough projective objects. The method of proof is very similar to the construction of projectives in the category ${\mathcal O}$ over a semisimple complex Lie algebra, or in the category of $G_1T$-modules in case $G$ is a modular algebraic group (cf. \cite{AJS}). We first construct quite explicitely a set of {\em special projectives}. We then use the fact that the wall crossing functors are exact and self-adjoint to produce further projectives. We then prove some results on projectives in subgeneric situations, and we finish the section with a rather technical lemma that concerns extensions of standard objects in projective objects. \subsection{Special sheaves} Let $\mu\in X$ and let $\Lambda\in C({\mathcal A}_T)$ be a connected component. Recall the section $\Lambda_\mu$ that was introduced in Section \ref{subsec-toponV}. We now apply the functor ${\mathscr M}_{\Lambda_\mu}$ to the ${\mathcal Z}$-module ${\mathcal Z}^{\overline\Lambda}$ (this is clearly a root torsion free ${\mathcal Z}$-module that is ${\mathcal Z}$-supported on $\overline{\Lambda_\mu}=\overline\Lambda$). \begin{proposition} \label{prop-specsheaf} The object ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ is an object in ${\mathbf B}$ and for any $A\in{\mathcal A}$ we have $$ ({\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda}):{\mathscr V}(A))=\begin{cases} 0,&\text{ if $A\not\in\Lambda_\mu$}\\ v^{2n_A},&\text{ if $A\in\Lambda_\mu$},\\ \end{cases} $$ where $n_A$ is the number of $\alpha\in R^+$ with $\alpha\downarrow A\in\Lambda_\mu$. \end{proposition} \begin{proof} We already know that ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ is an object in ${\operatorname{pSh}}$. Let ${\mathcal J}$ be an open subset of ${\mathcal A}_T$. Then ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})({\mathcal J})={\mathcal Z}^{\pi({\mathcal J}\cap\Lambda_\mu)}$. As $\pi({\mathcal J}\cap\Lambda)$ is a $\le_{T,\mu}$-open subset of ${\mathcal V}$ for any $T$-open subset ${\mathcal J}$, it follows form the description in Proposition \ref{prop-Zlocfree} that ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ satisfies the sheaf condition and that every local section is a free $T$-module of finite rank. For any flat base change $T\to T^\prime$ we have ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda}_T)\boxtimes_TT^\prime={\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda}\otimes_TT^\prime)={\mathscr M}_{{\mathcal K}}({\mathcal Z}^{\overline\Lambda}_{T^\prime})$. Together with what we have shown above this proves that ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})\boxtimes_TT^\prime$ is a sheaf (on ${\mathcal A}_{T^\prime}$) with local sections being graded free of finite rank. In particular, ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ is an object in ${\mathbf B}$. If $A\not\in\Lambda_\mu$, then ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})_{[A]}=0$ by construction. For $A\in\Lambda_\mu$, the statement about the Verma multiplicity follows from the statement about the graded characters in Proposition \ref{prop-Zlocfree} and Lemma \ref{lemma-Vflag2}. \end{proof} \subsection{Special projectives} Let ${\mathcal K}$ be a section and set ${\mathcal I}:={\mathcal K}_{\succeq_T}$. Then ${\mathcal I}$ is a closed subset of ${\mathcal A}_T$. \begin{lemma}\label{lemma-specproj} Let $M$ be an object in ${\mathbf Z}_{\mathcal K}$. Suppose that ${\mathscr M}_{{\mathcal K}}(M)$ is an object in ${\mathbf S}$ and that $M$ is projective in the category of ${\mathcal Z}$-modules. Then ${\mathscr M}_{{\mathcal K}}(M)$ is a projective object in ${\mathbf S}$. \end{lemma} \begin{proof} Let $0\to{\mathscr A}\to{\mathscr B}\to{\mathscr C}\to 0$ be a short exact sequence in ${\mathbf S}$. By Lemma \ref{lemma-ses1} and Lemma \ref{lemma-ses2} the short exact sequence stays exact after applying the functor $\Gamma(\cdot_{[{\mathcal I}]})$. Lemma \ref{lemma-homs1} yields an isomorphism ${\operatorname{Hom}}_{\mathbf S}({\mathscr M}_{{\mathcal K}}(M),(\cdot))\cong{\operatorname{Hom}}_{\operatorname{pSh}}({\mathscr M}_{{\mathcal K}}(M),(\cdot)_{[{\mathcal I}]})$, and Lemma \ref{lemma-homs2} yields another isomorphism ${\operatorname{Hom}}_{\operatorname{pSh}}({\mathscr M}_{{\mathcal K}}(M),(\cdot)_{[{\mathcal I}]})\cong{\operatorname{Hom}}_{\mathcal Z}(M,\Gamma(\cdot_{[{\mathcal I}]}))$. Note that all isomorphisms above are functorial. The projectivity of $M$ in the category of ${\mathcal Z}$-modules now yields the claim. \end{proof} \begin{remark} \label{rem-specproj} For $\mu\in X$ consider ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$. This is an object in ${\mathbf S}$ by Proposition \ref{prop-specsheaf} and ${\mathcal Z}^{\overline\Lambda}$ is a direct summand of ${\mathcal Z}$, hence projective in the category of ${\mathcal Z}$-modules. So by the above ${\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ is a projective object in ${\mathbf S}$.\end{remark} \subsection{Constructing projectives via wall crossing functors} Now suppose that $T=S$. Recall that we consider $S$ as a graded algebra, so all objects in ${\operatorname{pSh}}$, ${\mathbf S}$, and ${\mathbf B}$ are graded. \begin{theorem}\label{thm-projs} Let $A\in{\mathcal A}$. There is an up to isomorphism unique object ${\mathscr B}(A)$ in ${\mathbf S}$ with the following properties: \begin{enumerate} \item ${\mathscr B}(A)$ is indecomposable and projective in ${\mathbf S}$. \item ${\mathscr B}(A)$ admits an epimorphism ${\mathscr B}(A)\to{\mathscr V}(A)$. \end{enumerate} Moreover, the object ${\mathscr B}(A)$ admits a Verma flag for all $A\in{\mathcal A}$. \end{theorem} \begin{proof} We first show that there is at most one object (up to isomorphism) with the properties listed in (1). Suppose that we have found an object ${\mathscr B}(A)$ that has the stated properties, and suppose that ${\mathscr P}$ is a projective object in ${\mathbf S}$ that has an epimorphism onto ${\mathscr V}(A)$. Then the projectivity of ${\mathscr B}(A)$ and ${\mathscr P}$ implies that we can find homomorphisms $f\colon {\mathscr B}(A)\to{\mathscr P}$ and $g\colon {\mathscr P}\to{\mathscr B}(A)$ such that the diagram \centerline{ \xymatrix{ {\mathscr B}(A)\ar[dr]\ar[r]^f&{\mathscr P}\ar[d]\ar[r]^g&{\mathscr B}(A)\ar[dl]\\ &{\mathscr V}(A)& } } \noindent commutes. The composition $g\circ f$ must be an automorphism, as it cannot be nilpotent and ${\mathscr B}(A)$ is indecomposable (we use the Fitting decomposition in the category of graded sheaves of $S$-modules on ${\mathcal A}_S$). Hence ${\mathscr B}(A)$ is a direct summand of ${\mathscr P}$. If the latter is indecomposable, then ${\mathscr B}(A)\cong{\mathscr P}$, and hence we have proven the uniqueness statement. So we are left with showing that an object ${\mathscr B}(A)$ in ${\mathbf S}$ with the desired properties exists. For this, we do not need the assumption that $T=S$, so we prove the existence for arbitrary base rings $T$. First suppose that $A$ is a $\preceq_T$-minimal element in a section $\Lambda_\mu$ (for some $\Lambda\in C({\mathcal A}_T)$ and $\mu\in X$). In this case, consider the object ${\mathscr B}(A):={\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$. It is an object in ${\mathbf B}$ by Proposition \ref{prop-specsheaf}, it is projective by Remark \ref{rem-specproj}. As $A$ is the $\preceq_T$-smallest element in $\Lambda_\mu$, the canonical homomorphism ${\mathcal Z}^{\overline\Lambda}\to{\mathcal Z}^{\pi(A)}$ yields a homomorphism ${\mathscr B}(A)\to{\mathscr V}(A)$ with kernel ${\mathscr B}(A)_{[\succ_T A]}$. Hence this is an epimorphism in ${\mathbf B}$. As ${\mathcal Z}^{\overline\Lambda}$ is indecomposable as a ${\mathcal Z}$-module, ${\mathscr B}(A)$ is indecomposable in ${\mathbf B}$. Now let $A\in{\mathcal A}$ be an arbitrary alcove and let $A^\prime\in{\mathcal A}$ be an alcove which is $\preceq_T$-minimal in $\Lambda_\mu$ for some $\mu\in X$ and some $\Lambda\in C({\mathcal A}_T)$ and has the property that $\langle\lambda_{A^\prime}-\lambda_A,\alpha^\vee\rangle>0$ for all $\alpha\in R^+$. By Lemma \ref{lemma-specalc} we can find simple affine reflections $s_1$,\dots,$s_n$ in ${\widehat\CS}$ with $A=A^\prime s_1\cdots s_n$ and $ A^\prime s_1\cdots s_{i-1}$ and $ A^\prime s_1\cdots s_{i}$ are either $\preceq_T$-incomparable, or $ A^\prime s_1\cdots s_{i}\prec_T A^\prime s_1\cdots s_{i-1}$. As the wall crossing functors preserve projectivity and the subcategory ${\mathbf B}$, the object ${\mathscr Q}=\vartheta_{s_n} \cdots\vartheta_{s_1}{\mathscr B}(A^\prime)$ is projective in ${\mathbf S}$ and it is contained in ${\mathbf B}$. By Lemma \ref{lemma-charcross} and the construction of the sequence $s_1$,\dots, $s_n$, $A$ is a $\preceq_T$-minimal element in ${\operatorname{supp}}_{\preceq_T} {\mathscr Q}$, and $({\mathscr Q}:{\mathscr V}(A))=1$. Hence there is an epimorphism ${\mathscr Q}\to{\mathscr V}(A)$. So we can take for ${\mathscr B}(A)$ every indecomposable direct summand of ${\mathscr Q}$ that maps surjectively onto ${\mathscr V}(A)$. This proves the existence part. \end{proof} \begin{remark}\label{rem-strucproj} It follows from the construction above that $({\mathscr B}(A),{\mathscr V}(A))=1$ and $({\mathscr B}(A): {\mathscr V}(B))\ne 0$ implies $A\preceq_T B$. \end{remark} \subsection{Projectives in the subgeneric case} In this section we suppose that $T$ is subgeneric with $R_T^+=\{\alpha\}$. Let $A\in{\mathcal A}$ and let $\Lambda$ be the connected component of ${\mathcal A}_T$ containing $A$. Then $\alpha\uparrow A\in\Lambda$ and $\overline{\Lambda}=\pi(\Lambda)=\pi(\{A,\alpha\uparrow A\})$. Moreover, Lemma \ref{lemma-upmin} implies that $\{A,\alpha\uparrow A\}$ is a section in ${\mathcal A}_T$. Define $$ {\mathscr Q}(A)={\mathscr Q}_T(A):={\mathscr M}_{\{A,\alpha\uparrow A\}}({\mathcal Z}^{\overline\Lambda}). $$ More explicitely, $$ {\mathscr Q}(A)({\mathcal J})= \begin{cases} {\mathcal Z}^{\overline\Lambda},&\text{ if $A,\alpha\uparrow A\in{\mathcal J}$},\\ {\mathcal Z}^{\pi(A)},&\text{ if $\alpha\uparrow A\not\in{\mathcal J}$, $A\in{\mathcal J}$},\\ 0, &\text{ if $A\not\in{\mathcal J}$}. \end{cases} $$ \begin{lemma} \begin{enumerate} \item ${\mathscr Q}(A)$ is a projective object in ${\mathbf S}$ and it is contained in ${\mathbf B}$. \item There is a short exact sequence $0\to{\mathscr V}(\alpha\uparrow A)[-2]\to{\mathscr Q}(A)\to{\mathscr V}(A)\to 0$. \end{enumerate} \end{lemma} \begin{proof} From the above explicit description it is clear that ${\mathscr Q}(A)$ is a sheaf on ${\mathcal A}_T$ with local sections that are graded free as $T$-modules, and that there is a short exact sequence in the category of sheaves on ${\mathcal A}_T$ as claimed in (2). Let $T\to T^\prime$ be a flat homomorphism of base rings. If $T^\prime$ is again subgeneric, then ${\mathscr Q}_T(A)\boxtimes_TT^\prime={\mathscr Q}_{T^\prime}(A)$ (using Lemma \ref{lemma-firstpropM}). If $T^\prime$ is generic, then ${\mathcal Z}_{T^\prime}^{\overline\Lambda}={\mathcal Z}_{T^\prime}^{\pi(A)}\oplus{\mathcal Z}_{T^\prime}^{\pi(\alpha\uparrow A)}$ and hence ${\mathscr Q}_T(A)\boxtimes_TT^\prime\cong{\mathscr V}_{T^\prime}(A)\oplus {\mathscr V}_{T^\prime}(\alpha\uparrow A)$. In any case, ${\mathscr Q}_T(A)\boxtimes_TT^\prime$ is a sheaf on ${\mathcal A}_{T^\prime}$ with graded free local sections. Hence ${\mathscr Q}_T(A)$ is an object in ${\mathbf B}$. As ${\mathcal Z}^{\overline\Lambda}$ is a direct summand of ${\mathcal Z}$, hence a projective ${\mathcal Z}$-module, Lemma \ref{lemma-specproj} implies that ${\mathscr Q}(A)$ is a projective object in ${\mathbf S}$. \end{proof} \begin{lemma}\label{lemma-transVerma} Let $T$ and $\Lambda$ be as above and $s\in{\widehat\CS}$. \begin{enumerate} \item If $\Lambda\ne\Lambda s$, then $\vartheta_s{\mathscr V}(A)\cong{\mathscr V}(A)\oplus{\mathscr V}(As)$. \item If $\Lambda=\Lambda s$, then $\vartheta_s{\mathscr V}(A)$ is isomorphic to ${\mathscr Q}(A^\prime)$ where $A^\prime\in\{A,As\}$ is such that $A^\prime\preceq_T A^\prime s$. In particular, $\vartheta_s{\mathscr V}(A)$ is projective in ${\mathbf S}$. \end{enumerate} \end{lemma} \begin{proof} In the case $\Lambda\ne\Lambda s$ the claim folllows immediately from Lemma \ref{lemma-propwc1} and the fact that $\gamma_s^{[\ast]}{\mathscr V}(A)\cong{\mathscr V}(As)$. Hence assume that $\Lambda=\Lambda s$. Let $\mu\in X$ be such that $A,As\in\Lambda_\mu$. By Lemma \ref{lemma-firstpropM} we have $\vartheta_s{\mathscr V}(A)=\vartheta_s{\mathscr M}_{\{A,As\}}({\mathcal Z}^{\pi(A)})\cong{\mathscr M}_{\{A, As\}}({\mathcal Z}\otimes_{{\mathcal Z}^s}{\mathcal Z}^{\pi(A)})\cong{\mathscr M}_{\{A,As\}}({\mathcal Z}^{\overline\Lambda})={\mathscr Q}(A^\prime)$. \end{proof} \begin{corollary}\label{cor-imtrans} Let $T$, $\Lambda$ and $s$ be as above and suppose that $\Lambda=\Lambda s$. Suppose that ${\mathscr M}$ is an object in ${\mathbf B}$ supported on $\Lambda$. Then $\vartheta_s{\mathscr M}$ splits into a direct sum of shifted copies of objects isomorphic to ${\mathscr Q}(A)$ with $A\preceq_T As$. \end{corollary} \begin{proof} As ${\mathscr M}$ is an extension of various ${\mathscr V}(A)$'s with $A\in\Lambda$ the claim follows from Lemma \ref{lemma-transVerma}, (2). \end{proof} \begin{lemma}\label{lemma-split} Let $T$, $\Lambda$ and $s$ be as above and suppose that $\Lambda=\Lambda s$. Let ${\mathscr M}$ be an object in ${\mathbf B}$ that is supported on $\Lambda$, and let $A\in\Lambda$ be such that $A=\alpha\uparrow As$. Then the short exact sequence $$ 0\to(\vartheta_s{\mathscr M})_{[\alpha\uparrow A]}\to(\vartheta_s{\mathscr M})_{[A,\alpha\uparrow A]}\to(\vartheta_s{\mathscr M})_{[A]}\to 0 $$ splits uniquely. \end{lemma} \begin{proof} By Corollary \ref{cor-imtrans} $\vartheta_s{\mathscr M}$ is isomorphic to a direct sum of copies of various ${\mathscr Q}(B)$'s with $B$ satisfying $B\preceq_T Bs$. In particular, ${\mathscr Q}(A)$ does not occur since $As\preceq_T A$. The only direct summands that contribute to $(\vartheta_s{\mathscr M})_{[A,\alpha\uparrow A]}$ are hence those isomorphic to ${\mathscr Q}(\alpha\downarrow A)$ and ${\mathscr Q}(\alpha\uparrow A)$. Now the sequence splits as ${\mathscr Q}(\alpha\downarrow A)_{[A,\alpha\uparrow A]}= {\mathscr Q}(\alpha\downarrow A)_{[A]}$ and ${\mathscr Q}(\alpha\uparrow A)_{[A,\alpha\uparrow A]}= {\mathscr Q}(\alpha\uparrow A)_{[\alpha\uparrow A]}$. The uniqueness follows then from the fact that for any object ${\mathscr X}$ in ${\mathbf S}$, the sheaf ${\mathscr X}_{[A]}$ is a sheaf of ${\mathcal Z}^{\pi(A)}$-modules and ${\mathscr X}_{[\alpha\uparrow A]}$ is a sheaf of ${\mathcal Z}^{\pi(\alpha\uparrow A)}$-modules and $\pi(A)\ne\pi(\alpha\uparrow A)=s_\alpha\pi(A)$. \end{proof} Now let $T$ be arbitrary. \begin{lemma}\label{lemma-locstruc} Let $A\in{\mathcal A}$ and let ${\mathscr B}(A)$ be the projective object corresponding to $A$. If $T^\prime$ is a subgeneric base ring, then ${\mathscr B}(A)\boxtimes_TT^{\prime}$ splits into a direct sum of copies of ${\mathscr V}_{T^\prime}(B)$ and ${\mathscr Q}_{T^\prime}(C)$ for various $B,C\in{\mathcal A}$. \end{lemma} \begin{proof} If $A$ is a minimal element in a section of the form $\Lambda_\mu$, then ${\mathscr B}(A)={\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda})$ and hence ${\mathscr B}(A)\boxtimes_TT^{\prime}\cong{\mathscr M}_{\Lambda_\mu}({\mathcal Z}^{\overline\Lambda}_{T^\prime})$ by Lemma \ref{lemma-firstpropM}. As ${\mathcal Z}^{\overline\Lambda}_{T^\prime}$ splits into a direct sum of summands ${\mathcal Z}^{\overline\Omega}_{T^\prime}$, where $\overline\Omega=\{x\}$ or $\overline\Omega=\{x,s_\alpha x\}$ (where $R_{T^\prime}^+=\{\alpha\}$), the claim follows for special $A$. For general $A$ the claim now follows from Lemma \ref{lemma-transVerma} and the fact that ${\mathscr B}(A)$ is constructed as a direct summand of an object obtained by repeatedly applying translation functors to a special projective. \end{proof} \subsection{On the inclusion of standard objects} Now let $T$ be an arbitrary base ring. Let ${\mathcal J}\subset{\mathcal A}_T$ be open and denote by $j\colon{\mathcal J}\to{\mathcal A}_T$ the inclusion. \begin{lemma}\label{lemma-extstruc}Let $A,B\in{\mathcal A}$, $A\ne B$ and $n\in{\mathbb Z}$. Let ${\mathcal O}\subset{\mathcal A}_T$ be open and let $f\colon{\mathscr V}(B)[n]\to{\mathscr B}(A)|_{\mathcal O}$ be a monomorphism in ${\mathbf B}$ (i.e. ${\operatorname{coker}} f$ is contained in ${\mathbf B}$ as well). Then there exists some $\alpha\in R^+$ and a non-split sequence $0\to{\mathscr V}(B)[n]\to{\mathscr X}\to{\mathscr V}(\alpha\downarrow B)[n+2]\to 0$ and a monomorphism $g\colon{\mathscr X}\to{\mathscr B}(A)|_{\mathcal O}$ such that $f$ factors over $g$. \end{lemma} Again, the shifts should be ignored in the case that $T$ is not graded. \begin{proof} As $A\ne B$, ${\mathscr V}(B)[n]$ is not a quotient of ${\mathscr B}(A)|_{\mathcal O}$. As ${\mathscr B}(A)|_{\mathcal O}$ is an extension of shifted copies of various ${\mathscr V}(C)$'s, there must be an object ${\mathscr X}$ that fits into a non-split exact sequence $$ 0\to{\mathscr V}(B)[n]\to{\mathscr X}\to{\mathscr V}(C)[m]\to 0\leqno{(\ast\ast)} $$ and a morphism $g\colon {\mathscr X}\to{\mathscr B}(A)|_{{\mathcal O}}$ such that $f$ factors over $g$. By Lemma \ref{lemma-ses3} we have $C\preceq_T B$ and there exists $\alpha\in R^+$ such that $\pi(A)=s_\alpha\pi(C)$ and such that the short exact sequence $(\ast\ast)$ does not split after extension of scalars to $T^{\alpha}$. Now ${\mathscr B}(A)\boxtimes_TT^{\alpha}|_{{\mathcal O}}$ is a direct sum of objects of the form ${\mathscr Q}_{T^\alpha}(D)|_{\mathcal O}$ and ${\mathscr V}_{T^\alpha}(E)|_{\mathcal O}$ by Lemma \ref{lemma-locstruc}. As ${\mathscr X}\boxtimes_TT^{\alpha}$ is non-split, it must be isomorphic to some ${\mathscr Q}_{T^\alpha}(D)$. As $C\preceq_T B$ this implies $C=D$, $B=\alpha\uparrow C$ and $m=n+2$. \end{proof} \section{A functor into the category of Andersen, Jantzen and Soergel} The main result in this paper is that there exists a functor from the category ${\mathbf B}$ to the combinatorial category ${\mathbf K}$ that Andersen, Jantzen and Soergel define in \cite{AJS}. This functor maps the indecomposable projective objects in ${\mathbf B}$ to the ``special objects'' in ${\mathbf K}$ that encode the baby Verma multiplicities of projective objects in the category ${\mathbf C}$ of restricted, $X$-graded representations of a modular Lie algebra (cf. Section \ref{sec-modrep}). \subsection{The combinatorial category of Andersen--Jantzen--Soergel} Recall that $S$ is the symmetric algebra of the $k$-vector space $X^\vee\otimes_{\mathbb Z} k$. Recall also that we define $S^{\emptyset}=S[\alpha^{\vee-1}\mid \alpha\in R^+]$ and $S^{\alpha}=S[\beta^{\vee-1}\mid \beta\in R^+,\beta\ne\alpha]$ for all $\alpha\in R^+$. \begin{definition}[\cite{AJS,Soe95}] We define the category ${\mathbf K}$ as the category that consists of objects $ M=\left(\{M(A)\}_{A\in{{\mathcal A}}}, \{M(A,\beta)\}_{A \in {{\mathcal A}},\beta\in R^+}\right)$, where \begin{enumerate} \item $M(A)$ is an $S^{\emptyset}$-module for each $A \in {{\mathcal A}}$ and \item for $A \in{{\mathcal A}}$ and $\beta\in R^+$, $M(A ,\beta)$ is an $S^\beta$-submodule of $M(A )\oplus M(\beta\uparrow A )$. \end{enumerate} A morphism $f\colon M\to N$ in ${\mathbf K}$ is given by a collection $(f_A)_{A\in{{\mathcal A}}}$ of homomorphisms $f_A\colon M(A)\to N(A)$ of $S^\emptyset$-modules, such that for all $A\in{{\mathcal A}}$ and $\beta\in R^+$, $f_A\oplus f_{\beta\uparrow A}$ maps $M(A,\beta)$ into $N(A,\beta)$. \end{definition} \subsection{The functor $\Psi\colon{\mathbf B}\to{\mathbf K}$} We now fix the base ring $T=S$ and consider the category ${\mathbf B}={\mathbf B}_S$. For simplicity we write $\preceq$ instead of $\preceq_S$. Let ${\mathscr M}$ be an object in ${\mathbf B}$. In order to simplify notation write ${\mathscr M}^\emptyset:={\mathscr M}\boxtimes_SS^{\emptyset}$ and ${\mathscr M}^\alpha:={\mathscr M}\boxtimes_SS^{\alpha}$ for $\alpha\in R^+$. Define the object $\Psi({\mathscr M})$ of ${\mathbf K}$ in the following way. For $A\in{\mathcal A}$ and $\alpha\in R^+$, \begin{align*} \Psi({\mathscr M})(A)&:=\Gamma({\mathscr M}^{\emptyset}_{[A]}),\\ \Psi({\mathscr M})(A,\alpha)&:=\Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]}). \end{align*} A few remarks are in order. Lemma \ref{lemma-upmin} shows that $\{A,\alpha\uparrow A\}$ is locally closed in ${\mathcal A}_{S^{\alpha}}$. As $A$ and $\alpha\uparrow A$ are in distinct ${\mathbb Z} R$-orbits (i.e. in distinct connected components of ${\mathcal A}_{S^\emptyset}$), the short exact sequence $$ 0\to{\mathscr M}^{\alpha}_{[\alpha\uparrow A]}\to {\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]}\to {\mathscr M}^{\alpha}_{[A]}\to 0 $$ splits canonically after applying the functor $\boxtimes_{S^\alpha}S^{\emptyset}$. Hence $$ \Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]})\otimes_{S^\alpha}S^\emptyset=\Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]}\boxtimes_{S^\alpha}S^\emptyset)=\Gamma({\mathscr M}^{\emptyset}_{[A]})\oplus\Gamma({\mathscr M}^{\emptyset}_{[\alpha\uparrow A]}) $$ canonically. In particular, we can consider $\Psi({\mathscr M})(A,\alpha)$ as a subset of $\Psi({\mathscr M})(A)\oplus\Psi({\mathscr M})(\alpha\uparrow A)$. So the above indeed yields a functor $\Psi$ from ${\mathbf B}$ to ${\mathbf K}$. \subsection{Wall crossing functors on ${\mathbf K}$} We fix a simple reflection $s\in{\widehat\CS}$. In this section we recall the definition of the wall crossing functor $\vartheta^c_s\colon{\mathbf K}\to{\mathbf K}$ of \cite{AJS} in the normalization of \cite{FieJAMS}. For $M\in{\mathbf K}$, $B\in{\mathcal A}$ and $\alpha\in R^+$ set \begin{eqnarray*} \vartheta^c_s M({A}) &:= & M({A})\oplus M({As}), \\ \vartheta^c_s M({A},\alpha) &:= & \begin{cases} \left\{(\alpha^\vee x+y,y)\mid x,y\in M(A,\alpha)\right\}, & \text{if $As=\alpha\uparrow A$},\\ \alpha\cdot M(\alpha^\vee\uparrow A,\alpha)\oplus M(\alpha\downarrow {A},\alpha), & \text{if $As=\alpha\downarrow A$},\\ M(A,\alpha)\oplus M(As,\alpha) , & \text{if $As\ne\alpha\uparrow A,As\ne\alpha\downarrow A$} \end{cases} \end{eqnarray*} with the obvious inclusion $\vartheta_s^c M(A,\alpha)\subset\vartheta_s^cM(A)\oplus\vartheta_s^cM(\alpha\uparrow A)$. The following result is the main ingredient in the proof that the indecomposable projective objects in ${\mathbf B}$ correspond, via $\Psi$, to the special objects considered by Andersen, Jantzen and Soergel. \begin{proposition}\label{prop-psiint} For any $s\in{\widehat\CS}$ there is an isomorphism $$ \Psi\circ\vartheta_s\cong\vartheta_s^c\circ\Psi $$ of functors from ${\mathbf B}$ to ${\mathbf K}$. \end{proposition} \begin{proof} Let ${\mathscr M}$ be an object in ${\mathbf B}$. As the wall crossing functor commutes with base change by \cite[Lemma 7.2]{FieLanWallCross}, there is a functorial isomorphism $(\vartheta_s {\mathscr M})^{\emptyset}_{[A]}\cong\vartheta_s({\mathscr M}^{\emptyset})_{[A]}$ and Lemma \ref{lemma-propwc1} yields a further isomorphism onto ${\mathscr M}^{\emptyset}_{[A]}\oplus\gamma_s^{[\ast]}({\mathscr M}^{\emptyset}_{[As]})$ for any $A\in{\mathcal A}$. Hence we obtain a functorial isomorphism (of $S^{\emptyset}$-modules) \begin{align*} \Psi(\vartheta_s{\mathscr M})(A)&=\Gamma((\vartheta_s{\mathscr M})^\emptyset_{[A]})\\ &\cong\Gamma({\mathscr M}^{\emptyset}_{[A]})\oplus\Gamma({\mathscr M}^{\emptyset}_{[As]})=\vartheta_s^c(\Psi{\mathscr M})(A). \end{align*} Let $\alpha\in R^+$ and $A\in{\mathcal A}$ and denote by $\Lambda$ the connected component that contains $A$. If $As\not\in\{\alpha\uparrow A,\alpha\downarrow A\}$, then $\Lambda\ne\Lambda s$ by Lemma \ref{lemma-Asuparrow}. In this case we obtain as before canonical isomorphisms $(\vartheta_s{\mathscr M})^\alpha_{[\{A,\alpha\uparrow A\}]}\cong\vartheta_s({\mathscr M}^\alpha)_{[\{A,\alpha\uparrow A\}]}\cong{\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]}\oplus\gamma_s^{[\ast]}({\mathscr M}^{\alpha}_{[\{As,\alpha\uparrow As\}]})$ and hence \begin{align*} (\Psi\vartheta_s{\mathscr M})( A,\alpha)&=\Gamma((\vartheta_s{\mathscr M})^\alpha_{[\{A,\alpha\uparrow A\}]})\\ &\cong\Gamma({\mathscr M}^\alpha_{[\{A,\alpha\uparrow A\}]})\oplus\Gamma({\mathscr M}^\alpha_{[\{As,\alpha\uparrow As\}]}) =(\vartheta_s^c\Psi{\mathscr M})(A,\alpha) \end{align*} canonically (note that $(\alpha\uparrow A)s=\alpha\uparrow As$ in this case). Now suppose that $As=\alpha\uparrow A$. Then $\Lambda=\Lambda s$ and $\{A,\alpha\uparrow A\}$ is a locally closed $s$-invariant subset of ${\mathcal A}_{S^{\alpha}}$. Hence \begin{align*} (\Psi\vartheta_s{\mathscr M})(A,\alpha)&=\Gamma( (\vartheta_s{\mathscr M}^{\alpha})_{[\{A,\alpha\uparrow A\}]})\\ &=\Gamma(\vartheta_s({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]}))\text{ by Proposition \ref{prop-propwc2}},\\ &={\mathcal Z}\otimes_{{\mathcal Z}^s}\Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]})\text{ by the defining property of $\vartheta_s$}\\ &={\mathcal Z}^{\overline\Lambda}\otimes_{{\mathcal Z}^{\Lambda, s}}\Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]})\text{ by Lemma \ref{lemma-transsinv}}\\ &=\left\{(\alpha^\vee x+y,y)\mid x,y\in \Gamma({\mathscr M}^{\alpha}_{[\{A,\alpha\uparrow A\}]})\right\}\text{ by \cite[Lemma 4.4]{FieLanWallCross}}\\ &=(\vartheta_s^c\Psi{\mathscr M})(A,\alpha). \end{align*} Finally suppose that $As=\alpha\downarrow A$. By Lemma \ref{lemma-split} we have $$ (\vartheta_s{\mathscr M})^\alpha_{[\{A,\alpha\uparrow A\}]} =\vartheta_s({\mathscr M}^{\alpha})_{[\{A,\alpha\uparrow A\}]}\cong\vartheta_s({\mathscr M}^{\alpha})_{[A]}\oplus\vartheta_s({\mathscr M}^{\alpha})_{[\alpha\uparrow A]} $$ canonically. From the previous step we obtain identifications \begin{align*} \Gamma((\vartheta_s{\mathscr M})^{\alpha}_{[A]})&=\alpha^\vee\Gamma({\mathscr M}^{\alpha}_{[\{\alpha\downarrow A,A\}]}) =\alpha^\vee\Psi{\mathscr M}(\alpha\downarrow A,\alpha) \end{align*} and \begin{align*} \Gamma((\vartheta_s{\mathscr M})^{\alpha}_{[\alpha\uparrow A]})&=\Gamma({\mathscr M}^{\alpha}_{[\{\alpha\uparrow A,\alpha\uparrow^2 A\}]})=\Psi{\mathscr M}(\alpha\uparrow A,\alpha). \end{align*} Hence $(\Psi\vartheta_s{\mathscr M})(A,\alpha)=(\vartheta_s^c\Psi{\mathscr M})(A,\alpha)$ also in this case. \end{proof} \subsection{Indecomposability} Now we show that indecomposable projective objects in ${\mathbf B}$ stay indecomposable after applying the functor $\Psi$. \begin{lemma}\label{lemma-Psiindec} For any $A\in{\mathcal A}$, the object $\Psi{\mathscr B}(A)$ is indecomposable in ${\mathbf K}$. \end{lemma} \begin{proof} Suppose this is not the case. Then $\Psi{\mathscr B}(A)=M\oplus N$ with non-zero objects $M,N$ in ${\mathbf K}$. We can assume that $M(A)\ne 0$. As $\Psi{\mathscr B}(A)(A)=\Gamma({\mathscr B}^\emptyset(A)_{[A]})$ is a free $S^{\emptyset}$-module of rank 1, we have $N(A)=0$. Choose a $\preceq_S$-minimal $B\in{\mathcal A}$ such that $N(B)\ne 0$. Then $A\ne B$. The above decomposition induces a decomposition ${\mathscr B}(A)_{[B]}={\mathscr M}\oplus {\mathscr N}$ with objects ${\mathscr M}$ and ${\mathscr N}$ in ${\mathbf B}$, both non-zero and both supported on $\{B\}$. Then there is an inclusion $f\colon {\mathscr V}(B)\to{\mathscr N}\subset {\mathscr B}(A)_{[B]}\subset{\mathscr B}(A)|_{\preceq_S B}$. By Lemma \ref{lemma-extstruc} there is an inclusion $g\colon {\mathscr X}\to {\mathscr B}(A)|_{\preceq_S B}$ where ${\mathscr X}$ is a non-split extension of ${\mathscr V}(B)$ and ${\mathscr V}(\alpha\downarrow B)$ such that $f$ factors over $g$. But the image of $f$ must then be contained in ${\mathscr N}$, which contradicts the minimality of $B$. \end{proof} \subsection{The special objects of Andersen, Jantzen and Soergel} Let $\mu\in X$ and let $A_\mu^-$ be the $\preceq_S$-minimal element in ${\mathcal A}_\mu$ (note that ${\mathcal A}$ is the only connected component of ${\mathcal A}_S$, so ${\mathcal A}_\mu$ is, by the earlier definition, the set of alcoves that contain $\mu$ in their closure). Define the object $Q_\mu\in{\mathbf K}$ as follows. \begin{align*} Q_\mu(A) & := \begin{cases} S^\emptyset, & \text{if $A\in{\mathcal W}_\mu(A_\mu^-)$}, \\ 0, & \text{else}, \end{cases} \\ Q_\mu(A,\alpha) & := \begin{cases} S^\alpha, & \text{ if $A\in{\mathcal A}_\mu$ and $\alpha\uparrow A\not\in{\mathcal A}_\mu$},\\ \left\{(x,y)\in S^{\alpha}\oplus S^{\alpha}\left|\, \begin{matrix}x\equiv y\\ \mod\alpha^\vee\end{matrix}\right\}\right.,& \text{ if $A,\alpha\uparrow A\in{\mathcal A}_\mu$},\\ \alpha^\vee S^\alpha, & \text{ if $A\not\in{\mathcal A}_\mu$, $\alpha\uparrow A\in{\mathcal A}_\mu$},\\ 0, & \text{ else}, \end{cases} \end{align*} with the obvious inclusions $Q_\mu(A,\alpha)\subset Q_\mu(A)\oplus Q_\mu(\alpha\uparrow A)$ for all $A\in{\mathcal A}$ and $\alpha\in R^+$. \begin{definition} Denote by ${\mathbf M}^\circ$ the full subcategory of ${\mathbf K}$ that contains all objects that are isomorphic to a direct sum of direct summands of objects of the form $\vartheta_s^c\cdots\vartheta_t^c Q_\mu$ for all sequences $s,\dots, t\in{\widehat\CS}$ and all $\mu\in X$. \end{definition} The objects in ${\mathbf M}^{\circ}$ are sometimes called the {\em special objects}. One of the main results in the book \cite{AJS} is the construction of a functor from the deformed category of certain $X$-graded $\fg$-modules, where $\fg$ is the $k$-Lie algebra associated with $R$ (cf. Section \ref{sec-modrep}), into the category ${\mathbf K}$ and the proof that this induces an equivalence between the full subcategory of projective objects and ${\mathbf M}^{\circ}$. In particular, this yields the following result. \begin{proposition}\label{prop-classspec} For all $A\in{\mathcal A}$ there is an up to isomorphism unique object $Q(A)\in{\mathbf M}^\circ$ with the following properties: \begin{itemize} \item $Q(A)$ is indecomposable in ${\mathbf K}$, \item $Q(A)(B)=0$ unless $A\preceq_S B$, and $Q(A)(A)=S^\emptyset$. \end{itemize} \end{proposition} For example, $Q(A_\mu^-)=Q_\mu$. Now we obtain the connection to the sheaves on the alcoves. \begin{theorem}\label{thm-Bspec} For all $A\in{\mathcal A}$ we have an isomorphism $\Psi({\mathscr B}(A))\cong Q(A)$ in ${\mathbf K}$. Moreover, ${{\operatorname{rk}}}_{S^\emptyset}\, Q(A)(B)=({\mathscr B}(A):{\mathscr V}(B))(1)$ for all $B\in{\mathcal A}$. \end{theorem} Here, ${{\operatorname{rk}}}_{S^\emptyset}\, M$ is the rank of a free $S^{\emptyset}$-module, and by $({\mathscr B}(A):{\mathscr V}(B))(1)$ we mean the polynomial $({\mathscr B}(A):{\mathscr V}(B))$ evaluated at $1$. \begin{proof} Suppose that $A$ is special, i.e. $A=A_\mu^-$. Then one checks immediately that $\Psi({\mathscr B}(A_\mu^-))=\Psi({\mathscr M}_{{\mathcal A}_\mu}({\mathcal Z}))\cong Q_\mu=Q(A_\mu^-)$. As $\Psi$ intertwines the translation functors on ${\mathbf B}$ and on ${\mathbf K}$ by Proposition \ref{prop-psiint} , we obtain, using the translation algorithm that constructs the indecomposable projectives from Theorem \ref{thm-projs}, that $\Psi({\mathscr B}(A))$ is contained in ${\mathbf M}^{\circ}$. This is an indecomposable object by Lemma \ref{lemma-Psiindec}. Remark \ref{rem-strucproj} now yields that $\Psi({\mathscr B}(A))(A)\cong S^{\emptyset}$ and $\Psi({\mathscr B}(A))(B)=0$ unless $A\preceq_S B$. Hence $\Psi({\mathscr B}(A))\cong Q(A)$. Moreover, \begin{align*} {{\operatorname{rk}}}_{S^\emptyset}\,\Psi({\mathscr B}(A))(B)&={{\operatorname{rk}}}_{S^\emptyset}\,\Gamma({\mathscr B}(A)^{\emptyset}_{[B]})\\ &=({\mathscr B}(A)^\emptyset:{\mathscr V}(B)^\emptyset)\\ &=({\mathscr B}(A):{\mathscr V}(B)). \end{align*}\end{proof} \section{The application to modular representation theory}\label{sec-modrep} In this section we quickly review some of the main result in \cite{AJS}. One of the applications of Theorem \ref{thm-Bspec} is that the indecomposable projective objects in ${\mathbf B}$ encode rational simple characters of the reductive groups associated with $R$, if the characteristic of $k$ is larger than the Coxeter number. We assume in this section that $k$ is algebraically closed and that its characteristic is a prime number $p$ that is larger than the Coxeter number of $R$. \subsection{Modular representations} Let $\fg$ be the Lie algebra over $k$. Denote by ${\mathbf C}$ the category of $X$-graded restricted representations of $\fg$ (cf. \cite{Soe95, FieBull}). For any $\lambda$ there is the simple highest weight module $L(\lambda)$ and the baby Verma module $Z(\lambda)$ in ${\mathbf C}$. The character of the baby Verma modules are easy to determine, and one can calculate the characters of the simple modules once the Jordan--H\"older multiplicities $[Z(\lambda):L(\mu)]$ are known. Now consider the map $m_p\colon X\to X$, $m_p(v)=pv$. There is a unique ${\widehat\CW}$-action $\cdot_p$ of ${\widehat\CW}$ on $X$ such that $m_p(wv)=w\cdot_pm_p(v)$ for all $w\in{\widehat\CW}$ and $v\in X$. Using the linkage and the translation principle it turns out that one needs to know only the numbers $[Z((w\cdot_p\rho)-\rho):L((x\cdot_p\rho)-\rho)]$ for $w,x\in{\widehat\CW}$, where $\rho=\frac{1}{2}\sum_{\alpha\in R^+}\alpha$. In \cite{AJS} it is shown: \begin{theorem} \label{thm-mainAJS} For $w,x\in{\widehat\CW}$ let $A,B\in{\mathcal A}$ be the unique alcoves with $x(\rho)-\rho\in A$ and $w(\rho)-\rho\in B$. Then $$ [Z((w\cdot_p\rho)-\rho):L((x\cdot_p\rho)-\rho)]={{\operatorname{rk}}}_{S^\emptyset}\, Q(A)(B). $$ \end{theorem} Theorem \ref{thm-Bspec} then yields the following. \begin{theorem} For $A,B\in{\mathcal A}$ let $w,x\in{\widehat\CW}$ be the unique alcoves with $x(\rho)-\rho\in A$ and $w(\rho)-\rho\in B$. Then $$ [Z((w\cdot_p\rho)-\rho):L((x\cdot_p\rho)-\rho)]=({\mathscr B}(A):{\mathscr V}(B))(1).$$ \end{theorem}
\section*{Abstract} Optical activity is a fundamental phenomenon originating from the chiral nature of crystals and molecules. While intrinsic chiroptical responses of ordinary chiral materials to circularly polarized light are relatively weak, they can be enhanced by specially tailored nanostructures. Here, nanorod metamaterials, comprising a dense array of vertically aligned gold nanorods, is shown to provide significant enhancement of the circular dichroism response of an embedded material. A nanorod composite, acting as an artificial uniaxial crystal, is filled with chiral mercury sulfide nanocrystals embedded in a transparent polymer. The nanorod based metamaterial, being inherently achiral, enables optical activity enhancement or suppression. Unique properties of inherently achiral structures to tailor optical activities pave a way for flexible characterization of optical activity of molecules and nanocrystal-based compounds.
\section{Introduction} Numerical micromagnetics is often the tool of choice when investigating the behavior of magnetization at scales where fine details of magnetic structures such as domain walls need to be resolved but atomic description is computationally unfeasible. Since their early application in predicting domain wall structure in soft thin films \cite{micromag1}, micromagnetic simulations have been used to reproduce a variety of experimental results \cite{microexp1,microexp2, microexp3}. With the advances in GPU-accelerated computing, the speed of micromagnetic simulations has surged \cite{gpu1,mumax1}, making it possible to perform larger length- and timescale simulations. An area currently lacking in micromagnetics is the capability of simulating mechanical motion of magnets and the interplay of motion and the domain dynamics of magnets moving relative to each other. The relative motion of small-scale magnets is relevant in studying phenomena such as magnetic friction \cite{AtomicSpinFriction, IsingFric, motioncontrol, magiera1, magiera4}, and for applications such as magnetic force microscopy \cite{MFM}, and micro- and nanomanipulation \cite{manipul4, manipul3}. Despite the scientific interest in these areas, simulation frameworks capable of general micromagnetic simulations coupled with the motion dynamics of the magnets, to the authors' knowledge, do not exist. In magnetic friction context, studies have been performed on specific simulation instances such as single magnetic dipole being moved at a constant velocity atop a monolayer \cite{magiera1, magiera2} and perpendicularly polarized thin films sliding relative to each other \cite{motioncontrol}, but otherwise computational studies of moving microscale magnets and their interactions have been scarce. In this paper, we extend an existing finite difference micromagnetic simulation code to handle the linear motion of a magnet interacting with another. In the case of conducting magnets, we also include an eddy current solver in our movement implementation in order to study the effects of eddy currents on the motion and magnetization dynamics. Our primary focus is on magnetic friction and thin films, but other phenomena involving moving magnets can also be studied within the framework. The structure of the paper is as follows: in Section~\ref{sec:movement}, we examine the simulation of moving magnets in a finite difference framework and present our method for simulating smooth motion. Section \ref{sec:movImplementation} elaborates on the technical details of the movement and eddy current implementations. In Section \ref{sec:results}, we test our implementation with example simulations, comparing the obtained results to those of previous works on magnetic friction \cite{motioncontrol} and eddy currents \cite{TorresEddy, eddycurrenthead}. Finally, in Section \ref{sec:summary} we summarize the main points of the article and conclude with thoughts on possible future work. \section{Moving microscopic magnets} \label{sec:movement} At the core of micromagnetics is the the Landau-Lifshitz-Gilbert (LLG) equation, which governs the time evolution of the magnetization in a magnetic material. It can be written as \begin{equation} \frac{\partial \textbf{m}}{\partial t}=-\gamma \mathbf{H}_{\mathrm{eff}} \times \mathbf{m} + \alpha \mathbf{m} \times \frac{\partial \textbf{m}}{\partial t}, \end{equation} where $\gamma$ is the gyromagnetic ratio, $\mathbf{m}$ is the normalized magnetization $\mathbf{m}=\mathbf{M}/M_\mathrm{sat}$, $\alpha$ is the phenomenological Gilbert damping constant, and $\mathbf{H}_\mathrm{eff}$ the effective field, in most cases containing four field terms: exchange field $\mathbf{H}_\mathrm{exch}$, anisotropy field $\mathbf{H}_\mathrm{anis}$, external (Zeeman) field $\mathbf{H}_\mathrm{ext}$ and demagnetizing field $\mathbf{H}_\mathrm{d}$. In micromagnetics, the magnetic properties of a material are determined by material parameters such as the exchange constant $A_\mathrm{ex}$, the saturation magnetization $M_\mathrm{sat}$ and the Gilbert damping constant. In numerical micromagnetics, finite difference methods have been found attractive due to the possibility of using Fast Fourier transforms to speed up the evaluation of the demagnetizing field, which usually is the computationally most demanding part of micromagnetic simulations \cite{numericalmicromagnetics}. In finite difference micromagnetics, the domain of interest is discretized into cuboid (often cubic) cells in which the LLG equation is solved. A discretization cell can be empty (nonmagnetic, vacuum/air) or contain magnetic material, in which case the cell is typically treated as uniformly magnetized, represented by a vector in the center of the discretization cell. These magnetization vectors interact with the local field $\mathbf{H}_\mathrm{eff}$ in each cell and evolve in time according to the LLG equation. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 1.0cm 0.2cm, clip=true,width=1.00\columnwidth]{./films.pdf} \caption{An example system of two stripe-patterned thin films for simulating magnetic friction. In this example, the upper film is driven towards $+x$-direction with a constant velocity $v$ and the system is periodic in the film plane (periodic images not shown). The direction of magnetization in the $xy$-plane is indicated by the color wheel on the left, while white and black correspond to magnetization in $+z$ and $-z$ directions, respectively.} \label{FIGSimulationExample} \end{figure} A possible simulation scenario with two magnetic thin films in relative motion is depicted in Fig.~\ref{FIGSimulationExample}. Movement in this kind of simulation scheme consists of updating the cells with the correct material parameters and magnetization vectors when the magnet moves in and out of the simulation cells. However, due to the discretization the magnet can only move in discrete jumps inside the simulation domain, and thus $\mathbf{m}$, $\mathbf{H}_\mathrm{eff}$ and other quantities inside the cells change discontinuously in response to the motion. This leads into a cycle of excitations and relaxations of the magnetization, which is especially prominent at low velocities. The intermittent movement also introduces artificial discontinuities in quantities such as energy of the system (Fig.~\ref{FIGEnergyJumps}), complicating the analysis of results e.g. when studying stick-slip motion. Additionally, when eddy currents are included in the simulation (see Section~\ref{sec:EddyImplementation}), the discontinuous change in the local magnetic field due to the jumps could lead to an overestimation in the induced eddy currents. In order to properly study the interaction of two magnets in relative motion and the related phenomena, smooth continuous motion is desirable. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=1.00\columnwidth]{./enJumps.pdf} \caption{A demonstration of the discontinuous jumps in total energy caused by the discrete movement in the example system depicted in Fig.~\ref{FIGSimulationExample} for three different driving velocities.} \label{FIGEnergyJumps} \end{figure} \subsection{Smooth motion through interpolation} There are a couple of ways to realize smooth motion within a finite difference framework. The simplest idea is to use smaller simulation cells to limit the size of the cell-to-cell jumps during the motion, but this increases the computational cost dramatically and does not truly eliminate the problem. Another way is to emulate movement between cells by scaling the $M_\mathrm{sat}$ of the partially filled cells by the percentage of the cell volume containing magnetic material, but this can lead to errors unless corrections are made to the calculation of exchange interaction and demagnetizing field terms \cite{Garcia-Cervera}. When simulating magnets in motion, applying the corrections could become computationally quite intensive. A simpler approach applicable to our simulation scenario, that is two magnets in relative motion and not in direct contact, is to use interpolation to find the effective field in between the discretization cells. This approach can be made computationally quite inexpensive when appropriate calculation methods are used. Two magnets that are not in direct contact interact with each other only via the long range interaction term of the LLG equation, the demagnetizing field (or stray field) $\mathbf{H}_\mathrm{d}$, governed by the equations \begin{equation} \nabla \cdot \mathbf{H}_\mathrm{d} = -\nabla \cdot \mathbf{M},~~~~\nabla \times \mathbf{H}_\mathrm{d} = 0. \end{equation} When simulating two magnets of which one is moving, the demagnetizing field of the stationary magnet can be interpolated at the location of the moving magnet (Fig.~\ref{FIGInterpolation}) and vice versa. The interpolation of $\mathbf{H}_\mathrm{d}$ between cells can be done in two ways: direct interpolation of the field vectors, or by calculating the magnetic scalar potential $\phi_M$, interpolating it and obtaining the demagnetizing field as the gradient of the potential $\mathbf{H}_\mathrm{d} = -\nabla \phi_M$. Both methods are included in our implementation. A problem that can arise when interpolating the demagnetizing field is introducing artificial divergence and/or curl into the system. It has been shown that artificial divergences induced by simply interpolating the field vectors componentwise can lead to unphysical behavior in magnetohydrodynamics \cite{divergencefreeneeded}, and thus to avoid similar problems we try to maintain the demagnetizing field as divergence-free (outside the magnet) and curl-free (everywhere) as possible. In this regard, the scalar potential method is advantageous, since it gives a curl-free field by definition as long as the interpolants are $C^2$ continuous, i.e. continuous up to the second derivative \cite{interpb}. The behavior of divergence and curl during interpolation in both scalar potential method and direct interpolation of the field is examined in Section~\ref{sec:results}. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=0.93\columnwidth]{./interpolation.pdf} \caption{An illustration of a part of a discretized magnet moving in between the simulation cells with speed $\mathbf{v}$ in the $x$-direction, the partial movement denoted by $x_\mathrm{p}$, the black arrows depicting the demagnetizing field vectors of the stationary magnet and the interpolated field vectors shown in red inside the moving magnet.} \label{FIGInterpolation} \end{figure} Simulations can include other field terms that require interpolation as well. When applying an external field $\mathbf{H}_\mathrm{ext}$ that is not uniform in the whole simulation domain, the field can change smoothly between cells and therefore has to be interpolated inside the moving magnet. For the external field, one has to directly interpolate the field vectors between cells when the magnet is moving, since the external field is not necessarily expressable as a gradient of a scalar potential. The same applies to the eddy current field. Fortunately the anisotropy field $\mathbf{H}_\mathrm{anis}$ is localized in a cell and the exchange field $\mathbf{H}_\mathrm{exch}$ is very short-ranged, extending only to the nearest neighbor cells. Thus interpolation is not needed for these interactions. \section{Implementation} \label{sec:movImplementation} The movement and interpolation codes were implemented in the micromagnetic solver \texttt{MuMax}3 \cite{vansteenkiste2014design}, due to its open-source nature and authors' previous experience with the software. \texttt{MuMax}3 has functions for moving the entire simulation domain a cell in a specified direction, useful when studying e.g. the movement of a domain wall in a long nanowire. However, since the whole simulation domain is moved, relative motion of two magnets cannot be simulated. Hence we implemented functions with which one can define the part of the simulation domain as moving (''slider'') and part as staying at rest (''base''). The slider part of the simulation domain can then be moved in the desired direction while the base remains in place. In our extension, the slider can be allowed to move in selected directions in 3 dimensions, making it possible to study perpendicular movement relative to the base (e.g. in adhesion context) in addition to parallel movement. The slider can be driven either with constant velocity or with a spring moving at a constant velocity. The extension also supports periodic boundary conditions. The slider and base geometries are defined at the beginning of the simulation, and are assumed not to change. The slider moves as a rigid body, and the location relative to the cell centers (where the exact $\mathbf{m}$ is calculated) is updated constantly, the relevant fields being interpolated according to the location. We incorporated Newton's equations of motion into the Euler solver and the adaptive step RK45 Dormand-Prince solver, solving the equations simultaneously with the LLG equation. Whenever the slider has moved a full simulation cell, the geometry and parameters in the involved cells are updated accordingly and the parameter determining location relative to the cell centers starts again from zero. We modified the calculations of energy and other quantities to use the interpolated fields so that they take into account the partial movement of the slider. Additionally, we introduced new quantities relevant to the motion such as the total forces affecting the base and the slider, the speed and acceleration of the slider etc. For simulating magnetic friction, we implemented the calculation of some additional measures, such as the force the base exerts on the slider and the power dissipated by the relaxation of $\mathbf{M}$ due to Gilbert damping. Since the slider and base interact only via the demagnetizing field, the force the slider feels from the base can be written as \begin{equation} \mathbf{F}_\mathrm{m}^\mathrm{s} = \mu_0V_\mathrm{cell}\sum_{i\in{s}} (\mathbf{M}^\mathrm{s}(\mathbf{x}_i)\cdot \nabla)\mathbf{H}_\mathrm{d}^\mathrm{b}(\mathbf{x}_i), \label{EQForce} \end{equation} where the sum is over the cells designated as the slider, $\mu_0$ is the permeability of vacuum, $V_\mathrm{cell}$ is the volume of a simulation cell, $\mathbf{x}_i$ is the (possibly interpolated) location in \mbox{cell $i$}, and superscripts $s$ and $b$ are used to denote the slider and base, respectively \cite{motioncontrol}. Moving the slider forward pumps energy into the system with power $P_\mathrm{in} = -\mathbf{F}_\mathrm{m}^\mathrm{s}\cdot \mathbf{v}_\mathrm{s}$, where $\mathbf{v}_\mathrm{s}$ denotes the velocity of the slider. In the steady state, the power pumped into the system and the power dissipated by the relaxation of the magnetic moments (and possible mechanical damping of the spring in the case of spring driving) have to be equal. Power dissipated by the relaxation of $\mathbf{m}$ can be calculated as (\mbox{Ref.~\cite{magiera1}}) \begin{equation} P_\mathrm{diss} = \frac{\gamma \alpha\mu_0V_\mathrm{cell}}{(1+\alpha^2)M_\mathrm{sat}}\sum_{i=1}^N\big(\mathbf{M}(\mathbf{x}_i)\times \mathbf{H}_\mathrm{eff}(\mathbf{x}_i)\big)^2. \end{equation} If other damping factors are small, the friction force determined by energy dissipation $F = \langle P_\mathrm{diss}/ v_\mathrm{s}\rangle$ should then coincide with the force of Eq.~(\ref{EQForce}) in the steady state. \subsection{Interpolation of the demagnetizing field} \label{sec:demagImplementation} A typical way of solving the demagnetizing field in finite difference micromagnetics, including \texttt{MuMax}3, is as a discrete convolution with kernel usually referred to as the demagnetization tensor $\mathbf{N}$. Mathematically the direct calculation of $\mathbf{H}_\mathrm{d}$ at point $\mathbf{r}$ can be written as a convolution integral, \begin{equation} \begin{aligned} \mathbf{H}_\mathrm{d}(\mathbf{r}) &= -\frac{1}{4\pi}\nabla \int \mathbf{M}(\mathbf{r}^\prime)\cdot \nabla^\prime \frac{1}{|\mathbf{r}-\mathbf{r^\prime}|} d^3 \mathbf{r^\prime}\\ &= -\int \mathbf{N}(\mathbf{r}-\mathbf{r}^\prime) \mathbf{M}(\mathbf{r}^\prime) d^3 \mathbf{r^\prime}, \end{aligned} \end{equation} of which the discretized version used in the finite difference method is \begin{equation} \mathbf{H}_\mathrm{d}(\mathbf{r}_\mathrm{i}) = -\sum_\mathrm{j} \mathbf{N}(\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}) \mathbf{M}(\mathbf{r}_\mathrm{j}), \end{equation} where $i$ and $j$ denote indices of the discretization cells. The demagnetization tensor is a $3\times3$ matrix containing geometrical coefficients for each pair $\mathbf{r}_\mathrm{i},\mathbf{r}_\mathrm{j}$. The calculation can be sped up by FFTs, changing the convolution in real space to a pointwise multiplication of FFT'd magnetization and the demagnetization tensor \cite{numericalmicromagnetics}, reducing the calculation complexity from $O(n^2)$ to $O(n\log n)$ of FFTs. In addition to performing FFTs, \texttt{MuMax}3 further speeds up the calculations by using the GPU to massively parallelize the effective field calculations. The demagnetization tensor is only computed once, Fourier transformed and moved to the GPU at the beginning of the simulation, while the magnetization has to be transformed and inverse-transformed during each time step, the number of transforms being dependent on the time integration scheme used. As for the interpolation of the field values between cells, GPUs can utilize texture memory for fast interpolation. However, these interpolations are linear and the discontinuity of the derivatives make for a poor interpolation for the field. Fortunately, there exists a fast GPU-based interpolation library capable of constructing a 3D cubic b-spline interpolants and finding the gradient at interpolated points, written by Ruijters and Thevenaz \cite{ruijters1}. They have also shown that since b-splines are not truly interpolating functions (meaning the interpolated values differ from the actual point values) by default, the data has to be prefiltered for accurate interpolation \cite{ruijters2}. A function performing the prefiltering is included in the library. We incorporated the library into the extension, and utilize it for both direct componentwise interpolation of the field vectors and interpolation of the scalar potential. For calculating the demagnetizing field via the scalar potential, Abert \emph{et al.} have presented a method which utilizes a similar kernel multiplication in Fourier space as is done with the demagnetization tensor, yielding a fast way to calculate the scalar potential \cite{Scalarpotential}. In the scalar potential method, the equation for the demagnetizing field reads \begin{equation} \mathbf{H}_\mathrm{d}(\mathbf{r}_\mathrm{i}) = -\nabla\phi_M = -\nabla \sum_\mathrm{j} \mathbf{S}(\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}) \mathbf{M}(\mathbf{r}_\mathrm{j}), \end{equation} where $\mathbf{S}$ denotes the scalar potential kernel, its elements defined by \begin{equation} \mathbf{S}(\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}) = \frac{1}{4\pi}\int_{V_j}\nabla^\prime \frac{1}{|\mathbf{r}-\mathbf{r}^\prime|}d^3\mathbf{r}^\prime\bigg\rvert_{\mathbf{r} = \mathbf{r}_\mathrm{i}}. \end{equation} We follow their method with a slight modification: instead of calculating the potential in the corners of the cells, we calculate it at the cell centers, since the same kernel can also be used to calculate the solenoidal component of the electric field when simulating eddy currents. The gradient of the scalar potential in our case is obtained by a four-point central finite difference approximation. The demagnetization tensor method gives more accurate results for $\mathbf{H}_\mathrm{d}$ at the boundaries of the magnet, where the field component perpendicular to the boundary can be discontinuous. Thus when using the scalar potential method, we opt to use the scalar potential for the far field only, and use the demagnetization tensor to calculate the near field (the defined magnetization geometry and one additional cell in each direction) since the near field does not require interpolation for either magnet. To retain the speed of the simulation at levels comparable to the demagnetization tensor method, we parallelized the scalar potential calculation and gradient on the GPU. Similarly to the demagnetization tensor, the scalar potential kernel is computed and Fourier transformed only once in the beginning of the simulation, and the convolution with the kernel is parallelized easily as a pointwise multiplication. The calculation of the gradient of the potential was also trivially parallelizable. We use scalar potential that extends four cells over of the simulation domain boundary in each direction in order to properly prefilter and interpolate the values at the boundaries of the domain. These additional values do not require a larger kernel however, since when not using periodic boundary conditions we get the potential twice the system size in each direction anyway due to the zero padding required for the FFT and kernel multiplication. When using periodic boundaries, the four additional values are simply copied from the other side of the simulation domain. \subsection{Eddy currents} \label{sec:EddyImplementation} If the moving magnets are conducting, the change in magnetic field inside the magnets creates eddy currents, which can impede the motion due to the currents inducing a magnetic field resisting the motion according to Lenz's Law, turning kinetic energy into heat in the process. On the macroscale, this kind of ''eddy current friction'' is utilized in applications such as eddy current brakes \cite{eddycurrentbrakes}. In micromagnetics, eddy currents are usually assumed to be incorporated into the Gilbert damping parameter. When simulated explicitly, they have been found to have a visible effect in the switching times of magnetic nanocubes \cite{TorresEddy,eddyswitching2} and the field strength in magnetic recording heads \cite{eddycurrenthead}. In order to see if and how eddy currents influence the magnetic friction forces, we include an implementation of eddy current simulation in our extension. Our eddy current implementation follows the method of Torres \emph{et al}, in which the irrotational and solenoidal electric field components, $\mathbf{E}_\mathrm{irrot}$ and $\mathbf{E}_\mathrm{sol}$, are solved separately and summed to obtain the total electric field $\mathbf{E}$. From the electric field, the current density $J = \sigma \mathbf{E}$ and the resulting magnetic field $\mathbf{H}_\mathrm{eddy}$ are then calculated. A short summary of the method is detailed below, for more complete description see Ref. \cite{TorresEddy}. The solenoidal electric field is found via the formula \begin{equation} \mathbf{E}_\mathrm{sol}(\mathbf{r}_\mathrm{i}) = \sum_\mathrm{j} -\frac{1}{4\pi}\frac{\partial \mathbf{B}(\mathbf{r}_\mathrm{j})}{\partial t} \times \int_{V_j} \frac{\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}}{|\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}|^3} d^3\mathbf{r}_\mathrm{j}, \end{equation} where $\mathbf{B} = \mu_0(\mathbf{H}_\mathrm{d} + \mathbf{H}_\mathrm{ext} + \mathbf{M})$. Noting that \begin{equation} \int_{V} \frac{\mathbf{r}-\mathbf{r}^\prime}{|\mathbf{r}-\mathbf{r}^\prime|^3} d^3\mathbf{r}^\prime = \int_{V}\nabla^\prime \frac{1}{|\mathbf{r}-\mathbf{r}^\prime|}d^3\mathbf{r}^\prime, \end{equation} we see that the scalar potential kernel $\mathbf{S}$ can also be utilized in the calculation the solenoidal electric field, \begin{equation} \mathbf{E}_\mathrm{sol}(\mathbf{r}_\mathrm{i}) = \sum_\mathrm{j}\frac{\partial \mathbf{B}(\mathbf{r}_\mathrm{j})}{\partial t} \times \mathbf{S}(\mathbf{r}_\mathrm{i}-\mathbf{r}_\mathrm{j}). \end{equation} Taking the cross product of the scalar potential kernel and Fourier transformed $\partial \mathbf{B}(\mathbf{r}_\mathrm{j})/{\partial t}$ on the GPU, we find the solenoidal electric field. Assuming charge neutral material, the irrotational field $\mathbf{E}_\mathrm{irrot}$ can be calculated from the electric scalar potential $\phi_E$, which is found by solving the Laplace's equation \begin{equation} \Delta \phi_E = 0 \end{equation} inside the magnet, with the boundary condition $\partial \phi_E / \partial n = \mathbf{E}_{\mathrm{sol},n}$, where $n$ denotes the surface normal of the magnet. This boundary condition ensures that the eddy currents are tangential to the surface. In our implementation, the Laplace's equation for the electric potential is solved iteratively via successive-over-relaxation performed on the GPU. Taking the gradient of the potential then yields the irrotational electric field. The current density $\mathbf{J}$ is obtained by summing the electric fields $\mathbf{E}_\mathrm{irrot}$ and $\mathbf{E}_\mathrm{sol}$ and multiplying with conductivity $\sigma$, which is treated as a uniform constant across the material. From the current density, another tensor multiplication with the scalar potential kernel, computed in the same fashion as the solenoidal electric field, is required to obtain the magnetic field $\mathbf{H}_\mathrm{eddy}$ generated by eddy currents. \section{Numerical examples} \label{sec:results} \subsection{Divergence and curl} The effect of interpolation on the divergence and curl of the demagnetizing field in both scalar potential method and direct componentwise interpolation of $\mathbf{H}_\mathrm{d}$ was studied by creating a completely random magnetization in the base film and keeping the magnetic vectors frozen during movement. The demagnetizing field of the base was calculated and interpolated inside the slider while observing how the interpolation affects the average magnitudes of divergence and curl, defined by \begin{equation} \begin{aligned} D(x) &= \frac{1}{N}\sum_i^N|\nabla \cdot \mathbf{H}_\mathrm{d}|_i(x)\\ C(x) &=\frac{1}{N}\sum_i^N||\nabla \times \mathbf{H}_\mathrm{d}||_i(x), \end{aligned} \end{equation} where the divergences and curls were calculated in each cell $i$ using a two-point central finite difference approximation, and $x$ refers to the partial movement between cells. Since the method and numerical noise always give some nonvanishing divergence and curl, we use the divergence and curl of the stationary non-interpolated field as a baseline and calculate the relative difference of the interpolated values compared to the stationary value. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=1.0\columnwidth]{./divs.pdf} \caption{The relative error of divergence during the interpolation between two cell centers 4 nm apart, $x$ denoting the location of the slider. The spline interpolation is slightly asymmetric, the error reversing sign close to the end of the interpolation.} \label{FIGDiviCurli} \end{figure} The results for divergence are gathered in Fig.~\ref{FIGDiviCurli}. As can be seen from the figure, the interpolation induces relatively small errors to the divergence of the field during the interpolation in both the scalar potential method and direct interpolation, even in the case of a randomized magnetization resulting in a mostly random field. In the case of a smoother field, the errors are likely to be smaller. For reference, the effect of linearly interpolating the field vectors was also studied, and though one or two orders of magnitude greater difference to the stationary case than with the spline interpolation, even in the case of linear interpolation the difference is in the order of percents. The results are similar for the curl of the field. \subsection{Magnetic friction} For simulating magnetic friction, we used a system of two \mbox{1024 nm $\times$ 1024 nm $\times$ 20 nm} thin films with a distance of 20 nm and periodic boundary conditions in the film plane. The domain discretized in cubic cells with 4 nm side length. We used CoCrPt as the material, with parameters similar to those in Ref. \cite{navas2014domain}, i.e. uniaxial anisotropy in the $+z$-direction, and \mbox{$K_\mathrm{u} = 1.225 \cdot 10^5$ J/m$^3$}, \mbox{$M_\mathrm{sat} = 3.5\cdot 10^5$ A/m}, \mbox{$A_\mathrm{ex} = 5\cdot 10^{-12}$ J/m} and \mbox{$\alpha = 0.05$}. Disorder was introduced by dividing the upper and lower films into grains of 20 nm average size using Voronoi tessellation \cite{disorder}, and setting the direction of the anisotropy vector randomly from 0$^\circ$ to $8^\circ$ from the $+z$-axis for each grain. The films were initialized to a stripe pattern similar to Ref.~\cite{motioncontrol}, with approximately 80 nm wide stripes and let relax (Resulting in a system similar to what was shown in Fig.~\ref{FIGSimulationExample}), after which the upper film was driven in the $+x$-direction by a spring moving at a constant velocity $v_\mathrm{d} = 2$ m/s for 300 ns. The friction force was measured from the spring elongation $F_\mathrm{spring}=k(v_\mathrm{d}t - x_\mathrm{s})$, where $x_\mathrm{s}$ is the position of the slider. The spring constant was chosen as \mbox{$k = 0.005$ N/m}. The simulations were carried out in zero temperature. We also included a viscous damping term in the equation of motion, \begin{equation} \mathbf{F}_\mathrm{d} = -\gamma m \dot{x}_\mathrm{s}, \end{equation} where $m$ is the mass of the slider, $\dot{x}_\mathrm{s}$ its velocity and $\gamma$ is a viscous damping coefficient. The complete equation of motion for the slider is then \begin{equation} m\ddot{x}_\mathrm{s} = k(v_\mathrm{d}t - x_\mathrm{s}) - \gamma m \dot{x}_\mathrm{s} + F^\mathrm{s}_\mathrm{m}, \end{equation} where $F^\mathrm{s}_\mathrm{m}$ is the $x$-directional component of the force exerted by the base on the slider defined in Eq.~(\ref{EQForce}). The mass and the damping coefficient in these numerical examples are chosen such that the spring-slider system is critically damped and the resulting viscous damping force is roughly an order of magnitude smaller than $F^\mathrm{s}_\mathrm{m}$ when $v_\mathrm{s} = v_\mathrm{d}$. To see whether the film distance would affect the friction behavior in our tests as it did in Ref. \cite{motioncontrol}, we ran simulations for various film distances, ranging from 20 nm to 80 nm. We started the simulation with the spring already ahead of the slider by 80 nm so that the beginning part of the simulation, where the spring slowly elongates increasing the force, is shorter. A snapshot of the system total energy for the different interpolation methods in an example simulation can be seen in Fig.~\ref{FIGEnergyinterpolation}. For both the direct componentwise interpolation and the scalar potential interpolation, the system becomes continuously driven instead of the periodic jumps of the non-interpolated case and thus the discontinuities in the total energy are eliminated, as expected. For a relatively long simulation time, both the direct interpolation and the scalar potential method predict the same magnetization dynamics and hence the same energy. When driven for long enough, small discrepancies in the predicted field values can lead to slightly different time evolution of domains. However, the effect this has on quantities such as the average friction force is minimal. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=1.0\columnwidth]{./t256.pdf} \caption{Energies for different interpolation methods. Though the dissimilar time evolution of the magnetization is reflected by the energy of the system in the various cases, the trend in the total energy is similar in all three cases. The drop in energy is the result of a magnetization reconfiguration in response to motion of the slider.} \label{FIGEnergyinterpolation} \end{figure} \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=1.0\columnwidth]{./FricComp.pdf} \caption{The friction forces with inter-film distance of \mbox{20 nm}, in which the stripe domains in the slider deform but are held in place by the stripes of the base, and \mbox{80 nm}, where the slider experiences stick-slip motion, and the stripes experience only minor changes. The diminishing force in the \mbox{80 nm} case is due to the stripes having slightly different widths, and the initial configuration having better matching stripes in the slider and base.} \label{FIGFrictionForce} \end{figure} Considering the fact that we used different material and way of realizing disorder along with smaller films, the qualitative behavior and the numerical results are comparable to those of Ref.~\cite{motioncontrol}. With little distance between the magnetic films, the interaction between the stripe domains of the base and slider are stronger than the pinning effect of the disorder in the slider, and thus the stripes are locked in place. Due to the movement of the slider, the stripe domains deform, but they don't move with the slider and thus the slider is actually pulled through its own stripe domains. In this case, the magnetic domain configuration changes constantly during the dragging, and thus the energy dissipation due to relaxation of magnetic moments is large compared to the damping of the spring. In this case the average friction force calculated from power dissipation and directly from the force exerted by the base on the slider are roughly equal, giving approximately 0.7 nN as the friction force. An increase in the distance leads to the stripe domains getting pinned in place inside the slider by the disorder. This results in a situation where the slider and it's pinned stripe domains stick and slip in the periodic potential created by the domain structure of the base, alternating between increase of the force during stick phase and rapid decrease during slips (Fig.~\ref{FIGFrictionForce}). Even though the stripe domains provide resistance to the motion in the form of potential wells, the stripes themselves deform comparatively little, and thus the energy dissipation is actually dominated by the damping of the spring, which grows comparatively large during the slips. The contribution of the magnetic moment relaxation to the average friction force was only \mbox{0.04 nN} in this case. In our simulations, even with the smallest distance between films there was some behavior reminiscent to stick-slip in addition to domain dragging. This resulted from a stripe sticking to individual grains with strong anisotropy before ''snapping'' to another configuration. The stripe domains realigning with the driving direction was also observed in some configurations similar to Ref.~\cite{motioncontrol}. \subsection{Eddy current simulations} The eddy current implementation was tested by running a simulation in which a Permalloy nanocube switches its magnetization due to an external field, similar to the example simulation of Ref.~\cite{TorresEddy}. The Permalloy cube with side length of 40 nm was discretized into cubic cells of 2.5 nm side length. The magnetization was first relaxed into a $+z$-directed flower state \cite{flowerstate}, and the switching was caused by an external magnetic field in the $-z$ direction. The field strength was ramped linearly from zero to \mbox{$100$ mT} in the span \mbox{of 0.1 nanoseconds}, after which the field is held constant. The simulations were run in zero temperature, with \mbox{$A_{ex} = 13\cdot 10^{-12}$ J/m}, \mbox{$M_{sat} = 860\cdot 10^3$ A/m} and varying \mbox{$\alpha = 0.01 - 0.1$}. The value used for conductivity of Permalloy was \mbox{$\sigma = 6.25\cdot 10^6$ S/m}. \cite{torres2} An example case for $\alpha = 0.01$ is shown in Fig.~\ref{FIGeddya005}, and in this simulation the switch is anticipated by the eddy currents similarly as in previous literature \cite{TorresEddy,eddyswitching2}. However, we found the simulation to be sensitive to the small changes in the initial conditions. For example, relaxing the magnetization for a few more picoseconds could in some cases influence the switching time by almost a hundred picoseconds even without eddy currents. The sensitivity might be due to the switching being an avalanche-like event, starting from small rotations in the magnetization vectors which generate the eddy field that in turn affects the time-evolution of the magnetization. Thus small changes in the eddy field and/or magnetization can have relatively large effects on the final switching time. \begin{figure}[t!] \leavevmode \includegraphics[trim=0cm 0cm 0cm 0cm, clip=true,width=1.0\columnwidth]{./eddy2.pdf} \caption{The anticipation of the magnetic switching of a Permalloy nanocube with $\alpha = 0.01$ when eddy currents are included in the simulation compared to the simulation without eddy currents. The inset shows that on average, the eddy currents anticipate the switching with low values for $\alpha$, while the trend actually seems to reverse for intermediate values. For the highest three values the difference in average switching time is negligible.} \label{FIGeddya005} \end{figure} To mitigate the sensitivity to initial conditions, we averaged the simulations over 150 realizations, each relaxed and then slightly perturbed with a weak random field. Though most of the results for averaged behaviour with and without eddy currents (inset of Fig.~\ref{FIGeddya005}) are within the standard error of the mean from each other, the results suggest that the effect of eddy currents depends on the value of the Gilbert damping. This seems reasonable, since after the initial contribution of the change in external magnetic field, the only contribution to eddy currents comes from the change in magnetization $\partial\mathbf{M}/\partial t$, which depends on the damping parameter. As noted in \mbox{Ref.~\cite{eddycurrenthead}}, eddy currents provide additional resistance to the precessional motion of the magnetic moments. In the low $\alpha$ regime, the magnetization tilts initially towards the $xy-$plane, after which there is a brief out-of-plane rotation, and then the switching occurs. The lessened precession with eddy currents can lead to magnetization not tilting as much out of the $xy$-plane after the initial tilt, thus leaving the magnetization more susceptible to initiating the switch. For \mbox{$\alpha =$ 0.05 - 0.07}, the additional resistance to precession due to eddy currents appears to act similarly to a higher damping constant, delaying the switching. For the largest values of \mbox{$\alpha =$ 0.08 - 0.10}, the switching is likely dominated overall by the Gilbert damping and thus the effect of eddy currents is negligible. The effect of eddy currents on the magnetic friction force was also studied, with the same simulation scenario of two CoCrPt films as in the movement simulations before, but with eddy currents included. In this test, we used smaller films (512 nm $\times$ 512 nm in the $xy$-plane) for shorter computation times. Not finding a documented value of the conductivity of thin CoCrPt films, we chose a conductivity similar to Permalloy, $\sigma = 10^6$ S/m. When compared to the movement simulation without eddy currents, there's no difference in the force resisting the motion at the first 100 ns. Later, the force changes compared to the eddy currentless case, though in our test simulation, the difference is relatively small (few tens \mbox{of pN}). The change seems to be caused less by the eddy current field of the base directly affecting the slider (as $\mathbf{H}_\mathrm{eddy}$ at that distance is very weak) and more by the change in the magnetization in both the base and the slider due to the eddy current fields inside the films. This change in magnetization further affects the $\mathbf{H}_\mathrm{exch}$ and the $\mathbf{H}_\mathrm{d}$, modifying the time evolution of the magnetization and thus the perceived force. In order to gain a clearer picture about how eddy currents affect the movement, a more in-depth study is required. Additionally, since Joule heating plays a significant role in the energy dissipation due to eddy currents, it would likely have to be taken into account in order to obtain conclusive results. \subsection{Performance and limitations} The scalar potential method requires fewer FFTs and calculations in the reciprocal space, and this somewhat mitigates the simulation time increase brought by the interpolation and the calculation of near field via the demagnetization tensor. Since the scalars also require fewer interpolations overall than do vectors, both the scalar potential method and the direct interpolation via splines are quite equal in computational cost. The discrete movement is naturally the fastest, as no additional calculations are required compared to simulations without movement. However, since one has to calculate the force exerted by the demagnetizing field of the base on the slider film, one still has to calculate the fields separately. This along with some calculations related to the movement results in the modified RK45 solver being a bit slower than the RK45 solver of \texttt{Mumax}3 in general. Eddy currents are computationally quite heavy, requiring two extra FFTs, IFFTs and interpolations for both the base and the slider, and the solving of a single Laplace's equation. Depending on the desired accuracy, they increase the computation time from roughly double up to an order of magnitude. The calculation of eddy currents also requires the information on the surface normals, and as such the simulated magnets have to be more than 1 cell thick or the normal is not uniquely defined. Additionally, since small enough changes in magnetization induce an eddy field so weak that it can be lost due to floating point precision, the eddy currents might start to affect the magnetization evolution at different points of time with different parameters. Since some quantities are calculated using a two-point central finite difference approximation, the values of the demagnetizing field in cells just outside the boundary of the base and slider in each direction are also interpolated to give correct values inside the magnet. Hence the slider and base have to be more than 2 simulation cells apart, which typically means distances larger than approx. \mbox{5 - 10 nm} depending on cell size. We found that when doing the spline interpolation on the GPU, performing 64 lookups on the nearest neighbors instead of 8 trilinear interpolations for the construction of the spline gives more accurate results and less noise. This might be caused by the fact that the linear interpolations on the GPU can take only 254 possible coordinate positions between two texture points \cite{ruijters1}, and thus using trilinear interpolations we implicitly round the position between cells to one of these 254 values, whereas with the 64 nearest neighbor lookups we get the position to floating point accuracy.\\ \section{Summary} \label{sec:summary} We have augmented an existing micromagnetic code \texttt{Mumax}3 with the possibility of moving geometries independently inside the simulation domain, making it possible to study two magnets in relative motion in a micromagnetic framework. We implemented smooth motion through interpolating the fields affecting the magnets during movement. For the interpolation of field terms in the LLG equation, an external library for 3D cubic spline interpolation on the GPU was integrated to the code, as well as a method for calculating the demagnetizing field with the scalar potential. The extension source code has been published as a separate branch for \texttt{Mumax}3 on GitHub \cite{github}. We tested our movement and eddy current implementations with various numerical example simulations and demonstrated that smooth relative motion can be well approximated using splines to interpolate the demagnetizing fields, while the errors in divergence and curl of the fields remain minimal. Comparison with the results from previous literature indicates that finite difference micromagnetic simulations are a suitable framework for studying the motion of microscale magnets and phenomena related to the motion such as magnetic friction. Eddy currents were found to have an effect in the switching time of Permalloy nanocubes and the friction force between two thin films in relative motion. However, the exact mechanism of how eddy currents and the related parameters affect the switching time merit further study. Additionally, more simulations are required to better assess the effect of eddy currents in magnetic friction context. \begin{acknowledgments} We acknowledge the support of the Academy of Finland via an Academy Research Fellowship (LL, projects no. 268302 and 303749), and the Centres of Excellence Programme (2012-2017, project no. 251748). We acknowledge the computational resources provided by the Aalto University School of Science Science-IT project, as well as those provided ny CSC (Finland). \end{acknowledgments}
\section{Introduction} \label{Introduction} \label{Intr} Electrons in the cosmic radiation were identified for the first time about fifty years after the discovery of CRs \citep{1961PhRvL...6..193M,1961PhRvL...6..125E}. Subsequently, the origin of the observed spectrum of CR electrons has been one of the most important questions in CR physics. Early CR electron measurements of increasing precision and expanding energy range were made over a series of balloon flights by different experiments \citep[e.g.,][]{ 1969ApJ...158..771F, 1975ApJ...199..669B, 1976ApJ...204..927H, 1984ApJ...287..622G, 1994ApJ...436..769G, 1995ICRC....3....1B, 1998ApJ...498..779B, 2000ApJ...532..653B, 2001ApJ...559..973T, 2002A&A...392..287G}. However, the experimental scatter was large because the CR electron spectrum is steeply falling with increasing energy, and the background of heavier CR species is high. The first high-statistics measurements of the all-electron CR spectrum over a wide energy range were made by the \emph{Fermi} Large Area Telescope (\emph{Fermi}--LAT{}) launched in 2008 \citep{2009ApJ...697.1071A}. These measurements showed that the all-electron spectrum is flatter than expected with an index about --3 over the energy range 7--1000 GeV \citep{2009PhRvL.102r1101A,2010PhRvD..82i2004A}. PAMELA data \citep[1--625 GeV,][]{2011PhRvL.106t1101A} generally confirmed the \emph{Fermi}--LAT{} results albeit with larger error bars, as did the higher precision data from AMS-02 \citep[0.5-1000 GeV,][]{2014PhRvL.113v1102A}. Even though the precise AMS-02 data showed deviations from the earlier \emph{Fermi}--LAT\ measurements that are significant due to high statistics and consequently very small error bars, the absolute difference is only $\sim$10\% above 20 GeV vs.\ a factor of $\sim$3--4 in the pre-{\it Fermi} era. Note that the latest \emph{Fermi}--LAT\ all-electron spectrum (7--2000 GeV) obtained using a revised event reconstruction and background rejection analysis \citep[][]{2017PhRvD..95h2007A} agrees well with AMS-02 results. Above $\sim$1 TeV, the all-electron spectrum falls rapidly \citep[H.E.S.S.,][]{2008PhRvL.101z1104A,2009A&A...508..561A}. The first ever measurement of the all-electron spectrum for energies $\lesssim100$ MeV outside of the heliosphere has been made by Voyager 1 that reached the heliopause in 2012 \citep{2013Sci...341..150S,2016ApJ...831...18C}. The strong interest in the CR electron spectrum during the last decade is also fueled by the PAMELA discovery of a continuous rise of the positron fraction up to $\sim100$~GeV \citep{2009Natur.458..607A}, and expectations of spectral features at very-high energies associated with local CR accelerators \citep[e.g.,][]{2004ApJ...601..340K}. The latter are yet to be found, although the dedicated experiment CALET has been operating on the International Space Station (ISS) since August 19, 2015 \citep{2017APh....91....1A}, and the ISS-CREAM, which was launched to the ISS on August 14, 2017, is also deployed there to make CR measurements in the multi-TeV range \citep{2014AdSpR..53.1451S}. The discovery of the rise of the positron fraction by PAMELA, contrary to the expectations based on the pure secondary production of positrons in energetic CR interactions with the interstellar gas \citep{1982ApJ...254..391P,1998ApJ...493..694M}, was the first clear evidence of new phenomena detected in CRs, even though the first hints of it appeared in data collected by earlier experiments. The TS93 apparatus launched on a balloon from Fort Sumner, NM, in 1993 measured a flat positron fraction $0.078\pm0.016$ in the range $\sim$5--60 GeV \citep{1996ApJ...457L.103G}. Subsequent balloon-borne flights by CAPRICE94 in 1994 \citep{2000ApJ...532..653B}, the HEAT-$e^\pm$ instrument in 1994 and 1995 \citep{1997ApJ...482L.191B}, and HEAT-pbar instrument in 2000 \citep{2004PhRvL..93x1102B}, indicated that the positron flux did not fall-off as quickly as expected. However, the experimental error bars in these early experiments were too large to provide convincing evidence for a new phenomenon. Following the PAMELA discovery the rise of the positron fraction up to 200~GeV was confirmed by the \emph{Fermi}--LAT\ \citep{2012PhRvL.108a1103A}, where the geomagnetic field (the ``East-West effect'') was used to provide the charge sign separation, and then up to $\sim500$ GeV with higher precision by AMS-02 \citep{2014PhRvL.113l1101A,2014PhRvL.113v1102A}. These measurements stimulated an extensive discussion of the origin of the rising positron fraction with dozens of different hypotheses proposed in the literature. They range from conventional astrophysics to non-standard model physics involving various types of dark matter particles. A component with similar origin could be also present in the electron spectrum \citep[e.g.,][]{RozzaJHEA_2015}. High-precision measurements of both electrons and positrons over a wide energy range are thus of critical importance toward unveiling the origin of the excess positrons. Meanwhile, the $e^\pm$ spectra and the positron fraction below $\sim$10 GeV was found to depend on the solar activity \citep[PAMELA,][]{2016PhRvL.116x1105A}. The determination of the true electron LIS is, therefore, of considerable interest for the astrophysics and particle physics communities. In the present paper, the same method \mynote{-- including the treatment of errors --} is employed as for the recently published studies devoted to the LIS of CR protons, helium nuclei, and anti-protons \citep{2017ApJ...840..115B}. \section{{\sc GALPROP}{} and \textsc{HelMod}{} codes} In this paper, we use a recently developed version of the \textsc{HelMod}\footnote{\mynote{ In this work we use \textsc{HelMod}{} version 3.5, available from http://www.helmod.org/. The origin of the \textsc{HelMod}{} code goes back to the work by \citeauthor*{1999NuPhS..78...26G} (\citeyear{1999NuPhS..78...26G}) \citep[see, for instance,][]{doi:10.1142/9789812702708_0004,DellaTorre2009,Bobik2011ApJ,DellaTorre2012,DellaTorre2013AdvAstro,BobikEtAl2016,2017HelMod}. It has been under continuous development since that time. \label{helmod-link}}} 2D Monte Carlo code for heliospheric CR propagation \citep[][]{Bobik2011ApJ,DellaTorre2013AdvAstro,2017HelMod} combined with the {\sc GALPROP}{}\footnote{http://galprop.stanford.edu} code for interstellar CR propagation \citep{2016ApJ...824...16J,2017ApJ...846...67P} to take advantage of the progress made in the recent CR electron measurements and to derive a self-consistent electron LIS. The \textsc{HelMod}{} code includes all relevant effects and, thus, a full description of the diffusion tensor. \textsc{HelMod}\ enables accurate calculations for the heliospheric modulation effect over arbitrary epochs and is easily interfaced with {\sc GALPROP}{}. \subsection{Galactic CR propagation with the {\sc GALPROP}{} code} \label{galprop} The {\sc GALPROP}\ code has been under development since the mid-90s \citep{1998ApJ...493..694M,1998ApJ...509..212S} and is the {\it de facto} standard code for calculating the propagation of CRs and their associated interstellar emissions. It solves the CR transport equation for a given source distribution and boundary conditions for all CR species. {\sc GALPROP}\ includes all relevant transport and energy loss/gain processes, such as a galactic wind (advection), diffusive reacceleration in the ISM, energy losses, nuclear fragmentation, radioactive decay, and the production of secondary particles and isotopes. The numerical solution of the transport equation can be obtained using different solvers, including a Crank-Nicholson implicit second-order scheme as well as an explicit method. The spatial boundary conditions assume free particle escape. For a given halo size the diffusion coefficient as a function of momentum is determined by fitting model parameters to CR nuclei secondary-to-primary ratios. The {\sc GALPROP}{} code computes a full network of CR primary, secondary and tertiary species from input source abundances. Starting with the heaviest primary nucleus typically considered ($^{64}$Ni, $A=64$) the propagation solution is used to compute the source term for its spallation products $A-1$, $A-2$, and so forth. These are propagated in turn, and so on down in mass to protons, secondary $e^\pm$, and $\bar{p}$. The inelastically scattered $p$ and $\bar{p}$ are treated as separate components (secondary $p$, tertiary $\bar{p}$). {\sc GALPROP}{} includes a description for the processes of K-capture, electron capture by bare CR nuclei and stripping, as well as knock-on electrons. More details are given in \citet{2006ApJ...642..902P}, \citet{2007ARNPS..57..285S}, \citet{2011CoPhC.182.1156V}, and \citet{2016ApJ...824...16J}, as well as the description of the most recent version of {\sc GALPROP}{} (v.~56) -- see \citet{PoS(ICRC2017)279} and \citet{2017ApJ...846...67P}, and references therein. \subsection{\textsc{HelMod}{} code for heliospheric CR transport \label{Sect::Helmod} {\sc GALPROP}{} provides the predictions for the LIS of all CR species. However, they cannot be compared to the direct CR measurements made at Earth's orbit, or generally in the inner heliosphere, because of the effect of the so-called heliospheric or solar modulation. This modulation is the combined effect of the expanding magnetic fields and the solar wind (SW) whose properties depend on the level of solar activity~\citep[e.g., see][]{2017ApJ...840..115B,2017HelMod}. The propagation of CRs in the heliosphere was first studied by \citet{1965P&SS...13....9P}, who formulated the transport equation~\citep[also called the Parker equation -- see, e.g., the discussion in][and reference therein]{Bobik2011ApJ}: \begin{align} \label{EQ::FPE} \frac{\partial U}{\partial t}= &\frac{\partial}{\partial x_i} \left( K^S_{ij}\frac{\partial \mathrm{U} }{\partial x_j}\right)\\ &+\frac{1}{3}\frac{\partial V_{ \mathrm{sw},i} }{\partial x_i} \frac{\partial }{\partial T}\left(\alpha_{\mathrm{rel} }T\mathrm{U} \right) - \frac{\partial}{\partial x_i} [ (V_{ \mathrm{sw},i}+v_{d,i})\mathrm{U}],\nonumber \end{align} where $U$ is the number density of Galactic CR particles per unit of kinetic energy $T$ (GeV/nucleon), $t$ is time, $V_{ \mathrm{sw},i}$ is the SW velocity along the axis $x_i$, $K^S_{ij}$ is the symmetric part of the diffusion tensor, $v_{d,i}$ is the particle magnetic drift velocity (related to the anti-symmetric part of the diffusion tensor), and $\alpha_{\mathrm{rel} }=\frac{T+2m_r c^2}{T+m_r c^2} $, with $m_r$ -- the particle rest mass per nucleon in units of GeV/nucleon. The terms in the Parker equation describe: (i) the \textit{diffusion} of Galactic CRs scattered by magnetic turbulences, (ii) the \textit{adiabatic} energy losses/gains due to the propagation in the expanding magnetic fields carried in the SW, (iii) an \textit{effective convection} resulting from the SW convection with velocity $\vec{V}_{\rm sw}$, and (iv) the \textit{drift effects} related to the drift velocity ($\vec{v}_{\rm drift}$). Overall, the heliospheric modulation results in energy losses and supression of the fluxes of CR species compared to the LIS that are energy- and charge-sign-dependent. These effects are controlled by the polarity of the solar magnetic field and by the level of solar activity. The particle transport within the heliosphere, from the Termination Shock (TS) to Earth's orbit, is treated in this paper using the \textsc{HelMod}{} code. \textsc{HelMod}{} integrates the \citet{1965P&SS...13....9P} transport equation using a Monte Carlo approach involving stochastic differential equations; for further details of the method and code see \citet{Bobik2011ApJ,BobikEtAl2016}. \mynote{ In previous models of CR propagation in the heliosphere, the parallel diffusion coefficient ($K_{||}$) was assumed to have a sharp break at $\sim$1 GV, in the transitional region between the two regimes at high and low rigidities~\citep[e.g., see][]{perko1987,alanko2007,Strauss2011,Bobik2011ApJ}. However, as the accuracy of the collected data increased, it becomes clear that a smooth transition between the two regimes is necessary. The functional form of such a transition that is currently employed in \textsc{HelMod}{} \citep[see Equation 5 in][]{2017HelMod} is consistent with those presented in \citet{BurgerHattingh1998} for the same rigidity interval.} The normalization of the parallel component $K_{||}$ of the symmetric part of the diffusion tensor $K^S_{ij}$ is determined by the so-called diffusion parameter $K_0$, as defined by Eq.~(2) of \citet[][and references therein]{2017HelMod}. In turn, the diffusion parameter $K_0$ includes a correction factor that rescales the absolute value proportionally to the drift contribution. This correction factor is evaluated in \citet{2017ApJ...840..115B} using the proton spectrum during the period of positive polarity of the heliospheric magnetic field (HMF), and accounts for the presence of the latitudinal structure in the spatial distribution of Galactic CRs. The same correction factor is now applied to electron propagation ($q<0$) during the negative HMF polarity period\footnote{A similar correction has to be evaluated for the negative-charge particle diffusion during the positive HMF polarity period ($qA<0$). The negative-charge particles are subject to a correction that is opposite to the one applied to the positive-charge particles.} ($A<0$), so that an equivalent scaling\footnote{\textsc{HelMod}{} Parameters -- usually determined at 1 AU -- are used for the properties of any heliospheric sector, according to the time required by the solar wind coming from the Sun to reach such a region \citep{Bobik2011ApJ,2017HelMod}. When this is not accounted for there is an effective time delay in the correlation between time variations of the parameters of the solar magnetic field, as measured at Earth, and the observed intensity variations of GCRs \citep[see, e.g.,][and references therein]{2017TomassettiTimeLag}.} is applied to periods with $qA>0$. \mynote{The drift treatment in \textsc{HelMod}{} follows the formalism originally developed by \citet{Potgieter85} and refined using Parker's magnetic field with polar correction described in \citet{DellaTorre2013AdvAstro}. During high activity periods the heliospheric magnetic field is far from being considered regular, therefore, we introduced a correction factor suppressing any drift velocity at solar maximum.} As discussed by \citet{2017HelMod}, the validity of the \textsc{HelMod}{} code is verified down to about 1 GV rigidities (equivalent to $\sim$1 GeV in kinetic energy for electrons). Lower rigidities/energies are not considered in the present work because to do so requires additional refinement for the description of the solar modulation in the outer heliosphere -- between TS and interstellar space \citep[see, e.g.,][]{2011ApJ...735..128S,2017NatAs...1E.115D} -- as well as inclusion of the turbulence in the calculation of the drift coefficient \citep[see, e.g.,][]{2017ApJ...841..107E}. However, Voyager 1 electron data is used as a guideline. \begin{deluxetable}{rrlc} \tablecolumns{4} \tablewidth{0mm} \tablecaption{Best-fit propagation parameters for electrons\label{tbl-1}} \tablehead{ \colhead{N} & \multicolumn{2}{c}{Parameter\quad} & \colhead{Best Value} } \startdata 1 & $z_h$,& kpc &4.0 \\ 2 & $D_{0}$,& $10^{28}$ cm$^{2}$ s$^{-1}$ &4.3 \\ 3 & $\delta$ &&0.405 \\ 4 & $V_{\rm Alf}$,& km s$^{-1}$ &31 \\ 5 & $dV_{\rm conv}/dz$,& km s$^{-1}$ kpc$^{-1}$ & 9.8 \enddata \end{deluxetable} \begin{deluxetable}{cc} \tablecolumns{2} \tablewidth{0mm} \tablecaption{Electron injection spectrum \label{tbl-2}} \tablehead{ \colhead{Parameters} & \colhead{Values} } \startdata $R_{0}$ &190 MV \\ $R_{1}$ &6 GV \\ $R_{2}$ &95 GV \\ ${\gamma}_0$ &2.57 \\ ${\gamma}_1$ &1.40 \\ ${\gamma}_2$ &2.80 \\ ${\gamma}_3$ &2.40/2.54\tablenotemark{a} \enddata \tablenotetext{a}{If an additional component to the electron spectrum is added, see a discussion in Section~\ref{Sect::results}.} \end{deluxetable} \begin{figure*} \begin{center} \includegraphics[width=0.72\textwidth]{fig1} \caption{The electron LIS (dashed) as derived from the MCMC procedure compared with AMS-02, PAMELA and Voyager 1 measurements (see text).} \label{fig:GALPROPLISS} \end{center} \end{figure*} \section{Interstellar propagation}\label{Sec:IntersProp} The tuning procedure employed in this paper is the same that was used by \citet{2017ApJ...840..115B}. A short description of the method is provided below. The Markov Chain Monte Carlo (MCMC) interface to v.56 of {\sc GALPROP}{} was adapted from CosRayMC~\citep{2012PhRvD..85d3507L} and, in general, from the COSMOMC package \citep{2002PhRvD..66j3511L}. An iterative procedure was developed that calculates LIS with {\sc GALPROP}{}, passing the results to \textsc{HelMod}{} to produce the modulated spectra for specific time periods for comparison with AMS-02 data, which are the observational constraints. The goodness estimator of the parameter scan is the natural logarithm of the likelihood. For computational convenience this is built using $\chi^2$ from all observables: hundreds of thousands of samples were generated and the Log-Likelihood used to accept or reject each sample. The scan is terminated when the Log-Likelihood is maximized. The basic features of CR propagation in the Galaxy are well-known, but the exact values of propagation parameters depend on the assumed propagation model and accuracy of selected CR data. Therefore, the MCMC procedure is used to determine the propagation parameters employing the best available CR measurements. The five propagation parameters that have the largest effect on the overall shape of CR spectra were left free in the scan that used a 2D {\sc GALPROP}{} model: the Galactic halo half-width $z_h$, the normalization of the diffusion coefficient $D_0$ and the index of its rigidity dependence $\delta$, the Alfv\'en velocity $V_{\rm Alf}$, and the gradient of the convection velocity $dV_{\rm conv}/dz$ ($V_{\rm conv}=0$ in the plane, $z=0$). The spatial distribution of CRs near the Sun depends only weakly on the chosen radial size of the Galaxy if its distance is farther than the halo size \citep[e.g.,][]{2012ApJ...750....3A}. The radial boundary is therefore set to 20~kpc. The best values for the main propagation parameters tuned to the AMS-02 data are listed in Table~\ref{tbl-1}. The values are similar to those obtained by \citet{2017ApJ...840..115B}, within the quoted error bands, while the convection velocity $V_{\rm conv}$ is set to 0 in the plane. For example, to get a more consistent electron LIS, the Alfv\'en velocity $V_{\rm Alf}$ was increased by $\sim2$~km~s$^{-1}$. As already discussed by \citet{2017ApJ...840..115B}, simultaneous inclusion of both reacceleration and convection is needed to describe the high precision AMS-02 data, particularly in the range below 20 GV where the modulation effects on CR spectra are significant. For more details the reader is referred to the above-mentioned paper. The MCMC procedure is used only for first step to define a consistent set for the Galactic CR propagation parameters. The \textsc{HelMod}\ module was then used for a methodical calibration of the LIS spectral parameters. Parameters of the injection spectra, such as spectral indices $\gamma_i$ and the break rigidities $R_i$, were left free, but their exact values depend on the solar modulation, so the low-energy parts of the spectra are tuned together with the solar modulation parameters as described below. To refine the LIS description smoothing features to the breaks in the injection spectrum were added. Reproducing the electron spectrum from MeV to TeV energies requires an injection spectrum with three spectral breaks. MCMC scans in $\gamma_i$ and $R_i$ were performed using CR electron measurements by AMS-02 \citep{2014PhRvL.113l1102A} and by Voyager~1 \citep{2016ApJ...831...18C} as constraints. At the next step, these parameters were slightly modified together with the solar modulation parameters in order to find the best-fit solution for the electron LIS, as explained by \citet{2017ApJ...840..115B}. Reproduction of the low-energy electron LIS measurements by Voyager 1 requires a break around $R_{0}\sim190$ MV. The resulting best-fit spectral parameters are shown in Table~\ref{tbl-2}. Note that the only data available to tune the electron LIS below AMS-02 energies are coming from Voyager~1. Unfortunately, the Electron Telescope (TET) aboard the Voyager~1 spacecraft cannot discriminate between electrons and positrons, so it provides only the all-electron spectrum. On the other hand, {\sc GALPROP}{} calculations indicate that the secondary positron fraction decreases as energy decreases being $\lesssim35$\% at its maximum contribution for $\sim200$ MeV energies, and becomes as small as a few per cent or less below $\sim$20 MeV \citep[e.g.,][]{2008ApJ...682..400P}. Therefore, assuming that only electrons are present in CRs at low energies the maximum error in the results at these energies would be $\sim30$\%. \begin{figure}[tb!] \centerline{ \includegraphics[width=0.49\textwidth]{fig2} } \caption{The proposed electron LIS is compared with high-energy all-electron data from AMS-02 and PAMELA experiments. } \label{fig:low_high_LISData} \end{figure} \begin{deluxetable*}{crrcc}[tb!] \tablecolumns{5} \tablewidth{0mm} \tablecaption{Normalization corrections applied to the electron LIS\label{tbl-norm}} \tablehead{ \colhead{Dataset group} & \colhead{Experiment} & \colhead{Time span}& \colhead{Normalization correction}& \colhead{Reference} } \startdata a) & PAMELA & 5 years integrated spectrum & 0.81 & \citet{2011PhRvL.106t1101A} \\ b) & PAMELA & 6 months integrated spectrum & 0.9 & \citet{2015ApJ...810..142A}\\ c) & AMS-02 & 3 years integrated spectrum & 1.0 & \citet{2014PhRvL.113l1102A} \enddata \end{deluxetable*} \begin{figure*}[tb!] \centerline{ \includegraphics[width=0.49\textwidth]{fig3a}\hfill \includegraphics[width=0.49\textwidth]{fig3b} } \caption{Differential intensity of CR electrons for AMS-02 2011-2013 (left) and PAMELA 2006-2010 (right) datasets. Points represent experimental data, the black dashed line is the {\sc GALPROP}{} LIS, and the red/green solid lines are the computed modulated spectra. The blue solid line represents the expected LIS including the high energy electron excess contribution (see text). The bottom panel shows the relative difference between the numerical solutions and the experimental data. } \label{fig:ElectronAMSPAMELA} \end{figure*} \begin{figure*}[tb!] \centerline{ \includegraphics[width=0.49\textwidth]{fig4a}\hfill \includegraphics[width=0.49\textwidth]{fig4b} } \caption{Differential intensity of CR electrons for PAMELA 2006 (left) and PAMELA 2009 (right) datasets. Points represent experimental data, the black dashed line is the {\sc GALPROP}{} LIS, and green solid lines are the computed modulated spectra. The bottom panel shows the relative difference between the numerical solution and the experimental data. } \label{fig:ElectronPAMELAa} \end{figure*} \begin{figure*}[tb!] \includegraphics[width=0.49\textwidth]{fig5a}\hfill \includegraphics[width=0.49\textwidth]{fig5b} \caption{High energy LIS for electrons (left panel) and ``all-electrons'' (right panel) along with AMS-02 (red points, \citealt{2014PhRvL.113l1102A,2014PhRvL.113v1102A}), PAMELA (green open circles, top panel,~\citealp{2011PhRvL.106t1101A}), \emph{Fermi}-LAT (orange squares, bottom panel, \citealt{2012PhRvL.108a1103A}), CALET (brown crosses, bottom panel, \citealt{PhysRevLett.119.181101}) and H.E.S.S.\ (cyan triangles, bottom panel, \citealt{2008PhRvL.101z1104A}) measurements. The {\sc GALPROP}{} LIS is plotted with the dashed line, the estimated high-energy omindirectional-intensity positron excess is plotted with the dot-dash line (multiplied by a factor of 2 in the bottom panel to account for the identical electron excess, see text) and, finally the sum of {\sc GALPROP}{} LIS and electron and positron excess components is plotted with the solid line.} \label{fig:el_sig} \end{figure*} \subsection{Electron LIS at low and Intermediate energies}\label{Sect::LISOutsideMod} Since the end of August, 2012, the Voyager 1 mission is exploring interstellar space providing invaluable data on the composition of Galactic CRs at low energies \citep{2013Sci...341..150S,2016ApJ...831...18C}. In the current analysis Voyager~1 data \citep{2016ApJ...831...18C} taken between December 2012 and June 2015 is used as a constraint for evaluating the electron LIS, as described above. A comparison of the Voyager 1 all-electron spectrum in the kinetic energy range 3--74 MeV and the proposed model for the LIS is shown in Figure~\ref{fig:GALPROPLISS}. The combined model provides a good description of the electron LIS at low energies. At high energies, where the CR fluxes are not affected by the heliospheric modulation, the most recent measurements by AMS-02 and PAMELA up to 90 GeV are included and shown in Figure~\ref{fig:low_high_LISData}. The electron LIS at even higher energies is discussed in Sect.~\ref{Sect::results}. It can be seen that even though the AMS-02 \citep{2014PhRvL.113l1102A} and PAMELA data \citep{2011PhRvL.106t1101A} in Figure~\ref{fig:low_high_LISData} are consistent within the error bars, the systematic difference between the datasets can be as large as $\sim$20\% in the energy range 30--90 GeV. Speculation on the possible origin(s) of this difference is not made here. However, it is clear that it is not the effect of solar modulation because it should be insignificant at these energies. For the MCMC procedure (Sect.~\ref{galprop}) the AMS-02 data is used because it has the smallest error bars. \subsection{Data at Earth \mynote{and outside of the ecliptic plane}}\label{Sect::DataAtEarth} This section illustrates an application of the HELMOD code to derivation of the modulated electron spectra at Earth. The spectra have to be compared to those measured by AMS-02 and PAMELA during periods of low \citep[i.e., PAMELA from 2006 to 2010,][]{2011PhRvL.106t1101A,2015ApJ...810..142A} and high solar activity~\citep[i.e., AMS-02 from 2011 to 2013,][]{2014PhRvL.113l1102A}. The available data are integrated over a period of a few months to years. To reproduce the conditions of both low and high solar activity, the \textsc{HelMod}{} modulated spectra are evaluated for each Carrington Rotation within the period appropriate to the corresponding dataset. The obtained results are then used to evaluate a unique normalized probability function for the modulation tool described in Section 3.1 of~\citet{2017ApJ...840..115B}. Improvements in the data analysis procedure and in the simulation of the time dependence of the tracking system performance of PAMELA \citep{2015ApJ...810..142A} lead to a $\sim$10\% increase in the overall normalization of the CR electron fluxes measured in the period from July, 2006 -- December, 2009 compared to earlier results \citep{2011PhRvL.106t1101A}. However, it is not enough to account for a systematic discrepancy of $\sim$20\% between AMS-02 and earlier results from PAMELA \citep{2011PhRvL.106t1101A}. Due to the smaller quoted systematic uncertainties, the AMS-02 data are used as the reference. In this work a normalization factor for the electron LIS that is listed in Table~\ref{tbl-norm} is calculated for each presented dataset. The computed modulated spectra, for both low and high solar activity periods, are shown in Figures \ref{fig:ElectronAMSPAMELA} and \ref{fig:ElectronPAMELAa}. The details of the modulation model are described in Sect.~\ref{Sect::Helmod} and applied to the LIS described in Sect.~\ref{Sect::LISOutsideMod}. The high energy part of the spectrum is not affected by the solar modulation, and, therefore, is not discussed here. Simulated spectra are in a good agreement with experimental data in the energy range from 1 GeV to 90 GeV. The $\sim2\sigma$ deviations seen in the energy range $\la$3 GeV are present in all spectra, and this most likely implies that the injection spectrum needs some additional adjustments. Further comparison with the data is made in Appendix~\ref{app:SupMat} that also includes data taken by PAMELA around solar minimum \citep{2015ApJ...810..142A}. \mynote{A reliable model for heliospheric modulation requires a proper modeling of CR distribution in the whole heliospheric volume, including space outside the ecliptic plane and at large distances from the Sun. Since 1990s and until 2009, the Ulysses spacecraft~\citep[see e.g.][]{Sandersonetal1995,Marsden2001,BaloghetAl2001} explored the heliosphere outside the ecliptic plane up to $\pm 80\ensuremath{^\circ }$ in solar latitude and at distances $\sim$1--5 AU from the Sun. In particular, observations of particle flux were performed using the Cosmic Ray and Solar Particle Investigation Kiel Electron Telescope (COSPIN/KET) and High Energy Telescope (COSPIN/HET). Figure~\ref{fig:OutEcliptic} shows the Ulysses counting rate normalized to the average value. Data for Ulysses were taken from Ulysses Final Archive\footnote{http://ufa.esac.esa.int/ufa}. The analyzed data come from the KET electron channel E300-B \citep[electron energies of 0.9--4.6 GeV]{1996A&A...307..981R} using the Carrington Rotation average. } \mynote{\textsc{HelMod}{} calculations are made for electrons of 0.6--10 GeV for each Carrington Rotation at the same distance and solar latitude as the Ulysses spacecraft. In order to correctly weight the spectral energy distribution, the calculated differential flux is then convolved with the subchannel response function available in \citet{1996A&A...307..981R}. The error band was evaluated using the procedure described in~\citet{2017ApJ...840..115B}. Figure~\ref{fig:OutEcliptic} shows a comparison of the Ulysses data with the \textsc{HelMod}{} calculations. Both experimental data and simulations are normalized to their corresponding mean values to allow a relative comparison along the solar cycle. The model reproduces the general features of the latitudinal gradients observed during the fast scans of 1994--1995 and 2007. Moreover, the agreement is still acceptable along the whole orbit, which extends as far as $\sim$3 AU. We note that the purpose of Figure~\ref{fig:OutEcliptic} is only to demonstrate the qualitative agreement between the \textsc{HelMod}{} calculations and observations. A proper quantitative comparison with the Ulysses data would require a calculation that combines several energy bins weighted with the Ulysses response function and detector efficiency. } \begin{figure*}[tb!] \centerline{ \includegraphics[width=0.95\textwidth]{fig6} } \caption{\mynote{Ulysses counting rate normalized to the average value for the KET electron channel E300-B (electron energies of 0.9--4.6 GeV) as a function of time, where each point is an average over one Carrington rotation. The red solid line is the \textsc{HelMod}{} calculation for electrons of 0.6--10 GeV convolved with the subchannel response function for each Carrington rotation at same distance and solar latitude of the Ulysses spacecraft. Blue area shows systematic errors associated with model calculations. }} \label{fig:OutEcliptic} \end{figure*} \section{Electron LIS} \label{Sect::results} In addition to the plots and tabulated data presented in Sect.~\ref{Sect::DataAtEarth} and the Appendix, we provide a parameterization $F(T)$ of the {\sc GALPROP}{} LIS (Figure \ref{fig:GALPROPLISS}) from 2 MeV up to 90 GeV as a function of kinetic energy in GeV: \begin{eqnarray}\label{EQ::an} &&F(T) = \\ &&\left\{ \begin{tabular}{lr} \multicolumn{2}{l}{$\displaystyle\frac{1.181\!\!\times\!\! 10^{11} T^{-12.061}}{1+4.307\!\!\times\!\! 10^{8} T^{-9.269}+3.125\!\!\times\!\! 10^{8} T^{-10.697}}$,}\\ & $T<6.88$ GeV\\ $995.598\, T^{-3.505}+4.423\, T^{-2.620}$, & \quad\ $ T\ge 6.88$ GeV \end{tabular} \right.\nonumber \end{eqnarray} where the units are (m$^2$ s sr GeV)$^{-1}$. This fit reproduces the {\sc GALPROP}{} electron LIS with an accuracy better than 5\% for the whole quoted energy range. The electron LIS that results from the model calculations is in a good agreement with data (Figure \ref{fig:el_sig}). Meanwhile, it may harbor an additional electron component from an unknown source of the same nature as that of the excess positrons \citep{2009Natur.458..607A,2014PhRvL.113l1101A}. If charge-sign symmetry is assumed, i.e.\ that the electron and positron components coming from an unknown source have identical spectra, then the spectral shape of such an additional electron component can be derived from AMS-02 positron measurements \citep{2014PhRvL.113l1102A}. The spectrum of an additional component, ``the signal,'' $S(T)$ can be parametrized as a function of kinetic energy as: \begin{equation} S(T)= 4.5\times10^{-3}\ T^{-1.53} e^{-\frac{T}{400\ {\rm GeV}}}\ ({\rm m}^2\ {\rm s\ sr\ GeV})^{-1} \end{equation} This involves a re-tuning of the electron injection spectrum above the break at 95 GV ($\gamma_3$ in Table~\ref{tbl-2}). This parameterization also takes into account the standard astrophysical background of secondary positrons evaluated to be $\la$6\% at 30 GeV \citep{1998ApJ...493..694M,2014PhRvL.113l1101A}. With an addition of the extra components, the electron and all-electron spectra \citep{2014PhRvL.113v1102A} match the AMS-02 data well (Figure \ref{fig:el_sig}). The calculated all-electron spectrum includes the astrophysical background of positrons ($\la$6\% relative to the all-electron LIS) that is also used as an estimate of the systematic uncertainty. The all-electron spectrum includes twice the positron excess that accounts for both extra electron and positron components. The inclusion of the extra electron and positron components in equal amounts improves the agreement with the AMS-02 data~\citep{RozzaJHEA_2015}. A possible origin of this excess will be discussed in a forthcoming paper devoted to the positron LIS. \section{Conclusions} The electron LIS derived in the current work provides a good description of the Voyager 1, PAMELA, and AMS-02 data over the energy range from 1 MeV to 1 TeV. The data for solar cycles 23 and 24 to be successfully reproduced within a single framework. This includes a fully realistic and exhaustive description of the relevant CR physics. Given their high precision, recent AMS-02 electron and positron data can be used to put useful constraints on the origin of the positron excess -- to be discussed in the forthcoming paper. This work complements earlier results on the proton, He, and antiproton LIS illustrating a significant potential of the combined {\sc GALPROP}{}-\textsc{HelMod}{} framework. \acknowledgements Special thanks are made to Pavol Bobik, Giuliano Boella, Karel Kudela, Marian Putis and Mario Zannoni for their support of the \textsc{HelMod}{} code and many useful suggestions. This work is supported by ASI (Agenzia Spaziale Italiana) under contract ASI-INFN I/002/13/0 and ESA (European Space Agency) contract 4000116146/16/NL/HK. Igor Moskalenko and Troy Porter acknowledge support from NASA Grant No.~NNX17AB48G.
\section{Introduction} Among the foregrounds imprinting temperature anisotropies and spectral distortions on the Cosmic Microwave Background (CMB) radiation, the thermal Sunyaev-Zel'dovich effect is of particular interest for Astrophysics and Cosmology~\citep{Sunyaev:1970, Sunyaev:1972, Sunyaev:1980, Sazonov:1999zp, Challinor:1999yz, Bunn:2006mp}. Inverse Compton scattering of the CMB photons by the hot electrons present within galaxy clusters results in a shift and distortion of their blackbody spectrum towards higher frequencies. The intracluster plasma cools down the CMB radiation at frequencies typically lower than $217\,\mathrm{GHz}$ while warming it up at higher frequencies. Such a signature is unique among foregrounds and has been intensively used by the {\textit{Planck}} satellite collaboration and other CMB ground telescopes, such as the Atacama Cosmology Telescope (ACT) and the South Pole Telescope, to provide unprecedented catalogues of Sunyaev-Zel'dovich (SZ) sources~\citep{Hasselfield:2013wf, Ade:2013skr, Bleem:2014iim, Ade:2015mva}. The SZ effect does not depend on the redshift, and therefore provides a new high-redshift observable of galaxy clusters. The full sky coverage of the {\textit{Planck}} satellite has allowed the release of the {\texttt{PSZ2}} catalog in \citet{Ade:2015gva} containing more than $1600$ SZ sources. Among them, $1200$ objects have been confirmed as clusters by the {\textit{Planck}} collaboration through their cross identification in the Meta-Catalog of X-ray detected clusters (MCXC)~\citep{2011A&A...534A.109P}, with optical counterparts in the Sloan Digital Sky Survey (SDSS)~\citep{York:2000gk}, in the {\texttt{redMaPPer}} catalog~\citep{Rozo:2014zva, Rykoff:2016trm}, in the Nasa/IPAC Extragalactic Database (NED), and with infrared galaxy overdensities in the Wide-field Infrared Survey (WISE)~\citep{2010AJ....140.1868W}. More than $400$ SZ sources were still unconfirmed at the time of publication of the catalog and not all confirmed sources have redshift information. Cluster counts using the {\texttt{PSZ2}} catalogue have been used for Cosmology in \citet{Ade:2015fva}. They allow CMB-independent estimations of the amplitude of the matter power spectrum $\sigma_8$ and of the matter density parameter $\Omega_\um$, which are currently in mild tension with the best fit $\Lambda$CDM model obtained from CMB primary anistropies alone~\citep{Ade:2015xua}. Doing cosmology with cluster counts requires the determination of a scaling relation between the total integrated Compton parameter $Y_{\mathrm{5R500}}$, the cluster angular size, $\theta_\us$, and its total mass, $M_{500}$, (defined over a radius enclosing $500$ times the critical density at redshift $z$). As explained in \citet{Ade:2013lmv}, SZ measurements give information on the relation between $Y_{\mathrm{5R500}}$ and $\theta_\us$ while breaking the degeneracy between $Y_{\mathrm{5R500}}$ and $M_{500}$, at a given redshift $z$, relies on a scaling relation extracted from X-ray observations and assuming hydrostatic equilibrium of the intracluster gas~\citep{2010A&A...517A..92A, Arnaud:2007br}. For each of the SZ sources, the {\texttt{PSZ2}} catalog provides the most probable hydrostatic mass $M_{\uSZ}(z)$ (and its standard deviation) assuming the scaling relation to hold. Follow-up programs of SZ sources are therefore of immediate interest in evaluating $M_{\uSZ}$ for a given cluster by the determination of its redshift $z$. Dedicated optical follow-up programs of unconfirmed {\textit{Planck}} clusters have been carried on using professional telescopes since the publication of the {\texttt{PSZ2}} catalog. The Pan-STARRS $1.8\,\mathrm{m}$ telescope survey~\citep{Liu:2014rza} has provided $60$ confirmations combined with spectroscopic redshift measurements. Another $16$ high-redshift clusters have been confirmed by the Canada-France-Hawa\"{\i} telescope (CFHT) with photometric redshifts together with richness mass estimates~\citep{vanderBurg:2015ssn}. Spectroscopic redshifts and confirmation of $13$ more clusters have been provided by the $1.5\,\mathrm{m}$ Russian-Turkish telescope, the $2.2\,\mathrm{m}$ Calar Alto Observatory telescope, and the $6\,\mathrm{m}$ Bolshoi (BTA) telescope in \citet{Vorobyev:2016hez} \citep[see also][]{Ade:2014pna}. The {\textit{Planck}} collaboration has used a month of observations at the Canary Islands Observatories for the confirmation of $73$ more candidates~\citep{Ade:2015qqa}. Although these numbers could suggest that unconfirmed SZ sources would soon be exhausted, artificial neural networks have recently been used on the {\textit{Planck}} CMB measurements to improve the detection threshold of SZ sources. A new catalog discussed by \citet{Hurier:2017krx} contains almost $4000$ galaxy cluster candidates. In addition, ground-based telescopes are still contributing to new SZ detection thereby calling for an increase of the telescope time needed for follow-up programs~\citep{Hilton:2017gal} . In this paper, we explore and report on the possibility to use sub-meter non-professional telescopes (of typically $0.5\,\mathrm{m}$-$0.6\,\mathrm{m}$ diameter) to carry on optical follow-up searches of unconfirmed SZ sources. In spite of obvious technical challenges, some scientific measurements can be achieved such as galaxy counts and photometric redshift estimates. As a test case, we report on a cluster candidate, {\texttt{PSZ2\,G156.24+22.32}}, which has not been confirmed in any of the aforementioned catalogs, nor in the follow-up programs, and which is not included in the SDSS sky coverage~\citep{2012ApJS..203...21A, 2012ApJS..199...34W}. The paper is organized as follows. Section~\ref{sec:obs} describes the observations and the method used for data reduction. Some details are provided concerning the observatory, the hardware used, as well as the technical difficulties overcome for achieving sufficiently good tracking and imaging for photometry. In Sect.~\ref{sec:results}, we present our main results, namely galaxy counts, photometric redshift, and optical richness estimates for {\texttt{PSZ2\,G156.24+22.32}}. In Sect.~\ref{sec:discuss}, various tests to assess the validity of our measurements are presented. In the conclusion, we briefly discuss a proof of concept on what small telescopes can and cannot achieve, would they massively contribute to the search of optical counterparts of SZ sources. \section{Observations and data reduction} \label{sec:obs} \subsection{Observatory and instrumentation} The observatory of Saint-V\'{e}ran is located in France, at $44\degree 42\arcmin 03\arcsec$ N, $6\degree 52\arcmin 06\arcsec$ E, at an altitude of $2930\,\mathrm{m}$ a.s.l. (IAU code 615). It has been managed by the Astroqueyras Association\footnote{\url{https://www.astroqueyras.com}} for roughly $30$ years, and is intended to allow amateur astronomers to observe under better conditions compared to that of typical lower altitude suburban skies. The observatory comprises three main instruments: a Cassegrain telescope with a diameter of $0.62\,\mathrm{m}$ and $9\,\mathrm{m}$ of focal length (T62), and two Ritchey-Chr\'{e}tien telescopes, each having a diameter of $0.5\,\mathrm{m}$ and $4\,\mathrm{m}$ of focal length. The instrument mainly used in the context of this work is the T62. Although the primary mirror is of $0.62\,\mathrm{m}$ diameter, the holding baffle reduces the effective aperture to $0.60\,\mathrm{m}$. The T62 is mounted on a German-type {\textsc{Reosc}} equatorial mount, equipped electronically for semi-automatic target pointing. The imaging device used is an {\textsc{Apogee U16M}} CCD camera equipped with a {\textsc{KAF-16803}} sensor, cooled at $-20\degree\,\mathrm{C}$. The sensor has $4096 \times 4096$ pixels of area $9\times9\,\mu\meter^2$, which implies a genuine angular sampling of $0.21\arcsec \times 0.21\arcsec$. The field of view is a square of $14\arcmin$ side. The \citet{1989S&T....77S.387K} polar drift method has been applied to align the mount right ascension (R.A.) and Earth rotation axes, and therefore improves the pointing and tracking accuracy. This operation must be done regularly, due to local seismic activity and a slow rotation of the mountain where the observatory is installed. In the context of this work, the residual angle between the right ascension axis of the mount and the Earth rotation axis was reduced to a value smaller than roughly $10\arcsec$. The native periodical error of the RA movement is estimated to be around $5\arcsec$ at vanishing declination (DEC), with smooth amplitude variations during tracking. The tracking accuracy is yet improved by auto-guiding the T62, i.e., by correcting any deviations between the sky and mount movements. This is achieved using a second camera installed on a $0.2\,\mathrm{m}$ Schmidt-Cassegrain telescope. It is mounted in parallel with the T62 and has a focal length of $2\,\mathrm{m}$. The camera has a {\textsc{Exview}} sensor made of $752 \times 580$ pixels of area $8.2 \times 8.4\,\mu\meter^2$. This allows for exposures up to $10$ to $15$ minutes long, depending on the telescope orientation and the target declination. The resulting guiding error is estimated from the average point spread function of the stars and found to be less or equal to the seeing. The measured full width at half maximum (FWHM) varies between $1.2\arcsec$ to $2\arcsec$ across the exposure series. These FWHM values led us to optimize the sampling for the {\textsc{Apogee U16M}} camera. A binning grouping four pixels into one has been used, yielding an angular sampling of $0.42\arcsec \times 0.42\arcsec$. The search for optical counterparts of the SZ targets has been performed in luminance, i.e. without a specific spectral filtering of the light input. Once the galaxies have been located, color imaging of the suspected cluster is done using interferential filters. For this work, we have used a set of {\textsc{Astrodon Gen 2 Sloan}} photometric filters corresponding to the SDSS photometric standards~\citep{Fukugita:1996qt, 2002AJ....123.2121S}. The low quantum efficiency of the {\textsc{KAF-16803}} sensor in the ultraviolet wavelength range led us to consider only the $g'$, $r'$, $i'$, and $z'$ filters. \subsection{Data acquisition} \label{sec:acquisition} The search of optical counterparts of the {\textit{Planck}} SZ candidates took place during two one-week long observation missions, one from 2015 November 7 to November 15, and the other between 2017 February 18 and February 26. The goal of the first mission was to assess the feasibility of the project and was dedicated to the observations of confirmed {\textit{Planck}} clusters having known redshifts. Individual galaxy identifications for five clusters having redshifts ranging from $0.1$ to $0.6$ were successfully performed. In particular, color imaging of two of them, {\texttt{PSZ2\,G138.32-39.82}} and {\texttt{PSZ2\,G164.18-38.88}}, located at redshift $0.280$ and $0.08$, respectively, allowed us to test the instrumentation for photometric redshift estimation. A low-signal test of our apparatus was achieved by successfully resolving individual galaxies in luminance within a distant cluster {\texttt{PSZ2\,G144.83+25.11}}, having a redshift of $0.584$ (also known as {\texttt{MACS\,J0647.7+7015}}). These results are discussed in more details in Sect.~\ref{sec:discuss}. The 2017 winter mission was dedicated to the search of non-confirmed {\textit{Planck}} SZ sources optical counterparts. Five objects from the {\texttt{PSZ2}} catalog, having no X-ray nor optical counterparts, have been pointed. The choice of the targets has been made taking into account several constraints. First, we have kept the airmass reasonably close to unity and only objects well-above the horizon, by at least $40\degree$, have been considered. Second, the targets should not be too close from the Milky Way to minimize possible confusion between faint stars and distant galaxies. A technical difficulty associated with the use of a small telescope is the exposure time needed to collect enough photons for galaxy detection. Based on empirical results from the first mission, around $1$ hour of exposure has been accumulated per target, made from $10$ minutes luminance slices. After performing some minimal data reduction, a visual inspection allowed us to check for overdensity within the $14\arcmin$ field of view around the SZ signal coordinates. Among the observed targets, {\texttt{PSZ2\,G156.24+22.32}} located in the Lynx constellation (northern celestial hemisphere), ended up showing a significant object count. We therefore started data acquisition in the color filter $g'$, $r'$, $i'$ and $z'$ from 2017 February 21 until the end of the mission on February 26. According to the above-mentioned criteria, {\texttt{PSZ2\,G156.24+22.32}} was of sufficiently high altitude in the sky only during the second half of the night. The first part of the night was therefore dedicated in the color imaging of our reference photometric SDSS DR9 galaxy field, located nearby {\messier{63}}, which is roughly at the same altitude in the sky than the one occupied by the cluster later on. Around $1.5$ hours of cumulated exposure per filter were taken for the reference field. In total, around $14$ hours of color exposure have been used to derive the results presented below. \subsection{Reduction} \label{sec:reduc} In order to produce photometric usable data, image reduction has been performed in two steps. In a first pass, we have used the Image Reduction and Analysis Facility ({\textsc{IRAF}}) to correct each image from bias, dark currents and nonlinear response pixels~\citep{1986SPIE..627..733T, 1993ASPC...52..173T}. Basic astrometric registration and airmass calculations are also performed for each color images in order to provide a World Coordinate System (WCS) compatible header for each of them. \begin{figure} \begin{center} \includegraphics[width=\onefigw]{figures/coaddcl_g156_24p22_32_allreg} \includegraphics[width=\onefigw]{figures/coaddLGRIZ_g156_24p22_32} \caption{Upper panel: circular regions of radius $2\arcmin$ and $3\arcmin$ centered at the {\textit{Planck}} SZ maximum signal location (marked by a cross) used for galaxy counts and photometric redshift estimates. Objects with a small circle are matched sources across the color filters (stars excluded; see the text). The lower panel is a zoom within the $3\arcmin$ region.} \label{fig:regions} \end{center} \end{figure} The second pass consists in an accurate astrometry and photometry solving starting from the WCS single-epoch images produced by the first pass. For this purpose, we have used the {\textsc{AstrOmatic}} software suite~\citep{1996A&AS..117..393B, 2006ASPC..351..112B, 2002ASPC..281..228B}. Sources are extracted in all images using {\textsc{SExtractor}} (version 2.19.5) with a detection and analysis threshold set at $1.5\sigma$ with respect to the local background noise. An astrometric and photometric solution is then obtained by using the {\textsc{Scamp}} code. It has been run in multi-instruments mode, one astrometric and photometric instrument for each color filter, plus luminance, and we have allowed for astrometric distortions within a given instrument. The reference astrometry catalog chosen is the {\texttt{USNO-B1}}~\citep{2003AJ....125..984M}. The reported internal astrometric errors are small, $0.05\arcsec$ (FWHM), and remain negligible with respect to the ones of the reference catalog, evaluated at $0.5\arcsec$ (FWHM). However, a shear contraction amplitude of typically $0.15\%$ has been corrected for each instrument, far above what one could have expected for an airmass never exceeding $1.4$ ($0.05\%$). The distortion map of the pixel scale computed by {\textsc{Scamp}} indeed reveals an almost constant hyperbolic pattern over all filters and luminance. Although the reason for this distortion is unclear, different sources are possible, among which a stress on the primary mirror, or still a minor mirror alignment issue leading to astigmatism appearing at moderate defocus. Time constraint did not allow for a deeper exploration and resolution of this issue. Concerning the photometric solution, zero-point changes across the exposure series have been corrected within each filter. The standard deviations of these corrections are found in the following ranges: $\Delta g'_0 \in [0.1,0.4]$, $\Delta r'_0 \in [0.05,0.3]$, $\Delta i'_0 \in[0.05,0.4]$ and $\Delta z'_0 \in[0.05,0.5]$. The first (and lowest) value is for high signal-over-noise matched sources only while the second one includes all matched objects between the single-epoch images and the reference catalog. Although corrected, these numbers show some degradation of our photometric stability up to half a magnitude for faint objects in the $z'$ filter, and some significant scatter in the $g'$ band as well. This could be attributed to the parasitic presence of a $V=7.2$ magnitude double star in the field of view as a much lower scatter is obtained for the SDSS reference field (see below and Fig.~\ref{fig:regions}). In the last step, coaddition of the corrected single-epoch images for each filter (and luminance) has been delegated to the {\textsc{SWarp}} code, which takes care of background estimation, as well as resampling, for each image. Highest contrasts have been obtained by using a median weighted stacking, the weights being estimated from the background noise~\citep[see][]{2002ASPC..281..228B}. \subsection{Calibration} The absolute zero-point magnitudes for the four coadded images in the $g'$, $r'$, $i'$, and $z'$ filter have been determined from our SDSS DR9 reference galaxy field (see Sect.~\ref{sec:acquisition}). The reference images have been reduced and flattened, for each color filter, exactly as described above. Then, we have used the {\textsc{SExtractor}} code over the coadded images to create a catalog of photometric reference sources. The magnitude measurement method chosen is {\texttt{mag\_auto}} and only high signal-over-noise detections have been kept, $5\sigma$ above the estimated background~\citep{1996A&AS..117..393B}. Our reference catalogs, in $g'$, $r'$, $i'$, and $z'$, are then matched together and to the SDSS DR9 catalog by cross identifying objects of same position at less than $1\arcsec$. For this purpose, the imaging software {\textsc{DS9}} has been used to create a set of roughly $30$ galaxies for which one has both the non-calibrated {\texttt{mag\_auto}} magnitudes and the {\texttt{modelMag}} magnitudes as provided by the SDSS DR9 catalog~\citep{2012ApJS..203...21A}. The zero-point values for each filter, $g'$, $r'$, $i'$ and $z'$, have been determined with {\textsc{IRAF}} using a photometric weighting based on the magnitude error estimates made by {\textsc{SExtractor}}. In the following, unless specified otherwise, our calibrated {\texttt{mag\_auto}} magnitudes will be referred to as $griz$ since they are indistinguishable of the {\texttt{modelMag}} SDSS DR9 magnitudes within the uncertainties of our apparatus and methodology. \section{Results} \label{sec:results} \subsection{Color catalog of matched objects} \label{sec:colorcat} From the photometric usable images obtained as described in Sect.~\ref{sec:obs}, we have constructed a $griz$ catalog of all objects suspected to be galaxies within the $14\arcmin$ field of view around the SZ coordinates associated with {\texttt{PSZ2\,G156.24+22.32}}. Again, the {\textsc{SExtractor}} code has been used for this purpose, in single-image mode and with a detection threshold at $2\sigma$ for the $g'$, $r'$, and $i'$ filter. As discussed in the previous section, the $z'$ image showing higher noise than the others, {\textsc{SExtractor}} has been used in two-images mode, $2\sigma$ detection coming from the $i'$ image, photometry coming from the $z'$ one with an analysis threshold set at $1.5\sigma$. Separation between stars and galaxies is made using the neural network classifier of {\textsc{SExtractor}} by discarding all objects having a {\texttt{CLASS\_STAR}} greater than $0.98$. The remaining objects over all filters are then matched together according to their position, required to be the same at $1\arcsec$, and then rejected if they correspond to an optical counterpart in the {\texttt{USNO-URAT1}} catalog~\citep{2015AJ....150..101Z}. In Fig.~\ref{fig:regions}, the SZ signal center, as reported in the {\texttt{PSZ2}} catalog, has been represented by a cross and small circles have been drawn around all the remaining objects of our $griz$ catalog. A visual inspection of their shape suggests that many of them should be galaxies while some overdensity is visible left from the SZ center. Let us notice that having chosen to exclude objects from the {\texttt{USNO-URAT1}} catalog is unexpectedly doing a good job in removing bright and close galaxies visible in the picture. A closer look to Fig.~\ref{fig:regions} also reveals that many small objects close to the bright star, and which are certainly galaxies belonging to the cluster, are not present in our $griz$ catalog. This is due to the fact that these sources have been excluded by {\textsc{SExtractor}} as being too much contaminated, in at least one color, by the parasitic glow of the star. As discussed below, five more objects close to the star end up being obvious outliers and will be removed from the subsequent analysis (drawn with a small white box). From the {\textit{Planck}} catalog {\texttt{MMF3}}, we have extracted the two-dimensional probability distribution in the plane $(Y_{\mathrm{5R500}},\theta_\us)$ associated with {\texttt{PSZ2\,G156.24+22.32}} \citep{Ade:2015gva}. By marginalizing over the integrated Comptonization parameter $Y_{\mathrm{5R500}}$, the most probable angular size of the SZ region is found to be \begin{equation} \theta_\us = 2.5\arcmin \pm 0.5\arcmin, \label{eq:ts} \end{equation} at $68\%$ of confidence. As a result, we have defined a circular region around the SZ maximum having a radius of $3\arcmin$ to encompass the whole SZ region. It is represented as the yellow circle in Fig.~\ref{fig:regions}. To assess the sensitivity of the results with respect to the chosen cluster angular size, another circular region has been defined, centered at the SZ location, with a radius of $2\arcmin$ (dashed inner circle in Fig.~\ref{fig:regions}). The intersection of our catalog with these two regions will be referred to as $griz_3$ and $griz_2$ in the following; they contain $114$ and $58$ objects, respectively (including the five outliers; see Fig.~\ref{fig:regions}). Finally, let us mention that {\texttt{PSZ2\,G156.24+22.32}} is associated in the {\texttt{PSZ2}} catalog with a value of $\texttt{Q\_NEURAL}=0.96$, which indicates a high probability of being a genuine SZ source. Moreover, as reported by \citet{vanderBurg:2015ssn}, all the SZ candidates validated by optical counterparts in this work have a $\texttt{Q\_NEURAL}>0.8$, thereby rendering our observation of galaxy overdensity around the SZ location not unlikely. \subsection{Photometric redshift and cluster mass} \begin{figure} \begin{center} \includegraphics[height=\onefigh]{figures/zann_test_pred_4x90_2} \includegraphics[height=\onefigh]{figures/zann_errors} \caption{Photometric redshift estimates of the artificial neural network over an independent testing set of $250\,000$ galaxies from the SDSS DR9 catalog. The upper panel shows the neural net estimated redshift $z_\uphot$ as a function of photometric SDSS redshift (the plot has been truncated to $8000$ random samples for illustration convenience). The lower panel shows the distribution of the residuals $\Delta z_\uphot$ and has a standard deviation of $\sigma_{\Delta z_\uphot} = 0.027$.} \label{fig:anntest} \end{center} \end{figure} \begin{figure} \begin{center} \includegraphics[width=\onefigw]{figures/mag_auto_3arcmin} \includegraphics[width=\onefigw]{figures/zphot_3arcmin} \caption{Upper panel: magnitude distribution in $griz$ for the $109$ galaxies observed within the $3\arcmin$ radius region centered at the SZ coordinates. The lower panel is the corresponding photometric redshift distribution as inferred by our neural network trained over the SDSS DR9 catalog (five outliers having negative redshifts removed).} \label{fig:griz3} \end{center} \end{figure} In order to evaluate the photometric redshift of the objects belonging to our color catalogs, we have used an artificial neural network (ANN) regression of the SDSS DR9 color-redshift relationship, but only for the reduced set of $griz$ colors. For this purpose, the publicly available {\textsc{SkyNet}} code has been run to train a simple feed-forward artificial neural network~\citep{2012MNRAS.421..169G, 2014MNRAS.441.1741G, 2014IAUS..306..279H}. The ANN input layer takes as argument the $griz$ {\texttt{modelMag}} magnitudes, and the output layer returns the photometric redshift. All input and hidden layer nodes of the ANN are evaluating the hyperbolic tangent of the biased weighted addition of the input signals. For faster training, the output layer has, however, been chosen to only perform a biased linear combination of the last hidden layer nodes. The training set chosen consists of $250\,000$ photometric clean objects from the SDSS DR9 data release, selected to have nearest neighbors in the SDSS color space, photometric redshift errors not exceeding $0.03$, and color magnitudes in the range $[12,29]$. Another group of $250\,000$ objects, selected with the same criteria, has been used as a testing set to check the quality of the ANN regression. We have found that a good enough learning of the ANN over the training set requires four hidden layers of $90$ nodes each, in addition to the input layer of four nodes and the single-node output layer. In total, {\textsc{SkyNet}} has been used to find the optimal values of more than $30\,000$ weights and biases as described in~\citet{2014MNRAS.441.1741G}. The upper panel of Fig.~\ref{fig:anntest} shows the ANN output values obtained by inputting the $griz$ color magnitudes of the SDSS DR9 testing set as a function of the photometric redshift estimated by the SDSS DR9 collaboration. The lower panel shows the distribution of the residuals. The ANN reproduces very well the SDSS estimated photometric redshifts for almost all values from $z_\uphot \simeq 0$ to $z_\uphot \simeq 0.8$. The standard deviation of the residuals, over a quarter million of objects, reads $\sigma_{\Deltaz_\uphot} = 0.027$. Because it is of the same order as the SDSS photometric redshift errors of the training catalog, the ANN regression is nearly optimal. Applying the trained ANN over the color magnitudes of our $griz_3$ catalog gives the distribution of photometric redshifts of all galaxies located at less than $3\arcmin$ from the SZ center associated with {\texttt{PSZ2\,G156.24+22.32}}. In total, $griz_3$ contains $114$ objects, five of them end up having a negative photometric redshift. A closer examination of these outliers show that they have unusually large values for the estimated error on {\texttt{mag\_auto}} ($\Delta m \gtrsim 0.2$), and they are all located close to the bright star. They have therefore been removed from the analysis and are represented as white boxes in Fig.~\ref{fig:regions}. The photometric redshift distribution of all the $109$ remaining objects has been plotted in the lower panel of Fig.~\ref{fig:griz3} while the upper panel shows their color magnitude distribution. A clear reddening of the objects can be observed between the $g$ and $r$ magnitude, and to a lesser extend between $r$ and $i$ as well, supporting the claim that the sources are redshifted galaxies. The photometric redshift distribution indeed shows a peak around a redshift of $0.3$ and no object are found with a redshift less than $0.08$ (up to the five outliers). In order to estimate the mode of the redshift distribution, the ``{\texttt{ash}}'' package of the {\textsc{R-project}} software suite has been used to compute a polynomial density estimate and extract its maximum. One finds \begin{equation} z_\uphot=0.29 \pm 0.08. \label{eq:zphot3} \end{equation} To minimize sensitivity to potential systematics, the quoted error stands for the median absolute deviation around the mode, normalized such that it would match the usual standard deviation for a Gaussian distribution. Changing the smoothing kernel does not affect the estimation of the mode by more than $0.01$. As expected, the median absolute deviation is larger than the intrinsic ANN residuals plotted in Fig.~\ref{fig:anntest} due to the color-magnitude errors of our measurements. The most probable hydrostatic mass, $M_{\uSZ}(z)$, as well as its standard deviation, as a function of the cluster redshift $z$ is given by the {\textit{Planck}} collaboration in the {\texttt{MMF3}} catalog~\citep{Ade:2015gva}. Combined with Eq.~\eqref{eq:zphot3}, it yields \begin{equation} M_{\uSZ} = \left( 4.4\pm 1.3 \right)\times 10^{14} M_{\sun}. \label{eq:msz} \end{equation} The quoted errors are the intersect of the median absolute deviations associated with the photometric redshift and the standard deviation on $M_{\uSZ}(z)$. In order to test the robustness of Eq.~\eqref{eq:zphot3} with respect to the chosen condition under which galaxies belong to the cluster, we have also considered a region of $2\arcmin$ radius around the SZ coordinates. This corresponds to the lower $1\sigma$ limit of $\theta_\us$ in Eq.~\eqref{eq:ts}, and to the objects constituting the $griz_2$ color catalog. After the removal of the same five outliers as in the $griz_3$ catalog, it remains $53$ galaxies for which one finds $z_\uphot=0.29 \pm 0.11$. As before, the first value is the mode and the error stands for the median absolute deviation around the mode. \subsection{Optical richness} \begin{figure} \begin{center} \includegraphics[height=0.89\onefigw]{figures/lambda_richness_0290} \includegraphics[height=0.94\onefigh]{figures/maxrichness} \caption{Upper panel: map of the optical richness $\lambda$ over the field of view of figure~\ref{fig:regions} (the red sequence galaxies are assumed to be at $z=0.29$). The lower panel shows the dependence of $\lambda(z)$ for the two locations exhibiting maximal richness in the upper panel. Only the one located East to the SZ center is well bounded in redshift and can be associated with a galaxy cluster (red points).} \label{fig:richmap} \end{center} \end{figure} A visual inspection of the red luminous objects contiguous to the ones contained within the $2\arcmin$- and $3\arcmin$-radius regions suggests that a galaxy population is also present further southest (SE), i.e., toward the lower left corner of Fig.~\ref{fig:regions}. Let us notice that the NED database reports one X-ray source in this region, {\texttt{1RXS\,J064506.9+592603}}~\citep{1999A&A...349..389V}. To quantify which objects are clustered, we have estimated the optical richness, $\lambda$, as discussed in \citet{2009ApJ...703..601R}. In practice, $\lambda$ has been computed according to the method presented in \citet{2012ApJ...746..178R} and \citet{2014ApJ...785..104R}. In order to use the same luminosity tracer as in these references, we have recalibrated our $i'$ filter over the SDSS DR9 reference field by using the $i$ {\texttt{CmodelMag}} magnitude (instead of the {\texttt{modelMag}}). The color has been estimated as before, namely our $g-r$ comes from $g'$ and $r'$ filter calibrated from {\texttt{modelMag}} magnitudes. This color should be an accurate tracer of the red-sequence galaxies up to redshift $0.35$~\citep{2000AJ....120.2148G, 2007ApJ...660..221K}. All of the magnitudes have been corrected for Galactic extinction and reddening~\citep{1998ApJ...500..525S, 2011ApJ...737..103S}, and the cosmological parameters have been chosen according to the Planck 2015 favored values~\citep{Ade:2015xua}. The presence of the parasiting star and the other uncertainties associated with our small instrumentation are expected to introduce various systematics in the determination of the photometric zero-points. As reported in \citet{2012ApJ...746..178R}, the determination of $\lambda$ is expected to be accurate for zero-point shifts up to $\pm 0.05$ magnitudes, and we might have systematic uncertainties as large as eight times this value for some objects (see section~\ref{sec:reduc}). Adding an additional scatter of $0.1$ magnitudes to luminosity and colors is indeed found to increase the value of $\lambda$ by a factor of $2$. As a result, there is a possibility that the following evaluations of $\lambda$ are underestimated, which is inherent to the experimental limitations of our setup. Notice, however, that the dependence of $\lambda$ with respect to the coordinates of the clustering center and to the redshift, remains mostly insensitive to the uncertainties in the photometric zero-points. This is what we focus on in the following. To minimize the propagation of these potential systematics, we have chosen the radial filter to be \begin{equation} R_{\mathrm{c}}(\lambda) = R_0 \left(\dfrac{\lambda}{100}\right)^{\beta}, \end{equation} with $R_0 = 0.95 h^{-1}\,\mathrm{Mpc}$, and $\beta=0.1$ instead of $R_0 =1 h^{-1}\,\mathrm{Mpc}$ and $\beta=0.2$ as done in \citet{2012ApJ...746..178R}. Our choice is still in the region of minimal intrinsic scatter for red-sequence galaxies, but has the advantage of lowering the impact of underestimated $\lambda$ values. The background galaxies and the red-sequence fit in $g-r$ have been taken as in \citet{2012ApJ...746..178R} while the luminosity filter is the one of \citet{2014ApJ...785..104R}. The upper panel of figure~\ref{fig:richmap} shows a map of $\lambda$ over the field of view of figure~\ref{fig:regions}, obtained by postulating that the red-sequence galaxies are at the redshift $z=0.29$. The two regions exhibiting maximal richness encompass the one visually expected east from the SZ center (left), around $(\alpha,\delta)=(101.31,59.48)$, and the one associated with the SE population at $(\alpha,\delta) = (101.27,59.36)$ (lower left). In the lower panel of figure~\ref{fig:richmap}, we have plotted the optical richness $\lambda(z)$, as a function of the redshift, for these two locations. Only the first one ends up being well localized in redshift space, and this allows us to improve the cluster's redshift estimate to \begin{equation} z_{\lambda} = 0.30{\,}^{+0.03}_{-0.05}\,. \end{equation} The quoted errors are the intercepts for FWHM. As can be seen in figure~\ref{fig:richmap}, for the SE population of galaxies, $\lambda(z)$ steadily increases up to $z=0.42$ to vanish at $z=0.7$ (not represented). For these redshifts, the choice of the color filter $g-r$ is no longer accurately tracing red-sequence galaxies, but we can, however, conclude that most of these objects do not belong to the population east from the SZ center. \begin{figure} \begin{center} \includegraphics[width=\onefigw]{figures/cmd} \caption{Color-magnitude diagram for the all objects located within a $R_\mathrm{c}(\lambda_{\max}) \simeq 1.1\,\mathrm{Mpc}$ radius around the cluster center (see the text and Fig.~\ref{fig:richmap}). Red crosses are for galaxies identified as cluster members, while the black dots are for all the other objects.} \label{fig:cmd} \end{center} \end{figure} Finally, in figure~\ref{fig:cmd}, we have represented the color-magnitude diagram for all objects found within a $R_\mathrm{c}(\lambda_{\max})$ radius around the location $(101.31, 59.48)$, corresponding to the east population of figure~\ref{fig:richmap}. The red crosses represent red-sequence galaxies, which have been identified as belonging to the cluster with a probability greater than $0.5$. The scatter of half a magnitude in $g-r$ for bright objects ($i <17$) might be the result of the aforementioned systematics in the zero-points. As already discussed, they may bias $\lambda$ to lower values by pulling galaxies off the red sequence. For fainter objects, the dispersion in $g-r$ shows a clear degradation, which is expected due to the loss of signal, especially toward the limiting magnitude $i\gtrsim 20$. \section{Discussion} \label{sec:discuss} \subsection{Comparison with Pan-STARRS1} \label{sec:panstarrs} The SZ source under scrutiny belongs to the second Planck SZ catalog, and it does not appear in the Pan-STARRS follow-up paper~\citep{Liu:2014rza}. However, the recent data release of the Pan-STARRS1 (PS1) survey~\citep{2016arXiv161205560C} covers the location of {\texttt{PSZ2\,G156.24+22.32}}. As can be checked on the PS1 public archive\footnote{\href{http://ps1images.stsci.edu/cgi-bin/ps1cutouts?pos=101.23488+59.450954}{https://confluence.stsci.edu/display/PANSTARRS}}, the $grizy$ stack images encompassing the SZ location show significant background subtraction and saturation artifacts coming from the central bright star. The depth of the $griz$ channels also appears to be smaller than the one we have obtained from the $14$ hours of exposure (see Fig.~\ref{fig:griz3}). This is not very surprising, as the small aperture of the $0.6\,\mathrm{m}$ telescope renders imaging less sensitive to saturation\footnote{Two-colors fits available at this \href{http://cp3.irmp.ucl.ac.be/~ringeval/upload/aape5/twocolors}{url}}. Concerning the limiting magnitudes, as explained in \citet{2016arXiv161205560C}, although the Pan-STARRS telescope collects $10$ times more light than the T62, the exposure time on each patch is relatively small. For the plates encompassing {\texttt{PSZ2\,G156.24+22.32}}, this is about $10$ minutes for the $grz$ channels, and $20$ minutes for $i$. Nevertheless, the objects we have identified as galaxies are also present in the PS1 redder colors, while being hardly visible in $g$ only. More interestingly, and although we have not attempted a quantitative comparison, the other southeast galaxy overdensity is present and more easily seen owing to the larger field of view accessible in the PS1. \subsection{Other redshift estimates} We have also attempted to estimate the photometric redshift associated with the $griz_3$ catalog by using a simple linear color fit over the $g$, $r$, $i$ and $z$ magnitudes. The best fit has been determined over $100\,000$ galaxies of the SDSS DR9 catalog by iterative rejections of all objects remaining at more than $3 \sigma$ from the best fit. This rejection is necessary as a brute force linear color fit over all SDSS DR9 galaxies ends up being reasonably tracking the photometric redshift only within the limited range $0.1 \lesssim z_\uphot \lesssim 0.35$. Applying the best fit to the $griz_3$ catalog yields a photometric redshift distribution, again centered around a redshift $0.3$, but with a much larger spreading than the one represented in Fig.~\ref{fig:griz3}. We find $z_\uphot=0.35 \pm 0.16$, the first value being again the mode and the second one stands for the absolute median deviation. Finally, we have tested an alternative redshift estimate by ignoring data taken with the $z'$ filter, as it shows some higher photometric errors than in the $g'$, $r'$, and $i'$ bands for faint objects (see Sect.~\ref{sec:reduc}). Following in all points the method presented in Sect.~\ref{sec:results}, but for the $gri$ magnitudes only, one finds, within the $3\arcmin$-radius region, $z_\uphot=0.27 \pm 0.06$ for the mode and absolute median deviation. This is again compatible with the photometric estimate in Eq.~\eqref{eq:zphot3}. \subsection{Instrumental tests on confirmed clusters} As mentioned in the introduction, instrumental tests have been undertaken during the 2015 mission to assess the feasibility of resolving individual galaxies in distant clusters with small telescopes. Successful identification of individual galaxies has been obtained for all the observed clusters, and we briefly report below our results for each of them. \begin{description} \item[\texttt{PSZ2\,G144.83+25.11}], referred to as {\texttt{MACS\,J0647.7+7015}}, is a massive and distant cluster located at $z=0.584$. It has been used as a low-signal test of the T62 and imaged in luminance for a total exposure time of $1.5$ hours. As can be seen in Fig.~\ref{fig:farmacs}, individual galaxies are resolved, but the elliptical shape of only a few can be guessed. Overdensity in galaxy counts is obvious, but occupies a relatively small angular size, about $2\arcmin$.\\ \item[\texttt{PSZ2\,G149.75+34.68}], also known as {\texttt{RXC\,J0830.9+6551}}, is reported in the {\textit{Planck}} catalog with a X-ray redshift of $z_\uX=0.1818$~\citep{2003ApJ...594..154M}. The elliptic shape of the most massive galaxies is resolved after less than $1$ hour of luminance exposure.\\ \item[\texttt{PSZ2\,G157.32-26.77}], also {\texttt{MACS\,J0308.9+2645}}, at a redshift of $z=0.356$~\citep{2001ApJ...553..668E}. Galaxies are individually resolved after $1.6$ hours of luminance exposure, but elliptic shape can only be inferred for the largest ones.\\ \item[\texttt{PSZ2\,G138.32-39.82}] has a X-ray counterpart known as {\texttt{RX\,J0142.0+2131}}, which is located at a redshift $z_\uspec=0.280$~\citep{Barr:2005gi}. This cluster has been observed with the $0.5\,\mathrm{m}$ telescope and four non-standard interferential color filters available at that time, centered over the red, green, blue and near infrared wavelengths, with about $2.5$ hours of exposure per filter. Calibration over SDSS galaxies was used to determine a transformation matrix between these colors and the SDSS $ugri$ ${\texttt{modelMag}}$, and a linear color-redshift fit gives $z_\uphot=0.30 \pm 0.1$ (mode and absolute median deviation).\\ \item[\texttt{PSZ2\,G164.18-38.88}], a close cluster belonging to the \citet{1958ApJS....3..211A} catalog and known as {\texttt{Abel\,401}}, at a redshift of $z=0.0739$. It has been observed in luminance with the T62 and for a total exposure time of $4.5$ hours. The shape of galaxies is well resolved, and their internal structure, such as spiral arms, can be observed for many of them. However, no obvious galaxy overdensity can be inferred, as the $14\arcmin$ field of view is too small for encompassing all the cluster's galaxies. We have also observed the same field of view with the $0.5\,\mathrm{m}$ telescope in three non-standard colors (blue, green, and near infrared) up to $1.5$ hours per filter. A linear color-redshift fit gives $z_\uphot=0.09 \pm 0.08$ for the mode and the absolute median deviation. \end{description} \begin{figure} \begin{center} \includegraphics[width=\onefigw]{figures/coaddcl_g144_83p25_11_invert} \caption{Low-signal instrumental test for the $0.6\,\mathrm{m}$ telescope during the 2015 mission. The image corresponds to a total of $1.5$ hours of luminance exposure. Many galaxies of {\texttt{MACS\,J0647.7+7015}}, located at redshift $z=0.584$, are individually resolved, but the elliptic shape of only a few can be guessed.} \label{fig:farmacs} \end{center} \end{figure} \section{Conclusions} \label{sec:conclu} This article presents the results of optical follow-up searches of {\textit{Planck}} SZ sources with non-professional $0.5\,\mathrm{m}$ and $0.6\,\mathrm{m}$ telescopes. Our main result is the confirmation of the cluster candidate {\texttt{PSZ2\,G156.24+22.32}} by observing more than $100$ galaxies within a $3\arcmin$-radius region around the SZ coordinates and by estimating their photometric redshift at $z_\uphot=0.29 \pm 0.08$. We have also estimated the optical richness, $\lambda$, around this location. Although systematics in the photometric zero-points are expected to bias $\lambda$ to lower values, its dependence in redshift allows us to narrow down the cluster's redshift to $z_\lambda=0.30{\,}^{+0.03}_{-0.05}$. Imaging also reveals a contiguous population of galaxies extending a few arcminutes southeast from the SZ region. However, their optical richness suggests that they do not belong to the cluster, and are loosely concentrated around $z \simeq 0.42$. The robustness of these results have been tested against the choice of the region in which galaxies are counted, the color-redshift relationship, and by removing the $z'$ color data. Moreover, photometric redshift estimates of two already confirmed clusters of the {\texttt{PSZ2}} catalog, made with the same telescopes, are compatible with their actual redshifts. The potential of individual sub-meter instruments in the optical confirmation of SZ sources and the measurement of their redshift is obviously limited with respect to what can be achieved with much larger telescopes. However, compared with automated acquisition campaigns, their advantage is the possibility to acquire sensibly deeper data by accumulating longer exposure time over one target (see Sect.~\ref{sec:panstarrs}). The present results suggest that observing galaxy overdensity and estimating redshift are achievable in a redshift range $0.1$ to $0.6$, albeit with relatively large uncertainties for the redshift, up to $40\%$ for the closest clusters. In addition, there are potentially hundreds of sub-meter class telescopes available around the world, mostly within the amateur astronomer community. With even a fraction of them, dedicated searches of SZ sources could be collectively envisaged, in a way similar to what the Galaxy Zoo project is providing~\citep{2008MNRAS.389.1179L}. A case-by-case tuning of the acquisition parameters (unitary exposure time in particular) can be operated to account for the presence of bright objects in the vicinity of the faint galaxies to be detected, which is more complicated to achieve in the case of an automatic survey. Such a collective campaign would certainly bring complementarity to automated surveys. At the very least, such a project could be used to provide a first information on the redshift before starting more accurate investigations with professional telescopes. \section*{Acknowledgments} We would like to warmly thank the Astroqueyras Association for having allocated us the time and resources needed to carry on this project. In particular, the acquisition of the set of Sloan filters was greatly appreciated. It is a pleasure to thank E.~Bertin, H.~J.~McCracken, and the two anonymous referees for precious advice. We also acknowledge usage of the SDSS-III data, whose funding and participating institutions can be found at \url{http://www.sdss3.org/}. The optical richness code has been developed based on the one publicly provided by R.~H.~Wechsler at \url{http://risa.stanford.edu/redmapper}. We have made use of the NED database, operated by the Jet Propulsion Laboratory, the California Institute of Technology, under NASA contract, and the SIMBAD database, operated at the Centre de Donn\'ees Astronomique de Strasbourg, France~\citep{2000A&AS..143....9W}. Preprocessing of raw images has been made with IRAF, distributed by the National Optical Astronomy Observatories. Catalog manipulations have been made using \href{http://ds9.si.edu}{SAOImage DS9}. \bibliographystyle{aasjournal}
\section{Introduction} Combinatorial Hopf algebras are combinatorial vector spaces endowed with a product (that combines combinatorial objects) and a coproduct (that decomposes combinatorial objects), subject to a strong compatibility relation. This paper is motivated by two particularly relevant combinatorial Hopf algebras: C.~Malvenuto and C.~Reutenauer's Hopf algebra~$\MR$ on permutations~\cite{MalvenutoReutenauer} and J.-L.~Loday and M.~Ronco's Hopf algebra~$\LR$ on binary trees~\cite{LodayRonco}. Remarkably~\cite{HivertNovelliThibon-algebraBinarySearchTrees}, $\LR$ embeds as a Hopf subalgebra of~$\MR$ by sending each binary tree~$\tree$ to the sum of the permutations in a certain class~$\linearExtensions(\tree)$. More precisely, the permutations in~$\linearExtensions(\tree)$ are the linear extensions of~$\tree$ (seen as the Hasse diagram of a poset oriented towards its root), or equivalently the permutations whose insertion in a binary search tree gives~$\tree$. The resulting classes are equivalence classes of the sylvester congruence~\cite{HivertNovelliThibon-algebraBinarySearchTrees} on permutations, defined as the transitive closure of the rewriting rule~$UacVbW \equiv^\textrm{sylv} UcaVbW$ where~${a < b < c}$ are letters while~$U,V,W$ are words~on~$\N$. The objective of the present work is to discuss similar Hopf algebra structures on congruence classes of all lattice quotients of the weak order on~$\fS_n$. Several examples of relevant combinatorial structures arise from lattice quotients of the weak order. The fundamental example is the Tamari lattice introduced by D.~Tamari in~\cite{Tamari} and largely studied since then (see the survey book~\cite{TamariFestschrift}). It can be defined as the transitive closure of right rotations on binary trees. It is also (isomorphic to) the quotient of the weak order on~$\fS_n$ by the above-mentioned sylvester congruence. See \fref{fig:weakOrderTamariLattice}. Many other relevant lattice quotients of the weak order have been studied, see in particular~\cite{Reading-CambrianLattices, ChatelPilaud, PilaudPons-permutrees, LawReading, Giraudo, Law, Pilaud-brickAlgebra}. N.~Reading provided in~\cite{Reading-arcDiagrams} a powerful combinatorial description of the lattice congruences of the weak order and of their congruence classes in terms of collections of certain arcs and noncrossing arc diagrams. \begin{figure}[t] \capstart \centerline{$\vcenter{\includegraphics[scale=.8]{weakOrder}} \hspace{-7cm} \vcenter{\includegraphics[scale=.62]{TamariLattice}}$} \caption{The weak order (left) and the Tamari lattice (right).} \label{fig:weakOrderTamariLattice} \end{figure} The search for Hopf algebra structures on congruence classes of lattice quotients of the weak order was pioneered by N.~Reading. In~\cite{Reading-HopfAlgebras}, he studied Hopf subalgebras of~$\MR$ generated by sums of permutations over the classes of a fixed lattice congruence~$\equiv_n$ on each~$\fS_n$ for~${n \ge 0}$. He called translational (resp.~insertional) certain families~$(\equiv_n)_{n \in \N}$ of congruences that yield a subalegbra (resp.~subcoalgebra). This approach produces relevant Hopf algebras indexed by interesting combinatorial objects such as permutations~\cite{MalvenutoReutenauer}, binary trees~\cite{LodayRonco}, diagonal rectangulations~\cite{LawReading} (or equivalently twin binary trees~\cite{Giraudo}), sashes~\cite{Law}, certain pipe dreams called twists~\cite{Pilaud-brickAlgebra}, etc. However, the conditions on these families of congruences are rather constrained. A more recent approach, initiated by G.~Chatel and V.~Pilaud for the Cambrian algebra~\cite{ChatelPilaud} and extended by V.~Pilaud and V.~Pons for the permutree algebra~\cite{PilaudPons-permutrees}, consists of constructing subalgebras of decorated versions of the algebra~$\MR$. For example, \cite{ChatelPilaud} considers simultaneously all Cambrian congruences defined in~\cite{Reading-CambrianLattices}. These congruences are given by certain rewriting rules~\cite{Reading-CambrianLattices} generalizing the sylvester congruence, and their classes are given by linear extensions of certain Cambrian trees~\cite{LangePilaud, ChatelPilaud} generalizing binary trees. Since these congruences depend on a sequence of signs, the Cambrian algebra of~\cite{ChatelPilaud} is constructed as a subalgebra of a Hopf algebra on signed permutations generalizing~$\MR$ and studied by J.-C.~Novelli and J.-Y.~Thibon in~\cite{NovelliThibon-coloredHopfAlgebras}. The same idea was used in~\cite{PilaudPons-permutrees} to construct an algebra on permutrees. Note that the Hopf algebra of~\cite{NovelliThibon-coloredHopfAlgebras} on signed permutations is also useful for type~$B$ generaizations, see for instance~\cite{FoissyFromentin, JosuatNovelliThibon}. In this paper, we explore this approach further to construct Hopf algebras on other families of congruences of the weak order. Starting with a graded set of decorations~$\f{X}$ endowed with an operation of concatenation and an operation of selection that fulfill natural compatibility relations (see Definition~\ref{def:decorationSet}), we construct a Hopf algebra on permutations decorated with elements of~$\f{X}$. Provided a well-chosen map~$\arcs$ from the decoration set~$\f{X}$ to the lattice congruences of the weak order (see Definition~\ref{def:conservative}), we then construct a Hopf algebra on the classes of the lattice congruences in the image of~$\arcs$. This algebra is obtained as a Hopf subalgebra of the Hopf algebra of $\f{X}$-decorated permutations. The choice of~$\f{X}$ and~$\arcs$ leaves quite some flexibility and allows to construct different relevant Hopf algebras on lattice congruence classes. In this paper, we apply this general recipe in two particular settings: \begin{enumerate}[(i)] \item In the first setting, the image of~$\arcs$ is a family of lattice congruences of the weak order that simultaneously generalize the permutree congruences of~\cite{PilaudPons-permutrees} and the twist congruences of~\cite{Pilaud-brickAlgebra}. The resulting Hopf algebra contains (as Hopf subalgebras) those of~\cite{PilaudPons-permutrees, Pilaud-brickAlgebra}. \\[-.2cm] \item In the second setting, the map~$\arcs$ is surjective so that we obtain a Hopf algebra involving the classes of all lattice congruences of the weak order. It contains (as Hopf subalgebras) the algebras of~\cite{MalvenutoReutenauer, LodayRonco, ChatelPilaud, PilaudPons-permutrees} but not those of~\cite{LawReading, Giraudo, Pilaud-brickAlgebra}. \end{enumerate} Let us mention that, although our method covers simultaneously all lattice congruences and allows quite some flexibility on the resulting Hopf algebra structure, it is restricted to lattice congruences of the weak order. Many monoid congruences are not lattice congruences of the weak order, but give rise to relevant subalgebras of~$\MR$. For instance, the plactic monoid related to the Robinson-Schensted-Knuth insertion gives rise to the Hopf algebra of S.~Poirier and C.~Reutenauer on Young tableaux~\cite{PoirierReutenauer}. The paper is organized as follows. In Section~\ref{sec:latticeCongruences}, we first recall N.~Reading's combinatorial model for lattice quotients of the weak order on~$\fS_n$ in terms of arc diagrams, and provide a combinatorial description of the surjection map from permutations to noncrossing arc diagrams of any fixed lattice congruence of~$\fS_n$. In Section~\ref{sec:generalRecipe}, we present our general recipe to construct Hopf algebras on permutations and arc diagrams decorated with a given decoration set. Finally, Section~\ref{sec:examples} is devoted to some relevant applications of this general recipe. \section{Lattice congruences of the weak order and arc diagrams} \label{sec:latticeCongruences} We first review a powerful combinatorial interpretation of the lattice quotients of the weak order on permutations in terms of arc diagrams. All results presented in this section are either borrowed or directly follow from N.~Reading's work on noncrossing arc diagrams~\cite{Reading-arcDiagrams}. \subsection{Canonical representations of permutations and noncrossing arc diagrams} \label{subsec:canonicalRepresentations} Consider a finite lattice~$(L,\le,\meet,\join)$. A \defn{join representation} of~$x \in L$ is a subset~$J \subseteq L$ such that~${x = \bigJoin J}$. Such a representation is \defn{irredundant} if~$x \ne \bigJoin J'$ for a strict subset~$J' \subsetneq J$. The irredundant join representations of an element~$x \in L$ are ordered by containement of the lower ideals of their elements, \ie~$J \le J'$ if and only if for any~$y \in J$ there exists~$y' \in J'$ such that~$y \le y'$ in~$L$. When this order has a minimal element, it is called the \defn{canonical join representation} of~$x$. All elements of the canonical join representation~$x = \bigJoin J$ are then \defn{join-irreducible}, \ie cover a single element. A lattice is \defn{join-semidistributive} when every element has a canonical join representation. Equivalently~\cite[Thm.~2.24]{FreeseNation}, ${x \join z = y \join z \Longrightarrow x \join z = (x \meet y) \join z}$ for any~${x, y, z \in L}$. \defn{Canonical meet representations}, \defn{meet-irreducible elements} and \defn{meet-semidistributive lattices} are defined dually. A lattice is \defn{semi-distributive} if it is both join- and meet-semidistributive. Let~$[n] \eqdef \{1, \dots, n\}$ and let~$[a,b] \eqdef \{a, \dots, b\}$ and~${{]a,b[} \eqdef \{a+1, \dots, b-1\}}$ for~$a < b$. Consider the set~$\fS_n$ of permutations of~$[n]$. An \defn{inversion} of~$\sigma = \sigma_1 \dots \sigma_n \in \fS_n$ is a pair~$(\sigma_i, \sigma_j)$ such that~${i < j}$ and~${\sigma_i > \sigma_j}$. Denote by~$\inv(\sigma)$ the \defn{inversion set} of~$\sigma$. The \defn{weak order} on~$\fS_n$ is defined by inclusion of inversion sets, that is $\sigma \le \tau$ if and only if ${\inv(\sigma) \subseteq \inv(\tau)}$. Its minimal (resp.~maximal) element is the permutation~$1 \dots n$ (resp.~$n \dots 1$) and its cover relations correspond to swapping two consecutive entries in a permutation. See \fref{fig:weakOrderTamariLattice}. The weak order on~$\fS_n$ is known to be a semidistributive lattice. The canonical join and meet representations of a permutation~$\sigma$ were explicitly described by N.~Reading in~\cite{Reading-arcDiagrams} as follows. A \defn{descent} (resp.~\defn{ascent}) in~${\sigma = \sigma_1 \dots \sigma_n \in \fS_n}$ is a position~$i \in [n-1]$ such that~$\sigma_i > \sigma_{i+1}$ (resp.~${\sigma_i < \sigma_{i+1}}$). For a descent~$i$ of~$\sigma$, define~$\underline{\lambda}(\sigma, i)$ to be the permutation whose entries are given by~$1 \dots (\sigma_{i+1} - 1)$ followed by~$\set{\sigma_j}{j < i, \, \sigma_j \in {]\sigma_{i+1}, \sigma_i[}}$ in increasing order, then~$\sigma_i \sigma_{i+1}$, then~$\set{\sigma_j}{j > i+1, \, \sigma_j \in {]\sigma_{i+1}, \sigma_i[}}$ in increasing order, and finally~$(\sigma_i + 1) \dots n$. This permutation~$\underline{\lambda}(\sigma, i)$ is join-irreducible since it has a unique descent~$\sigma_i > \sigma_{i+1}$. We define dually a meet-irreducible permutation~$\overline{\lambda}(\sigma, i) \eqdef \omega_\circ \underline{\lambda}(\omega_\circ\sigma,i)$ for each ascent~$i$ of~$\sigma$, where~$\omega_\circ \eqdef [n, n-1, \dots, 2, 1]$ is the longest permutation of~$\fS_n$. \begin{theorem}[{\cite[Thm.~2.4]{Reading-arcDiagrams}}] \label{thm:joinMeetRepresentationsPermutations} The canonical join and meet representations of a permutation~$\sigma = \sigma_1 \dots \sigma_n$ are given by~$\bigJoin \set{\underline{\lambda}(\sigma, i)}{\sigma_i > \sigma_{i+1}}$ and~$\bigMeet \set{\overline{\lambda}(\sigma, i)}{\sigma_i < \sigma_{i+1}}$. \end{theorem} As N.~Reading observed in~\cite{Reading-arcDiagrams}, the permutation~$\underline{\lambda}(\sigma, i)$ is uniquely determined by the values~$\sigma_i$ and~$\sigma_{i+1}$ and by the set~$\set{\sigma_j}{j < i, \, \sigma_j \in {]\sigma_{i+1}, \sigma_i[}}$. This combinatorial data can be recorded in the following combinatorial gadgets. An \defn{arc} is a quadruple~$(a, b, n, S)$ where~$a,b,n \in \N$ are such that~$1 \le a < b \le n$, and~${S \subseteq {]a,b[}}$. We define~$\c{A}_n \eqdef \set{(a, b, n, S)}{1 \le a < b \le n \text{ and } S \subseteq {]a,b[}}$, and~$\c{A} \eqdef \bigsqcup_{n \in \N} \c{A}_n$. For a permutation~${\sigma \in \fS_n}$, we denote by~$\underline{\alpha}(i, i+1, \sigma) \eqdef (\sigma_{i+1}, \sigma_i, n, \set{\sigma_j}{j < i \text{ and } \sigma_j \in {]\sigma_{i+1}, \sigma_i[} \,})$ the arc associated to a descent~$i$ of~$\sigma$ and by~$\underline{\delta}(\sigma) \eqdef \set{\underline{\alpha}(i, i+1, \sigma)}{\sigma_i > \sigma_{i+1}}$ the set of arcs corresponding to all descents of~$\sigma$. We define~$\overline{\alpha}$ and~$\overline{\delta}$ dually for ascents. An arc~$(a, b, n, S)$ can be visually represented as an $x$-monotone continuous curve wiggling around the horizontal axis, with endpoints~$a$ and~$b$, and passing above the points of~$S$ and below the points of~${]a,b[} \ssm S$. Using this representation, N.~Reading provided a convenient visual interpretation of~$\underline{\delta}$ and~$\overline{\delta}$. For this, represent the permutation~$\sigma$ by its \defn{permutation table}~$(\sigma_i, i)$. (This unusual choice of orientation is necessary to fit later with the existing constructions ~\cite{LodayRonco, HivertNovelliThibon-algebraBinarySearchTrees, ChatelPilaud, PilaudPons-permutrees}.) Draw arcs between any two consecutive dots~$(\sigma_i, i)$ and~$(\sigma_{i+1}, i+1)$, colored green if~$\sigma_i < \sigma_{i+1}$ is an ascent and red if~$\sigma_i > \sigma_{i+1}$ is a descent. Then move all dots down to the horizontal axis, allowing the segments to curve, but not to cross each other nor to pass through any dot. The set of red (resp.~green) arcs is then the set~$\underline{\delta}(\sigma)$ (resp.~$\overline{\delta}(\sigma)$) corresponding to the canonical join (resp.~meet) representation of~$\sigma$. See \fref{fig:noncrossingArcDiagrams} for illustrations of these maps. \begin{figure} \capstart \centerline{\includegraphics[scale=.85]{arcDiagrams}} \caption{The noncrossing arc diagrams~$\underline{\delta}(\sigma)$ (bottom) and~$\overline{\delta}(\sigma)$ (top) for the permutations~$\sigma = 2537146$, $2531746$, $2513746$, and $2513476$.} \label{fig:noncrossingArcDiagrams} \end{figure} This representation provides a natural characterization of the sets of join-irreducible (resp.~meet-irreducible) permutations that form canonical join (resp.~meet) representations. We say that two arcs \defn{cross} if the interior of the two curves representing these arcs intersect. In other words, the arcs~$(a, b, n, R)$ and~$(c, d, n, S)$ cross if there exist~$r, s \in \big( [a,b] \cap [c,d] \big) \ssm \big( \{a,b\} \cap \{c,d\} \big)$ such that~$r \in \big( R \cup \{a,b\} \big) \ssm S$ while $s \in \big( S \cap \{c,d\} \big) \ssm R$. A \defn{noncrossing arc diagram} is a collection~$\c{D}$ of arcs of~$\c{A}_n$ such that for any two arcs~$\alpha, \beta \in \c{D}$ do not cross and have distinct left endpoints and distinct right endpoints (but the right endpoint of~$\alpha$ can be the left endpoint of~$\beta$ or~\mbox{\viceversa}). See \fref{fig:noncrossingArcDiagrams} for examples of noncrossing arc diagrams. \begin{theorem}[{\cite[Thm.~3.1]{Reading-arcDiagrams}}] The maps~$\underline{\delta}$ and~$\overline{\delta}$ are bijections from permutations of~$\fS_n$ to noncrossing arc diagrams of~$\c{A}_n$. \end{theorem} The reverse bijections~$\underline{\delta}^{-1}$ and~$\overline{\delta}^{-1}$ are explicitly described in~\cite[Prop.~3.2]{Reading-arcDiagrams}. Briefly speaking, consider the poset of connected components of~$\c{D}$ ordered by (the transitive closure of) the priority $X \prec Y$ if there is an arc~$\alpha = (a, b, n, S) \in \c{D}$ with~$S \cap X \ne \varnothing$ and~$a, b \in Y$ or with~$a, b \in X$ and~$({]a,b[} \ssm S) \cap Y \ne \varnothing$. To obtain~$\underline{\delta}{}^{-1}(\c{D})$ (resp.~$\overline{\delta}{}^{-1}(\c{D})$), choose the linear extension of this priority poset where ties are resolved by choosing first the leftmost (resp.~rightmost) connected component, and order decreasingly (resp.~increasingly) the values in each connected component. See \fref{fig:noncrossingArcDiagrams}. \subsection{Lattice quotients of the weak order} \label{subsec:latticeQuotients} Consider a finite lattice~${(L,\le,\meet,\join)}$. A \defn{lattice congruence} of~$L$ is an equivalence relation on~$L$ that respects the meet and the join operations, \ie such that $x \equiv x'$ and~$y \equiv y'$ implies ${x \meet y \, \equiv \, x' \meet y'}$ and~${x \join y \, \equiv \, x' \join y'}$. Equivalently, the equivalence classes of~$\equiv$ are intervals of~$L$, and the up and down maps~$\projUp$ and~$\projDown$, respectively sending an element of~$L$ to the top and bottom elements of its equivalence class for~$\equiv$, are order-preserving. A lattice congruence~$\equiv$ defines a \defn{lattice quotient}~$L/{\equiv}$ on the congruence classes of~$\equiv$ where the order relation is given by~$X \le Y$ if and only if there exists~$x \in X$ and~$y \in Y$ such that~$x \le y$. The meet~$X \meet Y$ (resp.~the join~$X \join Y$) of two congruence classes~$X$ and~$Y$ is the congruence class of~$x \meet y$ (resp.~of~$x \join y$) for arbitrary representatives~$x \in X$~and~$y \in Y$. Intuitively, the quotient~$L/{\equiv}$ is obtained by contracting the equivalence classes of~$\equiv$ in the lattice~$L$. More precisely, we say that an element~$x$ is \defn{contracted} by~$\equiv$ if it is not minimal in its equivalence class of~$\equiv$, \ie if~$x \ne \projDown(x)$. As each class of~$\equiv$ is an interval of~$L$, it contains a unique uncontracted element, and the quotient~$L/{\equiv}$ is isomorphic to the subposet of~$L$ induced by its uncontracted elements. Moreover, the canonical join representations in the quotient~$\projDown(L)$ are precisely the canonical join representations of~$L$ that do not involve any contracted join-irreducible. This yields the following. \begin{theorem}[{\cite[Thm.~4.1]{Reading-arcDiagrams}}] \label{thm:arcDiagrams} Consider a lattice congruence~$\equiv$ of the weak order on~$\fS_n$, and let~$\c{I}_\equiv$ denote the arcs corresponding to the join-irreducible permutations not contracted by~$\equiv$. \begin{enumerate}[(i)] \item A permutation~$\sigma$ is minimal in its $\equiv$-congruence class if and only if~${\underline{\delta}(\sigma) \subseteq \c{I}_\equiv}$. \item Sending a $\equiv$-congruence class with minimal permutation~$\sigma$ to the arc diagram~$\underline{\delta}(\sigma)$ defines a bijection between the congruence classes of~$\equiv$ and the noncrossing arc diagrams~in~$\c{I}_\equiv$. \item The congruence~$\equiv$ is the transitive closure of the rewriting rule~$\sigma \to \sigma \cdot (i \; i+1)$ where~$i$ is a descent of~$\sigma$ such that~${\underline{\alpha}(i, i+1, \sigma)} \notin \c{I}_\equiv$. \end{enumerate} \end{theorem} A dual statement holds replacing minimal by maximal and~$\underline{\delta}(\sigma)$ by~$\overline{\delta}(\sigma)$. Moreover, the sets of arcs~$\bigset{\underline{\delta}(\sigma)}{\sigma \text{ join-irreducible}, \; \projDown(\sigma) = \sigma}$ and~$\bigset{\overline{\delta}(\sigma)}{\sigma \text{ meet-irreducible}, \; \projUp(\sigma) = \sigma}$ coincide. We denote still this set~$\c{I}_\equiv$. \subsection{Arc ideals} \label{subsec:arcIdeals} It remains to characterize the sets of arcs~$\c{I}_\equiv$ corresponding to the uncontracted join-irreducibles of a lattice congruence of the weak order. This is again transparent on the arc representation of join-irreducible permutations. An arc~$(a, d, n, S)$ is \defn{forced} by an arc~$(b, c, n, T)$ if~${a \le b < c \le d}$ and~${T = S \cap {]b,c[}}$. Graphically, it means that~$(b, c, n, T)$ is obtained by restricting the arc~$(a, d, n, S)$ to the interval~$[b,c]$. We denote by~$(a, d, n, S) \prec (b, c, n, T)$ the forcing order. \fref{fig:forcingOrderArcIdeals}\,(left) shows this order on~$\c{A}_4$. \begin{figure} \capstart \centerline{\includegraphics[scale=.55]{forcingOrder} \hspace{1.5cm} \includegraphics[scale=.9]{arcIdeals2lines}} \caption{The forcing order on arcs of~$\c{A}_4$ (left) and some examples of arc ideals~$\c{A}_{\north, \south, \east, \west}^{< k}$ (right) whose associated lattice congruence classes correspond to permutations, binary trees, binary sequences, diagonal rectangulations, permutrees, sashes, acyclic $2$-twists, and $3$-descent schemes. Walls are in red and $k = 1$ if not stated otherwise.} \label{fig:forcingOrderArcIdeals} \end{figure} \begin{theorem}[{\cite[Coro.~4.5]{Reading-arcDiagrams}}] \label{thm:arcIdeals} A set of arcs~$\c{I} \subseteq \c{A}_n$ corresponds to the set of uncontracted join-irreducible permutations of some lattice congruence~$\equiv$ of the weak order on~$\fS_n$ if and only if it is an upper ideal of the forcing order~$\prec$. \end{theorem} Call \defn{arc ideal} any upper ideal~$\c{I}$ of the forcing order: $(a, d, n, S) \in \c{I}$ implies~${(b, c, n, S \cap {]b,c[}) \in \c{I}}$ for all~$a \le b < c \le d$ and~$S \subseteq {]a,d[}$. We denote by~$\f{I}_n$ the set of arc ideals of~$\c{A}_n$. \begin{example} \label{exm:boundedCrossingCongruences} The sets of all arcs~$\c{A}_n$, the set of upper arcs~$\c{A}_n^+ \eqdef \set{(a, b, n, {]a, b[})}{1 \le a < b \le n}$, the set of lower arcs~$\c{A}_n^- \eqdef \set{(a, b, n, \varnothing)}{1 \le a < b \le n}$, or the union~$\c{A}_n^+ \cup \c{A}_n^-$ are all arc ideals. More generally, fix four functions~$\north, \south, \east, \west : [n] \to \N$ and choose~$k \in \N$. For each~$a \in [n]$, draw $\north(a)$ upper vertical walls above~$a$, $\south(a)$ lower vertical walls below~$a$, and~$\min(\east(a), \west(a+1))$ horizontal walls from~$a$ and~$a+1$. Then the set~$\c{A}_{\north, \south, \east, \west}^{< k}$ of arcs that cross at most~$k-1$ of all these walls is an arc ideal. For certain choices of~$\north, \south, \east, \west$ and~$k$, the resulting arc ideals can correspond to: \begin{itemize} \item the weak order~(${\north = \south = \east = \west = 0}$ and~$k = 1$), \item the Tamari lattice~\cite{Tamari} ($\north = \east = \west = 0$ and ${\south = k = 1}$), \item the boolean lattice ($\north = \south = k = 1$ and $\east = \west = 0$), \item the lattice of diagonal rectangulations~\cite{LawReading}~($\north = \south = 0$ and $\east = \west = k = 1$), \item the permutree lattices~\cite{PilaudPons-permutrees}~($\north \le 1$, $\south \le 1$, $\east = \west = 0$ and ${k = 1}$), \item the lattice of sashes~\cite{Law} ($\north = 1$, $\south = 2$, $\east = \west = 0$ and~$k = 2$), \item the lattice of acyclic $k$-twists~\cite{Pilaud-brickAlgebra} ($\north = \east = \west = 0$, ${\south = 1}$ and~$k \ge 1$), \item the lattice of $k$-descent schemes~\cite{NovelliReutenauerThibon, Pilaud-brickAlgebra} ($\north = \south = 1$, $\east = \west = 0$ and~$k \ge 1$). \end{itemize} See \fref{fig:forcingOrderArcIdeals}\,(right). \end{example} \subsection{Explicit surjection} \label{subsec:surjection} Consider a lattice congruence~$\equiv$ of the weak order and let~$\c{I} = \c{I}_\equiv$. According to Theorem~\ref{thm:arcDiagrams}, the congruence classes of~$\equiv$ are in bijection with noncrossing arc diagrams of~$\c{I}$. Moreover, the map~$\underline{\eta}{}_\c{I}$ defined by~$\underline{\eta}{}_\c{I}(\sigma) \eqdef \underline{\delta}\big( \projDown(\sigma) \big)$ sends a permutation~$\sigma \in \fS_n$ to the noncrossing arc diagram of~$\c{I}$ corresponding to the congruence class of~$\sigma$. For completeness, we now provide a direct explicit description of this surjection~$\underline{\eta}{}_\c{I}$. \begin{figure}[b] \capstart \centerline{\includegraphics[scale=.85]{arcDiagramsQuotients}} \caption{The noncrossing arc diagrams~$\underline{\eta}_\c{I}(\sigma)$ (bottom) and~$\overline{\eta}_\c{I}(\sigma)$ (top) for the permutation~$\sigma = 2537146$ and different arc ideals (represented in light gray).} \label{fig:arcDiagramsQuotients} \end{figure} We still represent the permutation~$\sigma$ by its permutation table~$\set{(\sigma_i, i)}{i \in [n]}$. We define \[ \boxbslash(\sigma) \eqdef \set{(i, j)}{1 \le i < j \le n, \, \sigma_i > \sigma_j \text{ and } \sigma({]i,j[}) \cap {]\sigma_j, \sigma_i[} = \varnothing}. \] Intuitively, $\boxbslash(\sigma)$ are the pairs of positions such that the rectangle with bottom right corner~$(\sigma_i, i)$ and top left corner~$(\sigma_j, j)$ contains no other point~$(\sigma_k, k)$ of the permutation table of~$\sigma$. Order~$\boxbslash(\sigma)$ by~$(i, j) \prec (k,\ell)$ if~$i \le k < \ell \le j$ and~$\sigma_k \ge \sigma_i > \sigma_j \ge \sigma_\ell$. For~$(i, j) \in \boxbslash(\sigma)$, we define an arc~$\alpha(i, j, \sigma)$ by \[ \underline{\alpha}(i, j, \sigma) \eqdef (\sigma_j, \sigma_i, n, \set{\sigma_k}{j < k \text{ and } \sigma_k \in {]\sigma_j, \sigma_i[} \,}). \] Note that it extends our previous definition of~$\underline{\alpha}(i, i+1, \sigma)$ in Section~\ref{subsec:canonicalRepresentations}. Finally, define~$\boxbslash_\c{I}(\sigma)$ to be the subset of $\prec$-maximal elements in~$\set{(i, j) \in \boxbslash(\sigma)}{\underline{\alpha}(i, j, \sigma) \in \c{I}}$. \begin{proposition} For any~$\sigma \in \fS_n$, the set~$\underline{\eta}{}_\c{I}(\sigma) = \underline{\delta}\big( \projDown(\sigma) \big) = \bigset{\underline{\alpha}(i, j, \sigma)}{(i, j) \in \boxbslash_\c{I}(\sigma)}$ is the noncrossing arc diagram of~$\c{I}$ corresponding to the $\equiv$-congruence class of~$\sigma$. \end{proposition} \begin{proof} We first observe that if~$\sigma \in \fS_n$ is minimal in its congruence class, then~$\underline{\eta}{}_\c{I}(\sigma) = \underline{\delta}(\sigma)$ is the arc diagram of the congruence class of~$\sigma$. Indeed, observe first that the characterization of Theorem~\ref{thm:arcDiagrams}\,(i) ensures that~$\boxbslash_\c{I}(\sigma)$ contains~$(i,i+1)$ for each descent~$i$ of~$\sigma$. Conversely, consider~$(i, j) \in \boxbslash_\c{I}(\sigma)$. Since~$(i, j) \in \boxbslash(\sigma)$, there exists~$i \le k < j$ such that~$\sigma_{k+1} \le \sigma_j < \sigma_i \le \sigma_k$. Therefore, $(k, k+1) \in \boxbslash_\c{I}(\sigma)$ so that~$(i, j) = (k, k+1)$ by $\prec$-maximality in the definition of~$\boxbslash_\c{I}(\sigma)$. Assume now that~$\sigma \in \fS_n$ is not minimal in its congruence class. By~Theorem~\ref{thm:arcDiagrams}\,(i), $\sigma$ has a descent~$i$ such that~$\underline{\alpha}(i, i+1, \sigma) \notin \c{I}$. Let~$\sigma' \eqdef \sigma \cdot (i \; i+1)$. Note that~${\boxbslash(\sigma) \ssm \{(i,i+1)\} \subseteq \boxbslash(\sigma')}$. Conversely, consider~$(k,\ell) \in \boxbslash(\sigma') \ssm \boxbslash(\sigma)$. Then either~$k = i$ and~$\ell > j$, or~$k < i$ and~$\ell = j$. In both cases, $\underline{\alpha}(i, j,\sigma')$ cannot belong to~$\c{I}$ since it forces~$\underline{\alpha}(i, i+1, \sigma)$ which does not belong to~$\c{I}$. We conclude that~$\boxbslash_\c{I}(\sigma') = \boxbslash_\c{I}(\sigma)$ so that~$\underline{\eta}{}_\c{I}(\sigma') = \underline{\eta}{}_\c{I}(\sigma)$. In other words, $\underline{\eta}{}_\c{I}(\sigma)$ is preserved by the rewriting rule of Theorem~\ref{thm:arcDiagrams}\,(iii). This concludes the proof since this rewriting rule terminates on a permutation which is minimal in its congruence class. \end{proof} As in Section~\ref{subsec:canonicalRepresentations}, $\underline{\eta}{}_\c{I}(\sigma)$ is obtained by connecting the points~$(\sigma_i, i)$ and~$(\sigma_j, j)$ in the table of the permutation~$\sigma$ for all~$(i, j) \in \boxbslash_\c{I}(\sigma)$, and by moving all numbers of this table to the horizontal axis, allowing the segment connecting~$i$ and~$j$ to curve but not to pass through any number. Note that to obtain all pairs~$(i, j) \in \boxbslash_\c{I}(\sigma)$, one can either draw all pairs~$(i, j) \in \boxbslash(\sigma)$ for which~$\underline{\alpha}(i, j,\sigma) \in \c{I}$ and conserve the $\prec$-maximal ones, or one can perform a direct insertion algorithm similar to that of~\cite{ChatelPilaud, PilaudPons-permutrees}. Details are left to the reader. We define dually the sets~$\boxslash(\sigma)$ and~$\boxslash_\c{I}(\sigma)$ and the maps~$\overline{\alpha}$ and~$\overline{\eta}_\c{I}$. See \fref{fig:arcDiagramsQuotients} for an illustration of the maps~$\underline{\eta}{}_\c{I}$ and~$\overline{\eta}_\c{I}$. \section{Hopf algebra structures on noncrossing arc diagrams} \label{sec:generalRecipe} In this section, we present general methods to construct Hopf algebra structures on decorated permutations and decorated arc diagrams. Recall that a combinatorial Hopf algebra is a combinatorial vector space~$\c{A}$ endowed with an associative product~$\product : \c{A} \otimes \c{A} \to \c{A}$ and a coassociative coproduct~$\coproduct : \c{A} \to \c{A} \otimes \c{A}$ so that the diagram \centerline{ \begin{tikzpicture} \matrix (m) [matrix of math nodes, row sep=2.5em, column sep=5em, minimum width=2em, ampersand replacement=\&] { \c{A} \otimes \c{A} \& \c{A} \& \c{A} \otimes \c{A} \\ \c{A} \otimes \c{A} \otimes \c{A} \otimes \c{A} \& \& \c{A} \otimes \c{A} \otimes \c{A} \otimes \c{A} \\ }; \path[->] (m-1-1) edge node [above] {$\product$} (m-1-2) edge node [left] {$\coproduct \otimes \coproduct$} (m-2-1) (m-1-2) edge node [above] {$\coproduct$} (m-1-3) (m-2-1) edge node [below] {$I \otimes \swap \otimes I$} (m-2-3) (m-2-3) edge node [right] {$\product \otimes \product$} (m-1-3); \end{tikzpicture} } \noindent commutes, where~$\swap : \c{A} \otimes \c{A} \to \c{A} \otimes \c{A}$ is defined by~$\swap(x \otimes y) = y \otimes x$ and~$I$ is the identity. \subsection{Hopf algebra on permutations} \label{subsec:MalvenutoReutenauer} Before constructing our decorated versions, we briefly recall C.~Malvenuto and C.~Reutenauer's Hopf algebra on permutations~\cite{MalvenutoReutenauer}. We denote by~$\fS \eqdef \bigsqcup_{n \in \N} \fS_n$ the set of all permutations, of arbitrary size. The \defn{standardization} of a word~$w \in \N^q$ with distinct entries is the permutation~$\stdf(w)$ of~$[q]$ whose entries are in the same relative order as the entries of~$w$. For a permutation~$\rho \in \fS_p$ and a subset~$R = \{r_1 < \dots < r_q\} \subseteq [p]$, we define $\stdpos{\rho}{R}$ (resp.~$\stdval{\rho}{R}$) as the standardization of the word obtained by deleting form~$\rho$ the entries whose positions (resp.~values) are not in~$R$. For two permutations~$\sigma \in \fS_m$ and~$\tau \in \fS_n$, define the \defn{shifted shuffle}~$\sigma \shiftedShuffle \tau$ and the \defn{convolution}~$\sigma \convolution \tau$~by \begin{align*} \sigma \shiftedShuffle \tau & \eqdef \set{\rho \in \fS_{m+n}}{\stdval{\rho}{[m]} = \sigma \text{ and } \stdval{\rho}{[m+n] \ssm [m]} = \tau} \\ \text{and}\qquad \sigma \convolution \tau & \eqdef \set{\rho \in \fS_{m+n}}{\stdpos{\rho}{[m]} = \sigma \text{ and } \stdpos{\rho}{[m+n] \ssm [m]} = \tau}. \end{align*} For example, \begin{align*} {\red 12} \shiftedShuffle {\blue 231} & = \{ {\red 12}{\blue 453}, {\red 1}{\blue 4}{\red 2}{\blue 53}, {\red 1}{\blue 45}{\red 2}{\blue 3}, {\red 1}{\blue 453}{\red 2}, {\blue 4}{\red 12}{\blue 53}, {\blue 4}{\red 1}{\blue 5}{\red 2}{\blue 3}, {\blue 4}{\red 1}{\blue 53}{\red 2}, {\blue 45}{\red 12}{\blue 3}, {\blue 45}{\red 1}{\blue 3}{\red 2}, {\blue 453}{\red 12} \}, \\ \text{and}\qquad {\red 12} \convolution {\blue 231} & = \{ {\red 12}{\blue 453}, {\red 13}{\blue 452}, {\red 14}{\blue 352}, {\red 15}{\blue 342}, {\red 23}{\blue 451}, {\red 24}{\blue 351}, {\red 25}{\blue 341}, {\red 34}{\blue 251}, {\red 35}{\blue 241}, {\red 45}{\blue 231} \}. \end{align*} \begin{theorem}[\cite{MalvenutoReutenauer}] \label{thm:MalvenutoReutenauer} The vector space~$\b{k}\fS$ with basis~$(\F_\sigma)_{\sigma \in \fS}$ endowed with the product and coproduct defined by \[ \F_\sigma \product \F_\tau = \sum_{\rho \in \sigma \shiftedShuffle \tau} \F_\rho \qquad\text{and}\qquad \coproduct \F_\rho = \sum_{\rho \in \sigma \convolution \tau} \F_\sigma \otimes \F_\tau \] is a graded Hopf algebra. \end{theorem} Recall that the product in~$\b{k}\fS$ behaves nicely with the weak order on~$\fS_n$. For two permutations~$\sigma \in \fS_m$ and~$\tau \in \fS_n$, consider the permutations~$\sigma\backslash\tau$ and~$\tau\slash\sigma$ of~$\fS_{m+n}$ defined by \[ \sigma\backslash\tau(i) = \begin{cases} \mu(i) & \text{ if } i \in [m] \\ m + \tau(i-m) & \text{ otherwise} \end{cases} \qquad\text{and}\qquad \tau\slash\sigma(i) = \begin{cases} m + \tau(i) & \text{ if } i \in [n] \\ \sigma(i-n) & \text{ otherwise.} \end{cases} \] The shifted shuffle~$\sigma \shiftedShuffle \tau$ is then precisely given the weak order interval between~$\sigma\backslash\tau$ and~$\sigma\slash\tau$ in the weak order on~$\fS_{m+n}$. This extends to product of weak order intervals as follows. \begin{proposition} \label{prop:productIntervalWeakOrder} A product of weak order intervals in~$\b{k}\fS$ is a weak order interval: for any two weak order intervals~$[\mu, \nu] \subseteq \fS_m$ and~$[\lambda, \omega] \subseteq \fS_n$, we have \[ \bigg( \sum_{\mu \le \sigma \le \nu} \F_\sigma \bigg) \product \bigg( \sum_{\lambda \le \tau \le \omega} \F_\tau \bigg) = \sum_{\mu\backslash\lambda \le \rho \le \omega\slash\nu} \F_\rho. \] \end{proposition} \subsection{Decorated permutations} For our purposes, we need extensions of C.~Malvenuto and C.~Reutenauer's Hopf algebra on permutations. For example, we needed the signed or decorated permutations of~\cite{NovelliThibon-coloredHopfAlgebras} to construct the Cambrian and permutree Hopf algebras~\cite{ChatelPilaud, PilaudPons-permutrees}. We now define Hopf algebras on permutations decorated with potentially more complicated structures. \begin{definition} \label{def:decorationSet} A \defn{decoration set} is a graded set~$\f{X} \eqdef \bigsqcup_{n \ge 0} \f{X}_n$ endowed with \begin{itemize} \item a \defn{concatenation}~$\concatf : \f{X}_m \times \f{X}_n \longrightarrow \f{X}_{m+n}$ for all~$m, n \in \N$, \item a \defn{selection}~$\selectf : \f{X}_m \times \binom{[m]}{k} \longrightarrow \f{X}_k$ for all~$m, k \in \N$, \end{itemize} such that \begin{enumerate}[(i)] \item $\concat{\c{X}}{\concat{\c{Y}}{\c{Z}}} = \concat{\concat{\c{X}}{\c{Y}}}{\c{Z}}$ for any elements~$\c{X}, \c{Y}, \c{Z} \in \f{X}$, \item $\select{\select{\c{X}}{R}}{S} = \select{\c{X}}{\set{r_s}{s \in S}}$ for any element~$\c{X} \in \f{X}_p$, and any subsets $R = \{r_1, \dots, r_q\} \subseteq [p]$ and~${S \subseteq [q]}$, \item ${\concat{\select{\c{X}}{R}}{\select{\c{Y}}{S}} = \select{\concat{\c{X}}{\c{Y}}}{R \cup S^{\rightarrow m}}}$ for any elements~${\c{X} \in \f{X}_m}$ and~${\c{Y} \in \f{X}_n}$, and any subsets~$R \subseteq [m]$ and~$S \subseteq [n]$, where~$S^{\rightarrow m} \eqdef \set{s+m}{s \in S}$. \end{enumerate} \end{definition} \begin{example} \label{exm:decorationSet} A typical decoration set is the set of words~$\c{A}^*$ on a finite alphabet~$\c{A}$, graded by their length, with the classical concatenation of words, and the selection defined by subwords: $\concat{u_1 \dots u_m}{v_1 \dots v_n} = u_1 \dots u_mv_1 \dots v_n$ and $\select{w_1 \dots w_p}{\{r_1, \dots, r_q\}} = w_{r_1} \dots w_{r_q}$. Among many other examples, let us also mention the set of labeled graphs, graded by their number of vertices, with the concatenation defined as the shifted union, and the selection defined by standardized induced subgraphs. Further examples will appear in Section~\ref{sec:examples}. \end{example} For~$n \ge 0$, we denote by~$\eP_n$ the set of \defn{$\f{X}$-decorated permutations} of size~$n$, \ie of pairs~$(\sigma, \c{X})$ with~$\sigma \in \fS_n$ and~$\c{X} \in \f{X}_n$. We consider the graded set~$\eP \eqdef \bigsqcup_{n \ge 0} \eP_n$ and the graded vector space~$\b{k}\eP \eqdef \bigoplus_{n\ge 0} \b{k}\eP_n$, where~$\b{k}\eP_n$ is a vector space with basis~$(\F_{(\sigma, \c{X})})_{(\sigma, \c{X}) \in \eP_n}$ indexed by \mbox{$\f{X}$-decorated} permutations of size~$n$. For two decorated permutations~$(\sigma, \c{X})$ and~$(\tau, \c{Y})$, we define the \defn{product}~$\F_{(\sigma, \c{X})} \product \F_{(\tau, \c{Y})}$ by \[ \F_{(\sigma, \c{X})} \product \F_{(\tau, \c{Y})} \eqdef \sum_{\rho \in \sigma \shiftedShuffle \tau} \F_{( \rho, \concat{\c{X}}{\c{Y}} )}. \] \begin{proposition} \label{prop:algebraDecoratedPermutations} The product~$\product$ defines an associative graded algebra structure on~$\b{k}\eP$. \end{proposition} \begin{proof} If~$(\sigma, \c{X}) \in \eP_m$ and~$(\tau, \c{Y}) \in \eP_n$, we have~$(\rho, \concat{\c{X}}{\c{Y}}) \in \eP_{m+n}$ for any~$\rho \in \sigma \shiftedShuffle \tau$, so that~$\product$ is a graded product. It is associative since both the concatenation (by Definition~\ref{def:decorationSet}\,(i)) and the shifted shuffle product (by Theorem~\ref{thm:MalvenutoReutenauer}) are associative. \end{proof} Note that an analogue of Proposition~\ref{prop:productIntervalWeakOrder} clearly holds for decorated permutations. \medskip We define the \defn{standardization} of a decorated permutation~$(\rho, \c{Z}) \in \eP_p$ at a subset~$R \subseteq [p]$ as \[ \std{(\rho, \c{Z})}{R} \eqdef \big( \stdpos{\rho}{R}, \select{\c{Z}}{\rho^{-1}(R)} \big), \] where~$\stdpos{\rho}{R}$ is the position standardization on permutations and~$\select{\c{Z}}{\rho^{-1}(R)}$ is the selection on~$\f{X}$. For a decorated permutation~$(\rho, \c{Z}) \in \eP_p$, we define the \defn{coproduct}~$\coproduct\F_{(\rho, \c{Z})}$ by \[ \coproduct\F_{(\rho, \c{Z})} \eqdef \sum_{k = 0}^p \F_{\std{(\rho, \c{Z})}{[k]}} \otimes \F_{\std{(\rho, \c{Z})}{[p] \ssm [k]}}. \] \begin{proposition} \label{prop:coalgebraDecoratedPermutations} The coproduct~$\coproduct$ defines a coassociative graded coalgebra structure on~$\b{k}\eP$. \end{proposition} \begin{proof} If~$(\sigma, \c{Z}) \in \eP_p$ and~$R \subseteq [p]$, we have~$\std{(\rho, \c{Z})}{R} \in \eP_{|R|}$ so that~$\coproduct$ is a graded coproduct. Moreover, using Definition~\ref{def:decorationSet}\,(ii), we obtain that for a decorated permutation~$(\rho, \c{Z}) \in \eP_p$, both~$(\Id \otimes \coproduct)(\coproduct\F_{(\rho,\c{Z})})$ and~$(\coproduct \otimes \Id)(\coproduct\F_{(\rho,\c{Z})})$ equal to \[ \sum_{0 \le k \le \ell \le p} \F_{\std{(\rho, \c{Z})}{[k]}} \otimes \F_{\std{(\rho, \c{Z})}{[\ell] \ssm [k]}} \otimes \F_{\std{(\rho, \c{Z})}{[p] \ssm [\ell]}}. \qedhere \] \end{proof} \begin{theorem} \label{thm:HopfAlgebraDecoratedPermutations} The product~$\product$ and coproduct~$\coproduct$ endow the family of decorated permutations with a graded Hopf algebra structure. \end{theorem} \begin{proof} This follows from the same property for the product and coproduct on permutations and by Definition~\ref{def:decorationSet}\,(iii). Indeed \begin{align*} \coproduct\big( \F_{(\sigma, \c{X})} \product \F_{(\tau, \c{Y})} \big) & = \sum_{k = 0}^{m+n} \sum_{\rho \in \sigma \shiftedShuffle \tau} \F_{\std{(\rho, \concat{\c{X}}{\c{Y}})}{[k]}} \otimes \F_{\std{(\rho, \concat{\c{X}}{\c{Y}})}{[m+n] \ssm [k]}} \\ & = \sum_{p = 0}^m \sum_{q = 0}^n \begin{array}{@{}l} \Big( \sum\limits_\mu \F_{( \mu, \concat{\std{\c{X}}{\sigma^{-1}([p])}}{\std{\c{Y}}{\tau^{-1}([q])}} )} \Big) \\[-.1cm] \qquad \otimes \Big( \sum\limits_\nu \F_{( \nu, \concat{\std{\c{X}}{\sigma^{-1}([m] \ssm [p])}}{\std{\c{Y}}{\tau^{-1}([n] \ssm [q])}} )} \Big) \end{array} \\[-.1cm] & = \Big( \sum_{p = 0}^m \F_{\std{(\sigma, \c{X})}{[p]}} \otimes \F_{\std{(\sigma, \c{X})}{[m] \ssm [p]}} \Big) \product \Big( \sum_{q = 0}^n \F_{\std{(\tau, \c{X})}{[q]}} \otimes \F_{\std{(\tau, \c{X})}{[n] \ssm [q]}} \Big) \\ & = \coproduct\F_{(\sigma, \c{X})} \product \coproduct\F_{(\tau, \c{Y})} \end{align*} where~$\mu$ ranges over~$\stdpos{\sigma}{[p]} \shiftedShuffle \stdpos{\tau}{[q]}$ while~$\nu$ ranges over~$\stdpos{\sigma}{[m] \ssm [p]} \shiftedShuffle \stdpos{\tau}{[n] \ssm [q]}$ in the second line, and the swap is understood in the last two lines. \end{proof} \begin{example} When~$\f{X}$ is the set of words~$\c{A}^*$ on a finite alphabet~$\c{A}$ (with the classical concatenation of words and the selection defined by subwords, as in Example~\ref{exm:decorationSet}), the Hopf algebra of decorated permutations was studied in detail by J.-C.~Novelli and J.-Y.~Thibon in~\cite{NovelliThibon-coloredHopfAlgebras}. Further relevant examples will appear in Section~\ref{sec:examples}. \end{example} \subsection{Decorated noncrossing arc diagrams} We now use our Hopf algebra on decorated permutations to construct Hopf algebras on decorated noncrossing arc diagrams. As in the previous section, we consider a decoration set~$(\f{X}, \concatf, \selectf)$ and the corresponding Hopf algebra~$(\b{k}\eP, \,\product\,, \coproduct)$ on $\f{X}$-decorated permutations. Recall from Section~\ref{subsec:arcIdeals} that~$\f{I}_n$ denotes the set of arc ideals of~$\c{A}_n$. For an arc~$\alpha = (a, b, m, S)$ and~$n \in \N$, we define the \defn{augmented arc}~$\alpha^{+n} \eqdef (a, b, m+n, S)$ and the \defn{shifted arc}~$\alpha^{\rightarrow n} \eqdef (a+n, b+n, m+n, \set{s+n}{s \in S})$. Graphically, $\alpha^{+n}$ is obtained from~$\alpha$ by adding $n$ points to its right, and~$\alpha^{\rightarrow n}$ is obtained from~$\alpha$ by adding~$n$ points to its left. For~$\c{I} \subseteq \c{A}_m$ and~$n \in \N$, define~$\c{I}^{+n} \eqdef \set{\alpha^{+n}}{\alpha \in \c{I}}$ and~$\c{I}^{\rightarrow n} \eqdef \set{\alpha^{\rightarrow n}}{\alpha \in \c{I}}$. \begin{definition} \label{def:conservative} A graded function~$\arcs : \f{X} = \bigsqcup_{n \ge 0} \f{X}_n \longrightarrow \f{I} = \bigsqcup_{n \ge 0} \f{I}_n$ is \defn{conservative} if \begin{enumerate}[(i)] \item $\arcs(\c{X})^{+n}$ and~$\arcs(\c{Y})^{\rightarrow m}$ are both subsets of~$\arcs(\concat{\c{X}}{\c{Y}})$ for any~$\c{X} \in \f{X}_m$ and~${\c{Y} \in \f{X}_n}$, \item $(r_a, r_b, p, S) \in \arcs(\c{Z})$ implies $(a, b, q, \set{c \in [q]}{r_c \in S}) \in \arcs(\select{\c{Z}}{R})$ for any~$\c{Z} \in \f{X}_p$, any ${R = \{r_1 < \dots < r_q\} \subseteq [p]}$, any~$1 \le a < b \le q$ and any~$S \subseteq {]r_a, r_b[}$. \end{enumerate} \end{definition} \begin{example} If~$\f{X} = \{\bullet\}^*$ is the decoration set of words on a one element alphabet, then the maps $\bullet^n \mapsto \c{A}_n = \set{(a, b, n, S)}{1 \le a < b \le n \text{ and } S \subseteq {]a,b[}}$ and~$\bullet^n \mapsto \set{(a, b, n, \varnothing)}{1 \le a < b \le n}$ are both conservative. Further relevant examples will appear in Section~\ref{sec:examples}. \end{example} From now on, we assume that we are given a conservative function~$\arcs : \f{X} \longrightarrow \f{I}$. For~${n \ge 0}$, we denote by~$\eD_n$ the set of \defn{$\f{X}$-decorated noncrossing arc diagrams} of size~$n$, \ie of pairs~$(\c{D}, \c{X})$ where~${\c{X} \in \f{X}_n}$ and~$\c{D}$ is a noncrossing arc diagram contained in~$\arcs(\c{X})$. We now define a Hopf algebra on $\f{X}$-decorated noncrossing arc diagrams using the map~$\underline{\eta}$ defined in Section~\ref{subsec:surjection}. We denote by~$\b{k}\eD \eqdef \bigoplus_{n \ge 0} \b{k}\eD_n$ the graded vector subspace of~$\b{k}\eP$ generated by the elements \[ \PPT_{(\c{D}, \c{X})} \eqdef \sum_{\substack{\sigma \in \fS \\ \underline{\eta}{}_{\arcs(\c{X})}(\sigma) = \c{D}}} \F_{(\sigma, \c{X})}, \] for all $\f{X}$-decorated noncrossing arc diagrams~$(\c{D}, \c{X})$. Our central result is the following statement. \begin{theorem} \label{thm:HopfAlgebraDecoratedArcDiagrams} The subspace~$\b{k}\eD$ is a Hopf subalgebra~of~$\b{k}\eP$. \end{theorem} \begin{proof} We first prove that~$\b{k}\eD$ is a subalgebra of~$\b{k}\eP$, \ie that it is stable by product. Consider two $\f{X}$-decorated noncrossing arc diagrams~$(\c{D}, \c{X}) \in \f{D}_m$ and~$(\c{E}, \c{Y}) \in \f{D}_n$. By definition, all permutations that appear in the product~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$ are decorated by the product~$\c{Z} \eqdef \concat{\c{X}}{\c{Y}}$. Observe first that the product~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$ is multiplicity-free in the basis~$(\F_{(\rho, \c{Z})})_{(\rho, \c{Z}) \in \eP}$ of~$\b{k}\eP$, since any~$\F_{(\rho, \c{Z})}$ in~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$ must come from the product~$\F_{(\stdval{\rho}{[m]}, \c{X})} \product \F_{(\stdval{\rho}{[m+n] \ssm [m]}, \c{Y})}$. Consider now two decorated permutations~$(\rho, \c{Z})$ and~$(\rho', \c{Z})$ such that~$\underline{\eta}{}_{\arcs(\c{Z})}(\rho) = \underline{\eta}{}_{\arcs(\c{Z})}(\rho')$. We want to show that~$\F_{(\rho, \c{Z})}$ appears in~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$ if and only if~$\F_{(\rho', \c{Z})}$ appears in~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$. Assume first that~${\rho' = \rho \cdot (k \; k+1)}$ for a descent~$k$ of~$\rho$ such that~${\underline{\alpha}(k, k+1, \rho)} \notin \arcs(\c{Z})$ and that~$\F_{(\rho, \c{Z})}$ appears in the product~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$. Let~$\sigma \in \underline{\eta}{}_{\arcs(\c{X})}^{-1}(\c{D})$ and~$\tau \in \underline{\eta}{}_{\arcs(\c{Y})}^{-1}(\c{E})$ be such that~$\rho \in \sigma \shiftedShuffle \tau$. We then distinguish three cases: \begin{itemize} \item If $\rho_{k+1} \le m < \rho_k$, then~$\rho'$ also belongs to~$\sigma \shiftedShuffle \tau$ so that~$\F_{(\rho', \c{Z})}$ also appears in~${\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}}$. \item If~$\rho_k \le m$, then Definition~\ref{def:conservative}\,(i) ensures that~${\underline{\alpha}(i, i+1, \sigma) \notin \c{X}}$, where~$i$ is the descent of~$\sigma$ such that~$\sigma_i = \rho_k$. The permutation~$\sigma' \eqdef \sigma \cdot (i \; i+1)$ thus satisfies~${\underline{\eta}{}_{\arcs(\c{X})}(\sigma') = \underline{\eta}{}_{\arcs(\c{X})}(\sigma) = \c{D}}$. Since~$\rho' \in \sigma' \shiftedShuffle \tau$, it follows that~$\F_{(\rho', \c{Z})}$ also appears in~${\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}}$. \item Finally, if~$m < \rho_{k+1}$, the argument is similar using~$\tau' \eqdef \tau \cdot (j \; j+1)$ where~$\tau_j = \rho_k$. \end{itemize} By transitivity in Theorem~\ref{thm:arcDiagrams}\,(iii), we obtain that~$\F_{(\rho, \c{Z})}$ appears in~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$ if and only if~$\F_{(\rho', \c{Z})}$ appears in~$\PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})}$. Therefore~$\b{k}\eD$ is a subalgebra of~$\b{k}\eP$. We now prove that~$\b{k}\f{D}$ is a subcoalgebra of~$\b{k}\f{P}$, \ie that it is stable by coproduct. Consider a decorated noncrossing arc diagram~$(\c{D}, \c{Z}) \in \f{D}_p$. Observe first that the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$ is multiplicity-free in the basis~$(\F_{(\rho, \c{Z})})_{(\rho, \c{Z}) \in \eP}$ of~$\b{k}\eP$, since any~${\F_{(\sigma, \c{X})} \otimes \F_{(\tau, \c{Y})}}$ in~$\coproduct\PPT_{(\c{D}, \c{Z})}$ must come from the coproduct~$\coproduct\F_{(\rho, \c{Z})}$ where~$\rho(i) = \sigma(i)$ if~$i \in [m]$ and~$\rho(i) = m + \sigma(i-m)$ if~${i \in [m+n] \ssm [m]}$. Consider now four decorated permutations~$(\sigma, \c{X})$, $(\sigma', \c{X})$, $(\tau, \c{Y})$ and~$(\tau', \c{Y})$ such that ${\underline{\eta}{}_{\arcs(\c{X})}(\sigma) = \underline{\eta}{}_{\arcs(\c{X})}(\sigma')}$ and~$\underline{\eta}{}_{\arcs(\c{Y})}(\tau) = \underline{\eta}{}_{\arcs(\c{Y})}(\tau')$. We want to show that~${\F_{(\sigma, \c{X})} \otimes \F_{(\tau, \c{Y})}}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$ if and only if~${\F_{(\sigma', \c{X})} \otimes \F_{(\tau', \c{Y})}}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$. Assume first that~$\sigma' = \sigma \cdot (i \; i+1)$ for a descent~$i$ of~$\sigma$ with~${\underline{\alpha}(i, i+1, \sigma) \notin \c{X}}$, that~$\tau = \tau'$ and that~$\F_{(\sigma, \c{X})} \otimes \F_{(\tau, \c{Y})}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$. By definition of the coproduct, there exist~${\rho \in \underline{\eta}{}_{\arcs(\c{Z})}^{-1}(\c{D})}$ and~$k \in [p]$ such that~${(\sigma, \c{X}) = \std{(\rho, \c{Z})}{[k]}}$ and~${(\tau, \c{Y}) = \std{(\rho, \c{Z})}{[p] \ssm [k]}}$. Since~${\c{X} = \select{\c{Z}}{\rho^{-1}([k])}}$ and~$\underline{\alpha}(i, i+1, \sigma) \notin \c{X}$, Definition~\ref{def:conservative}\,(ii) ensures that~$\underline{\alpha}(i, i+1, \rho) \notin \c{Z}$. We conclude that~$\rho' = \rho \cdot (i \; i+1)$ is in~$\underline{\eta}{}_{\arcs(\c{Z})}^{-1}(\c{D})$. Since moreover~${(\sigma', \c{X}) = \std{(\rho', \c{Z})}{[k]}}$ and~${(\tau, \c{Y}) = \std{(\rho', \c{Z})}{[p] \ssm [k]}}$, we get that~${\F_{(\sigma', \c{X})} \otimes \F_{(\tau, \c{Y})}}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$. By symmetry and by transitivity in Theorem~\ref{thm:arcDiagrams}\,(ii), we conclude that~$\F_{(\sigma, \c{X})} \otimes \F_{(\tau, \c{Y})}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$ if and only if~$\F_{(\sigma', \c{X})} \otimes \F_{(\tau', \c{Y})}$ appears in the coproduct~$\coproduct\PPT_{(\c{D}, \c{Z})}$ for any~$(\sigma, \c{X})$, $(\sigma', \c{X})$, $(\tau, \c{Y})$ and~$(\tau', \c{Y})$ such that~$\underline{\eta}{}_{\arcs(\c{X})}(\sigma) = \underline{\eta}{}_{\arcs(\c{X})}(\sigma')$ and~$\underline{\eta}{}_{\arcs(\c{Y})}(\tau) = \underline{\eta}{}_{\arcs(\c{Y})}(\tau')$. Therefore~$\b{k}\eD$ is a subcoalgebra of~$\b{k}\eP$. \end{proof} \enlargethispage{.7cm} We now provide an analogue of Proposition~\ref{prop:productIntervalWeakOrder} for decorated noncrossing arc diagrams. \begin{proposition} \label{prop:descriptionProduct} Consider two $\f{X}$-decorated noncrossing arc diagrams~$(\c{D}, \c{X})$ and~$(\c{E}, \c{Y})$, and their corresponding weak order intervals~$[\mu, \nu] \eqdef \underline{\eta}_{\arcs(\c{X})}^{-1}(\c{D})$ and~$[\lambda, \omega] \eqdef \underline{\eta}_{\arcs(\c{Y})}^{-1}(\c{E})$. Then \[ \PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})} = \sum_{\c{F}} \PPT_{(\c{F}, \concat{\c{X}}{\c{Y}} )}, \] where~$\c{F}$ ranges in the interval between~$\c{D}\backslash\c{E} \eqdef \underline{\eta}_{\arcs(\concat{\c{X}}{\c{Y}})}(\mu\backslash\lambda)$ and~$\c{E}\slash\c{D} \eqdef \underline{\eta}_{\arcs(\concat{\c{X}}{\c{Y}})}(\omega\slash\nu)$ in the lattice of noncrossing arc diagrams in~$\arcs(\concat{\c{X}}{\c{Y}})$. \end{proposition} \begin{proof} This follows from Proposition~\ref{prop:productIntervalWeakOrder} and the fact that the $\underline{\eta}_{\arcs(\concat{\c{X}}{\c{Y}})}$ fibers of the noncrossing arc diagrams in the $\arcs(\concat{\c{X}}{\c{Y}})$-interval between~$\c{D}\backslash\c{E}$ and~$\c{E}\slash\c{D}$ form a partition of the weak order interval between~$\mu\backslash\lambda$ and~$\omega\slash\nu$: \[ \PPT_{(\c{D}, \c{X})} \product \PPT_{(\c{E}, \c{Y})} = \sum_{\mu \le \sigma \le \nu} \!\! \F_{(\sigma, \c{X})} \product \!\! \sum_{\lambda \le \tau \le \omega} \!\! \F_{(\tau, \c{Y})} = \!\!\!\! \sum_{\mu\backslash\lambda \le \rho \le \omega\slash\nu} \!\!\!\! \F_{(\rho, \concat{\c{X}}{\c{Y}})} = \sum_{\c{F}} \PPT_{(\c{F}, \concat{\c{X}}{\c{Y}} )} \qedhere \] \end{proof} \subsection{Decoration products and decoration subsets} To close our generic Hopf algebra constructions, we observe two natural operations on decoration sets that behave properly with our construction. The straightforward proofs are left to the reader. First, we observe that we can obtain Hopf algebra structures on arc diagrams decorated by cartesian products of decorations. \begin{proposition} \label{prop:decorationProduct} The Cartesian product~$\f{X} \times \f{X}'$ of two decoration sets~$\f{X}$ and~$\f{X}'$, endowed with the concatenation and selection defined by \begin{align*} \concat{(\c{X},\c{X}')}{(\c{Y},\c{Y}')} & \eqdef (\concat{\c{X}}{\c{Y}}, \concat{\c{X}'}{\c{Y}'}) \\ \text{and} \qquad \select{(\c{Z},\c{Z}')}{R} & \eqdef (\select{\c{Z}}{R}, \select{\c{Z}'}{R}), \end{align*} is a decoration set. Moreover, for two conservative functions~$\arcs: \f{X} \to \f{I}$ and~$\arcs': \f{X}' \to \f{I}$, the function~$\arcs \cap \arcs': \f{X} \times \f{X}' \to \f{I}$ defined by~$(\arcs \cap \arcs') (\c{X}, \c{X}') \eqdef \arcs(\c{X}) \cap \arcs'(\c{X}')$ is conservative. \end{proposition} On the other hand, we observe that decoration subsets define Hopf subalgebras. \begin{proposition} \label{prop:decorationSubset} If~$\f{X} \subseteq \f{X'}$ are two decoration sets, and~$\arcs': \f{X}' \to \f{I}$ is a conservative function, then the restriction~$\arcs$ of~$\arcs'$ to~$\f{X}$ is conservative. Therefore, the Hopf algebra~$\b{k}\f{D}$ constructed from~$\arcs$ is a Hopf subalgebra of the Hopf algebra~$\b{k}\f{D}'$ constructed from~$\arcs'$. \end{proposition} \section{Applications} \label{sec:examples} In this section, we provide examples of applications of Theorems~\ref{thm:HopfAlgebraDecoratedPermutations} and~\ref{thm:HopfAlgebraDecoratedArcDiagrams}. \subsection{Insertional, translational, and Hopf families of congruences} For all~$n \in \N$, fix a lattice congruence~$\equiv_n$ of the weak order on~$\f{S}_n$, with arc ideal~$\c{I}_n$. As a first application of Theorem~\ref{thm:HopfAlgebraDecoratedArcDiagrams}, we obtain sufficient conditions for the family~$(\equiv_n)_{n \in \N}$ to define a Hopf subalgebra~of~$\b{k}\f{S}$. \begin{corollary}[{\cite[Thm.~1.2 \& 1.3]{Reading-HopfAlgebras}}] \label{coro:HopfFamilies} For all~$n \in \N$, consider a lattice congruence~$\equiv_n$ of the weak order on~$\f{S}_n$, with arc ideal~$\c{I}_n$. If \begin{itemize} \item both~$\c{I}_m^{+n}$ and~$\c{I}_n^{\rightarrow m}$ are contained in~$\c{I}_{m+n}$ for all~$m, n \in \N$, \item $(r_a, r_b, p, S) \in \c{I}_p$ implies~$(a, b, q, \set{c \in [q]}{r_c \in S}) \in \c{I}_q$ for any~${R = \{r_1 < \dots < r_q\} \subseteq [p]}$, any~$1 \le a < b \le q$ and any~$S \subseteq {]r_a, r_b[}$, \end{itemize} then the subvector space of~$\b{k}\f{S}$ generated by the sums~$\sum_{\sigma} \F_\sigma$ over the classes of the congruences~$\equiv_n$ is a Hopf subalgebra of C.~Malvenuto and C.~Reutenauer's Hopf algebra~$\b{k}\f{S}$. \end{corollary} \begin{proof} Consider the decoration set~$\{\bullet\}^*$ of words over a one element alphabet and the function ${\arcs : \{\bullet\}^* \to \f{I}}$ given by~${\arcs(\bullet^n) = \c{I}_{\equiv_n}}$. Note that the Hopf algebra~$\b{k}\f{P}$ of permutations decorated with~$\{\bullet\}^*$ is just isomorphic to C.~Malvenuto and C.~Reutenauer's Hopf algebra~$\b{k}\f{S}$ on permutations. Moreover, the conditions of the statement assert that~$\arcs$ is conservative. The result thus immediately follows from Theorem~\ref{thm:HopfAlgebraDecoratedArcDiagrams}. \end{proof} The conditions of Corollary~\ref{coro:HopfFamilies} are essentially the translational and insertional conditions given by N.~Reading in~\cite[Thm.~1.2 \& 1.3]{Reading-HopfAlgebras}. Note however that our condition is slightly weaker as we only require that the restriction of~$\equiv_{m+n}$ to~$\set{\sigma\backslash\tau}{\sigma \in \f{S}_m \text{ and } \tau \in \f{S}_n}$ refines the congruence relation induced by~${\equiv_m} \times {\equiv_n}$ on~$\set{\sigma\backslash\tau}{\sigma \in \f{S}_m \text{ and } \tau \in \f{S}_n}$ while N.~Reading's definition of translational families requires that these congruences coincide. \begin{example} Corollary~\ref{coro:HopfFamilies} covers various families of lattice congruences, producing Hopf algebra structures on permutations~\cite{MalvenutoReutenauer}, on binary trees~\cite{LodayRonco, HivertNovelliThibon-algebraBinarySearchTrees}, on binary sequences~\cite{GelfandKrobLascouxLeclercRetakhThibon}, on diagonal quadragulations~\cite{LawReading} or equivalently on twin binary trees~\cite{Giraudo}, on $k$-twists~\cite{Pilaud-brickAlgebra}, on $k$-descent schemes~\cite{NovelliReutenauerThibon, Pilaud-brickAlgebra}, etc. \end{example} \subsection{Bounded crossings} \label{subsec:boundedCrossings} We now consider the family of arc ideals~$\c{A}_{\north, \south, \east, \west}^{< k}$ defined in Example~\ref{exm:boundedCrossingCongruences}. Consider the decoration set~$\f{X} = \bigsqcup_{n \in \N} \f{X}_n$, where~$\f{X}_n$ is the set of quadruples of functions~$[n] \to \N$, and where the concatenation is defined by \[ \concat{(\north, \south, \east, \west)}{(\north', \south', \east', \west')}(a) = \begin{cases} (\north(a), \south(a), \east(a), \west(a)) & \text{if } a \le m \\ (\north'(a), \south'(a), \east'(a), \west'(a)) & \text{if } a > m \end{cases} \] (in other words, the usual concatenation of words in~$(\N^4)^*$), and the selection is defined by \[ \select{(\north, \south, \east, \west)}{R}(a) = (\north(r_a), \; \south(r_a), \; \min \set{\east(s)}{s \in {]r_{a-1}, r_a]}}, \; \min \set{\west(s)}{s \in {[r_a, r_{a+1}[}}). \] Choose~$k \in \N$ and define the function~${\arcs : \f{X}_n \to \c{A}_n}$ by~$\arcs(\north, \south, \east, \west) = \c{A}_{\north, \south, \east, \west}^{< k}$. Recall from Example~\ref{exm:boundedCrossingCongruences} that for each~$a \in [n]$, we place $\north(a)$ upper vertical walls above~$a$, $\south(a)$ lower vertical walls below~$a$ and~$\min(\east(a), \west(a+1))$ horizontal walls between~$a$ and~$a+1$, and that an arc belongs to~$\c{A}_{\north, \south, \east, \west}^{< k}$ if it crosses at most~$k-1$ of these walls. The function~$\arcs$ is conservative since \begin{itemize} \item for any~$u \in \f{X}_m$, $v \in \f{X}_n$, $\alpha \in \arcs(u)$ and~$\beta \in \arcs(v)$, the walls of~$uv$ crossed by~$\alpha^{+n}$ are precisely the walls of~$u$ crossed by~$\alpha$, while the walls of~$uv$ crossed by~$\beta^{\rightarrow m}$ are precisely the $m$-translates of the walls of~$v$ crossed by~$\beta$, \item for any~$w \in \f{X}_p$, $R = \{r_1, \dots, r_q\} \subseteq [p]$, $1 \le a < b \le q$ and~$S \subseteq {]r_a, r_b[}$, the walls crossed by the arc~$(a, b, q, \set{c}{r_c \in S})$ are walls crossed by the arc~$(r_a, r_b, p, S)$ (but the latter might cross more walls than the former). \end{itemize} We therefore obtain a Hopf algebra~$\b{k}\f{D}^{< k}$ on the classes of all lattice congruences~$\c{A}_{\north, \south, \east, \west}^{< k}$ simultaneously. Moreover, as observed in Proposition~\ref{prop:decorationSubset} any subset of~$\f{X}$ stable by concatenation and selection provides a Hopf subalgebra~$\b{k}\f{D}^{< k}$. In particular, $\b{k}\f{D}^{< 1}$ contains \defn{simultaneously} Hopf subalgebras on permutations~\cite{MalvenutoReutenauer}, binary trees~\cite{LodayRonco, HivertNovelliThibon-algebraBinarySearchTrees}, binary sequences~\cite{GelfandKrobLascouxLeclercRetakhThibon}, Cambrian trees~\cite{ChatelPilaud}, permutrees~\cite{PilaudPons-permutrees}, and diagonal rectangulations~\cite{LawReading, Giraudo}, while~$\b{k}\f{D}^{< k}$ contains subalgebras on $k$-twists~\cite{Pilaud-brickAlgebra} and on $k$-descent schemes~\cite{NovelliReutenauerThibon, Pilaud-brickAlgebra}. Finally, one could also mix conditions on the crossing numbers with walls of different colors using \mbox{Proposition~\ref{prop:decorationProduct}}. \subsection{All arc diagrams} To conclude, we define a Hopf algebra~$\b{k}\f{D}^\star$ simultaneously involving the classes of all lattice congruences of the weak order, and containing the permutree algebra. \subsubsection{Extended arcs} We call \defn{extended arc} any quadruple~$(a, b, n, S)$ where~$a,b,n \in \N$ are such that~$0 \le a < b \le n+1$, and~${S \subseteq {]a,b[}}$. In other words, extended arcs are precisely like arcs but they are allowed to be attached before~$1$ and after~$n$. We represent extended arcs exactly in the same way as arcs (but the points $0$ and~$n+1$ are colored white). We denote by~$\c{A}_n^\star \eqdef \set{(a, b, n, S)}{0 \le a < b \le n+1 \text{ and } S \subseteq {]a,b[}}$ the set of all extended arcs. An extended arc~$(a, b, n, S)$ is \defn{initial} if~$a = 0$, \defn{terminal} if~$b = n+1$, and \defn{strict} otherwise. The notions of crossing and forcing, as well as the operations~$\alpha^{+n}$ and~$\alpha^{\rightarrow n}$, are defined as for classical~arcs. We denote by~$\f{I}_n^\star$ the set of extended arc ideals (\ie upper ideals of the forcing order~$\prec$ on~$\c{A}_n^\star$). We call \defn{juxtaposition}~$\juxta{\alpha}{\beta}$ of two extended arcs~$\alpha \eqdef (a, b, n, R)$ and~$\beta \eqdef (c, d, n, S)$ the arc \[ \juxta{\alpha}{\beta} \eqdef \begin{cases} \{(a, d, n, R \cup S)\} & \text{if~$c = b + 1$,} \\ \varnothing & \text{otherwise.} \end{cases} \] In other words, $\alpha\beta$ is obtained by joining $\alpha$ to~$\beta$ when the final endpoint of~$\alpha$ appears just after the initial endpoint of~$\beta$, and is empty otherwise. Note that the juxtaposition is associative: for $\alpha \eqdef (a, b, n, R)$, $\beta \eqdef (c, d, n, S)$, and~$\gamma \eqdef (e, f, n, T)$ we have~$\juxta{(\juxta{\alpha}{\beta})}{\gamma} = \juxta{\alpha}{(\juxta{\beta}{\gamma})} = \{(a, f, n, R \cup S \cup T)\}$ if~$c = b + 1$ and~$e = d + 1$, and~$\juxta{(\juxta{\alpha}{\beta})}{\gamma} = \juxta{\alpha}{(\juxta{\beta}{\gamma})} = \varnothing$ otherwise. For~$\c{I}, \c{J} \subseteq \c{A}_n^\star$, we define the \defn{juxtaposition}~$\juxta{\c{I}}{\c{J}}$~by \[ \juxta{\c{I}}{\c{J}} \eqdef \c{I} \cup \c{J} \cup \bigcup_{\substack{\alpha \in \c{I} \\ \beta \in \c{J}}} \juxta{\alpha}{\beta} \] Observe that if~$\c{I}$ and~$\c{J}$ are both extended arc ideals, then~$\juxta{\c{I}}{\c{J}}$ is also an extended arc ideal. Note again that the juxtaposition is associative: $\juxta{(\juxta{\c{I}}{\c{J}})}{\c{K}} = \juxta{\c{I}}{(\juxta{\c{J}}{\c{K}})} = \c{I} \cup \c{J} \cup \bigcup_{\substack{\alpha \in \c{I} \\ \beta \in \c{J} \\ \gamma \in \c{K}}} \big( \juxta{\alpha}{\beta} \cup \juxta{\beta}{\gamma} \cup \juxta{\juxta{\alpha}{\beta}}{\gamma} \big)$. We define the \defn{concatenation} of two extended arc ideals~$\c{I} \subseteq \c{A}_m^\star$ and~$\c{J} \subseteq \c{A}_n^\star$ by \[ \concat{\c{I}}{\c{J}} \eqdef \juxta{\c{I}^{+n}}{\c{J}^{\rightarrow m}}. \] Graphically, $\concat{\c{I}}{\c{J}}$ is obtained by juxtaposing~$\c{I}$ and~$\c{J}$ such that the~$n$\,---\,$(n+1)$ edge of~$\c{I}$ coincides with the~$0$\,---\,$1$ edge of~$\c{J}$, and joining all final arcs of~$\c{I}$ with all initial arcs of~$\c{J}$. See \fref{fig:arcConcatenation} for an illustration. \begin{figure}[h] \capstart \centerline{\includegraphics[scale=1]{arcConcatenation}} \caption{The concatenation of two extended arc ideals.} \label{fig:arcConcatenation} \end{figure} \begin{lemma} \label{lem:concatenation} The concatenation~$\concat{\c{I}}{\c{J}}$ of two extended arc ideals~$\c{I} \subseteq \c{A}_m^\star$ and~$\c{J} \subseteq \c{A}_n^\star$ is an arc ideal of~$\c{A}_{n+m}^\star$. \end{lemma} \begin{proof} The set~$\concat{\c{I}}{\c{J}}$ is contained in~$\c{A}_{m+n}^\star$ by definition and closed by forcing since both~$\c{I}^{+n}$ and~$\c{J}^{\rightarrow m}$~are. \end{proof} \begin{lemma} \label{lem:concatenationAssociative} For any arc ideals~$\c{I}, \c{J}, \c{K}$, we have $\concat{\concat{\c{I}}{\c{J}}}{\c{K}} = \concat{\c{I}}{\concat{\c{J}}{\c{K}}}$. \end{lemma} \begin{proof} Assume that~$\c{I} \subseteq \c{A}_m^\star$, $\c{J} \subseteq \c{A}_n^\star$ and~$\c{K} \subseteq \c{A}_p^\star$. Using the associativity of the juxtaposition, \begin{align*} \concat{\concat{\c{I}}{\c{J}}}{\c{K}} & = (\c{I}^{+n}\c{J}^{\rightarrow m})^{+p}\c{K}^{\rightarrow (m+n)} = \c{I}^{+(n+p)}(\c{J}^{\rightarrow m})^{+p}\c{K}^{\rightarrow (m+n)} \\ & = \c{I}^{+(n+p)}(\c{J}^{+p}\c{K}^{\rightarrow n})^{\rightarrow m} = \concat{\c{I}}{\concat{\c{J}}{\c{K}}}. \qedhere \end{align*} \end{proof} Consider now an extended arc ideal~$\c{K} \subseteq \c{A}_p^\star$ and a subset~$X \eqdef \{x_1 < \dots < x_q\}$ of~$[p]$. Define by convention~$x_0 \eqdef 0$ and~$x_{q+1} \eqdef p+1$. We define the \defn{selection} of~$\c{K}$ at~$X$ by \[ \select{\c{K}}{X} \eqdef \set{(a, b, q, S)}{\begin{array}{@{}l@{}} \exists \; y_0 < \dots < y_r \in [p] \text{ with } x_a = y_0 \text{ and } x_b = y_r \text{ while } y_1, \dots, y_{r-1} \notin X \\ \exists \; (y_0, y_1, p, S_1), \dots, (y_{r-1}, y_r, p, S_r) \in \c{K} \text{ with } S = \set{\ell \in [q]}{x_\ell \in \bigcup S_k}\end{array}}. \] Graphically, $\select{\c{K}}{X}$ is obtained by considering all arcs obtained by merging $x$-monotone paths in~$\c{K}$ with endpoints in~$\{0\} \cup X \cup \{p+1\}$ but all interior points in~$[p] \ssm X$, deleting all points of~$[p] \ssm X$, and packing the remaining points of~$\{0\} \cup X \cup \{p+1\}$ (together with the merged arcs) to the left towards their standard position~$0, 1, \dots, q, q+1$. See \fref{fig:arcSelection} for an illustration. \begin{figure}[h] \capstart \centerline{\includegraphics[scale=1]{arcSelection}} \caption{The selection in an arc ideal. Selected points are in red. The blue extended arc~$(0,4,3,\{1,3\})$ in~$\select{\c{K}}{\{1,3,6\}}$ arises from the concatenation of the three blue extended arcs~$(0,2,6,\{1\})$, $(2,5,6,\{4\})$ and~$(5,7,6,\{6\})$ in~$\c{K}$.} \label{fig:arcSelection} \end{figure} \begin{lemma} \label{lem:selection} The selection~$\select{\c{K}}{X}$ of an extended arc ideal~$\c{K} \subseteq \c{A}_p^\star$ on a $q$-element subset~$X$ of~$[p]$ is an extended arc ideal of~$\c{A}_q^\star$. \end{lemma} \begin{proof} Let~$\c{I} \eqdef \select{\c{K}}{X}$. We have~$\c{I} \subseteq \c{A}_q^\star$ by definition. To show that~$\c{I}$ is closed by forcing, assume that an arc~$(a, d, q, S) \in \c{I}$ is forced by an arc~$(b, c, q, T)$, so that~${a \le b < c \le d}$ and~${T = S \cap {]b, c[}}$. Consider a path of arcs~$\alpha_1 \eqdef (y_0, y_1, p, S_1), \dots, \alpha_r \eqdef (y_{r-1}, y_r, p, S_r)$ of~$\c{K}$ corresponding to~$\c{I}$. Let~$u \eqdef \min\set{s \in [r]}{x_b < y_s}$ and~$v \eqdef \max\set{s \in [r]}{y_{s-1} < x_c}$. If~$u = v$, then~$(x_b, x_c, p, S_u \cap {]x_b, x_c[})$ belongs to~$\c{K}$ (since it is closed by forcing), thus~$(b, c, q, T)$ belongs to~$\c{I}$. If~$u < v$, then both~$\alpha_u' \eqdef (x_b, y_u, p, S_u \cap {]x_b, y_u[})$ and ${\alpha_v' \eqdef (y_{v-1}, x_c, S_v \cap {]y_{v-1}, x_c[})}$ belong to~$\c{K}$ (since it is closed by forcing). The path of arcs~$\alpha_u', \alpha_{u+1}, \dots, \alpha_{v-1}, \alpha_v'$ thus ensures that~$(b, c, q, T)$ belongs to~$\c{I}$ as well. \end{proof} \begin{lemma} \label{lem:selectionCoassociative} For any extended arc ideal~$\c{K} \subseteq \c{A}_p^\star$, any subset~$X \eqdef \{x_1, \dots, x_q\}$ of~$[p]$ and any subset~$Y$ of~$[q]$, we have~$\select{\select{\c{K}}{X}}{Y} = \select{\c{K}}{\set{x_y}{y \in Y}}$. \end{lemma} \begin{proof} By definition, both~$\select{\select{\c{K}}{X}}{Y}$ and~$\select{\c{K}}{\set{x_y}{y \in Y}}$ are obtained by merging all paths in~$\c{K}$ whose endpoints are in~$\{0\} \cup \set{x_y}{y \in Y} \cup \{p+1\}$ but whose interior vertices are all in~$[p] \ssm \set{x_y}{y \in Y}$, and packing the remaining points of~$\{0\} \cup \set{x_y}{y \in Y} \cup \{p+1\}$ to their standard position~$0, 1, \dots, |Y|, |Y|+1$. \end{proof} \begin{proposition} \label{prop:concatenationStandardization} For any arc ideals~$\c{I} \subseteq \c{A}_m^\star$ and~$\c{J} \subseteq \c{A}_n^\star$ and any subsets~$X \subseteq [m]$ and~$Y \subseteq [n]$, \[ \concat{\select{\c{I}}{X}}{\select{\c{J}}{Y}} = \select{\concat{\c{I}}{\c{J}}}{X \cup Y^{\rightarrow m}} \] where~$Y^{\rightarrow m} \eqdef \set{y+m}{y \in Y}$. \end{proposition} \begin{proof} Consider an arc~$\alpha \eqdef (a, b, m+n, S) \in \c{A}_{m+n}^\star$. We distinguish three cases: \begin{itemize} \item If~$b \le m$, then~$\alpha \in \concat{\select{\c{I}}{X}}{\select{\c{J}}{Y}}$ and~${\alpha \in \select{\concat{\c{I}}{\c{J}}}{X \cup Y^{\rightarrow m}}}$ are both equivalent to~$(a, b, m, S) \in \select{\c{I}}{X}$. \item If~$m < a$, then~$\alpha \in \concat{\select{\c{I}}{X}}{\select{\c{J}}{Y}}$ and~${\alpha \in \select{\concat{\c{I}}{\c{J}}}{X \cup Y^{\rightarrow m}}}$ are both equivalent to~$(a-m, b-m, n, \set{s-m}{s \in S}) \in \select{\c{J}}{Y}$. \item Finally, assume that~$a \le m < b$. If~$\alpha \in \concat{\select{\c{I}}{X}}{\select{\c{J}}{Y}}$, then there exists a final arc~$\beta \in \select{\c{I}}{X}$ and an initial arc~$\gamma \in \select{\c{J}}{Y}$ such that~$\{\alpha\} = \juxta{\beta^{+n}}{\gamma^{\rightarrow m}}$. The arc~$\beta \in \select{\c{I}}{X}$ corresponds to a path of arcs~$\beta_0, \dots, \beta_r$ in~$\c{I}$ whose interior points all belong to~$[m] \ssm X$, and similarly the arc~$\gamma \in \select{\c{J}}{Y}$ corresponds to a path of arcs~$\gamma_0, \dots, \gamma_s$ in~$\c{J}$ whose interior points all belong to~$[n] \ssm Y$. The path $\beta_0^{+n}, \dots, \beta_{r-1}^{+n}, \juxta{\beta_r^{+n}}{\gamma_0^{\rightarrow m}}, \gamma_1^{\rightarrow m}, \dots, \gamma_s^{\rightarrow m}$ thus shows that ${\alpha \in \select{\concat{\c{I}}{\c{J}}}{X \cup Y^{\rightarrow m}}}$. Conversely, if~$\alpha \in \select{\concat{\c{I}}{\c{J}}}{X \cup Y^{\rightarrow m}}$, it corresponds to a path of arcs~$\alpha_1, \dots, \alpha_r$ in~$\concat{\c{I}}{\c{J}}$ whose interior points all belong to~$X \cup Y^{\rightarrow m}$. Since~$a \le m < b$, there is~$s \in [r]$ such that~$\alpha_s = (c, d, m+n, T)$ with~$c \le m < d$. Let~$\beta_1, \dots, \beta_s$ in~$\c{I}$ and~$\gamma_s, \dots, \gamma_r$ in~$\c{J}$ be such that~$\alpha_s = \juxta{\beta_s^{+n}}{\gamma_s^{\rightarrow m}}$ and~$\alpha_i = \beta_i^{+n}$ if~$i < s$ while $\alpha_i = \gamma_i^{\rightarrow m}$ if~$i > s$. Then the paths~$\beta_1, \dots, \beta_s$ in~$\c{I}$ and~$\gamma_s, \dots, \gamma_r$ in~$\c{J}$ ensure the existence of~$\beta \in \select{\c{I}}{X}$ and~$\gamma \in \select{\c{J}}{Y}$ such that~$\alpha = \juxta{\beta^{+n}}{\gamma^{\rightarrow m}} \in \concat{\select{\c{I}}{X}}{\select{\c{J}}{Y}}$. \qedhere \end{itemize} \end{proof} We have therefore proved the following statement. \begin{corollary} The set~$\f{I}^\star \eqdef \bigsqcup_{n \in \N} \f{I}_n^\star$ of all extended arcs ideals, endowed with the concatenation~$\concatf$ and selection~$\selectf$, is a decoration set. \end{corollary} \subsubsection{Noncrossing extended arc diagrams} We now consider the map~$\arcs: \f{I}^\star \to \f{I}$ which sends an extended arc ideal to the arc ideal of its strict arcs. This function is clearly conservative so that we obtain a Hopf algebra~$\b{k}\f{D}^\star$ on pairs~$(\c{D}, \c{I})$, where~$\c{I}$ is any extended arc ideal and $\c{D}$ is a noncrossing arc diagram containing only strict arcs of~$\c{I}$. Note that~$\b{k}\f{D}^\star$ is graded but not connected as there are two extended arc ideals in~$\c{A}_0^\star$: the pair~$\big(\varnothing, \{(0, 1, 0, \varnothing)\} \big)$ is the identity of~$\b{k}\f{D}^\star$, while the pair~$(\varnothing, \varnothing)$ is a primitive idempotent of~$\b{k}\f{D}^\star$. We could have forced connectivity by imposing all short arcs~$(i, i+1, n, \varnothing)$ for~$0 \le i \le n$ in all extended arc ideals of~$\f{J}_n^\star$. The Hopf algebra~$\b{k}\f{D}^\star$ involves the classes of all lattice congruences of the weak order. Moreover, the concatenation and selection on extended arc diagrams was chosen to fulfill the following statement. \begin{proposition} The permutree Hopf algebra is a Hopf subalgebra of~$\b{k}\f{D}^\star$. \end{proposition} \begin{proof} Any function~$\north, \south : [n] \to \{0,1\}$ naturally correspond to the extended arc ideal of extended arcs~$(a, b, n, S)$ such that~$\north(c) = 0$ for~$c \in S$ and~$\south(c) = 0$ for~$c \in {]a, b[} \ssm S$. On these particular extended arc ideals, the concatenation and selection corresponds to that defined in Section~\ref{subsec:boundedCrossings}. The result immediately follows by Proposition~\ref{prop:decorationSubset}. \end{proof} In contrast, the reader can check that none of the Hopf algebras of~\cite{LawReading, Giraudo, Pilaud-brickAlgebra} is a Hopf subalgebra of~$\b{k}\f{D}^\star$. \addtocontents{toc}{\vspace{.3cm}} \section*{Acknowledgements} I thank two anonymous referees for helpful comments that improved the presentation, fixed imprecise statements, and suggested relevant bibliographic connections. \bibliographystyle{alpha}
\section{Introduction} Boundary Domain Integral Equation Systems (BDIES) are often derived from a wide class of boundary value problems with variable coefficient in domains with smooth boundary: cf. \cite{mikhailov1} for a scalar mixed elliptic BVP in bounded domains; cf. \cite{exterior} for the corresponding problem in unbounded domains; cf. \cite{carlos1} for the mixed problem for the incompressible Stokes system in bounded domains, and cf. \cite{dufera} for a 2D mixed elliptic problem in bounded domains. Further results on the theory of BDIES derived from BVP with variable coefficient can be found on \cite{carlos2, iterative,localised,united, traces,numerics,miksolandreg,dufera,ayele}. Let us note that these type of BVPs model, for example, the heat transfer in non homogeneous media or the motion of a laminar fluid with variable viscosity. In order to deduce a BDIES from a BVP with variable coefficient a parametrix (see formula \eqref{parametrixdef}) is required since it keeps a strong relationship with the corresponding fundamental solution of the analogous BVP with constant coefficient. Using this relationship, it is possible to stablish further relations between the surface and volume potential type operators of the variable coefficient case with their counterparts from the constant coefficient case, see, e.g. \cite[Formulae (3.10)-(3.13)]{mikhailov1}, \cite[Formulae (34.10)-(34.16)]{carlos1}. For this scalar equation, a family of weakly singular parametrices of the form $P^{y}(x,y)$ for the particular operator \[\mathcal{A}u(x) := \sum_{i=1}^{3}\dfrac{\partial}{\partial x_{i}}\left(a(x)\dfrac{\partial u(x)}{\partial x_{i}}\right),\] has been studied in \cite{mikhailov1,miksolandreg,exterior}. Note that the superscript in $P^{y}(x,y)$ means that $P^{y}(x,y)$ is a function of the variable coefficient depending on $y$, this is $$P^{y}(x,y)= P(x,y;a(y))=\dfrac{-1}{4\pi a(y)\vert x-y\vert}.$$ \textit{In this paper,} we study the parametrices for the operator $\mathcal{A}$ of the form $$P^{x}(x,y)= P(x,y;a(x))=\dfrac{-1}{4\pi a(x)\vert x-y\vert}.$$ which can be useful at the time of studying BDIES derived from a BVP with a system of PDEs as illustrated in the following example. Let $\bs{\mathcal{B}}$ be the compressible Stokes operator with variable viscosity: \begin{align} \mathcal{B}_{j}(p, \boldsymbol{v})(x ):&= \frac{\partial}{\partial x_{i}}\left(\mu(x)\nonumber \left(\frac{\partial v_{j}}{\partial x_{i}} + \frac{\partial v_{i}}{\partial x_{j}} -\frac{2}{3}\delta_{i}^{j} \Div (\boldsymbol{v})\right)\right) -\frac{\partial p}{\partial x_{j}},\\ &j,i\in \lbrace 1,2,3\rbrace.\nonumber \end{align} Following the same notation as for $P^{y}(x,y)$, here $\bs{P}^{x,y}_{\mathcal{B}}(x,y)$ mean that the parametrix for the operator $\mathcal{B}$ includes the variable coefficient $\mu$ depending on $x$ and \textit{also} includes $\mu$ depending on $y$. This is $\bs{P}_{\mathcal{B}}^{x,y}(x,y):=(q^{k}(x,y),u_{j}^{k}(x,y))$ \begin{align*} q^{k}(x,y)&=\frac{\mu(x)}{\mu(y)}\frac{(x_{k}-y_{k})}{4\pi\vert x-y\vert^{3}},\\ u_{j}^{k}(x,y)&=-\frac{1}{8\pi\mu(y)}\left\lbrace \dfrac{\delta_{j}^{k}}{\vert x-y\vert}+\dfrac{(x_{j}-y_{j})(x_{k}-y_{k})}{\vert x-y\vert^{3}}\right\rbrace, \hspace{0.5em}j,k\in \lbrace 1,2,3\rbrace. \end{align*} Then, it seems reasonable to study parametrices for a rather more simple problem of the type $P^{x}(x,y;a(x))$, which have not been analysed yet, before embarking in the analysis of boundary domain integral equations for the operator $\mathcal{B}$. There are fast computational techniques developed to solve BDIES. One is the discretisation of the BDIES using localised parametrices which leads to systems of linear equations with large sparsed matrices whose solution can be solve by fast iterative methods, see \cite[Section 1 and Section 5]{localised}, see also \cite{localised2,sladek}. Another fast method is using a collocation method along with hierarchical matrix compression technique in conjunction with the adaptive cross approximation procedure, this is shown in \cite{numerics}. In order to study the possible numerical advantages of the new family of parametrices of the form $P^{x}(x,y;a(x))$ with respect to the parametrices already studied, it is necessary to prove the unique-solvency of an analogous BDIES derived with this new family of parametrices. This is the main purpose of this paper along with showing useful arguments that can be helpful at the time of studying BDIES derived from BVPs with variable coefficient which use parametrices of the same family studied in here. The main differences between the different families of parametrices are the relations between the parametrix-based potentials with their counterparts for the constant coefficient case. Notwithstanding, the same mapping properties in Sobolev-Bessel potential spaces still hold allowing us to prove the equivalence between the BDIES and the BVP. An analysis of the uniqueness of the BDIES is performed by studying the Fredholm properties of the matrix operator which defines the system. \section{Preliminaries and the BVP} Let $\Omega=\Omega^{+}$ be a bounded simply connected domain, $\Omega^{-}:=\mathbb{R}^{3}\smallsetminus\bar{\Omega}^{+}$ the complementary (unbounded) subset of $\Omega$. The boundary $S := \partial\Omega$ is simply connected, closed and infinitely differentiable, $S\in\mathcal{C}^{\infty}$. Furthermore, $S :=\overline{S}_{N}\cup \overline{S}_{D}$ where both $S_{N}$ and $S_{D}$ are non-empty, connected disjoint manifolds of $S$. The border of these two submanifolds is also infinitely differentiable, $\partial S_{N}= \partial S_{D}\in\mathcal{C}^{\infty}$. Let us introduce the following partial differential equation with variable smooth positive coefficient $a(x)\in \mathcal{C}^{\infty}(\overline{\Omega})$: \begin{equation}\label{ch4operatorA} \mathcal{A}u(x):=\sum_{i=1}^{3}\dfrac{\partial}{\partial x_{i}}\left(a(x)\dfrac{\partial u(x)}{\partial x_{i}}\right)=f(x),\,\,x\in \Omega, \end{equation} where $u(x)$ is an unknown function and $f$ is a given function on $\Omega$. It is easy to see that if $a\equiv 1$ then, the operator $\mathcal{A}$ becomes $\Delta$, the Laplace operator. We will use the following function spaces in this paper (see e.g. \cite{mclean, lions, hsiao} for more details). Let $\mathcal{D}'(\Omega)$ be the Schwartz distribution space; $H^{s}(\Omega)$ and $H^{s}(S)$ with $s\in \mathbb{R}$, the Bessel potential spaces; the space $H^{s}_{K}(\mathbb{R}^{3})$ consisting of all the distributions of $H^{s}(\mathbb{R}^{3})$ whose support is inside of a compact set $K\subset \mathbb{R}^{3}$; the spaces consisting of distributions in $H^{s}(K)$ for every compact $K\subset \overline{\Omega^{-}},\hspace{0.1em}s\in\mathbb{R}$. Let us introduce the following Sobolev-Bessel potentials on the boundary: \begin{equation*} \widetilde{H}^{s}(S):= \overline{\mathcal{C}^{\infty}_{0}(S)}^{\parallel\cdot\parallel_{H^{s}(\mathbb{R}^{3})}},\quad\quad\quad H^{s}(S):= \overline{\mathcal{C}^{\infty}_{0}(S)}^{\parallel\cdot\parallel_{H^{s}(S)}}, \end{equation*} whose characterizations are given as follows: $\widetilde{H}^{s}(S_{1})=\lbrace g\in H^{s}(S): {\rm supp}(g)\subset \overline{S_{1}}\rbrace$; $H^{s}(S_{1})=\lbrace g\vert_{S_{1}}: g\in H^{s}(S)\rbrace$, where the notation $g\vert_{S_{1}} = r_{S_{1}}g$ is used to indicate the restriction of the function $g$ from $S$ to $S_{1}$. We will make use of the space, see e.g. \cite{costabel, mikhailov1}, \begin{center} $H^{1,0}(\Omega; \mathcal{A}):= \lbrace u \in H^{1}(\Omega): \mathcal{A}u\in L^{2}(\Omega)\rbrace $ \end{center} which is a Hilbert space with the norm defined by \begin{center} $\parallel u \parallel^{2}_{H^{1,0}(\Omega; \mathcal{A})}:=\parallel u \parallel^{2}_{H^{1}(\Omega)}+\parallel \mathcal{A}u \parallel^{2}_{L^{2}(\Omega)}$. \end{center} \paragraph{Traces and conormal derivatives.} For a scalar function $w\in H^{s}(\Omega^\pm)$, $s>1/2$, the trace operator $\gamma^{\pm}(\,\cdot \,):=\gamma_{S}^\pm(\,\cdot\,)$, acting on $w$ is well defined and $\gamma^{\pm}w\in H^{s-\frac{1}{2}}(S)$ (see, e.g., \cite{mclean, traces}). For $u\in H^{s}(\Omega)$, $s>3/2$, we can define on $S$ the conormal derivative operator, $T^{\pm}$, in the classical (trace) sense \begin{equation*}\label{ch4conormal} T^{\pm}_{x}u := \sum_{i=1}^{3}a(x)\gamma^{\pm}\left( \dfrac{\partial u}{\partial x_{i}}\right)^{\pm}n_{i}^{\pm}(x), \end{equation*} where $n^{+}(x)$ is the exterior unit normal vector directed \textit{outwards} the interior domain $\Omega$ at a point $x\in S$. Similarly, $n^{-}(x)$ is the unit normal vector directed \textit{inwards} the interior domain $\Omega$ at a point $x\in S$. Furthermore, we will use the notation $T^{\pm}_{x}u$ or $T^{\pm}_{y}u$ to emphasise which respect to which variable we are differentiating. When the variable of differentiation is obvious or is a dummy variable, we will simply use the notation $T^{\pm}u$. Moreover, for any function $u\in H^{1,0}(\Omega; \mathcal{A})$, the \textit{canonical} conormal derivative $T^{\pm}u\in H^{-\frac{1}{2}}(\Omega)$, is well defined, cf. \cite{costabel,mclean,traces}, \begin{equation}\label{ch4green1} \langle T^{\pm}u, w\rangle_{S}:= \pm \int_{\Omega^{\pm}}[(\gamma^{-1}\omega)\mathcal{A}u +E(u,\gamma^{-1}w)] dx,\,\, w\in H^{\frac{1}{2}}(S), \end{equation} where $\gamma^{-1}: H^{\frac{1}{2}}(S)\longrightarrow H_{K}^{1}(\mathbb{R}^{3})$ is a continuous right inverse to the trace operator whereas the function $E$ is defined as \begin{equation*}\label{ch4functionalE} E(u,v)(x):=\sum_{i=1}^{3}a(x)\dfrac{\partial u(x)}{\partial x_{i}}\dfrac{\partial v(x)}{\partial x_{i}}, \end{equation*} and $\langle\, \cdot \, , \, \cdot \, \rangle_{S}$ represents the $L^{2}-$based dual form on $S$. We aim to derive boundary-domain integral equation systems for the following \textit{mixed} boundary value problem. Given $f\in L^{2}(\Omega)$, $\phi_{0}\in H^{\frac{1}{2}}(S_D)$ and $\psi_{0}\in H^{-\frac{1}{2}}(S_N)$, we seek a function $u\in H^{1}(\Omega)$ such that \begin{subequations}\label{ch4BVP} \begin{align} \mathcal{A}u&=f,\hspace{1em}\text{in}\hspace{1em}\Omega\label{ch4BVP1};\\ r_{S_{D}}\gamma^{+}u &= \phi_{0},\hspace{1em}\text{on}\hspace{1em} S_{D}\label{ch4BVP2};\\ r_{S_{N}}T^{+}u &=\psi_{0},\hspace{1em}\text{on}\hspace{1em} S_{N};\label{ch4BVP3} \end{align} where equation \eqref{ch4BVP1} is understood in the weak sense, the Dirichlet condition \eqref{ch4BVP2} is understood in the trace sense and the Neumann condition \eqref{ch4BVP3} is understood in the functional sense \eqref{ch4green1}. \end{subequations} By Lemma 3.4 of \cite{costabel} (cf. also Theorem 3.9 in \cite{traces}), the first Green identity holds for any $u\in H^{1,0}(\Omega; \mathcal{A})$ and $v\in H^{1}(\Omega)$, \begin{equation}\label{ch4green1.1} \langle T^{\pm}u, \gamma^{+}v\rangle_{S}:= \pm \int_{\Omega}[v\mathcal{A}u +E(u,v)] dx. \end{equation} The following assertion is well known and can be proved, e.g., using the Lax-Milgram lemma as in \cite[Chapter 4]{steinbach}. \begin{theorem}\label{ch4Thomsol} The boundary value problem \eqref{ch4BVP} has one and only one solution. \end{theorem} \section{Parametrices and remainders} We define a parametrix (Levi function) $P(x,y)$ for a differential operator $\mathcal{A}_{x}$ differentiating with respect to $x$ as a function on two variables that satisfies \begin{equation}\label{parametrixdef} \mathcal{A}_{x}P(x,y) = \delta(x-y)+R(x,y). \end{equation} For a given operator $\mathcal{A}$, the parametrix is not unique. For example, the parametrix \begin{equation*}\label{ch4P2002} P^y(x,y)=\dfrac{1}{a(y)} P_\Delta(x-y),\hspace{1em}x,y \in \mathbb{R}^{3}, \end{equation*} was employed in \cite{localised, mikhailov1}, for the operator $\mathcal{A}$ defined in \eqref{ch4operatorA}, where \begin{equation*}\label{ch4fundsol} P_{\Delta}(x-y) = \dfrac{-1}{4\pi \vert x-y\vert} \end{equation*} is the fundamental solution of the Laplace operator. The remainder corresponding to the parametrix $P^{y}$ is \begin{equation*} \label{ch43.4} R^y(x,y) =\sum\limits_{i=1}^{3}\frac{1}{a(y)}\, \frac{\partial a(x)}{\partial x_i} \frac{\partial }{\partial x_i}P_\Delta(x-y) \,,\;\;\;x,y\in {\mathbb R}^3. \end{equation*} {\em In this paper}, for the same operator $\mathcal{A}$ defined in \eqref{ch4operatorA}, we will use another parametrix, \begin{align}\label{ch4Px} P(x,y):=P^x(x,y)=\dfrac{1}{a(x)} P_\Delta(x-y),\hspace{1em}x,y \in \mathbb{R}^{3}, \end{align} which leads to the corresponding remainder \begin{align*}\label{ch4remainder} R(x,y) =R^x(x,y) &= -\sum\limits_{i=1}^{3}\dfrac{\partial}{\partial x_{i}} \left(\frac{1}{a(x)}\dfrac{\partial a(x)}{\partial x_{i}}P_{\Delta}(x,y)\right)\\ & = -\sum\limits_{i=1}^{3}\dfrac{\partial}{\partial x_{i}} \left(\dfrac{\partial \ln a(x)}{\partial x_{i}}P_{\Delta}(x,y)\right),\hspace{0.5em}x,y \in \mathbb{R}^{3}. \end{align*} Note that the both remainders $R_x$ and $R_y$ are weakly singular, i.e., \[ R^x(x,y),\,R^y(x,y)\in \mathcal{O}(\vert x-y\vert^{-2}).\] This is due to the smoothness of the variable coefficient $a$. \section{Volume and surface potentials} The volume parametrix-based Newton-type potential and the remainder potential are respectively defined, for $y\in\mathbb R^3$, as \begin{align*} \mathcal{P}\rho(y)&:=\displaystyle\int_{\Omega} P(x,y)\rho(x)\hspace{0.25em}dx\\ \mathcal{R}\rho(y)&:=\displaystyle\int_{\Omega} R(x,y)\rho(x)\hspace{0.25em}dx. \end{align*} The parametrix-based single layer and double layer surface potentials are defined for $y\in\mathbb R^3:y\notin S $, as \begin{equation*}\label{ch4SL} V\rho(y):=-\int_{S} P(x,y)\rho(x)\hspace{0.25em}dS(x), \end{equation*} \begin{equation*}\label{ch4DL} W\rho(y):=-\int_{S} T_{x}^{+}P(x,y)\rho(x)\hspace{0.25em}dS(x). \end{equation*} We also define the following pseudo-differential operators associated with direct values of the single and double layer potentials and with their conormal derivatives, for $y\in S$, \begin{align} \mathcal{V}\rho(y)&:=-\int_{S} P(x,y)\rho(x)\hspace{0.25em}dS(x),\nonumber \\ \mathcal{W}\rho(y)&:=-\int_{S} T_{x}P(x,y)\rho(x)\hspace{0.25em}dS(x),\nonumber\\ \mathcal{W'}\rho(y)&:=-\int_{S} T_{y}P(x,y)\rho(x)\hspace{0.25em}dS(x),\nonumber\\ \mathcal{L}^{\pm}\rho(y)&:=T_{y}^{\pm}{W}\rho(y)\nonumber. \end{align} The operators $\mathcal P, \mathcal R, V, W, \mathcal{V}, \mathcal{W}, \mathcal{W'}$ and $\mathcal{L}$ can be expressed in terms the volume and surface potentials and operators associated with the Laplace operator, as follows \begin{align} \mathcal{P}\rho&=\mathcal{P}_{\Delta}\left(\dfrac{\rho}{a}\right),\label{ch4relP}\\ \mathcal{R}\rho&=\nabla\cdot\left[\mathcal{P}_{\Delta}(\rho\,\nabla \ln a)\right]-\mathcal{P}_{\Delta}(\rho\,\Delta \ln a),\label{ch4relR}\\ V\rho &= V_{\Delta}\left(\dfrac{\rho}{a}\right),\label{ch4relSL}\\ \mathcal{V}\rho &= \mathcal{V}_{\Delta} \left( \dfrac{\rho}{a}\right),\label{ch4relDVSL}\\ W\rho &= W_{\Delta}\rho -V_{\Delta}\left(\rho\frac{\partial \ln a}{\partial n}\right),\label{ch4relDL}\\ \mathcal{W}\rho &= \mathcal{W}_{\Delta}\rho -\mathcal{V}_{\Delta}\left(\rho\frac{\partial \ln a}{\partial n}\right),\label{ch4relDVDL}\\ \mathcal{W}'\rho &= a \mathcal{W'}_{\Delta}\left(\dfrac{\rho}{a}\right),\label{ch4relTSL} \\ \mathcal{L}^{\pm}\rho &= \widehat{\mathcal{L}}\rho - aT^{\pm}_\Delta V_{\Delta}\left(\rho\frac{\partial \ln a}{\partial n}\right), \label{ch4relTDL}\\ \widehat{\mathcal{L}}\rho &:= a\mathcal{L}_{\Delta}\rho.\label{ch4hatL} \end{align} The symbols with the subscript $\Delta$ denote the analogous operator for the constant coefficient case, $a\equiv 1$. Furthermore, by the Liapunov-Tauber theorem, $\mathcal{L}_{\Delta}^{+}\rho = \mathcal{L}_{\Delta}^{-}\rho = \mathcal{L}_{\Delta}\rho$. Using relations \eqref{ch4relP}-\eqref{ch4hatL} it is now rather simple to obtain, similar to \cite{mikhailov1}, the mapping properties, jump relations and invertibility results for the parametrix-based surface and volume potentials, provided in theorems/corollary \ref{ch4thmUR}-\ref{ch4thinvV}, from the well-known properties of their constant-coefficient counterparts (associated with the Laplace equation). \newpage \begin{theorem}\label{ch4thmUR} Let $s\in \mathbb{R}$. Then, the following operators are continuous, \begin{equation*} \mathcal{P}:\widetilde{H}^{s}(\Omega) \longrightarrow H^{s+2}(\Omega),\hspace{0.5em} s\in \mathbb{R},\label{ch4mpvp1}\\ \end{equation*} \begin{equation*} \mathcal{P}: H^{s}(\Omega) \longrightarrow H^{s+2}(\Omega),\hspace{0.5em} s>-\dfrac{1}{2},\label{ch4mpvp2}\\ \end{equation*} \begin{equation*} \mathcal{R}:\widetilde{H}^{s}(\Omega) \longrightarrow H^{s+1}(\Omega),\hspace{0.5em} s\in \mathbb{R},\label{ch4mpvp3}\\ \end{equation*} \begin{equation*} \mathcal{R}: H^{s}(\Omega) \longrightarrow H^{s+1}(\Omega),\hspace{0.5em} s>-\dfrac{1}{2}\,.\label{ch4mpvp4} \end{equation*} \end{theorem} \begin{corollary}\label{ch4corcompact}Let $s>\frac{1}{2}$, let $S_{1}$ be a non-empty submanifold of $S$ with smooth boundary. Then, the following operators are compact: \begin{align*} \mathcal{R}&: H^{s}(\Omega) \longrightarrow H^{s}(\Omega),\\ r_{S_{1}}\gamma^{+}\mathcal{R}&: H^{s}(\Omega) \longrightarrow H^{s-\frac{1}{2}}(S_{1}),\\ r_{S_{1}}T^{+}\mathcal{R}&: H^{s}(\Omega) \longrightarrow H^{s-\frac{3}{2}}(S_{1}). \end{align*} \end{corollary} \begin{theorem}\label{ch4thmappingVW} Let $s\in \mathbb{R}$. Then, the following operators are continuous: \begin{align*} V: H^{s}(S) \longrightarrow H^{s+\frac{3}{2}}(\Omega),\\ W: H^{s}(S) \longrightarrow H^{s+\frac{1}{2}}(\Omega). \end{align*} \end{theorem} \begin{theorem} \label{ch4thmappingDVVW}Let $s\in \mathbb{R}$. Then, the following operators are continuous: \begin{align*} \mathcal{V}&: H^{s}(S) \longrightarrow H^{s+1}(S),\\ \mathcal{W}&: H^{s}(S) \longrightarrow H^{s+1}(S),\\ \mathcal{W'}&: H^{s}(S) \longrightarrow H^{s+1}(S),\\ \mathcal{L}^\pm&: H^{s}(S) \longrightarrow H^{s-1}(S). \end{align*} \end{theorem} \begin{theorem}\label{ch4thjumps} Let $\rho\in H^{-\frac{1}{2}}(S)$, $\tau\in H^{\frac{1}{2}}(S)$. Then the following operators jump relations hold: \begin{align*} \gamma^{\pm}V\rho&=\mathcal{V}\rho,\\ \gamma^{\pm}W\tau&=\mp\dfrac{1}{2}\tau+\mathcal{W}\tau,\\ T^{\pm}V\rho&=\pm\dfrac{1}{2}\rho+\mathcal{W'}\rho. \end{align*} \end{theorem} \begin{theorem}\label{ch4thcompVW} Let $s\in \mathbb{R}$, let $S_{1}$ and $S_{2}$ be two non-empty manifolds with smooth boundaries, $\partial S_{1}$ and $\partial S_{2}$, respectively. Then, the following operators \begin{align*} r_{S_{2}}\mathcal{V}: \widetilde{H}^{s}(S_{1}) \longrightarrow H^{s}(S_{2}),\\ r_{S_{2}}\mathcal{W}: \widetilde{H}^{s}(S_{1}) \longrightarrow H^{s}(S_{2}),\\ r_{S_{2}}\mathcal{W}':\widetilde{H}^{s}(S_{1}) \longrightarrow H^{s}(S_{2}). \end{align*} are compact. \end{theorem} \begin{theorem}\label{ch4thinvV} Let $S_{1}$ be a non-empty simply connected submanifold of $S$ with infinitely smooth boundary curve, and $0<s<1$. Then, the operators \begin{align*} r_{S_{1}}\mathcal{V}&: \widetilde{H}^{s-1}(S_{1}) \longrightarrow H^{s}(S_{1}),\\ \mathcal{V}&: H^{s-1}(S) \longrightarrow H^{s}(S), \end{align*} are invertible. \end{theorem} \begin{proof} Relation \eqref{ch4relSL} gives $\mathcal{V}g = \mathcal{V}_{\Delta}g^{*}$, where $g = g^{*}/a$. The invertibility of $\mathcal{V}$ then follows from the invertibility of $\mathcal{V}_{\Delta}$, see references \cite[Theorem 2.4]{costste} and \cite[Theorem 3.5]{miksolandreg}. \end{proof} \begin{theorem}\label{ch4thinvL} Let $S_{1}$ be a non-empty simply connected submanifold of $S$ with infinitely smooth boundary curve, and $0<s<1$. Then, the operator \begin{align*} r_{S_{1}}\widehat{\mathcal{L}}: \widetilde{H}^{s}(S_{1}) \longrightarrow H^{s-1}(S_{1}), \end{align*} is invertible whilst the operators \begin{align*} r_{S_{1}}(\mathcal{L}^{\pm}-\widehat{\mathcal{L}}): \widetilde{H}^{s}(S_{1}) \longrightarrow H^{s-1}(S_{1}), \end{align*} are compact. \end{theorem} \begin{proof} Relation \eqref{ch4relTDL} gives \[ \widehat{\mathcal{L}}\rho = \mathcal{L}^{\pm}\rho + aT^{+}_\Delta V_{\Delta}\left(\rho\frac{\partial \ln a}{\partial n}\right) = \mathcal{L}^{\pm}\rho + aT^{-}_\Delta V_{\Delta}\left(\rho\frac{\partial \ln a}{\partial n}\right). \] Take into account $\widehat{\mathcal{L}}\rho := a\mathcal{L}_{\Delta}\rho$ and the invertibility of the operator $\mathcal{L}_{\Delta}$, see references \cite[Theorem 2.4]{costste} and \cite[Theorem 3.6]{miksolandreg}; we deduce the invertibility of the operator $\widehat{\mathcal{L}}$. To prove the compactness properties, we consider the identity: \[ \mathcal{L}^{\pm}\rho - \widehat{\mathcal{L}}\rho = a\left(\mp \dfrac{1}{2}I - \mathcal{W}'_{\Delta}\right)\left(\rho\frac{\partial \ln a}{\partial n}\right). \] Since $\rho\in \widetilde{H}^{s}(S_{1})$, due to the mapping properties of the operator $\mathcal{W}'$, $\mathcal{L}^{\pm} - \rho\widehat{\mathcal{L}}\rho\in H^{s}$. Then, immediately follows from the compact embedding $H^{s}(S)\subset H^{s-1}(S)$, that the operators \begin{align*} r_{S_{1}}(\mathcal{L}^{\pm}-\widehat{\mathcal{L}}): \widetilde{H}^{s}(S_{1}) \longrightarrow H^{s-1}(S_{1}), \end{align*} are compact. \end{proof} \section{Third Green identities and integral relations} In this section we provide the results similar to the ones in \cite{mikhailov1} but for our, different, parametrix \eqref{ch4Px}. Let $u,v\in H^{1,0}(\Omega;\mathcal{A})$. Subtracting from the first Green identity \eqref{ch4green1.1} its counterpart with the swapped $u$ and $v$, we arrive at the second Green identity, see e.g. \cite{mclean}, \begin{equation}\label{ch4green2} \displaystyle\int_{\Omega}\left[u\,\mathcal{A}v - v\,\mathcal{A}u\right]dx= \int_{S}\left[u\, T^{+}v \,-\,v\, T^{+}u\,\right]dS(x). \end{equation} Taking now $v(x):=P(x,y)$, we obtain from \eqref{ch4green2} by the standard limiting procedures (cf. \cite{miranda}) the third Green identity for any function $u\in H^{1,0}(\Omega;\mathcal{A})$: \begin{equation}\label{ch4green3} u+\mathcal{R}u-VT^{+}u+W\gamma^{+}u=\mathcal{P}\mathcal{A}u,\hspace{1em}\text{in}\hspace{0.2em}\Omega. \end{equation} If $u\in H^{1,0}(\Omega; \mathcal{A})$ is a solution of the partial differential equation \eqref{ch4BVP1}, then, from \eqref{ch4green3} we obtain: \begin{equation}\label{ch43GV} u+\mathcal{R}u-VT^{+}u+W\gamma^{+}u=\mathcal{P}f,\hspace{0.5em}in\hspace{0.2em}\Omega; \end{equation} \begin{equation}\label{ch43GG} \dfrac{1}{2}\gamma^{+}u+\gamma^{+}\mathcal{R}u-\mathcal{V}T^{+}u+\mathcal{W}\gamma^{+}u=\gamma^{+}\mathcal{P}f,\hspace{0.5em}on\hspace{0.2em}S. \end{equation} For some distributions $f$, $\Psi$ and $\Phi$, we consider a more general, indirect integral relation associated with the third Green identity \eqref{ch43GV}: \begin{equation}\label{ch4G3ind} u+\mathcal{R}u-V\Psi+W\Phi=\mathcal{P}f,\hspace{0.5em}{\rm in\ }\Omega. \end{equation} \begin{lemma}\label{ch4lema1}Let $u\in H^{1}(\Omega)$, $f\in L_{2}(\Omega)$, $\Psi\in H^{-\frac{1}{2}}(S)$ and $\Phi\in H^{\frac{1}{2}}(S)$ satisfying the relation \eqref{ch4G3ind}. Then $u$ belongs to $H^{1,0}(\Omega, \mathcal{A})$; solves the equation $\mathcal{A}u=f$ in $\Omega$, and the following identity is satisfied, \begin{equation}\label{ch4lema1.0} V(\Psi- T^{+}u) - W(\Phi- \gamma^{+}u) = 0\hspace{0.5em}\text{in}\hspace{0.5em}\Omega. \end{equation} \end{lemma} \begin{proof} First, let us prove that $u\in H^{1,0}(\Omega;\mathcal{A})$. Since $u\in H^{1}(\Omega)$ by hypothesis, it suffices to prove that $\mathcal{A}u \in L^{2}(\Omega)$. Let us thus take equation \eqref{ch4G3ind} and apply the relations \eqref{ch4relP}, \eqref{ch4relSL} and \eqref{ch4relDL} to obtain \begin{align}\label{ch4lema1.1} u=&\,\mathcal{P}f-\mathcal{R}u+V\Psi-W\Phi\nonumber\\ =&\,\mathcal{P}_{\Delta}\left(\dfrac{f}{a}\right)-\mathcal{R}u+V_{\Delta}\left(\dfrac{\Psi}{a}\right)-W_{\Delta}\Phi +V_{\Delta}\left(\dfrac{\partial\ln a}{\partial n}\,\Phi\right). \end{align} We note that $\mathcal{R}u\in H^{2}(\Omega)$ due to the mapping properties given by Theorem \ref{ch4thmUR}. Moreover, $V_{\Delta}$ and $W_{\Delta}$ in \eqref{ch4lema1.1} are harmonic potentials, while $\mathcal{P}_{\Delta}$ is the Newtonian potential for the Laplacian, i.e., $\Delta\mathcal{P}_{\Delta}\left(\dfrac{f}{a}\right)=\dfrac{f}{a}$. Consequently, $ \Delta u = \dfrac{f}{a}-\Delta\mathcal{R}u\in L^{2}(\Omega). $ Hence, $\mathcal{A}u\in L^{2}(\Omega)$ and thus $u\in H^{1,0}(\Omega;\mathcal{A})$. Since $u\in H^{1,0}(\Omega;\mathcal{A})$, the third Green identity \eqref{ch43GV} is valid for the function $u$, and we proceed subtracting \eqref{ch4green3} from \eqref{ch4G3ind} to obtain \begin{equation}\label{ch4lema1.3} W(\gamma^{+}u-\Phi)-V(T^{+}u-\Psi)=\mathcal{P}(\mathcal{A}u-f). \end{equation} Let us apply relations \eqref{ch4relP}, \eqref{ch4relSL} and \eqref{ch4relDL} to \eqref{ch4lema1.3}, and then, apply the Laplace operator to both sides. Hence, we obtain \begin{equation}\label{ch4lema1.5} \mathcal{A}u-f=0, \end{equation} i.e., $u$ solves \eqref{ch4BVP1}. Finally, substituting \eqref{ch4lema1.5} into \eqref{ch4lema1.3}, we prove \eqref{ch4lema1.0}. \end{proof} \begin{lemma}\label{ch4lemma2} Let $\Psi^{*}\in H^{-\frac{1}{2}}(S)$. If \begin{equation}\label{ch4lema2i} V\Psi^{*}(y) = 0,\hspace{2em}y\in\Omega \end{equation} then $\Psi^{*}(y) = 0$. \end{lemma} \begin{proof} Taking the trace of \eqref{ch4lema2i}gives: \begin{center} $\mathcal{V}\Psi^{*}(y) = \mathcal{V}_{\triangle}\left(\dfrac{\Psi^{*}}{a}\right)(y) = 0, \hspace{2em}y\in\Omega$, \end{center} from where the result follows due to the invertibility of the operator $\mathcal{V}_{\triangle}$ (cf. Lemma \ref{ch4thinvV}). \end{proof} \section{BDIE system for the mixed problem} We aim to obtain a segregated boundary-domain integral equation system for mixed BVP \eqref{ch4BVP}. To this end, let the functions $\Phi_{0}\in H^{\frac{1}{2}}(S)$ and $\Psi_{0}\in H^{-\frac{1}{2}}(S)$ be respective continuations of the boundary functions $\phi_{0}\in H^{\frac{1}{2}}(S_{D})$ and $\psi_{0}\in H^{-\frac{1}{2}}(S_{N})$ to the whole $S$. Let us now represent \begin{equation*}\label{ch4gTrepr} \gamma^{+}u=\Phi_{0} + \phi,\quad\quad T^{+}u = \Psi_{0} +\psi,\quad\text{ on }\,\, S, \end{equation*} where $\phi\in\widetilde{H}^{\frac{1}{2}}(S_{N})$ and $\psi\in\widetilde{H}^{-\frac{1}{2}}(S_{D})$ are unknown boundary functions. To obtain one of the possible boundary-domain integral equation systems we employ identity \eqref{ch43GV} in the domain $\Omega$, and identity \eqref{ch43GG} on $S$, substituting there $\gamma^{+}u=\Phi_{0} + \phi$ and $T^{+}u = \Psi_{0} +\psi$ and further considering the unknown functions $\phi$ and $\psi$ as formally independent (segregated) of $u$ in $\Omega$. Consequently, we obtain the following system (M12) of two equations for three unknown functions, \begin{subequations} \begin{align} u+\mathcal{R}u-V\psi+W\phi&=F_{0}\hspace{2em}in\hspace{0.5em}\Omega,\label{ch4SM12v}\\ \dfrac{1}{2}\phi+\gamma^{+}\mathcal{R}u-\mathcal{V}\psi+\mathcal{W}\phi&=\gamma^{+}F_{0}-\Phi_{0}\label{ch4SM12g}\hspace{2em}on\hspace{0.5em}S, \end{align} \end{subequations} where \begin{equation}\label{ch4F0term} F_{0}=\mathcal{P}f+V\Psi_{0}-W\Phi_{0}. \end{equation} We remark that $F_{0}$ belongs to the space $H^{1}(\Omega)$ in virtue of the mapping properties of the surface and volume potentials, see Theorems \ref{ch4thmUR} and \ref{ch4thmappingVW}. The system (M12), given by \eqref{ch4SM12v}-\eqref{ch4SM12g} can be written in matrix notation as \begin{equation*} \mathcal{M}^{12}\mathcal{X}=\mathcal{F}^{12}, \end{equation*} where $\mathcal{X}$ represents the vector containing the unknowns of the system, \begin{equation*} \mathcal{X}=(u,\psi,\phi)^{\top}\in H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N}), \end{equation*} the right hand side vector is \[\mathcal{F}^{12}:= [ F_{0}, \gamma^{+}F_{0} - \Psi_{0} ]^{\top}\in H^{1}(\Omega)\times H^{\frac{1}{2}}(S),\] and the matrix operator $\mathcal{M}^{12}$ is defined by: \begin{equation*} \mathcal{M}^{12}= \left[ {\begin{array}{ccc} I+\mathcal{R} & -V & W \\ \gamma^{+}\mathcal{R} & -\mathcal{V} & \dfrac{1}{2}I + \mathcal{W} \end{array} } \right]. \end{equation*} We note that the mapping properties of the operators involved in the matrix imply the continuity of the operator \begin{equation*} \mathcal{M}^{12}: H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})\longrightarrow H^{1}(\Omega)\times H^{\frac{1}{2}}(S). \end{equation*} \begin{theorem}\label{ch4EqTh} Let $f\in L_{2}(\Omega)$. Let $\Phi_{0}\in H^{\frac{1}{2}}(S)$ and $\Psi_{0}\in H^{-\frac{1}{2}}(S)$ be some fixed extensions of $\phi_{0}\in H^{\frac{1}{2}}(S_{D})$ and $\psi_{0}\in H^{-\frac{1}{2}}(S_{N})$ respectively. \begin{enumerate} \item[i)] If some $u\in H^{1}(\Omega)$ solves the BVP \eqref{ch4BVP}, then the triple $(u, \psi, \phi )^{\top}\in H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})$ where \begin{equation}\label{ch4eqcond} \phi=\gamma^{+}u-\Phi_{0},\hspace{4em}\psi=T^{+}u-\Psi_{0},\hspace{2em}on\hspace{0.5em}S, \end{equation} solves the BDIE system (M12). \item[ii)] If a triple $(u, \psi, \phi )^{\top}\in H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})$ solves the BDIE system then $u$ solves the BVP and the functions $\psi, \phi$ satisfy \eqref{ch4eqcond}. \item[iii)] The system (M12) is uniquely solvable. \end{enumerate} \end{theorem} \begin{proof} First, let us prove item $i)$. Let $u\in H^{1}(\Omega)$ be a solution of the boundary value problem \eqref{ch4BVP} and let $\phi$, $\psi$ be defined by \eqref{ch4eqcond}. Then, due to \eqref{ch4BVP2} and \eqref{ch4BVP3}, we have \[(\psi,\phi) \in \widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N}).\] Then, it immediately follows from the third Green identities \eqref{ch43GV} and \eqref{ch43GG} that the triple $(u,\phi, \psi)$ solves BDIE system $\mathcal{M}^{12}$. Let us prove now item $ii)$. Let the triple $(u, \psi,\phi )^{\top}\in H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})$ solve the BDIE system. Taking the trace of the equation \eqref{ch4SM12v} and substract it from the equation \eqref{ch4SM12g}, we obtain \begin{equation}\label{ch4M12a1} \phi=\gamma^{+}u-\Phi_{0}, \hspace{1em} \text{on}\hspace{0.5em}S. \end{equation} This means that the first condition in \eqref{ch4eqcond} is satisfied. Now, restricting equation \eqref{ch4M12a1} to $S_{D}$, we observe that $\phi$ vanishes as $supp(\phi)\subset S_{N}$. Hence, $\phi_{0}=\Phi_{0}=\gamma^{+}u$ on $S_{D}$ and consequently, the Dirichlet condition of the BVP \eqref{ch4BVP2} is satisfied. We proceed using the Lemma \ref{ch4lema1} in the first equation of the system (M12), \eqref{ch4SM12v}, with $\Psi=\psi + \Psi_{0}$ and $\Phi = \phi + \Phi_{0}$ which implies that $u$ is a solution of the equation \eqref{ch4BVP1} and also the following equality: \begin{equation*}\label{ch4M12a2} V(\Psi_{0}+\psi - T^{+}u) - W(\Phi_{0} + \phi -\gamma^{+}u) = 0 \text{ in } \Omega. \end{equation*} By virtue of \eqref{ch4M12a1}, the second term of the previous equation* vanishes. Hence, \begin{equation*}\label{ch4M12a3} V(\Psi_{0}+\psi - T^{+}u)= 0, \quad \text{ in } \Omega. \end{equation*} Now, by virtue of Lemma \ref{ch4lemma2} we obtain \begin{equation}\label{ch4M12a4} \Psi_{0} + \psi - T^{+}u = 0,\quad\text{ on } S. \end{equation} Since $\psi$ vanishes on $S_{N}$, we can conclude that $\Psi_{0}=\psi_{0}$ on $S_{N}$. Consequently, equation \eqref{ch4M12a4} implies that $u$ satisfies the Neumann condition \eqref{ch4BVP3}. Item $iii)$ immediately follows from the uniqueness of the solution of the mixed boundary value problem \ref{ch4Thomsol}. \end{proof} \begin{lemma}\label{ch4remark}$(F_{0}, \gamma^{+}F_{0}-\Phi_{0})=0$ if and only if $(f, \Phi_{0},\Psi_{0})=0$ \end{lemma} \begin{proof} It is trivial that if $(f, \Phi_{0}, \Psi_{0})=0$ then $(F_{0}, \gamma^{+}F_{0}-\Phi_{0})=0$. Conversely, supposing that $(F_{0}, \gamma^{+}F_{0}-\Phi_{0})=0$, then taking into account equation \eqref{ch4F0term} and applying Lemma \ref{ch4lema1} with $F_{0}=0$ as $u$, we deduce that $f=0$ and $V\Psi_{0}-W\Phi_{0}=0$ in $\Omega$. Now, the second equality, $\gamma^{+}F_{0}-\Phi_{0}=0$, implies that $\Phi_{0}=0$ on $S$ and applying Lemma \ref{ch4lemma2} gives $\Psi_{0}=0$ on $S$. \end{proof} \begin{theorem} The operator \[\mathcal{M}^{12}:H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})\longrightarrow H^{1}(\Omega)\times H^{\frac{1}{2}}(S),\] is invertible. \end{theorem} \begin{proof} Let $\mathcal{M}_{0}^{12}$ be the matrix operator defined by \begin{equation*}\label{ch4M012} \mathcal{M}_{0}^{12}:= \left[ {\begin{array}{ccc} I & -V & W \\ 0 & -\mathcal{V} & \dfrac{1}{2}I \\ \end{array} } \right]. \end{equation*} The operator $\mathcal{M}_{0}^{12}$ is also bounded due to the mapping properties of the operators involved. Furthermore, the operator \begin{center} $\mathcal{M}^{12}- \mathcal{M}_{0}^{12}: H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})\longrightarrow H^{1}(\Omega)\times H^{\frac{1}{2}}(S)$ \end{center} is compact due to the compact mapping properties of the operators $\mathcal{R}$ and $\mathcal{W}$, (cf. Theorem \ref{ch4corcompact} and Theorem \ref{ch4thcompVW}). Let us prove that the operator $\mathcal{M}^{12}_{0}$ is invertible. For this purpose, we consider the following system with arbitrary right hand side $\widetilde{F}=[\widetilde{F_{1}},\widetilde{F_{2}}]^{\top}\in H^{1}(\Omega)\times H^{\frac{1}{2}}(S)$ and let $\mathcal{X}=(u,\psi,\phi)^{\top}\in H^{1}(\Omega)\times\widetilde{H}^{-\frac{1}{2}}(S_{D})\times\widetilde{H}^{\frac{1}{2}}(S_{N})$ be the vector of unknowns \begin{equation}\label{ch4systemM120} \mathcal{M}^{12}_{0}\mathcal{X}=\widetilde{F}. \end{equation} Writing \eqref{ch4systemM120} component-wise, \begin{subequations} \begin{align} u- V\psi +W\phi &= \widetilde{F_{1}},\hspace{2em} in \hspace{0.5em}\Omega,\label{ch4i121}\\ \frac{1}{2}\phi - \mathcal{V}\psi &= \widetilde{F_{2}}, \hspace{2em}on \hspace{0.5em}S.\label{ch4i122} \end{align} \end{subequations} Equation \eqref{ch4i122} restricted to $S_{D}$ gives: \begin{equation}\label{ch4i123} -r_{S_{D}}\mathcal{V}\psi = r_{S_{D}}\widetilde{F_{2}}. \end{equation} Due to the invertibility of the operator $\mathcal{V}$ (cf. Lemma \ref{ch4thinvV}), equation \eqref{ch4i123} is uniquely solvable on $S_{D}$. Equation \eqref{ch4i123} means that $(\mathcal{V}\psi + \widetilde{F_{2}})\in \widetilde{H}^{\frac{1}{2}}(S_{N})$. Thus, the unique solvability of \eqref{ch4i123} implies that $\phi$ is also uniquely determined by the equation \begin{equation*} \phi=(2\mathcal{V}\psi +2\widetilde{F_{2}})\in \widetilde{H}^{\frac{1}{2}}(S_{N}). \end{equation*} Consequently, $u$ also is uniquely determined by the first equation \eqref{ch4i121} of the system. Furthermore, since $V\psi$, $W\phi\in H^{1}(\Omega)$, we have $u\in H^{1}(\Omega)$. Thus, the operator $\mathcal{M}_{0}^{12}$ is invertible and the operator $\mathcal{M}^{12}$ is a zero index Fredholm operator due to the compactness of the operator $\mathcal{M}^{12}-\mathcal{M}_{0}^{12}$. Hence the Fredholm property and the injectivity of the operator $\mathcal{M}^{12}$, provided by item $iii)$ of Theorem \ref{ch4remark}, imply the invertibility of operator $\mathcal{M}^{12}$. \end{proof} \section{Conclusions} A new parametrix for the diffusion equation in non homogeneous media (with variable coefficient) has been analysed in this paper. Mapping properties of the corresponding parametrix based surface and volume potentials have been shown in corresponding Sobolev spaces. A BDIES for the original BVP has been obtained. Results of equivalence between the BDIES and the BVP has been shown along with the invertibility of the matrix operator defining the BDIES. Now, we have obtained an analogous system to the BDIES (M12) of \cite{mikhailov1} with a new family of parametrices which is uniquely solvable. Hence, further investigation about the numerical advantages of using one family of parametrices over another will follow. Analogous results could be obtain for exterior domains following a similar approach as in \cite{exterior}. Further generalised results for Lipschitz domains can also be obtain by using the generalised canonical conormal derivative operator defined in \cite{traces, mikhailovlipschitz}. Moreover, these results can be generalised to Bessov spaces as in \cite{miksolandreg}.
\section{Introduction} RENO has successully measured the value of the smallest neutrino mixing angle, $\theta_{13}$, and has undertaken the measurement of the squared mass difference $|\Delta m^2 _{ee}|$. The inverse beta decay (IBD) data collected at RENO uses electron antineutrinos produced by six equally spaced reactors of the Hanbit nuclear power plant. There are two identical detectors located at near and far sites at 294 m and 1,383 m, respectively, from the center of the reactor array. The power plant consists of six equally spaced reactor cores placed linearly and provides a total thermal power of 16.8 GW$_{\rm th}$ in full operation mode. Even though all three neutrino mixing angles and two mass square differences in the PMNS matrix are measured based on reactor experiments, precise measurements of these parameters are still important issues for current and future neutrino oscillation experiments to measure leptonic CP violation and to determine neutrino mass ordering. Recently some methodologies to measure neutrino mass ordering using reactor anti electron neutrino are discussed \cite{1}. In this work RENO improved background systematic uncertainty and updated $\sin^2 2\theta_{13}$ and $|\Delta m^2 _{ee}|$ using 1,500 live days of data collected in the detectors. The updated 5 MeV excess estimation is also reported. \section{RENO Detector} RENO near (far) detector is constructed with 120 (450) m.w.e. overburden. The two detectors are assembled identically in a concentric cylindrical shape. Each detector consists of inner detector (ID) and outer veto detector (OD) filled with 350 ton purified water. The ID consists of target (16 ton liquid scintillator with 0.1\% Gd), $\gamma$-catcher (29 ton liquid scintillator), and buffer (65 ton mineral oil) from the detector center. Total 354 (67) Hamamatsu 10 inch PMTs are installed on the buffer (veto) wall. More details on the RENO experimental setup and the detector are found in \cite{2,3}. \section{Data Sample} RENO has been taking data since 2011 continuously with average DAQ live time efficiency of ~95\% for both detectors. In this analysis we use data collected from Aug. 19, 2011 to Apr. 23, 2017 for near detector and from Aug. 11, 2011 to Sep. 23, 2015 for far detector. Total live time of the data is 15,47.35 (1,397.78) days for near (far) detector. \begin{table} \center \begin{tabular}{c c c } \hline Detector & Near & Far \\ \hline Selected candidate events & 732.168&68.055\\ Total background rate & 9.34$\pm$0.37&1.95$\pm$0.15\\ IBD rate after background subtraction&463.80$\pm$0.66&46.75$\pm$0.24\\ \hline \hline Livetime [days]& 1,547.35&1,397.78\\ \hline Accidental & 2.07$\pm$0.02&0.38$\pm$0.01\\ $^{9}$Li/$^{8}$He & 5.49$\pm$0.36&0.93$\pm$0.15\\ Fast neutron&1.74$\pm$0.02&0.35$\pm$0.01\\ $^{252}$Cf&0.04$\pm$0.01&0.28$\pm$0.02\\ \hline \end{tabular} \caption{Event rates per day of the observed IBD candidates and the estimated background in 1.2 < E$_p$ < 8 MeV} \end{table} RENO select IBD event sample by applying the IBD selection criteria described in \cite{2}. In this analysis, to reduce background rate and its uncertainty, the optimized values of the spatial coincidence requirement of $\Delta$R < 2.0 m to lower the accidental background is considered. The following multiplicity requirements are also changed to make additional reduction of fast neutron, $^9$Li/$^{8}$He and $^{252}$Cf backgrounds (note that the indexes of changed criteria are the ones used in \cite{3}): a timing veto requirement for rejecting coincidence pair (a) if they are accompanied by any preceding ID or OD trigger within a 300 $\mu$s window before their prompt candidate, (b) if they are followed by any subsequent ID-only trigger other than those associated with the delayed candidate within a 200 (800) $\mu$s window from their prompt candidate (only far $^{252}$Cf contaminated data), (d) if there are other subsequent pairs within the 500 (1,000) $\mu$s interval (only far $^{252}$Cf contaminated data), (f) if they are accompanied by a prompt candidate of E$_P$ > 3 MeV and Q$_{max}$/Q$_{tot}$ < 0.04 within a 10 (20) s window and a distance of 40 (50) cm for near (far) $^{252}$Cf contaminated data; (ix) a spatial veto requirement for rejecting coincidence pairs in the far detector only if the vertices of their prompt candidates are located in a cylindrical volume of 50 cm in radius, centered at x = +12.5 cm and y = +12.5 cm and z < -110 cm. Total dead time due to the selection criteria is estimated as 40.37 (31.47)\% for near (far) data. The same detection efficiency in \cite{4} is used in this analysis. Some background could remain in the IBD candidate events sample passing the selection criteria. The methods to estimate the remaining background are well described in \cite{4} and adopting the same method for the 1,500 live days of RENO data we estimated the remaining background and summarized in Table 1. \begin{table} \center \begin{tabular}{c c c } \hline & Bin-correlated & Bin-uncorrelated \\ \hline Total background & 0.60\% (near), 1.99\% (far)&3.94\% (near), 2.71\% (far)\\ \hline Accidental & 0.37\% (near), 0.96\% (far)&0.18\% (near), 0.49\% (far)\\ $^{9}$Li/$^{8}$He &1.01\% (near), 3.66\% (far)&6.71\% (near), 4.17\% (far)\\ Fast neutron&0.23\% (near), 0.54\% (far)&0.75\% (near), 0.83\% (far)\\ $^{252}$Cf&6.00\% (near), 1.11\% (far)&10.23\% (near), 12.62\% (far)\\ \hline \end{tabular} \caption{Background systematic uncertainties in 1.2 < E$_p$ < 8 MeV} \end{table} \section{Systematic Uncertainties} To obtain the systematic uncertainties, the methods described in \cite{4} is applied. Based on these methods we estimated our systematic uncertainties on background and summarized in Table 2. The systematic uncertainties of reactor, detection efficiency including timing veto, and energy scale remain the same as before \cite{4}. \begin{figure}[htbp] \centering \includegraphics[width=120mm]{Fig1.png} \caption{\label{fig1}(Top panels) Comparison of the IBD prompt spectra between 1,500 live days of RENO data and expectation \cite{6,7}. (Bottom panels) The fractional difference between the observed and expected spectra where the 5 MeV excesses are clearly shown in both near and far data.} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=120mm]{Fig2.png} \caption{\label{fig1}((Left) The 5 MeV excess vs. IBD rates per day. (Right) The 5 MeV excess vs. $^{235}$U fission fraction.} \end{figure} \section{Results} With 1,500 live days of data we estimate the 5 MeV excess and spectral measurement of $\sin^2 2 \theta_{13}$ and $|\Delta m^2 _{ee}|$. \begin{figure} \centering \includegraphics[width=80mm]{Fig3.png} \caption{(Top panel) Observed (black dots with error bars) vs. expected (blue dotted histogram) IBD prompt energy spectra after background subtraction at far site. The expected spectrum at far site is obtained using the near IBD data assuming no oscillation. The orange histogram represents the expected IBD spectrum with bestfit oscillation parameters. (Bottom panel) Ratio of the observed to the expected IBD prompt spectra. There is a clear energy dependent reactor neutrino disappearance.} \end{figure} \begin{figure} \centering \includegraphics[width=80mm]{Fig4.png} \caption{(Contour plot of $\sin^2 2 \theta_{13}$ vs. $|\Delta m^2 _{ee}|$. The best fit value for rate + shape (rate-only assuming $|\Delta m^2 _{ee}| = 2.49 \times 10^{-3} {\rm eV}^2$) analysis is represented as a black dot (cross). The three ellipses represent the corresponding confidence levels of 68.3\%, 95.5\%, and 99.7\%. The upper (righter) panel shows 1-dimentional $\Delta \chi^2$ distribution for $\sin^2 2 \theta_{13}$ ($|\Delta m^2 _{ee}|$) and 1 $\sigma$ error band in orange color.} \end{figure} RENO is the first reactor neutrino experiment group who discovers the 5 MeV excess based on spectral comparion of observed and expected IBD prompt events at the two detectors in 2014 using 800 live days of RENO data \cite{5}. The correlation between the 5 MeV excess and the IBD rate, i.e. the reactor thermal power was also reported. These results are updated using 1,500 live days of data. Figure 1 top panels show observed IBD prompt spectra of near and far data compared to the expected ones by the Huber and Mueller model \cite{6,7} normalized to the area except the 5 MeV excess region. The bottom panels of the Fig. 1 depict the difference between the two spectra in the corresponding upper panels, where yellow bands represent uncertainties in the model. A clear spectral discrepancy is observed in the region of 5 MeV in both detectors. For the spectral comparison only, the MC predicted energy spectra are normalized to the observed events out of the excess range 3.6 < E$_{p}$ < 6.6 MeV. The excess of events is estimated as about 2.5\% of the total observed reactor $\bar{\nu}_{e}$ rate in both detectors. \begin{figure} \centering \includegraphics[width=80mm]{Fig5.png} \caption{Reactor neutrino survival probability as a function of L$_{\rm eff}$/E. The L$_{\rm eff}$ is a flux weighted effective distance to a detector from the six reactors with different baselines. Far data matches well with the best-fit oscillation prediction (blue curve).} \end{figure} Using the $\chi^2$ function for the rate + shape analysis described in \cite{3}, $\sin^2 2\theta_{13}$ and $|\Delta m^2 _{ee}| $ are obtained for the 1,500 live days of RENO data. The measured values using events in 1.2 < E$_{p}$ < 8 MeV are: $\sin^2 2\theta_{13} = 0.086 \pm 0.006 ({\rm stat.}) ± 0.005 ({\rm syst.})$ and $|\Delta m^2 _{ee}| = 2.61+0.15-0.16 ({\rm stat.}) \pm 0.09 ({\rm syst.}) (\times 10^{-3} {\rm eV^2})$. The total uncertainty on $\sin^2 2\theta_{13}$ ($|\Delta m^2 _{ee}| $) is reduced from 12 (10)\% to 9 (7)\% compared to our previous measurements using 500 live days of data \cite{3}. Figure 3 top panel shows the observed IBD prompt spectrum at far (black dots with error bars) and the expected one obtained from near data assuming no oscillation. There is a clear discrepancy between the two due to electron anti neutrino disappearance at far, and their ratio is drawn in the bottom panel where the energy dependent discrepancy is shown well. Figure 4 shows the contour plot and the best-fit values of rate + shape (black dot) and rate-only (cross sign) measurements. Figure 5 shows the electron anti neutrino survival probability as a function of L$_{\rm eff}$/E. Both near (open circles) and far (black dots) data points are shown with the best-fit oscillation probability (blue curve). The far data points matches very well to the best-fit oscillation. The near data points, however, matches extremely well to the best-fit oscillation since the near expectation without oscillation was obtained by unavoidably using near data itself rather than MC. Note that MC can not be used in this case because of the mismatch in the 5 MeV excess region. In summary, using 1,500 live days of data RENO has reduced the uncertainties to 9\% and 7\% for the $\sin^2 2\theta_{13}$ and $|\Delta m^2 _{ee}| $measurements, respectively. RENO has a plan to reduce the $\sin^2 2\theta_{13}$ uncertainty to ~6\% using data taken by 2018. With additional 2 or 3 more years of data taking from 2019 the uncertainty on the $|\Delta m^2 _{ee}| $ measurement is expected to be reduced to 4$\sim$5\% even though the $\sin^2 2\theta_{13}$ uncertainty would remain as ~6\%.
\section{Introduction and Main Results} Let $n$ and $k$ be two positive integers such that $n\geq k$. Throughout the paper, the two symbols $[n]$ and ${[n]\choose k}$, respectively, stand for the sets $\{1,\ldots,n\}$ and $\{A\subseteq[n]\colon |A|=k\}$. The {\it Kneser graph $\operatorname{KG}_{n,k}$} is a graph whose vertex set is ${[n]\choose k}$ where two vertices are adjacent if their corresponding sets are disjoint. Kneser graphs are important objects in many areas of combinatorics and they are involved in many interesting results, for instance see~\cite{EKR61,HilMil67,Kneser55,Lovasz78,Matousek04,Schrijver78}. A family $\mathcal{A}\subseteq {[n]\choose k}$ is called {\it intersecting} whenever each of two members of $\mathcal{A}$ have nonempty intersection , i.e., $\mathcal{A}$ is an independent set in $\operatorname{KG}_{n,k}$. Let us recall that for a graph $G$, the set $U\subseteq V(G)$ is independent if $G[U]$, the {\it subgraph induced by $U$}, has no edge. Moreover, the size of a maximum independent set in $G$ is called the {\it independence number of $G$} and is denoted by $\alpha(G)$. Clearly, for each $i\in[n]$, the set $$\mathcal{S}_i=\Big\{A\in{[n]\choose k}\colon i\in A \Big\}$$ is an independent set of $\operatorname{KG}_{n,k}$. An independent set $\mathcal{A}$ of $\operatorname{KG}_{n,k}$ is called a {\it star } if $\mathcal{A}\subseteq \mathcal{S}_i$ for some $i\in[n]$. Otherwise, $\mathcal{A}$ is called a {\it nontrivial independent set}. For an $\ell$-subset $L\subseteq [n]$, the union of $\ell$ stars $\bigcup\limits_{i\in L}\mathcal{S}_{i}$ is said to be an {\it $\ell$-constellation} and is denoted by $C(L)$, i.e., $$C(L)=\Big\{A\in {[n]\choose k}\colon A\cap L\neq\varnothing\Big\}.$$ The well-known Erd{\H o}s-Ko-Rado theorem~\cite{EKR61} asserts that $\alpha(\operatorname{KG}_{n,k})={n-1\choose k-1}$ provided that $n\geq 2k$; furthermore, if $n>2k$, then the only independent sets of this size are maximal stars. Evidently, an independent set in a graph $G$ is a subset $U\subseteq V(G)$ for which the induced subgraph $G[U]$ contains no subgraph isomorphic to $K_2$. This leads to a number of interesting generalizations of the classical concepts in graph theory, such as independent sets and also proper vertex-coloring of graphs (see~\cite{DarFra95, harary1}). In this regard, we are interested in the following problem which mainly motivated the present paper. \begin{problem}\label{problem} Given a graph $G$, how large a subset $\mathcal{A}\subseteq {[n]\choose k}$ must be chosen to guarantee that $\operatorname{KG}_{n,k}[\mathcal{A}]$ has some subgraph isomorphic to $G$? Also, what is the structure of the largest subset $\mathcal{A}\subseteq {[n]\choose k}$ for which $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $G$? \end{problem} This problem has been investigated for some specific graphs $G$ in the literature, but in a different language. In the following, we list some of them.\\ \begin{itemize} \item The Erd{\H o}s-Ko-Rado theorem answers to the problem when $G=K_2$.\\ \item The case $G=K_{1,t}$ is studied by Gerbner {\it et al.} in~\cite{MR3022158}. For $t=2$, they have proved that if $n\geq 2k+2$, then any maximum subset $\mathcal{A}\subseteq {[n]\choose k}$ for which $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $K_{1,2}$ has the cardinality at most ${n-1\choose k-1}$ and the equality holds if and only if $\mathcal{A}$ is a star. Moreover, for an arbitrary $t$, they proved the same assertion provided that $n\geq \min\{O(tk^2),O(k^3+tk)\}$. \item The case $G=K_{s,t}$ was studied by Katona and Nagy in~\cite{MR3386026}. They proved that there is a threshold $n(k,t)$ such that for $n\geq n(k,t)$, if $\mathcal{A}\subseteq{[n]\choose k}$ and $\operatorname{KG}_{n,k}[\mathcal{A}]$ is a $K_{s,t}$-free graph, then $|\mathcal{A}|\leq {n-1\choose k-1}+s-1$.\\ \item The Erd{\H o}s Matching Conjecture~\cite{Erdos65} suggests the exact value for the size of a maximum subset $\mathcal{A}\subseteq {[n]\choose k}$ for which $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $K_{s+1}$. This conjecture has been studied extensively in the literature. It has been already proved that the conjecture is true for $k\leq 3$ (see~\cite{ErdGal59,Frankl2017,LucMie14}). Also, improving the earlier results in~\cite{BolDayErd76,Erdos65,FranLucMie12,HuaLohSud12}, Frankl~\cite{Frankl13} confirmed the conjecture for $n\geq (2s+1)k-s$; moreover, he determined the structure of $\mathcal{A}$ in the extremal case. \end{itemize} Scott and Wilmer~\cite{ScottWilmer14} studied the number of vertices and the structure of an induced Kneser subgraph whose vertex degrees are located in an interval. Another interesting generalization of the Erd{\H o}s-Ko-Rado theorem can be found in~\cite[Theorem~3]{HavWood2014} which concerns the maximum number of vertices for a multipartite subgraph of the complement of Kneser graphs which has bounded size in its parts. \begin{alphtheorem}{\rm (Frankl~\cite{Frankl13})}\label{thm:Frankl} Let $\mathcal{A}\subseteq {[n]\choose k}$ such that $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no-subgraph isomorphic to $K_{s+1}$ and $n\geq(2s + 1)k-s$. Then $|\mathcal{A}|\leq {n\choose k}-{n-s\choose k}$ with equality if and only if $\mathcal{A}$ is equal to an $s$-constellation $C(L)$ for some $L\subseteq [n]$. \end{alphtheorem} In the present paper, along with some other auxiliary results, we will answer to Problem~\ref{problem} provided that $n$ is sufficiently large. Before stating our main results, we need to introduce some preliminaries. For a given graph $G$ with $\chi(G)=q$, the minimum size of a color class among all proper $q$-coloring of $G$ is denoted by $\eta(G)$, i.e., $$\eta(G)=\min\left\{\min\limits_{i\in[q]}|U_i|\colon (U_1,\ldots,U_{q})\text{ is a proper $q$-coloring of } G\right\}.$$ A subgraph of $G$ is called {\it special} if removing its vertices from $G$ reduces the chromatic number by one. Note that $G$ is a subgraph of a complete $q$-partite graph $K_{t_1\ldots,t_q}$ for some positive integers $t_1,\ldots, t_q$, where $t_1\geq\cdots\geq t_q=\eta(G)$. Now, we are in a position to state our first main result. \begin{theorem}\label{thm:main} Let $k\geq 2$ be a fixed positive integer and $G$ be a fixed graph with $|V(G)|=m$, $\chi(G)=q$ and $\eta(G)=\eta$. There exists a threshold $N(G,k)$ such that for any $n\geq N(G,k)$ and for any $\mathcal{A}\subseteq {[n]\choose k}$, if $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $G$, then $$|\mathcal{A}|\leq {n\choose k}-{n-q+1\choose k}+\eta-1.$$ Moreover, the equality holds if and only if there is a $(q-1)$-set $L\subseteq [n]$ such that $$|\mathcal{A}\setminus C(L)|= \eta-1$$ and $\operatorname{KG}_{n,k}[\mathcal{A}\setminus C(L)]$ has no subgraph isomorphic to a special subgraph of $G$. \end{theorem} Let $s$ and $t$ be two positive integers such that $t\geq s$. A subset $\mathcal{A}\subseteq {[n]\choose k}$ is said to be {\it $(s,t)$-union intersecting} whenever for each $\{A_1,\ldots,A_s\},\{B_1,\ldots,B_t\}\subseteq \mathcal{A}$, we have $$\left(\bigcup\limits_{i=1}^s A_i\right)\cap\left(\bigcup\limits_{i=1}^tB_i\right)\neq \varnothing.$$ It is clear that the Erd{\H o}s-Ko-Rado theorem determines the maximum possible size of a $(1,1)$-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$. From this point of view, one may naturally ask for the maximum size of an $(s,t)$-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$. Note that any family $\mathcal{A}\subseteq {[n]\choose k}$ with the property that $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $K_{s,t}$ is an $(s,t)$-union intersecting family and vice versa. This observation implies that if we set $G=K_{s,t}$, then Theroem~\ref{thm:main} gives a partial answer to the aforementioned question. However, in the next theorem we prove a better result by estimating the threshold $N(G,k)$ appearing in the statement of Theorem~\ref{thm:main}. It should be mentioned that the maximum size of an $(s,t)$-union intersecting family $\mathcal{A}\subset {[n]\choose k}$ have been investigated by Katona and Nagy in~\cite{MR3386026}. They prove that for sufficiently large $n$, every $(s,t)$-union intersecting family $\mathcal{A}\subset {[n]\choose k}$ has the cardinality at most $ {n-1\choose k-1}+s-1$. In the next theorem, improving this result, we show that all $(s,t)$-union intersecting families with the maximum possible size are formed by the union of a maximal star and a set of $s-1$ $k$-sets. \begin{theorem}\label{thm:EKR} Let $k,t$ and $s$ be fixed positive integers such that $k\geq 2$ and $t\geq s\geq 1$. If $n\geq 1+\max \{2(sk(k-1)+t-1), 2^{2s(1+{3\over 2k-2})}(t-1)^{1\over k-1}(k-1) \}$, then any $(s,t)$-union intersecting family $\mathcal{A}\subseteq{[n]\choose k}$ has the cardinality at most ${n-1\choose k-1}+s-1$. Moreover, the equality holds if and only if there is an $i\in[n]$ such that $\mathcal{A}$ is a union of the star $\mathcal{S}_i$ and $s-1$ vertices from $\mathcal{A}\subseteq{[n]\choose k}\setminus \mathcal{S}_i$. \end{theorem} Note that if we set $t=1$, then the previous theorem is an immediate consequence of the Erd{\H o}s-Ko-Rado theorem. Extending the Erd{\H o}s-Ko-Rado theorem, Hilton and Milner~\cite{HilMil67} determined, when $n>2k$, the maximum possible size of an independent set in $\operatorname{KG}_{n,k}$ which is contained in no star, i.e., the independent set is {\it nontrivial}. In detail, Hilton and Milner proved that for $n>2k$, any nontrivial independent set has the cardinality at most ${n-1\choose k-1}-{n-k-1\choose k-1}+1$. Many other interesting extensions of the Erd{\H o}s-Ko-Rado theorem and the Hilton-Milner theorem have since been proved, for instance see~\cite{MR3482268,MR3403515,DeFr1983,MR0480051,MR1415313,Frankl13,FranLucMie12,FRANKL20121388,MR3022158,MR2489272,KATONA1972183,MR2202076,MR2285800,MR771733}. When $s=1$ and $t\geq 2$, we have the following theorem giving a result stronger than the previous theorem. \begin{theorem}\label{HilMilnew} Let $n$, $k$ and $t$ be positive integers such that $k\geq 2$, and $t\geq 2$. Any $(1,t)$-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ of size at least $${n-1\choose k-1}-{n-k-1\choose k-1}+(t-1){2k-1\choose k-1}+t$$ is contained in some star $\mathcal{S}_i$. In particular, if $n\geq {3k\over2}(1+(t-1+{t\over {2k-1\choose k-1}})^{1\over{k-1}})$ and $\mathcal{A}$ is $(1,t)$-union intersecting, then $\mathcal{A}\leq{n-1\choose k-1}$ and the equality holds if only if $\mathcal{A}$ is the same as a star $\mathcal{S}_i$ for some $i\in [n].$ \end{theorem} As mentioned before, the maximum size of a $(1,t)$-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ has been already studied by Grebner {\it et al.} in~\cite{MR3022158}. They proved that there exists an $N=N(k,t)$ such that if $n\geq N$ then the size of a (1,t)-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ is at most ${n-1\choose k-1}$ with equality if and only if $\mathcal{A}$ is equal to some star $\mathcal{S}_i$. They showed that $N(k,t)\leq \min\{O(tk^2),O(k^3+tk)\}$ and posed the problem of finding the smallest value of $N(k,t)$. Also, with an interesting proof, using Katona's cycle method, they showed that for $t=2$ and $k\geq 3$, the minimum of $N(k,2)$ is $2k+2$. Theorem~\ref{HilMilnew} implies that $N(k,t)\leq {3k\over2}(1+(t-1+{t\over {2k-1\choose k-1}})^{1\over{k-1}})$ which is an improvement of their result when $t\geq 3$. For integers $n$ and $k$ with $n> 2k$, we set $M={n-1\choose k-1}-{n-k-1\choose k-1}$. Note that $M\leq k{n-2\choose k-2}=O(n^{k-2}).$ In the next theorem, we present a Hilton-Milner type theorem improving Theorem~\ref{thm:EKR}. \begin{theorem}\label{thm:hiltontype} Let $k, s$ and $t$ be three integers such that $k\geq 3$ and $t\geq s\geq 1$ and also let $\beta$ be a positive real number. There is an integer $N=N(s,t,\beta)$ such that if $n\geq N$, then for any $(s,t)$-union intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ with $|\mathcal{A}|\geq (s+\beta)M$, we have $\ell(\mathcal{A})\leq s-1$. \end{theorem} If we set $s=t=1$, then the previous theorem implies that any intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ with $|\mathcal{A}|\geq (t+\beta)M$ is contained in a unique star $\mathcal{S}_i$ provided that $n$ is large enough. However, the original Hilton-Milner theorem asserts much more; for $n>2k$, any intersecting family $\mathcal{A}\subseteq {[n]\choose k}$ with $|\mathcal{A}|\geq M+2$ is contained in a unique star $\mathcal{S}_i$. \section{Proof of Main Results} \subsection{Preliminaries} For a given graph $G$, the {\it Tur\'an number ${\rm ex}(n,G)$} is the maximum possible number of edges for a spanning subgraph of $K_n$ with no subgraph isomorphic to $G$. The well-known Erd{\H o}s-Stone-Simonovits theorem~\cite{MR0205876,MR0018807} asserts that for any graph $G$ with $\chi(G)\geq 2$, \begin{equation} {\rm ex}(G,n)=(1-{1\over \chi(G)-1}){n\choose 2}+o(n^2). \end{equation} This equality asymptotically determines ${\rm ex}(G,n)$ provided that $\chi(G)\geq 3$. However, when $\chi(G)=2$, it just indicates that ${\rm ex}(G,n)=o(n^2)$ and gives no more information about ${\rm ex}(G,n)$. Indeed, for the case that $G$ is bipartite, the order of ${\rm ex}(G,n)$ is open in general. In this regard, K{\H o}vari, S\'os, and Tur\'an~\cite{Kovari1954} proved that if $1\leq s\leq t$, then ${\rm ex}(n,K_{s,t})\leq c(s)n^{2-{1\over s}}$. In what follows, we review the proof of this result since we want to estimate the constant $c(s)$. Assume that $G$ is an $n$-vertex graph having no $K_{s,t}$ subgraph. Clearly, we must have $$\sum\limits_{v\in V(G)}{d(v)\choose s}\leq (t-1){n\choose s}.$$ Consequently, since $\displaystyle n{{2|E(G)|\over n}\choose s}=n{{1\over n}\sum\limits_{v\in V(G)} \deg(v)\choose s}\leq \sum\limits_{v\in V(G)}{\deg(v)\choose s}$, we have $$n{({2|E(G)|\over n}-(s-1))^s\over s!}\leq n{{2|E(G)|\over n}\choose s}\leq (t-1){n\choose s}\leq (t-1){n^s\over s!},$$ which implies \begin{equation}\label{bipartiteturan}|E(G)|\leq ({1\over 2}+{s-1\over{n^{1-{1\over s}}}}){\sqrt[s]{t-1}}n^{2-{1\over s}}. \end{equation} \subsection{Proofs} This section is devoted to the proofs of the results stated in the previous section. For a family $\mathcal{A}\subseteq {[n]\choose k}$, we define $\mathcal{A}^*$ to be the largest intersecting subfamily of $\mathcal{A}$; if there are more than one such a subfamily, we just choose one of them. Now, we set $\ell(\mathcal{A})=|\mathcal{A}\setminus\mathcal{A}^*|$. Also, we define $\mathcal{A}^*_i$ to be equal to $\mathcal{A}\cap\mathcal{S}_i$. \begin{proof}[Proof of Theorem~\ref{thm:main}] Set $T(k,q,\eta)= {n\choose k}-{n-q+1\choose k}+\eta$. To prove the first part of the theorem, it suffices to show that for any $\mathcal{A}\subseteq {[n]\choose k}$, if $|\mathcal{A}|\geq T(k,q,\eta)$, then $\operatorname{KG}_{n,k}[\mathcal{A}]$ has some subgraph isomorphic to $G$. We proceed by induction on $q$. If $q=1$, then clearly the assertion holds. Now, we assume that $q\geq 2$. Without loss of generality, we can assume that $G=K_{t_1,\ldots,t_q}$, for some positive integers $t_1,\ldots,t_q$, where $t_1\geq\cdots\geq t_q=\eta$. Also, without loss of generality, assume that $|\mathcal{A}|=T(k,q,\eta)$. We distinguish the following different cases. \begin{itemize} \item[(I)] $\max\limits_{i\in[n]}|\mathcal{A}^*_i|< (\sum\limits_{i=2}^qt_i)M+t_1$.\\ In this case, $\operatorname{KG}_{n,k}[\mathcal{A}]$ has at least $${|\mathcal{A}|\choose 2}-\sum\limits_{i=1}^n{|\mathcal{A}^*_i|\choose 2}= {|\mathcal{A}|\choose 2}-o(|\mathcal{A}|^2) $$ edges. Thus, by the Erd{\H o}s-Stone-Simonovits theorem, $\operatorname{KG}_{n,k}[\mathcal{A}]$ contains some subgraph isomorphic to $G$ provided that $n$ is large enough. \\ \item[(II)] $\max\limits_{i\in[n]}|\mathcal{A}^*_i|\geq (\sum\limits_{i=2}^qt_i)M+t_1$.\\ Without loss of generality, we can assume $|\mathcal{A}_n^*|\geq (\sum\limits_{i=2}^qt_i)M+t_1$. Consider $\mathcal{A}'=\mathcal{A}\setminus \mathcal{A}^*_n$. Since $|\mathcal{A}^*_n|\leq |\mathcal{S}_n|\leq {n-1\choose k-1}$, we have $|\mathcal{A}'|\geq T(k,q-1,\eta)$. Therefore, by the induction, there is a threshold $N(K_{t_2,\ldots,t_q},k)$ such that if $n\geq N(K_{t_2,\ldots,t_q},k)$, then $\operatorname{KG}_{n,k}[\mathcal{A}']$ contains a subgraph isomorphic to $K_{t_2,\ldots,t_q}$. Let $V\subseteq \mathcal{A}'$ be the vertex set of this subgraph. Note that each $A\in V$ is adjacent to at least $|\mathcal{A}_n^*|-M$ vertices in $ \mathcal{A}_n^*$. Consequently, there are at least $|\mathcal{A}_n^*|-(\sum\limits_{i=2}^qt_i)M\geq t_1$ vertices in $\mathcal{A}^*$ such that each of them is adjacent to each vertex in $V$, completing the proof of the first part of the theorem. \end{itemize} In what follows, we determine the structure of $\mathcal{A}$ when the equality holds. This is done in two parts: We first prove the existence of the desired $L$ and then deduce the structure of $\mathcal{A}\setminus C(L)$. Suppose that $n\geq N(G,k)$, $|\mathcal{A}|=T(k,q,\eta)-1$, and $\operatorname{KG}_{n,k}[\mathcal{A}]$ has no subgraph isomorphic to $G$. In what follows, we prove that there is a $(q-1)$-set $L\subseteq [n]$ such that $$|\mathcal{A}\setminus C(L)|= \eta-1.$$ First note that we must have $\max\limits_{i\in[n]}|\mathcal{A}^*_i|\geq (\sum\limits_{i=2}^qt_i)M+t_1$. Otherwise, with the same argument as in the proof of Case~(I), $\operatorname{KG}_{n,k}[\mathcal{A}]$ contains some subgraph isomorphic to $G$ provided that $n$ is large enough, which is~not possible. Therefore, the argument employed in the proof of Case~(II) should fail. It can be verified that if we have $|\mathcal{A}'|\geq T(k,q-1,\eta)$, then the proof still works. Hence, we must have $|\mathcal{A}^*_n|=\max\limits_{i\in[n]}|\mathcal{A}^*_i|={n-1\choose k-1}$. Note that $\mathcal{A}'\subseteq {[n-1]\choose k}$ has exactly $T(k,q-1,\eta)-1$ elements. Also, by following the proof of Case~(II), one can see that if $\operatorname{KG}_{n,k}[\mathcal{A}']$ has some subgraph isomorphic to $K_{t_2,\ldots,t_q}$, then $\operatorname{KG}_{n,k}[\mathcal{A}]$ contains some subgraph isomorphic to $K_{t_1,\ldots,t_q}$. Consequently, $\operatorname{KG}_{n,k}[\mathcal{A}']$ has no subgraph isomorphic to $K_{t_2,\ldots,t_q}$. Accordingly, by the induction, there is an $L\subseteq [n]$ of size $q-1$ such that $|\mathcal{A}\setminus C(L)|= \eta-1$. Suppose for the sake of contradiction that there is a subset $\{B_1,\ldots,B_r\}\subseteq \mathcal{A}\setminus C(L)$ such that $\operatorname{KG}_{n,k}[\{B_1,\ldots,B_r\}]$ is isomorphic to a special subgraph $H$ of $G$. Let $(U_1,\ldots,U_{q-1})$ be a proper $(q-1)$-coloring of $G-H$ such that $|U_1|\geq \cdots\geq |U_{q-1}|$. For the simplicity of notation, set $L=\{1,\ldots,q-1\}$ and $b=|\bigcup\limits_{i=1}^rB_i|$. Let $n$ be sufficiently large such that $$\displaystyle{\lfloor{n-b\over q-1}\rfloor \choose k-1}\geq \displaystyle{\lfloor{n-rk\over q-1}\rfloor \choose k-1}\geq |U_1|.$$ Now, consider $q-1$ pairwise disjoint subsets $Q_1,\ldots,Q_{q-1}$ of $[n]\setminus (\bigcup\limits_{i=1}^r B_i)$ such that $|Q_i|=\lfloor{n-b\over q-1}\rfloor$ and $i\in Q_i$, for each $i\in [q-1]$. Set $$\mathcal{C}=\{B_1,\ldots,B_r\}\cup\left(\bigcup\limits_{i=1}^{q-1} {Q_i\choose k-1}\right).$$ Now, one can simply check that $\operatorname{KG}_{n,k}[\mathcal{C}]$ contains $G$ as a subgraph, a contradiction. Suppose that there is a $(q-1)$-set $L\subseteq [n]$ such that $|\mathcal{A}\setminus C(L)|= \eta-1$ and $\operatorname{KG}_{n,k}[\mathcal{A}\setminus C(L)]$ has no subgraph isomorphic to a special subgraph of $G$. For a contradiction, assume that $G$ is a subgraph of $\operatorname{KG}_{n,k}[\mathcal{A}]$. Note that this subgraph must have some elements in $\mathcal{A}\setminus C(L)$ as its vertices. Consider the subgraph of $G$ induced by these vertices. One can simply see that this subgraph is a special subgraph of $G$ which is~not possible. \end{proof} Frankl~\cite{MR670845} generalizing a classical result due to Bollob{\'a}s~\cite{MR0183653} proved the following theorem. \begin{alphtheorem}\label{skew}\cite{MR670845} Let $\{(A_1,B_1),\ldots,(A_h,B_h)\}$ be a family of pairs of subsets of an arbitrary set with $|A_i|=k$ and $|B_i|=\ell$ for all $1\leq i\leq h$. If $A_i\cap B_i=\varnothing$ for $1\leq i\leq h$ and $A_i\cap B_j\neq\varnothing$ for $1\leq i<j\leq h$, then $h\leq {k+\ell\choose k}$. \end{alphtheorem} We will use this theorem to prove the following lemma which improves a result by Balogh {\it et al.}~\cite{MR3482268} asserting that for any $\mathcal{A}\subseteq{[n]\choose k}$, the induced subgraph $\operatorname{KG}_{n,k}[\mathcal{A}]$ has at least ${\ell(\mathcal{A})^2\over 2{2k\choose k}}$ edges. Our technique can be considered as a development of those in~\cite[Lemma 3.1]{MR3482268} and~\cite[Theorem 2.1]{ScottWilmer14}. \begin{lemma}\label{lem:1} If $\mathcal{A}\subseteq {[n]\choose k}$, then $|E(\operatorname{KG}_{n,k}[\mathcal{A}])|\geq {\ell(\mathcal{A})^2\over {2k\choose k}}.$ \end{lemma} \begin{proof} Note that if $\ell(\mathcal{A})=0$, then there is nothing to prove. Henceforth, we assume that $\ell(A)>0$. Set $\mathcal{A}^1=\mathcal{A}$. Let $i\geq1$. For each $i\geq 1$, if $E(\operatorname{KG}_{n,k}[\mathcal{A}^{i}])\neq\varnothing$, we define $\mathcal{C}^i,m_i,A^i$ and $\mathcal{A}^{i+1}$ as follows.\\ \begin{itemize} \item Set $\mathcal{B}^i_1=\mathcal{A}^{i}$. \item Let $A^i_1B^i_1\in E(\operatorname{KG}_{n,k}[\mathcal{B}^i_1])$. \item While $E(\operatorname{KG}_{n,k}[\mathcal{B}^i_j\setminus N(A^i_j)])\neq\varnothing$, define $\mathcal{B}^i_{j+1}=\mathcal{B}^i_{j}\setminus N(A^i_{j})$ and choose $A^i_{j+1},B^i_{j+1}\in \mathcal{B}^i_{j+1}$ such that $A^i_{j+1}B^i_{j+1}\in E(\operatorname{KG}_{n,k}[\mathcal{B}^i_{j+1}])$. \end{itemize} Define $m_i$ to be the maximum index $j$ for which $E(\operatorname{KG}_{n,k}[\mathcal{B}^i_j])\neq\varnothing$ and $\mathcal{C}_i$ to be the set of vertices in $\mathcal{A}^i$ which are adjacent to $A^i_j$ for some $j\in[m_{i}]$. Clearly, in view of how the $(A^i_j,B^i_j)$'s are chosen, we have $E(\operatorname{KG}_{n,k}[\mathcal{B}^i_{m_i}\setminus N(A^i_{m_i})])=\varnothing$. Hence, $$\mathcal{A}^i\setminus \mathcal{C}^i=\mathcal{B}^i_{m_i}\setminus N(A^i_{m_i})$$ is an independent set of $\operatorname{KG}_{n,k}$. Accordingly, $|\mathcal{C}^i|\geq \ell(\mathcal{A}^i)$. Now, it is clear that there is a vertex $A^i\in \{A^i_1,\ldots,A^i_{m_i}\}$ such that $$\deg(A^i)\geq {|\mathcal{C}^i|\over m_i}\geq {\ell(\mathcal{A}^i)\over m_i}.$$ If $E(\operatorname{KG}_{n,k}[\mathcal{A}^{i}\setminus \{A^{i}\}])\neq\varnothing$, then define $\mathcal{A}^{i+1}=\mathcal{A}^{i}\setminus \{A^{i}\}$. Let $p$ be the maximum index for which $\mathcal{A}^p$ is defined, i.e. $E(\operatorname{KG}_{n,k}[\mathcal{A}^p\setminus \{A^p\}])=\varnothing$. Note that $p\geq \ell(\mathcal{A})$. In view of the definition of $A^i$'s, we have $$\begin{array}{lll} |E(\operatorname{KG}_{n,k}[\mathcal{A}])| & \geq & \sum\limits_{i=1}^{p} {\ell(\mathcal{A}_i)\over m_i}\\ & \geq & \sum\limits_{i=1}^{\ell(\mathcal{A})} {\ell(\mathcal{A})-i+1\over m}\\ & \geq & {\ell(\mathcal{A})(\ell(\mathcal{A})+1)\over 2m}, \end{array}$$ where $m=\max_{i\geq1} m_i$. To finish the proof, it is enough to show that $m \leq {2k-1\choose k-1}$. For $m_i+1\leq j\leq 2m_i$, set $A^i_j=B^i_{2m_i-j+1}$ and $B^i_j=A^i_{2m_i-j+1}$. One can verify that the family $$\left\{(A^i_1,B^i_1),\ldots,(A^i_{2m_i},B^i_{2m_i})\right\}$$ satisfies the condition of Theorem~\ref{skew}. Consequently, we must have $2m_i\leq {2k\choose k}$ or equivalently, $m_i\leq {2k-1\choose k-1}$. Therefore, for each $i$, we have $m_i\leq {2k-1\choose k-1}$, as requested. \end{proof} We are now in a position to present the proofs of Theorems~\ref{thm:EKR},~\ref{HilMilnew} and~\ref{thm:hiltontype}. \begin{proof}[Proof of Theorem~{\rm\ref{thm:EKR}}] The case $t=1$ has been already known to be true by the Erd{\H o}s-Ko-Rado theorem. For $t\geq 2$, we prove the following statement which implies the theorem, immediately. \\ \begin{changemargin}{1cm}{1cm} \noindent{\it Under the assumptions of Theorem~{\rm\ref{thm:EKR}}, if $\mathcal{A}\subseteq {[n]\choose k}$ is an $(s,t)$-union intersecting family where $t\geq 2$ and $|\mathcal{A}|\geq {n-1\choose k-1}+s-1$, then $|\mathcal{A}|= {n-1\choose k-1}+s-1$ and $\ell(\mathcal{A})= s-1$. In other words, $\mathcal{A}$ is the union of a star $\mathcal{S}_i$ and $s-1$ vertices from ${[n]\choose k}\setminus \mathcal{S}_i$.} \end{changemargin} \vspace{.5cm} First note that by the Erd{\H o}s-Ko-Rado theorem, we already have $\ell(\mathcal{A})\geq s-1$. Furthermore, if we prove that $\ell(\mathcal{A})= s-1$, then it implies $|\mathcal{A}|= {n-1\choose k-1}+s-1$ as well. For a contradiction, suppose that $\ell(\mathcal{A})\geq s.$ Without loss of generality, we can assume that $|\mathcal{A}|={n-1\choose k-1}+s-1$. To see this, if $|\mathcal{A}^*|={n-1\choose k-1}$, then consider $\mathcal{A}'\subseteq \mathcal{A}$ such that $|\mathcal{A}^*\setminus \mathcal{A}'|=1$ and $|\mathcal{A}'|={n-1\choose k-1}+s-1$; otherwise, consider $\mathcal{A}'\subseteq \mathcal{A}$ such that $\mathcal{A}^*\subseteq \mathcal{A}'$ and $|\mathcal{A}'|={n-1\choose k-1}+s-1$. Note that $\mathcal{A}'$ satisfies the conditions of aforementioned statement and we can thus work with $\mathcal{A}'$ instead of $\mathcal{A}$. For simplicity of notation, set $L={n-1\choose k-1}$, $M={n-1\choose k-1}-{n-k-1\choose k-1}$ and $R={2k\choose k}$. \begin{claim}\label{alphaKG[A]} $\alpha(\operatorname{KG}_{n,k}[\mathcal{A}])\leq sM+t-1$. \end{claim} \begin{proof} For a contradiction, let $\mathcal{B}$ be an independent set of $\operatorname{KG}_{n,k}[\mathcal{A}]$ with $|\mathcal{B}|\geq sM+t$. In view of the Hilton-Milner theorem, there is some $i$ for which $\mathcal{B} \subseteq \mathcal{S}_i$. Now, we consider $C_1,\ldots,C_s\in \mathcal{A}\setminus \mathcal{B}$ (this is possible since $\ell(\mathcal{A})\geq s$). Now, it is clear that there are at least $t$ elements $B_1,\ldots,B_t$ in $\mathcal{B}$ such that each of $B_i$'s is adjacent to each of $C_j$'s contradicting the fact that $\mathcal{A}$ is $(s,t)$-union intersecting. \end{proof} In view of Claim~\ref{alphaKG[A]}, $\ell(\mathcal{A})= |\mathcal{A}|-\alpha(\operatorname{KG}_{n,k}[\mathcal{A}])\geq L-sM-t+1$. Note that $$\begin{array}{lll} L-sM-t+1&\geq& L-sk{n-2\choose k-2}-t+1\\ &&\\ &=&\Big(1-{sk(k-1)\over n-1}-{t-1\over L}\Big)L. \end{array}$$ Using Lemma~\ref{lem:1} and the fact that $R={2k \choose k}\leq 2^{2k-1}$, we have $$|E(\operatorname{KG}_{n,k}[\mathcal{A}])|\geq {\ell(\mathcal{A})^2\over R}\geq{(1-{sk(k-1)\over n-1}-{t-1\over L})^2L^2\over R}\geq{(1-{sk(k-1)\over n-1}-{t-1\over L})^2L^2\over 2^{2k-1}}.$$ On the other hand, in view of the discussion before the statement of Theorem~\ref{thm:EKR}, we know that $\operatorname{KG}_{n,k}[\mathcal{A}]$ contains no $K_{s,t}$ subgraph. Consequently, Inequality~\ref{bipartiteturan} implies that $$|E(\operatorname{KG}_{n,k}[\mathcal{A}])|\leq ({1\over 2}+{s-1\over{L^{1-{1\over s}}}}){\sqrt[s]{t-1}}L^{2-{1\over s}}\leq {\sqrt[s]{t-1}}L^{2-{1\over s}}.$$ Thus, we should have $$({1-{sk(k-1)\over n-1}-{t-1\over L}})^2\leq {2^{2k-1}} {\sqrt[s]{t-1}\over L^{1\over s}},$$ which implies $${1-{sk(k-1)\over n-1}-{t-1\over L}}\leq {2^{k-{1\over 2}}} {\sqrt[2s]{t-1}\over L^{1\over 2s}}.$$ Accordingly, if $n-1\geq \max \{2(sk(k-1)+t-1), 2^{2s(1+{3\over 2k-2})}(t-1)^{1\over k-1}(k-1) \}$, then the left hand side of inequality is at least $1\over 2$ and moreover by using the inequality $L={n-1\choose k-1}\geq ({n-1\over k-1})^{k-1}$ the right hand side is less than half, a contradiction. \end{proof} \begin{proof}[Proof of Theorem~{\rm\ref{HilMilnew}}] For a contradiction, suppose that $\mathcal{A}$ is not contained in any star. Since $|\mathcal{A}|\geq {n-1\choose k-1}-{n-k-1\choose k-1}+2$, there must be some disjoint pair in $\mathcal{A}$, i.e., $\operatorname{KG}_{n,k}[\mathcal{A}]$ has at least one edge. Choose $A_1\in \mathcal{A}_1=\mathcal{A}$ and $B_1\in N(A_1)$. For each $i\geq 2$, set $\mathcal{A}_i=\mathcal{A}_{i-1}\setminus N(A_{i-1})$ and until $E(\operatorname{KG}_{n,k}(\mathcal{A}_{i}))\neq\varnothing$, choose $A_i\in \mathcal{A}_{i}$ and $B_i\in N(A_i)$. Let $m$ be the largest index $i$ for which $E(\operatorname{KG}_{n,k}(\mathcal{A}_{i}))\neq\varnothing$. For $m+1\leq j\le 2m$, set $A_j=B_{2m_i-j+1}$ and $B_j=A_{2m_i-j+1}$. It can be verified that $\{(A_1,B_1),\ldots,(A_{2m,}B_{2m})\}$ satisfies the condition of Theorem~\ref{skew} for $l=k$. Therefore, we must have $2m\leq {2k\choose k}$ and consequently $m\leq {2k-1\choose k-1}$. Set $$\mathcal{C}=\Big\{C\in\mathcal{A}| {\rm there\,\, is\,\, some\,\,} i\leq m\,\,{\rm such\,\, that}\,\, C\cap A_i=\varnothing\Big\}.$$ In other words, $\mathcal{C}$ is the set of all neighbors of $\{A_1,\ldots,A_m\}$. Since $\Delta(\operatorname{KG}_{n,k}[\mathcal{A}])\leq t-1$, we have $|\mathcal{C}|\leq (t-1)m.$ Note that $\mathcal{A}\setminus \mathcal{C}$ in an independent set of $\operatorname{KG}_{n,k}$. Indeed, since $m$ is the largest index for which $E(\operatorname{KG}_{n,k}(\mathcal{A}_{i}))\neq\varnothing$, we must have $E(\operatorname{KG}_{n,k}(\mathcal{A}_{m}\setminus N(A_m)))=\varnothing$. But, in view of the definition of $A_i$'s, it is clear that $\mathcal{A}\setminus \mathcal{C}=\mathcal{A}_{m}\setminus N(A_m)$. If $|{ \mathcal{A}\setminus \mathcal{C}}|\geq {n-1\choose k-1}-{n-k-1\choose k-1}+t$, then $B_1$ has at least $t$ neighbors in $\mathcal{A}\setminus \mathcal{C}$, which is not possible. Accordingly, $|{ \mathcal{A}\setminus \mathcal{C}}|\leq {n-1\choose k-1}-{n-k-1\choose k-1}+t-1$ and consequently, $$ \begin{array}{lll} |\mathcal{A}| & = & |\mathcal{C}|+|\mathcal{A}\setminus \mathcal{C}|\\ & \leq & (t-1) {2k-1\choose k-1}+{n-1\choose k-1}-{n-k-1\choose k-1}+t-1, \end{array}$$ which is impossible. First, note that $n\geq {3k\over2}(1+(t-1+{t\over {2k-1\choose k-1}})^{1\over{k-1}})$. To complete the proof, it suffices to show that $${n-1\choose k-1}-{n-k-1\choose k-1}+(t-1){2k-1\choose k-1}+t\leq {n-1\choose k-1},$$ or equivalently, $$t-1+{t\over {2k-1\choose k-1}}\leq\prod_{i=1}^{k-1}\frac{n-k-i}{2k-i}.$$ Since $\prod_{i=1}^{k-1}\frac{n-k-i}{2k-i}\geq (\frac{2n-3k}{3k})^{k-1}$, the proof will be completed if $$t-1+{t\over {2k-1\choose k-1}}\leq(\frac{2n-3k}{3k})^{k-1}$$ which clearly holds. \end{proof} \begin{proof}[Proof of Theorem~{\rm\ref{thm:hiltontype}}] Without loss of generality, we may assume that $|\mathcal{A}|=\lceil (s+\beta)M\rceil$. We shall distinguish the following cases. \begin{itemize} \item $\ell(\mathcal{A})> \beta M-t$. Using Lemma~\ref{lem:1}, we have $$|E(\operatorname{KG}_{n,k}[\mathcal{A}])|\geq {\ell(\mathcal{A})^2\over R}=O(|\mathcal{A}|^2).$$ Since every $K_{s,t}$-free graph with $m$ vertices has at most $c(t)m^{2-{1\over t}}+o(m^{2-{1\over t}})$ edges, we deduce that $\operatorname{KG}_{n,k}[\mathcal{A}]$ has some $K_{s,t}$ provided that $n$ is sufficiently large. \\ \item $s\leq \ell(\mathcal{A})=|\mathcal{A}|-|\mathcal{A}^*|\leq\beta M-t$. It implies that $|\mathcal{A}^*|\geq |\mathcal{A}|-\beta M+t=sM+t$ and consequently, $\mathcal{A}^*$ is trivially intersecting (contained in a star). Each $s$ vertices in $\mathcal{A}-\mathcal{A}^*$ have at least $|\mathcal{A}^*|-sM\geq t$ common neighbors in $\mathcal{A}^*$, which completes the proof. \end{itemize} \end{proof} \section*{Acknowledgements} We would like to thank Alex Scott for pointing out references~\cite{HavWood2014,ScottWilmer14}. \def$'$} \def\cprime{$'${$'$} \def$'$} \def\cprime{$'${$'$}
\section{Introduction} Let $G \curvearrowright X$ be a continuous action of a countable discrete group on a compact Hausdorff space. This action is said to be {\em proximal} if for any $x,y \in X$ there exists a net $\{g_i\}$ in $G$ such that $\lim_i g_i x=\lim_i g_i y$. $G$ is said to be {\em strongly amenable} if every such proximal action of $G$ has a fixed point. Glasner introduced these notions in~\cite{glasner1976proximal}, and proved a number of results: he showed that every virtually nilpotent group is strongly amenable, and that non-amenable groups are not strongly amenable. He also gave some examples of amenable groups that are not strongly amenable.\footnote{Glasner attributes one of these examples to Furstenberg.} Since then, a number of papers have studied strong amenability~\cites{glasner1983proximal, glasner2002minimal, melleray2015polish, hartman2016thompson, dai2017universal}, but none have made significant progress on relating it to other group properties. Our main result is a characterization of strongly amenable groups. Recall that a group has the infinite conjugacy class property (ICC) if each of its non-trivial elements has an infinite conjugacy class. \begin{maintheorem} \label{thm:main} A countable discrete group is strongly amenable if and only if it has no ICC quotients. In particular, a finitely generated group is strongly amenable if and only if it is virtually nilpotent. \end{maintheorem} For example, this implies that the group $S_\infty$ of finite permutations of $\mathbb{N}$ is not strongly amenable. Likewise, the alternating subgroup of $S_\infty$ is not strongly amenable, as is every infinite simple group. Groups that have no ICC quotients---which by Theorem~\ref{thm:main} are exactly the strongly amenable groups---are also known as {\em hyper-FC-central}~\cite{mclain1956remarks} or {\em hyper-FC}~\cite{duguid1960class}. This implies that subgroups of strongly amenable countable discrete groups are again strongly amenable. A finitely generated group is hyper-FC if and only if it is virtually nilpotent~\cite{mclain1956remarks,duguid1960class}\footnote{For a self-contained proof see~\cite{frisch2018virtually}.}, from which the second part of the theorem follows. The case of groups with no ICC quotients is a straightforward consequence of Glasner's work. To prove that groups with ICC quotients are not strongly amenable, we consider an ICC group $G$, and a certain class of symbolic dynamical systems for $G$. Using a topological genericity argument, we show that in this class there is a proximal action without a fixed point. In light of Theorem~\ref{thm:main}, it is natural to ask whether, in some larger class of topological groups, a group is strongly amenable if and only if each of its quotients has a non-trivial element with a compact (or perhaps precompact) conjugacy class. \subsection*{The strongly amenable radical, the universal minimal proximal action, and the group von Neumann algebra} One can define the {\em FC-series} of a group $G$ as $$1\leq F_1\leq F_2 \leq \cdots \leq F_\alpha \leq \cdots \leq G,$$ where $F_{\alpha+1}/F_\alpha$ is the normal subgroup of $G/F_\alpha$ consisting of the elements of the finite conjugacy classes, and $F_\beta = \cup_{\alpha<\beta} F_\alpha$ for $\beta$ a limit ordinal~\cites{haimo1953FC, mclain1956remarks}. The group $\cup_\alpha F_\alpha$ is called the {\em hyper-FC-subgroup} of $G$. Note that the hyper-FC-subgroup of $G$ is in fact the {\em strongly amenable radical} of $G$, i.e. the largest normal strongly amenable subgroup of $G$. In ~\cite[Section II.4]{glasner1976proximal} Glasner defines the universal minimal proximal action of a group $G$; this is the unique minimal proximal action of $G$ which has every minimal proximal action as a factor. We denote this action by $G\curvearrowright \partial_p G$. In Proposition~\ref{prop:faithful} we show that every ICC group has a minimal proximal faithful action. On the other hand, the proof of Proposition~\ref{prop:non-icc} shows that the strongly amenable radical of $G$ acts trivially on $\partial_p G$. Combining these gives us: \begin{corollary} \label{cor:kernel} For a countable discrete group $G$, $\ker(G\curvearrowright \partial_p G)$ is equal to the strongly amenable radical of $G$. \end{corollary} Glasner also defines the universal minimal {\em strongly proximal} action of a group $G$, which is the unique minimal strongly proximal action of $G$ which has every minimal strongly proximal action as a factor\footnote{A topological action $G \curvearrowright X$ is {\em strongly proximal} if for each Borel probability measure $\mu$ on $X$ there exists a net $\{g_i\}$ such that $\lim_i g_i\mu$ is a point mass.}. We denote this action by $G \curvearrowright \partial_s G$. Furman~\cite[Proposition 7]{furman2003minimal} shows that the kernel of $G \curvearrowright \partial_s G$ is the amenable radical of $G$. Thus Corollary~\ref{cor:kernel} is the analogous statement, for strong amenability. It is known that the group von Neumann algebra of a group $G$ has a unique tracial state iff $G$ is ICC, and we show that ICC groups are precisely the groups with faithful universal minimal proximal actions. We thus have the following dynamical characterization of the unique trace property of the group von Neumann algebra: \begin{corollary} \label{cor:von Neumann unique trace} For a countable discrete group $G$, the following are equivalent: \begin{enumerate} \item The group von Neumann algebra of $G$ has a unique tracial state. \item $G\curvearrowright \partial_p G$ is faithful. \end{enumerate} \end{corollary} Analogously, it has been recently shown by Breuillard, Kalantar, Kennedy, and Ozawa~\cite[Corollary 4.3]{breuillard2017c} that the reduced $\mathrm{C}^*$-algebra of $G$ has a unique tracial state if and only if $G \curvearrowright \partial_s G$ is faithful. Following this analogy raises an interesting question. We know from~\cite[Theorem 1.5]{kalantar2017boundaries} that simplicity of the reduced $\mathrm{C}^*$-algebra of a group $G$ is equivalent to the freeness of $G\curvearrowright \partial_s G$. We also know from~\cite[Corollary 4.3]{breuillard2017c} that unique trace property of the reduced $\mathrm{C}^*$-algebra of a group $G$ is equivalent to faithfulness of $G\curvearrowright \partial_s G$. On the other hand, for von Neumann algebras, simplicity and the unique trace property are equivalent. So it is natural to ask whether freeness of $G\curvearrowright \partial_p G$ is equivalent to its faithfulness. \subsection*{Acknowledgments} We would like to thank Benjamin Weiss for correcting a mistake in an earlier draft of this paper. We would also like to thank Yair Hartman and Mehrdad Kalantar for drawing our attention to the relation of our results to the unique trace property of group von Neumann algebras. \section{Overview of the proof of Theorem~\ref{thm:main}} That a group with no ICC quotients is strongly amenable follows immediately from from the following proposition. \begin{proposition} \label{prop:non-icc} Let $G$ be a countable discrete group that acts faithfully, minimally and proximally on a compact Hausdorff space $X$. Then each non-trivial element of $G$ has an infinite conjugacy class. \end{proposition} \begin{proof} Let $g$ be a non-trivial element of $G$. Assume by contradiction that $g$ has a finite conjugacy class. Let $H$ be the centralizer of $g$, so that $H$ has finite index in $G$. By~\cite[Lemma 3.2]{glasner1976proximal} $H$ acts proximally and minimally on $X$. Since $g$ is in the center of $H$, it acts trivially on $X$, by~\cite[Lemma 3.3]{glasner1976proximal}. This contradicts the assumption that the action in faithful. \end{proof} Thus, to prove Theorem~\ref{thm:main}, we consider any $G$ that is ICC, and prove that it has a proximal action that does not have a fixed point. This is without loss of generality, since if $G$ has a proximal action without a fixed point, then so does any group that has $G$ as a quotient. \subsection{Existence by genericity} Our general strategy for the proof of Theorem~\ref{thm:main} is to consider a certain space $\mathcal{S}$ of non-trivial actions of $G$. We show that this space includes a proximal action without a fixed point by showing that, in fact, a {\em generic} action in this space is minimal and proximal. Genericity here is in the Baire category sense. To define the space $\mathcal{S}$, let $A$ be a finite alphabet of size at least 2. The {\em full shift} $A^G$, equipped with the product topology, is a space on which $G$ acts continuously by left translations. Enumerate elements of $G = \{g_1, g_2, \ldots \}$ and endow $A^G$ with the metric $d(\cdot,\cdot)$ given by $d(s,t)=1/k$ where $k=\inf\{n \,:\, s(g_n)\neq t(g_n)\}$. An element of $A^G$ is called a {\em configuration}. The closed, $G$-invariant non-empty subsets of $A^G$ are called {\em shifts}. The space of shifts is endowed with the subspace topology of the Hausdorff topology (or Fell topology) on the closed subsets of $A^G$. This topology is also metrizable: take, for example, the metric that assigns to a pair of shifts $S,T \subseteq A^G$ the distance $1/(n+1)$, where $n$ is the largest index such that $S$ and $T$ agree on $\{g_1,\ldots,g_n\}$; by agreement on a finite $X\subseteq G$ we mean that the restriction of the configurations in $S$ to $X$ is equal to the restrictions of the configurations in $T$ to $X$. Note that for any shift $S\subseteq A^G$, the sets of the form $\{T\subseteq A^G \:|\: T \text{ agrees with } S \text{ on } X\}$ for different finite subsets $X\subseteq G$ form a basis of the neighborhoods for $S$. We define the space $\mathcal{S}$ to be the closure, in the space of shifts, of the strongly irreducible shifts, with the $|A|$ trivial (i.e., singleton) shifts removed. Strongly irreducible shifts are defined as follows: \begin{definition} A shift $S\subseteq A^G$ is said to be strongly irreducible if there exists a finite $X\subseteq G$ including the identity such that for any two subsets $E_1,E_2 \subseteq G$ with $E_1 X \cap E_2 X = \emptyset$ and any two configurations $s_1,s_2\in S$ there is a configuration $s\in S$ such that $s$ restricted to $E_1$ equals $s_1$ restricted to $E_1$, and $s$ restricted to $E_2$ equals $s_2$ restricted to $E_2$. \end{definition} To show that the proximal actions are generic in $\mathcal{S}$, we define $\varepsilon$-proximal actions; proximal actions will be the actions which are $\varepsilon$-proximal for each $\varepsilon>0$. \begin{definition} An action $G \curvearrowright X$ on a compact metric space with metric $d(\cdot,\cdot)$ is $\varepsilon$-proximal if for all $x,y \in X$ there exists a $g \in G$ such that $d(g x,g y) < \varepsilon$. \end{definition} To show that minimal actions are generic in $\mathcal{S}$, we similarly define the notion of $\varepsilon$-minimality. \begin{definition} An action $G \curvearrowright X$ on a compact metric space with metric $d(\cdot,\cdot)$ is $\varepsilon$-minimal if for all $x,y\in X$ there exists a $g\in G$ such that $d(g x, y)<\varepsilon$. \end{definition} A subset of a topological space is generic (in the Baire category sense) if it contains a dense $G_\delta$. To prove our main result, we show that the proximal actions are a dense $G_\delta$ in $\mathcal S$. The proof of density is the main challenge of this paper, while proving that this subset is a $G_\delta$ is straightforward. \begin{claim} \label{clm:G-delta} The set of $\varepsilon$-proximal shifts is an open set in $\mathcal S$. Thus the set of proximal shifts is a $G_\delta$ set in $\mathcal S$. Similarly, the set of $\varepsilon$-minimal shifts is an open set in $\mathcal{S}$. Thus the set of minimal shifts is a $G_\delta$ set in $\mathcal{S}$. \end{claim} The Baire Category Theorem guarantees that for well behaved spaces (such as our locally compact space $\mathcal S$), a countable intersection of dense open sets is dense. Thus, to prove that the proximal shifts are dense in the closure of the strongly proximal shifts, it suffices to show that the $\varepsilon$-proximal shifts are dense in $\mathcal S$ for each $\varepsilon$. That is, fixing $\varepsilon$, we must show that for each strongly irreducible subshift $S \subseteq A^G$ and each finite subset $X \subseteq G$ there exists a strongly irreducible subshift $S'$ that agrees with $S$ on $X$, and is $\varepsilon$-proximal. To this end, we construct a class of subshifts of $\{0,1\}^G$ (which we denote by $2^G$) which are $\varepsilon$-proximal. Furthermore, for these shifts $\varepsilon$-proximality is witnessed by a particular configuration around the origin: one having a 1 at the origin, and zeros close to it. For a finite symmetric subset $X \subset G$ and $g,h \in G$ we say that $g$ and $h$ are {\em $X$-apart} if $g^{-1}h \not \in X$. \begin{definition} Let $X$ be a finite symmetric subset of $G$. A shift $S \subset 2^G$ is an {\em $X$-witness} shift if \begin{enumerate} \item For each $s \in S$, $s(a)=1$ and $s(b)=1$ implies that $a$ and $b$ are $X$-apart. \item For each $s,t \in S$ there exists an $a \in G$ such that $s(a)=t(a)=1$. \end{enumerate} \end{definition} The construction of $X$-witness shifts in Propositions~\ref{prop:r-witness for finite sets} and~\ref{prop:r-witness si} contains the main technical effort of this paper. \subsection{A toy example} \label{sec:informal} To give the reader some intuition and explain the role of ICC in the construction of $X$-witness shifts, we now explain how to construct a single configuration in $2^G$ with an $X$-witness {\em orbit}, and show that such configurations do not exist for groups that are not ICC. Note that the closure of this orbit is not necessarily an $X$-witness shift; the construction of $X$-witness shifts requires more work and a somewhat different approach, which we pursue later, in the formal proofs. Given a configuration $u \in 2^G$, we denote by $G u = \{g u\,:\, g \in G\}$ the $G$-orbit of $u$. Given a finite symmetric $X \subset G$, we say that a configuration $u\in 2^G$ is an {\em $X$-witness configuration} if \begin{enumerate} \item For each $s \in G u$, $s(a)=1$ and $s(b)=1$ implies that $a$ and $b$ are $X$-apart. \item For each $s,t \in G u$ there exists an $a \in G$ such that $s(a)=t(a)=1$. \end{enumerate} We now informally explain that when $G$ is ICC then for every such $X$ there exist $X$-witness configurations, and that when $G$ is not ICC then there such an $X \subset G$ for which there are no such configurations. Suppose first that $G$ is not ICC. Then there cannot exist an $X$-witness shift for every $X$. To see this, suppose that $g\in G$ is an element with finitely many conjugates, and let $X$ be a finite symmetric subset of $G$ that contains all the conjugates of $g$. Assume towards a contradiction that there exists an $X$-witness configuration $u$. So, by the second property of $X$-witness configurations, there exists an $a\in G$, such that $[gu](a)=u(a)=1$, which means $u(g^{-1}a)=u(a)=1$. Now, by the first property of $u$, we need to have that $g^{-1}a$ and $a$ are $X$-apart, which means $(g^{-1}a)^{-1}a = a^{-1}ga \notin X$. This is a contradiction, since we let $X$ contain all the conjugates of $g$. Consider now the case that $G$ is ICC. Given a finite symmetric $X$, we choose a random configuration $u \in 2^G$ as follows. Assign to each element of $G$ an independent uniform random variable in $[0,1]$. Let $V_a$ be the random variable corresponding to $a\in G$. For each $a\in G$, let $u(a) = 1$ iff $V_a > V_{a x}$ for all $x\in X\setminus \{e\}$; i.e., $u(a)=1$ if $V_a$ is maximal in its $X$-neighborhood. Note that if $g$ and $h$ are $X^2$-apart then the event $u(g)=1$ and the event $u(h)=1$ are independent. We claim that $u$ is, with probability one, an $X$-witness shift. By construction $u$ almost surely satisfies the first property: if $s = g^{-1} u$ and $s(a)=s(b)=1$ then $u(g a)=u(g b)=1$, hence $g a$ and $g b$ are $X$-apart, and so $a$ and $b$ are $X$-apart. To satisfy the second property, it must hold that for every $g \neq h \in G$ there is some $a \in G$ such that $u(ga) = u(ha)=1$. By the ICC property, we can choose an $a \in G$ to make $g a$ and $h a$ arbitrarily far apart, as this corresponds to finding an $a$ such that $a^{-1} (h^{-1}g) a$ is large. For such a choice of $a$, the events $u(g a)=1$ and $u(h a)=1$ are independent, and, since we have infinitely many such $a$'s that we can use, with probability one at least one of them will give us the desired result. \subsection{Constructing $X$-witness shifts} We now return to the construction of $X$-witness shifts, which are the main tool in our proof of Theorem~\ref{thm:main}. The first step is to construct a single configuration which is an $X$-witness in a large finite set. \begin{proposition} \label{prop:r-witness for finite sets} Let $G$ be an ICC group. For each finite symmetric $X \subset G$ there exists an $s \in 2^G$ and a finite symmetric $Y \supset X$ such that \begin{enumerate} \item For every $a,b \in G$, if $s(a)=s(b)=1$ then $a$ and $b$ are $X$-apart. \item For every $g,h \in Y^{100}$ there exists some $a \in Y$ such that $s(g a) = s(h a) = 1$. \end{enumerate} \end{proposition} The proof of this proposition---along with Proposition~\ref{prop:r-witness si} below---contains the main technical effort of this paper. The proof elaborates on the ideas of the informal construction of \S\ref{sec:informal}: we choose the configuration $s$ at random, and then show that it has the desired properties with positive probability. This stage crucially uses the assumption that the group is ICC, which translates to independence of some events that arise in the analysis of this random choice. This is the only step in the proof of Theorem~\ref{thm:main} in which we use the ICC property of $G$. We use the configuration constructed in Proposition~\ref{prop:r-witness for finite sets} to construct $X$-witness shifts. These shifts will additionally (and importantly) be strongly irreducible. \begin{proposition} \label{prop:r-witness si} Let $G$ be a group for which, for each finite symmetric $X \subset G$, there exists a configuration that satisfies the conditions of Proposition~\ref{prop:r-witness for finite sets}. Then for each such $X$ there also exists a strongly irreducible $X$-witness shift. \end{proposition} The combination of Propositions~\ref{prop:r-witness for finite sets} and~\ref{prop:r-witness si} immediately yields the following. \begin{proposition} \label{prop:r-witness si amenable icc-rf} Let $G$ be an ICC group. Then for each finite symmetric $X \subset G$ there exists a strongly irreducible $X$-witness shift $S \subset 2^G$. \end{proposition} \subsection{$\varepsilon$-proximal shifts} Finally, we use these strongly irreducible $X$-witness shifts to construct approximations to a given strongly irreducible shift $S$ that are both $\varepsilon$-proximal and $\varepsilon$-minimal. \begin{proposition} \label{prop:eps-proximal approx} Let $G$ be a group for which there exists, for each finite symmetric $X \subset G$, a strongly irreducible $X$-witness shift. Let $T \subseteq A^G$ be a strongly irreducible shift. Then for each $\varepsilon$ and finite $X\subset G$ there exists a strongly irreducible shift $T' \subseteq 2^G$ that is $\varepsilon$-proximal, $\varepsilon$-minimal, and agrees with $T$ on $X$. \end{proposition} An immediate consequence of Proposition~\ref{prop:eps-proximal approx} and Claim~\ref{clm:G-delta} is the following. \begin{proposition} \label{prop:dense-G_delta} Let $G$ be an ICC group. Then there is a dense $G_\delta$ set in $\mathcal S$ for which the action $G \curvearrowright S$ is minimal and proximal. \end{proposition} In the next proposition we show that this result can be strengthened to show that a generic shift is additionally faithful. \begin{proposition} \label{prop:faithful} Let $G$ be an ICC group. Then there is a dense $G_\delta$ set in $\mathcal S$ for which the action $G \curvearrowright S$ is {\em faithful}, minimal, and proximal. \end{proposition} Given all this, the proof of our main theorem follows easily. \begin{proof}[Proof of Theorem~\ref{thm:main}] That groups with no ICC quotients are strongly amenable follows immediately from Proposition~\ref{prop:faithful}. Let $G$ be ICC. By Proposition~\ref{prop:dense-G_delta} the proximal minimal shifts are a dense $G_\delta$ in $\mathcal S$, and in particular exist, since $\mathcal S$ is non-empty (e.g., the full shift $A^G$ is strongly irreducible and non-constant). Since there are no trivial shifts in $\mathcal S$, and since non-trivial minimal shifts have no fixed points, we have proved that $G$ is not strongly amenable. \end{proof} \section{Proofs} \subsection{Proof of Proposition \ref{prop:r-witness for finite sets}} Let $G$ be an ICC group, and let $X$ be a finite, symmetric subset of $G$. We choose a random configuration $u \in 2^G$ as follows. Assign to each element of $G$ an independent uniform random variable in $[0,1]$. Let $V_a$ be the random variable corresponding to $a\in G$. For each $a\in G$, let $u(a) = 1$ iff $V_a > V_{ax}$ for all $x\in X\setminus \{e\}$. That is, let $u(a)=1$ if $V_a > V_b$ whenever $a^{-1}b\in X$ and $b\neq a$. The following claim is an immediate consequence of the definition of $u$. \begin{claim} \label{clm:independence} If $a_1,\ldots, a_n$ are $X^2$-apart\footnote{Recall that given a finite symmetric subset $X \subset G$ and $g, h \in G$, we say that $g$ and $h$ are $X$-apart if $g^{-1}h \not \in X$.} for $a_i\in G$, then $\{u(a_i)=1\}$ are independent events. \end{claim} Clearly, for all values of the random configuration, $u(a)=u(b)=1$ implies that $a^{-1}b\notin X$ for all $a,b\in G$, which means that $a$ and $b$ are $X$-apart. So the random configuration $u$ almost surely satisfies the first part of the proposition. It thus remains to find a finite symmetric subset $Y \supset X$ such that for each $g,h \in Y^{100}$ there exists some $a \in Y$ such that $u(g a) = u(h a) = 1$. The next lemma claims that there exists a subset $Y$ with certain useful properties. We use this lemma to prove our proposition, and then prove the lemma. \begin{lemma} \label{lem:Y} There exists a $Y \supset X$ with the following properties. \begin{enumerate} \item $$|Y|^{200} (1-|X|^{-2})^{|Y|/(10|X^2|+5)} < 1.$$ \item For each $g,h \in G$ there exists a subset $Y_{g,h} \subseteq Y$ with the following properties. \begin{enumerate} \item $|Y_{g,h}| \geq |Y|/(10|X^2|+5)$. \item For $y_1, y_2\in Y_{g,h}$, $g y_1$ and $h y_2$ are $X^2$-apart. \end{enumerate} \end{enumerate} \end{lemma} For $c,d,y \in G$, let $E_c$ be the event that $u(c)=1$, and let $E_{c,d}^y = E_{c y} \cap E_{d y}$. Now fix $g,h \in G$. \begin{enumerate} \item By the second property of $Y_{g,h}$, $g y$ and $h y$ are $X^2$-apart for any $y\in Y_{g,h}$. Hence $E_{gy}$ and $E_{hy}$ are independent, by Claim~\ref{clm:independence}. \item $\Pr{E_c} = 1/|X|$ for all $c\in G$. \item Combining the previous two results: $\Pr{E_{g,h}^y} = |X|^{-2}$ for all $y\in Y_{g,h}$. So $\Pr{\neg E_{g,h}^y} = 1-|X|^{-2}$. \item $E_{g,h}^y$ are independent events for different values of $y\in Y_{g,h}$. This is because $g y_1$ and $h y_2$ are $X^2$-apart for any $y_1, y_2\in Y_{a,b}$, which means $\{ E_{g y}, E_{h y} \:|\: y\in Y_{g,h}\}$ are independent events. And finally, since $E_{g,h}^y = E_{gy} \cap E_{hy}$, we get that $E_{g,h}^y$ are independent events for $y\in Y_{g,h}$. \item We say that the pair $(g, h)$ {\em fails} if $E_{g,h}^y$ does not happen for any $y\in Y_{g,h}$. So, by the previous two results, \begin{align*} \Pr{(g, h) \text{ fails}} & = \Pr{E_{g,h}^y \text{ for no } y\in Y_{g,h}} \\ & = (1-|X|^{-2})^{|Y_{g,h}|} \\ & \leq (1-|X|^{-2})^{|Y|/(10|X^2|+5)}, \end{align*} where the last inequality follows from the first property of $Y_{g,h}$. \end{enumerate} By the last inequality, union bound, and the first property of $Y$: \begin{align*} \Pr{(g,h) \text{ fails for some } g,h\in Y^{100} } & \leq |Y^{100}|^2(1-|X|^{-2})^{|Y|/(10|X^2|+5)} \\ & \leq |Y|^{200}(1-|X|^{-2})^{|Y|/(10|X^2|+5)} < 1. \end{align*} So, there is at least one configuration, say $s$, for which no $(g,h)$ fails for $g,h\in Y^{100}$. Therefore, for all $g,h\in Y^{100}$ there is an $a\in Y$ such that $s(ga) = s(ha) = 1$. So this $s$ satisfies the second part of the proposition, which concludes the proof of Proposition ~\ref{prop:r-witness for finite sets}, except the proof of Lemma~\ref{lem:Y}, to which we turn now. \begin{proof}[Proof of Lemma~\ref{lem:Y}] We call an element $g\in G$ {\em switching} if for all non-identity $x \in X^2$ we have $g^{-1} x g\notin X^2$. \begin{claim} There exists at least one switching element $g_s\in G$. \end{claim} \begin{proof} Let $C_x$ be the centralizer of $x$ for each $x\in X^2$. Then there are finitely many cosets of $C_x$, say $g^x_1 C_x, \ldots, g^x_{n_x} C_x$, such that $g^{-1}xg\in X^2$ only if $g\in g^x_i C_x$ for some $i\in \{1,\ldots,n_x\}$. So, non-switching elements are in the union of finitely many cosets of subgroups with infinite index, i.e. $g$ is non-switching only if $g\in g^x_i C_x$ for some $x\in X^2$ and some $i\in\{1,\ldots, n_x\}$. Since $G$ is ICC, each $C_x$ has infinite index in $G$. By ~\cite[Lemma 4.1]{neumann1954groups} a finite collection of cosets of infinite index does not cover the whole group $G$, so, there is at least one switching element in $G$. \end{proof} Let $g_s$ be a switching element. We can choose an arbitrarily large finite subset $Y_1\subseteq G$ which includes the identity and such that $Y_1\cap Y_1 g_s=\emptyset$. Choose such a $Y_1$ that is large enough so that $$(5 |Y_1|)^{200}(1-|X|^{-2})^{2|Y_1|/(10|X^2|+5)} < 1 \;\text{ and }\; |Y_1|\geq |X|$$ and let $Y = (Y_1\cup Y_1 g_s) \cup (Y_1\cup Y_1 g_s)^{-1} \cup X$. Note that $Y$ is symmetric and $5|Y_1| \geq |Y| \geq 2 |Y_1|$, which implies $$|Y|^{200} (1-|X|^{-2})^{|Y|/(10|X^2|+5)} < 1.$$ This establishes the first property of $Y$. Fix $g,h\in G$ with $g\neq h$. We say $y\in G$ is {\em distancing} for the pair $(g,h)$ if $gy$ and $hy$ are $X^2$-apart. \begin{claim} If $y\in G$ is not distancing for $(g,h)$ then $y g_s$ is distancing for $(g,h)$. \end{claim} \begin{proof} Since $y$ is not distancing for $(g,h)$, $(g y)^{-1}(h y) = y^{-1}g^{-1}h y \in X^2$. By the definition of a switching element $g_s^{-1} [(g y)^{-1}(h y)] g_s = (g y g_s)^{-1}(h y g_s) \notin X^2$, which means that $y g_s$ is distancing for $(g,h)$. \end{proof} By this observation, if $y_1\in Y_1$ is not distancing for $(g,h)$ then $y_1 g_s\in Y_1 g_S$ is distancing for $(g,h)$. So at least half of the elements in $Y_1 \cup Y_1 g_s$ are distancing for $(g,h)$ and thus at least one fifth of the elements in $Y$ are distancing for $(g,h)$. Let $Y'_{g,h}$ be the collection of elements in $Y$ that are distancing for $(g,h)$. We just saw that $|Y'_{g,h}|\geq |Y|/5$. Now define a graph on $Y'_{g,h}$ by connecting $y_1\neq y_2\in Y'_{g,h}$ if either $g y_1$ and $h y_2$ are not $X^2$-apart or $g y_2$ and $h y_1$ are not $X^2$-apart. Call this graph $G'_{g,h}$. Note that the degree of each $y\in Y'_{g,h}$ in $G'_{g,h}$ is at most $2|X^2|$. So, we can find an independent set of size at least $|Y'_{g,h}|/(2|X^2|+1) \geq |Y|/(10|X^2|+5)$ in $G'_{g,h}$. Call this independent set $Y_{g,h}$. \begin{claim} $|Y_{g,h}| \geq |Y|/(10|X^2|+5)$ and for $y_1, y_2\in Y_{g,h}$, we have that $g y_1$ and $h y_2$ are $X^2$-apart. \end{claim} \begin{proof} The bound on the size of $Y$ is established in the previous paragraph. To see the second property, note that in the case that $y_1 \neq y_2$, this follows from independence of $Y_{g,h}$ in $G'_{g,h}$. In the case $y_1=y_2$, it follows from the fact that all elements of $Y'_{g,h}$ are distancing for $(g,h)$ and that $Y_{g,h}\subseteq Y'_{g,h}$. \end{proof} This establishes the two properties of $Y_{g,h}$, and thus concludes the proof of the lemma. \end{proof} \subsection{Proof of Proposition~\ref{prop:r-witness si}} \begin{definition} Let $Z_1,\ldots,Z_n$ be finite subsets of $G$. A {\em $\{Z_1,\ldots,Z_n\}$-packing} is a $p\in \{Z_1,\ldots,Z_n,\emptyset\}^G$ with $h\:p(h)\cap g\:p(g)=\emptyset$ for all $g,h\in G$; note that $h\:p(h)$ and $g\:p(g)$ are each a translate, by $h$ and $g$ respectively, of some element of $\{Z_1,\ldots,Z_n,\emptyset\}$. When $p(g) \neq \emptyset$, we call the translate $g\:p(g)$ a {\em block}. \end{definition} By an abuse of notation, we use the term $Z$-packing instead of $\{Z\}$-packing when we have only one subset. \begin{definition} Let $Z_1,\ldots,Z_n$ be finite subsets of $G$. We say that a $\{Z_1,\ldots,Z_n\}$-packing $p$ is {\em saturated} if there is no $\{Z_1,\ldots,Z_n\}$-packing $p'\neq p$ such that $p(g)\neq \emptyset$ implies $p'(g)=p(g)$. \end{definition} Saturated Z-packings are packings to which one cannot add any blocks (i.e., $Z$-translates) without removing at least one (note, however, that it may be possible to add more $Z$ translates by first removing some). The proof of the following claim is standard. \begin{claim} Let $Z$ be a finite subset of $G$. The set of all saturated $Z$-packings is a shift. We denote this shift by $P_Z$. \end{claim} The following claim will be useful in the construction of strongly irreducible $X$-witness shifts. \begin{claim} \label{clm:P-Z-strongly-irreducible} $P_Z$ is strongly irreducible. \end{claim} A similar claim with a similar proof appears in~\cite[Lemma 2.2]{frisch2017symbolic}. \begin{proof} Let $X = Z \cup Z^{-1}$. Let $F_1,F_2 \subset G$ be any two subsets of $G$ that are $X^4$-apart. To prove the claim, it suffices to show that for any $p_1,p_2 \in P_Z$ there is a $p \in P_Z$ that agrees with $p_1$ on $F_1$ and with $p_2$ on $F_2$. Let $F_1' = F_1 X$ and $F_2'=F_2 X$. Then $F_1'$ and $F_2'$ are disjoint, and furthermore, if $a_1 \in F_1'$ and $a_2 \in F_2'$ then $p_1(a_1)$ and $p_2(a_2)$ are disjoint. Thus there is a packing that is equal to $p_1$ on $F_1'$ and to $p_2$ on $F_2'$. Consider the set of all such saturated packings. This set is non-empty by Zorn's Lemma. Furthermore, it is easy to see that each packing in this set agrees with $p_1$ on $F_1$, agrees with $p_2$ on $F_2$, and is saturated, i.e. is an element of $P_Z$. Thus $P_Z$ is strongly irreducible. \end{proof} We can now start the proof of proposition~\ref{prop:r-witness si}. Assume that $X$, a finite symmetric subset of $G$, is given. We now seek to construct a strongly irreducible $X$-witness shift $T$. Since $G$ satisfies proposition~\ref{prop:r-witness for finite sets}, we can let $Y$ and $s$ be a finite symmetric subset of $G$ and a configuration on $G$ that satisfy the statement of proposition~\ref{prop:r-witness for finite sets} for $X\subseteq G$. Define $\phi:P_{Y^{100}X} \times P_{YX} \to \{Y^{100}X,YX,\emptyset\}^G$ as follows. For $p_1\in P_{Y^{100}X}$ and $p_2\in P_{YX}$ let $$ \phi(p_1, p_2)(g) = \begin{cases} p_1(g) & \text{if } p_1(g)\neq \emptyset\\ p_2(g) & \text{if } p_2(g)\neq \emptyset \text{ and}\\ & \quad g\:p_2(g)\cap h\:p_1(h) = \emptyset \text{ for all } h\in G \\ \emptyset & \text{otherwise} \end{cases} $$ So $\phi$ receives a $Y^{100}X$-packing $p_1$ and a $YX$-packing $p_2$, and produces a $\{Y^{100}X, YX, \emptyset\}$-packing $\phi(p_1,p_2)$, which can be informally described as follows. Add all the blocks in $p_1$ to $\phi(p_1, p_2)$. For any block in $p_2$, if it does not intersect with any of the blocks in $p_1$, add it to $\phi(p_1, p_2)$, and otherwise ignore it. In other words, $\phi(p_1, p_2)$ consists of all the blocks in $p_1$, and all the blocks in $p_2$ that are disjoint from the blocks in $p_1$. It is easy to verify that $\phi$ is continuous and equivariant, and that $P=\phi(P_{Y^{100}X}\times P_{YX})$ is a saturated $\{Y^{100}X, YX\}$-packing. Since $P$ is a factor of a product of strongly irreducible shifts it is also strongly irreducible. Define $\psi: P\to 2^G$ by $$ [\psi(p)](g) = \begin{cases} s(h^{-1} g) & \text{if } g\in h\:Y^{100} \text{ for some } h\in G\\ & \quad \text{with } p(h) = Y^{100}X \\ s(h^{-1} g) & \text{if } g\in h\:Y \text{ for some } h\in G\\ & \quad \text{with } p(h) = YX \\ 0 & \text{ otherwise } \end{cases} $$ What $\psi$ does is produce a configuration which is 0 outside of the $X$-interior\footnote{The $X$-interiors of $Y^{100}X$ and $YX$ are $Y^{100}$ and $Y$.} of blocks, and is equal to translates of $s|_{Y^{100}}$ and $s|_Y$ inside the interior of blocks. It is again easy to see that $\psi$ is continuous and equivariant, so $T=\psi(P)$ is a strongly irreducible shift. The following claim completes the proof of proposition~\ref{prop:r-witness si}. \begin{claim} $T$ is an $X$-witness shift. \end{claim} The claim follows immediately from the following two lemmas. The first of the lemmas is straightforward from our construction, while the second is less immediate. \begin{lemma} For all $t\in T$, the $1$'s in $t$ are $X$-apart. \end{lemma} \begin{proof} Let $t\in T$ and $a,b\in G$ with $t(a)=t(b)=1$. Since $t\in T$, there is a $p\in P$ with $\psi(p)=t$. By the definition of $\psi$, since $[\psi(p)](a)=[\psi(p)](b)=1$, we get that $a\in h\:p(h)$ and $b\in g\:p(g)$ for some $h,g\in G$. If $g=h$, i.e. $a$ and $b$ are in the same block of $p$, then $s(h^{-1}a)=t(a)=1$ and $s(h^{-1}b)=t(b)=1$. But, since $s$ satisfies proposition~\ref{prop:r-witness for finite sets} (in particular, the $1$'s in $s$ are $X$-apart), $h^{-1}a$ and $h^{-1}b$ are $X$-apart, which implies $a$ and $b$ are $X$-apart. If $g\neq h$, then $h\:p(h)$ and $g\:p(g)$ are disjoint, so the $X$-interior of $h\:p(h)$ and the $X$-interior of $g\:p(g)$ are $X$-apart. We also know that $a$ is in the $X$-interior of $h\:p(h)$ and $b$ is in the $X$-interior of $g\:p(g)$. Therefore, $a$ and $b$ are $X$-apart. \end{proof} \begin{lemma} For any $t_1, t_2\in T$ there is an $a\in G$ with $t_1(a)=t_2(a)=1$. \end{lemma} \begin{proof} We essentially prove this lemma by a series of reductions. Let $t_1, t_2\in T$. So there are $p_1, p_2\in P$ with $\psi(p_1)=t_1$ and $\psi(p_2)=t_2$. Pick an $a_1\in G$ with $p_1(a_1)=Y^{100}X$. This means that $a_1^{-1}p_1$ has a block of shape $Y^{100}X$ centered at the identity. Let $p_1'=a_1^{-1}p_1$, $p_2'=a_1^{-1}p_2$, and let $t_1'=\psi(p_1')$, $t_2'=\psi(p_2')$. So, $p_1'$ has a block of shape $Y^{100}X$ centered at the identity. Since $p_2'$ is saturated, we know there is an $a_2\in Y^4$ such that either (I) $a_2$ is in the $YX$-interior of a block of shape $Y^{100}X$ in $p_2'$, or (II) $a_2$ is the center of a block of shape $YX$ in $p_2'$. Let $p_1''=a_2^{-1}p_1'$, $p_2''=a_2^{-1}p_2'$, and let $t_1''=\psi(p_1'')$, $t_2''=\psi(p_2'')$. Observe that in $p_1''$ the identity is in the $YX$-interior of a block of shape $Y^{100}X$, say $e\in k_1 Y^{99}$ for some $k_1\in G$ with $p_1''(k_1)=Y^{100}X$. Moreover, in $p_2''$ the identity is either (I) in the $YX$-interior of a block of shape $Y^{100}X$ or (II) in the center of a block of shape $YX$. \begin{figure} \includegraphics[scale=0.6,center]{prop_2_7_caseI.pdf} \caption{\label{fig:caseI}Case (I).} \end{figure} In case (I), since in $p_2''$ the identity is in the $YX$-interior of a block of shape $Y^{100}X$, $e\in k_2\:Y^{99}$ for some $k_2\in G$ with $p_2''(k_2)=Y^{100}X$. So $k_2^{-1}\in Y^{99}$. By the second part of proposition~\ref{prop:r-witness for finite sets} applied to $g=k_1^{-1}$ and $h=k_2^{-1}$, we know that there is an $a_3\in Y$ such that $s(k_1^{-1}a_3) = s(k_2^{-1} a_3) = 1$. So, by the definition of $\psi$, the fact that $k_1^{-1}a_3\in Y^{100}$, and the fact that $p_1''(k_1)=Y^{100}X$, we get $t_1''(a_3) = s(k_1^{-1} a_3) = 1$, and similarly, we get $t_2''(a_3) = s(k_2^{-1} a_3) =1$. Therefore, $t_1(a_1 a_2 a_3) = t_1''(a_3) = 1$ and $t_2(a_1 a_2 a_3) = t_2''(a_3) = 1$. Case (I) is schematically depicted in Figure~\ref{fig:caseI}. \begin{figure} \includegraphics[scale=0.6,center]{prop_2_7_caseII.pdf} \caption{\label{fig:caseII}Case (II).} \end{figure} In case (II), $p_2''(e)=YX$. Again, if we apply the second part of proposition~\ref{prop:r-witness for finite sets} to $g=k_1^{-1}$ and $b=e$, we get that there is an $a_3\in Y$ such that $s(k_1^{-1}a_3) = s(a_3) = 1$. So, by the definition of $\psi$, the fact that $k_1^{-1}a_3\in Y^{100}$, and the fact that $p_1''(k_1)=Y^{100}X$, we get $t_1''(a_3) = s(k_1^{-1} a_3) = 1$. Also, by the definition of $\psi$, the fact that $a_3\in Y$, and the fact that $p_2''(e)=YX$, we get $t_2''(a_3)=s(a_3)=1$. Therefore, $t_1(a_1 a_2 a_3)=t_1''(a_3)=1$ and $t_2(a_1 a_2 a_3) = t_2''(a_3) = 1$. Case (II) is schematically depicted in Figure~\ref{fig:caseII}. In both cases we showed there is an $a\in G$ with $t_1(a)=t_2(a)=1$. This completes the proof. \end{proof} \subsection{Proof of Proposition~\ref{prop:eps-proximal approx}} Fix $\epsilon>0$ and $X$ a finite symmetric subset of $G$. Without loss of generality, we may assume that $X$ includes the identity, and is large enough so that any two configurations that agree on $X$ have distance less than $\varepsilon$. Since $T\subseteq A^G$ is a strongly irreducible shift, there is a finite symmetric $U\subseteq G$ including the identity such that for any two subsets $E_1,E_2 \subseteq G$ with $E_1 U \cap E_2 U = \emptyset$ and any two configurations $t_1,t_2\in T$ there is a configuration $t\in T$ such that $t$ restricted to $E_1$ equals $t_1$ restricted to $E_1$, and $t$ restricted to $E_2$ equals $t_2$ restricted to $E_2$ Given a shift $S \subseteq A^G$ and a finite $Y \subset G$, we call a map $p \colon Y \to A$ a {\em $Y$-pattern of $S$} if it is equal to $s|_Y$, the restriction of some $s \in S$ to $Y$. In this case we say that $s$ contains the $X$-pattern $p$. By strong irreducibility of $T$, we can find a $u\in T$ whose orbit $\{g u\,:\, g \in G\}$ contains all the $X$-patterns of $T$. Furthermore, since there are only finitely many $X$-patterns in $S$, there must be a finite $V \subset G$ (which we assume w.l.o.g.\ to be symmetric and contain the identity) such that $\{g u\,:\, g \in \text{ the } X\text{-interior of } V\}$ contains all the $X$-patterns of $T$. By making $V$ even larger, we can assume that $d(t,t') < \varepsilon$ for any two configurations $t,t' \in T$ that agree on $V$, where $d(\cdot,\cdot)$ is the metric on $T$. Let $Z=(VU^2X)(VU^2X)^{-1}$. By the assumption in the statement, there is a strongly irreducible $Z$-witness shift for $G$. Call this shift $S$. Now, define a continuous equivariant function $\phi: S\times T \to A^G$. Let $s\in S, t\in T$. Let $t'=\phi(s,t)$ be defined as follows, in the following cases: \begin{enumerate} \item $g = k h$ for some $k\in G$ with $s(k)=1$ and some $h\in V$: In this case, let $t'(g) = u(h)$. \item $g = k h$ for some $k\in G$ with $s(k)=1$ and some $h\in VU^2\setminus V$: In this case let $E_1=kV$ and $E_2 = \text{ complement of } k VU^2$. Since $E_1 U\cap E_2 U=\emptyset$, there is a $v\in T$ with $v|_{E_1} = (ku)|_{E_1}$ and $v|_{E_2} = t|_{E_2}$. If there are multiple choices for $v$, choose the lexicographically least configuration for a fixed ordering of $G$ and a fixed ordering of $A$. Let $t'(g) = v(kh)$. \item $g\neq kh$ for $s(k)=1$ and $h\in VU^2$: In this case, let $t'(g) = t(g)$. \end{enumerate} Since the $1$'s in $S$ are $Z$-apart, this leads to a well-defined definition for $t'$. Informally, $t'$ is constructed from $t$ as follows: the configuration $t'$ mostly agrees with $t$. The first exceptions are the $V$-neighborhoods of any $k \in G$ such that $s(k)=1$, where we set $t'$ to equal the pattern that appears around the origin in $u$. The second exceptions are the borders of these $V$-neighborhoods, where some adjustments need to be made so that---as we explain below---$t'$ and $t$ agree on any translate of $X$. This construction is schematically depicted in Figure~\ref{fig:phi eps-prox approx}. \begin{figure}[t] \includegraphics[scale=0.8,center]{prop_2_9.pdf} \caption{\label{fig:phi eps-prox approx}$t'=\phi(s,t)$ for $s\in S$ and $t\in T$.} \end{figure} The following hold: \begin{itemize} \item $\phi$ is continuous and equivariant. So $T'=\phi(S\times T)$ is a subshift. \item Since strong irreducibility is closed under taking products and factors, we see that $T'$ is strongly irreducible. \item Let $t'_1 = \phi(s_1, t_1), t'_2 = \phi(s_2, t_2) \in T'$. Since $S$ is a $(VU^2X)(VU^2X)^{-1}$-witness shift, there is a $g\in G$ with $s_1(g) = s_2(g) = 1$. So, $t'_1|_{gV}$ and $t'_2|_{gV}$ are both translates of $u|_V$, which means $(g^{-1} t'_1)|_V = (g^{-1} t'_2)|_V$. So from the definition of $V$, we get $d(g^{-1}t'_1, g^{-1}t'_2) < \epsilon$. Hence $T'$ is $\epsilon$-proximal. \item Now we claim that the set of $X$-patterns of $T'$ and $T$ are equal. First notice that since $u|_V$ has all the $X$-patterns in $T$, and $u|_V$ appears in $T'$. So we get that all the $X$-patterns of $T$ appear in $T'$. Now let $t'=\phi(s,t)\in T'$ and fix an $X$-pattern in $t'$, located at $gX$. If $gX$ does not meet any $k (VU^2X)$ for $s(k)=1$, then $t'|_{g X} = t|_{g X}$ and so the pattern appears in $T$. If, on the other hand, $g X$ intersects $k (VU^2X)$ for some $k$ with $s(k)=1$, by the definition of $t'$ around $k$, we again see that the pattern in $g X$ appears in $T$. \item To see $\varepsilon$-minimality of $T'$, let $t'_1,t'_2\in T'$. We know that $t'_2|_X$ is one of the $X$-patterns in $T$, so it appears somewhere in $t'_1$, i.e. there exists a $g\in G$ such that $(g t'_1)|_X$ agrees with $t'_2|_X$. We assumed that any two configurations that agree on $X$ have distance less than $\varepsilon$. So, $d(g t'_1, t'_2)<\varepsilon$. \end{itemize} This concludes the proof of Proposition \ref{prop:eps-proximal approx}. \subsection{Proof of Claim~\ref{clm:G-delta}} First we prove proximal shifts are a $G_\delta$. Given a shift $S$, an $\varepsilon>0$ and a $g \in G$, let $P_g \subset S \times S$ be the set of pairs of configurations $s_1,s_2$ such that $d(g s_1,g s_2)<\varepsilon$. Since $P_g$ is the preimage of an open set under a continuous map $P_g$ is open. Thus, whenever $S$ is $\varepsilon$-proximal the collection $\{P_g\,:\, g \in G\}$ forms an open cover of $S \times S$ and thus, by compactness, whenever a shift is $\varepsilon$-proximal there is a finite subset $X \subset G$ which suffice to demonstrate this. For each $X \subset G$, whether $X$ demonstrates $\varepsilon$-proximality is determined by the restriction of $S$ to a finite set of elements of $G$. But this is exactly the definition of a clopen set in the topology on the space of shifts. Thus the set of $\varepsilon$-proximal shifts is the union of a collection of clopen sets and is therefore open. Now we prove minimal shifts are a $G_\delta$. To do this, since minimal shifts are exactly the shifts that are $\varepsilon$-minimal for all $\varepsilon>0$, it is enough to show that the set of $\varepsilon$-minimal shifts is open. Note that by compactness of $X$, a shift is $\varepsilon$-minimal iff its $\varepsilon$-minimality is demonstrated by a finite set. Thus $\varepsilon$-minimality is determined by the set of $Z$-patterns for a finite large enough $Z\subseteq G$. So, as above, the set of $\varepsilon$-minimal shifts is a union of clopen sets, so it is open. \subsection{Proof of Proposition~\ref{prop:faithful}} By Proposition~\ref{prop:dense-G_delta} the minimal proximal shifts are a dense $G_\delta$ in $\mathcal S$. It thus remains to be shown that faithfulness is also generic. Given an element $g\in G$ call a shift {\em $g$-faithful} if $g$ acts non-trivially on the shift. It is easy to see that $g$-faithfulness is an open condition, and so the intersection over all non-trivial $g \in G$, which is faithfulness of the action of $G$, is a $G_\delta$ set. It remains to show that it is dense. To do this we show that each non-trivial $g \in G$ acts non-trivially on every non-trivial strongly irreducible shift. Suppose $g$ is not the identity and acts trivially on a shift $S$. Then all conjugates of $g$ also act trivially on $S$, so that $hs=s$ for every $h$ a conjugate of $g$ and $s\in S$. In particular, $s(h^{-1})$ must be the same for every $h$ a conjugate of $g$ and every $s \in S$. Since $g$ has an infinite conjugacy class this holds for infinitely many such $h$. But if $S$ is strongly irreducible and non-trivial, then there is some finite $X \subset G$ such that, if $h \notin X$ then there is an $s \in S$ such that $s(h) \neq s(e)$. Thus $g$ must act non-trivially on every non-trivial strongly irreducible shift, and so we have proved the claim.
\section{Introduction} In black hole X-ray binaries, matter from the companion stars is accreted onto the black hole through stellar wind or Roche lobe, forming the accretion disk. The viscosity in the disk is thought to play an important role in transferring the angular momentum outward, so that the flow can spiral in toward the black hole and is heated up at the expense of gravitational energy. One of the observational appearances of the accretion process is the spectral energy distribution of the emitted X-rays. It is puzzling that even at a similar bolometric luminosity, a given X-ray binary can show significant difference in the spectral shapes with spectral index $\Gamma < 2$ and $\Gamma >2$, leading to the definition of the hard state and the soft state, respectively. The hard state is characterized by the high-energy Comptonization component (peaking at E $\ge$ 100 keV), which dominates over the weak, low-energy blackbody component, whereas the soft state is characterized by a strong (disk) blackbody component below $\sim$ 10 keV and a weak, high-energy tail of $\sim 25\%$ of the total bolometric luminosity (see, e.g., Gierli{\'n}ski et al. 1999; Zdziarski \& Gierli{\'n}ski 2004; Remillard \& McClintock 2006; Done, Gierli{\'n}ski, \& Kubota 2007, for the detailed review). The hard-soft spectral transitions in black hole binary outbursts have been observed with a number of X-ray satellite observatories (review in, e.g., Fender \& Belloni 2004), indicating a change in the relative contribution of the spectral components to the overall radiation. Such spectral transition can be interpreted by the truncated disk model (Meyer \& Meyer-Hofmeister 1994; Esin et al. 1997; Liu et al. 1999; R{\'o}{\.z}a{\'n}ska \& Czerny 2000; Qiao \& Liu 2012). The blackbody component is due to the thermal radiation from the geometrically thin, optically thick disk (Shakura \& Sunyaev 1973), which is truncated at a certain radius $R_{\rm tr}$ exceeding ISCO ($R_{\rm ISCO} = 6$ for $a=0$; radius is in units of the gravitational radius throughout this work), whereas the Comptonization emission arises from the hot flow interior to the disk. In the hard state, the truncation radius is tens of gravitational radii away from the black hole, and thus the disk dissipates a small fraction of gravitational energy, while most of the energy is radiated from the inner flow, as the dominant Comptonization component at high energy. As the source brightens, the truncation radius moves inward, which will increase the blackbody radiation luminosity. The hot flow will then be cooled down owing to the increased flux of soft photons from the disk, and consequently the hard X-ray tail is softened. The truncated disk model is supported by the observations of the disk receding in the soft-hard transition (Gierli{\'n}ski et al. 2008). Another observational appearance of the accretion process is the broadband X-ray variability, covering timescales from from $\le 0.01$ s to thousands of seconds (Yu et al.2003; Belloni \& Motta 2016). Fourier analysis and other techniques have been used to study the variability property. The derived power spectral density (PSD) is generally described by a broadband noise continuum with narrow peaks superimposed on this. The narrow peaks indicate quasi-periodic oscillations (QPOs) within the flow. However, the physical origin of QPOs is still under debate. As for low-frequency (1$\sim$10 Hz) quasi-periodic oscillations (LFQPOs), the possible mechanism involves the so-called Lense-Thirring precession which is due to the frame-dragging effect in the strong gravity field (see Stella \& Vietri 1998; Stella et al. 1999; see Belloni \& Motta 2016, for the reviews of other alternative QPO models). In the truncation geometry, if the flow interior to the disk misaligns with black hole spin, it will precess around spin axis at a given frequency. Since the hot flow is thought to produce hard X-ray emission via inverse Comptonization, the Lense-Thirring precession of the hot flow will result in the X-ray modulation. Motivated by this scenario, Ingram et al. (2009) incorporated the truncated model with Lense-Thirring precession to explain the observed low frequency QPOs in the X-ray variability. Besides matching the predicted QPO frequency in the Lense-Thirring precession model with the observation data, it is necessary to verify whether this precession scenario of inner flow can reproduce the observed fractional variability amplitude, which is defined as the ratio of root-mean-squared (rms) variability over mean flux. The energy-dependent fractional rms, i.e., fractional rms spectrum, was observationally explored in the literature (e.g., Rodriguez et al. 2002,2004). The energy-resolved variability enables one to decompose the contribution from different variable emission components (e.g., the disk blackbody, the Comptonization of the hot plasma, and the reflection off the disk) and hence determine how the spectral components vary with respect to each other (e.g., Sobolewska \& {\.Z}ycki 2006; Axelsson et al. 2014; Axelsson \& Done 2016, in which the fractional rms spectra were studied only for the QPOs. it is also possible to study the fractional rms over broadband Fourier frequency (Gierli{\'n}ski \& Zdziarski 2005; De Marco et al. 2015), but here we concentrate only on the fractional rms associated with QPOs. Furthermore, the fractional rms spectrum changes dramatically during the spectral transition of the binary outburst (Rodriguez et al. 2004; Sobolewska \& {\.Z}ycki 2006; Gierlinski et al. 2010). Observationally, within the energy range of $3-30$ keV, the fractional rms spectrum is constant across photon energy in the hard state, while slightly decreasing with energy in the intermediate state and increasing with energy in the soft state (Gierli{\'n}ski \& Zdziarski 2005). In Sobolewska \& {\.Z}ycki (2006), it was shown that the rms spectrum is harder than the time-averaged spectrum in the soft spectral state, while the rms spectrum is softer than the time-averaged spectrum when the source is in the hard spectral state, for some binary systems. Therefore, the acceptable model should be the one that can not only explain the origin of the variability but also, more crucially, self-consistently associate the changing of the variability pattern with the varying spectral components during the state transition of the source. In this paper, we will investigate the evolution of fractional rms spectra during the spectral transition from hard to soft state in the Lense-Thirring precession model of the truncated disk/hot inner flow. Fundamentally, since the varying X-ray radiation comes from the region where is in the strong gravitational field region, it is necessary to take the relativistic effects into account, i.e., Doppler and gravitational redshift, light bending, and the existence of black hole event horizon, which might affect the variability amplitude and the fractional rms spectrum. The combination of these relativistic corrections will reshape not only the X-ray energy spectra (You et al. 2012), but also the fractional rms spectra (Schnittman \& Rezzolla 2006; Schnittman et al. 2006). In this paper, we simulate the X-ray modulation due to the Lense-Thirring precession of the inner flow in the truncated disk geometry, within the framework of general relativity. We aim at investigating the evolution of the fractional rms spectrum as the source softens from the hard state by means of the decrease in the truncation radius. Throughout this work, the calculations of the fractional rms are integrated over all Fourier harmonics, i.e. taking the standard deviation of the flux versus QPO phase. The description of the assumed geometry of the accretion flow, as well as the setup of the Monte Carlo simulation, will be given in Sect. 2. The results of the relativistic X-ray spectra and fractional rms spectra are shown in Sect. 3. The explanation of the evolution of fractional rms spectra during the spectral transition and the influence of the relativistic effect on the variability will be discussed in Sect. 4. The main conclusions in this paper are given in Sect. 5. \section{Model} \subsection{Truncated outer disk and the precessing inner flow} In this work, the basic geometry of the accretion flow is assumed to be the truncated disk model in which the geometrically thin and optically thick disk extends from the outer radius $R_{\rm out}$ down to the truncated radius $R_{\rm tr}$. Interior to the thin disk is a geometrically thick, optically thin hot flow. This is assumed to have the shape of a torus with a trapezoid cross section and it will be referred to as the torus throughout this work. The inner radius of the torus is $R_{\rm in}$, while its outer radius coincides with the inner radius of the disk, $R_{\rm tr}$. The half-opening angle of the torus (measured from the equatorial plane) is $\theta_{\rm o}$. The schematic picture of the entire flow is shown in Fig. \ref{schematic_torus}. In the context of the Lense-Thirring precession, we assume that the black hole spin axis $J_{\rm BH}$ is tilted with respect to the symmetry axis of the outer disk $J_{\rm d}$ by $\theta_{\rm p}$, and the symmetry axis of the torus $J_{\rm t}$ misaligns with the spin axis by $\theta_{\rm t}$. Therefore, the precession of the hot flow can be manifested as $J_{\rm t}$ precessing around $J_{\rm BH}$ at some frequency. The geometry used here closely follows works by Ingram \& Done (2012), Veledina et al.(2013), and Ingram et al. (2015). Note that once the geometrical configuration is fixed, the results of the model calculation will depend on the observer position, which is defined by two angles: the polar angle, $i$, with respect to the symmetry axis of the outer disk $J_{\rm d}$, and the azimuthal angle, $\Phi_{\circ}$, with respect to the plane formed by the black hole spin axis, $J_{\rm BH}$, and the symmetry axis of the outer disk, $J_{\rm d}$. For simplicity, most of the results in this paper (e.g., Fig. \ref{spec_0p3_t15}-\ref{rms_10rg_t45} below) will be for the viewer azimuth $\Phi_{\circ} = 0$, i.e., the spin axis being directed toward the observer. The impact of the viewer azimuthal angle on the predictions of the variability property will be discussed in Sect. 4.4. \begin{figure} \includegraphics[width=\columnwidth]{schematic_torus.eps} \caption{ Schematic picture of the entire flow. The accretion flow is assumed to be the truncated at a given radius. Interior to the thin disk is a geometrically thick, optically thin hot flow, which is assumed to have the shape of a torus with a trapezoid cross section. In the context of the Lense-Thirring precession, we assume that the black hole spin axis $J_{\rm BH}$ is tilted with respect to the symmetry axis of the outer disk $J_{\rm d}$ , and the symmetry axis of the torus $J_{\rm t}$ misaligns with the spin axis. Therefore, the precession of the hot flow can be manifested as $J_{\rm t}$ precessing around $J_{\rm BH}$ at some frequency. \label{schematic_torus}} \end{figure} \subsection{Spectral state transitions} We aim at studying the evolution of spectral and variability properties during the spectral transition from the hard to soft state. In the truncated disk geometry, for given black hole mass and accretion rate, the spectral transition can be implemented by changing the truncation radius (e.g. Esin et al.\ 1997). And this will be done by the use of the \textit{eqpair} code\footnote{http://www.astro.yale.edu/coppi/eqpair/} in our work. Code \textit{eqpair} computes the electron energy distribution resulting from a balance between heating and direct acceleration of particles on one hand and cooling processes on the other. The processes considered include electron-positron pair balance, bremsstrahlung, and Compton cooling, including external soft-photon input. The final electron distribution can be hybrid and thermal/nonthermal, i.e. consisting of a Maxwellian and a power-law part. In this work we assume the purely thermal case, and the code computes the resulting plasma temperature and its optical depth. The code is described in detail in Coppi (1999). In \textit{eqpair}, the ratio of the hard to soft compactness $l_{\rm h}/l_{\rm s}$, where $l_{\rm h,\rm s} = L_{\rm h,\rm s}\sigma_{\rm T}/Rm_{\rm e}c^3$, and the soft-photon compactness $l_{\rm s}$ are the first two model parameters in approximate order of decreasing importance. At a given truncation radius $R_{\rm tr}$, the energy generation in the inner flow and outer disk is \begin{equation} Q_{\rm h} \propto \int_{R_{\rm in}}^{R_{\rm tr}} R f(R) dR, \end{equation} and \begin{equation} Q_{\rm s} \propto \int_{R_{\rm tr}}^{R_{\rm out}} R f(R) dR, \end{equation} respectively, where $f(R)$ is the energy dissipation rate per surface. It should be noted that in \textit{eqpair} the Comptonizing source is assumed to be spherical, and the seed soft photons are uniformly distributed inside this region. However, in our work the basic geometry of the flow is the inner torus plus outer truncated disk. For simplicity, let us assume the ratio of the hard to soft compactness $l_{\rm h}/l_{\rm s} \approx Q_{\rm h}/(\eta_0 Q_{\rm s})$, where $\eta_0$ is defined as the fraction of the soft-photon energy from the outer disk being intercepted by the inner hot flow. The explicit estimate of the compactness ratio requires the physical solution of the dissipated energy in the flow, which is beyond the scope of this work. In principle, $\eta_0$ mainly depends on the size of the hot flow and its relative geometry with respect to the disk. For simplicity, we further assume the phase-averaged value of $\eta_0=0.05$ (i.e., irrespective of the truncation radius and precession phase). Therefore, as the truncation radius decreases, the heating-to-cooling ratio monotonously decreases as well, so that the inner flow will be effectively cooled and the spectrum softens. Besides the compactness ratio $l_{\rm h}/l_{\rm s}$, the soft compactness $l_s$ is another important parameter that can affect the spectral properties as well. However, this parameter is hard to compute, since the geometry of the flow is not spherical in this work. Poutanen \& Coppi(1998) gave the dependencies of $l_{\rm s}$ on $R$ as \begin{equation} l_{\rm s}(R_{\rm tr}) = l_{\rm s,0}({R_{\rm tr,0}}/{R_{\rm tr}})^2, \quad\rm for\quad R_{\rm tr} < R_{\rm tr,0} \end{equation} where $l_{\rm s,0}$ is the soft compactness at $R_{\rm tr,0}$. Here we adopt the scaling relations above to compute the $l_{\rm s}$, by assuming $l_{\rm s,0} = 1$ at $R_{\rm tr,0} = 90$. Overall, under the assumptions above, both $l_{\rm h}/l_{\rm s}$ and $l_{\rm s}$ have the monotonous relations with the truncation radius. This will allow us to use the \textit{eqpair} code to simply compute the parameters of the Comptonizing plasma (optical depth $\tau_{0}$, electron temperature $T_{\circ}$) for a given $R_{\rm tr}$. And optical depth and electron temperature will be taken as input parameters in our Monte Carlo simulation to compute the X-ray energy spectrum and the associated variability in the following sections. \subsection{Monte Carlo simulation of X-ray energy spectrum} The X-ray radiation that will be simulated consists of three components: the thermal emission from the truncated disk, the hard X-ray emission from the torus, and the component due to the reprocessing of the hard X-rays from the torus in the outer disk. Both the Comptonization and reflection components contribute to the X-ray variability. The Monte Carlo code developed in this work takes the relativistic effects, e.g., light bending and gravitational redshift, into account. The relativistic thermal spectrum of thin-disk flow is produced by the Novikov \& Thorne (1973) model. For given black hole mass $M$, Eddington-scaled mass accretion rate $\dot{m} \equiv \dot{M}/\dot{M}_{\rm Edd}$, and the spin $a$, the radial flux profile $F(r)$ can be determined. The corresponding local blackbody temperature, $T(r)$, is given by the Stefan-Boltzmann law. A photon's emission radius is generated according to the $F(r)$ distribution, while its energy is generated from the Planck distribution with the temperature $T(r)$. Details of these algorithms are given in the Appendix. The remaining information of the disk soft photon is, the azimuth of the emitting position and 4-momentum. The azimuth of the emitting position is randomly generated between 0 and $2\pi$. The directions of photon 4-momentum are specified by two angles in the local frame, i.e., the azimuthal angle and the polar angle with respect to the normal of the disk. The azimuthal angle of the photon's momentum is randomly generated between 0 and $2\pi$, while the polar angle is randomly generated under the condition that the number of photons per second emitted into equal portions of solid angle depends on the polar angle. The implement for randomly generating this polar angle is given in Equations (9)-(11) in the Appendix. Relativistic ray tracing is applied to the photons emitted from the disk, computed with the use of the sim5 library.\footnote{https://github.com/mbursa/sim5 } Emitted disk photons will (i) travel to infinity (forming the observed disk spectrum), (ii) or enter the black hole event horizon (being discarded), or (iii) enter the hot flow (being upscattered by the thermal electrons). If the disk photon enters into the hot flow, it may be Compton scattered by the hot electrons. For simplicity, we assume that the entire hot flow rotates in the radius-dependent Keplerian motion and ignore the radial velocity, although this might not be the case (Czerny \& You 2016). The additional component of the flow velocity, due to precession motion, is not taken into account. Before modeling the Comptonization, the photon momentum is converted from the Boyer-Lindquist frame to the local rest frame of the torus, following Kulkarni et al. (2011). In the rest frame of the torus, the inverse Compton scattering of soft photons in the hot plasma is simulated using the standard prescriptions of Pozdnyakov et al.(1983) and Gorecki \& Wilczewski (1984; see also Janiuk et al. 2000). The code assumes uniform plasma density and temperature. At a given $R_{\rm tr}$, the plasma density can be estimated based on the derived optical depth $\tau_{0}$ in Sect. 2.2, while the electron temperature will depend on the position of the torus during the precession. It should be noted that the derived $\tau_{0}$ and $T_{\circ}$ in Sect. 2.2 are averaged values over precession phase. In principle, the ratio of heating to cooling rate is associated with the ratio of the disk luminosity intercepted by the torus to the total disk emitted luminosity, $\eta(\phi)$, which is variable as a function of precession phase. As the torus precesses, it is expected that the heating-to-cooling ratio correspondingly varies during precession phase, leading to the variation of the electron temperatures. Therefore, in order to reflect this geometrical effect of the precession on the temperature, we estimate the electron temperature $T_e(\phi)$ at each precession phase based on Equations (13) and (14) in Beloborodov (1999), for given optical depth $\tau_{\circ}$, imposing that the phase-averaged temperature matches with the derived temperature $T_{\circ}$. Relativistic ray tracing is always taken into account throughout the consecutive inverse Compton scatterings. The Comptonized photon leaving the torus can (i) be lost in the black hole; (ii) go to the infinity, forming the observed Comptonization spectrum; and (iii) enter the outer disk, being reprocessed. The reprocessed photons will produce the reflection spectrum including the iron emission line. In this paper, for simplicity, we assume that the outer disk is neutral. The reflection code in this simulation is written following prescriptions by George \& Fabian (1991) and \.{Z}ycki \& Czerny (1994). Once the photon emerges away from the disk, ray tracing is applied again, including the Doppler shift due to the Keplerian rotation of the accretion disk. In principle, the reflected photon could enter into the torus again. For simplicity, we assume that reflected photons can travel either to the black hole event horizon (being discarded) or to infinity (forming the observed reflection spectrum). The overall spectrum is modeled in the range of $10^{-3}$ to $10^3$ keV. The uncertainties are assigned assuming that the modeled photon counts within each energy bin follow a Poisson distribution. Throughout the simulations in this work, at energies $E>100$ keV the photon number count is about 400, so that the corresponding uncertainty is relatively high, $\sim 5\%$. In some cases, this leads to unconstrained values for the fractional variability amplitude, as the Monte Carlo noise becomes significant. Therefore, we limit the X-ray variability analysis to $E\leq 100$ keV. \subsection{Modulation of the X-Ray flux} Following the procedure above, we can model the X-ray energy spectrum for different geometrical configurations of the torus. The Lense-Thirring precession of the hot flow is thought to be the mechanism producing low-frequency X-ray modulations. Here we focus on the study of X-ray spectral variability as produced solely by these modulations. We compute a sequence of spectra corresponding to consecutive values of the precession phase and calculate the fractional rms amplitude of variability (van der Klis 1989; Vaughan et al. 2003) as a function of energy. In the following sections, the spectral and variability properties will be studied in detail. For simplicity, the time lags and relativistic time dilution are not taken into account. This is justified, as the precession timescale, $\sim 1\rm s$, is much longer than the photon traveling time scale of roughly milliseconds for X-ray binaries, provided that the size of the X-ray radiation region is about tens of gravitational radii (Basak \& Zdziarski 2016). Therefore, at a given $R_{\rm tr}$ the modeling strategy is as follows: \begin{enumerate} \item Computing $l_{\rm h}/l_{\rm s}$ and $l_{\rm s}$ to derive the electron temperature and Thomson optical depth. \item At given precession phase (so that the relative position of the torus with respect to the outer disk is fixed), the overall spectrum is modeled with our Monte Carlo simulation. \item Modeling the spectrum over one complete precession of the flow to derive the X-ray variability. \end{enumerate} We then repeat the three steps above for different truncation radii, to derive the evolution of both spectral and variability properties during the state transitions. The inner radius of the hot flow is rather uncertain. Magnetohydrodynamic (MHD) simulations of the precession flow indicate that the inner radius of the tilted geometrically thick flow will increase as the spin increases (Fragile et al. 2009), which is counterintuitive in the sense that the ISCO of a standard disk decreases with the black hole spin. This is due to the additional torque from the misalignment of the flow, which causes the surface density of the inner flow to dramatically decrease in the inner radii. The analytic estimate for the inner radius in this situation is given in Lubow et al.(2002), i.e., $r_i = 3.0(h/r)^{-4/5}a^{2/5}$, which is roughly consistent with the simulation results by Fragile et al.(2009). This description of the inner radius is used in Ingram (2009) to explain the independence of the low-frequency QPO on the spin. Here we also use this description so that the inner radius is approximately $R_{\rm in} = 5, 7,$ and 8 for $a = 0.3, 0.6,$ and 0.9, respectively. \section{Results} Throughout this work, we assume $M = 10M_{\sun}$, Eddington-scaled mass accretion rate $\dot{m} \equiv \dot{M}/\dot{M}_{\rm Edd} = 0.01$, and misalignment angle of the black hole spin with respect to the the symmetry axis of the disk $\theta_{\rm p} = 15^{\circ}$, while the symmetry axis of the torus with respect to the spin is tilted by $\theta_{\rm t} = 15^{\circ}$, so that at some particular precession phases the torus will align with the outer disk. Regarding the assumed misalignment angle, on one hand, the misalignment needs to be large enough to give an observable effect; on the other hand, we may not expect systems with very large misalignments to be common, since a very large one would likely disrupt the binary system. Therefore, systems that survive to become X-ray binaries may be expected to have predominantly modest misalignments (e.g. Fragos et al. 2010). A misalignment of $\sim$10$^\circ$ (Veledina et al. 2013; Ingram et al. 2015) to $\sim$15$^\circ$ (Ingram \& Done 2012) therefore seems fairly reasonable. In Fig. \ref{lsoft}, $\eta(\phi)$ and the resultant temperature $T_e(\phi)$ as a function of precession phase, for $R_{\rm tr} = 10, 30,$ and 90, are plotted, where $a=0.3$. Additionally, the dependence of $\eta(\phi)$ on the spin is shown. As the spin increases, the light-bending effect tends to focus many more disk photons toward the torus, resulting in the increase of $\eta(\phi)$. \begin{figure} \includegraphics[width=\columnwidth]{lsoft.eps} \caption{ Ratio of the disk luminosity intercepted by the inner hot flow to the total disk emitted luminosity, $\eta(\phi)$ (upper panel, in blue) and the resulting electron temperature (bottom panel, in red), as a function of precession phase, for different black hole spins and disk truncation radii. The solid, dotted, and dotted-dashed lines are for black hole spin $a = 0.3, 0.6,$ and 0.9, respectively, while the truncation radius is fixed at $R_{\rm tr} = 10$. The dashed line and crossed points are for $R_{\rm tr} = 30$ and 90, while the spin is fixed at $a = 0.3$. The changing relative geometry of the precession flow leads to the variations of $\eta(\phi)$. \label{lsoft}} \end{figure} Based on the geometrical configurations (i.e., relative geometry between the inner torus and outer truncated disk) and physical parameters (i.e., black hole spin, electron Thomson optical depth, and temperature), we are able to compute the emergent spectrum consisting of a disk, Comptonization, and reflection component as a function of the precession phase. The spectral property and energy-dependent fractional variability during the state transition will be analyzed. In the following sections, the results are divided into two classes, i.e., the half-opening angle $\theta_o = 15^{\circ}$ and $45^{\circ}$, since the realistic value is unknown. \subsection{Slim-torus case} Here we assume a half-opening angle of the torus of $\theta_{\rm o} = 15^{\circ}$. \subsubsection{Effects of varying the truncation radius} \begin{figure*} \includegraphics[width=2\columnwidth]{spec_phase_resolved_0p3_t15.eps} \caption{ Normalized radiation spectrum from the hot inner flow plus outer truncated disk for the half-opening angle of the flow $\theta_{o} = 15^{\circ}$ and the black hole spin $a=0.3$. The left, middle, and right panels are for the truncation radius $R_{\rm tr} = 90, 30,$ and 10, respectively. The top, middle, and bottom panels are for the sinusoidal value of viewing angle $\cos i$ = 0.1, 0.5, and 0.9, respectively. In each subplot, the spectra at four particular precession phases, which are separated by one-fourth of the precession period, are plotted. The phase-averaged spectrum is plotted in black. \label{spec_0p3_t15}} \end{figure*} In this subcase, we investigate the spectral and variability properties during the state transition from hard to soft state, by adopting the truncation radii $R_{\rm tr} = 90, 30,$ and 10, while black hole spin is fixed at $a = 0.3$. In Fig. \ref{spec_0p3_t15}, the overall spectra are plotted, in which the first, second, and third columns are for $R_{\rm tr} = 90, 30,$ and 10, respectively. The top, middle, and bottom panels are for $\cos i = 0.1, 0.5$, and 0.9, respectively, where $i$ is the viewing angle with respect to the symmetry axis of the outer disk. In each individual subplot, the spectrum consists of the thermal disk emission in the soft energy band, the Comptonization emission from the torus, and the reflection emission off the disk. The spectra in four colors correspond to the four particular precession phases separated by $90^{\circ}$ during the precession. For the large truncation radius, e.g., $R_{\rm tr} = 90$, a large fraction of the gravitational energy is dissipated in the torus, and the heating-to-cooling ratio is high, so that the electron temperature is high, which leads to a hard spectrum. The disk blackbody radiation peaks at low energy, since the disk is relatively far away from the black hole. As the truncation radius $R_{\rm tr}$ decreases (comparing left panels with right panels), e.g., from $R_{\rm tr} = 30$ to 10, more energy is dissipated in the disk, and the disk luminosity increases. The heating-to-cooling ratio is low, so that the electron will be cooled, producing a soft X-ray spectrum at high photon energy. Therefore, as predicted in the truncated disk model, the X-ray continuum spectrum softens as $R_{\rm tr}$ decreases. Furthermore, it can be seen that it is the Comptonization rather than the disk emission that varies, by comparing the individual spectrum at different precession phases with the phase-averaged spectrum (black dashed line). As mentioned in the previous sections, when the Comptonizing hot flow precesses, the variation of the heating-to-cooling ratio will result in the change of the electron temperature. This effect, combined with the variation of the projected area of the torus due to the precession of the flow, will essentially affect the X-ray spectrum. In Ingram et al. (2016), the QPO phase-resolving method invented by Ingram et al. (2015) was applied to the combined \textit{X-ray Multi-Mirror Mission} (\textit{XMM-Newton}) and \textit{Nuclear SpecTroscopic ARray} (\textit{NuSTAR}) data from the 2014 outburst of H1743-322. Observationally, both the 4-10 keV continuum normalization and power-law index were found to display the statistically significant ($>3\sigma$) modulation along with the QPO phase for the joint data. In Fig. \ref{slope_0p3_t15}, we plot the normalized continuum flux over 4-10 keV (left) and the X-ray photon index $\Gamma$ (right), which is derived by the power-law fits to the continuum spectrum, as a function of the precession phase, for different truncation radii. The half-opening angle $\theta_{\rm o} = 15^{\circ}$. The blue, red, and green solid lines are for $\cos i$ = 0.1, 0.5, and 0.9, respectively. The waveform-like modulation of the 4-10 keV flux is indeed seen in our simulations, especially when the disk is truncated at small radius ($R_{\rm tr} = 10$) and the system is viewed edge-on. Regarding the spectral index, when $R_{\rm tr} = 90$ the spectra are approximately softest at the middle phase, when the torus is aligned with the disk (see Fig. \ref{schematic_torus}), while the spectra are hardest at phase 0. As $R_{\rm tr}$ decreases, e.g., for $R_{\rm tr} = 10$, the overall Comptonizing flow approaches the black hole, so that the continuum shape will be distorted by the relativistic effect, leading to the distortion of the evolution of the photon index. In order to have a close look at the X-ray variability in this model, we calculate the energy-dependent fractional rms based on the radiation spectra at different phases over one complete precession of the flow. The results are plotted in Fig. \ref{rms_0p3_t15}, where the left, middle, and right panels are for $R_{\rm tr} = 90, 30,$ and 10, respectively. The top panels show the phase-averaged spectra and their decomposition into the disk, Comptonization, and reflection components, including the iron emission line. In this paper, the disk is assumed to be neutral with zero ionization for simplicity. Note that only a small fraction of photons escaping from the central source can illuminate the disk, so that the amplitude of the reflected component is low. Consequently, the iron line is most invisible in the overall energy spectrum. The second, third, and fourth rows are the fractional rms spectra as a function of energy for $\cos i$ = 0.1, 0.5, and 0.9, respectively. Throughout this paper, the uncertainties on the fractional rms are estimated based on Equation (B2) of Vaughan et al.(2003). The results are as follows: (i) The observed disk radiation (blue lines) is not variable in most cases, except when the source is in the soft state being observed with a large viewing angle (panel (f)). As for the latter case, the fractional rms variability amplitude of the disk component can be up to about 5\%, which is mainly due to the occultation of the photons emitted from the disk behind the torus. As the viewing angle decreases (viewing closer to face-on), the overlapping region and the resultant variability are reduced. The disk emission will gradually be more variable as the truncation radius moves inward, corresponding to the spectral evolution from hard to soft state. (ii) At $E$ > 3 keV, where the Comptonized emission dominates over other components, the fractional rms has a flat distribution as a function of energy (e.g., $R_{\rm tr} = 10$, in the soft state and being viewed edge-on), or increases with the energy (in the hard state with $R_{\rm tr} = 90$). In the intermediate/soft state ($R_{\rm tr} = 10, 30$), the fractional rms spectra of the Comptonized emission are concave at the low energy $E < 3$ keV, which corresponds to the unscattered photons from the disk traveling through the torus, at the low energy $E < 3$ keV. Therefore, the pivot energy is associated with disk peak temperature. (iii) The reflection component is highly variable, with the fractional rms amplitude reaching up to 30\%. The fractional rms spectra, especially at high photon energy, are independent of the viewing inclination, in both hard and soft state. (iv) At the low energy where the total spectrum is dominated by the disk radiation, the fractional rms is very low, $< 1\%$, while the variability amplitude of the Comptonized emission from the torus is high, $\sim 10\%$; on the other hand, where the total spectrum is dominated by the Comptonized radiation rather than the disk emission, the fractional rms spectrum of the total radiation has the most contribution from the former, i.e., flattening or increasing with photon energy. \begin{figure*} \begin{center} \includegraphics[height= 9.9cm,width=18.0cm,trim=0.0cm 0.0cm 0.0cm 0.0cm,clip=false]{flux_phase_resolved_0p3_t15.eps} \end{center} \caption{ Normalized continuum flux at 4-10 keV (left) and the photon spectral indices (right), as a function of the precession phase for half-opening angle $\theta_{\rm o} = 15^{\circ}$ and the black hole spin $a=0.3$. The top, middle, and bottom panels are for the truncation radius $R_{\rm tr} = 10, 30$, and 90, respectively. In each panel, blue, red, and green solid lines are for the sinusoidal value of viewing angle, $\cos i$ = 0.1, 0.5, and 0.9. On the right, the X-ray photon index $\Gamma$ is derived by the power-law fits to the continuum spectrum, and the error bars in the represent the uncertainties. \label{slope_0p3_t15}} \end{figure*} \begin{figure*} \includegraphics[width=2\columnwidth]{rms_energy_resolved_0p3_t15.eps} \caption{ Normalized radiation spectra and the fractional $\rm rms$ spectra for the half-opening angle of the flow $\theta_{\rm o} = 15^{\circ}$ and black hole spin $a=0.3$. The left, middle, and right panels are for the truncation radius $R_{\rm tr}$ = 90, 30, and 10, respectively. The top panels are the phase-averaged energy spectra, which consist of disk (dotted line), Comptonization (dashed) and reflection (dashed-dotted) emission components. The second, third, and fourth rows are the fractional rms spectra that correspond to the sinusoidal value of viewing angle $\cos i$ = 0.1, 0.5, and 0.9, respectively. In each subplot of the fractional rms spectrum, the blue, green, and red lines represent the fractional rms for disk, Comptonization, and reflection alone, respectively, while the black solid line represents the variability of the total emission. \label{rms_0p3_t15}} \end{figure*} \begin{figure*} \includegraphics[width=2\columnwidth]{rms_energy_resolved_0p3_t15_incli.eps} \caption{ Fractional $\rm rms$ spectra of the radiation integrated over all inclination angles for the half-opening angle of the flow $\theta_{\rm o} = 15^{\circ}$ and the black hole spin $a=0.3$. The left, middle, and right panels are for truncation radius $R_{\rm tr}$ = 90, 30, and 10, respectively. In each subplot of the fractional rms spectrum, the blue, green, and red lines represent the fractional rms for disk, Comptonization, and reflection alone, respectively, while the black solid line represents the variability of the total emission. \label{rms_0p3_t15_incli}} \end{figure*} In Fig. \ref{rms_0p3_t15_incli}, we plot the fractional $\rm rms$ spectra of the radiation integrated over all inclination angles, for different truncation radii. This enables us to get rid of the inclination effects dependent on the observer position as mentioned above, hence isolating the spectral variability caused by the changing geometry of the system. The variability amplitudes and the fractional rms spectrum for both the Comptonization and the reflection components evolve during the spectral transition as the truncation radius decreases from $R_{\rm tr}$ = 90 to $R_{\rm tr}$ = 10. \subsubsection{Effects of varying Black Hole spin} In this case, we study the spectral and variability properties for black hole spin $a = 0.3, 0.6,$ and 0.9, while the truncation radius is fixed at $R_{\rm tr} = 10$. The fractional rms spectra are plotted in Fig. \ref{rms_10rg_t15}, where the left, middle, and right columns are for $a = 0.3, 0.6,$ and 0.9, respectively. The top panels show the phase-averaged spectra and their decomposition into the disk, Comptonization, and reflection components. The second, third, and fourth rows are the fractional rms spectra as a function of energy for $\cos i = 0.1, 0.5,$ and 0.9, respectively. Comparing the fractional rms spectra for different black hole spin (from the left to right column), it can be seen that the variability of the disk emission does not depend on the spin, while variability amplitude of the Comptonized emission is counterintuitively suppressed as the spin increases. Correspondingly, as the output of the X-ray reprocessing in the disk, the variability of the reflection component is also suppressed for large black hole spin. \begin{figure*} \includegraphics[width=2\columnwidth]{rms_energy_resolved_10rg_t15.eps} \caption{ Normalized radiation spectra and fractional $\rm rms$ spectra for the half-opening angle of the flow $\theta_{\rm o} = 15^{\circ}$ and the truncation radius $R_{\rm tr} = 10$. The left, middle, and right panels are for the black hole spin $a = 0.3, 0.6,$ and 0.9, respectively. The top panels are the phase-averaged energy spectra that consist of disk (dotted line), Comptonization (dashed), and reflection (dot-dashed) emission components. The second, third, and fourth rows are fractional ${\rm rms}$ that corresponds to the sinusoidal value of viewing angle $\cos i$ = 0.1, 0.5, and 0.9, respectively. In each subplot of the fractional rms spectrum, the blue, green, and red lines represent the fractional rms for disk, Comptonization, and reflection alone, respectively, while the black solid line represents the variability of the total emission. \label{rms_10rg_t15}} \end{figure*} \subsection{Thick-torus case} The half-opening angle of the torus is uncertain, and physic consideration and simulation are beyond the scope of our current work. Therefore, we consider another possibilities by simply assuming the value of the half-opening angle. In this section, we repeat previous analysis, but in the case of the half-opening angle $\theta_{\rm o} = 45^{\circ}$. Other parameters are fixed with the same values as in the case of $\theta_{\rm o} = 15^{\circ}$. \subsubsection{Effects of varying the truncation radius} The fractional rms spectra are plotted in Fig. \ref{rms_0p3_t45}, where the left, middle, and right columns are for $R_{\rm tr} = 90, 30,$ and 10, respectively. The top panels show the phase-averaged spectra and their decomposition into the disk, Comptonization, and reflection components. The second, third, and fourth rows are the fractional rms as a function of energy for $\cos~i$ = 0.1, 0.5, and 0.9, respectively. It can be seen that (i) comparing with the results in Fig. \ref{rms_0p3_t15}, the variability amplitudes for $\theta_{\rm o} = 45^{\circ}$ are overall smaller than the ones for the small opening angle; (ii) the disk emission is invariable regardless of the spectral states; (iii) as the source evolves from hard state to soft state with the truncation radius decreasing from 90 to 10, the variability amplitudes of the Comptonized emission from the torus are enlarged; (iv) the variabilities of the reflection radiation are enhanced, with the fractional rms reaching up to 20\%; and (v) as the viewing angle decreases from edge-on to face-on, the overall variabilities of the source are suppressed. \begin{figure*} \includegraphics[width=2\columnwidth]{rms_energy_resolved_0p3_t45.eps} \caption{ Normalized radiation spectra and the fractional $\rm rms$ spectra for the half-opening angle of the flow $\theta_{\rm o} = 45^{\circ}$ and black hole spin $a=0.3$. The left, middle, and right panels are for the truncation radius $R_{\rm tr} = 90, 30$, and 10, respectively. The top panels are the phase-averaged energy spectra that consist of disk (dotted line), Comptonization (dashed), and reflection (dot-dashed) emission components. The second, third, and fourth rows are fractional ${\rm rms}$ that corresponds to the sinusoidal value of viewing angle $\cos i$ = 0.1, 0.5, and 0.9, respectively. In each subplot of the fractional rms spectrum, the blue, green, and red lines represent the fractional rms for disk, Comptonization, and reflection alone, respectively, while the black solid line represents the variability of the total emission. \label{rms_0p3_t45}} \end{figure*} \subsubsection{Effects of varying the BH spin } The energy-dependent fractional rms($E$) based on the spectra at different phases within the complete period of the flow precession are plotted in Fig. \ref{rms_10rg_t45}, where the left, middle, and right columns are for $a = 0.3, 0.6,$ and 0.9, respectively. The top panels show the phase-averaged spectra and their decomposition into the disk, Comptonized, and reflection components. The second, third, and fourth rows are the fractional rms($E$) as a function of energy for $\cos~i$ = 0.1, 0.5, and 0.9, respectively. The fractional rms($E$) of the Comptonized radiation is constant across high photon energy, and the amplitude is independent on the black hole spin, while the fractional rms spectra of the reflection components increase with photon energy. However, the variability amplitude of the latter decreases as the spin increases. Although the fractional rms spectra of the reflection components are independent of the viewing angle, the fractional rms spectra of the Comptonized radiation are larger when the source is viewed with large inclination. Therefore, the fractional rms spectra of the total radiation increase with the viewing angle. \begin{figure*} \includegraphics[width=2\columnwidth]{rms_energy_resolved_10rg_t45.eps} \caption{ Normalized radiation spectra and fractional $\rm rms$ spectra for the half-opening angle of the flow $\theta_{\rm o} = 45^{\circ}$ and the truncation radius $R_{\rm tr} = 10$. The left, middle, and right panels are for the black hole spin $a = 0.3, 0.6,$ and 0.9, respectively. The top panels are the phase-averaged energy spectra that consist of disk (dotted line), Comptonization (dashed), and reflection (dot-dashed) emission components. The second, third, and fourth rows are fractional ${\rm rms}$ that corresponds to the sinusoidal value of viewing angle $\cos i$ = 0.1, 0.5, and 0.9, respectively. In each subplot of the fractional rms spectrum, the blue, green, and red lines represent the fractional rms($E$) for disk, Comptonization, and reflection alone, respectively, while the black solid line represents the variability of the total emission. \label{rms_10rg_t45}} \end{figure*} \section{Discussion} In this work, we develop a relativistic Monte Carlo code, to compute the Compton-scattered X-ray flux produced by the hot inner flow intercepting seed photons from an outer truncated standard disk. The inner flow will undergo the Lense-Thirring precession if the rotation axis of the flow misaligns with the black hole spin axis owing to the frame-dragging effect. It was proposed that the precession of the inner flow gives rise to the modulation of the X-ray flux through the combination of the geometrical effect, e.g., the self-occultation, the wobbling of the projected area, and the relativistic effect (Ingram et al. 2009). We investigate the energy-dependent X-ray variabilities from the Lense-Thirring precession in the truncated disk geometry and, furthermore, the evolution of the variability properties during the spectral transition from the hard to soft state, which is implemented by the decrease of the truncation radius of the outer disk toward ISCO. \subsection{Mechanism of Low-frequency QPO variability} Before discussing the influence of model parameters on the QPO variability for disk, Comptonization, and reflection emission, we should explain the fundamental mechanism of QPO variability for these spectral components. The evolution of the QPO variability along with spectral transition will be discussed in the next subsection. {\bf \it{Disk thermal emission variability}:} The modulation of disk emission is seen in our simulation for some particular cases, e.g., the blue line in panel (f) of Fig. \ref{rms_0p3_t15}, where the source is in the soft state and observed with large inclination angle. In this case, the disk truncation radius is small, with $R_{\rm tr} = 10$ close to the torus inner radius $R_{\rm in} = 5$ for $a=0.3$, and thus the extent of the torus is small. This will result in parts of the innermost disk behind the torus being observed or hidden from view during the precession phase, which depends on the torus position. This changing appearance of the occulted disk then leads to the inner disk emission being variable (i.e., the bump at energy $E$ < 3.0 keV), due to not only the change in the occulted area of the disk but also the intrinsic blueshift/redshift modulation of the rotating disk emission. {\bf \it{Comptonized emission variability}:} The variability of the Comptonization emission is intrinsic in the Lense-Thirring precession mechanism. The precession flow emitting the X-ray is translucent with the optical depth in the range of $\sim 1-2$, which is determined by the \textit{eqpair} code , so that the varying of the projected area of the flow due to precession will contribute to the flux modulation. In other words, the angle between the line of sight and the axis of the torus changes with precession phase, so that the optical depth along the line of sight varies as the torus wobbles, which leads to the variable fraction of scattered and unscattered photons and thus the modulation of X-ray emission. Furthermore, photons with higher energy undergo a higher order of Comptonization before escaping the torus, so that the effect of the wobbling of the torus on the X-ray modulation is more significant for higher-energy photons. This then explains the increase of the fractional rms with photon energy (e.g., green lines in left panels of Fig. \ref{rms_0p3_t15}). In addition, the electron temperature changes, if the relative geometry of the torus and outer disk changes during the precession phase, because of the change of heating-to-cooling ratio of the plasma. This leads to spectral (slope) variations and contributes to the extra variability. {\bf \it{Reflection component variability}:} In our simulation, the phased-averaged reflection components including the iron line are weak with respect to the Comptonization component (e.g., Fig \ref{rms_0p3_t15}). This is because only a small fraction of photons escaping from the central source can illuminate the disk, so that the amplitude of the reflected component is low. Furthermore, it has been shown in the literature that the ionization parameter plays an important role in shaping the resultant iron emission line (e.g, Garc{\'{\i}}a et al.(2013), Basak \& Zdziarski(2016). In this work, for simplicity, the disk is assumed to be neutral with zero ionization. Therefore, a more realistic ionization parameter would return an iron line more consistent with observations. Although the phased-averaged reflection components are weak, the fractional rms amplitudes of the reflection components increase with photon energy in most of the simulation results. As indicated in Ingram \& Done (2012), the tilted flow illuminates different azimuths of the disk as it precesses. The resulting reflection emission is blueshifted when the flow predominantly irradiates the approaching region of the rotating disk and redshifted when the flow predominantly irradiates the receding region of the disk. Therefore, this anisotropical irradiation due to the nonspherically symmetric geometry of the precessing torus intrinsically accounts for the reflection variability considered here. Because of the torus configuration, the closer to the innermost region of the torus the irradiation source is, the more anisotropic the irradiation with respect to the disk is. Moreover, compared to the irradiating photons escaping from the outer region of the torus, the energy of the ones from the innermost region is high, so that, the fractional rms amplitude of the reflection components due to the precessing illumination increases with photon energy. Moreover, there are interesting features in the soft states, i.e., a spike at $E$ $\sim$ 6-8 keV (e.g., right panels in Fig. \ref{rms_0p3_t15}). This arises from the variation of the Fe k$\alpha$ line, which is the characteristic signature for the reflection components. We find that both the centroid energy and line width of the iron line vary as the flow precesses, which agrees with the results of Ingram \& Done (2012). The results will be presented in detail in the next paper. Finally, the fractional rms($E$) for the total radiation is determined depending on the contribution of the flux from individual spectral components. For example, in panel (d) of Fig. \ref{rms_0p3_t15}, at soft energy $E$ < 1keV where the disk emission dominates over other spectral components, the fractional rms amplitude of the total radiation is very small, as the disk emission is weakly variable, regardless of the high variability of the Comptonization and reflection components. \subsection{Evolution of QPO variability} Based on the mechanism of the QPO variability, in this section we will investigate the results of Fig. \ref{rms_0p3_t15} to study the evolution behavior of the QPO variability along with the spectral transition. The discussion is divided into two subcases for small and large viewing angles. \subsubsection{Small viewing angle} When the viewing angle with respect to disk axis is small, e.g., the source being viewed face-on (bottom panels), the patterns of the fractional rms spectra are simple. The fractional rms spectra for the Comptonization, reflection, and hence total components all monotonously increase with energy at $E$ > 1 keV, e.g. panel (j). The ratio of the disk luminosity intercepted by the torus to the total disk luminosity and the resulting electron temperature are plotted in Fig. \ref{lsoft}. In the hard state, e.g., $R_{\rm tr} = 90$ or 30, the electron temperature varies ($\sim 10\%$) during the precession phase, while in the soft state, e.g., $R_{\rm tr} = 10$, there is relatively weak change ($\sim 6\%$) in the temperature during the precession. Therefore, this is why the variability amplitudes of the X-ray emission (both the Comptonization and reflection components) in the soft state are relatively lower than the ones in the hard state, comparing panel (j) with panel (l). \subsubsection{Large viewing angle} As explained in Sect. 4.1, when the viewing angle with respect to the disk axis is large, e.g., being viewed edge-on, the occultation of the disk by the torus becomes important. In the hard state, the disk is truncated at large radius, and thus the inner hot flow is spatially extensive, so that the portion of the disk that is occulted by the inner torus is large and not variable during the precession. Therefore, almost constant disk emission around peak energy $E\sim$0.1 keV would be expected, e.g., panel (d). Besides of the varying of the optical depth along the line of sight and plasma temperature, which contributes to the variabilities of the Comptonization, the self-occultation effect should also give rise to the flux modulation for edge-on observation. That is to say, when the torus terminates at large radius, the inner part will be totally obscured by the outer boundary at particular precession phase, while the the outer boundary can be always be observed during the precession. As the source evolves into soft state (panel (e) and (f)) with the inner radius of the disk moving inward, the pattern of the fractional rms spectra is complex: (1) below 3 keV, the bump spectrum for the disk component (blue line) and the concave spectrum for the Comptonization component (green line); (2) at high energy $E > 3$ keV, roughly flat distribution for the Comptonization component. As the truncation radius decreases, the smaller and smaller extent of the torus and the light-bending effect due to strong gravity will result in parts of the innermost disk behind the torus being observed or hidden from view during the precession phase, which depends on the torus position. This changing appearance of the unocculted disk then leads to the inner disk emission being variable, namely, the bump of the fractional rms spectrum for the disk component at $E < 3$ keV, due to not only the change in the occulted/unocculted area of the disk but also the intrinsic blueshift/redshift of the rotating disk emission. The concave fractional rms spectra (green line) correspond to the bump of the energy spectrum of the Comptonization component at low energy (panel (b) and (c)) which is attributed to those photons from the occulted disk traveling through the torus but without Comptonization (note that in our simulation, such unscattered photons are saved as the emission from the torus). Therefore, the changing appearance of the occulted disk also naturally contributes to the variability of the torus emission at $E < 3$ keV (unscattered photons). Moreover, during the precession phase, the outer torus that emits low-energy unscattered photons wobbles more significantly than the inner torus that emits relatively high energy unscattered photons, so that the resultant fractional rms due to the wobble decreases with photon energy, namely, the left wing of the concave fractional rms spectrum for the Comptonization component. As for the fractional rms spectra at high energy $E > 3$ keV that originate from the scattered photons, its amplitude is about 30\%. The soft state in the truncated disk model requires that the torus is spatially compact, meaning that low- and high-energy photons are emitted in the close region of the torus. Therefore, the fractional rms of the Comptonized photons with $E > 3$ keV should be somewhat independent of photon energy. Finally, for the fractional rms spectrum in the range of 1.0 and 3.0 keV, there is an increasing contribution from the scattered photon, so that the fractional rms will increase with photon energy, which is shown as the right wing of the concave fractional rms spectra of the Comptonization component. \subsection{Dependence of the QPO variability} In this section we will discuss the role of the major parameters in shaping both the QPO variability and its evolutional behavior along the spectral transition. The corresponding results are plotted in Fig. \ref{rms_10rg_t15}-\ref{rms_10rg_t45}. \subsubsection{On black hole spin} Regarding the potential influence of the black hole spin on the spectral and timing properties, it might be implemented by affecting the accretion physics in the innermost region near the rotating black hole and modifying the emergent spectrum due to gravitational redshift and the light-bending effect. Studying the role of the strong gravity of a rotating black hole on the accretion flow is beyond the scope of this work. It is suggested by analytic and simulation works that the misalignment of the accretion flow will result in not only the precession of the entire flow as a solid body but also the additional torque from a black hole, contributing to the stresses (Bardeen \& Petterson 1975; Nelson \& Papaloizou 2000; Fragile \& Anninos 2005). Then, the increased stresses will increase inward velocity and therefore decrease the density of the flow (Fragile et al. 2007; Liska et al. 2018). In this sense, the inner radius of the precessing flow will be larger than the ISCO, which is usually assumed as the inner radius of the disk. In Fig. \ref{rms_10rg_t15}, the evolution of both phase-averaged energy spectra and energy-dependent fractional rms for different black hole spins is shown, where the truncation radius of the outer disk is fixed at $R_{\rm tr} = 10$. The inner radius of the inner flow is simply assumed in the same way as in Ingram et al. (2009). The relativistic correction to the emergent spectrum is internally implemented in our simulation by tracing each individual photon from the flow to the infinity. When the viewing angle with respect to disk axis is small, e.g., viewing face-on (bottom panels), there is no self-occultation effect, so that the combination of the change in optical depth along the line of sight due to the wobbling of the torus and the relativistic effects leads to the monotonous increase in the fractional rms spectra of both the Comptonization and the resulting reflection components, as a function of photon energy. The resultant variation in plasma temperature (due to the chang in the number of the seed soft photons interacting with the torus) shows some subtle difference among different spins, e.g., the red lines in Fig. \ref{lsoft}. Therefore, no obvious change in the fractional rms amplitudes of the Comptonization components would be expected, e.g., green lines in panel (j)-(l) of Fig. \ref{rms_10rg_t15}. Yet, it is found that the fractional rms amplitudes of the reflection component increase as the spin decreases. As explained in the previous section, the reflection variability is attributed to the blueshift/redshift modulation in response to the precession of the illuminating flow. As the spin decreases, the inner torus extends further inward, so that part of the illuminating photons will arise from the region closer to the black hole. As the flow precesses, the illuminating spectrum is highly modulated owing to the relativistic effect of the strong gravitational field, contributing to extra variability amplitude of the resultant reflection radiation. This is why the reflection variability for the low spin is larger than the one for high spin. When the viewing angle with respect to the disk axis increases, e.g., from panel (j) to panel (d) in Fig. \ref{rms_10rg_t15}, the self-occultation effect plays an increasing role in shaping the fractional rms spectra. Especially when the source is viewed edge-on (panel (d)), the fractional rms flattens across high energy. In this case of large viewing angle, as the spin increases, from panel (d) to panel (f), the torus recedes, and hence the extent of the torus decreases, so that the self-occultation effect is reduced partly as a result of the light-bending effect. Therefore, the variability amplitude of both the Comptonization and reflection components is suppressed in the case of high spin. \subsubsection{On the torus opening angle} In our simulation, model parameters regarding the configuration of the geometry, e.g., the misalignment angle of the black hole spin with respect to the the symmetry axis of the disk $\theta_{\rm p}$, the misalignment angle of the symmetry axis of the torus with respect to the spin $\theta_{\rm t}$ and the half-opening angle of the torus, currently cannot be constrained well by the observational and theoretical studies. Note that $\theta_{\rm o}$ < $\theta_{\rm p}$ would probably give very different results, since the disk would see the `bottom' of the inner flow at some precession phases. It is impossible to explore the effect of all model parameters on the spectral and timing properties for the transient source in this paper. Therefore, in this paper, we investigate the spectral and variability properties in the Lense-Thirring precession model for two exemplary cases of the opening angle, i.e., $\theta_{\rm o} = 15^{\circ}$ and $45^{\rm \circ}$. In Fig. \ref{rms_0p3_t45}, the results for different truncation radii in the case of the half-opening angle $\theta_{\rm o} = 45^{\circ}$ are shown, in the comparison to the results in Fig. \ref{rms_0p3_t15}. The energy spectrum evolution during the state transition is similar to that in the case of $\theta_{\rm o} = 15^{\circ}$, while the fractional rms spectra are obviously different. The overall variability amplitudes of the Comptonization component are highly suppressed, $\leq 10\%$, irrespective of the spectral state. As the torus becomes thick with large opening angle, the torus is geometrically thicker than the range of its wobble due to precession, so that the variation of the projected area of the wobbling torus will be reduced. Moreover, the variation of the plasma temperature during the precession for the thick torus is subtle owing to an almost constant heating-to-cooling ratio of the plasma. The overall effect will result in the weak variability of the Comptonization radiation. Yet, it is found that the variability of the reflection component is enlarged from the hard to soft state, e.g, comparing left panels with right panels in Fig. \ref{rms_0p3_t45}. In the hard state with large truncation radius, the torus is spatially extensive, so that the anisotropy of the irradiation by the precessing torus with respect to the approaching/receding region of the disk is subtle, which leads to the weak variability. However, when the source evolves toward the soft state, the extent of the precessing torus decreases. Then, the effect of the anisotropical irradiation by the precessing torus becomes significant. This triggers the blueshift/redshift modulation for the reflection spectrum, namely, enhancing the reflection variability. In Fig. \ref{rms_10rg_t45}, the results of the spectral and variability properties are shown for different spins in the case of the half-opening angle $\theta_{\rm o} = 45^{\circ}$. Again, the overall amplitudes of the fractional rms spectra of both the Comptonization and total radiation are roughly constant and significantly lower than the ones for $\theta_{\rm o} = 15^{\circ}$, which has been discussed above. Moreover, the fractional rms spectra of the Comptonization are irrespective of the spin, because of the combination of large torus thickness and a subtle change in the electron temperature. And comparing to the case of small half-opening angle, it is more obvious that the fractional rms amplitudes of the reflection component increase as the spin decreases. \subsection{Comparison with observations} The aim of this work is to single out the effects of X-ray modulation due to Lense-Thirring precession of the hot flow on the X-ray variability spectra. Given that we are discarding other mechanisms involving instabilities in the flow, at present our simulations allow only for a qualitative comparison with observations. The fractional rms spectra as a function of energy could provide information and constraint on the variability mechanism and the accretion physics in the X-ray binaries. Gierli{\'n}ski \& Zdziarski (2005) analyzed several observations of two X-ray binaries in various states from the Rossi X-ray Timing Explorer ($RXTE$), and then extracted fractional rms spectra from the PCA. The presented characteristic patterns of the fractional rms clearly show the evolution during the state transition. However, those fractional rms spectra were integrated over the wide range of Fourier frequency, while the fractional rms spectra that are simulated in our paper correspond to the QPOs in the $<$ 10 Hz region. The work of investigating the fractional rms spectra for the QPOs within $1-10$ Hz was done by Sobolewska \& {\.Z}ycki (2006), which showed that the fractional rms decreases with energy for some objects and increase for others. Note that all the simulated results in Fig. \ref{spec_0p3_t15}-\ref{rms_10rg_t45} including the fractional rms spectra, are for the viewer azimuth $\Phi_{\circ} = 0$. However, since the geometry in this work is inherently asymmetric, it would be expected that the viewer azimuth has a quite profound effect on computing the variability properties. Indeed, Fig. 9 and 10 of Ingram et al (2015) show that the viewer azimuth can have a big influence on the observed fractional rms. In Fig. \ref{rms_0p3_t15_phi}, the fractional rms spectra for different viewer azimuths are plotted, where the truncation radius $R_{\rm tr}=10$ and the spin $a=0.3$. The top, middle, and bottom panels correspond to low, moderate, and high inclination, i.e., $cos i \simeq$ 0.9, 0.5, and 0.1, respectively. It can be seen that indeed the fractional rms spectrum varies with the viewer azimuth, even when other fundamental parameters are fixed. Moreover, such an effect is more profound for high inclinations than low inclinations. This means that the comparison of these predictions to observations of individual sources should take the effect of the viewer azimuth into account. As shown on the left of Fig. \ref{rms_0p3_t15_phi}, if the object is observed at different (polar) inclination angles and also different viewer azimuths, the fractional rms will display the diversified (energy dependence) variability properties. Indeed, Fig. 4 of Sobolewska \& Zycki (2006) shows a hard fractional rms spectrum for 4U 1630 and a soft one for XTE J1550. Fig. 6 of Ingram \& van der Klis (2015) shows that GRS 1915+105 has a hard rms spectrum for observations with a hard time-averaged spectrum. Considering the results in Fig. \ref{rms_0p3_t15} and \ref{rms_0p3_t45} from our simulation, the large half-opening angle gives almost constant fractional rms irrespective of photon energy, while the small one predicts the increasing of the fractional rms with photon energy. Therefore, it seems that the half-opening angle of the precessing torus decreases as the source evolves toward to the soft state, so that the rms gradually increases with energy. This postulated behavior of the half-opening angle during the state transition somewhat is somewhat plausible, provided that the height of the torus (inner hot flow) is supported by the magnetic pressure and/or radiation pressure, which might correlate with the plasma temperature; meanwhile, it was found that the high-energy cutoff in the X-ray spectrum of GX 339-4 decreases during the spectral transition from hard to soft state (Belloni et al. 2011). \begin{figure} \includegraphics[height=13.0cm,width=21.0cm,trim=0.0cm 0.0cm 0.0cm 0.0cm,clip=true]{rms_energy_resolved_0p3_t15_phi.eps} \caption{ Fractional $\rm rms$ spectra for the half-opening angle of the flow $\theta_{\rm o} = 15^{\circ}$. The truncation radius $R_{\rm tr}$ = 10, and the black hole spin $a=0.3$. The top, middle, and bottom panels correspond to the sinusoidal value of the viewing angle $\cos i$ = 0.9, 0.5, and 0.1, respectively. In each panel, the black, green, blue, and red lines are for the viewer azimuth $\Phi_{\circ} = 0, \pi/2, \pi$, and $3\pi/2$, respectively. \label{rms_0p3_t15_phi}} \end{figure} Recently, Motta et al. (2015) performed a systematic study of fast time-variability properties of the population of black hole X-ray binaries via $RXTE$ data. The fractional rms of type C QPOs, which are computed in the energy band 2-26 keV, was found to statistically decrease with the frequency of LFQPOs for low-inclination sources, while the fractional rms-frequency trend for high-inclination sources apparently deviates from the low-inclination sources. More specifically, the derived fractional rms increases to the maximum at $\sim$2 Hz and then reduces beyond this frequency, with the average value being higher than that for low inclination. Furthermore, it should be noted that, in their work, there were spreads in the fractional rms around the average values for both low and high inclinations. In order to compare with the observational properties, we compute the fractional rms of LFQPOs from our simulation in the same energy band. The trend of the fractional rms with the frequency of LFQPOs is plotted in Fig. \ref{rms_nu_phi} for the different viewer azimuths, where the QPO frequency is computed based on Eq(2) of Ingram et al. (2009) as a function of truncation radius. The top, middle, and bottom panels correspond to low, moderate, and high inclination, i.e., $cos i \simeq$ 0.9, 0.5, and 0.1, respectively. It can be seen that the fractional rms for low inclinations (top panel) decreases with QPO frequency. And in the case of low inclinations, the difference in the fractional rms spectrum due to different viewer azimuths is slight. As the inclination increases (in the bottom panels), the fractional rms apparently differs from the one for low inclinations and the amplitude becomes larger, especially for higher frequency. More importantly, here we find that, for moderate and high inclinations, the fractional rms shows the variation for different viewer azimuths, at a given QPO frequency. This may naturally explain the observed spread in the fractional rms in Motta et al. (2015), provided that the viewer azimuths of the objects in their paper perhaps are different. These results are consistent with the observational properties above, which support the hypothesis that type C LFQPOs may originate from the Lense-Thirring precession of the inner flow. As the source evolves from hard state to soft state, the truncation radius decreases, which will result in the evolution of both QPO frequency and variability amplitude, predicted by the precession model. On one hand, the frequency of LFQPOs increases with the truncation radius (Ingram et al. 2009). On the other hand, the variability amplitude depends on the source inclination and spectral state. At low inclinations, as discussed in previous sections, the variability mainly arises from the variation of the projected area due to the wobbling inner flow. Therefore, as the truncation radius decreases (evolving to soft state), i.e., QPO frequency increasing, the inner flow becomes more compact and the wobbling effect will gradually weaken, so that the fractional rms amplitude correspondingly decreases. At high inclinations, the self-occultation between the accretion disk and torus plays an increasingly important role in the fractional rms amplitude, which then results in the deviation from the rms-frequency trend for low inclinations. \begin{figure} \includegraphics[height=13.0cm,width=21.0cm,trim=0.0cm 0.0cm 0.0cm 0.0cm,clip=true] {energy_integrated_rms_energy_resolved_0p3_t15_phi.eps} \vspace{-1.5cm} \caption{ Fractional rms as a function of the QPO centroid frequency for the half-opening angle of the flow $\theta_{\rm o} = 15^{\circ}$ in the energy band 2-26 keV. The truncation radius $R_{\rm tr}$ = 10, and the black hole spin $a=0.3$. The QPO frequency is computed based on Equation (2) of Ingram et al. (2009) as a function of truncation radius, which is labeled in the upper X-axis. The top, middle, and bottom panels correspond to the sinusoidal value of viewing angle $\cos i$ = 0.9, 0.5, and 0.1, respectively. In each panel, the different point types correspond to different viewer azimuthal angles. \label{rms_nu_phi}} \end{figure} \section{Summary and Conclusion} In the geometry of the truncated disk, if the inner hot flow misaligns with the black hole spin, it will undergo the Lense-Thirring precession due to the frame-dragging effect. During the precession phase, the combination of the geometrical and relativistic effects contributes to the modulation of the X-ray flux: (1) the varying occultation of the truncated disk by the torus gives rise to the disk emission variability; (2) the varying optical depth along the line of sight, the heating-to-cooling ratio of the plasma, self-occultation, and the light-bending effect contribute to the modulation of the torus emission, which arises from upscattering the soft photons from the outer truncated disk; (3) the tilted flow under the precession will illuminate different azimuths of the disk, resulting in the blueshift/redshift modulation because of the rotation of the disk. We develop the Monte Carlo code to simulate the modulation of the relativistic X-ray spectrum by the Lense-Thirring precession of the truncated geometry, taking light bending and gravitational redshift into account. Based on these simulation results, we are able to investigate the evolution of the energy-dependent QPO variabilities during the spectral transition from hard to soft state, which is implemented by the decrease of the disk truncation radius. The main conclusions are as follows: \begin{enumerate} \item As the source in the outburst evolves from hard to soft state, the disk emission becomes variable with the fractional rms of roughly a few percent. \item The fractional rms of the Comptonization increases with photon energy. Yet in the soft state, where the precession flow is compact, the fractional rms spectra are roughly constant across the energy. \item The reflection variability amplitude increases with energy, because the illumination by soft photons can be relatively easily seen by both approaching and receding regions of the disk, so that the effect of the blueshift/redshift modulation is less than the illumination by hard photons. \item The fractional rms computed in the energy range 2-26 keV is found to decrease with the QPO frequency at low inclination, while the fractional rms is enhanced to large amplitude at high inclination owing to the increasing role of self-occultation between the torus and accretion disk. These simulated fractional rms-frequency trends are consistent with the observational variability properties of type C LFQPO (Motta et al. 2015), supporting the hypothesis that type C LFQPO may originate from the Lense-Thirring precession of the inner flow. \item It is plausible that the height (or the half-opening angle) of precessing flow is large in the hard state because of high temperature but decreases as the source evolves to soft state because of the increase in the cooling rate by the disk soft photon. Hence, the fractional rms amplitude could be up to $\sim 40\%$ in the hard state, while roughly a few percent in the soft state, which is consistent with the observation. \item The fractional rms spectrum of the total radiation is weakly dependent on the spin, while the fractional variability amplitude of the reflection emission increases with photon energy, and the reflection for low spin is more variable than the one for high spin. \end{enumerate} In our forthcoming papers, we will investigate the variability properties of the iron emission line due to the Lense-Thirring precession of the accretion flow (Ingram \& Done 2012), by the use of our Monte Carlo code developed in this work. Furthermore, we will also study both energy-dependent phase lag at both the fundamental and the first overtone and phase lag between two broad energy bands as a function of QPO frequency. The predictions will then be compared with the observational results (e.g, Ingram et al. 2015, 2016, 2017; van den Eijnden et al. 2017). \section{Acknowledgments} We thank Barbara De Marco and Agata R\' o\. za\' nska for discussion and comments. This research was supported by Polish National Science Centre grant nos. 2015/17/B/ST9/03422 and 2015/18/M/ST9/00541 and by Ministry of Science and Higher Education grant W30/7.PR/2013. This research was supported by ``the Fundamental Research Funds for the Central Universities.'' It received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 312789, Polish National Science Center grant Polonez 2016/21/P/ST9/04025, the National Program on Key Research and Development Project (grant no. 2016YFA0400803), and the Chinese National Science Foundation (grant no. 11622326). This research was partly financed by grant DEC-2011/03/B/ST9/03459 from the Polish National Science Centre. This work made use of the High Performance Computing Resource in the Core Facility for Advanced Research Computing at Shanghai Astronomical Observatory.
\section{Introduction} \label{sec:intro} Diffractive exclusive production of resonances and of dihadron continua are processes with relatively large cross sections, typically of the order of a few $\mu$b or even larger. It~is~expected that central exclusive production, mediated by double pomeron exchange, is an ideal reaction for the investigation of gluonic bound states (glueballs) of which the existence has not yet been confirmed unambiguously. Observation of glueballs would be a long-awaited confirmation of a crucial prediction of the QCD theory. Such processes were studied extensively at CERN starting from the Intersecting Storage Rings (ISR) experiments \cite{Waldi:1983sc,Akesson:1985rn,Breakstone:1986xd, Breakstone:1989ty,Breakstone:1990at} (for a review, see Ref.~\cite{Albrow:2010yb}) and later at the Omega spectrometer at SPS in the fixed-target WA102 experiment; see e.g.~\cite{Barberis:1996iq,Barberis:1997ve,Barberis:1998ax, Barberis:1998sr,Barberis:1999cq,Barberis:2000em,Kirk:2000ws}. The measurement of two charged pions in $p \bar{p}$ collisions was performed by the CDF Collaboration at the Tevatron \cite{Aaltonen:2015uva}. In this experiment the outgoing $p$ and $\bar{p}$ were not detected and only two large rapidity gaps, one on each side of the central hadronic system, were required. Thus, the data include also diffractive dissociation of (anti)protons into undetected hadrons. Exclusive reactions are of particular interest since they can be studied in experiments at the LHC by the ALICE, ATLAS, CMS \cite{Khachatryan:2017xsi}, and LHCb collaborations. At the LHC, in the reactions of interest here, protons are scattered in the forward/backward directions in which relevant detectors are not always present. Recently, there have been several efforts to install and use forward proton detectors. The CMS Collaboration combines efforts with the TOTEM Collaboration while the ATLAS Collaboration may use the ALFA subdetectors; see e.g. \cite{Staszewski:2011bg}. Also the STAR experiment at the Relativistic Heavy Ion Collider (RHIC) is equipped with such detectors that allow the measurement of forward protons. In this way, the non-exclusive background due to proton breakup could be rejected via the momentum balance constraint \cite{Adamczyk:2014ofa,Sikora:2016evz}. On the theoretical side, the exclusive diffractive dihadron continuum production can be understood as being mainly due to the exchange of two pomerons between the external protons and the centrally produced hadronic system. First calculations in this respect were concerned with the $p p \to p p \pi^+ \pi^-$ reaction \cite{Pumplin:1976dm,Lebiedowicz:2009pj,Lebiedowicz:2011nb}. The Born amplitude was written in terms of pomeron/reggeon exchanges with parameters fixed from phenomenological analyses of $NN$ and $\pi N$ total and elastic scattering. The four-body amplitude was parametrized using the four-momentum transfers squared $t_1$, $t_2$, and $s_{ij}$, the energies squared in the two-body subsystems. The energy dependence is known from two-body scatterings such as $NN$, $\pi N$, etc. Such calculations make sense for the continuum production of pseudoscalar meson pairs. These model studies were extended also to the $pp \to nn \pi^+ \pi^+$ \cite{Lebiedowicz:2010yb} and $pp \to pp K^+ K^-$ \cite{Lebiedowicz:2011tp} reactions and even for the exclusive $\pi^{+}\pi^{-}\pi^{+}\pi^{-}$ continuum production \cite{Kycia:2017iij}. In reality the Born approximation is usually not sufficient and absorption corrections have to be taken into account; see e.g. \cite{Harland-Lang:2013dia,Lebiedowicz:2015eka}. The phenomenological concepts underlying these calculations require further tests and clear phenomenological evidence to be commonly accepted. In this paper we are concerned with reactions in which the exchange of the soft pomeron plays the most important role. This -- still somewhat enigmatic -- soft pomeron is a flavorless object. It is often loosely stated that it possesses quantum numbers of the vacuum. This is true for the internal quantum numbers of the pomeron. However, the spin structure of the soft pomeron certainly is not that of the vacuum, i.e. spin 0. We believe that the soft pomeron is best described as an effective rank-2 symmetric-tensor exchange as introduced in \cite{Ewerz:2013kda}. In \cite{Ewerz:2016onn} three hypotheses for the soft-pomeron spin structure, effective scalar, vector, and tensor exchange, were discussed and compared to the experimental data on the helicity structure of proton-proton elastic scattering at $\sqrt{s} = 200$~GeV and small $|t|$ from the STAR experiment \cite{Adamczyk:2012kn}. Only the tensor option was shown to be viable, the vector and scalar options for the soft pomeron could be excluded. In \cite{Ewerz:2016onn} also some remarks on the history of the views of the pomeron spin structure were presented. For the convenience of the reader we repeat here some of the main points concerning the tensor pomeron in its connection to QCD. In \cite{Nachtmann:1991ua}, one of us made a general investigation of high-energy soft diffractive processes in QCD using functional methods. It was shown there that the resulting soft pomeron could be described as coherent exchange of spin $2+4+6+\ldots$. This is exactly the structure of the tensor pomeron of \cite{Ewerz:2013kda}; see Appendix~B there. In this way the tensor pomeron of \cite{Ewerz:2013kda} has good backing in nonperturbative QCD. Also investigations in the framework of the AdS/CFT correspondence prefer a tensor nature for the soft-pomeron exchange \cite{Domokos:2009hm,Iatrakis:2016rvj}. First applications of the tensor-pomeron model of \cite{Ewerz:2013kda} to the central exclusive production (CEP) of several scalar and pseudoscalar mesons in the reaction $p p \to p p M$ were studied in \cite{Lebiedowicz:2013ika} for the relatively low WA102 energy, where also the secondary reggeon exchanges play a very important role. The resonant $\rho^0$ ($J^{PC} = 1^{--}$) and non-resonant (Drell-S\"oding) $\pi^{+}\pi^{-}$ photoproduction contributions to CEP were studied in \cite{Lebiedowicz:2014bea}. In \cite{Bolz:2014mya}, an extensive study of the reaction $\gamma p \to \pi^+ \pi^- p$ was presented. In \cite{Lebiedowicz:2016ioh}, the model was applied to the reaction $p p \to p p \pi^+ \pi^-$ including the dipion continuum, the dominant scalar $f_{0}(500)$, $f_{0}(980)$~($J^{PC} = 0^{++}$), and tensor $f_{2}(1270)$~($J^{PC} = 2^{++}$) resonances decaying into the $\pi^+ \pi^-$ pairs. In \cite{Lebiedowicz:2016zka}, the model was applied to the $\pi^+ \pi^-\pi^+ \pi^-$ production via the intermediate $\sigma\sigma$ and $\rho^0\rho^0$ states. Also the $\rho^{0}$ meson production associated with a very forward/backward $\pi N$ system, that is, the $pp \to pp \rho^{0} \pi^{0}$ and $pp \to pn \rho^{0} \pi^{+}$ processes were discussed in \cite{Lebiedowicz:2016ryp}. It was shown in \cite{Lebiedowicz:2013ika,Lebiedowicz:2016ioh,Lebiedowicz:2014bea,Bolz:2014mya, Lebiedowicz:2016ryp,Lebiedowicz:2016zka} that the tensor-pomeron model does quite well in reproducing the data where available. Closely related to the reaction $pp \to pp p \bar{p}$ studied by us here are the reactions of central $p \bar{p}$ production in ultraperipheral nucleus-nucleus and nucleon-nucleus collisions, $AA \to AA p \bar{p}$ and $pA \to pA p \bar{p}$. For the first process, see \cite{Klusek-Gawenda:2017lgt}, in which the parameters of the model including the proton exchange, the $f_{2}(1270)$ and $f_{2}(1950)$ $s$-channel exchanges, and the handbag mechanism, were fitted to Belle data \cite{Kuo:2005nr} for the $\gamma \gamma \to p \bar{p}$ reaction. The model was applied then to estimate the cross section for the ultraperipheral, ultrarelativistic, heavy-ion collisions at the LHC. In the following, we extend the application of the tensor-pomeron model to central exclusive production of spin-$1/2$ hadron pairs ($p \bar{p}$ or $\Lambda \overline{\Lambda}$) in $pp$ collisions. The centrally produced baryon-antibaryon pairs were studied experimentally in Refs.~\cite{Akesson:1985rn,Breakstone:1989ty, Barberis:1998sr}. So far, the $p p \to p p p \bar{p}$ reaction at LHC energies has not been considered from the theory point of view. We will show first predictions for this reaction in the tensor-pomeron approach and compare them with results for central production of dihadrons with spin 0, $\pi^{+} \pi^{-}$ and $K^{+} K^{-}$. We shall discuss whether the predictions of the tensor-pomeron model can be verified by planned measurements at the RHIC and at the LHC. The observables suited for this purpose shall be presented. Our paper is organised as follows. In Sec.~\ref{sec:continuum_ppbar} we discuss continuum $p \bar{p}$ production. Section~\ref{sec:section_f0_ppbar} deals with $p \bar{p}$ production via scalar resonances. First results are presented in Sec.~\ref{sec:results}, and Sec.~\ref{sec:conclusions} presents our conclusions. We include in our calculations the exchanges of the soft pomeron, of reggeons, and also of the soft odderon for some distributions. The odderon was introduced a long time ago \cite{Lukaszuk:1973nt,Joynson:1975az} (for a review, see, e.g. \cite{Ewerz:2003xi}) and has recently become very interesting again \cite{Antchev:2017yns,Martynov:2017zjz,Khoze:2017swe,Khoze:2018bus}. We want to emphasise that the purpose of our paper is not to compare predictions of our tensor-pomeron approach with alternatives for the soft-pomeron structure. This has been done extensively in \cite{Lebiedowicz:2013ika,Ewerz:2016onn}. Also, since we are interested in the soft-scattering regime we cannot use or compare with the perturbative pomeron, initiated in \cite{Low:1975sv,Nussinov:1975mw,Kuraev:1977fs,Balitsky:1978ic}. The purpose of our work is to give experimentalists a solid idea of what to expect theoretically in central exclusive $p \bar{p}$ production. What are the magnitudes of cross sections? Where is continuum $p \bar{p}$? Where is resonance production prominent? What is the role of secondary reggeon exchanges and, if it exists, of odderon exchange? What are the differences between $p \bar{p}$ and two pseudoscalars central production? We would hope that our calculations could serve as basis for the construction of an event generator for this and related processes. \footnote{The $\mathtt{GenEx}$ Monte Carlo generator \cite{Kycia:2014hea} could be used and expanded in this context.} A long-term goal would be to derive the coupling constants of our effective theory from nonperturbative QCD, but this is beyond the scope of the present paper. \section{$p \bar{p}$ continuum production} \label{sec:continuum_ppbar} We study central exclusive production of $p \bar{p}$ in proton-proton collisions at high energies \begin{eqnarray} p(p_{a},\lambda_{a}) + p(p_{b},\lambda_{b}) \to p(p_{1},\lambda_{1}) + \bar{p}(p_{3},\lambda_{3}) + p(p_{4},\lambda_{4}) + p(p_{2},\lambda_{2}) \,, \label{2to4_reaction} \end{eqnarray} where $p_{i}$ and $\lambda_{i} \in \lbrace +1/2, -1/2 \rbrace$, indicated in brackets, denote the 4-momenta and helicities of the nucleons, respectively. The ${\cal T}$-matrix element for the reaction (\ref{2to4_reaction}) will be denoted as follows \begin{equation} \begin{split} {\cal M}_{\lambda_{a}\lambda_{b} \to \lambda_{1}\lambda_{2}\lambda_{3}\lambda_{4}} = \langle p(p_{1}, \lambda_{1}), p(p_{4}, \lambda_{4}), \bar{p}(p_{3}, \lambda_{3}) p(p_{2}, \lambda_{2}) | {\cal T} &| p(p_{a}, \lambda_{a}), p(p_{b}, \lambda_{b})\rangle\,. \end{split} \label{Tamplitude} \end{equation} Note that the order of the particles in the bra and ket states matters since we are dealing with fermions. In general the full amplitude for the $p\bar{p}$ production is a sum of the continuum amplitude and the amplitudes with the $s$-channel resonances: \begin{equation} \begin{split} {\cal M}_{\lambda_{a}\lambda_{b} \to \lambda_{1}\lambda_{2}\lambda_{3}\lambda_{4}} = {\cal M}^{p\bar{p}{\rm-continuum}}_{\lambda_{a}\lambda_{b} \to \lambda_{1}\lambda_{2}\lambda_{3}\lambda_{4}} + {\cal M}^{p\bar{p}{\rm-resonances}}_{\lambda_{a}\lambda_{b} \to \lambda_{1}\lambda_{2}\lambda_{3}\lambda_{4}}\,. \end{split} \label{amplitude_pomTpomT} \end{equation} At high energies the exchange objects to be considered are the photon $\gamma$, the pomeron $\mathbb{P}$, the odderon $\mathbb{O}$, and the reggeons $\mathbb{R}$. Their charge conjugation and $G$-parity quantum numbers are listed in Table~I of \cite{Lebiedowicz:2016ioh}. We treat the $C=+1$ pomeron and the reggeons $\mathbb{R}_{+} = f_{2 \mathbb{R}}, a_{2 \mathbb{R}}$ as effective tensor exchanges while the $C=-1$ odderon and the reggeons $\mathbb{R}_{-} = \omega_{\mathbb{R}}, \rho_{\mathbb{R}}$ are treated as effective vector exchanges. \begin{figure} \includegraphics[width=6.cm]{born_t_ppbar.eps} \includegraphics[width=6.cm]{born_u_ppbar.eps} \caption{\label{fig:born_diagrams} \small The Born diagrams for the double pomeron/reggeon and photon-mediated central exclusive continuum $p\bar{p}$ production in proton-proton collisions. } \end{figure} The $p \bar{p}$ continuum amplitude is expressed as the sum of ${\rm \hat{t}}$ and ${\rm \hat{u}}$ diagrams shown in Fig.~\ref{fig:born_diagrams}, \begin{eqnarray} {\cal M}^{p\bar{p}-\rm{continuum}}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}} = {\cal M}^{({\rm \hat{t}})}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}}+ {\cal M}^{({\rm \hat{u}})}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}} \,. \label{pompom_amp} \end{eqnarray} The combinations $(C_{1}, C_{2})$ of exchanges that can contribute in (\ref{pompom_amp}) are \begin{eqnarray} && (C_{1}, C_{2}) = (1, 1): \;(\mathbb{P} + \mathbb{R}_{+}, \mathbb{P} + \mathbb{R}_{+})\,; \label{C_modes_ppbar_pp}\\ && (C_{1}, C_{2}) = (-1, -1):\; (\mathbb{O} + \mathbb{R}_{-} + \gamma, \mathbb{O} + \mathbb{R}_{-} + \gamma)\,; \label{C_modes_ppbar_mm}\\ && (C_{1}, C_{2}) = (1, -1):\; (\mathbb{P} + \mathbb{R}_{+}, \mathbb{O} + \mathbb{R}_{-} + \gamma)\,; \label{C_modes_ppbar_pm}\\ && (C_{1}, C_{2}) = (-1, 1):\; (\mathbb{O} + \mathbb{R}_{-} + \gamma, \mathbb{P} + \mathbb{R}_{+})\,. \label{C_modes_ppbar_mp} \end{eqnarray} Here $C_{1}$ and $C_{2}$ are the charge-conjugation quantum numbers of the exchange objects. The contributions involving the photon $\gamma$ in (\ref{C_modes_ppbar_mm}) to (\ref{C_modes_ppbar_mp}) are expected to be small but may be important at very small four-momentum transfer squared. The $(\gamma, \mathbb{P} + \mathbb{R}_{+})$ and $(\mathbb{P} + \mathbb{R}_{+}, \gamma)$ contributions will be very important for the $p \bar{p}$ production in $pA$ collisions. There one also has to take into account contact terms required by gauge invariance. This will be studied elsewhere. The contributions involving the odderon $\mathbb{O}$ are expected to be small since its coupling to the proton is very small. Thus, we shall concentrate on the diffractive production of $p \bar{p}$ through the $\mathbb{P}$, $\mathbb{R}_{+}$, and $\mathbb{R}_{-}$ exchanges but also mention odderon effects where appropriate. The kinematic variables for reaction (\ref{2to4_reaction}) are \begin{eqnarray} &&s = (p_{a} + p_{b})^{2} = (p_{1} + p_{2} + p_{3} + p_{4})^{2}\,, \nonumber \\ &&s_{ij} = (p_{i} + p_{j})^{2}, \quad s_{34} = M_{34}^{2} = (p_{3} + p_{4})^{2}\,,\nonumber \\ &&t_1 = q_{1}^{2}, \quad q_1 = p_{a} - p_{1}\,, \nonumber \\ &&t_2 = q_{2}^{2}, \quad q_2 = p_{b} - p_{2}\,, \nonumber \\ && \hat{p}_{t} = p_{a} - p_{1} - p_{3}\,, \nonumber \\ && \hat{p}_{u} = p_{4} - p_{a} + p_{1}\,. \label{2to4_kinematic} \end{eqnarray} Let us first take a look at the dominant ($\mathbb{P}$, $\mathbb{P}$) contribution. The ${\rm \hat{t}}$- and ${\rm \hat{u}}$-channel amplitudes for the $\mathbb{P} \mathbb{P}$-exchange can be written as \begin{equation} \begin{split} & {\cal M}^{({\rm \hat{t}})}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}} = (-i) \bar{u}(p_{1}, \lambda_{1}) i\Gamma^{(\mathbb{P} pp)}_{\mu_{1} \nu_{1}}(p_{1},p_{a}) u(p_{a}, \lambda_{a})\; i\Delta^{(\mathbb{P})\, \mu_{1} \nu_{1}, \alpha_{1} \beta_{1}}(s_{13},t_{1})\\ & \qquad \qquad \qquad \quad \times \bar{u}(p_{4}, \lambda_{4}) \, i\Gamma^{(\mathbb{P} pp)}_{\alpha_{2} \beta_{2}}(p_{4},\hat{p}_{t}) \, iS_{F}(\hat{p}_{t})\, i\Gamma^{(\mathbb{P} pp)}_{\alpha_{1} \beta_{1}}(\hat{p}_{t},-p_{3})\, v(p_{3}, \lambda_{3}) \\ & \qquad \qquad \qquad \quad \times i\Delta^{(\mathbb{P})\, \alpha_{2} \beta_{2}, \mu_{2} \nu_{2}}(s_{24},t_{2})\, \bar{u}(p_{2}, \lambda_{2}) i\Gamma^{(\mathbb{P} pp)}_{\mu_{2} \nu_{2}}(p_{2},p_{b}) u(p_{b}, \lambda_{b}) \,, \end{split} \label{amplitude_pompom_t} \end{equation} \begin{equation} \begin{split} & {\cal M}^{({\rm \hat{u}})}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}} = (-i) \bar{u}(p_{1}, \lambda_{1}) i\Gamma^{(\mathbb{P} pp)}_{\mu_{1} \nu_{1}}(p_{1},p_{a}) u(p_{a}, \lambda_{a})\; i\Delta^{(\mathbb{P})\, \mu_{1} \nu_{1}, \alpha_{1} \beta_{1}}(s_{14},t_{1})\\ & \qquad \qquad \qquad \quad \times \bar{u}(p_{4}, \lambda_{4}) \, i\Gamma^{(\mathbb{P} pp)}_{\alpha_{1} \beta_{1}}(p_{4},\hat{p}_{u})\, iS_{F}(\hat{p}_{u}) \, i\Gamma^{(\mathbb{P} pp)}_{\alpha_{2} \beta_{2}}(\hat{p}_{u},-p_{3})\, v(p_{3}, \lambda_{3}) \\ & \qquad \qquad \qquad \quad \times i\Delta^{(\mathbb{P})\, \alpha_{2} \beta_{2}, \mu_{2} \nu_{2}}(s_{23},t_{2})\, \bar{u}(p_{2}, \lambda_{2}) i\Gamma^{(\mathbb{P} pp)}_{\mu_{2} \nu_{2}}(p_{2},p_{b}) u(p_{b}, \lambda_{b}) \,. \end{split} \label{amplitude_pompom_u} \end{equation} Here we use the standard propagator for the proton $i S_{F}(\hat{p}) = i / (\hat{p}\!\!\!/ - m_{p})$. The effective propagator of the tensor-pomeron exchange and the pomeron-proton vertex function are given in section~3 of \cite{Ewerz:2013kda}. For the convenience of the reader we collect these and other quantities which we use in our work in Appendix~\ref{sec:appendixA}. For $\mathbb{P} \mathbb{P}$ fusion the centrally produced $p \bar{p}$ system is in a state of $C = +1$. This implies for the amplitude (\ref{Tamplitude}) the following: \begin{equation} \begin{split} &\langle p(p_{1}, \lambda_{1}), p(p_{4}, \lambda_{4}), \bar{p}(p_{3}, \lambda_{3}), p(p_{2}, \lambda_{2}) | {\cal T} | p(p_{a}, \lambda_{a}), p(p_{b}, \lambda_{b})\rangle^{(\mathbb{P},\mathbb{P})} \\ &=\langle p(p_{1}, \lambda_{1}), \bar{p}(p_{4}, \lambda_{4}), p(p_{3}, \lambda_{3}), p(p_{2}, \lambda_{2}) | {\cal T} | p(p_{a}, \lambda_{a}), p(p_{b}, \lambda_{b})\rangle^{(\mathbb{P},\mathbb{P})} \\ &=-\langle p(p_{1}, \lambda_{1}), p(p_{3}, \lambda_{3}), \bar{p}(p_{4}, \lambda_{4}), p(p_{2}, \lambda_{2}) | {\cal T} | p(p_{a}, \lambda_{a}), p(p_{b}, \lambda_{b})\rangle^{(\mathbb{P},\mathbb{P})} \,. \end{split} \label{Tamplitude_aux} \end{equation} Here, we work in the overall c.m. system and assume that the helicity states for the centrally produced $p$ and $\bar{p}$ are both taken of the same type, e.g., of type (a); see Appendix~A of \cite{Klusek-Gawenda:2017lgt}. This antisymmetry relation (\ref{Tamplitude_aux}) can, of course, be verified explicitly using the expressions for ${\cal M}^{({\rm \hat{t}})}$ and ${\cal M}^{({\rm \hat{u}})}$ from (\ref{amplitude_pompom_t}) and (\ref{amplitude_pompom_u}), respectively. If we use another choice of $p$ and $\bar{p}$ helicity states in the c.m. system we will get additional phase factors in (\ref{Tamplitude_aux}) and the corresponding relations for the other $(C_{1}, C_{2})$ exchanges. But these phase factors drop out for distributions where the polarisations of the centrally produced $p$ and $\bar{p}$ are not observed. Thus, our above choice for the $p$ and $\bar{p}$ helicity states is very convenient as it makes the $p \bar{p}$ charge-conjugation relations for the amplitudes simple and explicit. The antisymmetry relation (\ref{Tamplitude_aux}) holds for all exchanges with $(C_{1}, C_{2})$ = $(1,1)$ and $(-1,-1)$; see (\ref{C_modes_ppbar_pp}) and (\ref{C_modes_ppbar_mm}). For the exchanges with $(C_{1}, C_{2})$ = $(1,-1)$ and $(-1,1)$ we have, instead, symmetry under the exchange $\left( p(p_{4}, \lambda_{4}), \bar{p}(p_{3}, \lambda_{3}) \right) \to \left( p(p_{3}, \lambda_{3}), \bar{p}(p_{4}, \lambda_{4}) \right)$; see (\ref{C_modes_ppbar_pm}) and (\ref{C_modes_ppbar_mp}). In the high-energy approximation, we can write the $\mathbb{P} \mathbb{P}$-exchange amplitude as \begin{equation} \begin{split} & {\cal M}^{(\mathbb{P} \mathbb{P} \to p \bar{p})}_{\lambda_{a} \lambda_{b} \to \lambda_{1} \lambda_{2} \lambda_{3} \lambda_{4}} \simeq (3 \beta_{\mathbb{P} NN})^{2}\, 2 (p_1 + p_a)_{\mu_{1}} (p_1 + p_a)_{\nu_{1}}\, \delta_{\lambda_{1} \lambda_{a}} \,[F_{1}(t_{1})]^{2}\\ & \qquad\qquad\qquad\quad \times \bar{u}(p_{4}, \lambda_{4}) \Large[ \gamma^{\mu_{2}}(p_{4}+\hat{p}_{t})^{\nu_{2}} \, \frac{1}{4 s_{13}} (- i s_{13} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{1})-1} \frac{[\hat{F}_{p}(\hat{p}_{t}^{2})]^{2}}{\slash{\hat{p}}_{t} - m_{p}}\\ & \qquad\qquad\qquad \quad \times \gamma^{\mu_{1}}(\hat{p}_{t}-p_{3})^{\nu_{1}} \, \frac{1}{4 s_{24}} (- i s_{24} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{2})-1}\\ &\qquad\qquad\qquad \qquad + \gamma^{\mu_{1}}(p_{4}+\hat{p}_{u})^{\nu_{1}} \frac{1}{4 s_{14}} (- i s_{14} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{1})-1} \frac{[\hat{F}_{p}(\hat{p}_{u}^{2})]^{2}}{\slash{\hat{p}}_{u} - m_{p}} \\ & \qquad\qquad\qquad \quad \times \gamma^{\mu_{2}}(\hat{p}_{u}-p_{3})^{\nu_{2}} \, \frac{1}{4 s_{23}} (- i s_{23} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{2})-1} \Large]\, v(p_{3}, \lambda_{3}) \\ & \qquad\qquad\qquad\quad \times (3 \beta_{\mathbb{P} NN})^{2}\,2 (p_2 + p_b)_{\mu_{2}} (p_2 + p_b)_{\nu_{2}}\, \delta_{\lambda_{2} \lambda_{b}}\, [F_{1}(t_{2})]^{2} \,. \end{split} \label{amplitude_pompom_approx} \end{equation} In (\ref{amplitude_pompom_approx}), we have introduced a form factor $\hat{F}_{p}(\hat{p}^{2})$, taking into account that the intermediate protons in Fig.~\ref{fig:born_diagrams} are off shell. This proton off-shell form factor is parametrized here in the exponential form, \begin{eqnarray} \hat{F}_{p}(\hat{p}^{2}) = \exp\left( \frac{\hat{p}^{2}-m_{p}^{2}}{\Lambda_{off,E}^{2}} \right) \,, \label{ff_exp} \end{eqnarray} where $\Lambda_{off,E}$ has to be adjusted to experimental data. The form factor (\ref{ff_exp}) is normalized to unity at the on-shell point $\hat{p}^{2} = m_{p}^{2}$. In a way similar to (\ref{amplitude_pompom_t}) - (\ref{amplitude_pompom_approx}) we can write the amplitudes for the exchanges $(\mathbb{P}, \mathbb{R}_{+})$, $(\mathbb{R}_{+}, \mathbb{P})$, and $(\mathbb{R}_{+}, \mathbb{R}_{+})$, since both, $\mathbb{P}$ and $\mathbb{R}_{+}$ exchange, are treated as tensor exchanges in our model. The contributions in (\ref{C_modes_ppbar_mm}) - (\ref{C_modes_ppbar_mp}) involving $C = -1$ exchanges are different. We recall that $\mathbb{R}_{-}$ exchanges are treated as effective vector exchanges in our model; see Sec.~3 of \cite{Ewerz:2013kda} and Appendix~\ref{sec:appendixA} of the present paper. \section{$pp \to pp (f_{0} \to p \bar{p})$} \label{sec:section_f0_ppbar} The resonances produced diffractively in the $p \bar{p}$ channel are not well known. Therefore, we will concentrate only on the $s$-channel scalar resonances. We shall study the reaction $pp \to pp (f_{0} \to p \bar{p})$ where $f_{0}$ stands for one of the $f_{0}(2020)$, $f_{0}(2100)$, and $f_{0}(2200)$ states with $I^{G}(J^{PC})= 0^{+}(0^{++})$. It must be noted that these states are only listed in \cite{Olive:2016xmw} and are not included in the summary tables. Also their couplings to the $p \bar{p}$ channel are essentially unknown. The $\mathbb{P} \mathbb{P}$-exchange amplitude through a scalar resonance $f_{0} \to p \bar{p}$ can be written as \begin{equation} \begin{split} & {\cal M}^{(\mathbb{P} \mathbb{P} \to f_{0} \to p \bar{p})}_{\lambda_{a}\lambda_{b} \to\lambda_{1}\lambda_{2}\lambda_{3}\lambda_{4}} \simeq 3 \beta_{\mathbb{P} NN} \, 2(p_1 + p_a)_{\mu_{1}} (p_1 + p_a)_{\nu_{1}}\, \delta_{\lambda_{1} \lambda_{a}}\, F_1(t_1) \; \frac{1}{4 s_{1}} (- i s_{1} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{1})-1} \\ & \quad \quad \times \Gamma^{(\mathbb{P} \mathbb{P} f_{0})\,\mu_{1} \nu_{1}, \mu_{2} \nu_{2}}(q_{1},q_{2})\, \Delta^{(f_{0})}(p_{34})\, \bar{u}(p_{4}, \lambda_{4}) \, \Gamma^{(f_{0} p \bar{p})}(p_{4},-p_{3})\, v(p_{3}, \lambda_{3}) \\ & \quad \quad\times \frac{1}{4 s_{2}} (- i s_{2} \alpha'_{\mathbb{P}})^{\alpha_{\mathbb{P}}(t_{2})-1}\, 3 \beta_{\mathbb{P} NN} \, 2 (p_2 + p_b)_{\mu_{2}} (p_2 + p_b)_{\nu_{2}}\, \delta_{\lambda_{2} \lambda_{b}}\, F_1(t_2) \,, \end{split} \label{amplitude_approx_ppbar} \end{equation} where $s_{1} = (p_{1} + p_{3} + p_{4})^{2}$, $s_{2} = (p_{2} + p_{3} + p_{4})^{2}$, and $p_{34} = p_{3} + p_{4}$. The effective Lagrangians and the vertices for $\mathbb{P} \mathbb{P}$ fusion into an $f_{0}$ meson are discussed in Appendix~A of \cite{Lebiedowicz:2013ika}. As was shown there the tensorial $\mathbb{P} \mathbb{P} f_{0}$ vertex corresponds to the sum of the two lowest values of $(l,S)$, that is, $(l,S) = (0,0)$ and $(2,2)$ with coupling parameters $g_{\mathbb{P} \mathbb{P} f_{0}}'$ and $g_{\mathbb{P} \mathbb{P} f_{0}}''$, respectively. The vertex, including a form factor, reads then as follows ($p_{34} = q_{1} + q_{2}$): \begin{eqnarray} i\Gamma_{\mu \nu,\kappa \lambda}^{(\mathbb{P} \mathbb{P} f_{0})} (q_{1},q_{2}) = \left( i\Gamma_{\mu \nu,\kappa \lambda}'^{(\mathbb{P} \mathbb{P} f_{0})}\mid_{bare} + i\Gamma_{\mu \nu,\kappa \lambda}''^{(\mathbb{P} \mathbb{P} f_{0})} (q_{1}, q_{2})\mid_{bare} \right) \tilde{F}^{(\mathbb{P} \mathbb{P} f_{0})}(q_{1}^{2},q_{2}^{2},p_{34}^{2}) \,; \label{vertex_pompomS} \end{eqnarray} see Eq.~(A.21) of \cite{Lebiedowicz:2013ika}. As was shown in \cite{Lebiedowicz:2013ika} these two $(l,S)$ couplings give different results for the distribution in the azimuthal angle between the transverse momenta $\vec{p}_{t,1}$ and $\vec{p}_{t,2}$ of the outgoing leading protons. We take the factorized form for the pomeron-pomeron-meson form factor \begin{eqnarray} \tilde{F}^{(\mathbb{P} \mathbb{P} f_{0})}(q_{1}^{2},q_{2}^{2},p_{34}^{2}) = F_{M}(q_{1}^{2}) F_{M}(q_{2}^{2}) F^{(\mathbb{P} \mathbb{P} f_{0})}(p_{34}^{2})\, \label{Fpompommeson} \end{eqnarray} normalised to $\tilde{F}^{(\mathbb{P} \mathbb{P} f_{0})}(0,0,m_{f_{0}}^{2}) = 1$. We will further set \begin{eqnarray} F^{(\mathbb{P} \mathbb{P} f_{0})}(p_{34}^{2}) = \exp{ \left( \frac{-(p_{34}^{2}-m_{f_{0}}^{2})^{2}}{\Lambda_{f_{0}}^{4}} \right)}\,, \quad \Lambda_{f_{0}} = 1\;{\rm GeV}\,. \label{Fpompommeson_ff} \end{eqnarray} The scalar-meson propagator is taken as \begin{eqnarray} i\Delta^{(f_{0})}(p_{34}) = \dfrac{i}{p_{34}^{2}-m_{f_{0}}^2+i m_{f_{0}} \Gamma_{f_{0}}}\,, \label{prop_scalar} \end{eqnarray} with constant widths for the $f_{0}$ states with the numerical values from \cite{Olive:2016xmw}. For the $f_{0} p \bar{p}$ vertex we have \begin{eqnarray} i\Gamma^{(f_{0} p \bar{p})}(p_{4},-p_{3}) = i g_{f_{0} p \bar{p}} \, F^{(f_{0} p \bar{p})}(p_{34}^{2})\,, \end{eqnarray} where $g_{f_{0} p \bar{p}}$ is an unknown dimensionless parameter. We assume $g_{f_{0} p \bar{p}}>0$ and $F^{(f_{0} p \bar{p})}(p_{34}^{2})$ = $F^{(\mathbb{P} \mathbb{P} f_{0})}(p_{34}^{2})$; see Eq.~(\ref{Fpompommeson_ff}). \section{First results} \label{sec:results} We start our analysis by comparing the cross section of our non-resonant contribution to the $pp \to pp p\bar{p}$ reaction (\ref{2to4_reaction}) with the CERN ISR data at $\sqrt{s} = 62$~GeV \cite{Breakstone:1989ty}. In \cite{Breakstone:1989ty} the centrally produced antiproton and proton were restricted to lie in the rapidity regions $|{\rm y}_{3}|$, $|{\rm y}_{4}| < 1.5$, respectively, and the outgoing forward protons to have $x_{F,p} > 0.9$ and the four-momentum transfer squared $|t| \geqslant 0.08$~GeV$^{2}$. With such kinematic conditions we get the integrated cross section of $\sigma_{th} = 0.013$ and 0.236~$\mu$b for $\Lambda_{off,E} = 0.8$ and 1~GeV, respectively, compared with $\sigma_{exp} = 0.80 \pm 0.17$~$\mu$b from \cite{Breakstone:1989ty}. Our theoretical results have been obtained in the Born approximation (neglecting absorptive corrections). The realistic cross section can be obtained by multiplying the Born cross section by the corresponding gap survival factor $\langle S^{2} \rangle$. At the ISR energies we estimate it to be $\langle S^{2} \rangle \simeq 0.5$.~\footnote{In exclusive reactions, as the $pp \to pp \pi^{+}\pi^{-}$ one, for instance, the gap survival factor is strongly dependent on the $t_{1}$ and $t_{2}$ variables; see e.g.~\cite{Lebiedowicz:2014bea,Lebiedowicz:2015eka}.} In our calculations, we include the pomeron and reggeon $\mathbb{R}_{+}$ and $\mathbb{R}_{-}$ exchanges; see (\ref{C_modes_ppbar_pp}) - (\ref{C_modes_ppbar_mp}). For double pomeron exchange and $\Lambda_{off,E} = 1$~GeV we get only $\sigma_{th} = 0.077$~$\mu$b. It is seen that inclusion of subleading reggeon exchanges is crucial at the ISR energy. In \cite{Akesson:1985rn} the measurement was performed at $\sqrt{s} = 63$~GeV, $|{\rm y}_{3}|, |{\rm y}_{4}| \leqslant 1$, $x_{F,p} > 0.95$, $0.01 \lesssim |t| \lesssim 0.06$~GeV$^{2}$ and the cross section $d^{2}\sigma_{exp}/dt_{1}dt_{2} = 1.0 \pm 0.5$~$\mu$b~GeV$^{-4}$ for $t_{1} = t_{2} = -0.035$~GeV$^{2}$ was determined. We get (without absorption) $d^{2}\sigma_{th}/dt_{1}dt_{2} = 0.73$ and 14.14~$\mu$b~GeV$^{-4}$ for $\Lambda_{off,E} = 0.8$ and 1~GeV, respectively. We see that this experiment supports the smaller value of $\Lambda_{off,E}$. Although the ISR experiments \cite{Akesson:1985rn,Breakstone:1989ty} were performed for different kinematic coverage, in both an enhancement in the low $p \bar{p}$ invariant-mass region was observed. The low-mass enhancement is clearly seen also at the WA102 energy \cite{Barberis:1998sr}, see Fig.~1~(b) there. Therefore, the non-resonant (continuum) contribution alone is not sufficient to describe the low-energy data and, e.g., scalar and/or tensor resonance contributions should be taken into account. We will return to this issue below (see Fig.~\ref{fig:f0}). Now we show numerical results for the reaction $pp \to pp p\bar{p}$ at higher energies. In Table~\ref{tab:table} we have collected cross sections in $\mu b$ for the exclusive $p \bar{p}$ continuum including some experimental cuts. We show results for the pomeron and reggeon exchanges in the amplitude (see the column ``$\mathbb{P}$ and $\mathbb{R}$'') and when only the $(\mathbb{P}, \mathbb{P})$ term contributes (see the column ``$\mathbb{P}$''). The calculations have been done in the Born approximation (without absorption effects) and for $\Lambda_{off,E} = 1$~GeV in (\ref{ff_exp}). The absorption effects lead to a damping of the cross section by a factor 5 for $\sqrt{s} = 0.2$~TeV and by a factor 10 for $\sqrt{s} = 13$~TeV; see e.g.~\cite{Lebiedowicz:2015eka}. The next-to-last line in Table~\ref{tab:table} shows result with an extra cut on leading protons of 0.17~GeV~$< |p_{y,1}|, |p_{y,2}|<$~0.5~GeV that will be measured in ALFA on both sides of the ATLAS detector. \begin{table} \begin{small} \caption{The integrated cross sections in $\mu$b for the exclusive diffractive $p \bar{p}$ continuum production for some experimental cuts on (pseudo)rapidity and $p_{t}$ of centrally produced individual $p$ and $\bar{p}$ for the STAR, ALICE, ATLAS, CMS, and LHCb experiments. Results for some limitations on leading protons are also shown. The column ``$\mathbb{P}$ and $\mathbb{R}$'' shows the resulting total cross sections from $\mathbb{P}$ and $\mathbb{R}$ ($\mathbb{R}_{+}$ and $\mathbb{R}_{-}$) exchanges, which include, of course, the interference term between the various components. The column ``$\mathbb{P}$'' shows results obtained for the $\mathbb{P}$ exchange alone. We have taken here $\Lambda_{off,E} = 1$~GeV. No absorption effects were included here. } \label{tab:table} \begin{center} \begin{tabular}{|c|l|c|c|c|} \hline $\sqrt{s}$, TeV & Cuts &$\mathbb{P}$ and $\mathbb{R}$ & $\mathbb{P}$ \\ \hline 0.2 &$|\eta| < 1$, $p_{t} > 0.2$~GeV & 0.031 & 0.018 \\ 0.2 &$|\eta| < 1$, $p_{t} > 0.2$~GeV, $0.03 < -t_{1,2} < 0.3$~GeV$^{2}$ & 0.014 & 0.008 \\ 13 &$|\eta| < 0.9$, $p_{t} > 0.1$~GeV & 0.032 & 0.031 \\ 13 &$|\rm{y}| < 2$, $p_{t} > 0.2$~GeV & 2.38 & 2.19 \\ 13 &$|\eta| < 2.5$, $p_{t} > 0.1$~GeV & 1.96 & 1.82 \\ 13 &$|\eta| < 2.5$, $p_{t} > 0.1$~GeV, $0.17 < |p_{y}| < 0.5$~GeV & 0.31 & 0.29 \\ 13 &$2 < \eta < 4.5$, $p_{t} > 0.2$~GeV & 0.79 & 0.68 \\ \hline \end{tabular} \end{center} \end{small} \end{table} We have also calculated the corresponding cross sections for the $pp \to pp \Lambda \overline{\Lambda}$ reaction, taking into account only the dominant $(\mathbb{P}, \mathbb{P})$ contribution. The amplitude ${\cal M}^{(\mathbb{P} \mathbb{P} \to \Lambda \overline{\Lambda})}$ is very much the same as ${\cal M}^{(\mathbb{P} \mathbb{P} \to p \bar{p})}$ (\ref{amplitude_pompom_approx}) but with $m_{p}$, $\hat{F}_{p}$ replaced by $m_{\Lambda}$, $\hat{F}_{\Lambda}$. To describe the off-shellness of the intermediate $t/u$-channel $\Lambda$ baryons we assume the form factor given by Eq.~(\ref{ff_exp}) with $\Lambda_{off,E} = 1$~GeV. For the coupling of the $\Lambda$ baryon to the pomeron we make an ansatz similar to the proton-pomeron coupling in (\ref{A4}) of Appendix~\ref{sec:appendixA} but with $\beta_{\mathbb{P} NN}$ replaced by a constant $\beta_{\mathbb{P} \Lambda \Lambda}$. The value of the latter can be estimated from the data on the total cross sections for $\Lambda p$ and $pp$ scattering at high energies \footnote{ The $\Lambda p$ total cross sections were measured in Refs.~\cite{Alexander:1969cx,Bassano:1967kbh,Kadyk:1971tc,Gjesdal:1972zu}. In Ref.~\cite{Gjesdal:1972zu} the average cross section was obtained as $\sigma_{tot}(\Lambda p) = 34.6 \pm 0.4$~mb in the hyperon momentum interval $P_{lab} = 6 - 21$~GeV (which corresponds to $\sqrt{s} \sim 4 - 6$~GeV). The lack of $\sigma_{tot}(\Lambda p)$ data at higher energy does not allow any reasonable estimate of the ratio, $\sigma_{tot}(\Lambda p)/\sigma_{tot}(pp)$, for the pomeron part alone. Instead we can argue that this ratio should be less than 1, similar to $\sigma_{tot}^{(\mathbb{P})}(K^{+} p)/\sigma_{tot}^{(\mathbb{P})}(\pi^{+}p) < 1$; see Sec. 3.1 of Ref.~\cite{Donnachie:2002en}. The factor 0.9 in Eq.~(\ref{beta_PLL}) is our educated guess. Data files and plots of various hadronic cross sections can be found in Ref.~\cite{PDG_CrossSections}.} using (6.41) of \cite{Ewerz:2013kda} \begin{eqnarray} \beta_{\mathbb{P} \Lambda \Lambda} \cong \beta_{\mathbb{P} NN} \frac{\sigma_{tot}(\Lambda p)}{\sigma_{tot}(pp)} \cong 1.87\;{\rm GeV}^{-1} \times 0.9 \simeq 1.68\;{\rm GeV}^{-1}\,. \label{beta_PLL} \end{eqnarray} We find a cross section of 0.11~$\mu$b for $\sqrt{s} = 13$~TeV and the ATLAS cuts ($|\eta| < 2.5$, $p_{t} > 0.1$~GeV on centrally produced $\Lambda$ and $\overline{\Lambda}$ baryons) and a cross section of 0.04~$\mu$b for the LHCb cuts ($2 < \eta < 4.5$ and $p_{t} > 0.2$~GeV). The calculated cross section for the $\Lambda \overline{\Lambda}$ continuum production is about 16 times smaller than the corresponding $p \bar{p}$ continuum production one. In Figs.~\ref{fig:dsig_dMhh} and \ref{fig:dsig_dy}, we present the distributions in the $p \bar{p}$ invariant mass $M_{34}$, in the antiproton rapidity ${\rm y}_{3}$, and in the rapidity distance between the antiproton and proton ${\rm y}_{diff} = {\rm y}_{3}-{\rm y}_{4}$ at $\sqrt{s} = 13$~TeV. We wanted to concentrate only on the main characteristics of the $p \bar{p}$ continuum production; therefore, the calculations have been done neglecting the absorptive corrections. To illustrate uncertainties of our model, we take in the calculation two values of $\Lambda_{off,E}$; see Eq.~(\ref{ff_exp}). The black long-dashed line represents the result for $\Lambda_{off,E} = 1$~GeV, and the black short-dashed line represents the result for $\Lambda_{off,E} = 0.8$~GeV. For comparison, we also show results for the $\pi^+ \pi^-$ and $K^+ K^-$ continuum production, see the blue solid line and the blue dotted line, respectively. The reaction $pp \to pp \pi^{+} \pi^{-}$ was discussed already in~\cite{Lebiedowicz:2016ioh}. The reaction $pp \to pp K^{+} K^{-}$ in the tensor-pomeron approach was recently studied in~\cite{Lebiedowicz:2018eui}. For reference, we show also a naive (``spin-0 protons'') result for artificially modified spin of centrally produced nucleons, from 1/2 to 0; see the red dash-dotted line. Here, we assume the amplitude as for $K^{+} K^{-}$ production but with some modifications, e.g., in the case of the $(\mathbb{P},\mathbb{P})$ term replacing $m_{K}$, $2 \beta_{\mathbb{P} K K}$, and $F_{M}(t_{1,2})$ by $m_{p}$, $3 \beta_{\mathbb{P} NN}$, and $F_{1}(t_{1,2})$, respectively. We take into account also reggeon exchanges with the corresponding reggeon-nucleon-nucleon coupling parameters. This result is purely academic but illustrates how important the correct inclusion of the spin degrees of freedom is in the Regge calculation. Different spin of the produced particles clearly leads to different results. \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{M34_cuts.eps} \includegraphics[width=0.48\textwidth]{M34_cuts_LHCb.eps} \caption{\label{fig:dsig_dMhh} \small The invariant mass distributions for centrally produced $\pi^+ \pi^-$, $K^+ K^-$ and $p \bar{p}$ systems for different experimental conditions at $\sqrt{s} = 13$~TeV. Results for the combined tensor-pomeron and reggeon exchanges and $\Lambda_{off,E} = 1$~GeV are presented. For the $p \bar{p}$ production we show results also for $\Lambda_{off,E} = 0.8$~GeV; see (\ref{ff_exp}). No absorption effects were included here.} \end{figure} In Fig.~\ref{fig:dsig_dMhh} we compare the invariant mass distributions for the $\pi^+ \pi^-$, $K^+ K^-$ and $p \bar{p}$ cases for two different experimental conditions at $\sqrt{s} = 13$~TeV. In our calculations we have included both pomeron and reggeon exchanges. The distribution in $p \bar{p}$ invariant mass has much larger threshold but is also much less steep, compared to that for production of pseudoscalar meson pairs. This effect is related to the spin of the produced particles (1/2 versus 0). We hope for a confirmation of the slope of the invariant mass distribution, e.g., by the ATLAS or the ALICE collaboration. We see from Fig.~\ref{fig:dsig_dMhh} that the normalisations of the $M_{34}$ distributions for $p \bar{p}$ are very sensitive to the cutoff parameter $\Lambda_{off,E}$ of (\ref{ff_exp}). In addition, we have the effects of absorption corrections. To fix the magnitudes of these two effects, we will have, at the moment, to have recourse to experimental input which, presumably, will come soon. \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{y3_cuts.eps} \includegraphics[width=0.48\textwidth]{y3_cuts_LHCb.eps} \includegraphics[width=0.48\textwidth]{ydiffa_cuts.eps} \includegraphics[width=0.48\textwidth]{ydiffa_cuts_LHCb.eps} \caption{\label{fig:dsig_dy} \small The differential cross sections for various processes at $\sqrt{s} = 13$~TeV. In the top panels we show the rapidity distributions obtained for the tensor pomeron and reggeon exchanges. In the bottom panels we show the distributions in the rapidity difference between the centrally produced hadrons. No absorption effects were included here.} \end{figure} In Fig.~\ref{fig:dsig_dy}, we show the rapidity distributions (the top panels) and the distributions in rapidity difference ${\rm y}_{diff} = {\rm y}_{3} - {\rm y}_{4}$ (the bottom panels) for the ATLAS and LHCb pseudorapidity ranges. The distribution in the (anti)proton rapidity looks rather standard while the distribution for ${\rm y}_{diff}$ is very special. We predict a dip in the rapidity difference between the antiproton and proton for ${\rm y}_{diff} = 0$. The dip is caused by a good separation of ${\rm \hat{t}}$ and ${\rm \hat{u}}$ contributions in (${\rm y}_{3}, {\rm y}_{4}$) space. This novel effect is inherently related to the spin 1/2 of the produced hadrons. We have checked that for the $p \bar{p}$ production the ${\rm \hat{t}}$- and ${\rm \hat{u}}$-channel diagrams interfere destructively for $(C_{1},C_{2}) = (1,1)$ and $(-1,-1)$ exchanges and constructively for $(1,-1)$ and $(-1,1)$ exchanges. For the $\pi^{+} \pi^{-}$ production, we get the opposite interference effects between the ${\rm \hat{t}}$- and ${\rm \hat{u}}$-channel diagrams. \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{c3_pipi_13_E1_0_tot.eps} \includegraphics[width=0.48\textwidth]{c3_ppbar_13_E1_0_tot.eps} \caption{\label{fig:dsig_dy3dy4} \small The two-dimensional distributions in (${\rm y}_{3}, {\rm y}_{4}$) for two processes at $\sqrt{s} = 13$~TeV. Results for the combined tensor-pomeron and reggeon exchanges are presented. We have taken here $\Lambda_{off,E} = 1$~GeV; see (\ref{ff_exp}). No absorption effects were included here. The asymmetry in the right panel will be discussed below.} \end{figure} In Fig.~\ref{fig:dsig_dy3dy4} we show the two-dimensional distributions in rapidity of the $\pi^+$ and $\pi^-$ (the left panel) and of the antiproton and proton (the right panel) for the full phase space. In our calculations we have included both pomeron and reggeon exchanges. The reggeon exchange contributions lead to enhancements of the cross section mostly at large rapidities of the centrally produced hadrons. For the production of the dipion continuum, the cross section is concentrated along the diagonal $\rm{y}_{3} = \rm{y}_{4}$. For the production of $p \bar{p}$ pairs, one can observe that the dip extends over the whole diagonal in (${\rm y}_{3}, {\rm y}_{4}$) space. \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{eta_asym.eps}\\ \includegraphics[width=0.48\textwidth]{eta_asym_ATLAS.eps} \includegraphics[width=0.48\textwidth]{eta_asym_LHCb.eps} \caption{\label{fig:asym} \small The asymmetry $A_{p\bar{p}}(\eta)$ (\ref{asymmetry_eta}) as function of the pseudorapidity $\eta$ for the full phase space (the top panel) and for the ATLAS and LHCb pseudorapidity ranges (the bottom panels) at $\sqrt{s} = 13$~TeV. Cuts on the transverse momenta of the centrally produced nucleons $p_{t,3}, p_{t,4} > 0.1$ and 0.2~GeV for the ATLAS and LHCb, respectively, have been imposed.} \end{figure} Figure~\ref{fig:asym} shows the asymmetry \begin{eqnarray} A_{p\bar{p}}(\eta) = \frac{\frac{d\sigma}{d\eta_{3}}(\eta) - \frac{d\sigma}{d\eta_{4}}(\eta)} {\frac{d\sigma}{d\eta_{3}}(\eta) + \frac{d\sigma}{d\eta_{4}}(\eta)}\,, \label{asymmetry_eta} \end{eqnarray} where $\eta_{3}$ and $\eta_{4}$ are the pseudorapidities of the antiproton and proton, respectively, as a function of the pseudorapidity $\eta$ at $\sqrt{s} = 13$~TeV. No absorption effects are included here, but they should approximately cancel in the ratio. Sizeable asymmetries are predicted in the full phase space. Much smaller asymmetries are seen for the limited range of pseudorapidities corresponding to the ATLAS, CMS, and ALICE experiments. The effect is better seen for the LHCb experiment, which covers the higher pseudorapidity region relevant for the reggeon exchanges. The asymmetry is caused by the interference of the $(C_{1},C_{2}) = (1,1)$ and $(-1,-1)$ exchanges with the $(C_{1},C_{2}) = (1,-1)$ and $(-1,1)$ exchanges; see (\ref{C_modes_ppbar_pp}) - (\ref{C_modes_ppbar_mp}). The former exchanges give an amplitude that is antisymmetric under $p_{3} \leftrightarrow p_{4}$, whereas the latter exchanges give a symmetric amplitude under $p_{3} \leftrightarrow p_{4}$; see (\ref{Tamplitude_aux}) and the discussion following it. Thus, the resulting $p \bar{p}$ distribution will not be symmetric under $p_{3} \leftrightarrow p_{4}$. The biggest contributions to the asymmetry come from the interference of the $(\mathbb{P},\mathbb{P})$ term with the $(\mathbb{P}, \omega_{\mathbb{R}})$ and $(\omega_{\mathbb{R}},\mathbb{P})$ contributions to the total amplitude. The prediction is that at larger $|\eta|$ more $\bar{p}$ than $p$ should be observed, while at smaller $|\eta|$, the situation is reversed. More general asymmetries than (\ref{asymmetry_eta}) can be considered and are again due to the interference of the $(C_{1},C_{2}) = (1,1)$ and $(-1,-1)$ with the $(C_{1},C_{2}) = (1,-1)$ and $(-1,1)$ exchanges. We emphasize that the following discussion holds for both non-resonant and resonant $p \bar{p}$ production. We can, for instance, consider the one-particle distributions for the central $p$ and $\bar{p}$ in the overall c.m. system, \begin{eqnarray} &&\frac{d^{3}\sigma}{d^{3}p_{3}}(\vec{p}_{3}) \quad {\rm for \;the \;antiproton}\,, \nonumber\\ &&\frac{d^{3}\sigma}{d^{3}p_{4}}(\vec{p}_{4}) \quad {\rm for \;the \;proton}\,, \nonumber \end{eqnarray} and the asymmetry \begin{eqnarray} A^{(1)}(\vec{p})=\frac{\frac{d^{3}\sigma}{d^{3}p_{3}}(\vec{p})-\frac{d^{3}\sigma}{d^{3}p_{4}}(\vec{p})} {\frac{d^{3}\sigma}{d^{3}p_{3}}(\vec{p})+\frac{d^{3}\sigma}{d^{3}p_{4}}(\vec{p})}\,. \label{asymmetry_1} \end{eqnarray} Here, the leading protons $p(\vec{p}_{1})$ and $p(\vec{p}_{2})$ may be integrated over their whole or only a part of their phase space. We can also consider the two-particle cross section for the centrally produced $p$ and $\bar{p}$: $\frac{d^{6}\sigma}{d^{3}p_{3} d^{3}p_{4}}(\vec{p}_{3},\vec{p}_{4})$. A suitable asymmetry there is \begin{eqnarray} A^{(2)}(\vec{p},\vec{p}')=\frac{\frac{d^{6}\sigma}{d^{3}p_{3} d^{3}p_{4}}(\vec{p},\vec{p}') -\frac{d^{6}\sigma}{d^{3}p_{3} d^{3}p_{4}}(\vec{p}',\vec{p})} {\frac{d^{6}\sigma}{d^{3}p_{3} d^{3}p_{4}}(\vec{p},\vec{p}') +\frac{d^{6}\sigma}{d^{3}p_{3} d^{3}p_{4}}(\vec{p}',\vec{p})}\,. \label{asymmetry_2} \end{eqnarray} In words, this asymmetry means the following. We choose two momenta $\vec{p}$ and $\vec{p}'$. Then, we ask if the situations ($\bar{p}(\vec{p}),p(\vec{p}')$) and ($\bar{p}(\vec{p}'),p(\vec{p})$) occur at the same or at a different rate. Another asymmetry of this type can be constructed from the pseudorapidity distributions $\frac{d^{2}\sigma}{d\eta_{3}d\eta_{4}}(\eta_{3},\eta_{4})$. For two pseudorapidities $\eta$ and $\eta'$, we define \begin{eqnarray} \widetilde{A}^{(2)}(\eta,\eta')=\frac{\frac{d^{2}\sigma}{d\eta_{3} d\eta_{4}}(\eta,\eta') -\frac{d^{2}\sigma}{d\eta_{3} d\eta_{4}}(\eta',\eta)} {\frac{d^{2}\sigma}{d\eta_{3} d\eta_{4}}(\eta,\eta') +\frac{d^{2}\sigma}{d\eta_{3} d\eta_{4}}(\eta',\eta)}\,. \label{asymmetry_3} \end{eqnarray} For the quantity $\frac{d^{2}\sigma}{d\eta_{3}d\eta_{4}}(\eta_{3},\eta_{4})$ and the asymmetry $\widetilde{A}^{(2)}(\eta,\eta')$, we have also investigated effects of an odderon using the parameters of (\ref{A12}) - (\ref{A14}). In Fig.~\ref{fig:5a}, we show, in two-dimensional plots, the ratios \begin{eqnarray} &&R^{(\mathbb{P} + \mathbb{R})}(\eta_{3},\eta_{4}) = \frac{d^{2}\sigma^{(\mathbb{P} + \mathbb{R})}/d\eta_{3}d\eta_{4}}{d^{2}\sigma^{(\mathbb{P})}/d\eta_{3}d\eta_{4}}\,, \label{ratio_eta3eta4_PR}\\ &&R^{(\mathbb{P} + \mathbb{R} + \mathbb{O})}(\eta_{3},\eta_{4}) = \frac{d^{2}\sigma^{(\mathbb{P} + \mathbb{R} + \mathbb{O})}/d\eta_{3}d\eta_{4}}{d^{2}\sigma^{(\mathbb{P} + \mathbb{R})}/d\eta_{3}d\eta_{4}} \label{ratio_eta3eta4_PRO} \end{eqnarray} for $\sqrt{s} = 13$~TeV and $-6 \leqslant \eta_{3}, \eta_{4} \leqslant 6$. We see that in the limited range of pseudorapidities corresponding to the ATLAS and LHCb experiments the effects of the secondary reggeons are predicted to be in the ranges of 2 - 11~\% and 5 - 26~\%, respectively. The addition of an odderon with the parameters of (\ref{A14}) has only an effect of less than 0.5~\%. \begin{figure}[!ht] \includegraphics[width=0.49\textwidth]{ratio_eta3eta4_PRvP.eps} \includegraphics[width=0.49\textwidth]{ratio_eta3eta4_PROvPR_setB.eps} \caption{\label{fig:5a} \small The ratios $R(\eta_{3},\eta_{4})$ at $\sqrt{s} = 13$~TeV and $p_{t,3}, p_{t,4} > 0.2$~GeV. The left panel represents the result for the ratio $R^{(\mathbb{P} + \mathbb{R})}(\eta_{3},\eta_{4})$ (\ref{ratio_eta3eta4_PR}). The right panel shows the result for $R^{(\mathbb{P} + \mathbb{R} + \mathbb{O})}(\eta_{3},\eta_{4})$ (\ref{ratio_eta3eta4_PRO}). Note that different z scales are taken for the left and right panels. Calculations were done with the parameters of Appendix~A. In addition regions of the coverage for the ATLAS and LHCb experiments are shown. } \end{figure} In Fig.~\ref{fig:5b} we show the asymmetry (\ref{asymmetry_3}) including pomeron and reggeon exchanges. For the investigated pseudorapidity range the asymmetries due to pomeron plus reggeon exchange show a characteristic pattern: positive for $|\eta| > |\eta'|$ and negative for $|\eta| < |\eta'|$. That is, antiprotons are predicted to come out typically with a higher absolute value of the (pseudo)rapidity than protons. In Fig.~\ref{fig:5b} the inclusion of the odderon would hardly change the result, only at the level of less than 1~\%. This is less than theoretical uncertainties associated with the reggeon exchanges. \begin{figure}[!ht] \includegraphics[width=0.55\textwidth]{asym2D_eta3eta4_PR.eps} \caption{\label{fig:5b} \small The asymmetry $\widetilde{A}^{(2)}(\eta,\eta')$ (\ref{asymmetry_3}) at $\sqrt{s} = 13$~TeV and $p_{t,3}, p_{t,4} > 0.2$~GeV. Shown is the result including pomeron and reggeon exchanges. } \end{figure} Finally, we note that for calculations of the asymmetries (\ref{asymmetry_eta}) - (\ref{asymmetry_3}) it is essential to use a model in which the pomeron is correctly treated as a $C= +1$ exchange, as is the case for our tensor pomeron. On the other hand, in a vector-pomeron model, using standard QFT rules for the vertices, we will have effectively a $C = -1$ pomeron. Then, all exchanges will be, effectively, $(C_{1},C_{2}) = (-1,-1)$ and all asymmetries (\ref{asymmetry_eta}) to (\ref{asymmetry_3}) will be zero. We cannot and do not exclude the possibility that by introducing some \textit{ad hoc} sign changes in amplitudes one can generate non-zero asymmetries also in vector-pomeron models. But we emphasize that in the tensor-pomeron model \cite{Ewerz:2013kda} asymmetries are generated in a natural and straightforward way. Thus, experimental observations of such asymmetries would give strong support for the tensor-pomeron concept. Now, we turn to $p \bar{p}$ production via resonances. Not much is known about mesonic resonances in the $p \bar{p}$ channel, especially for those produced in the diffractive processes. Exceptions may be production of $\eta_c$ and $\chi_c$ mesons for which the branching fractions to the $p \bar{p}$ channel are relatively well known \cite{Olive:2016xmw}. There is also some evidence for the presence of the $f_{2}(1950)$ resonance in the $\gamma \gamma \to p \bar{p}$ reaction \cite{Klusek-Gawenda:2017lgt}. Although statistics of the ISR data \cite{Akesson:1985rn,Breakstone:1989ty} was poor for the $pp \to pp p\bar{p}$ reaction, the data show a large low-mass enhancement. With good statistics one could study at the LHC the distribution $d^{2}\sigma/dM_{34} d{\rm y}_{diff}$ for the $pp \to pp p \bar{p}$ reaction. In the right panel of Fig.~\ref{fig:dsig_dM34dydiff}, we show this distribution for the non-resonant $p \bar{p}$ production. For comparison, in the left panel of Fig.~\ref{fig:dsig_dM34dydiff}, the distribution for the $pp \to pp \pi^{+} \pi^{-}$ reaction is shown. For $p \bar{p}$ production one can observe a characteristic ridge at the edge of the $(M_{34}, {\rm y}_{diff})$ space. The interior is then free of the diffractive continuum. There, the identification of possible resonances should be easier. In reality, the presence of resonances may destroy the dip as resonances are expected to give a dominant contribution just at ${\rm y}_{diff} = 0$. \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{map_M34ydiff_pipi.eps} \includegraphics[width=0.48\textwidth]{map_M34ydiff_ppbar.eps} \caption{\label{fig:dsig_dM34dydiff} \small The two-dimensional distributions in ($M_{34}, \rm{y}_{diff}$) for the diffractive continuum $\pi^{+}\pi^{-}$ (the left panel) and $p\bar{p}$ (the right panel) production for the full phase space at $\sqrt{s} = 13$~TeV. Results for the combined tensor-pomeron and reggeon exchanges are shown. We have taken here $\Lambda_{off,E} = 1$~GeV. No absorption effects have been included here.} \end{figure} In Fig.~\ref{fig:f0}, we discuss one possible scenario for the $pp \to pp p \bar{p}$ reaction. We take into account the non-resonant continuum including both pomeron and reggeon exchanges and, as an example, the scalar $f_{0}(2100)$ resonance created by the pomeron-pomeron fusion. The scalar $f_0(2100)$ was observed in $p \bar{p}$ annihilation into the $\eta \eta$ channel using a partial wave analysis of Crystal Barrel data \cite{Anisovich:2011bw,Anisovich:2000af}. It may be considered as a second scalar glueball, probably mixed with $q \bar{q}$ states. For the continuum term, we take $\Lambda_{off,E} = 0.8$~GeV in~(\ref{ff_exp}), while for the resonant term we take $\Lambda_{f_{0}} = 1$~GeV in~(\ref{Fpompommeson_ff}) and $g_{\mathbb{P} \mathbb{P} f_{0}}' \, g_{f_{0} p \bar{p}} = 0.8$, $g_{\mathbb{P} \mathbb{P} f_{0}}''= 0$; see (\ref{vertex_pompomS}) and Appendix~A of \cite{Lebiedowicz:2013ika}. Here, the coupling constants are fixed arbitrarily. We only want to give an example for the effects to be expected from resonance contributions. We show the distributions in the $p \bar{p}$ invariant mass (the left panel) and in ${\rm y}_{diff}$ (the right panel) at $\sqrt{s} = 13$~TeV. Clearly, the resonant contribution leads to enhancements at low $M_{p \bar{p}}$ and in the central region of ${\rm y}_{diff}$. We can see that the complete result indicates an interference effect of the continuum and $f_{0}(2100)$ terms. With the parameters used here we get for the complete cross section 113~nb for the ATLAS cuts ($|\eta_{3}|,|\eta_{4}| < 2.5$, $p_{t,3}, p_{t,4}> 0.1$~GeV) and 35~nb for the LHCb cuts ($2 < \eta_{3}, \eta_{4} < 4.5$, $p_{t,3}, p_{t,4} > 0.2$~GeV) on centrally produced $p \bar{p}$. Here the absorption effects are not included. It is worth adding that the cross section for the resonant contribution is concentrated along the diagonal ${\rm y}_{3} \simeq {\rm y}_{4}$ in (${\rm y}_{3}, {\rm y}_{4}$) space, exactly in the valley of the continuum contribution (see the right panel in Fig.~\ref{fig:dsig_dy3dy4}). \begin{figure}[!ht] \includegraphics[width=0.48\textwidth]{M34_cuts_f0.eps} \includegraphics[width=0.48\textwidth]{ydiffa_cuts_f0.eps} \caption{\label{fig:f0} \small The differential cross sections for $pp \to pp p \bar{p}$ at $\sqrt{s} = 13$~TeV for continuum plus $f_{0}(2100)$ production. The distributions in the $p \bar{p}$ invariant mass (the left panel) and in ${\rm y}_{diff}$ (the right panel) are shown. No absorption effects were included here.} \end{figure} In Fig.~\ref{fig:map_M34ydiff_ppbar_f0} we show two-dimensional distribution in $(M_{34}, {\rm y}_{diff})$ for $pp \to pp p \bar{p}$ obtained from the non-resonant plus the $f_{0}(2100)$ resonant contributions. Here, the model parameters were chosen as in Fig.~\ref{fig:f0}. Comparing with the right panel of Fig.~\ref{fig:dsig_dM34dydiff} we see clearly that the resonance contribution is centered around $M_{34} = 2.1$~GeV and is approximately uniform in ${\rm y}_{diff}$ for $|{\rm y}_{diff}| \lesssim 1$. Note that for $M_{34} \to 2 m_{p}$, that is, for $\vec{p}_{3} - \vec{p}_{4} \to 0$ both, the dominant $(\mathbb{P}, \mathbb{P})$ continuum contribution, as well as the $f_{0}(2100)$ resonance contribution must vanish; see (\ref{Tamplitude_aux}). This is clearly seen in Fig.~\ref{fig:map_M34ydiff_ppbar_f0}. \begin{figure}[!ht] \includegraphics[width=0.5\textwidth]{map_M34ydiff_ppbar_f0.eps} \caption{\label{fig:map_M34ydiff_ppbar_f0} \small The two-dimensional distribution in ($M_{34}, \rm{y}_{diff}$) for the $p\bar{p}$ production at $\sqrt{s} = 13$~TeV including the continuum and the $f_{0}(2100)$ contribution. The strength of the resonance contribution is chosen arbitrarily. No absorption effects were included here.} \end{figure} Also, azimuthal correlations are interesting for central exclusive $p \bar{p}$ production. From the experimental point of view, this typically would require that the momenta of the leading protons are measured. Then, one could study, for instance, the distributions in the angle $\phi_{12}$ between the transverse momenta $\vec{p}_{t,1}$ and $\vec{p}_{t,2}$ of the leading protons. For low-energy central-meson production these angular distributions have been extensively discussed in \cite{Barberis:1996iq,Barberis:1997ve,Barberis:1998ax, Barberis:1998sr,Barberis:1999cq,Barberis:2000em,Kirk:2000ws}, \cite{Close:1999is,Close:1999bi,Close:2000dx}, and from the tensor pomeron point of view in \cite{Lebiedowicz:2013ika}. Angular distributions for glueball production have been discussed in \cite{Iatrakis:2016rvj}. Since we have constructed in the present paper a model for central $p \bar{p}$ production at the amplitude level we could also discuss such azimuthal correlations. We have checked that our model, including both the continuum and the scalar resonance $f_{0}(2100)$, taking into account only the $(l,S) = (0,0)$ coupling in (\ref{vertex_pompomS}) gives a rather flat $\phi_{12}$ distribution, unlike for central $\pi^{+} \pi^{-}$ production \cite{Lebiedowicz:2014bea,Lebiedowicz:2016ioh}. This is consistent with a measurement made by the WA102 Collaboration; see Fig.~4~(a) of \cite{Barberis:1998sr}. But since present LHC experiments are not yet equipped for such measurements, we leave this for a further publication. \section{Conclusions} \label{sec:conclusions} In the present article, we have discussed exclusive production of $p \bar{p}$ and $\Lambda \overline{\Lambda}$ pairs in proton-proton collisions. At the present stage, we have taken into account mainly the diffractive production of the $p \bar{p}$ continuum. The amplitudes have been calculated using Feynman rules within the tensor-pomeron model \cite{Ewerz:2013kda} and taking into account the spins of the produced particles. Applying this model to our reactions here we had to introduce some form factors containing suitable cut-off parameters; see (\ref{ff_exp}) and (\ref{Fpompommeson_ff}). A first estimate of these cut-off parameters was made by comparing to low-statistics ISR data in which mostly the integrated cross section for $pp \to pp p \bar{p}$ was measured at $\sqrt{s} = 62$~GeV. There, we need a cut-off parameter $\Lambda_{off,E} \sim 1$~GeV in (\ref{ff_exp}). The form factors and corresponding cut-off parameters needed to describe the off-shellness of the intermediate $t$-/$u$-channel protons are not well known and have to be fitted in the future to experimental data. They influence mostly the absolute normalization of the cross sections and have almost no influence on shapes of distributions. In this paper we did not concentrate on the absolute normalization but rather on relative effects by studying the qualitative features of the $pp \to pp p \bar{p}$ reaction in the tensor-pomeron model. To describe the relatively low-energy ISR and WA102 experiments, we find that we have to include also subleading reggeon exchanges in addition to the two-pomeron exchange. For our predictions for the LHC we have used the off-shell proton form factor parameter in (\ref{ff_exp}), $\Lambda_{off,E}$, in the range between 0.8 and~1 GeV. The invariant mass distribution for $p \bar{p}$ pairs is predicted to extend to larger dihadron invariant masses than for the production of $\pi^+ \pi^-$ or $K^+ K^-$ or artificial pseudoscalar nucleons. This is strongly related to spin 1/2 for nucleons versus spin 0 for pseudoscalar mesons. Especially interesting is the distribution in the rapidity difference between antiproton and proton. For continuum $p \bar{p}$ production, we predict a dip at ${\rm y}_{diff} = 0$, in contrast to $\pi^+ \pi^-$ and $K^+ K^-$ production in which a maximum of the cross section occurs at ${\rm y}_{diff} = 0$. The dip is caused by a good separation of ${\rm \hat{t}}$ and ${\rm \hat{u}}$ contributions in (${\rm y}_{3}, {\rm y}_{4}$) space and destructive interference of them along the diagonal $\rm{y}_{3} = \rm{y}_{4}$ characteristic for our Feynman diagrammatic calculation with correct treatment of spins. In our calculations, we have included both pomeron and reggeon exchanges. The reggeon exchange contributions lead to enhancements at large absolute values of the $p$ and $\bar{p}$ (pseudo)rapidities. A similar effect was predicted for the $pp \to pp \pi^{+} \pi^{-}$ reaction in \cite{Lebiedowicz:2010yb}. We have predicted asymmetries in the (pseudo)rapidity distributions of the centrally produced antiproton and proton. The asymmetry is caused by interference effects of the dominant $(\mathbb{P}, \mathbb{P})$ with the subdominant $(\mathbb{R}_{-}, \mathbb{P} + \mathbb{R}_{+})$ and $(\mathbb{P} + \mathbb{R}_{+}, \mathbb{R}_{-})$ exchanges. It should be emphasized that limited detector acceptances in experimental searches at the LHC might affect the size of the asymmetry. The asymmetry should be much more visible for the LHCb experiment which covers a region of larger pseudorapidities where the reggeon exchanges become more relevant. Also the odderon will contribute to such asymmetries. However, we find for typical odderon parameters allowed by recent $pp$ elastic data \cite{Antchev:2017yns} only very small effects, roughly a factor 10 smaller than the effects due to reggeons as predicted in the present paper. All our predictions here have been done for the tensor-pomeron model. In the literature, often, a vector pomeron is used, which is -- strictly speaking -- inconsistent with the rules of quantum field theory as it gives the pomeron charge conjugation $C = -1$ instead of $C = +1$. This is discussed, e.g., in Refs.~\cite{Ewerz:2013kda,Lebiedowicz:2016ioh,Ewerz:2016onn}. Although the vector-pomeron model is incorrect from the field theory point of view, it leads to almost the same distributions including the prediction of the dip at ${\rm y}_{diff} = 0$. This is not too surprising since the leading $(\mathbb{P}, \mathbb{P})$ fusion term has $(C_{1}, C_{2}) = (1,1)$ for the tensor pomeron and $(C_{1}, C_{2}) = (-1,-1)$ for the vector pomeron, giving in both cases a state with $C = +1$. The situation is quite different for pomeron-reggeon, $(\mathbb{P}, \mathbb{R}_{-})$ and $(\mathbb{R}_{-}, \mathbb{P})$, exchange. There, we get with a tensor pomeron a $C = -1$ state, with a vector pomeron again a $C = +1$ state. The interference of $p \bar{p}$ amplitudes with $C = +1$ and $C = -1$ leads to the asymmetries discussed in Sec.~\ref{sec:results}. We see great difficulties producing such asymmetries in a vector-pomeron model in which only $C = +1$ $p \bar{p}$ amplitudes occur. Therefore, we find it an important task for experimentalist to study the asymmetries (\ref{asymmetry_eta}) - (\ref{asymmetry_3}). If non-zero asymmetries are found we would have a further strong argument in favour of the tensor-pomeron concept. In the present study, we have focused mainly on the production of continuum $p \bar{p}$ pairs in the framework of the tensor-pomeron model treating correctly the spin degrees of freedom. Not much is known about diffractively produced $p \bar{p}$ resonances. Any experimentally observed distortions from our continuum-$p \bar{p}$ predictions may therefore signal the presence of resonances. This could give new interesting information for meson spectroscopy. We have discussed a first qualitative attempt to ``reproduce'' the experimentally observed behaviors of the $p \bar{p}$ invariant mass ($M_{34}$) spectra observed in \cite{Akesson:1985rn,Breakstone:1989ty,Barberis:1998sr}. Our calculation shows that the diffractive production of $p \bar{p}$ through the $s$-channel $f_{0}(2100)$ resonance leads to an enhancement at low $M_{34}$ and that the resonance contribution is concentrated at $|{\rm y}_{diff}| < 1$. In general, more resonances can contribute, e.g., $f_{0}(2020)$, $f_{0}(2200)$, and $f_{0}(2300)$. Contributions of other states, such as $f_{2}(1950)$, are not excluded. Also, the subthreshold $m_R < 2 m_p$ resonances that would effectively generate a continuum $p \bar{p}$ contribution should be taken into account; see \cite{Klusek-Gawenda:2017lgt}. Interference effects between the continuum and resonant mechanisms certainly will occur; see Fig.~\ref{fig:f0}. The predictions made for $p \bar{p}$ production can be easily repeated for diffractive $\Lambda \overline{\Lambda}$ pair production. Here, the uncertainties for the continuum contribution are slightly larger than for the $p \bar{p}$ production (higher off-shell effects and less-known interaction parameters). However, here, the resonance contributions are expected to be much smaller if present at all. Any clear observation of a resonance in the $\Lambda \overline{\Lambda}$ channel would, therefore, be a sensation, and the result would definitely go to the Particle Data Book. On the other hand, a lack of such resonances would allow a verification of the minimum at ${\rm y}_{diff} = 0$, which we predict using the correct treatment of the spin degrees of freedom in the Regge-like calculations of central exclusive baryon-antibaryon production. \acknowledgments The authors are grateful to Leszek Adamczyk, Carlo Ewerz, and Rainer Schicker for discussions. This work was partially supported by the Polish National Science Centre Grant No. 2014/15/B/ST2/02528 and by the Center for Innovation and Transfer of Natural Sciences and Engineering Knowledge in Rzesz\'ow.
\section{Concluding Remarks} \label{sec:conclusions} We have presented a mailbox type system for reasoning about processes that communicate through first-class, unordered mailboxes. The type system enforces mailbox conformance, deadlock freedom and, for a significant class of processes, junk freedom as well. In sharp contrast with session types, mailbox types embody the unordered nature of mailboxes and enable the description of mailboxes concurrently accessed by several processes, abstracting away from the state and behavior of the objects/actors/processes using these mailboxes. The fact that a mailbox may have different types during its lifetime is entirely encapsulated by the typing rules and not apparent from mailbox types themselves. The mailbox calculus subsumes the actor model and allows us to analyze systems with a dynamic network topology and a varying number of processes mixing different concurrency abstractions. There are two natural extensions of the mailbox calculus that we have not incorporated in the formal development for the sake of simplicity. First, it is possible to relax the syntax of guarded processes to accommodate actions referring to different mailboxes as well as actions representing timeouts. This extension makes the typing rules for guards more complex to formulate but enhances expressiveness and precision of typing (see Appendix~\ref{sec:example_readers_writer}). Second, it is possible to allow multiple processes to receive messages from the same mailbox by introducing a distinguished capability that identifies shared mailboxes. The notion of type combination (Definition~\ref{def:type_combination}) must be suitably revised for deadling with shared mailboxes and avoid the soundness problems discussed in Example~\ref{ex:linear_input}. With this extension in place, it might also be possible to replace recursion with replication in the calculus. Concerning further developments, the intriguing analogies between the mailbox type system and linear logic pointed out in Section~\ref{sec:related} surely deserve a formal investigation. On the practical side, a primary goal to fulfil is the development of a type checking/inference algorithm for the proposed typing discipline. Subtyping is decidable and a type checking algorithm for a slightly simpler type language has already been developed~\cite{CobaltBlue}. We are confident that a type checking algorithm for the mailbox calculus can be obtained by reusing much of these known results. Concerning the applicability of the approach to real-world programming languages, one promising approach is the development of a tool for the analysis of Java bytecode, possibly with the help of Java annotations, along the lines of what has already been done for Kilim~\cite{SrinivasanMycroft08}. Other ideas for further developments include the extension of pattern atoms so as to accommodate Erlang-style matching of messages and the implementation of optimal matching algorithms driven by type information. \subsection{Actors using futures} \label{sec:example_account_await} Many Scala programs combine actors with futures~\cite{TasharofiDingesJohnson13}. As an example, Listing~\ref{lst:account_await} shows an alternative version of the \lstinline[language=Scala,style=INLINE]{Account} actor in Akka that differes from Listing~\ref{lst:account} in the handling of \lstinline[language=Scala,style=INLINE]{CreditMessages} (lines~\ref{account.future.begin}--\ref{account.future.end}). The \lstinline[language=Scala,style=INLINE]{future} variable created here is initialized asynchronously with the result of the debit operation invoked on \lstinline[language=Scala,style=INLINE]{recipient}. To make sure that each transaction is atomic, the actor waits for the variable to be resolved (line~\ref{account.future.end}) before notifying \lstinline[language=Scala,style=INLINE]{sender} that the operation has been completed. This version of \lstinline[language=Scala,style=INLINE]{Account} is arguably simpler than the one in Listing~\ref{lst:account}, if only because the actor has a unique top-level behavior. One way of modeling this implementation of \lstinline[language=Scala,style=INLINE]{Account} in the mailbox calculus is to use $\RecVar[Future]$, discussed in Example~\ref{ex:future}. A simpler modeling stems from the observation that \lstinline[language=Scala,style=INLINE]{future} in Listing~\ref{lst:account_await} is used for a one-shot synchronization. A future variable with this property is akin to a mailbox from which the value of the resolved variable is retrieved exactly once. Following this approach we obtain the process below: \[ \begin{array}{@{}rcl@{}} \RecVar[Account](\Var[self], \Var[balance]) & \triangleq & \Receive\Var[self]\Tag[debit]{\Var[amount],\Var[sender]} \\ & & \Send\Var[sender]\Tag[reply]{} \mathbin\ttbar \invoke\RecVar[Account]{\Var[self], \Var[balance] + \Var[amount]} \\ & + & \Receive\Var[self]\Tag[credit]{\Var[amount],\Var[recipient],\Var[sender]} \\ & & \New\Var[future]\bigparens{ \begin{lines} \Send\Var[recipient]\Tag[debit]{\Var[amount],\Var[future]} \mathbin\ttbar {} \\ \Receive\Var[future]\Tag[reply]{} \Free\Var[future] \\ \parens{ \Send\Var[sender]\Tag[reply]{} \mathbin\ttbar \invoke\RecVar[Account]{\Var[self], \Var[balance] + \Var[amount]} } \end{lines} } \\ & + & \Receive\Var[self]\Tag[stop]{} \Free\Var[self]\mkkeyword{done} \\ & + & \Receive\Var[self]\Tag[reply]{} \Fail\Var[self] \end{array} \] Compared to the process in Example~\ref{ex:account}, here the notification from the $\Var[recipient]$ account is received from the mailbox $\Var[future]$, which is created locally during the handling of the $\Tag[credit]$ message. The rest of the process is the same as before. This definition of $\RecVar[Account]$ and the one in Example~\ref{ex:account} can both be shown to be consistent with the declaration \[ \RecVar[Account] : (\Var[self] : \ttqmark\parens{ \tmessage\Tag[debit]{\mkkeyword{int},\rho}^{\ast} \cdot \tmessage\Tag[credit]{\mkkeyword{int},\ttemark\tmessage\Tag[debit]{\mkkeyword{int},\rho},\rho}^{\ast} + \Tag[stop]}, \Var[balance] : \mkkeyword{int}; \emptyset) \] where $\rho \stackrel{\text{\tiny def}}= \ttemark\Tag[reply]$. In particular, the dependencies between $\Var[self]$ and $\Var[future]$ that originate in this version of $\RecVar[Account]$ are not observable from outside $\RecVar[Account]$ itself. The use of multiple mailboxes and the interleaving of blocking operations on them may increase the likelyhood of programming mistakes causing mismatched communications and/or deadlocks. However, these errors can be detected by a suitable typing discipline such the one proposed in this paper. Types can also be used to mitigate the runtime overhead resulting from the use of multiple mailboxes. Here, for example, the typing of $\Var[future]$ guarantees that this mailbox is used for receiving a \emph{single} message and that $\Var[future]$ is empty by the time $\Free[]\Var[future]$ is performed. A clever compiler can take advantage of this information to statically optimize both the allocation and the deallocation of this mailbox. \subsection{Encoding of binary sessions} \label{sec:example_binary_sessions} \newcommand{\SessionProcess}[1]{\RecVar[Session]_{#1}} \newcommand{\CreateSessionProcess}[1]{\RecVar[Create]_{#1}} \newcommand{\EncodeSessionType}[1]{\mathcal{E}(#1)} \newcommand{\Tag[op]}{\Tag[op]} Session types~\cite{Honda93,HuttelEtAl16} have become a popular formalism for the specification and enforcement of structured protocols through static analysis. A session is a private communication channel shared by processes that interact through one of its \emph{endpoint}. Each endpoint is associated with a \emph{session type} that specifies the type, direction and order of messages that are supposed to be exchanged through that endpoint. A typical syntax for session types in the case of \emph{binary sessions} (those connecting exactly two peer processes) is shown below: \[ T, S ~~::=~~ \mkkeyword{end} ~~\mid~~ \ttqmark\tmessage{}\tau.T ~~\mid~~ \ttemark\tmessage{}\tau.T ~~\mid~~ T \mathbin{\with} S ~~\mid~~ T \mathbin{\oplus} S \] A session type $\ttqmark\tmessage{}\tau.T$ describes an endpoint used for receiving a message of type $\tau$ and then according to $T$. Dually, a session type $\ttemark\tmessage{}\tau.T$ describes an endpoint used for sending a message of type $\tau$ and then according to $T$. An external choice $T \mathbin{\with} S$ describes an endpoint used for receiving a selection (either $\Tag[left]$ or $\Tag[right]$) and then according to the corresponding continuation (either $T$ or $S$). Dually, an internal choice $T \mathbin{\oplus} S$ describes an endpoint used for making a selection and then according to the corresponding continuation. Communication safety and progress of a binary session are guaranteed by the fact that its two endpoints are linear resources typed by \emph{dual} session types, where the dual of $T$ is obtained by swapping inputs with outputs and internal with external choices. In this example we encode sessions and session types using mailboxes and mailbox types. We encode a session as a non-uniform, concurrent object. The object is ``concurrent'' because it is accessed concurrently by the two peers of the session. It is ``non-uniform'' because its interface changes over time, as the session progresses. The object uses a mailbox $\Var[self]$ and its behavior is defined by the equations for $\SessionProcessT(\Var[self])$ shown below, where $T$ is the session type according to which it must be used by one of the peers: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \SessionProcess\mkkeyword{end}(\Var[self]) & \triangleq & \Free\Var[self]\mkkeyword{done} \\ \SessionProcess{ \ttqmark\tmessage{}\tau.T }(\Var[self]) & \triangleq & \Receive\Var[self]\Tag[send]{x,s} \Receive\Var[self]\Tag[receive]{r} \\ & & \parens{ \Send{s}\Tag[reply]{x,\Var[self]} \mathbin\ttbar \Send{r}\Tag[reply]\Var[self] \mathbin\ttbar \invoke{\SessionProcessT}\Var[self] } \\ \SessionProcess{\ttemark\tmessage{}\tau.T}(\Var[self]) & \triangleq & \invoke{\SessionProcess{\ttqmark\tmessage{}\tau.T}}\Var[self] \\ \SessionProcess{T \mathbin{\with} S}(\Var[self]) & \triangleq & \Receive\Var[self]\Tag[left]{s} \Receive\Var[self]\Tag[receive]{r} \\ & & \parens{ \Send{s}\Tag[reply]\Var[self] \mathbin\ttbar \Send{r}\Tag[left]\Var[self] \mathbin\ttbar \invoke{\SessionProcessT}\Var[self] } \\ & + & \Receive\Var[self]\Tag[right]{s} \Receive\Var[self]\Tag[receive]{r} \\ & & \parens{ \Send{s}\Tag[reply]\Var[self] \mathbin\ttbar \Send{r}\Tag[right]\Var[self] \mathbin\ttbar \invoke{\SessionProcessS}\Var[self] } \\ \SessionProcess{T \mathbin{\oplus} S}(\Var[self]) & \triangleq & \invoke{\SessionProcess{T \mathbin{\with} S}}\Var[self] \end{array} \] To grasp the intuition behind the definition of $\SessionProcessT(\Var[self])$, it helps to recall that each stage of a session corresponds to an interaction between the two peers, where one process plays the role of ``sender'' and its peer that of ``receiver''. Both peers manifest their willingness to interact by storing a message into the session's mailbox. The receiver always stores a $\Tag[receive]$ message, while the sender stores either $\Tag[send]$, $\Tag[left]$ or $\Tag[right]$ according to $T$. All messages contain a reference to the mailbox owned by sender and receiver (respectively $s$ and $r$) where they will be notified once the interaction is completed. A $\Tag[send]$ message also carries actual payload $\Var$ being exchanged. The role of $\SessionProcessT(\Var[self])$ is simply to forward each message from the sender to the receiver. The notifications stored in $s$ and $r$ contain a reference to the session's mailbox so that its type reflects the session's updated interface corresponding to the rest of the conversation. Interestingly, the encoding of a session with type $T$ is undistinguishable from that of a session with the dual type $\coT$. This is natural by recalling that each stage of a session corresponds to a single interaction between the two peers: the order in which they store the respective messages in the session's mailbox is in general unpredictable but also unimportant, for both messages are necessary to complete each interaction. \newcommand{\RecVar[Alice]}{\RecVar[Alice]} \newcommand{\RecVar[Carol]}{\RecVar[Carol]} As an example, suppose we want to model a system where $\RecVar[Alice]$ asks $\RecVar[Carol]$ to compute the sum of two numbers exchanged through a session $s$. $\RecVar[Alice]$ and $\RecVar[Carol]$ use the session according to the session types $T \stackrel{\text{\tiny def}}= \ttemark\tmessage{}\mkkeyword{int}.\ttemark\tmessage{}\mkkeyword{int}.\ttqmark\tmessage{}\mkkeyword{int}.\mkkeyword{end}$ and $\coT \stackrel{\text{\tiny def}}= \ttqmark\tmessage{}\mkkeyword{int}.\ttqmark\tmessage{}\mkkeyword{int}.\ttemark\tmessage{}\mkkeyword{int}.\mkkeyword{end}$, respectively. The system is modeled as the process \begin{equation} \label{eq:session} \New\Var[alice] \New\Var[carol] \New{s}\parens{ \invoke\RecVar[Alice]{\Var[alice],s} \mathbin\ttbar \invoke\RecVar[Carol]{\Var[carol],s} \mathbin\ttbar \invoke{\SessionProcessT}{s} } \end{equation} where $\RecVar[Alice]$ and $\RecVar[Carol]$ are defined as follows: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Alice](\Var[self],s) & \triangleq & \phantom( \Send{s}\Tag[send]{4,\Var[self]} \mathbin\ttbar \Receive\Var[self]\Tag[reply]{s} \\ & & \parens{ \Send{s}\Tag[send]{2,\Var[self]} \mathbin\ttbar \Receive\Var[self]\Tag[reply]{s} \\ & & \parens{ \Send{s}\Tag[receive]\Var[self] \mathbin\ttbar \Receive\Var[self]\Tag[reply]{\Var,s} \\ & & \parens{ \Send\mathit{system}\Tag[print\ttunderscore int]\Var \mathbin\ttbar \Free\Var[self] \mkkeyword{done} } } } \\ \RecVar[Carol](\Var[self],s) & \triangleq & \phantom( \Send{s}\Tag[receive]\Var[self] \mathbin\ttbar \Receive\Var[self]\Tag[reply]{\Var[x],s} \\ & & \parens{ \Send{s}\Tag[receive]\Var[self] \mathbin\ttbar \Receive\Var[self]\Tag[reply]{\Var[y],s} \\ & & \parens{ \Send{s}\Tag[send]{\Var[x] + \Var[y], \Var[self]} \mathbin\ttbar \Receive\Var[self]\Tag[reply]{s} \Free\Var[self] \mkkeyword{done} } } \end{array} \] The process~\eqref{eq:session} and the definitions of $\RecVar[Alice]$ and $\RecVar[Carol]$ are well typed. In general, $\SessionProcessT$ is consistent with the declaration $\SessionProcessT : (\Var[self] : \ttqmark(\EncodeSessionTypeT \cdot \EncodeSessionType{\coT}); \emptyset)$ where $\EncodeSessionTypeT$ is the pattern defined by the following equations: \[ \begin{array}[b]{@{}r@{~}c@{~}l@{}} \EncodeSessionType\mkkeyword{end} & \stackrel{\text{\tiny def}}= & \mathbb{1} \\ \EncodeSessionType{\ttqmark\tmessage{}\tau.T} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[receive]{\ttemark\tmessage\Tag[reply]{\tau,\ttemark\EncodeSessionTypeT}} \\ \EncodeSessionType{\ttemark\tmessage{}\tau.T} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[send]{\tau,\ttemark\tmessage\Tag[reply]{\ttemark\EncodeSessionTypeT}} \\ \EncodeSessionType{T \mathbin{\with} S} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[receive]{\ttemark\parens{ \tmessage\Tag[left]{\ttemark\EncodeSessionTypeT} + \tmessage\Tag[right]{\ttemark\EncodeSessionTypeS} } } \\ \EncodeSessionType{T \mathbin{\oplus} S} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[left]{\ttemark\tmessage\Tag[reply]{\ttemark\EncodeSessionTypeT}} + \tmessage\Tag[right]{\ttemark\tmessage\Tag[reply]{\ttemark\EncodeSessionTypeS}} \end{array} \] This encoding of binary sessions extends easily to internal and external choices with arbitrary labels and also to recursive session types by interpreting both the syntax of $T$ and the definition of $\SessionProcessT$ coinductively. The usual regularity condition ensures that $\SessionProcessT$ is finitely representable. Finally, note that the notion of subtyping for encoded session types induced by Definition~\ref{def:subt} coincides with the conventional one~\cite{GayHole05}. Thus, the mailbox type system subsumes a rich session type system where Theorem~\ref{thm:soundness} corresponds to the well-known communication safety and progress properties of sessions. \subsection{Type-safe mailbox downcast} \label{sec:example_downcast} \newcommand{\Var[Cast]}{\Var[Cast]} \newcommand{\Tag[cast]}{\Tag[cast]} \[ \begin{array}{@{}r@{~}c@{~}l@{}} \Var[Cast](\Var[self]) & \triangleq & \Receive\Var[self]\Tag[cast]{\Var[x],\Var[y]} \\ & & (\Receive\Var[x]\Tag[A]{}(\Send\Var[x]\Tag[A]{} \mathbin\ttbar \Send\Var[y]\Tag[A]\Var[x]) + \Receive\Var[x]\Tag[B]{}(\Send\Var[x]\Tag[B]{} \mathbin\ttbar \Send\Var[y]\Tag[B]\Var[x])) \end{array} \] \subsection{Encoding of sessions with forks and joins} \label{sec:example_forks_joins} \newcommand{\Tag[Then]}{\Tag[Then]} \newcommand{\CollectProcess}[1]{\RecVar[Join]_{#1}} We have seen that it is possible to share the output capability on a mailbox among several processes. We can take advantage of this feature to extend session types with forks and joins: \[ T, S ~~::=~~ \mkkeyword{end} ~~\mid~~ \ttqmark\tmessage{}\tau.T ~~\mid~~ \ttemark\tmessage{}\tau.T ~~\mid~~ T \mathbin{\with} S ~~\mid~~ T \mathbin{\oplus} S ~~\mid~~ {\parr}_{i\in I} \tmessage{\Tag_i}{\tau_i};T ~~\mid~~ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T \] The idea is that the session type ${\otimes}_{1\leq i\leq n} \tmessage{\Tag_i}{\tau_i};T$ describes an endpoint that can be used for sending \emph{all} of the $\Tag_i$ messages, and then according to $T$. The difference between ${\otimes}_{1\leq i\leq n} \tmessage{\Tag_i}{\tau_i};T$ and a session type of the form $\ttemark\tmessage{}{\tau_1}\dots\ttemark\tmessage{}{\tau_n}.T$ is that the $\Tag_i$ messages can be sent by independent processes (for example, by parallel workers) in whatever order instead of by a single sender. Dually, the session type ${\parr}_{1\leq i\leq n} \tmessage{\Tag_i}{\tau_i};T$ describes an endpoint that can be used for collecting \emph{all} of the $\Tag_i$ messages, and then according to $T$. Forks and joins are dual to each other, just like simple outputs are dual to simple inputs. The tags $\Tag_i$ need not be distinct, but equal tags must correspond to equal argument types. The extension of $\SessionProcessT$ to forks and joins is shown below: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \SessionProcess{ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T }(\Var[self]) & \triangleq & \Receive\Var[self]\Tag[send]{s} \Receive\Var[self]\Tag[receive]{r} \invoke{ \CollectProcess{ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T } }{\Var[self],s,r} \\ \SessionProcess{ {\parr}_{i\in I} \tmessage{\Tag_i}{\tau_i};T }(\Var[self]) & \triangleq & \invoke{ \SessionProcess{ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T } }{\Var[self]} \\ \CollectProcess{ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T }(\Var[self],s,r) & \triangleq & \begin{cases} \Send{s}\Tag[reply]\Var[self] \mathbin\ttbar \Send{r}\Tag[reply]\Var[self] \mathbin\ttbar \invoke{\SessionProcessT}\Var[self] & \text{if $I = \emptyset$} \\ \Receive\Var[self]{\Tag_i}{\Var_i}\parens{ \Send{r}{\Tag_i}{\Var_i} \mathbin\ttbar \invoke{ \CollectProcess{ {\otimes}_{i\in I\setminus\set{i}} \tmessage{\Tag_i}{\tau_i};T } }{\Var[self],s,r} } & \text{if $i \in I$} \end{cases} \\ \SessionProcess{ {\parr}_{i\in I} \tmessage{\Tag_i}{\tau_i};T }(\Var[self]) & \triangleq & \invoke{ \SessionProcess{ {\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T } }\Var[self] \end{array} \] As in the case of simple interactions, sender and receiver manifest their willingness to interact by storing $\Tag[send]$ and $\Tag[receive]$ messages into the session's mailbox $\Var[self]$. At that point, $\invoke{\CollectProcessT}{\Var[self],s,r}$ forwards all the $\Tag_i$ messages coming from the sender side to the receiver side, in some arbitrary order (case $i \in I$). When there are no more messages to forward (case $I = \emptyset$) both sender and receiver are notified with a $\Tag[reply]$ message that carries a reference to the session's endpoint, with its type updated according to the rest of the continuation. The encoding of session types extended to forks and joins follows easily: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \EncodeSessionType{{\otimes}_{i\in I} \tmessage{\Tag_i}{\tau_i};T} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[send]{\ttemark\tmessage\Tag[reply]{\ttemark\EncodeSessionTypeT}} \cdot \prod_{i\in I} \tmessage{\Tag_i}{\tau_i} \\ \EncodeSessionType{{\parr}_{i\in I} \tmessage{\Tag_i}{\tau_i};T} & \stackrel{\text{\tiny def}}= & \tmessage\Tag[receive]{ \ttemark \parens{ \prod_{i\in I} \tmessage{\Tag_i}{\tau_i} } \cdot \tmessage\Tag[reply]{\ttemark\EncodeSessionTypeT} } \end{array} \] An alternative definition of $\CollectProcessT$ that fowards messages as soon as they become available can be obtained by providing suitable input actions for each $i\in I$ instead of picking an arbitrary $i\in I$. \subsection{Master-workers parallelism} \label{sec:example_master_workers} \newcommand{\RecVar[Available]}{\RecVar[Available]} \newcommand{\RecVar[Worker]}{\RecVar[Worker]} \newcommand{\RecVar[CreatePool]}{\RecVar[CreatePool]} \newcommand{\RecVar[CollectResults]}{\RecVar[CollectResults]} \newcommand{\Var[worker]}{\Var[worker]} \newcommand{\Tag[task]}{\Tag[task]} \newcommand{\Tag[work]}{\Tag[work]} \newcommand{\Tag[one]}{\Tag[one]} In this example we model a \emph{master} process that receives tasks to perform from a \emph{client}. For each task, the master creates a pool of \emph{workers} and assigns each worker a share of work. The master waits for all partial results from the workers before sending the final result back to the client and making itself available again. The number of workers may depend on some quantity possibly related to the task to be performed and that is known at runtime only. Below we define three processes corresponding to the three states in which the master process can be, and we leave $\RecVar[Worker]$ unspecified: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Available](\Var[self]) & \triangleq & \Receive\Var[self]\Tag[task]\Var[client] \New\Var[pool]\invoke\RecVar[CreatePool]{\Var[self],\Var[pool],\Var[client]} \\ & + & \Free\Var[self]\mkkeyword{done} \\ \RecVar[CreatePool](\Var[self],\Var[pool],\Var[client]) & \triangleq & \IfX{~\textit{more workers needed}~}{ \\ & & \quad \New\Var[worker]( \Send\Var[worker]\Tag[work]\Var[pool] \mathbin\ttbar \invoke\RecVar[Worker]\Var[worker]) \mathbin\ttbar {} \\ & & \quad \invoke\RecVar[CreatePool]{\Var[self],\Var[pool],\Var[client]} \\ & & }{ \\ & & \quad \invoke\RecVar[CollectResults]{\Var[self], \Var[pool], \Var[client]} } \\ \RecVar[CollectResults](\Var[self],\Var[pool],\Var[client]) & \triangleq & \Receive\Var[pool]\Tag[result]{} \invoke\RecVar[CollectResults]{\Var[self],\Var[pool],\Var[client]} \\ & + & \Free\Var[pool]\parens{ \Send\Var[client]\Tag[result]{} \mathbin\ttbar \invoke\RecVar[Available]\Var[self] } \end{array} \] The ``$\If{\mathit{condition}}PQ$'' form used here can be encoded in the mailbox calculus and is typed similarly to the non-deterministic choice of Example~\ref{ex:choice}. These definitions can be shown to be consistent with the following declarations: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Available] & : & (\Var[self] : \ttqmark\tmessage\Tag[task]{\ttemark\Tag[result]}^{\ast}; \emptyset) \\ \RecVar[CreatePool], \RecVar[CollectResults] & : & (\Var[self] : \ttqmark\tmessage\Tag[task]{\ttemark\Tag[result]}^{\ast}, \Var[pool] : \ttqmark\Tag[result]^{\ast}, \Var[client] : \ttemark\Tag[result]; \\ & & \phantom{(} \gedge\Var[pool]\Var[self] \sqcup \gedge\Var[pool]\Var[client]) \end{array} \] The usual implementation of this coordination pattern requires the programmer to keep track of the number of active workers using a counter that is decremented each time a partial result is collected~\cite{ImamSarkar14}. When the counter reaches zero, the master knows that all the workers have finished their job and notifies the client. In the mailbox calculus, we achieve the same goal by means of a dedicated mailbox $\Var[pool]$ from which the partial results are collected: when $\Var[pool]$ becomes disposable, it means that no more active workers remain.\Luca{Questo esempio potrebbe essere criticato in quanto l'azione $\Free[]{}$ sembra implicare l'uso di un complesso garbage collector distribuito. Il garbage collector pu\`o essere realizzato in maniera efficiente, ma \`e difficile da spiegare e dunque poco convincente. Questo \`e anche l'unico esempio in cui $\Free[]{}$ \`e seguita da un'azione interessante e non da $\mkkeyword{done}$. Usando una sola mailbox si ricade nel problema del type pollution.} \subsection{Parallel QuickSort} \label{sec:example_quicksort} \newcommand{\RecVar[QuickSort]}{\RecVar[QuickSort]} The QuickSort algorithm lends itself naturally to a parallel implementation, whereby the left and right partitions of a sufficiently large collection of items can be sorted in parallel. Below we see a modeling of the algorithm in the mailbox calculus, where we have abstracted away any reference to the data and focused exclusively on the communication structure: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[QuickSort](\Var[self]) & \triangleq & \Receive\Var[self]\Tag[sort]\Var[client] \\ & & \IfX{~\textit{data is small}~}{~ \Send\Var[client]\Tag[result]{} ~}{ \\ & & \quad \New\Var[l] \New\Var[r]\bigparens{ \begin{lines} \New\Var[left]\parens{ \Send\Var[left]\Tag[sort]\Var[l] \mathbin\ttbar \invoke\RecVar[QuickSort]\Var[left] }~\mathbin\ttbar \\ \New\Var[right]\parens{ \Send\Var[right]\Tag[sort]\Var[r] \mathbin\ttbar \invoke\RecVar[QuickSort]\Var[right] }~\mathbin\ttbar \\ \Receive\Var[l]\Tag[result]{} \Free\Var[l] \Receive\Var[r]\Tag[result]{} \Free\Var[r] \\ \parens{ \Send\Var[client]\Tag[result]{} \mathbin\ttbar \invoke\RecVar[QuickSort]\Var[self] } \end{lines} } } \\ & + & \Free\Var[self]\mkkeyword{done} \end{array} \] The $\RecVar[QuickSort]$ process waits for $\Tag[sort]$ requests carrying a reference to a mailbox $\Var[client]$ where the result is expected. If the data to sort is small enough, the result is computed sequentially. Otherwise, two new instances of $\RecVar[QuickSort]$ and corresponding mailboxes $\Var[left]$ and $\Var[right]$ are created. The partitioned data is assigned to the new processes via two $\Tag[sort]$ messages, each carrying a reference to a local mailbox for collecting the results. Once the results have been collected, the main process notifies $\Var[client]$ and makes itself available again. The ``$\If{\mathit{condition}}PQ$'' form used here can be encoded in the mailbox calculus and is typed similarly to the non-deterministic choice of Example~\ref{ex:choice}. The definition of $\RecVar[QuickSort]$ is well typed and consistent with the declaration $\RecVar[QuickSort] : (\Var[self] : \ttqmark\tmessage\Tag[sort]{\ttemark\Tag[result]}^{\ast}; \emptyset)$. Compared to a typical implementation of parallel QuickSort in the actor model,\footnote{See for example the version included in the \texttt{Savina} benchmark suite~\cite{ImamSarkar14}.} the use of dedicated mailboxes $\Var[l]$ and $\Var[r]$ for collecting the partial results from the two recursive invocations of $\RecVar[QuickSort]$ has a beneficial impact. In the pure actor model, the partial results are expected to be found in $\Var[self]$, the only mailbox available to the parent actor. This forced choice complicates the realization of the algorithm in two ways. First, each partial result from a recursive invocation must be appropriately tagged so that the parent actor knows whether it refers to the left or right partition of the collection being sorted. Without this information, the parent actor would have to peek inside the partial result to determine the order in which it must be concatenated. Most importantly, the natural control flow of the algorithm is disrupted by the flat structure imposed by the actor model, which requires the parent actor to handle both $\Tag[sort]$ and $\Tag[result]$ messages at the top-level. This forces the programmer to explicilty write bookkeeping code in order to detect when all partial results have been collected so that the client can be notified. On the other hand, the availability of multiple mailboxes and the interleaving of blocking operations on them may increase the likelyhood of programming mistakes causing mismatched communications and/or deadlocks. However, these errors can be detected by a suitable typing discipline such the one proposed in this paper. Types can also be used to mitigate the runtime overhead resulting from the use of multiple mailboxes. Here, for example, the typing of $\Var[l]$ and $\Var[r]$ guarantees that these mailboxes are used for receiving a \emph{single} message and are empty by the time $\Free[]\Var[l]$ and $\Free[]\Var[r]$ are performed. A clever compiler can take advantage of this information to statically optimize both the allocation and the deallocation of these mailboxes. \section{Readers-Writer Lock} \label{sec:example_readers_writer} \newcommand{\RecVar[Free]}{\RecVar[Free]} \newcommand{\RecVar[Write]}{\RecVar[Write]} \newcommand{\RecVar[Read]}{\RecVar[Read]} \newcommand{\Var[w]}{\Var[w]} \newcommand{\Var[r]}{\Var[r]} \newcommand{\Tag[acquireW]}{\Tag[acquireW]} \newcommand{\Tag[acquireR]}{\Tag[acquireR]} \newcommand{\Tag[read]}{\Tag[read]} \newcommand{\Tag[write]}{\Tag[write]} A readers-writer lock grants read-only access to an arbitrary number of readers and exclusive write access to a single writer. Below is a particular modeling of a readers-writer lock making use of \emph{mixed guards}, where different actions may refer to different mailboxes: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Free](\Var[self]) & \triangleq & \Free\Var[self]\mkkeyword{done} \\ & + & \Receive\Var[self]\Tag[acquireW]\Var[w]\parens{ \Send\Var[w]\Tag[reply]\Var[self] \mathbin\ttbar \invoke\RecVar[Write]\Var[self] } \\ & + & \Receive\Var[self]\Tag[acquireR]\Var[r] \New\Var[pool]\parens{ \Send\Var[r]\Tag[reply]\Var[pool] \mathbin\ttbar \invoke\RecVar[Read]{\Var[self],\Var[pool]} } \\ & + & \Receive\Var[self]\Tag[read]{} \Fail\Var[self] \\ & + & \Receive\Var[self]\Tag[write]\Var[w] \Fail\Var[self] \\ \RecVar[Write](\Var[self]) & \triangleq & \Receive\Var[self]\Tag[release]{} \invoke\RecVar[Free]\Var[self] \\ & + & \Receive\Var[self]\Tag[write]\Var[w]\parens{ \Send\Var[w]\Tag[reply]\Var[self] \mathbin\ttbar \invoke\RecVar[Write]\Var[self] } \\ & + & \Receive\Var[self]\Tag[read]{} \Fail\Var[self] \\ \RecVar[Read](\Var[self],\Var[pool]) & \triangleq & \Receive\Var[self]\Tag[acquireR]\Var[r]\parens{ \Send\Var[r]\Tag[reply]\Var[pool] \mathbin\ttbar \invoke\RecVar[Read]{\Var[self],\Var[pool]} } \\ & + & \Receive\Var[self]\Tag[write]\Var[w] \Fail\Var[self] \\ & + & \Receive\Var[pool]\Tag[read]{} \invoke\RecVar[Read]{\Var[self],\Var[pool]} \\ & + & \Free\Var[pool]\invoke\RecVar[Free]\Var[self] \end{array} \] The readers-writer lock may be free, in which case it can be acquired either by a reader or by a writer but it does not accept read or write requests. When the lock has been acquired by a writer process, the writer is granted exclusive access and read requests are not accepted. When a reader acquires a free lock, the lock creates $\Var[pool]$ of readers and moves into a state where more readers may be granted access. Each reader manifests its intention to read the resource by storing a $\Tag[read]$ message into $\Var[pool]$ whereas prospective readers manifest their intention of accessing the resource by storing $\Tag[acquireR]$ into $\Var[self]$. The mixed guard in the $\RecVar[Read]$ process is key to serve both kinds of requests. In particular, when all readers have terminated, $\Var[pool]$ can be deleted and the lock moves back into the free state. \begin{table} \begin{center} \[ \begin{array}{@{}c@{}} \inferrule{ \wtg{ \seqof\NameU : \ttqmark\seqof\Pattern, \Gamma; \seqof\NameU : \ttqmark\seqof\Pattern }{ G } \\ \vDash \seqof\Pattern }{ \textstyle \wtp{ \seqof\NameU : \ttqmark\seqof\Pattern, \Gamma }{ G }{ \gedge{\set\seqof\NameU}{\mathsf{dom}(\Gamma)} } } ~~\defrule{t-guard*} \\\\ \inferrule{ }{ \wtg{ \Gamma; u : \ttqmark\mathbb{0} }{ \Failu } } ~~\defrule{t-fail*} \qquad \inferrule{ \wtp\ContextAP\varphi }{ \wtg{ u : \tau, \Gamma; u : \ttqmark\mathbb{1} }{ \FreeuP } } ~~\defrule{t-free*} \\\\ \inferrule{ \wtp{ u : \ttqmarkE, \Gamma, \seqof\VarX : \seqof\Type }{ P }{ \varphi } }{ \wtg{ u : \tau, \Gamma; u : \ttqmark(\tmessage\Tag\seqof\Type\tmulE) }{ \Receiveu\Tag\seqof\VarXP } } ~~\defrule{t-in*} \qquad \inferrule{ \wtg{ \Gamma; \Delta_i }{ G_i } ~{}^{(i=1,2)} }{ \wtg{ \Gamma; \Delta_1 + \Delta_2 }{ G_1 + G_2 } } ~~\defrule{t-branch*} \end{array} \] \end{center} \caption{ \label{tab:relaxed_typing} Relaxed typing rules for mixed guards. } \end{table} In order to deal with mixed guards, the typing rules for guards and guarded processes must be generalized as shown in Table~\ref{tab:relaxed_typing}. The basic idea is the same as for restricted guards, namely the type of mailboxes different from the one referred to by an action cannot be affected by the content (or lack thereof) of that mailbox. To do so, the judgments for guards have the form $\wtg{\Gamma;\Delta}G$ where $\Gamma$ is the type environment of the guarded process as a whole whereas $\Delta$ keeps track of the types of the mailboxes referred to by the actions, which are split exactly as in the restricted typing rules (Table~\ref{tab:inference}). The $+$ operation on type environments is defined thus: \[ \Gamma_1 + \Gamma_2 = \begin{cases} \Gamma_1, \Gamma_2 & \text{if $\mathsf{dom}(\Gamma_1) \cap \mathsf{dom}(\Gamma_2) = \emptyset$} \\ u : \ttqmark(E_1 + E_2), \Gamma_1' + \Gamma_2' & \text{if $\Gamma_1 = u : \ttqmarkE_1, \Gamma_1'$ and $\Gamma_2 = u : \ttqmarkE_2, \Gamma_2'$} \end{cases} \] With the relaxed rules, it is possible to show that the above process definitions are consistent with the following declarations \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Free] & : & \parens{ \Var[self] : \ttqmark\parens{ \tmessage\Tag[acquireW]\tau^{\ast} \cdot \tmessage\Tag[acquireR]\rho^{\ast} }; \emptyset } \\ \RecVar[Write] & : & \parens{ \Var[self] : \ttqmark\parens{ \tmessage\Tag[acquireW]\tau^{\ast} \cdot \tmessage\Tag[acquireR]\rho^{\ast} \cdot \parens{ \Tag[release] + \tmessage\Tag[write]\tau } }; \emptyset } \\ \RecVar[Read] & : & \parens{ \Var[self] : \ttqmark\parens{ \tmessage\Tag[acquireW]\tau^{\ast} \cdot \tmessage\Tag[acquireR]\rho^{\ast} }, \Var[pool] : \ttqmark\Tag[read]^{\ast}; \gedge\Var[self]\Var[pool] } \end{array} \] where $\tau \stackrel{\text{\tiny def}}= \ttemark\tmessage\Tag[reply]{ \ttemark\parens{ \Tag[release] + \tmessage\Tag[write]\tau } }$ and $\rho = \ttemark\tmessage\Tag[reply]{ \ttemark\Tag[read]^{\ast} }$. The remarkable aspect of this typing is that it guarantees statically the key properties of the readers-writer lock: that there are no readers nor writers when the lock is free; that there are no readers if there is a single writer; that there is no writer if there are one or more readers. Once again, the modeling makes key use of multiple mailboxes so as to keep the typing as precise as possible. \section{Examples} \label{sec:examples} In this section we discuss a few more examples that illustrate the expressiveness of the mailbox calculus and of its type system. We consider a variant of the bank account shown in Listing~\ref{lst:account} (Section~\ref{sec:example_account_await}), the case of master-workers parallelism (Section~\ref{sec:example_master_workers}) and the encoding of binary sessions extended with forks and joins (Sections~\ref{sec:example_binary_sessions} and~\ref{sec:example_forks_joins}). \input{example_account_await} \input{example_master_workers} \input{example_binary_sessions} \input{example_forks_joins} \section{Supplementary Properties} \label{sec:extra_properties} \input{prop_subtyping} \input{prop_graphs} \input{prop_type_environments} \subsection{Dependency Graphs} \label{sec:graphs} We use \emph{dependency graphs} for tracking dependencies between mailboxes. Intuitively, there is a dependency between $u$ and $v$ if either $v$ is the argument of a message in mailbox $u$ or $v$ occurs in the continuation of a process waiting for a message from $u$. Dependency graphs have names as vertices and undirected edges. However, the usual representation of graphs does not account for the fact that mailbox names may be restricted and that the multiplicity of dependencies matters. Therefore, we define dependency graphs using the syntax below: \[ \textbf{Dependency Graph} \qquad \varphi, \psi ~~::=~~ \emptyset ~~\mid~~ \gedgeuv ~~\mid~~ \varphi \sqcup \psi ~~\mid~~ \Newa\varphi \] The term $\emptyset$ represents the empty graph which has no vertices and no edges. The unordered pair $\gedgeuv$ represents the graph made of a single edge connecting the vertices $u$ and $v$. The term $\varphi\sqcup\psi$ represents the union of $\varphi$ and $\psi$ whereas $\Newa\varphi$ represents the same graph as $\varphi$ except that the vertex $a$ is restricted. The usual notions of free and bound names apply to dependency graphs. We write $\mathsf{fn}(\varphi)$ for the free names of $\varphi$. \begin{table} \[ \begin{array}{@{}c@{}} \inferrule{}{ \gedgeuv \greduv \emptyset } ~~\defrule{g-axiom} \qquad \inferrule{ \varphi \greduv \varphi' }{ \varphi \sqcup \psi \greduv \varphi' \sqcup \psi } ~~\defrule{g-left} \qquad \inferrule{ \psi \greduv \psi' }{ \varphi \sqcup \psi \greduv \varphi \sqcup \psi' } ~~\defrule{g-right} \\\\ \inferrule{ \varphi \greduv \psi \\ a\neu,v }{ \Newa\varphi \greduv \Newa\psi } ~~\defrule{g-new} \qquad \inferrule{ \varphi \greduw \psi \\ \psi \gred\NameWv \varphi' }{ \varphi \greduv \varphi' } ~~\defrule{g-trans} \end{array} \] \caption{\label{tab:dgraph} Labelled transitions of dependency graphs.} \end{table} To define the semantics of a dependency graph we use the labelled transition system of Table~\ref{tab:dgraph}. A label $\glabeluv$ represents a path connecting $u$ with $v$. So, a relation $\varphi \greduv \varphi'$ means that $u$ and $v$ are connected in $\varphi$ and $\varphi'$ describes the residual edges of $\varphi$ that have not been used for building the path between $u$ and $v$. The paths of $\varphi$ are built from the edges of $\varphi$ (\emph{cf.}\xspace \refrule{g-axiom}) connected by shared vertices (\emph{cf.}\xspace \refrule{g-trans}). Restricted names cannot be observed in labels, but they may contribute in building paths in the graph (\emph{cf.}\xspace \refrule{g-new}). \begin{definition}[graph acyclicity and entailment] \label{def:grel} Let $\grel\varphi \stackrel{\text{\tiny def}}= \set{ \pairuv \mid \exists\varphi': \varphi \greduv \varphi' }$ be the \emph{dependency relation} generated by $\varphi$. % We say that $\varphi$ is \emph{acyclic} if $\grel\varphi$ is irreflexive. % We say that $\varphi$ \emph{entails} $\psi$, written $\varphi \Rightarrow \psi$, if $\grel\psi \subseteq \grel\varphi$. \end{definition} Note that $\sqcup$ is commutative, associative and has $\emptyset$ as unit with respect to $\grel\cdot$ (see Appendix~\ref{sec:prop_graphs}). These properties of dependency graphs are key to prove that typing is preserved by structural congruence on processes. Note also that $\sqcup$ is \emph{not} idempotent. Indeed, $\gedgeuv \sqcup \gedgeuv$ is cyclic whereas $\gedgeuv$ is not. The following example motivates the reason why the multiplicity of dependencies is important. \begin{example} \label{ex:multiplicity} Consider the reduction \[ P \stackrel{\text{\tiny def}}= \Newa \Newb\parens{ \Senda\TagAb \mathbin\ttbar \Senda\TagBb \mathbin\ttbar \Receivea\Tag[A]\Var[x] \Receivea\Tag[B]\Var[y] \Freea \Send\Var[x]\Tag\Var[y] } \rightarrow^* \Newb\Sendb\Tagb \arrownot\red \] and observe that $P$ stores two messages in the mailbox $a$, each containing a reference to the mailbox $b$. The two variables $\Var[x]$ and $\Var[y]$, which were syntactically different in $P$, have been unified into $b$ in the reduct, which is deadlocked. % Unlike previous examples of deadlocked processes, which resulted from mutual dependencies between different mailboxes, in this case the deadlock is caused by the same dependency $\gedgeab$ arising twice. % \hfill$\blacksquare$ \end{example} \section{Inferring Mailbox Patterns} \label{sec:inference} Pattern expressions \[ \mathbb{E}, \mathbb{F} ~~::=~~ \mathbb{0} ~~\mid~~ \mathbb{1} ~~\mid~~ \alpha ~~\mid~~ \tmessage\Tag{\seqof\Capability\seqof\PatternVar} ~~\mid~~ \mathbb{E} + \mathbb{F} ~~\mid~~ \mathbb{E} \cdot \mathbb{F} ~~\mid~~ \mathbb{E}^{\ast} \] Shape of constraints \[ \varphi ~~::=~~ \mkconstant{False} ~~\mid~~ \mathbb{E} \subp \mathbb{F} ~~\mid~~ \kappa\mathbb{E} \leqslant \kappa\mathbb{F} ~~\mid~~ \alpha \ll \tmessage\Tag{\seqof\Capability\seqof\PatternVar} \] \begin{table} \begin{center} \[ \begin{array}{@{}c@{}} \inferrule[\defrule{i-idle}]{ }{ \itp\Idle\emptyset\emptyset\emptyset } \qquad \inferrule[\defrule{i-message}]{ }{ \itp{\Sendu\Tag\seqof\NameV}{ u : \ttemark\beta, \seqof\NameV : \seqof{\kappa\alpha} }{ \gedgeu{\set\seqof\NameV} }{ \set{ \ttemark\beta \leqslant \ttemark\tmessage\Tag{\seqof{\kappa\alpha}} } } } \\\\ \inferrule[\defrule{i-invoke}]{ \mathstrut }{ \itp{\invoke\RecVar\seqof\NameV}{ \seqof\NameV : \seqof{\kappa\alpha} }{ \varphi\subst\seqof\NameV\seqof\NameU }{ \set{ \seqof{\kappa\alpha} \leqslant \seqof{\kappa\gamma} } } } ~~~\RecVar : (\seqof\NameU : \seqof{\kappa\gamma}; \varphi) \qquad \inferrule[\defrule{i-sub}]{ \itpP\Gamma\varphi\mathcal{C} }{ \itpP{\Gamma, u : \kappa\alpha}\varphi{ \mathcal{C} \cup \set{ \kappa\alpha \leqslant \kappa\mathbb{1} } } } \\\\ \inferrule[\defrule{i-input}]{ \itp{P_i}{ u : \ttqmark\beta_i, \Gamma_i, \seqof\VarX_i : \seqof\Capability_i\seqof\PatternVar_i }{ \varphi_i }{ \mathcal{C}_i } ~{}^{(\range{i}{1}{n})} \\ \Delta_1 = \Gamma_1 \\ \MergeContexts{\Delta_{i-1}}{\Gamma_i}{\Delta_i}{\mathcal{C}_i'} ~{}^{(\range{i}{2}{n})} }{ \textstyle \itp{ \Branch[\range{i}{1}{n}]\Receiveu{\Tag_i}{\seqof\VarX_i}P_i }{ u : \ttqmark\beta, \Delta_n }{ \gedgeu{\mathsf{dom}(\Delta_n)} }{ \begin{lines}[t] \textstyle \set{ \ttqmark\beta \leqslant \ttqmark\sum_{\range{i}{1}{n}} \tmessage{\Tag_i}{\seqof\Capability_i\seqof\PatternVar_i} \cdot \beta_i} \\ \textstyle {} \cup \bigcup_{\range{i}{1}{n}}\parens{ \mathcal{C}_i \cup \mathcal{C}_i' \cup \set{ \beta_i \ll \tmessage{\Tag_i}{\seqof\Capability_i\seqof\PatternVar_i} } } } \end{lines} } \\\\ \inferrule[\defrule{i-par}]{ \itp{P_i}{\Gamma_i}{\varphi_i}{\mathcal{C}_i} ~{}^{(i=1,2)} \\ \JoinContexts{\Gamma_1}{\Gamma_2}{\Gamma}{\mathcal{C}} }{ \itp{P_1 \mathbin\ttbar P_2}{\Gamma}{\varphi_1 \sqcup \varphi_2}{ \mathcal{C} \cup \mathcal{C}_1 \cup \mathcal{C}_2 } } ~~~\text{$\varphi_1 \sqcup \varphi_2$ acyclic} \qquad \inferrule[\defrule{i-new}]{ \itpP{\Gamma, a : \ttqmark\alpha}{\varphi}{\mathcal{C}} }{ \itp{\NewaP}{\Gamma}{\Newa\varphi}{ \mathcal{C} \cup \set{\ttqmark\mathbb{1} \leqslant \ttqmark\alpha} } } \end{array} \] \end{center} \caption{ \label{tab:inference} Pattern inference rules. } \end{table} merge operator \[ \inferrule{ }{ \MergeContexts\emptyset\EmptyContext\emptyset\emptyset } \qquad \inferrule{ \MergeContexts{\Gamma_1}{\Gamma_2}{\Delta}\mathcal{C} }{ \MergeContexts{ u : \kappa\alpha_1, \Gamma_1 }{ u : \kappa\alpha_2, \Gamma_2 }{ u : \kappa\alpha, \Gamma }{ \mathcal{C} \cup \set[i=1,2]{ \kappa\alpha \leqslant \kappa\alpha_i } } } \] join operator \[ \begin{array}{@{}c@{}} \inferrule{ }{ \JoinContexts\Gamma\emptyset\Gamma\emptyset } \qquad \inferrule{ }{ \JoinContexts\emptyset\Gamma\Context\emptyset } \qquad \inferrule{ \JoinContexts{\Gamma_1}{\Gamma_2}{\Gamma}{\mathcal{C}} }{ \JoinContexts{ u : \ttemark\alpha_1, \Gamma_1 }{ u : \ttemark\alpha_2, \Gamma_2 }{ u : \ttemark\alpha, \Gamma }{ \mathcal{C} \cup \set{ \ttemark\alpha \leqslant \ttemark\parens{\alpha_1 \cdot \alpha_2} } } } \\\\ \inferrule{ \JoinContexts{\Gamma_1}{\Gamma_2}{\Gamma}{\mathcal{C}} }{ \JoinContexts{ u : \ttemark\alpha_1, \Gamma_1 }{ u : \ttqmark\alpha_2, \Gamma_2 }{ u : \ttqmark\alpha, \Gamma }{ \mathcal{C} \cup \set{ \ttqmark\parens{\alpha_1 \cdot \alpha} \leqslant \ttqmark\alpha_2 } } } \end{array} \] \section{Introduction} \label{sec:introduction} Message passing is a key mechanism used to coordinate concurrent processes. The order in which a process consumes messages may coincide with the order in which they arrive at destination (\emph{ordered processing}) or may depend on some intrinsic property of the messages themselves, such as their priority, their tag, or the shape of their content (\emph{out-of-order or selective processing}). Ordered message processing is common in networks of processes connected by point-to-point \emph{channels}. Out-of-order message processing is common in networks of processes using \emph{mailboxes}, into which processes concurrently store messages and from which one process selectively receives messages. This communication model is typically found in the various implementations of actors~\cite{HewittEtAl73,Agha86} such as Erlang~\cite{Armstrong13}, Scala and Akka actors~\cite{HallerSommers11}, CAF~\cite{CharoussetHiesgenSchmidt16} and Kilim~\cite{SrinivasanMycroft08}. Non-uniform, concurrent objects~\cite{RavaraVasconcelos00,Puntigam01,CrafaPadovani17} are also examples of out-of-order message processors. For example, a busy lock postpones the processing of any $\Tag[acquire]$ message until it is released by its current owner. Out-of-order message processing adds further complexity to the challenging task of concurrent and parallel application development: storing a message into the wrong mailbox or at the wrong time, forgetting a message in a mailbox, or relying on the presence of a particular message that is not guaranteed to be found in a mailbox are programming mistakes that are easy to do and hard to detect without adequate support from the language and its development tools. \InputScala[label=lst:account,caption=An example of Scala actor taken from the \texttt{Savina} benchmark suite~\cite{ImamSarkar14}.]{Account.scala} The Scala actor in Listing~\ref{lst:account}, taken from the \texttt{Savina} benchmark suite~\cite{ImamSarkar14}, allows us to illustrate some of the subtle pitfalls that programmers must carefully avoid when dealing with out-of-order message processing. The \lstinline[language=Scala,style=INLINE]{process} method matches messages found in the actor's mailbox according to their type. If a message of type \lstinline[language=Scala,style=INLINE]{DebitMessage} is found, then \lstinline[language=Scala,style=INLINE]{balance} is incremented by the deposited amount and the actor requesting the operation is notified with a \lstinline[language=Scala,style=INLINE]{ReplyMessage} (lines~\ref{begin.account.debit}--\ref{end.account.debit}). If a message of type \lstinline[language=Scala,style=INLINE]{CreditMessage} is found, \lstinline[language=Scala,style=INLINE]{balance} is decremented by the amount that is transferred to \lstinline[language=Scala,style=INLINE]{recipient} (lines~\ref{begin.account.credit}--\ref{account.credit.send}). Since the operation is meant to be atomic, the actor temporarily changes its behavior and waits for a \lstinline[language=Scala,style=INLINE]{ReplyMessage} from \lstinline[language=Scala,style=INLINE]{recipient} signalling that the transfer is complete, before notifying \lstinline[language=Scala,style=INLINE]{sender} in turn (lines~\ref{account.credit.wait}--\ref{end.account.credit}). A message of type \lstinline[language=Scala,style=INLINE]{StopMessage} terminates the actor (line~\ref{account.stop}). Note how the correct execution of this code depends on some key assumptions: \begin{itemize} \item \lstinline[language=Scala,style=INLINE]{ReplyMessage} should be stored in the actor's mailbox only when the actor is involved in a transaction, or else the message would trigger the ``catch all'' clause that throws a ``unsupported message'' exception (lines~\ref{begin.account.unknown}--\ref{end.account.unknown}). \item No debit or credit message should be in the actor's mailbox by the time it receives \lstinline[language=Scala,style=INLINE]{StopMessage}, or else some critical operations affecting the balance would not be performed. \item Two distinct accounts should not try to simultaneously initiate a transaction with each other. If this were allowed, each account could consume the credit message found in its own mailbox and then deadlock waiting for a reply from the other account (lines~\ref{account.credit.wait}--\ref{end.account.credit}). \end{itemize} Static analysis techniques that certify the validity of assumptions like these can be valuable for developers. For example, session types~\cite{HuttelEtAl16} have proved to be an effective formalism for the enforcement of communication protocols and have been applied to a variety of programming paradigms and languages~\cite{AnconaEtAl16}, including those based on mailbox communications~\cite{MostrousVasconcelos11,CharalambidesDingesAgha16,Fowler16,NeykovaYoshida16}. However, session types are specifically designed to address point-to-point, ordered interactions over channels~\cite{Honda93}. Retrofitting them to a substantially different communication model calls for some inevitable compromises on the network topologies that can be addressed and forces programmers to give up some of the flexibility offered by unordered message processing. Another aspect that complicates the analysis of actor systems is that the pure actor model as it has been originally conceived~\cite{HewittEtAl73,Agha86} does not accurately reflect the actual practice of actor programming. In the pure actor model, each actor owns a single mailbox and the only synchronization mechanism is message reception from such mailbox. However, it is a known fact that the implementation of complex coordination protocols in the pure actor model is challenging~\cite{VarelaAgha01,TasharofiDingesJohnson13,ImamSarkar14bis,ChatterjeeEtAl16}. These difficulties have led programmers to mix the actor model with different concurrency abstractions~\cite{ImamSarkar12,TasharofiDingesJohnson13}, to extend actors with controlled forms of synchronization~\cite{VarelaAgha01} and to consider actors with multiple/first-class mailboxes~\cite{Haller12,ImamSarkar14bis,ChatterjeeEtAl16}. In fact, popular implementations of the actor model feature disguised instances of multiple/first-class mailbox usage, even if they are not explicitly presented as such: in Akka, the messages that an actor is unable to process immediately can be temporarily stashed into a different mailbox~\cite{Haller12}; in Erlang, hot code swapping implies transferring at runtime the input capability on a mailbox from a piece of code to a different one~\cite{Armstrong13}. In summary, there is still a considerable gap between the scope of available approaches used to analyze mailbox-based communicating systems and the array of features used in programming these systems. To help narrowing this gap, we make the following contributions: \begin{itemize} \item We introduce \emph{mailbox types}, a new kind of behavioral types with a simple and intuitive semantics embodying the unordered nature of mailboxes. Mailbox types allow us to describe mailboxes subject to selective message processing as well as mailboxes concurrently accessed by several processes. Incidentally, mailbox types also provide precise information on the size and reachability of mailboxes that may lead to valuable code optimizations. \item We develop a mailbox type system for the \emph{mailbox calculus}, a mild extension of the asynchronous $\pi$-calculus~\cite{SangiorgiWalker01} featuring tagged messages, selective inputs and first-class mailboxes. The mailbox calculus allows us to address a broad range of systems with dynamic topology and varying number of processes possibly using a mixture of concurrency models (including multi-mailbox actors) and abstractions (such as locks and futures). \item We prove three main properties of well-typed processes: the absence of failures due to unexpected messages (\emph{mailbox conformance}); the absence of pending activities and messages in irreducible processes (\emph{deadlock freedom}); for a non-trivial class of processes, the guarantee that every message can be eventually consumed (\emph{junk freedom}). \item We illustrate the expressiveness of mailbox types by presenting well-typed encodings of known concurrent objects (locks and futures) and actor benchmarks (atomic transactions and master-workers parallelism) and of binary sessions extended with forks and joins. In discussing these examples, we emphasize the impact of out-of-order message processing and of first-class mailboxes. \end{itemize} \subparagraph*{Structure of the paper.} We start from the definition of the \emph{mailbox calculus} and of the properties we expect from well-typed processes (Section~\ref{sec:model}). We introduce mailbox types (Section~\ref{sec:types}) and dependency graphs (Section~\ref{sec:graphs}) for tracking mailbox dependencies in processes that use more than one. Then, we present the typing rules (Section~\ref{sec:rules}) and the soundness results of the type system (Section~\ref{sec:properties}). In the latter part of the paper, we discuss a few more complex examples (Section~\ref{sec:examples}), related work (Section~\ref{sec:related}) and ideas for further developments (Section~\ref{sec:conclusions}). Additional definitions and proofs can be found in Appendices~\ref{sec:extra_properties}--\ref{sec:example_readers_writer}. \section{The Mailbox Calculus} \label{sec:model} \begin{table} \begin{center} \[ \begin{array}[t]{@{}rr@{~}c@{~}ll@{}} \textbf{Process} & P, Q & ::= & \mkkeyword{done} & \text{(termination)} \\ & & | & \invoke\RecVar\seqof\NameU & \text{(invocation)} \\ & & | & G & \text{(guarded process)} \\ & & | & \Sendu\Tag\seqof\NameV & \text{(stored message)} \\ & & | & P \mathbin\ttbar Q & \text{(parallel composition)} \\ & & | & \NewaP & \text{(mailbox restriction)} \\\\ \textbf{Guard} & G, H & ::= & \Failu & \text{(runtime error)} \\ & & | & \FreeuP & \text{(mailbox deletion)} \\ & & | & \Receiveu\Tag\seqof\VarXP & \text{(selective receive)} \\ & & | & G + H & \text{(guard composition)} \end{array} \] \end{center} \caption{\label{tab:processes} Syntax of the mailbox calculus.} \end{table} We assume given an infinite set of \emph{variables} $\Var[x]$, $\Var[y]$, an infinite set of \emph{mailbox names} $a$, $b$, a set of \emph{tags} $\Tag$ and a finite set of \emph{process variables} $\RecVar$. We let $u$, $v$ range over variables and mailbox names without distinction. Throughout the paper we write $\seqof{e}$ for possibly empty sequences $e_1, \dots, e_n$ of various entities. For example, $\seqof\NameU$ stands for a sequence $u_1,\dots,u_n$ of names and $\set\seqof\NameU$ for the corresponding set. The syntax of the \emph{mailbox calculus} is shown in Table~\ref{tab:processes}. The term $\mkkeyword{done}$ represents the terminated process that performs no action. The term $\Sendu\Tag\seqof\NameV$ represents a message stored in mailbox $u$. The message has tag $\Tag$ and arguments $\seqof\NameV$. The term $P \mathbin\ttbar Q$ represents the parallel composition of $P$ and $Q$ and $\NewaP$ represents a restricted mailbox $a$ with scope $P$. The term $\invoke\RecVar\seqof\NameU$ represents the invocation of the process named $\RecVar$ with parameters $\seqof\NameU$. For each process variable $\RecVar$ we assume that there is a corresponding \emph{global process definition} of the form $\define\RecVar\seqof\VarXP$. A guarded process $G$ is a composition of actions. The action $\Failu$ represents the process that fails with an error for having received an unexpected message from mailbox $u$. The action $\FreeuP$ represents the process that deletes the mailbox $u$ if it is empty and then continues as $P$. The action $\Receiveu\Tag\seqof\VarXP$ represents the process that receives an $\Tag$-tagged message from mailbox $u$ then continues as $P$ with $\seqof\VarX$ replaced by the message's arguments. A compound guard $G + H$ offers all the actions offered by $G$ and $H$. We assume that all actions in the same guard refer to the same mailbox $u$. The notions of free and bound names of a process $P$ are standard and respectively denoted by $\mathsf{fn}(P)$ and $\mathsf{bn}(P)$. The operational semantics of the mailbox calculus is mostly conventional. We use the structural congruence relation $\equiv$ defined below to rearrange equivalent processes: \[ \begin{array}{@{}*{3}{r@{~}c@{~}l}@{}} \Faila + G & \equiv & G & G + H & \equiv & H + G & G + (H + H') & \equiv & (G + H) + H' \\ \mkkeyword{done} \mathbin\ttbar P & \equiv & P & P \mathbin\ttbar Q & \equiv & Q \mathbin\ttbar P & P \mathbin\ttbar (Q \mathbin\ttbar R) & \equiv & (P \mathbin\ttbar Q) \mathbin\ttbar R \\ & & & \Newa\NewbP & \equiv & \Newb\NewaP & \NewaP \mathbin\ttbar Q & \equiv & \Newa(P \mathbin\ttbar Q) \quad\text{if $a \not\in \mathsf{fn}(Q)$} \end{array} \] Structural congruence captures the usual commutativity and associativity laws of action and process compositions, with $\Fail{}$ and $\mkkeyword{done}$ acting as the respective units. Additionally, the order of mailbox restrictions is irrelevant and the scope of a mailbox may shrink or extend dynamically. The reduction relation $\rightarrow$ is inductively defined by the rules \[ \begin{array}{rr@{~}c@{~}ll} \defrule{r-read} & \Senda\Tag{\seqofc} \mathbin\ttbar \Receivea\Tag\seqof\VarXP + G & \rightarrow & P\subst{\seqofc}\seqof\VarX \\ \defrule{r-free} & \Newa\parens{\FreeaP + G} & \rightarrow & P \\ \defrule{r-def} & \invoke\RecVar{\seqofc} & \rightarrow & P\subst{\seqofc}\seqof\VarX & \text{if $\define\RecVar\seqof\VarXP$} \\ \defrule{r-par} & P \mathbin\ttbar R & \rightarrow & Q \mathbin\ttbar R & \text{if $P \rightarrow Q$} \\ \defrule{r-new} & \NewaP & \rightarrow & \NewaQ & \text{if $P \rightarrow Q$} \\ \defrule{r-struct} & P & \rightarrow & Q & \text{if $P \equiv P' \rightarrow Q' \equiv Q$} \end{array} \] where $P\subst\seqof\MailboxC\seqof\VarX$ denotes the usual capture-avoiding replacement of the variables $\seqof\VarX$ with the mailbox names $\seqof\MailboxC$. Rule~\refrule{r-read} models the selective reception of an $\Tag$-tagged message from mailbox $a$, which erases all the other actions of the guard. Rule~\refrule{r-free} is triggered when the process is ready to delete the empty mailbox $a$ and no more messages can be stored in $a$ because there are no other processes in the scope of $a$. Rule~\refrule{r-def} models a process invocation by replacing the process variable $\RecVar$ with the corresponding definition. Finally, rules~\refrule{r-par}, \refrule{r-new} and \refrule{r-struct} close reductions under parallel compositions, name restrictions and structural congruence. We write $\rightarrow^*$ for the reflexive and transitive closure of $\rightarrow$, we write $P \arrownot\red^* Q$ if not $P \rightarrow^* Q$ and $P \arrownot\red$ if $P \arrownot\red Q$ for all $Q$. Hereafter, we will occasionally use numbers and conditionals in processes. These and other features can be either encoded or added to the calculus without difficulties. \begin{example}[lock] \label{ex:lock} In this example we model a lock as a process that waits for messages from a $\Var[self]$ mailbox in which acquisition and release requests are stored. The lock is either free or busy. When in state free, the lock nondeterministically consumes an $\Tag[acquire]$ message from $\Var[self]$. This message indicates the willingness to acquire the lock by another process and carries a reference to a mailbox into which the lock stores a $\Tag[reply]$ notification. When in state busy, the lock waits for a $\Tag[release]$ message indicating that it is being released: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[FreeLock](\Var[self]) & \triangleq & \Free\Var[self]\mkkeyword{done} \\ & + & \Receive\Var[self]\Tag[acquire]\Var[owner] \invoke\RecVar[BusyLock]{\Var[self],\Var[owner]} \\ & + & \Receive\Var[self]\Tag[release]{} \Fail\Var[self] \\ \RecVar[BusyLock](\Var[self],\Var[owner]) & \triangleq & \Send\Var[owner]\Tag[reply]\Var[self] \mathbin\ttbar \Receive\Var[self]\Tag[release]{}\invoke\RecVar[FreeLock]\Var[self] \end{array} \] Note the presence of the $\Free[]\Var[self]$ guard in the definition of $\RecVar[FreeLock]$ and the lack thereof in $\RecVar[BusyLock]$. In the former case, the lock manifests the possibility that no process is willing to acquire the lock, in which case it deletes the mailbox and terminates. In the latter case, the lock manifests its expectation to be eventually released by its current owner. % Also note that $\RecVar[FreeLock]$ fails if it receives a $\Tag[release]$ message. In this way, the lock manifests the fact that it can be released only if it is currently owned by a process. % A system where two users $\Var[alice]$ and $\Var[carol]$ compete for acquiring $\Var[lock]$ can be modeled as the process \begin{equation} \label{eq:alice_carol} \New\Var[lock] \New\Var[alice] \New\Var[carol]\parens{ \invoke\RecVar[FreeLock]\Var[lock] \mathbin\ttbar \invoke\RecVar[User]{\Var[alice], \Var[lock]} \mathbin\ttbar \invoke\RecVar[User]{\Var[carol], \Var[lock]} } \end{equation} where \[ \RecVar[User](\Var[self], \Var[lock]) \triangleq \Send\Var[lock]\Tag[acquire]\Var[self] \mathbin\ttbar \Receive\Var[self]\Tag[reply]{l} \parens{ \Send{l}\Tag[release]{} \mathbin\ttbar \Free\Var[self]\mkkeyword{done} } \] Note that $\RecVar[User]$ uses the reference $l$ -- as opposed to $\Var[lock]$ -- to release the acquired lock. As we will see in Section~\ref{sec:rules}, this is due to the fact that it is this particular reference to the lock's mailbox -- and not $\Var[lock]$ itself -- that carries the capability to release the lock. % \hfill$\blacksquare$ \end{example} \begin{example}[future variable] \label{ex:future} A future variable is a one-place buffer that stores the result of an asynchronous computation. The content of the future variable is set once and for all by the producer once the computation completes. This phase is sometimes called \emph{resolution} of the future variable. After the future variable has been resolved, its content can be retrieved any number of times by the consumers. If a consumer attempts to retrieve the content of the future variable beforehand, the consumer suspends until the variable is resolved. % We can model a future variable thus: \[ \begin{array}{@{}r@{~}c@{~}l@{}} \RecVar[Future](\Var[self]) & \triangleq & \Receive\Var[self]\Tag[resolve]\Var\invoke\RecVar[Present]{\Var[self],\Var} \\ \RecVar[Present](\Var[self], \Var) & \triangleq & \Free\Var[self]\mkkeyword{done} \\ & + & \Receive\Var[self]\Tag[get]\Var[sender](\Send\Var[sender]\Tag[reply]\Var \mathbin\ttbar \invoke\RecVar[Present]{\Var[self],\Var}) \\ & + & \Receive\Var[self]\Tag[resolve]{} \Fail\Var[self] \end{array} \] The process $\RecVar[Future]$ represents an unresolved future variable, which waits for a $\Tag[resolve]$ message from the producer. Once the variable has been resolved, it behaves as specified by $\RecVar[Present]$, namely it satisfies an arbitrary number of $\Tag[get]$ messages from consumers but it no longer accepts $\Tag[resolve]$ messages. % \hfill$\blacksquare$ \end{example} \begin{example}[bank account] \label{ex:account} Below we see the process definition corresponding to the actor shown in Listing~\ref{lst:account}. The structure of the term follows closely that of the Scala code: \[ \begin{array}{@{}rcl@{}} \RecVar[Account](\Var[self], \Var[balance]) & \triangleq & \Receive\Var[self]\Tag[debit]{\Var[amount],\Var[sender]} \\ & & \Send\Var[sender]\Tag[reply]{} \mathbin\ttbar \invoke\RecVar[Account]{\Var[self], \Var[balance] + \Var[amount]} \\ & + & \Receive\Var[self]\Tag[credit]{\Var[amount],\Var[recipient],\Var[sender]} \\ & & \Send\Var[recipient]\Tag[debit]{\Var[amount],\Var[self]} \mathbin\ttbar {} \\ & & \Receive\Var[self]\Tag[reply]{} \parens{ \Send\Var[sender]\Tag[reply]{} \mathbin\ttbar \invoke\RecVar[Account]{\Var[self], \Var[balance] + \Var[amount]} } \\ & + & \Receive\Var[self]\Tag[stop]{} \Free\Var[self]\mkkeyword{done} \\ & + & \Receive\Var[self]\Tag[reply]{} \Fail\Var[self] \end{array} \] The last term of the guarded process, which results in a failure, corresponds to the catch-all clause in Listing~\ref{lst:account} and models the fact that a $\Tag[reply]$ message is not expected to be found in the account's mailbox unless the account is involved in a transaction. The $\Tag[reply]$ message is received and handled appropriately in the $\Tag[credit]$-guarded term. We can model a deadlock in the case two distinct bank accounts attempt to initiate a transaction with one another. Indeed, we have \[ \begin{lines} \invoke\RecVar[Account]{\Var[alice], 10} \mathbin\ttbar \Send\Var[alice]\Tag[credit]{2, \Var[carol], \Var[bank]} \mathbin\ttbar {} \\ \invoke\RecVar[Account]{\Var[carol], 15} \mathbin\ttbar \Send\Var[carol]\Tag[credit]{5, \Var[alice], \Var[bank]} \end{lines} \rightarrow^* \begin{lines} \Send\Var[carol]\Tag[debit]{2,\Var[alice]} \mathbin\ttbar \Receive[]\Var[alice]\Tag[reply]{}\dots \mathbin\ttbar {} \\ \Send\Var[alice]\Tag[debit]{5,\Var[carol]} \mathbin\ttbar \Receive[]\Var[carol]\Tag[reply]{}\dots \end{lines} \] where both $\Var[alice]$ and $\Var[carol]$ ignore the incoming $\Tag[debit]$ messages, whence the deadlock. % \hfill$\blacksquare$ \end{example} We now provide operational characterizations of the properties enforced by our typing discipline. We begin with mailbox conformance, namely the property that a process never fails because of unexpected messages. To this aim, we define a process context $\mathcal{C}$ as a process in which there is a single occurrence of an \emph{unguarded hole} $[~]$: \[ \mathcal{C} ~~::=~~ [~] ~~\mid~~ \mathcal{C} \mathbin\ttbar P ~~\mid~~ P \mathbin\ttbar \mathcal{C} ~~\mid~~ \Newa\mathcal{C} \] The hole is ``unguarded'' in the sense that it does not occur prefixed by an action. As usual, we write $\mathcal{C}[P]$ for the process obtained by replacing the hole in $\mathcal{C}$ with $P$. Names may be captured by this replacement. A mailbox conformant process never reduces to a state in which the only action of a guard is $\Fail{}$: \begin{definition} \label{def:mailbox_conformance} We say that $P$ is \emph{mailbox conformant} if $P \arrownot\red^* \mathcal{C}[\Faila]$ for all $\mathcal{C}$ and $a$. \end{definition} Looking at the placement of the $\Failu$ actions in earlier examples we can give the following interpretations of mailbox conformance: a lock is never released unless it has been acquired beforehand (Example~\ref{ex:lock}); a future variable is never resolved twice (Example~\ref{ex:future}); an account will not be notified of a completed transaction (with a $\Tag[reply]$ message) unless it is involved in an ongoing transaction (Example~\ref{ex:account}). We express deadlock freedom as the property that all irreducible residuals of a process are (structurally equivalent to) the terminated process: \begin{definition} \label{def:deadlock_freedom} We say that $P$ is \emph{deadlock free} if $P \rightarrow^* Q \arrownot\red$ implies $Q \equiv \mkkeyword{done}$. \end{definition} According to Definition~\ref{def:deadlock_freedom}, if a deadlock-free process halts we have that: (1) there is no sub-process waiting for a message that is never produced; (2) every mailbox is empty. Clearly, this is not the case for the transaction between $\Var[alice]$ and $\Var[carol]$ in Example~\ref{ex:account}. \begin{example}[deadlock] \label{ex:deadlock} Below is another example of deadlocking process using $\RecVar[Future]$ from Example~\ref{ex:future}, obtained by resolving a future variable with the value it does not contain yet: \begin{equation} \label{eq:future_deadlock} \New\Var[f] \Newc\parens{ \invoke\RecVar[Future]\Var[f] \mathbin\ttbar \Send\Var[f]\TagGetc \mathbin\ttbar \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var } \end{equation} Notice that attempting to retrieve the content of a future variable not knowing whether it has been resolved is legal. Indeed, $\RecVar[Future]$ does not fail if a $\Tag[get]$ message is present in the future variable's mailbox before it is resolved. Thus, the deadlocked process above is mailbox conformant but also an instance of undesirable process that will be ruled out by our static analysis technique (\emph{cf.}\xspace Example~\ref{ex:future_deadlock}). We will need dependency graphs in addition to types to flag this process as ill typed. % \hfill$\blacksquare$ \end{example} A property stronger than deadlock freedom is fair termination. A fairly terminating process is a process whose residuals always have the possibility to terminate. Formally: \begin{definition} \label{def:terminating} We say that $P$ is \emph{fairly terminating} if $P \rightarrow^* Q$ implies $Q \rightarrow^* \mkkeyword{done}$. \end{definition} An interesting consequence of fair termination is that it implies \emph{junk freedom} (also known as lock freedom~\cite{Kobayashi02,Padovani14B}) namely the property that every message can be eventually consumed. Our type system does not guarantee fair termination nor junk freedom in general, but it does so for a non-trivial sub-class of well-typed processes that we characterize later on. \subsection{Proof of mailbox conformance} \label{sec:proof_conformance} \begin{lemma} \label{lem:fail} If $\wtp\Gamma{\mathcal{C}[\Failu]}\varphi$, then $\Gamma$ is unreliable. \end{lemma} \begin{proof} We reason by induction on the derivation of $\wtp\Gamma{\mathcal{C}[\Failu]}\varphi$ and by cases on the last rule applied, omitting symmetric cases and those ruled out by the syntax of $\mathcal{C}$. \proofrule{t-guard} % From \refrule{t-fail} we deduce that $\Gamma = u : \ttqmark\mathbb{0}, \Delta$ and we conclude that $\Gamma$ is unreliable. \proofrule{t-par} % Suppose, without loss of generality, that $\mathcal{C} = P \mathbin\ttbar \mathcal{C}'$. % Then there exist $\Gamma_1$, $\Gamma_2$, $\varphi_1$ and $\varphi_2$ such that $\Gamma = \Gamma_1 \mathbin{\|} \Gamma_2$ and $\varphi \Rightarrow \varphi_1 \sqcup \varphi_2$ and $\wtp{\Gamma_1}{P}{\varphi_1}$ and $\wtp{\Gamma_2}{\mathcal{C}'[\Failu]}{\varphi_2}$. % From the induction hypothesis we deduce that $\Gamma_2$ is unreliable. % We know that $\Gamma_1$ is usable since all types are assumed to be usable, hence we conclude that $\Gamma_1 \mathbin{\|} \Gamma_2$ is unreliable by Proposition~\ref{prop:env_mul_reliable}. \proofrule{t-new} % Then $\mathcal{C} = \Newa\mathcal{C}'$ and $\wtp{\Gamma, a : \ttqmark\mathbb{1}}{\mathcal{C}'[\Failu]}\psi$. % By induction hypothesis we deduce that $\Gamma, a : \ttqmark\mathbb{1}$ is unreliable. % Since $\ttqmark\mathbb{1}$ is reliable, we conclude that $\Gamma$ is unreliable. \proofrule{t-sub} % Then $\wtp\Delta{\mathcal{C}[\Failu]}\psi$ where $\Gamma \leqslant \Delta$. % By induction hypothesis we deduce that $\Delta$ is unreliable and we conclude by Proposition~\ref{prop:env_subt_reliable}. \end{proof} \begin{lemma} \label{lem:conformance} If $\wtp\EmptyContextP\varphi$, then $P \arrownot\red^* \mathcal{C}[\Faila]$ for all $\mathcal{C}$ and $a$. \end{lemma} \begin{proof} Immediate consequence of Theorem~\ref{thm:sr} and Lemma~\ref{lem:fail}. \end{proof} \subsection{Proof of deadlock freedom} \label{sec:proof_deadlock_freedom} \begin{notation} We abbreviate $\wtp\ContextP\varphi$ with $\wtp\ContextP{}$ when the dependency graph $\varphi$ is irrelevant. \end{notation} \begin{notation} Let $\wtp\ContextP{}$ and $u\in\mathsf{fn}(P)$. We write $u^\tau \in P$ if $u\in\mathsf{fn}(P)$ and there is a judgment of the form $\wtp{\Delta, u : \tau}Q{}$ in the derivation tree of $\wtp\ContextP{}$. Similarly for guards. \end{notation} \begin{definition} We say that $Q$ occurs \emph{unguarded} in $P$ if $P = \mathcal{C}[Q]$ for some $\mathcal{C}$. \end{definition} \begin{lemma}[output occurrence] \label{lem:output_occurrence} If $\wtp{a : \ttemarkE, \Gamma}P{}$ and $\Gamma$ is reliable, then there exist $n\geq 0$ and $F_1, \dots, F_n$ such that $F_1 \cdots F_n \subp E$ and $a^{\ttemarkF_i} \in P$ for all $1 \leq i\leq n$. Furthermore, the $a^{\ttemarkF_i}$ occurrences account for all of the unguarded messages stored into $a$ by $P$. \end{lemma} \begin{proof} By induction on the typing derivation and by cases on the last typing rule applied. The fact that all of the unguarded messages stored into $a$ by $P$ are considered follows from the structure of the proof, which visits every sub-process of $P$ in which $a$ may occur free. \proofrule{t-done} % This case is impossible because $\mkkeyword{done}$ is well typed in the empty context only. \proofrule{t-msg} % Then $P = \Sendu\Tag\seqof\NameV$ and $a : \ttemarkE, \Gamma = u : \ttemark\tmessage\Tag\seqof\TypeT, \seqof\NameV : \seqof\TypeT$ where $a$ is either $u$ or one of the $v_i$. % We conclude by taking $n \stackrel{\text{\tiny def}}= 1$ and $F_1 \stackrel{\text{\tiny def}}= E$. \proofrule{t-def} % Similar to the previous case. \proofrule{t-par} % Then $P = P_1 \mathbin\ttbar P_2$ and $a : \ttemarkE, \Gamma = \Gamma_1 \mathbin{\|} \Gamma_2$ and $\wtp{\Gamma_i}{P_i}{}$ for every $i=1,2$. % From the hypothesis that $\Gamma$ is reliable, the assumption that all types are usable and Proposition~\ref{prop:env_mul_reliable} we deduce that $\Gamma_1$ and $\Gamma_2$ are reliable. % We discuss two interesting sub-cases: \begin{itemize} \item Suppose $\Gamma_1 = a : \ttemarkE, \Gamma_1'$ and $a \not\in\mathsf{dom}(\Gamma_2)$. % Then $a \not\in \mathsf{fn}(P_2)$ and we conclude from the induction hypothesis on $P_1$. \item Suppose $\Gamma_1 = a : \ttemarkE_1, \Gamma_1'$ and $\Gamma_2 = a : \ttemarkE_2, \Gamma_2'$ and $E = E_1 \cdot E_2$. % From the induction hypothesis we deduce that there exist $n_1 \geq 0$ and $n_2 \geq 0$ and $F_1', \dots, F_{n_1}'$ and $F_1'', \dots, F_{n_2}''$ such that $F_1' \cdots F_{n_1}' \subp E_1$ and $F_1'' \cdots F_{n_2}'' \subp E_2$ and $a^{\ttemarkF_i'} \in P_1$ for all $1\leq i\leq n_1$ and $a^{\ttemarkF_i''} \in P_2$ for all $1\leq i\leq n_2$. % We conclude by taking $n \stackrel{\text{\tiny def}}= n_1 + n_2$ and $F_1, \dots, F_n \stackrel{\text{\tiny def}}= F_1', \dots, F_{n_1}', F_1'', \dots, F_{n_2}''$. \end{itemize} \proofrule{t-new} % Then $P = \NewcQ$ and $\wtp{a : \ttemarkE, \Gamma, c : \ttqmark\mathbb{1}}Q{}$. % Since $\ttqmark\mathbb{1}$ is reliable we conclude by the induction hypothesis. \proofrule{t-guard} % Then $P = G$ and $\wtg\ContextG$. % We conclude by the induction hypothesis. \proofrule{t-sub} % Then $\wtp\ContextBP{}$ where $a : \ttemarkE, \Gamma \leqslant \Delta$. % We have two possibilities: \begin{itemize} \item Suppose $a\in\mathsf{dom}(\Delta)$. % Then $\Delta = a : \ttemarkE', \Delta'$ where $E' \subp E$ and $\Gamma \leqslant \Delta'$. % From Proposition~\ref{prop:env_subt_reliable} we deduce that $\Delta'$ is reliable. % We conclude by the induction hypothesis using transitivity of $\subp$. \item Suppose $a\not\in\mathsf{dom}(\Delta)$. % Then $a\not\in\mathsf{fn}(P)$ and $\ttemarkE$ is irrelevant, meaning that $\mathbb{1} \subp E$. % We conclude by taking $n \stackrel{\text{\tiny def}}= 0$. \end{itemize} \proofrule{t-fail} % This case is impossible because $\Gamma$ is reliable by hypothesis. \proofrule{t-free} % Then $P = \FreeuQ$ and $a : \ttemarkE, \Gamma = u : \ttqmark\mathbb{1}, \Delta$ and $\wtp\ContextBQ{}$. % Clearly $a \ne u$. Also, from the hypothesis that $\Gamma$ is reliable we deduce that $\Delta$ is reliable. % We conclude by the induction hypothesis. \proofrule{t-in} % Then $P = \Receiveu\Tag\seqof\VarXQ$ and $a : \ttemarkE, \Gamma = u : \ttqmark(\tmessage\Tag\seqof\TypeT \cdot F), \Delta$ and $\wtp{u : \ttqmarkF, \Delta, \seqof\VarX : \seqof\TypeT}Q{}$. % Clearly $a \ne u$ therefore $\Delta = a : \ttemarkE, \Delta'$. % From the hypothesis that $\Gamma$ is reliable we deduce that $F \not\subp \mathbb{0}$. % From the assumption that argument types are reliable we deduce that $u : \ttqmarkF, \Delta, \seqof\VarX : \seqof\TypeT$ is reliable. % We conclude by the induction hypothesis. \proofrule{t-branch} % Then $P = G_1 + G_2$ and $a : \ttemarkE, \Gamma = u : \ttqmark(E_1 + E_2), \Delta$ and $\wtg{u : \ttqmarkE_i, \Delta}{G_i}$ for every $i=1,2$. % Clearly $a \ne u$, therefore $\Delta = a : \ttemarkE, \Delta'$. % From the hypothesis that $\Gamma$ is reliable we deduce that $E_1 + E_2 \not\subp \mathbb{0}$. Suppose, without loss of generality, that $E_1 \not\subp \mathbb{0}$. % We conclude by the induction hypothesis on $G_1$. \end{proof} \begin{lemma}[input occurrence] \label{lem:input_occurrence} If $\wtp{a : \ttqmarkE, \Gamma}P{}$ and $\Gamma$ is reliable and $\mathtt{M} \cdot F \subp E$ and $F \not\subp \mathbb{0}$, then there exist $\mathtt{M}'$ and $F'$ such that $\mathtt{M} \subp \mathtt{M}'$ and $F' \not\subp \mathbb{0}$ and $a^{\ttqmark\mathtt{M}'\tmulF'} \in P$. \end{lemma} \begin{proof} By induction on the derivation of $\wtp{a : \ttqmarkE, \Gamma}P{}$ and by cases on the last rule applied, recalling that a guard is also a process. \proofrule{t-done} % This case is impossible because $\mkkeyword{done}$ is well typed in the empty context only. \proofrule{t-msg} % Then $P = \Sendu\Tag\seqof\NameV$ and $a : \ttqmarkE, \Gamma = u : \ttemark\tmessage\Tag\seqof\TypeT, \seqof\NameV : \seqof\TypeT$. % Clearly $a \ne u$, so we conclude by taking $\mathtt{M} \stackrel{\text{\tiny def}}= \mathtt{M}'$ and $F' \stackrel{\text{\tiny def}}= F$. \proofrule{t-def} % Similar to the previous case. \proofrule{t-par} % Then $P = P_1 \mathbin\ttbar P_2$ and $a : \ttqmarkE, \Gamma = \Gamma_1 \mathbin{\|} \Gamma_2$ and $\wtp{\Gamma_i}{P_i}{}$ for $i=1,2$. % We only discuss one interesting case when $\Gamma_1 = a : \ttemarkE_1, \Gamma_1'$ and $\Gamma_2 = a : \ttqmark(E_1 \cdot E), \Gamma_2'$. % From the assumption that all types are usable we know that $E_1 \not\subp \mathbb{0}$ and both $\Gamma_1'$ and $\Gamma_2'$ are usable. % From the hypothesis that $\Gamma$ is reliable we deduce that $\Gamma_1' \mathbin{\|} \Gamma_2'$ is also reliable. % From Proposition~\ref{prop:env_mul_reliable} we deduce that $\Gamma_1'$ and $\Gamma_2'$ are both reliable. % From the hypothesis $\mathtt{M} \cdot F \subp E$ and the precongruence of $\subp$ we deduce $\mathtt{M} \cdot E_1 \cdot F \subp E_1 \cdot E$. % From $E_1 \not\subp \mathbb{0}$ and the hypothesis $F \not\subp \mathbb{0}$ we deduce $E_1 \cdot F \not\subp \mathbb{0}$. % We conclude by the induction hypothesis. \proofrule{t-new} % Then $P = \NewcQ$ and $\wtp{a : \ttqmarkE, \Gamma, c : \ttqmark\mathbb{1}}Q{}$. % Observe that $\ttqmark\mathbb{1}$ is reliable, so we can conclude by the induction hypothesis. \proofrule{t-sub} % Then $\wtp\ContextBP$ for some $\Delta$ such that $a : \ttqmarkE, \Gamma \leqslant \Delta$, which implies $\Delta = \ttqmarkE', \Delta'$ where $E \subp E'$ and $\Gamma \leqslant \Delta'$. % We have $\mathtt{M} \cdot F \subp E \subp E'$ by transitivity of $\subp$. % From the hypothesis that $\Gamma$ is reliable and Proposition~\ref{prop:env_subt_reliable} we deduce that $\Delta'$ is reliable. % We conclude by the induction hypothesis. \proofrule{t-guard} % Straightforward application of the induction hypothesis. \proofrule{t-fail} % This case is impossible because $E \not\subp \mathbb{0}$ and $\Gamma$ is reliable. \proofrule{t-free} % Then $P = \FreeuQ$ and $a : \ttqmarkE, \Gamma = u : \ttqmark\mathbb{1}, \Delta$ and $\wtp\ContextBQ{}$. % From the hypotheses $\mathtt{M} \cdot F \subp E$ and $F \not\subp \mathbb{0}$ we deduce $a \ne u$, hence $\Delta = a : \ttqmarkE, \Delta'$ for some $\Delta'$ such that $\Delta'$ is usable. % We conclude by the induction hypothesis. \proofrule{t-in} % Then $P = \Receiveu\Tag\seqof\VarXQ$ and $a : \ttqmarkE, \Gamma = u : \ttqmark(\tmessage\Tag\seqof\Type \cdot E'), \Delta$ and $\wtp{u : \ttqmarkE', \Delta, \seqof\VarX : \seqof\Type}Q{}$. % We distinguish the following sub-cases: \begin{itemize} \item Suppose $a = u$ and $\mathtt{M} \subp \tmessage\Tag\seqof\Type$. % Then $E = \tmessage\Tag\seqof\Type \cdot E'$. % From the hypotheses $\mathtt{M} \cdot F \subp E$ and $F \not\subp \mathbb{0}$ we deduce $E' \not\subp \mathbb{0}$. % We conclude by taking $\mathtt{M}' \stackrel{\text{\tiny def}}= \tmessage\Tag\seqof\Type$ and $F' \stackrel{\text{\tiny def}}= E'$. \item Suppose $a = u$ and $\mathtt{M} \not\subp \tmessage\Tag\seqof\Type$. % From the hypotheses $\mathtt{M} \cdot F \subp E$ and $F \not\subp \mathbb{0}$ we deduce that $\mathtt{M} \cdot E'' \subp E'$ for some $E'' \not\subp \mathbb{0}$. % Observe that $\Delta = \Gamma$. % From the assumption that argument types are reliable we know that all the types in $\seqof\Type$ are reliable. Therefore we can conclude by the induction hypothesis. \item Suppose $a \ne u$. % From the hypothesis that $\Gamma$ is reliable we deduce $E' \not\subp \mathbb{0}$. % From the assumption that argument types are reliable we know that all the types in $\seqof\Type$ are reliable. Therefore we can conclude by the induction hypothesis. \end{itemize} \proofrule{t-branch} % Then $P = G_1 + G_2$ and $a : \ttqmarkE, \Gamma = u : \ttqmark(E_1 + E_2), \Delta$ and $\wtg{u : \ttqmarkE_i, \Delta}{G_i}$. % We distinguish two sub-cases: \begin{itemize} \item If $a = u$, then $E = E_1 + E_2$ and $\Gamma = \Delta$. % From the hypothesis $\mathtt{M} \cdot F \subp E$ we deduce $\mathtt{M} \cdot F \subp E_i$ for some $i=1,2$.\Luca{Questa proproet\`a richiede un lemma non banale che usa anche l'ipotesi che $E$ \`e in forma normale.} % We conclude by the induction hypothesis. \item If $a \ne u$, then $\Delta = a : \ttqmarkE, \Delta'$. % From the hypothesis that $\Gamma$ is reliable we deduce $E_1 + E_2 \not\subp \mathbb{0}$. % Suppose, without loss of generality, that $E_1 \not\subp \mathbb{0}$. We conclude by applying the induction hypothesis on $G_1$. % \qedhere \end{itemize} \end{proof} \begin{lemma} \label{lem:termination} If $\wtp\EmptyContextP\psi$ and $P \arrownot\red$, then $P \equiv \mkkeyword{done}$. \end{lemma} \begin{proof} Using the hypothesis $P \arrownot\red$ and the laws of structural congruence we deduce that \[ P \equiv \New\seqof\MailboxAQ \qquad \text{where} \qquad Q = \prod_{i\in I} \Send{a_i}{\Tag_i}{\seqof\MailboxC_i} \mathbin\ttbar \prod_{\mathclap{j\in J}} G_j \] where $\wtp{\seqof\MailboxA : \ttqmark\mathbb{1}}{Q}{\varphi}$ and $\varphi$ is acyclic and each guarded process $G_j$ concerns some mailbox $a_j$. % We prove the result by contradiction, assuming that $I \cup J \ne \emptyset$. The proof proceeds in two steps. In the first step we show that, for every $m\in I\cup J$, there exist $n\in I\cup J$ such that $\varphi \Rightarrow \gedge{a_n}{a_m}$ and $\varphi$ contains an edge where $a_n$ and $a_m$ occur precisely in this order. In the second step, we show that this ultimately leads to a cyclic graph. Suppose $Q \equiv R \mathbin\ttbar G$ where $G \equiv \sum_{h\in H} \Receivea{\Tag_h}{\seqof\VarX_h}P_h\set{{} + \FreeaP'}$. % From \refrule{t-sub} and \refrule{t-par} we deduce that there exist $\Gamma_1$, $\Gamma_2$, $E$, $F$, $\varphi_1$ and $\varphi_2$ such that: \begin{itemize} \item $\wtp{\Gamma_1, a : \ttemarkE}R{\varphi_1}$ \item $\wtp{\Gamma_2, a : \ttqmark(E \cdot F)}G{\varphi_2}$ \item $\mathbb{1} \subp F$ \end{itemize} where $\Gamma_1$ and $\Gamma_2$ are both reliable. % From \refrule{t-sub} and \refrule{t-guard} we deduce that $E \cdot F \subp \sum_{h\in H} \tmessage{\Tag_h}{\seqof\Type_h} \cdot E_h\set{{} + \mathbb{1}}$. % From Lemma~\ref{lem:output_occurrence} we deduce that there exist $n\geq 0$ and $F_1, \dots, F_n$ such that $F_1 \cdots F_n \subp E$ and $a^{\ttemarkF_k} \in R$ for all $1\leq k\leq n$. % Suppose $n = 0$. Then $\mathbb{1} \subp E$ and therefore $\mathbb{1} \subp E \cdot F$, meaning that the $\FreeaP'$ sub-term must be present in $G$. This is absurd for we know that $P \arrownot\red$, hence there must be at least one occurrence of $a$ in $R$. % In particular, one of the $F_k$ for $1\leq k\leq n$ generates a non-empty subset of the $\tmessage{\Tag_h}{\seqof\Type_h}$ for $h\in H$. % We reason by cases on the places where the $a^{\ttemarkF_k}$ may occur: \begin{itemize} \item From the hypothesis $P \arrownot\red$ we deduce that for every $i\in I$ either $a_i \ne a$ or $\Tag_i \ne \Tag_h$ for every $h\in H$. Therefore, the $a^{\ttemarkF_k}$ cannot be any of the $a_i$. % \item If $a^{\ttemarkF_k}$ occurs in $\set{\seqof\MailboxC_i}$ for some $i\in I$, then $a_i \ne a$ and $\varphi \Rightarrow \gedge{a_i}{a}$. \item All of the $a_j$ have an input capability, therefore the $a^{\ttemarkF_k}$ cannot be any of them. \item If $a^{\ttemarkF_k}$ occurs in $G_j$ for some $j\in J$, then $a_j \ne a$ because $a$ is already used for input in $G$, so we have $\varphi \Rightarrow \gedge{a_j}{a}$. \end{itemize} Suppose $Q \equiv \Senda\Tag\seqof\MailboxC \mathbin\ttbar R$. % From \refrule{t-sub}, \refrule{t-par} and \refrule{t-msg} we deduce that there exist $\Gamma_1$, $\Gamma_2$, $E$, $F$, $\varphi_1$ and $\varphi_2$ such that: \begin{itemize} \item $\wtp{\Gamma_1, a : \ttemark\tmessage\Tag\seqof\Type}{\Senda\Tag\seqof\MailboxC}{\varphi_1}$ \item $\wtp{\Gamma_2, a : \ttqmark(E \cdot F)}R{\varphi_2}$ \item $\tmessage\Tag\seqof\Type \subp E$ and $\mathbb{1} \subp F$ \end{itemize} where $\Gamma_1$ and $\Gamma_2$ are both reliable. % From Lemma~\ref{lem:input_occurrence} we deduce that there exist $\mathtt{M}$ and $F'$ such that $\tmessage\Tag\seqof\Type \subp \mathtt{M}$ and $F' \not\subp \mathbb{0}$ and $a^{\ttqmark\mathtt{M} \cdot F'} \in R$. % We reason by cases on the places where $a^{\ttqmark\mathtt{M} \cdot F'}$ may occur: % \begin{itemize} \item All the $a_i$ have an output capability, therefore $a^{\ttqmark\mathtt{M}\tmulF'}$ cannot be any of them. \item If $a^{\ttqmark\mathtt{M}\tmulF'}$ occurs in $\set{\seqof\MailboxC_i}$ for some $i\in I$, then $a_i \ne a$ and $\varphi \Rightarrow \gedge{a_i}{a}$. \item If $a^{\ttqmark\mathtt{M}\tmulF'} \in G_j$ where $a_j \ne a$, then $\varphi \Rightarrow \gedge{a_j}{a}$. \item If $a^{\ttqmark\mathtt{M}\tmulF'} \in G_j \equiv \sum_{h\in H} \Receivea{\Tag_h}{\seqof\VarX_h}P_h\set{{} + \FreeaP'}$, then we can reason as in the case for inputs and find some $a_k \ne a$ such that $\varphi \Rightarrow \gedge{a_k}a$. \end{itemize} In summary, we have seen that starting from the assumption that $I \cup J \ne \emptyset$ it is possible to obtain a set $A$ of mailbox names that contains at least two distinct elements and such that for every $a \in A$ there exists $b \in A$ such that $\varphi \Rightarrow \gedge\MailboxBa$ and $\varphi$ contains an edge where $b$ and $a$ precisely occur in this order. The set $A$ is necessarily finite because $Q$ is finite, therefore $\grel\varphi$ must be reflexive, which contradicts the hypothesis that $\varphi$ is acyclic. This is absurd, hence we conclude $I = J = \emptyset$. \end{proof} \begin{lemma} \label{lem:deadlock_freedom} If $\wtp\EmptyContextP\varphi$ and $P \rightarrow^* Q \arrownot\red$, then $Q \equiv \mkkeyword{done}$. \end{lemma} \begin{proof} Straightforward consequence of Theorem~\ref{thm:sr} and Lemma~\ref{lem:termination}. \end{proof} \section{Proofs of Theorems~\ref{thm:soundness} and~\ref{thm:fair_termination}} \label{sec:proof_soundness} \begin{reptheorem}{thm:soundness} If $\wtp\EmptyContextP\varphi$, then $P$ is mailbox conformant and deadlock free. \end{reptheorem} \begin{proof} Immediate consequence of Lemma~\ref{lem:conformance} and Lemma~\ref{lem:deadlock_freedom}. \end{proof} \begin{reptheorem}{thm:fair_termination} If $\wtp\EmptyContextP\varphi$ and $P$ is finitely unfolding, then $P$ is fairly terminating. \end{reptheorem} \begin{proof} Consider a reduction $P \rightarrow^* Q$. From the hypothesis that $P$ is finitely unfolding we know that there exists $R$ such that $P \rightarrow^* Q \rightarrow^* R$ and no reduction of $R$ uses \refrule{r-def}. We conclude applying Theorem~\ref{thm:sr} and Lemma~\ref{lem:fair_termination}. \end{proof} \input{proof_conformance} \input{proof_deadlock_freedom} \input{proof_termination} \section{Proof of Theorem~\ref{thm:sr}} \label{sec:proof_type_preservation} \begin{lemma} \label{lem:subst} If $\wtp{\Gamma, \Var : \tau}P\varphi$ and $a \not\in\mathsf{dom}(\Gamma)$, then $\wtp{\Gamma, a : \tau}{P\substa\Var}{\varphi\substa\Var}$. \end{lemma} \begin{proof} A straightforward induction on the derivation of $\wtp{\Gamma, \Var : \tau}P\varphi$. \end{proof} \begin{lemma} If $\wtp\ContextP\varphi$ and $P \equiv Q$, then $\wtp\ContextQ\varphi$. \end{lemma} \begin{proof} An easy induction on the derivation of $P \equiv Q$, reasoning by cases on the last rule applied. The most critical points concern dependency graphs, whose structure changes as processes and restrictions are rearranged. Proposition~\ref{prop:grel} provides all the arguments to conclude that these changes do not affect the semantics of dependency graphs and therefore that no cycles are introduced. \end{proof} \begin{reptheorem}{thm:sr} If $\Gamma$ is reliable and $\wtp\ContextP\varphi$ and $P \rightarrow Q$, then $\wtp\ContextQ\varphi$. \end{reptheorem} \begin{proof} By induction on the derivation of $P \rightarrow Q$ and by cases on the last rule applied. \proofrule{r-read} % Then $P = \Senda\Tag\seqof\MailboxC \mathbin\ttbar \Receivea\Tag\seqof\VarXP + G\rightarrow P\subst\seqof\MailboxC\seqof\VarX = Q$. % From \refrule{t-sub} and \refrule{t-par} we deduce that there exist $\Gamma_1$, $\Gamma_2$, $\varphi_1$ and $\varphi_2$ such that: \begin{itemize} \item $\Gamma \leqslant \Gamma_1 \mathbin{\|} \Gamma_2$ \item $\varphi \Rightarrow \varphi_1 \sqcup \varphi_2$ \item $\wtp{\Gamma_1}{\Senda\Tag{\seqof\MailboxC}}{\varphi_1}$ \item $\wtp{\Gamma_2}{\Receivea\Tag\seqof\VarXP + G}{\varphi_2}$ \end{itemize} From \refrule{t-sub} and \refrule{t-msg} we deduce that there exist $\seqof\TypeT$ such that: \begin{itemize} \item $\Gamma_1 \leqslant a : \ttemark{\tmessage\Tag\seqof\Type}, \seqof\MailboxC : \seqof\Type$ \item $\varphi_1 \Rightarrow \gedgea{\set\seqof\MailboxC}$ \end{itemize} From \refrule{t-sub} and \refrule{t-guard} we deduce that there exist $\Delta$ and $E$ such that: \begin{itemize} \item $\Gamma_2 \leqslant a : \ttqmarkE, \Delta$ \item $\wtg{a : \ttqmarkE, \Delta}{\Receivea\Tag\seqof\VarXP + G}$ \item $\df{}E$ \item $\varphi_2 \Rightarrow \gedgea{\mathsf{dom}(\Delta)}$ \end{itemize} From \refrule{t-branch}, \refrule{t-in} and $\df{}E$ we deduce that there exist $\seqof\TypeS$, $F_1$, $F_2$ and $\psi$ such that: \begin{itemize} \item $E = \tmessage\Tag\seqof\TypeS \cdot F_1 + F_2$ \item $\wtp{a : \ttqmarkF_1, \Delta, \seqof\VarX : \seqof\TypeS}{P}{\psi}$ \item $F_1 \eqp \pderE{\tmessage\Tag\seqof\TypeS}$ \end{itemize} From the fact that $\varphi$ is acyclic and the properties of $\varphi_1$ and $\varphi_2$ we deduce that $\set\seqof\MailboxC \cap \mathsf{dom}(\Delta) = \emptyset$. Indeed, suppose by contradiction that $u \in \set\seqof\MailboxC \cap \mathsf{dom}(\Delta)$ and observe that $u$ cannot be $a$. Then $\varphi_1 \Rightarrow \gedgeau$ and $\varphi_2 \Rightarrow \gedge\Namea$, so $\varphi \Rightarrow \gedgea\Mailbox$ which is absurd. From the definition of subtype environment and of $\Gamma_1 \mathbin{\|} \Gamma_2$ we deduce that: \begin{itemize} \item $\Gamma_1 = a : \ttemarkE', \Gamma_1'$ where $\ttemarkE' \leqslant \ttemark{\tmessage\Tag\seqof\TypeT}$ and $\Gamma'_1 \leqslant \seqof\MailboxC : \seqof\TypeT$ \item $\Gamma_2 = a : \ttqmark\parens{E' \cdot F'}, \Gamma_2'$ where $\ttqmark\parens{E' \cdot F'} \leqslant \ttqmarkE$ and $\Gamma_2' \leqslant \Delta$ \end{itemize} From the definition of $\leqslant$, the precongruence and transitivity properties of $\subp$ we derive $\tmessage\Tag\seqof\TypeT \cdot F' \subp E' \cdot F' \subp E$. % From the hypothesis that $\Gamma$ is reliable we deduce $F' \not\subp \mathbb{0}$. % From Proposition~\ref{prop:subt_der_subt} and $\df{}E$ we deduce $\seqof\TypeT \leqslant \seqof\TypeS$ and $F' \subp \pderE{\tmessage\Tag\seqof\TypeS}$. % From Lemma~\ref{lem:subst} we deduce $\wtp{a : \ttqmarkF_1, \Delta, \seqof\MailboxC : \seqof\TypeS}{P\subst\seqof\MailboxC\seqof\VarX}{\psi\subst\seqof\MailboxC\seqof\VarX}$.\Luca{In questo punto serve sapere che in $\psi$ non possono comparire nomi arbitrari, $\seqof\MailboxC$ in particolare, per non generare cicli.} % To conclude we apply \refrule{t-sub} observing that $\Gamma \leqslant \Gamma_1 \mathbin{\|} \Gamma_2 = a : \ttqmarkF', (\Gamma_1' \mathbin{\|} \Gamma_2') \leqslant a : \ttqmarkF_1, \Delta, \seqof\MailboxC : \seqof\TypeS$ using Proposition~\ref{prop:cmul_subt} and the fact that $\set\seqof\MailboxC \cap \mathsf{dom}(\Delta) = \emptyset$. \proofrule{r-free} % Then $P = \Newa(\FreeaQ + G) \rightarrow Q$. % From \refrule{t-sub} and \refrule{t-new} we deduce that there exist $\Delta$ and $\psi$ such that: \begin{itemize} \item $\Gamma \leqslant \Delta$ \item $\varphi \Rightarrow \Newa\psi$ \item $\wtp{\Delta, a : \ttqmark\mathbb{1}}{\FreeaQ + G}{\psi}$. \end{itemize} From \refrule{t-sub} and \refrule{t-guard} we deduce that there exist $\Delta'$, $E$ and $\psi'$ such that: \begin{itemize} \item $\Delta, a : \ttqmark\mathbb{1} \leqslant \Delta', a : \ttqmarkE$ \item $\wtg{\Delta', a : \ttqmarkE}{\FreeaQ + G}$ \item $\psi \Rightarrow \gedgea{\mathsf{dom}(\Delta')}$. \end{itemize} From \refrule{t-branch} and \refrule{t-free} we deduce that there exists $\psi'$ such that $\wtp{\Delta'}{Q}{\psi'}$. % From the well formedness condition on judgments and the definition of $\leqslant$ for type environments, we know that $\mathsf{dom}(\psi') \subseteq \mathsf{dom}(\Delta') \subseteq \mathsf{dom}(\Delta) \subseteq \mathsf{dom}(\Gamma)$. % From the fact that $\psi$ implies a connected graph with domain $\seta \cup \mathsf{dom}(\Delta')$ we deduce $\varphi \Rightarrow \psi \Rightarrow \psi'$. % We conclude with one application of \refrule{t-sub}. \proofrule{r-def} % Then $P = \invoke\RecVar\seqof\MailboxC \rightarrow R\subst\seqof\MailboxC\seqof\VarX = Q$ where $\define\RecVar\seqof\VarXR$. % From \refrule{t-sub} and \refrule{t-def} we deduce that there exist $\seqof\Type$ and $\psi$ such that $\Gamma \leqslant \seqof\MailboxC : \seqof\Type$ and $\RecVar : (\seqof\VarX : \seqof\Type; \psi)$ and $\varphi \Rightarrow \psi\subst\seqof\MailboxC\seqof\VarX$. % From the hypothesis that all process definitions are well typed we know that $\wtp{\seqof\VarX : \seqof\Type}R{\psi}$. % From Lemma~\ref{lem:subst} we deduce $\wtp{\seqof\MailboxC : \seqof\Type}{R\subst\seqof\MailboxC\seqof\VarX}{\psi\subst\seqof\MailboxC\seqof\VarX}$. % To conclude we apply \refrule{t-sub}. \proofrule{r-par} % Then $P = P_1 \mathbin\ttbar P_2 \rightarrow P_1' \mathbin\ttbar P_2 = Q$ where $P_1 \rightarrow P_1'$. % From \refrule{t-sub} and \refrule{t-par} we deduce that there exist $\Gamma_1$, $\Gamma_2$, $\varphi_1$ and $\varphi_2$ such that $\wtp{\Gamma_i}{P_i}{\varphi_i}$ for $i=1,2$ where $\Gamma \leqslant \Gamma_1 \mathbin{\|} \Gamma_2$ and $\varphi \Rightarrow \varphi_1 \sqcup \varphi_2$. % From the hypothesis that $\Gamma$ is reliable and Proposition~\ref{prop:env_subt_reliable} we deduce that $\Gamma_1 \mathbin{\|} \Gamma_2$ is reliable. % From the assumption that types are usable and Proposition~\ref{prop:env_mul_reliable} we deduce that $\Gamma_1$ is reliable. % From the induction hypothesis we deduce $\wtp{\Gamma_1}{P_1'}{\varphi_1}$. % To conclude we apply \refrule{t-par} and then \refrule{t-sub}. \proofrule{r-new} % Then $P = \NewaP' \rightarrow \NewaP'' = Q$ where $P' \rightarrow P''$. % From \refrule{t-sub} and \refrule{t-new} we deduce that there exist $\Delta$ and $\psi$ such that $\wtp{\Delta, a : \ttqmark\mathbb{1}}{P'}{\psi}$ where $\Gamma \leqslant \Delta$ and $\varphi \Rightarrow \Newa\psi$. % From the hypothesis that $\Gamma$ is reliable and Proposition~\ref{prop:env_subt_reliable} we deduce that $\Delta$ is reliable and so is $\Delta, a : \ttqmark\mathbb{1}$. % From the induction hypothesis we deduce $\wtp{\Delta, a : \ttqmark\mathbb{1}}{P''}{\psi}$. % To conclude we apply \refrule{t-new} and then \refrule{t-sub}. \end{proof} \subsection{Fair termination for finitely unfolding processes} \label{sec:proof_termination} \begin{lemma} \label{lem:fair_termination} If $\wtp\EmptyContextP\varphi$ and no reduction of $P$ uses \refrule{r-def}, then $P \rightarrow^* \mkkeyword{done}$. \end{lemma} \begin{proof} Let $\mathsf{size}(P)$ be the function inductively defined by the following equations \[ \begin{array}{rcl} \mathsf{size}(\mkkeyword{done}) = \mathsf{size}(\Failu) = \mathsf{size}(\Sendu\Tag\seqof\NameV) = \mathsf{size}(\invoke\RecVar\seqof\NameU) & \stackrel{\text{\tiny def}}= & 0 \\ \mathsf{size}(\FreeuQ) = \mathsf{size}(\Receiveu\Tag\seqof\VarXQ) & \stackrel{\text{\tiny def}}= & 1 + \mathsf{size}(Q) \\ \mathsf{size}(G_1 + G_2) & \stackrel{\text{\tiny def}}= & \max\set{ \mathsf{size}(G_1), \mathsf{size}(G_2) } \\ \mathsf{size}(P_1 \mathbin\ttbar P_2) & \stackrel{\text{\tiny def}}= & \mathsf{size}(P_1) + \mathsf{size}(P_2) \\ \mathsf{size}(\NewaQ) & \stackrel{\text{\tiny def}}= & \mathsf{size}(Q) \end{array} \] and observe that $P \rightarrow Q$ implies $\mathsf{size}(Q) < \mathsf{size}(P)$ from the hypothesis that no reduction of $P$ uses \refrule{r-def}. Then $P$ is strongly normalizing and we conclude by Lemma~\ref{lem:deadlock_freedom}. \end{proof} \subsection{Properties of well-typed processes} \label{sec:properties} In this section we state the main properties enjoyed by well-typed processes. As usual, subject reduction is instrumental for all of the results that follow as it guarantees that typing is preserved by reductions: \begin{theorem} \label{thm:sr} If $\Gamma$ is reliable and $\wtp\ContextP\varphi$ and $P \rightarrow Q$, then $\wtp\ContextQ\varphi$. \end{theorem} Interestingly, Theorem~\ref{thm:sr} seems to imply that the types of the mailboxes used by a process do not change. In sharp contrast, other popular behavioral typing disciplines (session types in particular), are characterized by a subject reduction result in which types reduce along with processes. Theorem~\ref{thm:sr} also seems to contradict the observations made earlier concerning the fact that the mailboxes used by a process may have different types (Example~\ref{ex:lock_type}). The type preservation guarantee assured by Theorem~\ref{thm:sr} can be explained by recalling that the type environment $\Gamma$ in a judgment $\wtp\ContextP\varphi$ already takes into account the overall balance between the messages stored into and consumed from the mailbox used by $P$ (see Definition~\ref{def:cmul}). In light of this observation, Theorem~\ref{thm:sr} simply asserts that well-typed processes are steady state: they never produce more messages than those that are consumed, nor do they ever try to consume more messages than those that are produced. A practically relevant consequence of Theorem~\ref{thm:sr} is that, by looking at the type $\ttqmarkE$ of the mailbox $a$ used by a guarded process $P$ (rule~\refrule{t-guard}), it is possible to determine \emph{bounds} to the number of messages that can be found in the mailbox as $P$ waits for a message to receive. In particular, if every configuration of $E$ contains at most $k$ atoms with tag $\Tag$, then at runtime $a$ contains at most $\Tag$-tagged messages. As a special case, a mailbox of type $\ttqmark\mathbb{1}$ is guaranteed to be empty and can be statically deallocated. Note that the bounds may change after $P$ receives a message. For example, a free lock is guaranteed to have no $\Tag[release]$ messages in its mailbox, and will have at most one when it is busy (see Example~\ref{ex:lock_derivation}). The main result concerns the soundness of the type system, guaranteeing that well-typed (closed) processes are both mailbox conformant and deadlock free: \begin{theorem} \label{thm:soundness} If $\wtp\EmptyContextP\varphi$, then $P$ is mailbox conformant and deadlock free. \end{theorem} Fair termination and junk freedom are not guaranteed by our typing discipline in general. The usual counterexamples include processes that postpone indefinitely the use of a mailbox with a relevant type. For instance, the $\Tag$ message in the well-typed process $\Newa\parens{ \Senda\Tag{} \mathbin\ttbar \invoke\RecVara }$ where $\define\RecVar\Var{\invoke\RecVar\Var}$ is never consumed because $a$ is never used for an input operation. Nevertheless, fair termination is guaranteed for the class of finitely unfolding processes: \begin{theorem} \label{thm:fair_termination} We say that $P$ is \emph{finitely unfolding} if all maximal reductions of $P$ use \refrule{r-def} finitely many times. If $\wtp\EmptyContextP\varphi$ and $P$ is finitely unfolding, then $P$ is fairly terminating. \end{theorem} The class of finitely unfolding processes obviously includes all finite processes (those not using process invocations) but also many recursive processes. For example, every process of the form $\Newa\parens{ \Senda\Tag{} \mathbin\ttbar \cdots \mathbin\ttbar \Senda\Tag{} \mathbin\ttbar \invoke\RecVara }$ where $\RecVar(\Var) \triangleq \Receive\Var\Tag{}\invoke\RecVar\Var + \Free\Var\mkkeyword{done}$ is closed, well typed and finitely unfolding regardless of the number of $\Tag$ messages stored in $a$, hence is fairly terminating and junk free by Theorem~\ref{thm:fair_termination}. \subsection{Properties of dependency graphs} \label{sec:prop_graphs} \begin{proposition}[structure preserving transitions] The following properties hold: \begin{enumerate} \item If $\varphi_1 \sqcup \varphi_2 \greduv \varphi$, then $\varphi = \varphi_1' \sqcup \varphi_2'$ for some $\varphi_1'$ and $\varphi_2'$. \item If $\Newa\varphi \greduv \psi$, then $\psi = \Newa\varphi'$ for some $\varphi'$. \end{enumerate} \end{proposition} \begin{proof} A straightforward induction on the derivation of the transition. \end{proof} Because of the previous result, in the proofs that follow we only consider transitions where the structure of the dependency graph is preserved. \begin{proposition} \label{prop:gred_left} If $\varphi_1 \sqcup \varphi_2 \greduv \varphi_1' \sqcup \varphi_2'$, then $(\psi \sqcup \varphi_1) \sqcup \varphi_2 \greduv (\psi \sqcup \varphi_1') \sqcup \varphi_2'$. \end{proposition} \begin{proof} By induction on the derivation of $\varphi_1 \sqcup \varphi_2 \greduv \varphi_1' \sqcup \varphi_2'$ and by cases on the last rule applied. We omit the discussion of \refrule{g-right}, which is symmetric to \refrule{g-left}. \proofrule{g-left} % Then $\varphi_1 \greduv \varphi_1'$ and $\varphi_2 = \varphi_2'$. % We conclude by applying \refrule{g-right}, then \refrule{g-left}. \proofrule{g-trans} % Then $\varphi_1 \sqcup \varphi_2 \greduw \varphi_1'' \sqcup \varphi_2'' \gred\NameWv \varphi_1' \sqcup \varphi_2'$. % Using the induction hypothesis we derive $(\psi \sqcup \varphi_1) \sqcup \varphi_2 \greduw (\psi \sqcup \varphi_1'') \sqcup \varphi_2'' \gred\NameWv (\psi \sqcup \varphi_1') \sqcup \varphi_2'$ and we conclude with one application of \refrule{g-trans}. \end{proof} \begin{proposition} \label{prop:gred_gunion} If $\varphi_1 \sqcup (\varphi_2 \sqcup \varphi_3) \greduv \varphi_1' \sqcup (\varphi_2' \sqcup \varphi_3')$, then $(\varphi_1 \sqcup \varphi_2) \sqcup \varphi_3 \greduv (\varphi_1' \sqcup \varphi_2') \sqcup \varphi_3'$. \end{proposition} \begin{proof} By induction on the derivation of $\varphi_1 \sqcup (\varphi_2 \sqcup \varphi_3) \greduv \varphi_1' \sqcup (\varphi_2' \sqcup \varphi_3')$ and by cases on the last rule applied. \proofrule{g-left} % Then $\varphi_1 \greduv \varphi_1'$ and $\varphi_2 = \varphi_2'$ and $\varphi_3 = \varphi_3'$. % We conclude with two applications of \refrule{g-left}. \proofrule{g-right} % Then $\varphi_1 = \varphi_1'$ and $\varphi_2 \sqcup \varphi_3 \greduv \varphi_2' \sqcup \varphi_3'$. % We conclude by Proposition~\ref{prop:gred_left}. \proofrule{g-trans} % Then $\varphi_1 \sqcup (\varphi_2 \sqcup \varphi_3) \greduw \varphi_1'' \sqcup (\varphi_2'' \sqcup \varphi_3'') \gred\NameWv \varphi_1' \sqcup (\varphi_2' \sqcup \varphi_3')$. % Using the induction hypothesis we deduce $(\varphi_1 \sqcup \varphi_2) \sqcup \varphi_3 \greduw (\varphi_1'' \sqcup \varphi_2'') \sqcup \varphi_3'' \gred\NameWv (\varphi_1' \sqcup \varphi_2') \sqcup \varphi_3'$. % We conclude with one application of \refrule{g-trans}. \end{proof} \begin{proposition} \label{prop:gred_new} If $\Newa\varphi_1 \sqcup \varphi_2 \greduv \Newa\varphi_1' \sqcup \varphi_2'$ and $a\not\in\mathsf{fn}(\varphi_2)$, then $\Newa(\varphi_1 \sqcup \varphi_2) \greduv \Newa(\varphi_1' \sqcup \varphi_2')$. \end{proposition} \begin{proof} By induction on the derivation of $\Newa\varphi_1 \sqcup \varphi_2 \greduv \Newa\varphi_1' \sqcup \varphi_2'$ and by cases on the last rule applied. We do not discuss rule \refrule{g-right}, which is straightforward. \proofrule{g-left} % Then $\Newa\varphi_1 \greduv \Newa\varphi_1'$ and $\varphi_2 = \varphi_2'$. % From \refrule{g-new} we deduce $\varphi_1 \greduv \varphi_1'$ and $a\neu,v$. % We conclude with one application of \refrule{g-left} and one application of \refrule{g-new}. \proofrule{g-trans} % Then $\Newa\varphi_1 \sqcup \varphi_2 \greduw \Newa\varphi_1'' \sqcup \varphi_2'' \gred\NameWv \Newa\varphi_1' \sqcup \varphi_2'$. % From the induction hypothesis we deduce $\Newa(\varphi_1 \sqcup \varphi_2) \greduw \Newa(\varphi_1'' \sqcup \varphi_2'') \gred\NameWv \Newa(\varphi_1' \sqcup \varphi_2')$. % We conclude with one application of \refrule{g-trans}. \end{proof} \begin{proposition} \label{prop:grel} The following properties hold: \begin{enumerate} \item\label{item:grel_empty} $\grel{\emptyset \sqcup \varphi} = \grel\varphi$ \item\label{item:grel_comm} $\grel{\varphi_1 \sqcup \varphi_2} = \grel{\varphi_2 \sqcup \varphi_1}$ \item\label{item:grel_assoc} $\grel{\varphi_1 \sqcup (\varphi_2 \sqcup \varphi_3)} = \grel{(\varphi_1 \sqcup \varphi_2) \sqcup \varphi_3}$ \item\label{item:grel_new} If $a\not\in\mathsf{fn}(\varphi_2)$, then $\grel{\Newa\varphi_1 \sqcup \varphi_2} = \grel{\Newa(\varphi_1 \sqcup \varphi_2)}$. \end{enumerate} \end{proposition} \begin{proof} Items~\ref{item:grel_empty} and~\ref{item:grel_comm} are trivial. Items~\ref{item:grel_assoc} and~\ref{item:grel_new} respectively follow from Proposition~\ref{prop:gred_gunion} and Proposition~\ref{prop:gred_new}. \end{proof} \subsection{Properties of subtyping} \label{sec:prop_subtyping} \begin{proposition} \label{prop:subt_reliable_usable} If $\tau \leqslant \sigma$, then $\tau$ reliable implies $\sigma$ reliable and $\sigma$ usable implies $\tau$ usable. \end{proposition} \begin{proof} We only prove the part of the statement concerning reliability, since usability is analogous, and we prove the reverse implication. % The interesting case is when $\tau = \ttqmarkE$. From the hypothesis $\tau \leqslant \sigma$ we deduce $\sigma = \ttqmarkF$ and $E \subp F$. % Now if $F \subp \mathbb{0}$ we have $E \subp F \subp \mathbb{0}$ by transitivity of $\subp$. Hence, $\sigma$ unreliable implies $\tau$ unreliable. \end{proof} \begin{proposition} \label{prop:subt_der_subt} If $\tmessage\Tag\seqof\TypeT \cdot F \subp E$ and $F \not\subp \mathbb{0}$ and $\pderE{\tmessage\Tag\seqof\TypeS}$ is defined, then $\seqof\TypeT \leqslant \seqof\TypeS$ and $F \subp \pderE{\tmessage\Tag\seqof\TypeS}$. \end{proposition} \begin{proof} Let $\mathsf{A} \in \sem{\tmessage\Tag\seqof\TypeT \cdot F}$. % From the hypothesis $F \not\subp \mathbb{0}$ we deduce that $\mathsf{A} = \bag{\tmessage\Tag\seqof\TypeT} \uplus \bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeT_i}}$ where $\bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeT_i}} \in \semF$. % From the hypothesis $\tmessage\Tag\seqof\TypeT \cdot F \subp E$ and the definition of $\subp$ we deduce that there exist $\seqof\TypeR$ and $\seqof\TypeR_i$ such that $\bag{\tmessage\Tag\seqof\TypeR} \uplus \bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeR_i}} \in \semE$ and $\seqof\TypeT \leqslant \seqof\TypeR$ and $\seqof\TypeT_i \leqslant \seqof\TypeR_i$ for every $i\in I$. % From the hypothesis that $\pderE{\tmessage\Tag\seqof\TypeS}$ is defined we deduce that $\seqof\TypeR \leqslant \seqof\TypeS$, hence $\seqof\TypeT \leqslant \seqof\TypeS$. % Also, from the definition of derivative, we have $\bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeR_i}} \in \sem{\pderE{\tmessage\Tag\seqof\TypeS}}$. % We conclude $F \subp \pderE{\tmessage\Tag\seqof\TypeS}$. \end{proof} We extend the terminology used for type classification (Definition~\ref{def:classification}) to type environments as well. We say that $\Gamma$ is reliable/irrelevant if all the types in its range are reliable/irrelevant. \begin{example} \label{ex:global_assumptions} The global assumptions we made on types are aimed at ensuring that in a judgment $\wtp{u : \tau, \Gamma}P{}$ where $\tau$ is relevant and $\Gamma$ is reliable the name $u$ does indeed occur free in $P$. % If we allowed unreliable arguments, then it would be possible to derive \[ \wtp{ u : \tau, v : \ttqmark\tmessage\Tag{\ttqmark\mathbb{0}} }{ \Receivev\Tag\Var \Fail\Var }{ \emptyset } \] meaning that $u$ is not guaranteed to occur even if $\tau$ is relevant. % Analogously, if we allowed unusable arguments, then it would be possible to derive \[ \wtp{ u : \tau, v : \ttemark\tmessage\Tag{\ttemark\mathbb{0}} }{ \Newa\parens{ \Sendv\Taga \mathbin\ttbar \Faila } }{ \Newa\gedge\NameVa } \] again meaning that $u$ is not guaranteed to occur even if $\tau$ is relevant. % \hfill$\blacksquare$ \end{example} \subsection{Properties of type environments} \label{sec:prop_type_environments} \begin{proposition} \label{prop:env_subt_reliable} If $\Gamma \leqslant \Delta$, then $\Gamma$ reliable implies $\Delta$ reliable and $\Delta$ usable implies $\Gamma$ usable. \end{proposition} \begin{proof} Immediate from Proposition~\ref{prop:subt_reliable_usable}. \end{proof} \begin{proposition} \label{prop:cmul_subt} If both $\Gamma_1 \mathbin{\|} \Gamma_2$ and $\Delta_1, \Delta_2$ are defined and $\Gamma_i \leqslant \Delta_i$, then $\Gamma_1 \mathbin{\|} \Gamma_2 \leqslant \Delta_1, \Delta_2$. \end{proposition} \begin{proof} We discuss a few notable cases when $u \in (\mathsf{dom}(\Gamma_1) \cap \mathsf{dom}(\Gamma_2) \cap \mathsf{dom}(\Delta_1)) \setminus \mathsf{dom}(\Delta_1)$. \proofcase{$\Gamma_1(u) = \ttemarkE$ and $\Gamma_2(u) = \ttemarkF$ and $\Delta_1(u) = \ttemarkG$} % Then $\ttemarkE \leqslant \ttemarkG$ and $\ttemarkF \leqslant \ttemark\mathbb{1}$, which means $G \subp E$ and $\mathbb{1} \subp F$. % From the properties of $\subp$ we deduce $G \subp G \cdot \mathbb{1} \subp E \cdot F$. % We conclude $(\Gamma_1 \mathbin{\|} \Gamma_2)(u) = \ttemark\parens{E \cdot F} \leqslant \ttemarkG = (\Delta_1, \Delta_2)(u)$. \proofcase{$\Gamma_1(u) = \ttemarkE$ and $\Gamma_2(u) = \ttqmark\parens{E \cdot F}$ and $\Delta_1(u) = \ttemarkG$} % Then $\ttemarkE \leqslant \ttemarkG$ and $\ttqmark\parens{E \cdot F} \leqslant \ttemark\mathbb{1}$, which means $G \subp E$ and $E \cdot F \cdot \mathbb{1} \subp E \cdot F \subp \mathbb{1}$. % From the properties of $\subp$ we deduce $G \subp E \subp \mathbb{1}$ and $F \subp \mathbb{1}$. % We conclude $\parens{\Gamma_1 \mathbin{\|} \Gamma_2}(u) = \ttqmarkF \leqslant \ttemarkG = (\Delta_1, \Delta_2)(u)$. \proofcase{$\Gamma_1(u) = \ttqmark\parens{E \cdot F}$ and $\Gamma_2(u) = \ttemarkE$ and $\Delta_1(u) = \ttqmarkG$} % Then $\ttqmark\parens{E \cdot F} \leqslant \ttqmarkG$ and $\ttemarkE \leqslant \ttemark\mathbb{1}$, which means $E \cdot F \subp G$ and $\mathbb{1} \subp E$. % From the properties of $\subp$ we deduce $F \subp \mathbb{1} \cdot F \subp E \cdot F \subp G$. % We conclude $\parens{\Gamma_1 \mathbin{\|} \Gamma_2}(u) = \ttqmarkF \leqslant \ttqmarkG = (\Delta_1, \Delta_2)(u)$. \proofcase{$\Gamma_1(u) = \ttqmark\parens{E \cdot F}$ and $\Gamma_2(u) = \ttemarkE$ and $\Delta_1(u) = \ttemarkG$} % Then $\ttqmark(E \cdot F) \leqslant \ttemarkG$ and $\ttemarkE \leqslant \ttemark\mathbb{1}$, which means $E \cdot F \cdot G \subp \mathbb{1}$ and $\mathbb{1} \subp E$. % From the properties of $\subp$ we deduce $F \cdot G \subp \mathbb{1}$. % We conclude $\parens{\Gamma_1 \mathbin{\|} \Gamma_2}(u) = \ttqmarkF \leqslant \ttemarkG = (\Delta_1, \Delta_2)(u)$. \end{proof} \begin{proposition} \label{prop:env_mul_reliable} If $\Gamma$ is usable and $\Gamma \mathbin{\|} \Delta$ is reliable, then $\Delta$ is reliable. \end{proposition} \begin{proof} We discuss only the interesting case when $\Gamma(u) = \ttemarkE$ and $\Delta(u) = \ttqmark(E \cdot F)$, the others being symmetric or simpler. % Then $(\Gamma \mathbin{\|} \Delta)(u) = \ttqmarkF$. % From the hypothesis that $\Gamma$ is usable we deduce $\ttemark\mathbb{0} \not\leqslant \ttemarkE$, that is $E \not\subp \mathbb{0}$. % From the hypothesis that $\Gamma \mathbin{\|} \Delta$ is reliable we deduce $\ttqmarkF \not\leqslant \ttqmark\mathbb{0}$, that is $F \not\subp \mathbb{0}$. % We conclude $E \cdot F \not\subp \mathbb{0}$. \end{proof} \section{Related Work} \label{sec:related} \subparagraph*{Concurrent Objects.} There are analogies between actors and concurrent objects. Both entities are equipped with a unique identifier through which they receive messages, they may interact with several concurrent clients and their behavior may vary over time, as the entity interacts with its clients. Therefore, static analysis techniques developed for concurrent objects may be applicable to actors (and vice versa). Relevant works exploring behavioral type systems for concurrent objects include those of Najim \emph{et al.}\xspace~\cite{NajmNimourStefani99}, Ravara and Vasconcelos~\cite{RavaraVasconcelos00}, and Puntigam \emph{et al.}\xspace~\cite{Puntigam01,PuntigamPeter01}. As in the pure actor model, each object has a unique mailbox and the input capability on that mailbox cannot be transferred. The mailbox calculus does not have these constraints. A notable variation is the model studied by Ravara and Vasconcelos~\cite{RavaraVasconcelos00}, which accounts for \emph{distributed objects}: there can be several copies of an object that react to messages targeted to the same mailbox. Another common trait of these works is that the type discipline focuses on sequences of method invocations and types contain (abstract) information on the internal state of objects and on state transitions. Indeed, types are either finite-state automata~\cite{NajmNimourStefani99}, or terms of a process algebra~\cite{RavaraVasconcelos00} or tokens annotated with state transitions~\cite{PuntigamPeter01}. In contrast, mailbox types focus on the content of a mailbox and sequencing is expressed in the type of explicit continuations. The properties enforced by the type systems in these works differ significantly. Some do not consider deadlock freedom~\cite{RavaraVasconcelos00,Puntigam01}, others do not account for out-of-order message processing~\cite{Puntigam01}. Details on the enforced properties also vary. For example, the notion of protocol conformance used by Ravara and Vasconcelos~\cite{RavaraVasconcelos00} is such that any message sent to an object that is unable to handle that message, but can do so in some future state is accepted. In our setting, this would mean allowing to send a $\Tag[release]$ message to a free lock if the lock is acquired later on, or allowing to send a $\Tag[reply]$ message to an account if the account will later be involved in a transaction. The most closely related work among those addressing concurrent objects is the one by Crafa and Padovani~\cite{CrafaPadovani17}, who propose the use of the Objective Join Calculus as a model for non-uniform, concurrent objects and develop a type discipline that can be used for enforcing concurrent object protocols. Mailbox types have been directly inspired by their types of concurrent objects. There are two main differences between the work of Crafa and Padovani~\cite{CrafaPadovani17} and our own. First, in the Objective Join Calculus every object is associated with a single mailbox, just like in the pure actor model~\cite{HewittEtAl73,Agha86}, meaning that mailboxes are not first class. As a consequence, the types considered by Crafa and Padovani~\cite{CrafaPadovani17} all have an (implicit) output capability. Second, in the Objective Join Calculus input operations are defined atomically on molecules of messages, whereas in the mailbox calculus messages are received one at a time. As a consequence, the type of a mailbox in the work of Crafa and Padovani~\cite{CrafaPadovani17} is invariant, whereas the same mailbox may have different types at different times in the mailbox calculus (Example~\ref{ex:lock_type}). Remarkably, this substantial difference has no impact on the structure of the type language that we consider. \subparagraph*{Static analysis of actors.} Srinivasan and Mycroft~\cite{SrinivasanMycroft08} define a type discipline for controlling the ownership of messages and ensuring actor isolation, but consider only uniformly typed mailboxes and do not address mailbox conformance or deadlock freedom. Christakis and Sagonas~\cite{ChristakisSagonas11} describe a static analysis technique whose aim is to ensure matching between send and receive operations in actors. The technique, which is described only informally and does not account for deadlocks, has been implemented in a tool called \textsf{dialyzer} and used for the analysis of Erlang programs. Crafa~\cite{Crafa12} defines a behavioural type system for actors aimed at ensuring that the order of messages produced and consumed by an actor follows a prescribed protocol. Protocols are expressed as types and describe the behavior of actors rather than the content of the mailboxes they use. Deadlock freedom is not addressed. Charousset \emph{et al.}\xspace~\cite{CharoussetHiesgenSchmidt16} describe the design and implementation of CAF, the C++ Actor Framework. Among the features of CAF is the use of \emph{type-safe message passing interfaces} that makes it possible to statically detect a number of protocol violations by piggybacking on the C++ type system. There are close analogies between CAF's message passing interfaces and mailbox types with output capability: both are equipped with a subset semantics and report only those messages that can be stored into the mailbox through a mailbox reference with that type. Charousset \emph{et al.}\xspace~\cite{CharoussetHiesgenSchmidt16} point out that this feature fosters the decoupling of actors and enables incremental program recompilation. Giachino \emph{et al.}\xspace~\cite{GiachinoEtAl16,Mastandrea16} define a type system for the deadlock analysis of actors making use of implicit futures. Mailbox conformance and deadlocks due to communications are not taken into account. Fowler \emph{et al.}\xspace~\cite{FowlerLindleyWadler17} formalize channel-based and mailbox-based communicating systems, highlighting the differences between the two models and studying type-preserving encodings between them. Mailboxes in their work are uniformly typed, but the availability of union types make it possible to host heterogeneous values within the same mailbox. This however may lead to a loss of precision in typing. This phenomenon, dubbed \emph{type pollution} by Fowler \emph{et al.}\xspace~\cite{FowlerLindleyWadler17}, is observable to some extent also in our typing discipline and can be mitigated by the use of multiple mailboxes (\emph{cf.}\xspace Section~\ref{sec:example_master_workers}). Finally, Fowler \emph{et al.}\xspace~\cite{FowlerLindleyWadler17} leave the extension of their investigation to behaviorally-typed language of actors as future work. Our typing discipline is a potential candidate for this investigation and addresses a more general setting thanks to the support for first-class mailboxes. \subparagraph*{Sessions and actors.} The encoding of binary sessions into actors discussed in Section~\ref{sec:example_binary_sessions} is new and has been inspired by the encoding of binary sessions into the linear $\pi$-calculus~\cite{Kobayashi07,DardhaGiachinoSangiorgi17}, whereby each message is paired with a continuation. In our case, the continuation, instead of being a fresh (linear) channel, is either the mailbox of the peer or that of the session. This style of communication with explicit continuation passing is idiomatic in the actor model, which is based on asynchronous communications. The encoding discussed in Section~\ref{sec:example_binary_sessions} can be generalized to multiparty sessions by defining $\SessionProcessT$ as a \emph{medium process} through which messages are exchanged between the parties of the session. This idea has been put forward by Caires and P\'erez~\cite{CairesPerez16} to encode multiparty sessions using binary sessions. Mostrous and Vasconcelos~\cite{MostrousVasconcelos11} study a session type system for enforcing ordered dyadic interactions in core Erlang. They use \emph{references} for distinguishing messages pertaining to different sessions, making use of the advanced pattern matching capabilities of Erlang. Their type system guarantees a weaker form of mailbox conformance, whereby junk messages may be present at the end of a computation, and does not consider deadlock freedom. Compared to our encoding of binary sessions, their approach does not require a medium process representing the session itself. Neykova and Yoshida~\cite{NeykovaYoshida16} propose a framework based on multiparty session types for the specification and implementation of actor systems with guarantees on the order of interactions. This approach is applicable when designing an entire system and both the network topology and the communication protocol can be established in advance. Fowler~\cite{Fowler16} builds upon the work of Neykova and Yoshida to obtain a runtime protocol monitoring mechanism for Erlang. Charalambides \emph{et al.}\xspace~\cite{CharalambidesDingesAgha16} extend the multiparty session approach with a protocol specification language that is parametric in the number of actors participating in the system. In contrast to these approaches based on multiparty/global session types, our approach ensures mailbox conformance and deadlock freedom of a system compositionally, as the system is assembled out of smaller components, and permits the modeling of systems with a dynamic network topology or with a varying number of interacting processes. \subparagraph*{Linear logic.} Shortly after its introduction, linear logic has been proposed as a specification language suitable for concurrency. Following this idea, Kobayashi and Yonezawa~\cite{KobayashiYonezawa94,KobayashiYonezawa95} have studied formal models of concurrent objects and actors based on linear logic. More recently, a direct correspondence between propositions of linear logic and session types has been discovered~\cite{CairesPfenning10,Wadler14,LindleyMorris15}. There are several analogies between the mailbox type system and the proof system of linear logic. Mailbox types with output capability are akin to positive propositions, with $\ttemark\mathbb{0}$ and $\ttemark\mathbb{1}$ respectively playing the roles of $0$ and $1$ in linear logic and $\ttemark(E + F)$ and $\ttemark(E \cdot F)$ corresponding to $\oplus$ and $\otimes$. Mailbox types with input capability are akin to negative propositions, with $\ttqmark\mathbb{0}$ and $\ttqmark\mathbb{1}$ corresponding to $\top$ and $\bot$ and $\ttqmark(E + F)$ and $\ttqmark(E \cdot F)$ corresponding to $\with$ and $\parr$. Rules~\refrule{t-fail}, \refrule{t-free} and \refrule{t-branch} have been directly inspired from the rules for $\top$, $\bot$ and $\with$ in the classical sequent calculus for linear logic. Subtyping corresponds to inverse linear implication and its properties are consistent with those of the logic connectives according to the above interpretation. A noteworthy difference between our type system and those for session types based on linear logic~\cite{CairesPfenning10,Wadler14,LindleyMorris15} is the need for dependency graphs to ensure deadlock freedom (Section~\ref{sec:graphs}). There are two reasons that call for such auxiliary mechanism in our setting. First, the rule \refrule{t-par} is akin to a symmetric cut rule. Dependency graphs are necessary to detect mutual dependencies that may consequently arise (Example~\ref{ex:future_deadlock}). Second, unlike session endpoints that are linear resources, mailbox references can be used non-linearly. Thus, the multiplicity of dependencies, and not just the presence or absence thereof, is relevant (Example~\ref{ex:multiplicity}). \subsection{Typing Rules} \label{sec:rules} \begin{table} \begin{center} \[ \begin{array}{@{}c@{}} \multicolumn{1}{@{}l@{}}{\textbf{Typing rules for processes}\hfill\framebox{$\wtp\ContextP{\smash\varphi}$}} \\\\ \inferrule{ }{ \wtp\emptyset\mkkeyword{done}\emptyset } ~~\defrule{t-done} \qquad \inferrule{ \RecVar : (\seqof\VarX : \seqof\Type; \varphi) }{ \wtp{ \seqof\NameU : \seqof\Type }{ \invoke\RecVar\seqof\NameU }{ \varphi\subst\seqof\NameU\seqof\VarX } } ~~\defrule{t-def} \qquad \inferrule{ \wtp{\Gamma, a : \ttqmark\mathbb{1}}P\varphi }{ \wtp\Gamma{\NewaP}{\Newa\varphi} } ~~\defrule{t-new} \\\\ \inferrule{ }{ \wtp{ u : \ttemark{\tmessage\Tag\seqof\TypeT}, \seqof\NameV : \seqof\TypeT }{ \Sendu\Tag\seqof\NameV }{ \gedgeu{\set\seqof\NameV} } } ~~\defrule{t-msg} \qquad \inferrule{ \wtg{ u : \ttqmarkE, \Gamma }{ G } \\ \vDash E }{ \textstyle \wtp{ u : \ttqmarkE, \Gamma }{ G }{ \gedgeu{\mathsf{dom}(\Gamma)} } } ~~\defrule{t-guard} \\\\ \inferrule{ \wtp{\Gamma_i}{P_i}{\varphi_i}~{}^{(i=1,2)} }{ \wtp{ \Gamma_1 \mathbin{\|} \Gamma_2 }{ P_1 \mathbin\ttbar P_2 }{ \varphi_1 \sqcup \varphi_2 } } ~~\defrule{t-par} \qquad \inferrule{ \wtp\ContextBP\psi \\ \Gamma \leqslant \Delta \\ \varphi \Rightarrow \psi }{ \wtp\ContextAP\varphi } ~~\defrule{t-sub} \\\\ \multicolumn{1}{@{}l@{}}{\textbf{Typing rules for guards}\hfill\framebox{$\wtg\ContextG$}} \\\\ \inferrule{ }{ \wtg{ u : \ttqmark\mathbb{0}, \Gamma }{ \Failu } } ~~\defrule{t-fail} \qquad \inferrule{ \wtp\ContextP\varphi }{ \wtg{ u : \ttqmark\mathbb{1}, \Gamma }{ \FreeuP } } ~~\defrule{t-free} \\\\ \inferrule{ \wtp{ u : \ttqmarkE, \Gamma, \seqof\VarX : \seqof\Type }{ P }{ \varphi } }{ \wtg{ u : \ttqmark(\tmessage\Tag\seqof\Type\tmulE), \Gamma }{ \Receiveu\Tag\seqof\VarXP } } ~~\defrule{t-in} \qquad \inferrule{ \wtg{ u : \ttqmarkE_i, \Gamma }{ G_i } ~{}^{(i=1,2)} }{ \wtg{ u : \ttqmark(E_1 + E_2), \Gamma }{ G_1 + G_2 } } ~~\defrule{t-branch} \end{array} \] \end{center} \caption{ \label{tab:inference} Typing rules. } \end{table} We use \emph{type environments} for tracking the type of free names occurring in processes. A type environment is a partial function from names to types written as $\seqof\NameU : \seqof\Type$ or $u_1 : \tau_1, \dots, u_n : \tau_n$. We let $\Gamma$ and $\Delta$ range over type environments, we write $\mathsf{dom}(\Gamma)$ for the domain of $\Gamma$ and $\Gamma, \Delta$ for the union of $\Gamma$ and $\Delta$ when $\mathsf{dom}(\Gamma) \cap \mathsf{dom}(\Delta) = \emptyset$. We say that $\Gamma$ is reliable if so are all the types in its range. Judgments for processes have the form $\wtp\ContextP\varphi$, meaning that $P$ is well typed in $\Gamma$ and yields the dependency graph $\varphi$. Judgments for guards have the form $\wtg\ContextG$, meaning that $G$ is well typed in $\Gamma$. We say that a judgment $\wtp\ContextP\varphi$ is well formed if $\mathsf{fn}(\varphi) \subseteq \mathsf{dom}(\Gamma)$\Luca{Se si toglie l'entailment da \refrule{t-sub} questa condizione non serve pi\`u e si semplificano le regole e la descrizione. Considerare questa modifica dopo aver ricontrollato le prove.} and $\varphi$ is acyclic. Each process typing rule has an implicit side condition requiring that its conclusion is well formed. For each global process definition $\define\RecVar\seqof\VarXP$ we assume that there is a corresponding \emph{global process declaration} of the form $\RecVar : (\seqof\VarX : \seqof\Type; \varphi)$. We say that the definition is \emph{consistent} with the corresponding declaration if $\wtp{\seqof\VarX : \seqof\Type}P\varphi$. Hereafter, all process definitions are assumed to be consistent. We now discuss the typing rules in detail, introducing auxiliary notions and notation as we go along. \DiscussRule{Terminated process} According to the rule \refrule{t-done}, the terminated process $\mkkeyword{done}$ is well typed in the empty type environment and yields no dependencies. This is motivated by the fact that $\mkkeyword{done}$ does not use any mailbox. Later on we will introduce a subsumption rule \refrule{t-sub} that allows us to type $\mkkeyword{done}$ in any type environment with irrelevant names.\Ugo{irrelevant types?}\Luca{\`E indifferente per la terminologia introdotta nella Definizione~\ref{def:classification}} \DiscussRule{Message} Rule \refrule{t-msg} establishes that a message $\Sendu\Tag\seqof\NameV$ is well typed provided that the mailbox $u$ allows the storing of an $\Tag$-tagged message with arguments of type $\seqof\Type$ and the types of $\seqof\NameV$ are indeed $\seqof\Type$. The subsumption rule \refrule{t-sub} will make it possible to use arguments whose type is a \emph{subtype} of the expected ones. A message $\Sendu\Tag\seqof\NameV$ establishes dependencies between the target mailbox $u$ and all of the arguments $\seqof\NameV$. We write $\gedgeu{\set{v_1,\dots,v_n}}$ for the dependency graph $\gedgeu{v_1}\sqcup \cdots \sqcup \gedgeu{v_n}$ and use $\emptyset$ for the empty graph union. \DiscussRule{Process invocation} The typing rule for a process invocation $\invoke\RecVar\seqof\NameU$ checks that there exists a global definition for $\RecVar$ which expects exactly the given number and type of parameters. Again, rule~\refrule{t-sub} will make it possible to use parameters whose types are subtypes of the expected ones. A process invocation yields the same dependencies as the corresponding process definition, with the appropriate substitutions applied. \DiscussRule{Guards} Guards are used to match the content of a mailbox and possibly retrieve messages from it. According to rule~\refrule{t-fail}, the action $\Failu$ matches a mailbox $u$ with type $\ttqmark\mathbb{0}$, indicating that an unexpected message has been found in the mailbox. The type environment may contain arbitrary associations, since the $\Failu$ action causes a runtime error. Rule~\refrule{t-free} states that the action $\FreeuP$ matches a mailbox $u$ with type $\ttqmark\mathbb{1}$, indicating that the mailbox is empty. The continuation is well typed in the residual type environment $\Gamma$. An input action $\Receiveu\Tag\seqof\VarXP$ matches a mailbox $u$ with type $\ttqmark(\tmessage\Tag\seqof\Type \cdot E)$ that guarantees the presence of an $\Tag$-tagged message possibly along with other messages as specified by $E$. The continuation $P$ must be well typed in an environment where the mailbox has type $\ttqmarkE$, which describes the content of the mailbox after the $\Tag$-tagged message has been removed. Associations for the received arguments $\seqof\VarX$ are also added to the type environment. A compound guard $G_1 + G_2$ offers the actions offered by $G_1$ and $G_2$ and therefore matches a mailbox $u$ with type $\ttqmark(E_1 + E_2)$, where $E_i$ is the pattern that describes the mailbox matched by $G_i$. Note that the residual type environment $\Gamma$ is the same in both branches, indicating that the type of other mailboxes used by the guard cannot depend on that of $u$. The judgments for guards do not yield any dependency graph. This is compensated by the rule~\refrule{t-guard}, which we describe next. \DiscussRule{Guarded processes} Rule~\refrule{t-guard} is used to type a guarded process $G$, which matches some mailbox $u$ of type $\ttqmarkE$ and possibly retrieves messages from it. As we have seen while discussing guards, $E$ is supposed to be a pattern of the form $E_1 + \cdots + E_n$ where each $E_i$ is either $\mathbb{0}$, $\mathbb{1}$ or of the form $\mathtt{M} \cdot F$. However, only the patterns $E$ that are in \emph{normal form} are suitable to be used in this typing rule and the side condition $\df{}E$ checks that this is indeed the case. We motivate the need of a normal form by means of a simple example. Suppose that our aim is to type a process $\Receiveu\Tag[A]{}P + \Receiveu\Tag[B]{}Q$ that consumes either an $\Tag[A]$ message or a $\Tag[B]$ message from $u$, whichever of these two messages is matched first in $u$, and then continues as $P$ or $Q$ correspondingly. Suppose also that the type of $u$ is $\ttqmarkE$ with $E \stackrel{\text{\tiny def}}= \Tag[A]\cdot\Tag[C] + \Tag[B]\cdot\Tag[A]$, which allows the rules for guards to successfully type check the process. As we have seen while discussing rule~\refrule{t-in}, $P$ and $Q$ must be typed in an environment where the type of $u$ has been updated so as to reflect the fact that the consumed message is no longer in the mailbox. In this particular case, we might be tempted to infer that the type of $u$ in $P$ is $\ttqmark\Tag[C]$ and that the type of $u$ in $Q$ is $\ttqmark\Tag[A]$. Unfortunately, the type $\ttqmark\Tag[C]$ does not accurately describe the content of the mailbox after $\Tag[A]$ has been consumed because, according to $E$, the $\Tag[A]$ message may be accompanied by \emph{either} a $\Tag[B]$ message \emph{or} by a $\Tag[C]$ message, whereas $\ttqmark\Tag[C]$ only accounts for the second possibility. Thus, the appropriate pattern to be used for typing this process is $\Tag[A] \cdot (\Tag[B] + \Tag[C]) + \Tag[B] \cdot \Tag[A]$, where the fact that $\Tag[B]$ may be found after consuming $\Tag[A]$ is made explicit. This pattern and $E$ are equivalent as they generate exactly the same set of valid configurations. Yet, $\Tag[A] \cdot (\Tag[B] + \Tag[C]) + \Tag[B] \cdot \Tag[A]$ is in normal form whereas $E$ is not. In general the normal form is not unique. For example, also the patterns $\Tag[B] \cdot \Tag[A] + \Tag[C] \cdot \Tag[A]$ and $\Tag[A] \cdot (\Tag[B] + \Tag[C])$ are in normal form and equivalent to $E$ and can be used for typing processes that consume messages from $u$ in different orders or with different priorities. The first ingredient for defining the notion of pattern normal form is that of pattern residual $\pderE\mathtt{M}$, which describes the content of a mailbox that initially contains a configuration of messages described by $E$ and from which we remove a single message with type $\mathtt{M}$: \begin{definition}[pattern residual] \label{def:der} The \emph{residual} of a pattern $E$ with respect to an atom $\mathtt{M}$, written $\pderE\mathtt{M}$, is inductively defined by the following equations: \[ \begin{array}{r@{~}c@{~}ll} \pder\mathbb{0}\mathtt{M} = \pder\mathbb{1}\mathtt{M} & \stackrel{\text{\tiny def}}= & \mathbb{0} \\ \pder{(E^{\ast})}\mathtt{M} & \stackrel{\text{\tiny def}}= & \pderE\mathtt{M} \cdot E^{\ast} \end{array} ~ \begin{array}{r@{~}c@{~}ll} \pder{\tmessage\Tag\seqof\TypeT}{\tmessage\Tag\seqof\TypeS} & \stackrel{\text{\tiny def}}= & \mathbb{1} & \text{if $\seqof\TypeT \leqslant \seqof\TypeS$} \\ \pder{\tmessage\Tag\seqof\TypeT}{\tmessage{\Tag'}\seqof\TypeS} & \stackrel{\text{\tiny def}}= & \mathbb{0} & \text{if $\Tag \ne \Tag'$} \end{array} ~ \begin{array}{r@{~}c@{~}ll} \pder{(E + F)}\mathtt{M} & \stackrel{\text{\tiny def}}= & \pderE\mathtt{M} + \pderF\mathtt{M} \\ \pder{(E \cdot F)}\mathtt{M} & \stackrel{\text{\tiny def}}= & \pderE\mathtt{M} \cdot F + E \cdot \pderF\mathtt{M} \end{array} \] \end{definition} If we take the pattern $E$ discussed earlier we have $\pderE\Tag[A] = \mathbb{1} \cdot \Tag[C] + \Tag[A] \cdot \mathbb{0} + \mathbb{0} \cdot \mathbb{1} + \Tag[B] \cdot \mathbb{1} \eqp \Tag[B] + \Tag[C]$. The pattern residual operator is closely related to Brzozowski's derivative in a commutative Kleene algebra~\cite{Brzozowski64,HopkinsKozen99}. Unlike Brzozowski's derivative, the pattern residual is a partial operator: $\pderE{\tmessage\Tag\seqof\TypeS}$ is defined provided that the $\seqof\TypeS$ are supertypes of all types $\seqof\TypeT$ found in $\Tag$-tagged atoms within $E$. This condition has a natural justification: when choosing the message to remove from a mailbox containing a configuration of messages described by $E$, only the tag $\Tag$ of the message -- and not the type of its arguments -- matters. Thus, $\seqof\TypeS$ faithfully describe the received arguments provided that they are supertypes of \emph{all} argument types of \emph{all} $\Tag$-tagged message types in $E$. For example, assuming $\mkkeyword{nat} \leqslant \mkkeyword{int}$, we have that $\pder{(\tmessage\Tag\mkkeyword{int} + \tmessage\Tag\mkkeyword{nat})}{\tmessage\Tag\mkkeyword{int}}$ is defined whereas $\pder{(\tmessage\Tag\mkkeyword{int} + \tmessage\Tag\mkkeyword{nat})}{\tmessage\Tag\mkkeyword{nat}}$ is not. We use the notion of pattern residual to define pattern normal forms: \begin{definition}[pattern normal form] \label{def:nf} We say that a pattern $E$ is in \emph{normal form}, written $\df{}E$, if $\dfE\Pattern$ is derivable by the following axioms and rules: \[ \dfE\mathbb{0} \qquad \dfE\mathbb{1} \qquad \inferrule{ F \eqp \pderE\mathtt{M} }{ \dfE{\mathtt{M}\tmulF} } \qquad \inferrule{ \df{E}{F_1} \\ \df{E}{F_2} }{ \dfE{F_1 + F_2} } \] \end{definition} Essentially, the judgment $\df{}E$ verifies that $E$ is expressed as a sum of $\mathbb{0}$, $\mathbb{1}$ and $\mathtt{M}\tmulF$ terms where $F$ is (equivalent to) the residual of $E$ with respect to $\mathtt{M}$. A guarded process yields all the dependencies between the mailbox $u$ being used and the names occurring free in the continuations, because the process will not be able to exercise the capabilities on these names until the message from $u$ has been received. \DiscussRule{Parallel composition} Rule~\refrule{t-par} deals with parallel compositions of the form $P_1 \mathbin\ttbar P_2$. This rule accounts for the fact that the same mailbox $u$ may be used in both $P_1$ and $P_2$ according to different types. For example, $P_1$ might store an $\Tag[A]$ message into $u$ and $P_2$ might store a $\Tag[B]$ message into $u$. In the type environment for the parallel composition as a whole we must be able to express with a single type the combined usages of $u$ in $P_1$ and $P_2$. This is accomplished by introducing an operator that combines types: \begin{definition}[type combination] \label{def:type_combination} We write $\tau \mathbin{\|} \sigma$ for the \emph{combination} of $\tau$ and $\sigma$, where $\mathbin{\|}$ is the partial symmetric operator defined as follows: \[ \ttemarkE \mathbin{\|} \ttemarkF \stackrel{\text{\tiny def}}= \ttemark\parens{E \cdot F} \qquad \ttemarkE \mathbin{\|} \ttqmark\parens{E \cdot F} \stackrel{\text{\tiny def}}= \ttqmarkF \qquad \ttqmark\parens{E \cdot F} \mathbin{\|} \ttemarkE \stackrel{\text{\tiny def}}= \ttqmarkF \] \end{definition} Continuing the previous example, we have $\ttemark\Tag[A] \mathbin{\|} \ttemark\Tag[B] = \ttemark(\Tag[A] \cdot \Tag[B])$ because storing one $\Tag[A]$ message and one $\Tag[B]$ message in $u$ means storing an overall configuration of messages described by the pattern $\Tag[A] \cdot \Tag[B]$. When $u$ is used for both input and output operations, the combined type of $u$ describes the overall balance of the mailbox. For example, we have $\ttemark\Tag[A] \mathbin{\|} \ttqmark(\Tag[A] \cdot \Tag[B]) = \ttqmark\Tag[B]$: if we combine a process that stores an $\Tag[A]$ message into $u$ with another process that consumes both an $\Tag[A]$ message and a $\Tag[B]$ message from the same mailbox in some unspecified order, then we end up with a process that consumes a $\Tag[B]$ message from $u$. Notice that $\mathbin{\|}$ is a partial operator in that not all type combinations are defined. It might be tempting to relax $\mathbin{\|}$ in such a way that $\ttemark(\Tag[A] \cdot \Tag[B]) \mathbin{\|} \ttqmark\Tag[A] = \ttemark\Tag[B]$, so as to represent the fact that the combination of two processes results in an excess of messages that must be consumed by some other process. However, this would mean allowing different processes to consume messages from the same mailbox, which is not safe in general (see Example~\ref{ex:linear_input}). For the same reason, the combination of $\ttqmarkE$ and $\ttqmarkF$ is always undefined regardless of $E$ and $F$. Operators akin to $\mathbin{\|}$ for the combination of channel types are commonly found in substructural type systems for the (linear) $\pi$-calculus~\cite{SangiorgiWalker01,Padovani14B}. Unlike these systems, in our case the combination concerns also the content of a mailbox in addition to the capabilities for accessing it. \begin{example} \label{ex:linear_input} Suppose that we extend the type combination operator so that $\ttqmark\parens{E \cdot F} = \ttqmarkE \mathbin{\|} \ttqmarkF$. To see why this extension would be dangerous, consider the process \[ \begin{array}{l} \bigparens{ \Sendu\Tag[A]\mkconstant{True} \mathbin\ttbar \Receiveu\Tag[A]\Var[x] \parens{ \Send\mathit{system}\Tag[print\ttunderscore bool]\Var[x] \mathbin\ttbar \Freeu \mkkeyword{done} } } \mathbin\ttbar {} \\ \bigparens{ \Sendu\Tag[A]{\mkint2} \mathbin\ttbar \Receiveu\Tag[A]\Var[y] \parens{ \Send\mathit{system}\Tag[print\ttunderscore int]\Var[y] \mathbin\ttbar \Freeu \mkkeyword{done} } } \end{array} \] Overall, this process stores into $u$ a combination of messages that matches the pattern $\tmessage\Tag[A]\mkkeyword{bool} \cdot \tmessage\Tag[A]\mkkeyword{int}$ and retrieves from $u$ the same combination of messages. Apparently, $u$ is used in a balanced way. % However, there is no guarantee that the $\Sendu\Tag[A]\mkconstant{True}$ message is received by the process at the top and that the $\Sendu\Tag[A]{\mkint2}$ message is received by the process at the bottom. In fact, the converse may happen because only the tag of a message -- not the type or value of its arguments -- is used for matching messages in the mailbox calculus. % \hfill$\blacksquare$ \end{example} We now extend type combination to type environments in the expected way: \begin{definition}[type environment combination] \label{def:cmul} We write $\Gamma \mathbin{\|} \Delta$ for the \emph{combination} of $\Gamma$ and $\Delta$, where $\mathbin{\|}$ is the partial operator inductively defined by the equations: \[ \Gamma \mathbin{\|} \emptyset \stackrel{\text{\tiny def}}= \Gamma \qquad \emptyset \mathbin{\|} \Gamma \stackrel{\text{\tiny def}}= \Gamma \qquad (u : \tau, \Gamma) \mathbin{\|} (u : \sigma, \Delta) \stackrel{\text{\tiny def}}= u : \tau \mathbin{\|} \sigma, (\Gamma \mathbin{\|} \Delta) \] \end{definition} With this machinery in place, rule~\refrule{t-par} is straightforward to understand and the dependency graph of $P_1 \mathbin\ttbar P_2$ is simply the union of the dependency graphs of $P_1$ and $P_2$. \DiscussRule{Mailbox restriction} Rule~\refrule{t-new} establishes that the process creating a new mailbox $a$ with scope $P$ is well typed provided that the type of $a$ is $\ttqmark\mathbb{1}$. This means that every message stored in the mailbox $a$ by (a sub-process of) $P$ is also consumed by (a sub-process of) $P$. The dependency graph of the process is the same as that of $P$, except that $a$ is restricted. \DiscussRule{Subsumption} As we have anticipated earlier in a few occasions, the subsumption rule \refrule{t-sub} allows us to rewrite types in the type environment and to introduce associations for irrelevant names. The rule makes use of the following notion of subtyping for type environments: \begin{definition}[subtyping for type environments] We say that $\Gamma$ is a \emph{subtype environment} of $\Delta$ if $\Gamma \leqslant \Delta$, where $\leqslant$ is the least preorder on type environments such that: \[ \inferrule{ \mathstrut }{ u : \ttemark\mathbb{1}, \Gamma \leqslant \Gamma } \qquad \inferrule{ \tau \leqslant \sigma }{ u : \tau, \Gamma \leqslant u : \sigma, \Gamma } \] \end{definition} Intuitively, $\Gamma \leqslant \Delta$ means that $\Gamma$ provides more capabilities than $\Delta$. For example, $u : \ttemark(\Tag[A] + \Tag[B]), v : \ttemark\mathbb{1} \leqslant u : \ttemark\Tag[A]$ since a process that is well typed in the environment $u : \ttemark\Tag[A]$ stores an $\Tag[A]$ message into $u$, which is also a valid behavior in the environment $u : \ttemark(\Tag[A] + \Tag[B]), v : \ttemark\mathbb{1}$ where $u$ has more capabilities (it is also possible to store a $\Tag[B]$ message into $u$) and there is an irrelevant name $v$ not used by the process. { Rule~\refrule{t-sub} also allows us to replace the dependency graph yielded by $P$ with another one that generates a superset of dependencies. In general, the dependency graph should be kept as small as possible to minimize the possibility of yielding mutual dependencies (see \refrule{t-par}). The replacement allowed by \refrule{t-sub} is handy for technical reasons, but not necessary. The point is that the residual of a process typically yields fewer dependencies than the process itself, so we use \refrule{t-sub} to enforce the invariance of dependency graphs across reductions. } \begin{example} \label{ex:lock_derivation} We show the full typing derivation for $\RecVar[FreeLock]$ and $\RecVar[BusyLock]$ defined in Example~\ref{ex:lock}. Our objective is to show the consistency of the global process declarations \[ \RecVar[FreeLock] : (\Var[self] : \tau; \emptyset) \qquad \RecVar[BusyLock] : (\Var[self] : \tau, \Var[owner] : \rho; \gedge\Var[self]\Var[owner]) \] where $\tau \stackrel{\text{\tiny def}}= \ttqmark\tmessage\Tag[acquire]\rho^{\ast}$ and $\rho \stackrel{\text{\tiny def}}= \ttemark{\tmessage\Tag[reply]{\ttemark\Tag[release]}}$. In the derivation trees below we rename $\Var[self]$ as $\Var[x]$ and $\Var[owner]$ and $\Var[y]$ to resonably fit the derivations within the page limits. We start from the body of $\RecVar[BusyLock]$, which is simpler, and obtain \[ \begin{prooftree} \[ \justifies \wtp{ \Var[x] : \ttemark\Tag[release], \Var[y] : \rho }{ \Send\Var[y]\Tag[reply]\Var[x] }{ \gedge\Var[y]\Var[x] } \using\refrule{t-msg} \] \[ \[ \[ \justifies \wtp{ \Var[x] : \tau }{ \invoke\RecVar[FreeLock]\Var[x] }{ \emptyset } \using\refrule{t-def} \] \justifies \wtg{ \Var[x] : \sigma }{ \Receive\Var[x]\Tag[release]{} \invoke\RecVar[FreeLock]\Var[x] } \using\refrule{t-in} \] \justifies \wtp{ \Var[x] : \sigma }{ \Receive\Var[x]\Tag[release]{} \invoke\RecVar[FreeLock]\Var[x] }{ \emptyset } \using\refrule{t-guard} \] \justifies \wtp{ \Var[x] : \tau, \Var[y] : \rho }{ \Send\Var[y]\Tag[reply]\Var[x] \mathbin\ttbar \Receive\Var[x]\Tag[release]{} \invoke\RecVar[Lock]\Var[x] }{ \gedge\Var[y]\Var[x] \sqcup \emptyset } \using\refrule{t-par} \end{prooftree} \] where $\sigma \stackrel{\text{\tiny def}}= \ttqmark{(\Tag[release] \cdot \tmessage\Tag[acquire]\rho^{\ast})}$. Concerning $\RecVar[FreeLock]$, the key step is rewriting the pattern of $\tau$ in a normal form that matches the branching structure of the process. To this aim, we use the property $E^{\ast} \eqp \mathbb{1} + E \cdot E^{\ast}$ and the fact that $\mathbb{0}$ is absorbing for the product connective: \[ \begin{prooftree} \[ \[ \qquad\qquad \vdots \qquad\qquad \[ \[ \[ \justifies \wtg{ \Var[x] : \ttqmark\mathbb{0} }{ \Fail\Var[x] } \using\refrule{t-fail} \] \justifies \wtp{ \Var[x] : \ttqmark\mathbb{0} }{ \Fail\Var[x] }{ \emptyset } \using\refrule{t-guard} \] \using\refrule{t-guard} \justifies \wtg{ \Var[x] : \ttqmark(\Tag[release]\cdot\mathbb{0}) }{ \Receive\Var[x]\Tag[release]{} \Fail\Var[x] } \using\refrule{t-in} \] \justifies \wtg{ \Var[x] : \ttqmark\parens{ \mathbb{1} + \tmessage\Tag[acquire]\rho \cdot \tmessage\Tag[acquire]\rho^{\ast} + \Tag[release] \cdot \mathbb{0} } }{ {} \cdots + \Receive\Var[x]\Tag[release]{} \Fail\Var[x] } \using\refrule{t-branch} \] \justifies \wtp{ \Var[x] : \ttqmark\parens{ \mathbb{1} + \tmessage\Tag[acquire]\rho \cdot \tmessage\Tag[acquire]\rho^{\ast} + \Tag[release] \cdot \mathbb{0} } }{ {} \cdots + \Receive\Var[x]\Tag[release]{} \Fail\Var[x] }{ \emptyset } \using\refrule{t-guard} \] \justifies \wtp{ \Var[x] : \tau }{ \Free\Var[x]\mkkeyword{done} + \cdots + \Receive\Var[x]\Tag[release]{} \Fail\Var[x] }{ \emptyset } \using\refrule{t-sub} \end{prooftree} \] The elided sub-derivation concerns the first two branches of $\RecVar[FreeLock]$ and is as follows: \[ \begin{prooftree} \[ \[ \justifies \wtp{ \emptyset }{ \mkkeyword{done} }{ \emptyset } \using\refrule{t-done} \] \justifies \wtg{ \Var[x] : \ttqmark\mathbb{1} }{ \Free\Var[x]\mkkeyword{done} } \using\refrule{t-free} \] \[ \[ \justifies \wtp{ \Var[x] : \tau, \Var[y] : \rho }{ \invoke\RecVar[BusyLock]{\Var[x],\Var[y]} }{ \gedge\Var[x]\Var[y] } \using\refrule{t-def} \] \justifies \wtg{ \Var[x] : \ttqmark\tmessage\Tag[acquire]\rho \cdot \tmessage\Tag[acquire]\rho^{\ast} }{ \Receive\Var[x]\Tag[acquire]\Var[y] \invoke\RecVar[BusyLock]{\Var[x],\Var[y]} } \using\refrule{t-in} \] \justifies \wtg{ \Var[x] : \ttqmark\parens{ \mathbb{1} + \tmessage\Tag[acquire]\rho \cdot \tmessage\Tag[acquire]\rho^{\ast} } }{ \Free\Var[x]\mkkeyword{done} + \Receive\Var[x]\Tag[acquire]\Var[y] \invoke\RecVar[BusyLock]{\Var[x],\Var[y]} } \using\refrule{t-branch} \end{prooftree} \] The process~\eqref{eq:alice_carol}, combining an instance of the lock and the users $\Var[alice]$ and $\Var[carol]$, is also well typed. As we will see at the end of Section~\ref{sec:properties}, this implies that both $\Var[alice]$ and $\Var[carol]$ are able to acquire the lock, albeit in some unspecified order. % \hfill$\blacksquare$ \end{example} \begin{example} \label{ex:future_deadlock} In this example we show that the process~\eqref{eq:future_deadlock} of Example~\ref{ex:future} is ill typed. In order to do so, we assume the global process declaration \[ \RecVar[Future] : (\Var[self] : \ttqmark(\tmessage\Tag[put]\mkkeyword{int} \cdot \tmessage\Tag[get]{\ttemark\tmessage\Tag[reply]\mkkeyword{int}}^{\ast}); \emptyset) \] which can be shown to be consistent with the given definition for $\RecVar[Future]$. % In the derivation below we use the pattern $F \stackrel{\text{\tiny def}}= \tmessage\Tag[put]\mkkeyword{int} \cdot \tmessage\Tag[get]\rho^{\ast}$ and the types $\tau \stackrel{\text{\tiny def}}= \ttemark\tmessage\Tag[put]\mkkeyword{int}$, $\sigma \stackrel{\text{\tiny def}}= \ttqmark\parens{\tmessage\Tag[reply]\mkkeyword{int} \cdot \mathbb{1}}$ and $\rho \stackrel{\text{\tiny def}}= \ttemark\tmessage\Tag[reply]\mkkeyword{int}$: \[ \begin{prooftree} \[ \[ \[ \justifies \wtp{ \Var[f] : \ttemark\tmessage\Tag[get]\rho, c : \rho }{ \Send\Var[f]\TagGetc }{ \gedge\VarFuturec } \using\refrule{t-msg} \] \[ \[ \[ \[ \[ \justifies \wtp{ \Var[f] : \tau, \Var : \mkkeyword{int} }{ \Send\Var[f]\Tag[put]\Var }{ \emptyset } \using\refrule{t-msg} \] \justifies \wtg{ \Var[f] : \tau, c : \ttqmark\mathbb{1}, \Var : \mkkeyword{int} }{ \Freec \Send\Var[f]\Tag[put]\Var } \using\refrule{t-free} \] \justifies \wtp{ \Var[f] : \tau, c : \ttqmark\mathbb{1}, \Var : \mkkeyword{int} }{ \Freec \Send\Var[f]\Tag[put]\Var }{ \gedgec\Var[f] } \using\refrule{t-guard} \] \justifies \wtg{ \Var[f] : \tau, c : \sigma }{ \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var } \using\refrule{t-in} \] \justifies \wtp{ \Var[f] : \tau, c : \sigma }{ \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var }{ \gedgec\Var[f] } \using\refrule{t-guard} \] \justifies \wtp{ \Var[f] : \ttemark\parens{ \tmessage\Tag[get]\rho \cdot \tmessage\Tag[put]\mkkeyword{int} }, c : \ttqmark\mathbb{1} }{ \Send\Var[f]\TagGetc \mathbin\ttbar \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var }{ {-} } \using\refrule{t-par} \] \justifies \wtp{ \Var[f] : \ttemarkF, c : \ttqmark\mathbb{1} }{ \Send\Var[f]\TagGetc \mathbin\ttbar \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var }{ {-} } \using\refrule{t-sub} \] \justifies \wtp{ \Var[f] : \ttemarkF }{ \Newc\parens{ \Send\Var[f]\TagGetc \mathbin\ttbar \Receivec\Tag[reply]\Var \Freec \Send\Var[f]\Tag[put]\Var } }{ {-} } \using\refrule{t-new} \end{prooftree} \] In attempting this derivation we have implicitly extended the typing rules so that names with type $\mkkeyword{int}$ do not contribute in generating any significant dependency. The critical point of the derivation is the application of \refrule{t-par}, where we are composing two parallel processes that yield a circular dependency between $c$ and $\Var[f]$. In the process on the left hand side, the dependency $\gedge\VarFuturec$ arises because $c$ is sent as a reference in a message targeted to $\Var[f]$. In the process on the right hand side, the dependency $\gedgec\Var[f]$ arises because there are guards concerning the mailbox $c$ that block an output operation on the mailbox $\Var[f]$. % \hfill$\blacksquare$ \end{example} \begin{example}[non-deterministic choice] \label{ex:choice} Different input actions in the same guard can match messages with the same tag. This feature can be used to encode in the mailbox calculus the non-deterministic choice between $P_1$ and $P_2$ as the process \begin{equation} \label{eq:choice} \Newa\parens{ \Senda\Tag{} \mathbin\ttbar \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 } \end{equation} provided that $\wtp\Gamma{P_i}{\varphi_i}$ for $i=1,2$. That is, $P_1$ and $P_2$ must be well typed in the same type environment. Below is the typing derivation for \eqref{eq:choice} \[ \begin{prooftree} \[ \[ \justifies \wtp{ a : \ttemark\Tag }{ \Senda\Tag{} }{ \emptyset } \using\refrule{t-msg} \] \[ \[ \[ \[ \[ \[ \wtp\Gamma{ P_i }{ \varphi_i } \justifies \wtg{ \Gamma, a : \ttqmark\mathbb{1} }{ \Freea P_i } \using\refrule{t-free} \] \justifies \wtp{ \Gamma, a : \ttqmark\mathbb{1} }{ \Freea P_i }{ \varphi } \using\refrule{t-guard} \] \justifies \wtg{ \Gamma, a : \ttqmark(\Tag \cdot \mathbb{1}) }{ \Receivea\Tag{} \Freea P_i } \using\refrule{t-in}, i=1,2 \] \justifies \wtg{ \Gamma, a : \ttqmark(\Tag \cdot \mathbb{1} + \Tag \cdot \mathbb{1}) }{ \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 } \using\refrule{t-branch} \] \justifies \wtp{ \Gamma, a : \ttqmark(\Tag \cdot \mathbb{1} + \Tag \cdot \mathbb{1}) }{ \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 }{ \varphi } \using\refrule{t-guard} \] \justifies \wtp{ \Gamma, a : \ttqmark(\Tag \cdot \mathbb{1}) }{ \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 }{ \varphi } \using\refrule{t-sub} \] \justifies \wtp{ \Gamma, a : \ttqmark\mathbb{1} }{ \Senda\Tag{} \mathbin\ttbar \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 }{ \varphi } \using\refrule{t-par} \] \justifies \wtp\Gamma{ \Newa\parens{ \Senda\Tag{} \mathbin\ttbar \Receivea\Tag{} \Freea P_1 + \Receivea\Tag{} \Freea P_2 } }{ \Newa\varphi } \using\refrule{t-new} \end{prooftree} \] where $\varphi \stackrel{\text{\tiny def}}= \gedgea{\mathsf{dom}(\Gamma)}$. The key step is the application of \refrule{t-sub}, which exploits the idempotency of $+$ (in patterns) to rewrite $\Tag \cdot \mathbb{1}$ as the equivalent pattern $\Tag \cdot \mathbb{1} + \Tag \cdot \mathbb{1}$. % \hfill$\blacksquare$ \end{example} \subsection{Mailbox Types} \label{sec:types} \begin{table} \begin{center} \[ \begin{array}{rrcll} \textbf{Type} & \tau, \sigma & ::= & \ttqmarkE & \text{(input)} \\ & & | & \ttemarkE & \text{(output)} \\\\ \textbf{Pattern} & E, F & ::= & \mathbb{0} & \text{(unreliable mailbox)} \\ & & | & \mathbb{1} & \text{(empty mailbox)} \\ & & | & \tmessage\Tag\seqof\Type & \text{(atom)} \\ & & | & E + F & \text{(sum)} \\ & & | & E \cdot F & \text{(product)} \\ & & | & E^{\ast} & \text{(exponential)} \end{array} \] \end{center} \caption{\label{tab:types} Syntax of mailbox types and patterns.} \end{table} The syntax of mailbox types and patterns is shown in Table~\ref{tab:types}. Patterns are \emph{commutative regular expressions}~\cite{Conway71} describing the configurations of messages stored in a mailbox. An atom $\tmessage\Tag\seqof\Type$ describes a mailbox containing a single message with tag $\Tag$ and arguments of type $\seqof\Type$. We let $\mathtt{M}$ range over atoms and abbreviate $\tmessage\Tag\seqof\Type$ with $\Tag$ when $\seqof\Type$ is the empty sequence. Compound patterns are built using sum ($E + F$), product ($E \cdot F$) and exponential ($E^{\ast}$). The constants $\mathbb{1}$ and $\mathbb{0}$ respectively describe the empty and the unreliable mailbox. There is no configuration of messages stored in an unreliable mailbox, not even the empty one. We will use the $\mathbb{0}$ pattern for describing mailboxes from which an unexpected message has been received. Let us look at a few simple examples. The pattern $\Tag[A] + \Tag[B]$ describes a mailbox that contains either an $\Tag[A]$ message or a $\Tag[B]$ message, but not both, whereas the pattern $\Tag[A] + \mathbb{1}$ describes a mailbox that either contains a $\Tag[A]$ message or is empty. The pattern $\Tag[A] \cdot \Tag[B]$ describes a mailbox that contains both an $\Tag[A]$ message and also a $\Tag[B]$ message. Note that $\Tag[A]$ and $\Tag[B]$ may be equal, in which case the mailbox contains \emph{two} $\Tag[A]$ messages. Finally, the pattern $\Tag[A]^{\ast}$ describes a mailbox that contains an arbitrary number (possibly zero) of $\Tag[A]$ messages. A \emph{mailbox type} consists of a \emph{capability} (either $\ttqmark$ or $\ttemark$) paired with a pattern. The capability specifies whether the pattern describes messages to be received from ($\ttqmark$) or stored in ($\ttemark$) the mailbox. Here are some examples: A process using a mailbox of type $\ttemark\Tag[A]$ \emph{must} store an $\Tag[A]$ message into the mailbox, whereas a process using a mailbox of type $\ttqmark\Tag[A]$ is guaranteed to receive an $\Tag[A]$ message from the mailbox. A process using a mailbox of type $\ttemark(\Tag[A] + \mathbb{1})$ \emph{may} store an $\Tag[A]$ message into the mailbox, but is not obliged to do so. A process using a mailbox of type $\ttemark\parens{\Tag[A] + \Tag[B]}$ decides whether to store an $\Tag[A]$ message or a $\Tag[B]$ message in the mailbox, whereas a process using a mailbox of type $\ttqmark\parens{\Tag[A] + \Tag[B]}$ must be ready to receive both kinds of messages. A process using a mailbox of type $\ttqmark\parens{\Tag[A] \cdot \Tag[B]}$ is guaranteed to receive both an $\Tag[A]$ message and a $\Tag[B]$ message and may decide in which order to do so. A process using a mailbox of type $\ttemark\parens{\Tag[A] \cdot \Tag[B]}$ must store both $\Tag[A]$ and $\Tag[B]$ into the mailbox. A process using a mailbox of type $\ttemark{\Tag[A]^{\ast}}$ decides how many $\Tag[A]$ messages to store in the mailbox, whereas a process using a mailbox of type $\ttqmark{\Tag[A]^{\ast}}$ must be prepared to receive an arbitrary number of $\Tag[A]$ messages. To cope with possibly infinite types we interpret the productions in Table~\ref{tab:types} coinductively and consider as types the regular trees~\cite{Courcelle83} built using those productions. We require every infinite branch of a type tree to go through infinitely many atoms. This strengthened contractiveness condition allows us to define functions inductively on the structure of patterns, provided that these functions do not recur into argument types (\emph{cf.}\xspace Definitions~\ref{def:subp} and~\ref{def:der}). The semantics of patterns is given in terms of sets of multisets of atoms. Because patterns include types, the given semantics is parametric in the subtyping relation, which will be defined next: \begin{definition}[subpattern] \label{def:subp} The \emph{configurations} of $E$ are inductively defined by the following equations, where $\mathsf{A}$ and $\mathsf{B}$ range over multisets $\bag{\seqof\mathtt{M}}$ of atoms and $\uplus$ denotes multiset union: \[ \begin{array}[c]{@{}r@{~}c@{~}l@{}} \sem\mathbb{0} & \stackrel{\text{\tiny def}}= & \emptyset \\ \sem\mathbb{1} & \stackrel{\text{\tiny def}}= & \set{\bag{}} \end{array} \qquad \begin{array}[c]{@{}r@{~}c@{~}l@{}} \sem{E + F} & \stackrel{\text{\tiny def}}= & \semE \cup \semF \\ \sem{E \cdot F} & \stackrel{\text{\tiny def}}= & \set{ \mathsf{A} \uplus \mathsf{B} \mid \mathsf{A} \in \semE, \mathsf{B} \in \semF } \end{array} \qquad \begin{array}[c]{@{}r@{~}c@{~}l@{}} \sem\mathtt{M} & \stackrel{\text{\tiny def}}= & \set{\bag\mathtt{M}} \\ \sem{E^{\ast}} & \stackrel{\text{\tiny def}}= & \sem\mathbb{1} \cup \semE \cup \sem{E\tmulE} \cup \cdots \end{array} \] Given a preorder relation $\mathrel{\mathcal{R}}$ on types, we write $E \subp[\mathrel{\mathcal{R}}] F$ if $\bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeT_i}} \in \semE$ implies $\bag[i\in I]{\tmessage{\Tag_i}{\seqof\TypeS_i}} \in \semF$ and $\seqof\TypeT_i \mathrel{\mathcal{R}} \seqof\TypeS_i$ for every $i\in I$. % We write $\eqp[\mathrel{\mathcal{R}}]$ for ${\subp[\mathrel{\mathcal{R}}]} \cap {\supp[\mathrel{\mathcal{R}}]}$. \end{definition} For example, $\sem{\Tag[A] + \Tag[B]} = \set{ \bag\Tag[A], \bag\Tag[B] }$ and $\sem{\Tag[A] \cdot \Tag[B]} = \set{ \bag{\Tag[A], \Tag[B]} }$. It is easy to see that $\subp[\mathrel{\mathcal{R}}]$ is a pre-congruence with respect to all the connectives and that it includes all the known laws of commutative Kleene algebra~\cite{Conway71}: both $+$ and $\cdot$ are commutative and associative, $+$ is idempotent and has unit $\mathbb{0}$, $\cdot$ distributes over $+$, it has unit $\mathbb{1}$ and is absorbed by $\mathbb{0}$. Also observe that $\subp[\mathrel{\mathcal{R}}]$ is related covariantly to $\mathrel{\mathcal{R}}$, that is $\seqof\TypeT \mathrel{\mathcal{R}} \seqof\TypeS$ implies $\tmessage\Tag\seqof\TypeT \subp[\mathrel{\mathcal{R}}] \tmessage\Tag\seqof\TypeS$. We now define subtyping. As types may be infinite, we resort to coinduction: \begin{definition}[subtyping] \label{def:subt} We say that $\mathrel{\mathcal{R}}$ is a \emph{subtyping relation} if $\tau \mathrel{\mathcal{R}} \sigma$ implies either \begin{enumerate} \item\label{subt:input} $\tau = \ttqmarkE$ and $\sigma = \ttqmarkF$ and $E \subp[\mathrel{\mathcal{R}}] F$, or \item\label{subt:output} $\tau = \ttemarkE$ and $\sigma = \ttemarkF$ and $F \subp[\mathrel{\mathcal{R}}] E$. \end{enumerate} % We write $\leqslant$ for the largest subtyping relation and say that $\tau$ is a \emph{subtype} of $\sigma$ (and $\sigma$ a \emph{supertype} of $\tau$) if $\tau \leqslant \sigma$. % We write $\lessgtr$ for ${\leqslant} \cap {\geqslant}$, $\subp$ for $\subp[\leqslant]$ and $\eqp$ for $\eqp[\leqslant]$. \end{definition} Items~\ref{subt:input} and~\ref{subt:output} respectively correspond to the usual covariant and contravariant rules for channel types with input and output capabilities~\cite{PierceSangiorgi96}. For example, $\ttemark\parens{\Tag[A] + \Tag[B]} \leqslant \ttemark\Tag[A]$ because a mailbox of type $\ttemark\parens{\Tag[A] + \Tag[B]}$ is more permissive than a mailbox of type $\ttemark\Tag[A]$. Dually, $\ttqmark\Tag[A] \leqslant \ttqmark\parens{\Tag[A] + \Tag[B]}$ because a mailbox of type $\ttqmark\Tag[A]$ provides stronger guarantees than a mailbox of type $\ttqmark\parens{\Tag[A] + \Tag[B]}$. Note that $\ttemark\parens{\Tag[A] \cdot \Tag[B]} \lessgtr \ttemark\parens{\Tag[B] \cdot \Tag[A]}$ and $\ttqmark\parens{\Tag[A] \cdot \Tag[B]} \lessgtr \ttqmark\parens{\Tag[B] \cdot \Tag[A]}$, to witness the fact that the order in which messages are stored in a mailbox is irrelevant. Mailbox types whose patterns are in particular relations with the constants $\mathbb{0}$ and $\mathbb{1}$ will play special roles, so we introduce some corresponding terminology. \begin{definition}[type and name classification] \label{def:classification} We say that (a name whose type is) $\tau$ is: \begin{itemize} \item \emph{relevant} if $\tau \not\leqslant \ttemark\mathbb{1}$ and \emph{irrelevant} otherwise; \item \emph{reliable} if $\tau \not\leqslant \ttqmark\mathbb{0}$ and \emph{unreliable} otherwise; \item \emph{usable} if $\ttemark\mathbb{0} \not\leqslant \tau$ and \emph{unusable} otherwise. \end{itemize} \end{definition} A relevant name \emph{must} be used, whereas an irrelevant name may be discarded because not storing any message in the mailbox it refers to is allowed by its type. All mailbox types with input capability are relevant. A reliable mailbox is one from which no unexpected message has been received. All names with output capability are reliable. A usable name \emph{can} be used, in the sense that there exists a construct of the mailbox calculus that expects a name with that type. All mailbox types with input capability are usable, but $\ttqmark(\Tag[A] \cdot \mathbb{0})$ is unreliable. Both $\ttemark\Tag[A]$ and $\ttemark\parens{\mathbb{1} + \Tag[A]}$ are usable. The former type is also relevant because a process using a mailbox with this type must (eventually) store an $\Tag[A]$ message in it. On the contrary, the latter type is irrelevant, since not using the mailbox is a legal way of using it. \begin{center} \fbox{ \parbox{0.95\textwidth}{% \textit{Henceforth we assume that all types are usable and that all argument types are also reliable. That is, we ban all types like $\ttemark\mathbb{0}$ or $\ttemark(\mathbb{0}\cdot\Tag)$ and all types like $\ttqmark\tmessage\Tag{\ttqmark\mathbb{0}}$ or $\ttemark\tmessage\Tag{\ttqmark\mathbb{0}}$. Example~\ref{ex:global_assumptions} in Appendix~\ref{sec:prop_subtyping} discusses the technical motivation for these assumptions.} } } \end{center} \begin{example}[lock type] \label{ex:lock_type} The mailbox used by the lock (Example~\ref{ex:lock}) will have several different types, depending on the viewpoint we take (either the lock itself or one of its users) and on the state of the lock (whether it is free or busy). % As we can see from the definition of $\RecVar[FreeLock]$, a free lock waits for an $\Tag[acquire]$ message which is supposed to carry a reference to another mailbox into which the capability to release the lock is stored. Since the lock is meant to have several concurrent users, it is not possible in general to predict the number of $\Tag[acquire]$ messages in its mailbox. Therefore, the mailbox of a free lock has type \[ \ttqmark\tmessage\Tag[acquire]{\ttemark\tmessage\Tag[reply]{\ttemark\Tag[release]}}^{\ast} \] from the viewpoint of the lock itself. When the lock is busy, it expects to find one $\Tag[release]$ message in its mailbox, but in general the mailbox will also contain $\Tag[acquire]$ messages corresponding to pending acquisition requests. So, the mailbox of a busy lock has type \[ \ttqmark\parens{\Tag[release]\cdot\tmessage\Tag[acquire]{\ttemark\tmessage\Tag[reply]{\ttemark\Tag[release]}}^{\ast}} \] indicating that the mailbox contains (or will eventually contain) a single $\Tag[release]$ message along with arbitrarily many $\Tag[acquire]$ messages. Prospective owners of the lock may have references to the lock's mailbox with type $\ttemark\tmessage\Tag[acquire]{\ttemark\tmessage\Tag[reply]{\ttemark\Tag[release]}}$ or $\ttemark\tmessage\Tag[acquire]{\ttemark\tmessage\Tag[reply]{\ttemark\Tag[release]}}^{\ast}$ depending on whether they acquire the lock exactly once (just like $\Var[alice]$ and $\Var[carol]$ in Example~\ref{ex:lock}) or several times. Other intermediate types are possible in the case of users that acquire the lock a bounded number of times. % The current owner of the lock will have a reference to the lock's mailbox of type $\ttemark\Tag[release]$. This type is relevant, implying that the owner must eventually release the lock. % \hfill$\blacksquare$ \end{example} \section{A Mailbox Type System} \label{sec:type_system} In this section we detail the type system for the mailbox calculus. We start from the syntax and semantics of mailbox types (Section~\ref{sec:types}) and of dependency graphs (Section~\ref{sec:graphs}), the mechanism we use to track mailbox dependencies. Then we present the typing rules (Section~\ref{sec:rules}) and the properties of well-typed processes (Section~\ref{sec:properties}). \input{types} \input{graphs} \input{rules} \input{properties}